diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex | 663 |
1 files changed, 467 insertions, 196 deletions
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex index 22bcf58f930..200230b50a5 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex @@ -1,4 +1,17 @@ -%% Counters +%% Key managements + +\long\def\pgf@circ@comment#1{} + +\def\circuitikzbasekey{/tikz/circuitikz} + +\pgfkeys{\circuitikzbasekey/.is family} + +\def\circuitikzset#1{\pgfkeys{\circuitikzbasekey,#1}} +\let\ctikzset\circuitikzset +\def\ctikzvalof#1{\pgfkeysvalueof{\circuitikzbasekey/#1}} +\def\ctikzsetvalof#1#2{\pgfkeyssetvalue{\circuitikzbasekey/#1}{#2}} + +%% Temporary Counters \newcount\pgf@circ@count@a \newcount\pgf@circ@count@b @@ -51,11 +64,32 @@ \pgfarrowsdeclarereversed{latexslim reversed}{latexslim reversed}{latexslim}{latexslim} +\def\pgf@circ@setifdefinedfill#1#2{% + % if \ctikzclass is defined and \ctikzclass/fill is defined and is not none: + % set the fill color and execute \pgfusepath{#1}, else execute \pgfusepath{#2} + \ifdefined\ctikzclass + \pgfkeysifdefined{\circuitikzbasekey/\ctikzclass/fill}% + {% yes, it's defined + \edef\@@tmp{\ctikzvalof{\ctikzclass/fill}}\edef\@@none{none}% + \ifx\@@tmp\@@none % but it's none + \pgfusepath{#2}% + \else + \pgfsetfillcolor{\@@tmp}% + \pgfusepath{#1}% + \fi + }{% the class is defined but the fill key not; use #2 + \pgfusepath{#2}% + } + \else + \pgfusepath{#2}% + \fi +} + %% Macro to fill or draw \def\pgf@circ@draworfill{% \ifx\tikz@fillcolor\pgfutil@empty - \pgfusepath{draw} + \pgf@circ@setifdefinedfill{draw,fill}{draw} \else \pgfsetfillcolor{\tikz@fillcolor} \pgfusepath{draw, fill} @@ -64,6 +98,7 @@ \def\pgf@circ@draworfillandclip{% \ifx\tikz@fillcolor\pgfutil@empty + \pgf@circ@setifdefinedfill{draw, clip, fill}{draw, clip} \pgfusepath{draw, clip} \else \pgfsetfillcolor{\tikz@fillcolor} @@ -73,24 +108,37 @@ \def\pgf@circ@maybefill{% \ifx\tikz@fillcolor\pgfutil@empty - \pgfusepath{discard} + \pgf@circ@setifdefinedfill{fill}{discard} \else \pgfsetfillcolor{\tikz@fillcolor} \pgfusepath{fill} \fi } -%% Keys - -\long\def\pgf@circ@comment#1{} -\def\circuitikzbasekey{/tikz/circuitikz} - -\pgfkeys{\circuitikzbasekey/.is family} +%% Macros for setting linewidth +% #1 is the legacy class (bipoles, tripoles) etc +% #2 is the reference linewidth +\def\pgf@circ@setlinewidth#1#2{% + \ifdefined\ctikzclass + \pgfkeysifdefined{\circuitikzbasekey/\ctikzclass/thickness}% + {% yes, it's defined + \edef\@@tmp{\ctikzvalof{\ctikzclass/thickness}}\edef\@@none{none}% + \ifx\@@tmp\@@none % but it's none + \pgfsetlinewidth{\ctikzvalof{#1/thickness}#2}% passthrough legacy class + \else + \pgfsetlinewidth{\@@tmp #2}% + \fi + }{ % key not defined, do the legacy thing + \pgfsetlinewidth{\ctikzvalof{#1/thickness}#2}% + }% Ok, do nothing + \else % no class + \pgfsetlinewidth{\ctikzvalof{#1/thickness}#2}% + \fi +} +% use \pgf@circ@setlinewidth{none}{\pgflinewidth} if there is no legacy case +\ctikzset{none/thickness/.initial=1.0} % do not touch -\def\circuitikzset#1{\pgfkeys{\circuitikzbasekey,#1}} -\let\ctikzset\circuitikzset -\def\ctikzvalof#1{\pgfkeysvalueof{\circuitikzbasekey/#1}} -\def\ctikzsetvalof#1#2{\pgfkeyssetvalue{\circuitikzbasekey/#1}{#2}} +% voltage options \newif\ifpgf@circ@siunitx \newif\ifpgf@circuit@compat @@ -105,7 +153,6 @@ \ctikzset{voltage dir/EF/.code={\pgf@circ@oldvoltagedirectionfalse\pgf@circ@fixbatteriestrue}} \tikzset{voltage dir/.style={circuitikz/voltage dir=#1}} - % Option ">" for twoports \newif\ifpgf@circuit@inputarrow \ctikzset{>/.add code={}{\pgf@circuit@inputarrowtrue}} @@ -139,8 +186,130 @@ % Base len for all circuitikz \newdimen\pgf@circ@Rlen -\ctikzset{bipoles/length/.code={\pgf@circ@Rlen = #1}} +% scaled length for internal use in scalable shapes +\newdimen\pgf@circ@scaled@Rlen +\ctikzset{bipoles/length/.code={\pgf@circ@Rlen = #1\pgf@circ@scaled@Rlen=\pgf@circ@Rlen}} \pgf@circ@Rlen = 1.4cm +% by default scale is 1.0 +\pgf@circ@scaled@Rlen=\pgf@circ@Rlen + +%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% main style definitions +%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + +% load a style file: search ctikzstyle-NAME.tex in path +\def\ctikzloadstyle#1{% + \edef\pgf@temp{#1}% + % guard against re-loading + \expandafter\ifx\csname pgf@circ@style@\pgf@temp @loaded\endcsname\relax% + \expandafter\global\expandafter\let\csname pgf@circ@style@\pgf@temp @loaded\endcsname=\pgfutil@empty + \pgfutil@InputIfFileExists{ctikzstyle-#1}{}{% + \tikzerror{I did not find the circuitikz style #1}}% + \fi +} + +% global style parameters +\ctikzset{default/scale/.initial=1.0} % do not touch +\ctikzset{default/fill/.initial=none} % do not touch +\ctikzset{default/thickness/.initial=none} % do not touch +% default is use as the generic default style for bipoles + +% mostly bipoles: + +\ctikzset{resistors/scale/.initial=1.0} +\ctikzset{resistors/fill/.initial=none} +\ctikzset{resistors/thickness/.initial=none} + +\ctikzset{capacitors/scale/.initial=1.0} +\ctikzset{capacitors/fill/.initial=none} +\ctikzset{capacitors/thickness/.initial=none} + +\ctikzset{inductors/scale/.initial=1.0} +\ctikzset{inductors/fill/.initial=none} +\ctikzset{inductors/thickness/.initial=none} + +\ctikzset{diodes/scale/.initial=1.0} +\ctikzset{diodes/fill/.initial=none} +\ctikzset{diodes/thickness/.initial=none} + +\ctikzset{batteries/scale/.initial=1.0} +\ctikzset{batteries/fill/.initial=none} +\ctikzset{batteries/thickness/.initial=none} + +\ctikzset{sources/scale/.initial=1.0} +\ctikzset{sources/fill/.initial=none} +\ctikzset{sources/thickness/.initial=none} + +\ctikzset{csources/scale/.initial=1.0} +\ctikzset{csources/fill/.initial=none} +\ctikzset{csources/thickness/.initial=none} + +\ctikzset{instruments/scale/.initial=1.0} +\ctikzset{instruments/fill/.initial=none} +\ctikzset{instruments/thickness/.initial=none} + +\ctikzset{mechanicals/scale/.initial=1.0} +\ctikzset{mechanicals/fill/.initial=none} +\ctikzset{mechanicals/thickness/.initial=none} + +\ctikzset{misc/scale/.initial=1.0} +\ctikzset{misc/fill/.initial=none} +\ctikzset{misc/thickness/.initial=none} + +\ctikzset{blocks/scale/.initial=1.0} +\ctikzset{blocks/fill/.initial=none} +\ctikzset{blocks/thickness/.initial=none} + +% mostly nodes + +\ctikzset{grounds/scale/.initial=1.0} +\ctikzset{grounds/fill/.initial=none} +\ctikzset{grounds/thickness/.initial=none} + +\ctikzset{power supplies/scale/.initial=1.0} +\ctikzset{power supplies/fill/.initial=none} +\ctikzset{power supplies/thickness/.initial=none} + +\ctikzset{transistors/scale/.initial=1.0} +\ctikzset{transistors/fill/.initial=none} +\ctikzset{transistors/thickness/.initial=none} + +\ctikzset{tubes/scale/.initial=1.0} +\ctikzset{tubes/fill/.initial=none} +\ctikzset{tubes/thickness/.initial=none} + +\ctikzset{RF/scale/.initial=1.0} +\ctikzset{RF/fill/.initial=none} +\ctikzset{RF/thickness/.initial=none} + +\ctikzset{electromechanicals/scale/.initial=1.0} +\ctikzset{electromechanicals/fill/.initial=none} +\ctikzset{electromechanicals/thickness/.initial=none} + +% transformers go with inductors +\ctikzset{amplifiers/scale/.initial=1.0} +\ctikzset{amplifiers/fill/.initial=none} +\ctikzset{amplifiers/thickness/.initial=none} + +\ctikzset{switches/scale/.initial=1.0} +\ctikzset{switches/fill/.initial=none} +\ctikzset{switches/thickness/.initial=none} + +\ctikzset{logic ports/scale/.initial=1.0} +\ctikzset{logic ports/fill/.initial=none} +\ctikzset{logic ports/thickness/.initial=none} + +\ctikzset{chips/scale/.initial=1.0} +\ctikzset{chips/fill/.initial=none} +\ctikzset{chips/thickness/.initial=none} + +\ctikzset{displays/scale/.initial=1.0} +\ctikzset{displays/fill/.initial=none} +\ctikzset{displays/thickness/.initial=none} + +% grounds and power supplies \ctikzset{monopoles/.is family} \ctikzset{monopoles/ground/width/.initial=.25} @@ -155,7 +324,6 @@ \ctikzset{monopoles/chassis/width/.initial=.25} \ctikzset{monopoles/alternative chassis/width/.initial=.25} \ctikzset{monopoles/equipotentiality/width/.initial=.25} -\ctikzset{monopoles/tlinestub/width/.initial=.25} \ctikzset{monopoles/antenna/width/.initial=.25} \ctikzset{monopoles/antenna/label/xanchor/.initial=.4} \ctikzset{monopoles/antenna/label/yanchor/.initial=.75} @@ -169,6 +337,7 @@ \ctikzset{monopoles/bareantenna/label/xanchor/.initial=1} \ctikzset{monopoles/bareantenna/label/yanchor/.initial=0.5} \ctikzset{monopoles/waves/width/.initial=0.5} + % microstrips \ctikzset{bipoles/mstline/height/.initial=0.3} \ctikzset{bipoles/mstline/width/.initial=1.2} @@ -185,11 +354,34 @@ \ctikzset{bipoles/mic/depth/.initial=.0} \ctikzset{bipoles/mic/width/.initial=.8} +% Zig Zag resistors +\ctikzset{resistors/zigs/.initial=3} +\ctikzset{resistors/width/.code={% + \ctikzset{bipoles/resistor/width=#1}% + \ctikzset{bipoles/vresistor/width=#1}% + \ctikzset{bipoles/potentiometer/width=#1}% + \ctikzset{bipoles/resistivesens/width=#1}% + \ctikzset{bipoles/photoresistor/width=#1}% + \ctikzset{bipoles/thermistor/width=#1}% + \ctikzset{bipoles/thermistorntc/width=#1}% + \ctikzset{bipoles/thermistorptc/width=#1}% + \ctikzset{bipoles/varistor/width=#1}% + \ctikzset{bipoles/generic/width=#1}% + \ctikzset{bipoles/generic potentiometer/width=#1}% + \ctikzset{bipoles/ageneric/width=#1}% + \ctikzset{bipoles/tgeneric/width=#1}% +}} +% zigzag resistor \ctikzset{bipoles/resistor/height/.initial=.3} \ctikzset{bipoles/resistor/width/.initial=.8} \ctikzset{bipoles/potentiometer/height/.initial=.8} \ctikzset{bipoles/potentiometer/height 2/.initial=.3} \ctikzset{bipoles/potentiometer/width/.initial=.8} +\ctikzset{bipoles/vresistor/height/.initial=.6} +\ctikzset{bipoles/vresistor/width/.initial=.8} +\ctikzset{bipoles/resistivesens/height/.initial=.6} +\ctikzset{bipoles/resistivesens/width/.initial=.8} +% square resistors \ctikzset{bipoles/photoresistor/height/.initial=.6} \ctikzset{bipoles/photoresistor/height 2/.initial=.3} \ctikzset{bipoles/photoresistor/width/.initial=.8} @@ -207,8 +399,48 @@ \ctikzset{bipoles/varistor/main/.initial=.7} \ctikzset{bipoles/varistor/height/.initial=.428}%.3/.7 \ctikzset{bipoles/varistor/width/.initial=.8} -\ctikzset{bipoles/vresistor/height/.initial=.6} -\ctikzset{bipoles/vresistor/width/.initial=.8} +\ctikzset{bipoles/generic/height/.initial=.30} +\ctikzset{bipoles/generic/width/.initial=.80} +\ctikzset{bipoles/generic potentiometer/height/.initial=.80} +\ctikzset{bipoles/generic potentiometer/height 2/.initial=.30} +\ctikzset{bipoles/generic potentiometer/width/.initial=.80} +\ctikzset{bipoles/ageneric/height/.initial=.30} +\ctikzset{bipoles/tgeneric/height/.initial=.70} +\ctikzset{bipoles/tgeneric/width/.initial=.80} +\ctikzset{bipoles/ageneric/width/.initial=.80} + +%% Capacitors +\ctikzset{bipoles/capacitor/height/.initial=.6} +\ctikzset{bipoles/capacitor/width/.initial=.2} +\ctikzset{bipoles/ecapacitor/height/.initial=.5} +\ctikzset{bipoles/ecapacitor/width/.initial=.2} +\ctikzset{bipoles/ecapacitor/font/.initial= \fontsize{6}{0}\selectfont\boldmath} +\ctikzset{bipoles/pcapacitor/height/.initial=.6} +\ctikzset{bipoles/pcapacitor/width/.initial=.2} +\ctikzset{bipoles/pcapacitor/bend width/.initial=1.1} +\ctikzset{bipoles/vcapacitor/height/.initial=.6} +\ctikzset{bipoles/vcapacitor/width/.initial=.5} +\ctikzset{bipoles/vcapacitor/capacitor width/.initial=.4} +\ctikzset{bipoles/piezoelectric/height/.initial=.7} +\ctikzset{bipoles/piezoelectric/width/.initial=.5} + +% Inductors +\ctikzset{inductors/coils/.code={% + \ctikzset{bipoles/cuteinductor/coils=#1}% + \ctikzset{bipoles/cutechoke/coils=#1}% + \ctikzset{bipoles/americaninductor/coils=#1}% + \ctikzset{bipoles/vcuteinductor/coils=#1}% + \ctikzset{bipoles/vamericaninductor/coils=#1}% +}} +\ctikzset{inductors/width/.code={% + \ctikzset{bipoles/cuteinductor/width=#1}% + \ctikzset{bipoles/cutechoke/width=#1}% + \ctikzset{bipoles/americaninductor/width=#1}% + \ctikzset{bipoles/vcuteinductor/width=#1}% + \ctikzset{bipoles/vamericaninductor/width=#1}% + \ctikzset{bipoles/fullgeneric/width=#1}% + \ctikzset{bipoles/tfullgeneric/width=#1}% +}} \ctikzset{bipoles/cuteinductor/height/.initial=.3} \ctikzset{bipoles/cuteinductor/lower coil height/.initial=.15} \ctikzset{bipoles/cuteinductor/width/.initial=.6} @@ -223,8 +455,12 @@ \ctikzset{bipoles/cutechoke/cstep/.initial=.3} \ctikzset{bipoles/cutechoke/cdist/.initial=1.3} \ctikzset{bipoles/cutechoke/cthick/.initial=1} -\newif\ifpgf@circuit@bipole@twolines -\pgf@circuit@bipole@twolinesfalse +\newif\ifpgf@circuit@bipole@twolineschoke +\pgf@circuit@bipole@twolineschokefalse +\pgfkeys{/tikz/onelinechoke/.add code={}{\pgf@circuit@bipole@twolineschokefalse}} +\ctikzset{onelinechoke/.add code={}{\pgf@circuit@bipole@twolineschokefalse}} +\pgfkeys{/tikz/twolineschoke/.add code={}{\pgf@circuit@bipole@twolineschoketrue}} +\ctikzset{twolineschoke/.add code={}{\pgf@circuit@bipole@twolineschoketrue}} % \ctikzset{bipoles/americaninductor/height/.initial=.3} \ctikzset{bipoles/americaninductor/height 2/.initial=.1} @@ -241,6 +477,13 @@ \ctikzset{bipoles/vamericaninductor/width/.initial=.8} \ctikzset{bipoles/vamericaninductor/coils/.initial=4} \ctikzset{bipoles/vamericaninductor/coil height/.initial=.15} +\ctikzset{bipoles/tfullgeneric/height/.initial=.70} +\ctikzset{bipoles/tfullgeneric/width/.initial=.80} +\ctikzset{bipoles/fullgeneric/height/.initial=.30} +\ctikzset{bipoles/fullgeneric/width/.initial=.80} + +% Sources + \ctikzset{bipoles/esource/height/.initial=.60} \ctikzset{bipoles/esource/width/.initial=.60} \ctikzset{bipoles/pvsource/height/.initial=.60} @@ -275,6 +518,8 @@ \ctikzset{bipoles/cisource/width/.initial=.7} \ctikzset{bipoles/cisourceam/height/.initial=.7} \ctikzset{bipoles/cisourceam/width/.initial=.7} +\ctikzset{bipoles/ecsource/height/.initial=.7} +\ctikzset{bipoles/ecsource/width/.initial=.7} \ctikzset{bipoles/cvsource/height/.initial=.7} \ctikzset{bipoles/cvsource/width/.initial=.7} \ctikzset{bipoles/cvsourceam/height/.initial=.7} @@ -284,25 +529,15 @@ \ctikzset{bipoles/cisourcesin/width/.initial=.7} \ctikzset{bipoles/cvsourcesin/height/.initial=.7} \ctikzset{bipoles/cvsourcesin/width/.initial=.7} -\ctikzset{bipoles/capacitor/height/.initial=.6} -\ctikzset{bipoles/capacitor/width/.initial=.2} -\ctikzset{bipoles/ecapacitor/height/.initial=.5} -\ctikzset{bipoles/ecapacitor/width/.initial=.2} -\ctikzset{bipoles/ecapacitor/font/.initial= \fontsize{6}{0}\selectfont\boldmath} -\ctikzset{bipoles/pcapacitor/height/.initial=.6} -\ctikzset{bipoles/pcapacitor/width/.initial=.2} -\ctikzset{bipoles/pcapacitor/bend width/.initial=1.1} -\ctikzset{bipoles/vcapacitor/height/.initial=.6} -\ctikzset{bipoles/vcapacitor/width/.initial=.5} -\ctikzset{bipoles/vcapacitor/capacitor width/.initial=.4} -\ctikzset{bipoles/piezoelectric/height/.initial=.7} -\ctikzset{bipoles/piezoelectric/width/.initial=.5} \ctikzset{bipoles/battery/height/.initial=.6} \ctikzset{bipoles/battery/width/.initial=.3} \ctikzset{bipoles/battery1/height/.initial=.6} \ctikzset{bipoles/battery1/width/.initial=.3} \ctikzset{bipoles/battery2/height/.initial=.6} \ctikzset{bipoles/battery2/width/.initial=.3} + +% diodes + \ctikzset{bipoles/diode/height/.initial=.50} \ctikzset{bipoles/diode/width/.initial=.40} \ctikzset{bipoles/bidirectionaldiode/height/.initial=1.1} @@ -311,6 +546,9 @@ \ctikzset{bipoles/bidirectionaldiode/diode width right/.initial=.3} \ctikzset{bipoles/varcap/height/.initial=.50} \ctikzset{bipoles/varcap/width/.initial=.45} + +% switches + \ctikzset{bipoles/spst/height/.initial=.35} \ctikzset{bipoles/spst/width/.initial=.35} \ctikzset{bipoles/spst/depth/.initial=.2} @@ -320,8 +558,9 @@ \ctikzset{bipoles/ncs/height/.initial=.35} \ctikzset{bipoles/ncs/width/.initial=.35} \ctikzset{bipoles/ncs/depth/.initial=.2} -\ctikzset{bipoles/generic/height/.initial=.30} -\ctikzset{bipoles/generic/width/.initial=.80} + +% misc + \ctikzset{bipoles/european gas filled surge arrester/height/.initial=.30} \ctikzset{bipoles/european gas filled surge arrester/width/.initial=.80} \ctikzset{bipoles/european gas filled surge arrester/inside/.initial=.30} @@ -335,20 +574,9 @@ \ctikzset{bipoles/fuse/width/.initial=.50} \ctikzset{bipoles/afuse/height/.initial=.20} \ctikzset{bipoles/afuse/width/.initial=.50} -\ctikzset{bipoles/generic potentiometer/height/.initial=.80} -\ctikzset{bipoles/generic potentiometer/height 2/.initial=.30} -\ctikzset{bipoles/generic potentiometer/width/.initial=.80} -\ctikzset{bipoles/ageneric/height/.initial=.30} -\ctikzset{bipoles/ageneric/width/.initial=.80} \ctikzset{bipoles/memristor/height/.initial=.30} \ctikzset{bipoles/memristor/wave height/.initial=.5} \ctikzset{bipoles/memristor/width/.initial=.80} -\ctikzset{bipoles/tgeneric/height/.initial=.70} -\ctikzset{bipoles/tgeneric/width/.initial=.80} -\ctikzset{bipoles/tfullgeneric/height/.initial=.70} -\ctikzset{bipoles/tfullgeneric/width/.initial=.80} -\ctikzset{bipoles/fullgeneric/height/.initial=.30} -\ctikzset{bipoles/fullgeneric/width/.initial=.80} \ctikzset{bipoles/open/height/.initial=.3} %necessary for curly voltages \ctikzset{bipoles/open/width/.initial=.3} %necessary for curly voltages \ctikzset{bipoles/open/voltage/straight label distance/.initial=0} @@ -415,13 +643,12 @@ \ctikzset{bipoles/phaseshifter/width/.initial=.7} \ctikzset{bipoles/vphaseshifter/width/.initial=.7} \ctikzset{bipoles/detector/width/.initial=.7} -% resistive sensor american style -\ctikzset{bipoles/resistivesens/height/.initial=.6} -\ctikzset{bipoles/resistivesens/width/.initial=.8} % crossing wires \ctikzset{bipoles/crossing/size/.initial=.2} +% Transistors starts here + \newif\ifpgf@circuit@trans@depletiontype \pgf@circuit@trans@depletiontypefalse @@ -473,6 +700,7 @@ % Option draw pmos with empty circle \newif\ifpgf@circuit@pmos@emptycircle \pgf@circuit@pmos@emptycirclefalse +\ctikzset{tripoles/pmos style/.is choice} \pgfkeys{/tikz/emptycircle/.add code={}{\pgf@circuit@pmos@emptycircletrue}} \ctikzset{tripoles/pmos style/emptycircle/.add code={}{\pgf@circuit@pmos@emptycircletrue}} % Option draw pmos with no circle @@ -483,7 +711,12 @@ % back to normal \pgfkeys{/tikz/fullcircle/.add code={}{\pgf@circuit@pmos@emptycirclefalse\pgf@circuit@pmos@nocirclefalse}} \ctikzset{tripoles/pmos style/fullcircle/.add code={}{\pgf@circuit@pmos@emptycirclefalse\pgf@circuit@pmos@nocirclefalse}} - +% arrows at the end, the correct way +\newif\ifpgf@circuit@trans@arrowatend +\pgf@circuit@trans@arrowatendfalse +\ctikzset{transistors/arrow pos/.is choice} +\ctikzset{transistors/arrow pos/legacy/.code={\pgf@circuit@trans@arrowatendfalse}} +\ctikzset{transistors/arrow pos/end/.code={\pgf@circuit@trans@arrowatendtrue}} \newif\ifpgf@circuit@trans@ntype \pgf@circuit@trans@ntypetrue %default true @@ -742,56 +975,60 @@ \newif\ifpgf@circuit@europeanlogicport \ctikzset{logic ports/.is choice} \ctikzset{logic ports/european/.code= {\pgf@circuit@europeanlogicporttrue - \tikzset{and port/.style={shape=european and port}} - \tikzset{or port/.style={shape=european or port}} - \tikzset{xor port/.style={shape=european xor port}} - \tikzset{not port/.style={shape=european not port}} - \tikzset{nand port/.style={shape=european nand port}} - \tikzset{nor port/.style={shape=european nor port}} - \tikzset{xnor port/.style={shape=european xnor port}} - } } + \tikzset{and port/.style={shape=european and port}}% + \tikzset{or port/.style={shape=european or port}}% + \tikzset{xor port/.style={shape=european xor port}}% + \tikzset{buffer port/.style={shape=european buffer port}}% + \tikzset{not port/.style={shape=european not port}}% + \tikzset{nand port/.style={shape=european nand port}}% + \tikzset{nor port/.style={shape=european nor port}}% + \tikzset{xnor port/.style={shape=european xnor port}}% +}} \ctikzset{logic ports/american/.code= {\pgf@circuit@europeanlogicportfalse - \tikzset{and port/.style={shape=american and port}} - \tikzset{or port/.style={shape=american or port}} - \tikzset{xor port/.style={shape=american xor port}} - \tikzset{not port/.style={shape=american not port}} - \tikzset{nand port/.style={shape=american nand port}} - \tikzset{nor port/.style={shape=american nor port}} - \tikzset{xnor port/.style={shape=american xnor port}} - } } + \tikzset{and port/.style={shape=american and port}}% + \tikzset{or port/.style={shape=american or port}}% + \tikzset{xor port/.style={shape=american xor port}}% + \tikzset{buffer port/.style={shape=american buffer port}}% + \tikzset{not port/.style={shape=american not port}}% + \tikzset{nand port/.style={shape=american nand port}}% + \tikzset{nor port/.style={shape=american nor port}}% + \tikzset{xnor port/.style={shape=american xnor port}}% +}} \ctikzset{logic ports origin/.is choice} -\ctikzset{logic ports origin/legacy/.code= { - \ctikzset{tripoles/american and port/origin/.initial=0.8} - \ctikzset{tripoles/american nand port/origin/.initial=0.8} - \ctikzset{tripoles/american nor port/origin/.initial=0.8} - \ctikzset{tripoles/american or port/origin/.initial=0.8} - \ctikzset{tripoles/american xor port/origin/.initial=0.8} - \ctikzset{tripoles/american xnor port/origin/.initial=0.8} - \ctikzset{tripoles/european and port/origin/.initial=0.8} - \ctikzset{tripoles/european nand port/origin/.initial=0.8} - \ctikzset{tripoles/european or port/origin/.initial=0.8} - \ctikzset{tripoles/european nor port/origin/.initial=0.8} - \ctikzset{tripoles/european xor port/origin/.initial=0.8} - \ctikzset{tripoles/european xnor port/origin/.initial=0.8} - \ctikzset{tripoles/european not port/origin/.initial=0.8} - } +\ctikzset{logic ports origin/legacy/.code={ + \ctikzset{tripoles/american and port/origin/.initial=0.8}% + \ctikzset{tripoles/american nand port/origin/.initial=0.8}% + \ctikzset{tripoles/american nor port/origin/.initial=0.8}% + \ctikzset{tripoles/american or port/origin/.initial=0.8}% + \ctikzset{tripoles/american xor port/origin/.initial=0.8}% + \ctikzset{tripoles/american xnor port/origin/.initial=0.8}% + \ctikzset{tripoles/european and port/origin/.initial=0.8}% + \ctikzset{tripoles/european nand port/origin/.initial=0.8}% + \ctikzset{tripoles/european or port/origin/.initial=0.8}% + \ctikzset{tripoles/european nor port/origin/.initial=0.8}% + \ctikzset{tripoles/european xor port/origin/.initial=0.8}% + \ctikzset{tripoles/european xnor port/origin/.initial=0.8}% + \ctikzset{tripoles/european buffer port/origin/.initial=0.8}% + \ctikzset{tripoles/european not port/origin/.initial=0.8}% + }% } -\ctikzset{logic ports origin/center/.code= { - \ctikzset{tripoles/american and port/origin/.initial=0} - \ctikzset{tripoles/american nand port/origin/.initial=0} - \ctikzset{tripoles/american nor port/origin/.initial=0} - \ctikzset{tripoles/american or port/origin/.initial=0} - \ctikzset{tripoles/american xor port/origin/.initial=0} - \ctikzset{tripoles/american xnor port/origin/.initial=0} - \ctikzset{tripoles/european and port/origin/.initial=0} - \ctikzset{tripoles/european nand port/origin/.initial=0} - \ctikzset{tripoles/european or port/origin/.initial=0} - \ctikzset{tripoles/european nor port/origin/.initial=0} - \ctikzset{tripoles/european xor port/origin/.initial=0} - \ctikzset{tripoles/european xnor port/origin/.initial=0} - \ctikzset{tripoles/european not port/origin/.initial=0} - } +\ctikzset{logic ports origin/center/.code={% + \ctikzset{tripoles/american and port/origin/.initial=0}% + \ctikzset{tripoles/american nand port/origin/.initial=0}% + \ctikzset{tripoles/american nor port/origin/.initial=0}% + \ctikzset{tripoles/american or port/origin/.initial=0}% + \ctikzset{tripoles/american xor port/origin/.initial=0}% + \ctikzset{tripoles/american xnor port/origin/.initial=0}% + \ctikzset{tripoles/european and port/origin/.initial=0}% + \ctikzset{tripoles/european nand port/origin/.initial=0}% + \ctikzset{tripoles/european or port/origin/.initial=0}% + \ctikzset{tripoles/european nor port/origin/.initial=0}% + \ctikzset{tripoles/european xor port/origin/.initial=0}% + \ctikzset{tripoles/european xnor port/origin/.initial=0}% + \ctikzset{tripoles/european buffer port/origin/.initial=0}% + \ctikzset{tripoles/european not port/origin/.initial=0}% + }% } @@ -876,6 +1113,12 @@ \ctikzset{tripoles/european nand port/height/.initial=.65} \ctikzset{tripoles/european nand port/reserved/.initial=.6} \ctikzset{tripoles/european nand port/input height/.initial=.6} +\ctikzset{tripoles/european buffer port/width/.initial=1.4} +\ctikzset{tripoles/european buffer port/not height/.initial=.3} +\ctikzset{tripoles/european buffer port/not width/.initial=.8} +\ctikzset{tripoles/european buffer port/height/.initial=.65} +\ctikzset{tripoles/european buffer port/reserved/.initial=.6} +\ctikzset{tripoles/european buffer port/input height/.initial=0} \ctikzset{tripoles/european not port/width/.initial=1.4} \ctikzset{tripoles/european not port/not height/.initial=.3} \ctikzset{tripoles/european not port/not width/.initial=.8} @@ -907,6 +1150,8 @@ \ctikzset{tripoles/european xor port/inputs/.initial=2} \ctikzset{tripoles/european xnor port/origin/.initial=0.8} \ctikzset{tripoles/european xnor port/inputs/.initial=2} +\ctikzset{tripoles/european buffer port/origin/.initial=0.8} +\ctikzset{tripoles/european buffer port/inputs/.initial=1}% \ctikzset{tripoles/european not port/origin/.initial=0.8} \ctikzset{tripoles/european not port/inputs/.initial=1}% %%% parameters that are not used anymore after multi-input @@ -940,61 +1185,88 @@ \ctikzset{noinv output up/.add code={}{\pgf@circuit@oa@oplusuptrue}} \pgfkeys{/tikz/noinv output down/.add code={}{\pgf@circuit@oa@oplusupfalse}} \ctikzset{noinv output down/.add code={}{\pgf@circuit@oa@oplusupfalse}} -% -\ctikzset{tripoles/op amp/width/.initial=1.7} -\ctikzset{tripoles/op amp/port width/.initial=.7} -\ctikzset{tripoles/op amp/height/.initial=1.4} -\ctikzset{tripoles/op amp/input height/.initial=.5} -\ctikzset{tripoles/op amp/up pos/.initial=.45} -\ctikzset{tripoles/op amp/font/.initial= \fontsize{10}{12}\selectfont\boldmath}%absolute font size needed! + +% Operational amplifier +\ctikzset{tripoles/op amp/width/.initial=1.7} % Total width +\ctikzset{tripoles/op amp/port width/.initial=.7} % Terminals length +\ctikzset{tripoles/op amp/height/.initial=1.4} % Total height +\ctikzset{tripoles/op amp/input height/.initial=.5} % Input port vertical separation +\ctikzset{tripoles/op amp/up pos/.initial=.45} % Top and bottom anchor position +\ctikzset{tripoles/op amp/font/.initial= \fontsize{10}{12}\selectfont\boldmath} % Absolute font size needed! + +% Fully differential operational amplifier +\ctikzset{tripoles/fd op amp/width/.initial=1.7} % Total width +\ctikzset{tripoles/fd op amp/port width/.initial=.7} % Terminals length +\ctikzset{tripoles/fd op amp/height/.initial=1.4} % Total height +\ctikzset{tripoles/fd op amp/input height/.initial=.5} % Input port vertical separation +\ctikzset{tripoles/fd op amp/output height/.initial=.5} % Output port vertical separation +\ctikzset{tripoles/fd op amp/up pos/.initial=.45} % Top and bottom anchor position +\ctikzset{tripoles/fd op amp/font/.initial= \fontsize{10}{12}\selectfont\boldmath} % Absolute font size needed! + \ctikzset{tripoles/en amp/width/.initial=1.7} \ctikzset{tripoles/en amp/port width/.initial=.7} \ctikzset{tripoles/en amp/height/.initial=1.6} \ctikzset{tripoles/en amp/input height/.initial=.3} \ctikzset{tripoles/en amp/up pos/.initial=.45} -\ctikzset{tripoles/en amp/font/.initial= \fontsize{10}{12}\selectfont}%absolute font size needed! -\ctikzset{tripoles/en amp/font2/.initial= \fontsize{12}{14}\selectfont}%absolute font size needed! +\ctikzset{tripoles/en amp/font/.initial= \fontsize{10}{12}\selectfont} % Absolute font size needed! +\ctikzset{tripoles/en amp/font2/.initial= \fontsize{12}{14}\selectfont} % Absolute font size needed! \ctikzset{tripoles/en amp/text/.initial={$\mathstrut{\triangleright}\,{\infty}$}} \tikzset{ - en amp text/.code = { - \ctikzsetvalof{tripoles/en amp/text}{#1} + en amp text/.code = {% + \ctikzsetvalof{tripoles/en amp/text}{#1}% }, - en amp text A/.code = { - \ctikzsetvalof{tripoles/en amp/text}{$\mathstrut{\triangleright}\,\mathrm{A}$} + en amp text A/.code = {% + \ctikzsetvalof{tripoles/en amp/text}{$\mathstrut{\triangleright}\,\mathrm{A}$}% }, } -\ctikzset{tripoles/gm amp/width/.initial=1.7} -\ctikzset{tripoles/gm amp/port width/.initial=.7} -\ctikzset{tripoles/gm amp/height/.initial=1.4} -\ctikzset{tripoles/gm amp/input height/.initial=.5} -\ctikzset{tripoles/gm amp/up pos/.initial=.45} -\ctikzset{tripoles/inst amp/width/.initial=1.7} % instrumentation amplifier, simple -\ctikzset{tripoles/inst amp/port width/.initial=.7} -\ctikzset{tripoles/inst amp/height/.initial=1.4} -\ctikzset{tripoles/inst amp/input height/.initial=.5} -\ctikzset{tripoles/inst amp/up pos/.initial=.4} -\ctikzset{tripoles/inst amp/refv pos/.initial=.7} -\ctikzset{tripoles/inst amp/font/.initial= \fontsize{10}{0}\selectfont\boldmath}%absolute font size needed! -\ctikzset{tripoles/fd inst amp/width/.initial=1.7} % instrumentation amplifier, diff output -\ctikzset{tripoles/fd inst amp/port width/.initial=.7} -\ctikzset{tripoles/fd inst amp/height/.initial=1.4} -\ctikzset{tripoles/fd inst amp/input height/.initial=.5} -\ctikzset{tripoles/fd inst amp/up pos/.initial=.4} -\ctikzset{tripoles/fd inst amp/refv pos/.initial=.7} -\ctikzset{tripoles/fd inst amp/font/.initial= \fontsize{10}{0}\selectfont\boldmath}%absolute font size needed! -\ctikzset{tripoles/inst amp ra/width/.initial=2.4} % instrumentation amplifier with ra gain resistance added -\ctikzset{tripoles/inst amp ra/port width/.initial=.7} -\ctikzset{tripoles/inst amp ra/height/.initial=2.9} -\ctikzset{tripoles/inst amp ra/input height/.initial=.7} -\ctikzset{tripoles/inst amp ra/up pos/.initial=.4} -\ctikzset{tripoles/inst amp ra/refv pos/.initial=.7} -\ctikzset{tripoles/inst amp ra/ra pos/.initial=.6} -\ctikzset{tripoles/inst amp ra/font/.initial= \fontsize{10}{0}\selectfont\boldmath}%absolute font size needed! -\ctikzset{tripoles/plain amp/width/.initial=1.7} -\ctikzset{tripoles/plain amp/port width/.initial=.7} -\ctikzset{tripoles/plain amp/height/.initial=1.4} -\ctikzset{tripoles/plain amp/input height/.initial=.5} -\ctikzset{tripoles/plain amp/up pos/.initial=.45} + +% Transconductance amplifier +\ctikzset{tripoles/gm amp/width/.initial=1.7} % Total width +\ctikzset{tripoles/gm amp/port width/.initial=.7} % Terminals length +\ctikzset{tripoles/gm amp/height/.initial=1.4} % Left side of the trapezoid +\ctikzset{tripoles/gm amp/height 2/.initial=0.5} % Right side of the trapezoid +\ctikzset{tripoles/gm amp/input height/.initial=.5} % Input port vertical separation +\ctikzset{tripoles/gm amp/up pos/.initial=.45} % Top and bottom anchor position +\ctikzset{tripoles/gm amp/font/.initial= \fontsize{10}{12}\selectfont\boldmath} % Absolute font size needed! + +% Instrumentation amplifier +\ctikzset{tripoles/inst amp/width/.initial=1.7} % Total width +\ctikzset{tripoles/inst amp/port width/.initial=.7} % Terminals length +\ctikzset{tripoles/inst amp/height/.initial=1.4} % Left side of the trapezoid +\ctikzset{tripoles/inst amp/height 2/.initial=0.6} % Right side of the trapezoid +\ctikzset{tripoles/inst amp/input height/.initial=.5} % Input ports vertical separation +\ctikzset{tripoles/inst amp/up pos/.initial=.4} % Top and bottom anchor position +\ctikzset{tripoles/inst amp/refv pos/.initial=.7} % Top and bottom voltage reference position +\ctikzset{tripoles/inst amp/font/.initial= \fontsize{10}{0}\selectfont\boldmath} % Absolute font size needed! + +% Instrumentation amplifier with differential output +\ctikzset{tripoles/fd inst amp/width/.initial=1.7} % Total width +\ctikzset{tripoles/fd inst amp/port width/.initial=.7} % Terminals length +\ctikzset{tripoles/fd inst amp/height/.initial=1.4} % Left side of the trapezoid +\ctikzset{tripoles/fd inst amp/height 2/.initial=0.6} % Right side of the trapezoid +\ctikzset{tripoles/fd inst amp/input height/.initial=.5} % Input ports vertical separation +\ctikzset{tripoles/fd inst amp/output height/.initial=.5} % Output ports vertical separation +\ctikzset{tripoles/fd inst amp/up pos/.initial=.4} % Top and bottom anchor position +\ctikzset{tripoles/fd inst amp/refv pos/.initial=.7} % Top and bottom voltage reference position +\ctikzset{tripoles/fd inst amp/font/.initial= \fontsize{10}{0}\selectfont\boldmath} % Absolute font size needed! + +% Instrumentation amplifier with gain resistor terminals +\ctikzset{tripoles/inst amp ra/width/.initial=2.4} % Total width +\ctikzset{tripoles/inst amp ra/port width/.initial=.7} % Terminals length +\ctikzset{tripoles/inst amp ra/height/.initial=2.9} % Left side of the trapezoid +\ctikzset{tripoles/inst amp ra/height 2/.initial=0.4} % Right side of the trapezoid +\ctikzset{tripoles/inst amp ra/input height/.initial=.7} % Input ports vertical separation +\ctikzset{tripoles/inst amp ra/up pos/.initial=.4} % Top and bottom anchor position +\ctikzset{tripoles/inst amp ra/refv pos/.initial=.7} % Top and bottom voltage reference position +\ctikzset{tripoles/inst amp ra/ra pos/.initial=.6} % Gain resistor terminals vertical separation +\ctikzset{tripoles/inst amp ra/font/.initial= \fontsize{10}{0}\selectfont\boldmath} % Absolute font size needed! + +% Plain amplifier +\ctikzset{tripoles/plain amp/width/.initial=1.7} % Total width +\ctikzset{tripoles/plain amp/port width/.initial=.7} % Terminals length +\ctikzset{tripoles/plain amp/height/.initial=1.4} % Total height +\ctikzset{tripoles/plain amp/input height/.initial=.5} % Input ports vertical separation +\ctikzset{tripoles/plain amp/up pos/.initial=.45} % Top and bottom anchor position \ctikzset{tripoles/thyristor/height/.initial=1.10} \ctikzset{tripoles/thyristor/height 2/.initial=.5} @@ -1055,26 +1327,25 @@ \ctikzset{/tikz/circuitikz/tripoles/magnetron/width/.initial=1} \ctikzset{quadpoles style/.is choice} -\ctikzset{quadpoles style/inward/.code={ % default value - \ctikzset{quadpoles/transformer/inner=0.4} - \ctikzset{quadpoles/transformer/width=1.5} - \ctikzset{quadpoles/transformer core/inner=0.4} - \ctikzset{quadpoles/transformer core/width=1.5} - \ctikzset{quadpoles/gyrator/inner=0.4} - \ctikzset{quadpoles/gyrator/width=1.5} - } +\ctikzset{quadpoles style/inward/.code={% default value + \ctikzset{quadpoles/transformer/inner=0.4}% + \ctikzset{quadpoles/transformer/width=1.5}% + \ctikzset{quadpoles/transformer core/inner=0.4}% + \ctikzset{quadpoles/transformer core/width=1.5}% + \ctikzset{quadpoles/gyrator/inner=0.4}% + \ctikzset{quadpoles/gyrator/width=1.5}% + }% } -\ctikzset{quadpoles style/inline/.code={ % now horizontal baffle - \ctikzset{quadpoles/transformer/inner=1} - \ctikzset{quadpoles/transformer/width=0.6} - \ctikzset{quadpoles/transformer core/inner=1} - \ctikzset{quadpoles/transformer core/width=0.6} - \ctikzset{quadpoles/gyrator/inner=1} - \ctikzset{quadpoles/gyrator/width=0.6} - } +\ctikzset{quadpoles style/inline/.code={% now horizontal baffle + \ctikzset{quadpoles/transformer/inner=1}% + \ctikzset{quadpoles/transformer/width=0.6}% + \ctikzset{quadpoles/transformer core/inner=1}% + \ctikzset{quadpoles/transformer core/width=0.6}% + \ctikzset{quadpoles/gyrator/inner=1} % FIXME + \ctikzset{quadpoles/gyrator/width=0.6}% + }% } - % % multipoles % @@ -1129,7 +1400,7 @@ \ctikzset{multipoles/rotary/arrow/ccw/.code={\pgf@circ@rotaryarrowtrue\pgf@circ@rotaryarrow@cwfalse\pgf@circ@rotaryarrow@ccwtrue}} \tikzset{% - rotary switch/.style args={#1in#2wiper#3}{ + rotary switch/.style args={#1in#2wiper#3}{% shape=rotaryswitch, /tikz/circuitikz/multipoles/rotary/channels=#1, /tikz/circuitikz/multipoles/rotary/angle=#2, @@ -1152,11 +1423,11 @@ /tikz/circuitikz/multipoles/rotary/arrow=both, }, % Notice that these should be the same as the initial values of the keys - rotary switch/.default={5 in 60 wiper 20 }, - rotary switch -/.default={5 in 60 wiper 20 }, - rotary switch <-/.default={5 in 60 wiper 20 }, - rotary switch ->/.default={5 in 60 wiper 20 }, - rotary switch <->/.default={5 in 60 wiper 20 }, + rotary switch/.default={5 in 60 wiper 20}, + rotary switch -/.default={5 in 60 wiper 20}, + rotary switch <-/.default={5 in 60 wiper 20}, + rotary switch ->/.default={5 in 60 wiper 20}, + rotary switch <->/.default={5 in 60 wiper 20}, } % %Mechanical section @@ -1174,8 +1445,8 @@ \ctikzset{bipole/.is family} -\ctikzset{bipole/kind/.initial = } -\ctikzset{bipole/name/.initial = } +\ctikzset{bipole/kind/.initial=} +\ctikzset{bipole/name/.initial=} \newif\ifpgf@circuit@bipole@isvoltage \ctikzset{bipole/is voltage/.is if=pgf@circuit@bipole@isvoltage} \newif\ifpgf@circuit@bipole@voltageoutsideofsymbol @@ -1261,9 +1532,9 @@ \ctikzset{diode/full/.code = \pgf@circuit@fulldiodetrue } \ctikzset{diode/stroke/.code = \pgf@circuit@strokediodetrue} -\tikzset{full diodes/.style = { \circuitikzbasekey/diode = full }} -\tikzset{empty diodes/.style = { \circuitikzbasekey/diode = empty }} -\tikzset{stroke diodes/.style = { \circuitikzbasekey/diode = stroke }} +\tikzset{full diodes/.style = { \circuitikzbasekey/diode = full}} +\tikzset{empty diodes/.style = { \circuitikzbasekey/diode = empty}} +\tikzset{stroke diodes/.style = { \circuitikzbasekey/diode = stroke}} \ctikzset{thickness/.initial=2} \ctikzset{color/.initial=black} @@ -1333,40 +1604,40 @@ \ctikzset{current/distance/.initial = .5} -\tikzset{american currents/.style = { \circuitikzbasekey/current = american } } -\tikzset{european currents/.style = { \circuitikzbasekey/current = european } } -\tikzset{american voltages/.style = { \circuitikzbasekey/voltage = american } } -\tikzset{european voltages/.style = { \circuitikzbasekey/voltage = european } } -\tikzset{american resistors/.style = { \circuitikzbasekey/resistor = american } } -\tikzset{european resistors/.style = { \circuitikzbasekey/resistor = european } } +\tikzset{american currents/.style = {\circuitikzbasekey/current = american}} +\tikzset{european currents/.style = {\circuitikzbasekey/current = european}} +\tikzset{american voltages/.style = {\circuitikzbasekey/voltage = american}} +\tikzset{european voltages/.style = {\circuitikzbasekey/voltage = european}} +\tikzset{american resistors/.style = {\circuitikzbasekey/resistor = american}} +\tikzset{european resistors/.style = {\circuitikzbasekey/resistor = european}} \newif\ifpgf@circuit@europeangfsurgearrester \ctikzset{gas filled surge arrester choice/.is choice} -\ctikzset{gas filled surge arrester choice/european/.code= {\pgf@circuit@europeangfsurgearrestertrue } } -\ctikzset{gas filled surge arrester choice/american/.code= {\pgf@circuit@europeangfsurgearresterfalse } } - -\tikzset{american gas filled surge arrester set/.style = { \circuitikzbasekey/gas filled surge arrester choice=american } } -\tikzset{european gas filled surge arrester set/.style = { \circuitikzbasekey/gas filled surge arrester choice=european } } -\tikzset{american inductors/.style = { \circuitikzbasekey/inductor = american } } -\tikzset{european inductors/.style = { \circuitikzbasekey/inductor = european } } -\tikzset{cute inductors/.style = { \circuitikzbasekey/inductor = cute } } -\tikzset{american ports/.style = { \circuitikzbasekey/logic ports = american } } -\tikzset{european ports/.style = { \circuitikzbasekey/logic ports = european } } -\tikzset{european/.style = { european currents, european voltages, european resistors, european inductors, european ports, european gas filled surge arrester set} } -\tikzset{american/.style = { american currents, american voltages, american resistors, american inductors, american ports, american gas filled surge arrester set} } -\tikzset{cute/.style = { european currents, european voltages, american resistors, cute inductors, american ports } } +\ctikzset{gas filled surge arrester choice/european/.code= {\pgf@circuit@europeangfsurgearrestertrue}} +\ctikzset{gas filled surge arrester choice/american/.code= {\pgf@circuit@europeangfsurgearresterfalse}} + +\tikzset{american gas filled surge arrester set/.style = {\circuitikzbasekey/gas filled surge arrester choice=american}} +\tikzset{european gas filled surge arrester set/.style = {\circuitikzbasekey/gas filled surge arrester choice=european}} +\tikzset{american inductors/.style = {\circuitikzbasekey/inductor = american}} +\tikzset{european inductors/.style = {\circuitikzbasekey/inductor = european}} +\tikzset{cute inductors/.style = {\circuitikzbasekey/inductor = cute}} +\tikzset{american ports/.style = {\circuitikzbasekey/logic ports = american}} +\tikzset{european ports/.style = {\circuitikzbasekey/logic ports = european}} +\tikzset{european/.style = {european currents, european voltages, european resistors, european inductors, european ports, european gas filled surge arrester set}} +\tikzset{american/.style = {american currents, american voltages, american resistors, american inductors, american ports, american gas filled surge arrester set}} +\tikzset{cute/.style = {european currents, european voltages, american resistors, cute inductors, american ports}} % I should try to make the tree clearer (this voltage conflicts with the options above) \newif\ifpgf@circuit@europeanvoltage \ctikzset{voltage/.is choice} -\ctikzset{voltage/american/.code = {\pgf@circuit@europeanvoltagefalse } } -\ctikzset{voltage/european/.code = {\pgf@circuit@europeanvoltagetrue } } +\ctikzset{voltage/american/.code = {\pgf@circuit@europeanvoltagefalse}} +\ctikzset{voltage/european/.code = {\pgf@circuit@europeanvoltagetrue}} \newif\ifpgf@circuit@europeancurrent \ctikzset{current/.is choice} -\ctikzset{current/american/.code = \pgf@circuit@europeancurrentfalse } -\ctikzset{current/european/.code = \pgf@circuit@europeancurrenttrue } +\ctikzset{current/american/.code = \pgf@circuit@europeancurrentfalse} +\ctikzset{current/european/.code = \pgf@circuit@europeancurrenttrue} % noise sources \ctikzset{bipoles/noise sources/fillcolor/.initial=gray!50} @@ -1401,8 +1672,8 @@ \ctikzset{seven seg/bits/.initial=0000000} -\ctikzset{seven seg/value/.code={ - \edef\@@tmp{#1} +\ctikzset{seven seg/value/.code={% + \edef\@@tmp{#1}% \edef\@@n{0} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111110}\fi \edef\@@n{1} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0110000}\fi \edef\@@n{2} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1101101}\fi @@ -1435,13 +1706,13 @@ }} \tikzset{% - seven segment val/.style args={#1dot#2box#3}{ + seven segment val/.style args={#1dot#2box#3}{% shape=bare7seg, /tikz/circuitikz/seven seg/value=#1, /tikz/circuitikz/seven seg/dot=#2, /tikz/circuitikz/seven seg/box=#3, }, - seven segment bits/.style args={#1dot#2box#3}{ + seven segment bits/.style args={#1dot#2box#3}{% shape=bare7seg, /tikz/circuitikz/seven seg/bits=#1, /tikz/circuitikz/seven seg/dot=#2, |