summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/circuitikz/t-circuitikz.tex
blob: 12671123ff3be87dee1d55edbb3fc3469a49dc51 (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
\def\pgfcircversion{0.2.3}
\writestatus{loading}{2009/11/18 The CircuiTikz circuit drawing package version \pgfcircversion}
\startmodule[circuitikz]

\usemodule[tikz]
\usepgflibrary[decorations.pathmorphing]
\usetikzlibrary[calc]

\unprotect

\input circuitikz.code.tex

% defaults

\setupmodule[current=european, voltage=european,  resistor=american,  inductor=cute, logic=american, siunitx=true, arrowmos=false]

\processaction[\currentmoduleparameter{voltage}]
   [    european=>\ctikzset{voltage=european},
        american=>\ctikzset{voltage=american}
   ]

\processaction[\currentmoduleparameter{current}]
   [    european=>\ctikzset{ current=european},
        american=>\ctikzset{ current=american}
   ]

\processaction[\currentmoduleparameter{resistor}]
   [    european=>\ctikzset{ resistor=european},
        american=>\ctikzset{ resistor=american}
   ]

\processaction[\currentmoduleparameter{inductor}]
   [    european=>\ctikzset{ inductor=european},
        american=>\ctikzset{ inductor=american},
		cute=>\ctikzset{ inductor=cute}
   ]

\processaction[\currentmoduleparameter{diode}]
   [    full=>\ctikzset{ diode=full},
        empty=>\ctikzset{ diode=empty}
   ]

\processaction[\currentmoduleparameter{logic}]
   [    european=>\ctikzset{ logic ports=european},
        american=>\ctikzset{ logic ports=american}
   ] 
 
\processaction[\currentmoduleparameter{siunitx}]
   [    true=>\def\SI#1#2{#1\,#2}
	\def\ampere{\rm{A}}
	\def\volt{\rm{V}}
	\def\ohm{\Omega}
	\def\siemens{\rm{S}}
	\def\farad{\rm{F}}
	\def\henry{\rm{H}}
	\def\second{\rm{s}}
	\def\coulomb{\rm{C}}
	\def\siemens{\rm{S}}
	\def\radians{\rm{rad}}	
	\def\milli{\rm{m}}
	\def\micro{\mu}
	\def\nano{\rm{n}}
	\def\pico{\rm{p}}
	\def\kilo{\rm{k}}
	\def\mega{\rm{M}}
	\def\giga{\rm{G}}
	\def\tera{\rm{T}},
        false=>%,
%		\s!default=>\pgf@circ@siunitxtrue
   ] 

\processaction[\currentmoduleparameter{arrowmos}]
   [    true=>\pgf@circuit@mos@arrowstrue,
        false=>\pgf@circuit@mos@arrowsfalse%,
%		\s!default=>\pgf@circuit@mos@arrowstrue
   ] 


\ifpgf@circ@siunitx
 % nothing! siunitx and xstrings don't work in context
\fi


\input circuitikz1.code.tex


% define the environment
\long\def\startcircuitikz#1\stopcircuitikz{\starttikzpicture#1\stoptikzpicture}

\protect

\stopmodule


\endinput