diff options
author | Karl Berry <karl@freefriends.org> | 2019-10-12 22:06:25 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-10-12 22:06:25 +0000 |
commit | 99ec425b8fb26a84dadfc706c8f58738321c0e98 (patch) | |
tree | e1c8c5a5a54dde4bf050b34fd697f970d559515f /Master/texmf-dist/tex/generic | |
parent | 661224f6f6665b1a5928a419b2415190887cdfa4 (diff) |
circuitikz (13oct19)
git-svn-id: svn://tug.org/texlive/trunk@52354 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic')
9 files changed, 284 insertions, 57 deletions
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex index 200230b50a5..28e41a24d06 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex @@ -138,6 +138,36 @@ % use \pgf@circ@setlinewidth{none}{\pgflinewidth} if there is no legacy case \ctikzset{none/thickness/.initial=1.0} % do not touch +%% font changes compatible with plain/LaTeX/ConTeXt +%% thanks to Henri Menke https://github.com/circuitikz/circuitikz/issues/285#issuecomment-537224605 + +\ifpgfutil@format@is@latex + \long\def\pgf@circ@font@tiny{\tiny} + \long\def\pgf@circ@font@small{\small} + \long\def\pgf@circ@font@bold{\textbf} + \long\def\pgf@circ@font@boldmath{\boldmath} + \long\def\pgf@circ@font@sixbm{\fontsize{6}{7}\selectfont\boldmath} + \long\def\pgf@circ@font@tenbm{\fontsize{10}{12}\selectfont\boldmath} + \long\def\pgf@circ@font@twelve{\fontsize{12}{14}\selectfont} +\else\ifpgfutil@format@is@plain + \long\def\pgf@circ@font@tiny{\fiverm} + \long\def\pgf@circ@font@small{\sevenrm} + \long\def\pgf@circ@font@bold#1{{\bf#1}} + \long\def\pgf@circ@font@boldmath{\bf} % to be tested + \long\def\pgf@circ@font@sixbm{\sevenrm\bf} % + \long\def\pgf@circ@font@tenbm{\tenrm\bf} % + \long\def\pgf@circ@font@twelve{\twelverm} % +\else\ifpgfutil@format@is@context + \long\def\pgf@circ@font@tiny{\tfxx} + \long\def\pgf@circ@font@small{\tfx} + \long\def\pgf@circ@font@bold{\bold} + \long\def\pgf@circ@font@boldmath{\bold} % to be tested + \long\def\pgf@circ@font@sixbm{\tfx\bold} % + \long\def\pgf@circ@font@tenbm{\normal\bold}% + \long\def\pgf@circ@font@twelve{\tfa} % +\fi\fi\fi + + % voltage options \newif\ifpgf@circ@siunitx @@ -210,6 +240,12 @@ \fi } +% load and enact a style +\def\ctikzsetstyle#1{% + \ctikzloadstyle{#1}% + \tikzset{#1 circuit style}% +} + % global style parameters \ctikzset{default/scale/.initial=1.0} % do not touch \ctikzset{default/fill/.initial=none} % do not touch @@ -371,12 +407,17 @@ \ctikzset{bipoles/ageneric/width=#1}% \ctikzset{bipoles/tgeneric/width=#1}% }} +\ctikzset{wiper pos/.code={% + \ctikzset{bipoles/potentiometer/wiper pos=#1}% + \ctikzset{bipoles/generic potentiometer/wiper pos=#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/potentiometer/wiper pos/.initial=.5} \ctikzset{bipoles/vresistor/height/.initial=.6} \ctikzset{bipoles/vresistor/width/.initial=.8} \ctikzset{bipoles/resistivesens/height/.initial=.6} @@ -404,6 +445,7 @@ \ctikzset{bipoles/generic potentiometer/height/.initial=.80} \ctikzset{bipoles/generic potentiometer/height 2/.initial=.30} \ctikzset{bipoles/generic potentiometer/width/.initial=.80} +\ctikzset{bipoles/generic potentiometer/wiper pos/.initial=.5} \ctikzset{bipoles/ageneric/height/.initial=.30} \ctikzset{bipoles/tgeneric/height/.initial=.70} \ctikzset{bipoles/tgeneric/width/.initial=.80} @@ -414,10 +456,14 @@ \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/ecapacitor/font/.initial=\pgf@circ@font@sixbm} +%%% pcapacitor is deprecated \ctikzset{bipoles/pcapacitor/height/.initial=.6} \ctikzset{bipoles/pcapacitor/width/.initial=.2} \ctikzset{bipoles/pcapacitor/bend width/.initial=1.1} +\ctikzset{bipoles/ccapacitor/height/.initial=.6} +\ctikzset{bipoles/ccapacitor/width/.initial=.12} +\ctikzset{bipoles/ccapacitor/bend width/.initial=1.1} \ctikzset{bipoles/vcapacitor/height/.initial=.6} \ctikzset{bipoles/vcapacitor/width/.initial=.5} \ctikzset{bipoles/vcapacitor/capacitor width/.initial=.4} @@ -1192,7 +1238,7 @@ \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! +\ctikzset{tripoles/op amp/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed! % Fully differential operational amplifier \ctikzset{tripoles/fd op amp/width/.initial=1.7} % Total width @@ -1201,15 +1247,15 @@ \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/fd op amp/font/.initial=\pgf@circ@font@tenbm} % 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=\pgf@circ@font@tenbm} % Absolute font size needed! +\ctikzset{tripoles/en amp/font2/.initial=\pgf@circ@font@twelve} % Absolute font size needed! \ctikzset{tripoles/en amp/text/.initial={$\mathstrut{\triangleright}\,{\infty}$}} \tikzset{ en amp text/.code = {% @@ -1227,7 +1273,7 @@ \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! +\ctikzset{tripoles/gm amp/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed! % Instrumentation amplifier \ctikzset{tripoles/inst amp/width/.initial=1.7} % Total width @@ -1237,7 +1283,7 @@ \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! +\ctikzset{tripoles/inst amp/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed! % Instrumentation amplifier with differential output \ctikzset{tripoles/fd inst amp/width/.initial=1.7} % Total width @@ -1248,7 +1294,7 @@ \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! +\ctikzset{tripoles/fd inst amp/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed! % Instrumentation amplifier with gain resistor terminals \ctikzset{tripoles/inst amp ra/width/.initial=2.4} % Total width @@ -1259,7 +1305,7 @@ \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! +\ctikzset{tripoles/inst amp ra/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed! % Plain amplifier \ctikzset{tripoles/plain amp/width/.initial=1.7} % Total width @@ -1350,7 +1396,7 @@ % multipoles % \ctikzset{multipoles/thickness/.initial=2} -\ctikzset{multipoles/font/.initial=\tiny} +\ctikzset{multipoles/font/.initial=\pgf@circ@font@tiny} % DIP (dual in line package) chips \ctikzset{multipoles/dipchip/width/.initial=1.2} \ctikzset{multipoles/dipchip/num pins/.initial=8} diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex index 0048efb8924..2eaa1cf8e52 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex @@ -386,7 +386,7 @@ \pgfusepath{draw} \pgfsetlinewidth{\pgfstartlinewidth} - \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\tiny$\vartheta$} + \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\pgf@circ@font@tiny$\vartheta$} \pgfsetarrowsend{latexslim} \pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}} @@ -416,7 +416,7 @@ \pgfusepath{draw} \pgfsetlinewidth{\pgfstartlinewidth} - \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\tiny$\vartheta$} + \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\pgf@circ@font@tiny$\vartheta$} \pgfsetarrowsend{latexslim} \pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}} @@ -427,11 +427,17 @@ } %% Generic tunable -\pgfcircdeclarebipolescaled{resistors}{ - \anchor{wiper}{ - \northeast - \pgfpoint{0pt}{\pgf@y} - } +\pgfcircdeclarebipolescaled{resistors} +{ + \savedanchor{\wiper}{ + \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen + \pgf@ya=\ctikzvalof{bipoles/generic potentiometer/height}\pgf@circ@scaled@Rlen + \pgf@y=.5\pgf@ya + \pgf@xa=\ctikzvalof{bipoles/generic potentiometer/width}\pgf@circ@scaled@Rlen + \pgfmathsetlength{\pgf@x}{(\ctikzvalof{bipoles/generic potentiometer/wiper pos}-0.5)*\pgf@xa} + } + \anchor{wiper}{\wiper} + \anchor{W}{\wiper} } {\ctikzvalof{bipoles/generic potentiometer/height 2}} {genericpotentiometer} @@ -450,8 +456,9 @@ \pgfscope %\pgfsetlinewidth{\pgfstartlinewidth} \pgfsetarrowsend{latexslim} - \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}} + \pgfextractx{\pgf@circ@res@other}{\wiper} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}} \pgfusepath{draw} \endpgfscope } @@ -526,12 +533,20 @@ %% Potentiometer \pgfcircdeclarebipolescaled{resistors} { - \anchor{wiper}{\northeast\pgfpoint{0pt}{\pgf@y}} - \anchor{W}{\northeast\pgfpoint{0pt}{\pgf@y}} + \savedanchor{\wiper}{ + \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen + \pgf@ya=\ctikzvalof{bipoles/potentiometer/height}\pgf@circ@scaled@Rlen + \pgf@y=.5\pgf@ya + \pgf@xa=\ctikzvalof{bipoles/potentiometer/width}\pgf@circ@scaled@Rlen + \pgfmathsetlength{\pgf@x}{(\ctikzvalof{bipoles/potentiometer/wiper pos}-0.5)*\pgf@xa} + } + \anchor{wiper}{\wiper} + \anchor{W}{\wiper} \savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}} } {\ctikzvalof{bipoles/potentiometer/height 2}} -{potentiometer}{\ctikzvalof{bipoles/potentiometer/height}} +{potentiometer} +{\ctikzvalof{bipoles/potentiometer/height}} {\ctikzvalof{bipoles/potentiometer/width}} { \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} @@ -542,8 +557,9 @@ \pgfscope %\pgfsetlinewidth{\pgfstartlinewidth} \pgfsetarrowsend{latexslim} - \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}} + \pgfextractx{\pgf@circ@res@other}{\wiper} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}} \pgfusepath{draw} \endpgfscope } @@ -619,7 +635,7 @@ \endpgfscope } -%% Polar Capacitor +%% Polar Capacitor (DEPRECATED) \pgfcircdeclarebipolescaled{capacitors} {} {\ctikzvalof{bipoles/pcapacitor/height}} @@ -640,9 +656,38 @@ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} \pgfusepath{draw} +} + + +%% Curved capacitor +% see https://tex.stackexchange.com/questions/509594/polar-capacitor-orientation-in-circuitikz-seems-wrong +% for a rationale +% +\pgfcircdeclarebipolescaled{capacitors} +{} +{\ctikzvalof{bipoles/ccapacitor/height}} +{ccapacitor} +{\ctikzvalof{bipoles/ccapacitor/height}} +{\ctikzvalof{bipoles/ccapacitor/width}} +{ + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgfscope + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right+ \ctikzvalof{bipoles/ccapacitor/bend width}\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgftransformrotate{-90} + \pgfpathsine{\pgfpoint{\pgf@circ@res@up}{-\ctikzvalof{bipoles/ccapacitor/bend width}\pgf@circ@res@right}} + \pgfpathcosine{\pgfpoint{\pgf@circ@res@up}{\ctikzvalof{bipoles/ccapacitor/bend width}\pgf@circ@res@right}} + \pgfusepath{draw} + \endpgfscope + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfusepath{draw} } + + + %% Electrolytic Capacitor \pgfcircdeclarebipolescaled{capacitors} {} @@ -666,9 +711,9 @@ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfsetfillcolor{black} + \pgfsetfillcolor{\ctikzvalof{color}} \pgfusepath{draw,fill} - \pgfsetfillcolor{black} + \pgfsetfillcolor{\ctikzvalof{color}} % % plus pole annotation \pgftext[right,at=\pgfpoint{1.2\pgf@circ@res@left}{.6\pgf@circ@res@up}] {\ctikzvalof{bipoles/ecapacitor/font} $+$} @@ -746,7 +791,18 @@ %% cute inductor \pgfcircdeclarebipolescaled{inductors} -{} +{ + \savedanchor{\midtap}{% + \pgf@x=0pt\relax + \pgfmathsetlength{\pgf@y}{% + (mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?% + \ctikzvalof{bipoles/cuteinductor/height} :% even + -\ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd + *\pgf@circ@scaled@Rlen/2 + } + } + \anchor{midtap}{\midtap} +} {\ctikzvalof{bipoles/cuteinductor/lower coil height}} {cuteinductor} {\ctikzvalof{bipoles/cuteinductor/height}} @@ -778,6 +834,16 @@ \pgfcircdeclarebipolescaled{inductors} {% anchor for labelling the type of dependency \anchor{label}{\southwest\pgf@x=0.8\pgf@x\pgf@y=2.6\pgf@y}% + \savedanchor{\midtap}{% + \pgf@x=0pt\relax + \pgfmathsetlength{\pgf@y}{% + (mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?% + \ctikzvalof{bipoles/cuteinductor/height} :% even + -\ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd + *\pgf@circ@scaled@Rlen/2 + } + } + \anchor{midtap}{\midtap} } {\ctikzvalof{bipoles/cuteinductor/lower coil height}} {scuteinductor} @@ -814,7 +880,18 @@ %% cute choke \pgfcircdeclarebipolescaled{inductors} -{} +{ + \savedanchor{\midtap}{% + \pgf@x=0pt\relax + \pgfmathsetlength{\pgf@y}{% + (mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?% + \ctikzvalof{bipoles/cuteinductor/height} :% even + -\ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd + *\pgf@circ@scaled@Rlen/2 + } + } + \anchor{midtap}{\midtap} +} {\ctikzvalof{bipoles/cutechoke/lower coil height}} {cutechoke} {\ctikzvalof{bipoles/cutechoke/height}} @@ -858,7 +935,18 @@ %% variable cute inductor \pgfcircdeclarebipolescaled{inductors} -{} +{ + \savedanchor{\midtap}{% + \pgf@x=0pt\relax + \pgfmathsetlength{\pgf@y}{% + (mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?% + \ctikzvalof{bipoles/cuteinductor/height} :% even + -\ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd + *\pgf@circ@scaled@Rlen/2 + } + } + \anchor{midtap}{\midtap} +} {\ctikzvalof{bipoles/vcuteinductor/lower coil height}} {vcuteinductor} {\ctikzvalof{bipoles/vcuteinductor/height}} @@ -895,7 +983,18 @@ %% american inductor \pgfcircdeclarebipolescaled{inductors} -{} +{ + \savedanchor{\midtap}{% + \pgf@x=0pt\relax + \pgfmathsetlength{\pgf@y}{% + (mod(\ctikzvalof{bipoles/americaninductor/coils},2) ?% + 2*\ctikzvalof{bipoles/americaninductor/coil height} :% even + 0) %odd + *\pgf@circ@scaled@Rlen/2 + } + } + \anchor{midtap}{\midtap} +} {\ctikzvalof{bipoles/americaninductor/height 2}} {americaninductor} {\ctikzvalof{bipoles/americaninductor/height}} @@ -924,6 +1023,16 @@ \pgfcircdeclarebipolescaled{inductors} {% anchor for labelling the type of dependency \anchor{label}{\southwest\pgf@x=0.8\pgf@x\pgf@y=2.6\pgf@y}% + \savedanchor{\midtap}{% + \pgf@x=0pt\relax + \pgfmathsetlength{\pgf@y}{% + (mod(\ctikzvalof{bipoles/americaninductor/coils},2) ?% + 2*\ctikzvalof{bipoles/americaninductor/coil height} :% even + 0) %odd + *\pgf@circ@scaled@Rlen/2 + } + } + \anchor{midtap}{\midtap} } {\ctikzvalof{bipoles/americaninductor/height 2}} {samericaninductor} @@ -956,7 +1065,18 @@ %% variable american inductor \pgfcircdeclarebipolescaled{inductors} -{} +{ + \savedanchor{\midtap}{% + \pgf@x=0pt\relax + \pgfmathsetlength{\pgf@y}{% + (mod(\ctikzvalof{bipoles/vamericaninductor/coils},2) ?% + 2*\ctikzvalof{bipoles/vamericaninductor/coil height} :% even + 0) %odd + *\pgf@circ@scaled@Rlen/2 + } + } + \anchor{midtap}{\midtap} +} {\ctikzvalof{bipoles/vamericaninductor/height 2}} {vamericaninductor} {\ctikzvalof{bipoles/vamericaninductor/height}} @@ -989,7 +1109,9 @@ %% Generic bipole, filled - used as inductor by some \pgfcircdeclarebipolescaled{inductors} -{} +{ + \anchor{midtap}{\northeast\pgf@x=0pt\relax} +} {\ctikzvalof{bipoles/fullgeneric/height}} {fullgeneric} {\ctikzvalof{bipoles/fullgeneric/height}} @@ -1005,6 +1127,7 @@ \pgfcircdeclarebipolescaled{inductors} {% anchor for labelling the type of dependency \anchor{label}{\southwest\pgf@x=0.4\pgf@x\pgf@y=2\pgf@y}% + \anchor{midtap}{\northeast\pgf@x=0pt\relax} } {\ctikzvalof{bipoles/fullgeneric/height}} {sfullgeneric} @@ -1025,7 +1148,9 @@ %% Generic full tunable \pgfcircdeclarebipolescaled{inductors} -{} +{ + \anchor{midtap}{\northeast\pgf@x=0pt\relax} +} {\ctikzvalof{bipoles/tfullgeneric/height}} {tfullgeneric} {\ctikzvalof{bipoles/tfullgeneric/height}} @@ -2815,7 +2940,7 @@ {\ctikzvalof{bipoles/ammeter/width}} { \drawmeteringcircle - \pgfnode{circle}{center}{\textbf{A}}{}{} + \pgfnode{circle}{center}{\pgf@circ@font@bold{A}}{}{} } %OHMMETER \pgfcircdeclarebipolescaled{instruments} @@ -2837,7 +2962,7 @@ {\ctikzvalof{bipoles/voltmeter/width}} { \drawmeteringcircle - \pgfnode{circle}{center}{\textbf{V}}{}{} + \pgfnode{circle}{center}{\pgf@circ@font@bold{V}}{}{} } @@ -3276,7 +3401,7 @@ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} \pgfusepath{draw} - \pgftext[top,x=.65\pgf@circ@res@left,y=1.2\pgf@circ@res@down]{{\tiny\textsf{U}}} + \pgftext[top,x=.65\pgf@circ@res@left,y=1.2\pgf@circ@res@down]{{\pgf@circ@font@tiny\textsf{U}}} } %%%%%%%%%%%%%% diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirccurrent.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirccurrent.tex index 88cd79aa5b8..cc2bf8de14d 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcirccurrent.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirccurrent.tex @@ -10,6 +10,15 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Current handling +%% styles +\ctikzset{bipole current style/.style={}} +\tikzset{bipole current style/.code={ + \ctikzset{bipole current style/.style={#1}} +}} +\tikzset{bipole current append style/.code={ + \ctikzset{bipole current style/.append style={#1}} +}} + %% Options \ctikzset{i^>/.style = { i = #1, @@ -192,7 +201,9 @@ } \fi coordinate[currarrow,pos=\ctikzvalof{current/distance},rotate=\pgf@circ@ffffff](Iarrow) - (Iarrow.\pgf@circ@bipole@current@label@where) node[anchor=\pgf@circ@dir]{\pgf@circ@finallabels{current/label}} + (Iarrow.\pgf@circ@bipole@current@label@where) + node[anchor=\pgf@circ@dir, \circuitikzbasekey/bipole current style] + (\ctikzvalof{bipole/name}current){\pgf@circ@finallabels{current/label}} } \endinput diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircflow.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircflow.tex index 7995725d6d6..6af0af0ee04 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircflow.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircflow.tex @@ -10,6 +10,15 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% flow handling +%% styles +\ctikzset{bipole flow style/.style={}} +\tikzset{bipole flow style/.code={ + \ctikzset{bipole flow style/.style={#1}} +}} +\tikzset{bipole flow append style/.code={ + \ctikzset{bipole flow style/.append style={#1}} +}} + %% Options \ctikzset{f^>/.style = { f = #1, @@ -187,7 +196,8 @@ \fi } coordinate[flowarrow,pos=\ctikzvalof{flow/distance},rotate=\pgf@circ@ffffff,yshift=\flow@offset](Farrowpos) - (Farrowpos.\pgf@circ@bipole@flow@label@where) node[anchor=\pgf@circ@dir]{ \pgf@circ@finallabels{flow/label}} + (Farrowpos.\pgf@circ@bipole@flow@label@where) node[anchor=\pgf@circ@dir, \circuitikzbasekey/bipole flow style] + (\ctikzvalof{bipole/name}flow){\pgf@circ@finallabels{flow/label}} } \endinput diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirclabel.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirclabel.tex index 0d14585846c..51ecc8574b8 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcirclabel.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirclabel.tex @@ -10,6 +10,23 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Bipole label positioning +%% bipole labels and annotation extra style + +\ctikzset{bipole label style/.style={}} +\tikzset{bipole label style/.code={ + \ctikzset{bipole label style/.style={#1}} +}} +\tikzset{bipole label append style/.code={ + \ctikzset{bipole label style/.append style={#1}} +}} +\ctikzset{bipole annotation style/.style={}} +\tikzset{bipole annotation style/.code={ + \ctikzset{bipole annotation style/.style={#1}} +}} +\tikzset{bipole annotation append style/.code={ + \ctikzset{bipole annotation style/.append style={#1}} +}} + %% Options \ctikzset{label/.style = { l=#1 } } \ctikzset{l/.code = { @@ -188,7 +205,8 @@ } % reset cm is not working correctly here (labelcoor)++(\pgf@circ@labposangle:\the\pgf@circ@res@temp) coordinate(labelcoor) - node[anchor=mid, rotate=\pgfcirclabrot](\ctikzvalof{bipole/name}#1){\pgf@circ@finallabels{#1}} + node[anchor=mid, rotate=\pgfcirclabrot, \circuitikzbasekey/bipole #1 style] + (\ctikzvalof{bipole/name}#1){\pgf@circ@finallabels{#1}} } \def\pgf@circ@drawreglabels#1{ @@ -257,7 +275,7 @@ \fi \fi\fi (labelcoor) node[anchor=\pgf@circ@labanctext, - inner sep=0.5\pgf@circ@res@temp, outer sep=0pt, + inner sep=0.5\pgf@circ@res@temp, outer sep=0pt, \circuitikzbasekey/bipole #1 style, ](\ctikzvalof{bipole/name}#1){\strut\pgf@circ@finallabels{#1}% } } diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex index 0c9bfc12093..07a4a050d41 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex @@ -200,7 +200,9 @@ \def\pgf@circ@capacitor@path#1{\pgf@circ@bipole@path{capacitor}{#1}} \def\pgf@circ@capacitivesens@path#1{\pgf@circ@bipole@path{capacitivesens}{#1}} \def\pgf@circ@ecapacitor@path#1{\pgf@circ@bipole@path{ecapacitor}{#1}} +%% polar capacitor is deprectaed, use curved capacitor instead \def\pgf@circ@polarcapacitor@path#1{\pgf@circ@bipole@path{polarcapacitor}{#1}} +\def\pgf@circ@ccapacitor@path#1{\pgf@circ@bipole@path{ccapacitor}{#1}} \def\pgf@circ@vcapacitor@path#1{\pgf@circ@bipole@path{vcapacitor}{#1}} \def\pgf@circ@piezoelectric@path#1{\pgf@circ@bipole@path{piezoelectric}{#1}} \def\pgf@circ@battery@path#1{\pgf@circ@bipole@path{battery}{#1}} @@ -379,7 +381,9 @@ \compattikzset{capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@capacitor@path, l=#1}} \compattikzset{elko/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ecapacitor@path, l=#1}} \compattikzset{ecapacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ecapacitor@path, l=#1}} +% polar capacitor is deprecated, use curved capacitor instead \compattikzset{polar capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@polarcapacitor@path, l=#1}} +\compattikzset{curved capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ccapacitor@path, l=#1}} \compattikzset{variable capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcapacitor@path, l=#1}} \compattikzset{piezoelectric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@piezoelectric@path, l=#1}} \compattikzset{battery/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@battery@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}} @@ -664,7 +668,9 @@ \compattikzset{pR/.style= {\comnpatname potentiometer = #1}} \compattikzset{C/.style = {\comnpatname capacitor = #1}} \compattikzset{eC/.style = {\comnpatname ecapacitor = #1}} +%% pC is deprecated, use cC instead \compattikzset{pC/.style = {\comnpatname polar capacitor = #1}} +\compattikzset{cC/.style = {\comnpatname curved capacitor = #1}} \compattikzset{vC/.style = {\comnpatname variable capacitor = #1}} \compattikzset{PZ/.style = {\comnpatname piezoelectric = #1}} \compattikzset{L/.style = {\comnpatname inductor = #1}} diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex index 1ab0f935b6d..facb041effc 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex @@ -15,6 +15,8 @@ { \savedmacro{\ctikzclass}{\edef\ctikzclass{inductors}} \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}} + % shapename + \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}} \anchor{center}{ \northwest \pgf@x=0pt @@ -195,13 +197,13 @@ \edef\pgf@circ@temp{\ctikzvalof{inductor}}% \def\pgf@temp{european}% \ifx\pgf@temp\pgf@circ@temp% - \pgfnode{fullgenericshape}{center}{}{pgf@inductor1}{\pgfusepath{stroke}} + \pgfnode{fullgenericshape}{center}{}{\thisshape-L1}{\pgfusepath{stroke}} \else% \def\pgf@temp{cute} \ifx\pgf@temp\pgf@circ@temp% - \pgfnode{cuteinductorshape}{center}{}{pgf@inductor1}{\pgfusepath{stroke}} + \pgfnode{cuteinductorshape}{center}{}{\thisshape-L1}{\pgfusepath{stroke}} \else% - \pgfnode{americaninductorshape}{center}{}{pgf@inductor1}{\pgfusepath{stroke}} + \pgfnode{americaninductorshape}{center}{}{\thisshape-L1}{\pgfusepath{stroke}} \fi% \fi% @@ -223,13 +225,13 @@ \edef\pgf@circ@temp{\ctikzvalof{inductor}}% \def\pgf@temp{european}% \ifx\pgf@temp\pgf@circ@temp% - \pgfnode{fullgenericshape}{center}{}{pgf@inductor2}{\pgfusepath{stroke}} + \pgfnode{fullgenericshape}{center}{}{\thisshape-L2}{\pgfusepath{stroke}} \else% \def\pgf@temp{cute} \ifx\pgf@temp\pgf@circ@temp% - \pgfnode{cuteinductorshape}{center}{}{pgf@inductor2}{\pgfusepath{stroke}} + \pgfnode{cuteinductorshape}{center}{}{\thisshape-L2}{\pgfusepath{stroke}} \else% - \pgfnode{americaninductorshape}{center}{}{pgf@inductor2}{\pgfusepath{stroke}} + \pgfnode{americaninductorshape}{center}{}{\thisshape-L2}{\pgfusepath{stroke}} \fi% \fi% @@ -237,17 +239,17 @@ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpointanchor{pgf@inductor1}{b}} + \pgfpathlineto{\pgfpointanchor{\thisshape-L1}{b}} - \pgfpathmoveto{\pgfpointanchor{pgf@inductor1}{a}} + \pgfpathmoveto{\pgfpointanchor{\thisshape-L1}{a}} \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpointanchor{pgf@inductor2}{a}} + \pgfpathlineto{\pgfpointanchor{\thisshape-L2}{a}} - \pgfpathmoveto{\pgfpointanchor{pgf@inductor2}{b}} + \pgfpathmoveto{\pgfpointanchor{\thisshape-L2}{b}} \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex index 6c8df356076..73f1485b2b5 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex @@ -4066,7 +4066,7 @@ \pgfseteorule \pgfusepath{clip} \pgfpathrectangle{\pgfpoint{-.25\pgf@circ@res@step}{-.5\pgf@circ@res@up}}{\pgfpoint{.5\pgf@circ@res@step}{\pgf@circ@res@up}} - \pgfsetfillcolor{black} + \pgfsetfillcolor{\ctikzvalof{color}} \pgfusepath{fill, draw} \endpgfscope \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step} diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex index 158ee2dd79c..bad64d1bd8e 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex @@ -10,6 +10,14 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Voltage management +%% styles +\ctikzset{bipole voltage style/.style={}} +\tikzset{bipole voltage style/.code={ + \ctikzset{bipole voltage style/.style={#1}} +}} +\tikzset{bipole voltage append style/.code={ + \ctikzset{bipole voltage style/.append style={#1}} +}} \ctikzset{v^>/.style = { v = #1, @@ -94,8 +102,6 @@ \def\pgf@circ@avfont{\ctikzvalof{voltage/american font}} % % plus and minus symbols (default is $+$ and $-$, see pgfcirc.defines.tex) -% notice that the double braces are needed to be able -% to use \boldmath in the font (although it is semi-deprecated...) % \def\pgf@circ@avplus{\ctikzvalof{voltage/american plus}} \def\pgf@circ@avminus{\ctikzvalof{voltage/american minus}} @@ -457,8 +463,9 @@ \ifpgf@circuit@bipole@voltage@straight coordinate (Vlab) at ($(pgfcirc@Vto)!0.5!(pgfcirc@Vfrom) $) - node [anchor=\pgf@circ@bipole@voltage@label@anchor, inner sep=2pt] - at (Vlab) { \pgf@circ@finallabels{voltage/label} } + node [anchor=\pgf@circ@bipole@voltage@label@anchor, inner sep=2pt, + \circuitikzbasekey/bipole voltage style](\ctikzvalof{bipole/name}voltage) + at (Vlab) {\pgf@circ@finallabels{voltage/label}} \else \ifpgf@circuit@europeanvoltage coordinate (Vlab) at ($(pgfcirc@Vcont1)!0.5!(pgfcirc@Vcont2)$) @@ -470,7 +477,9 @@ coordinate (Vlab) at ($(Vlab) ! \alshift ! \pgf@circ@bipole@voltage@label@where :(pgfcirc@Vto)$) \fi \fi - node [anchor=\pgf@circ@bipole@voltage@label@anchor, inner sep=2pt] at (Vlab) { \pgf@circ@finallabels{voltage/label} } + node [anchor=\pgf@circ@bipole@voltage@label@anchor, inner sep=2pt, + \circuitikzbasekey/bipole voltage style](\ctikzvalof{bipole/name}voltage) + at (Vlab) {\pgf@circ@finallabels{voltage/label}} \fi }%end drawvoltages \endinput |