summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/schulmathematik/schulma-physik.sty
blob: 4191a4808419798b0732263897730b8e7f3751a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
% schulmathematik bundle: package schulma-physik
% Version 1.0
% 16. Februar 2020
\RequirePackage{xparse}
\ProvidesExplPackage {schulma-physik} {2020-02-16} {1.0} {Befehle für die Schulphysik}

\RequirePackage [locale=DE] {siunitx}
\RequirePackage {tikz}

\NewDocumentCommand \Massstab {m m m m}
  {
    \ensuremath
      {
        \SI {#1} {#2}
        \; \widehat {=} \;
        \SI {#3} {#4}
      }
  }

\NewDocumentCommand \tSI {m m}
  {
    \ensuremath
      {  
        \group_begin:
        \textstyle
        \SI [ per-mode = fraction ] {#1} {#2}
        \group_end:
      }
  }

\NewDocumentCommand \tsi {m}
  {
    \ensuremath
      {  
        \group_begin:
        \textstyle
        \si [ per-mode = fraction ] {#1}
        \group_end:
      }
  }

\NewDocumentCommand \Beschl {m}
  {
    \tSI{#1}{\m\per\square\s}
  }

\NewDocumentCommand \Erdb { }
  {
    \tSI{9,81}{\m\per\square\s}
  }

\NewDocumentCommand \Ortsf { }
  {
    \tSI{9,81}{\N\per\kg}
  }

\NewDocumentCommand \Elem { }
  {
    \SI{1,60e-19}{\coulomb}
  }

\NewDocumentCommand \Elekm { }
  {
    \SI{9,11e-31}{\kg}
  }

\NewDocumentCommand \Lichtg { }
  {
    \SI{3,00e8}{\m\per\s}
  }

\NewDocumentCommand \Planck { }
  {
    \SI{6,63e-34}{\J.\s}
  }

\ExplSyntaxOff

\usetikzlibrary{circuits.ee.IEC}

\pgfdeclareshape{doppelbuchse}
  {%
    \inheritsavedanchors[from=rectangle ee]%
    \inheritanchor[from=rectangle ee]{center}%
    \inheritanchor[from=rectangle ee]{north}%
    \inheritanchor[from=rectangle ee]{south}%
    \inheritanchor[from=rectangle ee]{east}%
    \inheritanchor[from=rectangle ee]{west}%
    \inheritanchor[from=rectangle ee]{north east}%
    \inheritanchor[from=rectangle ee]{north west}%
    \inheritanchor[from=rectangle ee]{south east}%
    \inheritanchor[from=rectangle ee]{south west}%
    \inheritanchor[from=rectangle ee]{input}%
    \inheritanchor[from=rectangle ee]{output}%
    \inheritanchorborder[from=rectangle ee]%
    \backgroundpath{
      \pgf@process{\pgfpointadd{\southwest}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}%
      \pgf@xa=\pgf@x \pgf@ya=\pgf@y
      \pgf@process{\pgfpointadd{\northeast}{\pgfpointscale{-1}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}}%
      \pgf@xb=\pgf@x \pgf@yb=\pgf@y
      \pgfutil@tempdima=\pgf@yb%
      \advance\pgfutil@tempdima by -\pgf@ya%
      \pgfutil@tempdima=0.5\pgfutil@tempdima%
      \advance\pgf@xa by \pgfutil@tempdima%
      \advance\pgf@xb by -\pgfutil@tempdima%
      {\pgfpathcircle{\pgfqpoint{\pgf@xa}{0pt}}{\pgfutil@tempdima}}
      {\pgfpathcircle{\pgfqpoint{\pgf@xb}{0pt}}{\pgfutil@tempdima}}
    }%
  }

\tikzset
  {
    bulb IEC graphic/.style=
      {
        circuit symbol lines,
        circuit symbol size=width 1.9 height 1.9,
        shape=generic circle IEC,
        /pgf/generic circle IEC/before background=
          {
            \pgfpathmoveto{\pgfpointpolar{-135}{1pt}}
            \pgfpathlineto{\pgfpointpolar{45}{1pt}}
            \pgfpathmoveto{\pgfpointpolar{-45}{1pt}}
            \pgfpathlineto{\pgfpointpolar{135}{1pt}}
            \pgfusepathqstroke
          },
        transform shape,
      },
    capacitor IEC graphic/.style=
      {
        circuit symbol lines,
        circuit symbol size=width 0.8 height 2.4,
        transform shape,
        shape=capacitor IEC,
      },
    amperemeter graphic/.style=
      {
        circuit symbol open,
        circuit symbol size=width 2 height 2,
        transform shape,
        shape=generic circle IEC,
        info=center:{\sffamily A}
      },
    voltmeter graphic/.style=
      {
        circuit symbol open,
        circuit symbol size=width 2 height 2,
        transform shape,
        shape=generic circle IEC,
        info=center:{\sffamily V}
      },
    circuit declare symbol=messgeraet,
    set messgeraet graphic=
      {
        circuit symbol open,
        circuit symbol size=width 2 height 2,
        transform shape,
        shape=generic circle IEC,
        /pgf/generic circle IEC/before background=
          {
            \draw[annotation arrow,->] (0.58pt,-0.58pt)--(-0.58pt,0.58pt);
          }
      },
    circuit declare symbol=spannungsquelle,
    set spannungsquelle graphic=
      {
        circuit symbol open,
        circuit symbol size=width 2.4 height 0.5,
        transform shape,
        shape=doppelbuchse,
        outer sep=0pt
      },
  }