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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
|
% Copyright 2018-2022 by Romano Giannetti
% Copyright 2015-2022 by Stefan Lindner
% Copyright 2013-2022 by Stefan Erhardt
% Copyright 2007-2022 by Massimo Redaelli
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
% See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
\NeedsTeXFormat{LaTeX2e}
% set up the rollback system
\providecommand\DeclareRelease[3]{}
\providecommand\DeclareCurrentRelease[2]{}
\def\pgfcircversion{1.5.0}
\def\pgfcircversiondate{2022/02/22}
\DeclareRelease{0.4}{2012/12/20}{circuitikz-0.4-body.tex}
\DeclareRelease{v0.4}{2012/12/20}{circuitikz-0.4-body.tex}
\DeclareRelease{0.6}{2016/06/06}{circuitikz-0.6-body.tex}
\DeclareRelease{v0.6}{2016/06/06}{circuitikz-0.6-body.tex}
\DeclareRelease{0.7}{2016/09/08}{circuitikz-0.7-body.tex}
\DeclareRelease{v0.7}{2016/09/08}{circuitikz-0.7-body.tex}
\DeclareRelease{0.8.3}{2017/05/28}{circuitikz-0.8.3-body.tex}
\DeclareRelease{v0.8.3}{2017/05/28}{circuitikz-0.8.3-body.tex}
\DeclareRelease{0.9.3}{2019/07/13}{circuitikz-0.9.3-body.tex}
\DeclareRelease{v0.9.3}{2019/07/13}{circuitikz-0.9.3-body.tex}
\DeclareRelease{0.9.6}{2019/11/09}{circuitikz-0.9.6-body.tex}
\DeclareRelease{v0.9.6}{2019/11/09}{circuitikz-0.9.6-body.tex}
\DeclareRelease{1.0}{2020/02/04}{circuitikz-1.0-body.tex}
\DeclareRelease{v1.0}{2020/02/04}{circuitikz-1.0-body.tex}
\DeclareRelease{1.1.2}{2020/05/17}{circuitikz-1.1.2-body.tex}
\DeclareRelease{v1.1.2}{2020/05/17}{circuitikz-1.1.2-body.tex}
\DeclareRelease{1.2.7}{2020/12/27}{circuitikz-1.2.7-body.tex}
\DeclareRelease{v1.2.7}{2020/12/27}{circuitikz-1.2.7-body.tex}
\DeclareRelease{1.4.6}{2022/02/04}{circuitikz-1.4.6-body.tex}
\DeclareRelease{v1.4.6}{2022/02/04}{circuitikz-1.4.6-body.tex}
\DeclareCurrentRelease{\pgfcircversion}{\pgfcircversiondate}
\ProvidesPackage{circuitikz}%
[\pgfcircversiondate{} The CircuiTikz circuit drawing package version \pgfcircversion]
%% Version 3.0 of pgf/TikZ is required
\RequirePackage{tikz}
\RequirePackage{regexpatch}%for color hack
\usetikzlibrary{calc}
%
% "arrows" library is deprecated, and behave badly with
% arrows on short paths. Change to the new arrows.meta
% In pfgcirc.define, we will add the old definition of
% latex' which we have lost in the transition
%
\usetikzlibrary{arrows.meta, bending}
\usetikzlibrary{fpu} % may be needed for use fpu reciprocal (v1.0.1)
%
% global of options (better use styles!)
%
\DeclareOption{european}{\AtEndOfPackage{%
\ctikzset{voltage=european} \ctikzset{current=european} \ctikzset{inductor=european}
\ctikzset{resistor=european} \ctikzset{logic ports=european} \ctikzset{gas filled surge arrester choice = european}}
}
\DeclareOption{american}{\AtEndOfPackage{%
\ctikzset{voltage=american} \ctikzset{current=american} \ctikzset{resistor=american} \ctikzset{inductor=american} \ctikzset{gas filled surge arrester choice = american}
\ctikzset{logic ports = american}}
}
%
% voltages
%
\DeclareOption{europeanvoltage}{\AtEndOfPackage{%
\ctikzset{voltage=european}}
}
\DeclareOption{straightvoltages}{\AtEndOfPackage{%
\ctikzset{voltage=straight}}
}
\DeclareOption{americanvoltage}{\AtEndOfPackage{%
\ctikzset{voltage=american}}
}
\DeclareOption{europeanvoltages}{\AtEndOfPackage{%
\ctikzset{voltage=european}}
}
\DeclareOption{americanvoltages}{\AtEndOfPackage{%
\ctikzset{voltage=american}}
}
% Voltage directions
\DeclareOption{oldvoltagedirection}{\AtEndOfPackage{%
\pgf@circ@oldvoltagedirectiontrue
\pgf@circ@explicitvdirtrue
\pgf@circ@fixbatteriesfalse}
}
\DeclareOption{nooldvoltagedirection}{\AtEndOfPackage{%
\pgf@circ@oldvoltagedirectionfalse
\pgf@circ@explicitvdirtrue
\pgf@circ@fixbatteriesfalse}
}
\DeclareOption{RPvoltages}{\AtEndOfPackage{%
\pgf@circ@oldvoltagedirectiontrue
\pgf@circ@explicitvdirtrue
\pgf@circ@fixbatteriestrue}
}
\DeclareOption{EFvoltages}{\AtEndOfPackage{%
\pgf@circ@oldvoltagedirectionfalse
\pgf@circ@explicitvdirtrue
\pgf@circ@fixbatteriestrue}
}
%
% currents
%
\DeclareOption{europeancurrent}{\AtEndOfPackage{%
\ctikzset{current = european}}
}
\DeclareOption{americancurrent}{\AtEndOfPackage{%
\ctikzset{current = american}}
}
\DeclareOption{europeancurrents}{\AtEndOfPackage{%
\ctikzset{current = european}}
}
\DeclareOption{americancurrents}{\AtEndOfPackage{%
\ctikzset{current = american}}
}
%
% resistors
%
\DeclareOption{americanresistor}{\AtEndOfPackage{%
\ctikzset{resistor = american}}
}
\DeclareOption{europeanresistor}{\AtEndOfPackage{%
\ctikzset{resistor = european}}
}
\DeclareOption{americanresistors}{\AtEndOfPackage{%
\ctikzset{resistor = american}}
}
\DeclareOption{europeanresistors}{\AtEndOfPackage{%
\ctikzset{resistor = european}}
}
%
% inductors
%
\DeclareOption{americaninductor}{\AtEndOfPackage{%
\ctikzset{inductor = american}}
}
\DeclareOption{europeaninductor}{\AtEndOfPackage{%
\ctikzset{inductor = european}}
}
\DeclareOption{cuteinductor}{\AtEndOfPackage{%
\ctikzset{inductor = cute}}
}
\DeclareOption{americaninductors}{\AtEndOfPackage{%
\ctikzset{inductor = american}}
}
\DeclareOption{europeaninductors}{\AtEndOfPackage{%
\ctikzset{inductor = european}}
}
\DeclareOption{cuteinductors}{\AtEndOfPackage{%
\ctikzset{inductor = cute}}
}
%
% logic ports
%
\DeclareOption{americanport}{\AtEndOfPackage{%
\ctikzset{logic ports = american}}
}
\DeclareOption{europeanport}{\AtEndOfPackage{%
\ctikzset{logic ports = european}}
}
\DeclareOption{americanports}{\AtEndOfPackage{%
\ctikzset{logic ports = american}}
}
\DeclareOption{europeanports}{\AtEndOfPackage{%
\ctikzset{logic ports = european}}
}
%
% surge arresters (really?)
%
\DeclareOption{americangfsurgearrester}{\AtEndOfPackage{%
\ctikzset{gas filled surge arrester choice = american}}
}
\DeclareOption{europeangfsurgearrester}{\AtEndOfPackage{%
\ctikzset{gas filled surge arrester choice = european}}
}
%
% diodes
%
\DeclareOption{fulldiodes}{\AtEndOfPackage{%
\ctikzset{diode = full}}
}
\DeclareOption{emptydiodes}{\AtEndOfPackage{%
\ctikzset{diode = empty}}
}
\DeclareOption{strokediodes}{\AtEndOfPackage{%
\ctikzset{diode = stroke}}
}
\DeclareOption{fulldiode}{\AtEndOfPackage{%
\ctikzset{diode = full}}
}
\DeclareOption{emptydiode}{\AtEndOfPackage{%
\ctikzset{diode = empty}}
}
\DeclareOption{strokediode}{\AtEndOfPackage{%
\ctikzset{diode = stroke}}
}
%
% MOSes and FETs
%
\DeclareOption{arrowmos}{\AtEndOfPackage{%
\pgf@circuit@mos@arrowstrue}
}
\DeclareOption{noarrowmos}{\AtEndOfPackage{%
\pgf@circuit@mos@arrowsfalse}
}
\DeclareOption{fetbodydiode}{\AtEndOfPackage{%
\pgf@circuit@fet@bodydiodetrue}
}
\DeclareOption{nofetbodydiode}{\AtEndOfPackage{%
\pgf@circuit@fet@bodydiodefalse}
}
\DeclareOption{fetsolderdot}{\AtEndOfPackage{%
\pgf@circuit@fet@solderdottrue}
}
\DeclareOption{nofetsolderdot}{\AtEndOfPackage{%
\pgf@circuit@fet@solderdotfalse}
}
\DeclareOption{emptypmoscircle}{\AtEndOfPackage{%
\pgf@circuit@pmos@emptycircletrue}
}
\DeclareOption{lazymos}{\AtEndOfPackage{%
\ctikzset{tripoles/nmos/width=.5}
\ctikzset{tripoles/nmos/gate height=.35}
\ctikzset{tripoles/nmos/base height=.35}
\ctikzset{tripoles/nmos/height/.initial=1.2}
\ctikzset{tripoles/nmos/base width=.5}
\ctikzset{tripoles/nmos/gate width=.65}
\ctikzset{tripoles/pmos/width=.5}
\ctikzset{tripoles/pmos/gate height=.35}
\ctikzset{tripoles/pmos/base height=.35}
\ctikzset{tripoles/pmos/height/.initial=1.2}
\ctikzset{tripoles/pmos/base width=.5}
\ctikzset{tripoles/pmos/gate width=.65}
\pgf@circuit@pmos@emptycircletrue}
}
%
% BJTs labels
%
\DeclareOption{legacytransistorstext}{\AtEndOfPackage{%
\pgf@circuit@transisors@fixlabelsfalse}
}
\DeclareOption{nolegacytransistorstext}{\AtEndOfPackage{%
\pgf@circuit@transisors@fixlabelstrue}
}
\DeclareOption{centertransistorstext}{\AtEndOfPackage{%
\pgf@circuit@transisors@fixlabelstrue}
}
%
% labels
%
\DeclareOption{straightlabels}{\AtEndOfPackage{%
\ctikzset{label/align = straight}}
}
\DeclareOption{rotatelabels}{\AtEndOfPackage{%
\ctikzset{label/align = rotate}}
}
\DeclareOption{smartlabels}{\AtEndOfPackage{%
\ctikzset{label/align = smart}}
}
%
% Several options (better use styles)
%
\DeclareOption{betterproportions}{\AtEndOfPackage{%
\ctikzset{monopoles/ground/width/.initial=.15}
\ctikzset{bipoles/resistor/height/.initial=.23}
\ctikzset{bipoles/resistor/width/.initial=.6}
\ctikzset{bipoles/capacitor/height/.initial=.4}
\ctikzset{bipoles/capacitor/width/.initial=.1}
\ctikzset{bipoles/potentiometer/height/.initial=.6}
\ctikzset{bipoles/potentiometer/height 2/.initial=.23}
\ctikzset{bipoles/potentiometer/width/.initial=.6}
\ctikzset{bipoles/photoresistor/height/.initial=.6}
\ctikzset{bipoles/photoresistor/height 2/.initial=.23}
\ctikzset{bipoles/photoresistor/width/.initial=.6}
\ctikzset{bipoles/thermistor/main/.initial=.7}
\ctikzset{bipoles/thermistor/height/.initial=.328}%.23/.7
\ctikzset{bipoles/thermistor/width/.initial=.6}
\ctikzset{bipoles/thermistorntc/width/.initial=.6}
\ctikzset{bipoles/thermistorntc/main/.initial=.7}
\ctikzset{bipoles/thermistorntc/height/.initial=.328}%.23/.7
\ctikzset{bipoles/thermistorntc/height 2/.initial=.75}%.23/.7
\ctikzset{bipoles/thermistorptc/width/.initial=.6}
\ctikzset{bipoles/thermistorptc/main/.initial=.7}
\ctikzset{bipoles/thermistorptc/height/.initial=.328}%.23/.7
\ctikzset{bipoles/varistor/main/.initial=.7}
\ctikzset{bipoles/varistor/height/.initial=.328}%.23/.7
\ctikzset{bipoles/varistor/width/.initial=.6}
\ctikzset{bipoles/vresistor/height/.initial=.45}
\ctikzset{bipoles/vresistor/width/.initial=.6}
\ctikzset{bipoles/generic/height/.initial=.23}
\ctikzset{bipoles/generic/width/.initial=.6}
\ctikzset{bipoles/generic potentiometer/height/.initial=.6}
\ctikzset{bipoles/generic potentiometer/height 2/.initial=.23}
\ctikzset{bipoles/generic potentiometer/width/.initial=.6}
\ctikzset{bipoles/ageneric/height/.initial=.23}
\ctikzset{bipoles/ageneric/width/.initial=.6}
\ctikzset{bipoles/memristor/height/.initial=.23}
\ctikzset{bipoles/memristor/wave height/.initial=.375}
\ctikzset{bipoles/memristor/width/.initial=.60}
\ctikzset{bipoles/tgeneric/height/.initial=.525}
\ctikzset{bipoles/tgeneric/width/.initial=.6}
\ctikzset{bipoles/tfullgeneric/height/.initial=.525}
\ctikzset{bipoles/tfullgeneric/width/.initial=.60}
\ctikzset{bipoles/fullgeneric/height/.initial=.23}
\ctikzset{bipoles/fullgeneric/width/.initial=.6}
\ctikzset{bipoles/diode/height/.initial=.3}
\ctikzset{bipoles/diode/width/.initial=.25}
\ctikzset{bipoles/bidirectionaldiode/height/.initial=.66}
\ctikzset{bipoles/bidirectionaldiode/width/.initial=.6}
\ctikzset{bipoles/bidirectionaldiode/diode width left/.initial=.3}
\ctikzset{bipoles/bidirectionaldiode/diode width right/.initial=.3}
\ctikzset{tripoles/thyristor/height/.initial=.66}
\ctikzset{tripoles/thyristor/height 2/.initial=.3}
\ctikzset{tripoles/thyristor/width/.initial=.6}
\ctikzset{tripoles/thyristor/diode height/.initial=.3}
\ctikzset{tripoles/thyristor/diode width left/.initial=.4}
\ctikzset{tripoles/thyristor/diode width right/.initial=.3}
\ctikzset{tripoles/triac/height/.initial=.66}
\ctikzset{tripoles/triac/width/.initial=.6}
\ctikzset{tripoles/triac/diode width left/.initial=.3}
\ctikzset{tripoles/triac/diode width right/.initial=.3}}
}
% This is a nice hack that prints all the shapes declared
% by the package. Very useful for coverage testing and debugging.
%
% \let\origpgfdeclareshape=\pgfdeclareshape
% \def\pgfdeclareshape#1{%
% \typeout{SHAPE:\space"#1"}%
% \origpgfdeclareshape{#1}
% }
%
%
%%%%%%%%%
%%% These is the only direct options!
\DeclareOption{siunitx}{
\pgf@circ@siunitxtrue
}
\DeclareOption{nosiunitx}{
\pgf@circ@siunitxfalse
}
\DeclareOption{compatibility}{
\pgf@circuit@compattrue
}
%% we have to load this before options to define the magics for compatibility
\input pgfcirc.defines.tex
% setup option defaults and process them
% notice that the default is nooldvoltagedirection; it's not explicitly set to allow for the warning
\ExecuteOptions{nofetbodydiode, nofetsolderdot, europeancurrents, europeanvoltages, americanports, americanresistors, cuteinductors ,europeangfsurgearrester, nosiunitx, noarrowmos, smartlabels}
\ProcessOptions\relax
\input pgfcircutils.tex
\input pgfcircpath.tex
\input pgfcircshapes.tex
\input pgfcircmonopoles.tex
\input pgfcircbipoles.tex
\input pgfcirctripoles.tex
\input pgfcircquadpoles.tex
\input pgfcircmultipoles.tex
\input pgfcirclabel.tex
\input pgfcircvoltage.tex
\input pgfcirccurrent.tex
\input pgfcircflow.tex
\ifpgf@circ@siunitx
\RequirePackage{xstring}[2009/03/13]
%\expandafter\let\csname angstrom\endcsname\relax
\RequirePackage{siunitx}
\fi
%% This should be executed *after* all the options!
%
% Remove the warning; nobody cares.
%
% \AtEndOfPackage{%
% \ifpgf@circ@explicitvdir\else
% \PackageWarningNoLine{circuitikz}{%
% You did not specify one of the voltage directions:\MessageBreak
% \space\space oldvoltagedirection, nooldvoltagedirection, \MessageBreak
% \space\space RPvoltages or EFvoltages \MessageBreak
% Default directions may have changed, \MessageBreak
% please check the manual%
% }
% \fi
% }
\newenvironment{circuitikz}{\begin{tikzpicture}}{\end{tikzpicture}}
%override (unused) circuitikz environment for compability to externalization)
\let\circuitikz\tikzpicture
\let\endcircuitikz\endtikzpicture
\endinput
|