diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/circuitikz')
9 files changed, 168 insertions, 62 deletions
diff --git a/Master/texmf-dist/tex/generic/circuitikz/ctikzstyle-romano.tex b/Master/texmf-dist/tex/generic/circuitikz/ctikzstyle-romano.tex index c244c605c61..d53f87cfc63 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/ctikzstyle-romano.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/ctikzstyle-romano.tex @@ -14,6 +14,8 @@ resistors/thickness=1.0, % Capacitors capacitors/scale=0.7, capacitors/thickness=1.0, +capacitors/width/.try=0.15, % from 1.4.1 +capacitors/height/.try=0.6, % from 1.4.1 % % Inductors (and transformers) inductors/scale=0.8, diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex index 6fc5db6b935..19d377e45c8 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex @@ -728,13 +728,40 @@ \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/width/.initial=.2} \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} +\ctikzset{bipoles/vcapacitor/width/.initial=.2} +\ctikzset{bipoles/vcapacitor/tunable width/.initial=3} +\ctikzset{bipoles/vcapacitor/capacitor width/.code={% + \pgfutil@packagewarning{circuitikz}{vcapacitor/capacitor width deprecated; ignored}% +}}% deprecated \ctikzset{bipoles/piezoelectric/height/.initial=.7} -\ctikzset{bipoles/piezoelectric/width/.initial=.5}% +\ctikzset{bipoles/piezoelectric/width/.initial=.4}% +% +% style settings +% +\ctikzset{capacitors/width/.code={% + \pgfmathsetmacro{\pgfcirc@@double}{2*#1}% + \ctikzset{bipoles/.cd, + capacitor/width=#1, ecapacitor/width=#1, ccapacitor/width=#1, + vcapacitor/width=#1, + piezoelectric/width=\pgfcirc@@double, +}}} +\ctikzset{capacitors/height/.code={% + \ctikzset{bipoles/.cd, + capacitor/height=#1, ecapacitor/height=#1, ccapacitor/height=#1, + vcapacitor/height=#1, + piezoelectric/height=#1, +}}} +\def\pgfcirc@maybe@fill@straight@capacitor{% + \pgfscope + \pgfpathrectanglecorners + {\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} + {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgf@circ@maybefill + \endpgfscope +} %>>> %% Shapes for capacitors%<<< @@ -746,6 +773,8 @@ {\ctikzvalof{bipoles/capacitor/height}} {\ctikzvalof{bipoles/capacitor/width}} { + \pgfcirc@maybe@fill@straight@capacitor + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} @@ -767,6 +796,7 @@ {\ctikzvalof{bipoles/capacitor/height}} {\ctikzvalof{bipoles/capacitor/width}} { + \pgfcirc@maybe@fill@straight@capacitor \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} @@ -791,8 +821,11 @@ {\ctikzvalof{bipoles/pcapacitor/height}} {\ctikzvalof{bipoles/pcapacitor/width}} { + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgfutil@packagewarning{circuitikz}{polar capacitor has been deprecated; change to curved capacitor (see manual)}% + \pgfscope \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left+ \ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}{\pgf@circ@res@up}} \pgftransformrotate{-90} @@ -818,24 +851,37 @@ {\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}} + \pgfscope + \pgfpathmoveto{\pgfpoint{\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/pcapacitor/bend width}\pgf@circ@res@right}} + \pgftransformrotate{90} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathclose{} + \pgf@circ@maybefill + \endpgfscope + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgfscope + % \pgfsetcolor{red} + \pgfpathmoveto{\pgfpoint{\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/pcapacitor/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} \endpgfscope - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} + % extend wire to the curved capacitor + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@right}{0pt}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} \pgfusepath{draw} } - - - %% Electrolytic Capacitor \pgfcircdeclarebipolescaled{capacitors} {} @@ -875,33 +921,30 @@ {\ctikzvalof{bipoles/vcapacitor/height}} {\ctikzvalof{bipoles/vcapacitor/width}} { - \pgf@circ@res@step = \ctikzvalof{bipoles/vcapacitor/capacitor width} \pgf@circ@res@right + \pgfcirc@maybe@fill@straight@capacitor + \pgf@circ@res@step = \ctikzvalof{bipoles/vcapacitor/tunable width} \pgf@circ@res@right \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} - \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@down}} + \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{-\pgf@circ@res@right}{\pgf@circ@res@down}} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} \pgfusepath{draw} \pgfscope \pgf@circ@set@relative@thickness{modifier thickness} \pgfcirc@set@arrows{tunable}{}{latexslim} \ifpgf@circ@fixtunable@dir - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}} \else - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}} \fi \pgfusepath{draw} \endpgfscope - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} - \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{0pt}} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}} \pgfsetlinewidth{\pgfstartlinewidth} \pgfusepath{draw} } @@ -954,12 +997,7 @@ {\ctikzvalof{bipoles/capacitor/height}} {\ctikzvalof{bipoles/capacitor/width}} { - \pgfscope - \pgfpathrectanglecorners - {\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} - {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} - \pgf@circ@maybefill - \endpgfscope + \pgfcirc@maybe@fill@straight@capacitor \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirccurrent.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirccurrent.tex index 49378d367bf..e5c5c760a83 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcirccurrent.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirccurrent.tex @@ -87,6 +87,10 @@ } } +\newif\ifpgfcirc@do@i@symbols\pgfcirc@do@i@symbolstrue +\ctikzset{no i symbols/.code={\pgfcirc@do@i@symbolsfalse}} +\ctikzset{i symbols/.code={\pgfcirc@do@i@symbolstrue}} + \ctikzset{i/.code = { \pgfcirc@has@itrue \pgfkeys{\circuitikzbasekey/bipole/current/direction = forward, @@ -211,10 +215,18 @@ } \fi coordinate (\pgfcirc@a@prefix-Ipos) at ($(\pgfcirc@a@prefix-Ifrom)! \ctikzvalof{current/distance} !(\pgfcirc@a@prefix-Ito)$) + % export the current direction + \pgfextra{\expandafter\xdef\csname pgfcirc@\pgfcirc@a@prefix-Iarrow-direction\endcsname{\pgf@circ@rounded@dir}} % if the current label is not empty (in which case we have already all the anchors) \pgf@circ@ifkeyempty{bipole/current/label/name}\else % put the arrow node - node[currarrow, rotate=\pgf@circ@rounded@dir, anchor=center](Iarrow) at (\pgfcirc@a@prefix-Ipos) {} + % if we do not want the arrow, just put an empty node (needed to maintain the exact same distances) + \ifpgfcirc@do@i@symbols + node[currarrow, rotate=\pgf@circ@rounded@dir, anchor=center](Iarrow) at (\pgfcirc@a@prefix-Ipos) {} + \else + node[currarrow, rotate=\pgf@circ@rounded@dir, anchor=center, + circuitikz/phantom@currarrow](Iarrow) at (\pgfcirc@a@prefix-Ipos) {} + \fi % put the label node[anchor=\pgf@circ@dir, \circuitikzbasekey/bipole current style] (\ctikzvalof{bipole/name}current) diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircflow.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircflow.tex index 77d240cef7f..d59325850d6 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircflow.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircflow.tex @@ -93,6 +93,10 @@ \ctikzset{f>/.style = { f={#1}, \circuitikzbasekey/bipole/flow/direction = forward } } \ctikzset{f^/.style = { f={#1}, \circuitikzbasekey/bipole/flow/y position = above } } +\newif\ifpgfcirc@do@f@symbols\pgfcirc@do@f@symbolstrue +\ctikzset{no f symbols/.code={\pgfcirc@do@f@symbolsfalse}} +\ctikzset{f symbols/.code={\pgfcirc@do@f@symbolstrue}} + \ctikzset{f/.code = { \pgfcirc@has@ftrue \pgfkeys{\circuitikzbasekey/bipole/flow/direction = forward, @@ -214,15 +218,20 @@ % % coordinate (\pgfcirc@a@prefix-Fpos) at % ([yshift=\flow@offset]$(\pgfcirc@a@prefix-Ffrom)! \ctikzvalof{flow/distance} !(\pgfcirc@a@prefix-Fto)$) + % export the flow direction + \pgfextra{\expandafter\xdef\csname pgfcirc@\pgfcirc@a@prefix-Farrow-direction\endcsname{\pgf@circ@rounded@dir}} % if the flow label is not empty (in which case we have already all the anchors) \pgf@circ@ifkeyempty{bipole/flow/label/name}\else % the flow arrow is really a node "flowarrow", not a real arrow - node[flowarrow, rotate=\pgf@circ@rounded@dir, anchor=center](Farrowpos) at (\pgfcirc@a@prefix-Fpos) {} - + \ifpgfcirc@do@f@symbols + node[flowarrow, rotate=\pgf@circ@rounded@dir, anchor=center](Farrowpos) at (\pgfcirc@a@prefix-Fpos) {} + \else + node[flowarrow, rotate=\pgf@circ@rounded@dir, anchor=center, + circuitikz/phantom@flowarrow](Farrowpos) at (\pgfcirc@a@prefix-Fpos) {} + \fi node[anchor=\pgf@circ@dir, \circuitikzbasekey/bipole flow style] (\ctikzvalof{bipole/name}flow) at (Farrowpos.\pgf@circ@bipole@flow@label@where) {\pgf@circ@finallabels{flow/label}} \fi - % adjust from and to before exporting --- it's much more simple like this then rework the algorithm above \ifpgf@circuit@bipole@flow@backward \pgfcirc@swap@coordinates{\pgfcirc@a@prefix-Ffrom}{\pgfcirc@a@prefix-Fto} diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirclabel.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirclabel.tex index 21fc6e8883e..ef115d4c5de 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcirclabel.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirclabel.tex @@ -215,7 +215,8 @@ \expandafter\xdef\csname pgfcirc@\pgfcirc@a@prefix-#1-anchor\endcsname{mid}% } % reset cm is not working correctly here - (pgfcirc@labelcoor)++(\pgf@circ@labposangle:\the\pgf@circ@res@temp) coordinate(pgfcirc@labelcoor) + % relative ++ movement disrupt to[] +() + ($(pgfcirc@labelcoor)+(\pgf@circ@labposangle:\the\pgf@circ@res@temp)$) coordinate(pgfcirc@labelcoor) node[anchor=mid, rotate=\pgfcirclabrot, \circuitikzbasekey/bipole #1 style] (\ctikzvalof{bipole/name}#1){\pgf@circ@finallabels{#1}} } @@ -264,7 +265,8 @@ % the inner sep, so recover it by shifting the anchor % reset cm is not working sometime, use @marmot solution % see https://tex.stackexchange.com/a/476018/38080 - (pgfcirc@labelcoor) ++(-\pgf@circ@labanc:\pgf@circ@res@temp) coordinate(pgfcirc@labelcoor) + % notice that relative ++ movement disrupt to[] +() + ($(pgfcirc@labelcoor)+(-\pgf@circ@labanc:\pgf@circ@res@temp)$) coordinate(pgfcirc@labelcoor) \pgfextra{\def\pgf@circ@labanctext{base}}%base \else \pgfextra{\def\pgf@circ@labanctext{north}}%north @@ -272,13 +274,13 @@ \else \ifnum \pgf@circ@labanc < 90 % shift, as above - (pgfcirc@labelcoor) ++(-\pgf@circ@labanc:\pgf@circ@res@temp) coordinate(pgfcirc@labelcoor) + ($(pgfcirc@labelcoor)+(-\pgf@circ@labanc:\pgf@circ@res@temp)$) coordinate(pgfcirc@labelcoor) \pgfextra{\def\pgf@circ@labanctext{base}}%base \else \ifnum \pgf@circ@labanc > 180 % this shouldn't happen, but somehow it does (270 degree anchors) % shift, as above - (pgfcirc@labelcoor) ++(-\pgf@circ@labanc:\pgf@circ@res@temp) coordinate(pgfcirc@labelcoor) + ($(pgfcirc@labelcoor)+(-\pgf@circ@labanc:\pgf@circ@res@temp)$) coordinate(pgfcirc@labelcoor) \pgfextra{\def\pgf@circ@labanctext{base}}%base \else \pgfextra{\def\pgf@circ@labanctext{north}}%north diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex index ee9d285fff6..405cfd45bb6 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex @@ -130,6 +130,8 @@ \pgfmathanglebetweenpoints{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}} {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}} \edef\pgf@circ@direction{\pgfmathresult} + % the global macro pgfcirc@whatever-direction is accessible as \ctikzgetdirection{whatever} + % this gives access to the element path direction \expandafter\xdef\csname pgfcirc@\pgfcirc@a@prefix-direction\endcsname{\pgf@circ@direction} } % position the component in the middle of the path. We DO NOT MOVE the current position! diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex index ce6e78680b0..4ee224cc9d6 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex @@ -551,6 +551,12 @@ %% Current arrow +%% we need a phantom version of this shape for advanced v-i-f +%% use strange names to keep ot private +\newif\ifpgfcirc@really@draw@currarrow\pgfcirc@really@draw@currarrowtrue +\ctikzset{phantom@currarrow/.code=\pgfcirc@really@draw@currarrowfalse} +\ctikzset{normal@currarrow/.code=\pgfcirc@really@draw@currarrowtrue} + \pgfdeclareshape{currarrow}{ \savedanchor{\northeast}{% \pgf@circ@res@step = \pgf@circ@Rlen @@ -577,22 +583,28 @@ } \behindforegroundpath{ \pgfscope - \pgf@circ@res@step = \pgf@circ@Rlen - \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale} - - \pgfpathmoveto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}} - \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{-.8\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{0pt}} - \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{.8\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}} - \pgfsetcolor{\ctikzvalof{color}} - \pgfusepath{draw,fill} - + \ifpgfcirc@really@draw@currarrow + \pgf@circ@res@step = \pgf@circ@Rlen + \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale} + + \pgfpathmoveto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}} + \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{-.8\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{0pt}} + \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{.8\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}} + \pgfsetcolor{\ctikzvalof{color}} + \pgfusepath{draw,fill} + \fi \endpgfscope } } %% Flow arrow +%% we need a phantom version of this shape for advanced v-i-f +%% use strange names to keep ot private +\newif\ifpgfcirc@really@draw@flowarrow\pgfcirc@really@draw@flowarrowtrue +\ctikzset{phantom@flowarrow/.code=\pgfcirc@really@draw@flowarrowfalse} +\ctikzset{normal@flowarrow/.code=\pgfcirc@really@draw@vlowarrowtrue} \pgfdeclareshape{flowarrow}{ \savedanchor{\northeast}{% @@ -626,14 +638,16 @@ } \behindforegroundpath{ \pgfscope - \pgf@circ@res@step = \pgf@circ@Rlen - \divide \pgf@circ@res@step by 4 - \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{0pt}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}} - \pgfsetcolor{\ctikzvalof{color}} - \pgfusepath{draw} - \pgftransformshift{\pgfpoint{\pgf@circ@res@step}{0pt}} - \pgfnode{currarrow}{tip}{}{}{\pgfusepath{fill}} + \ifpgfcirc@really@draw@flowarrow + \pgf@circ@res@step = \pgf@circ@Rlen + \divide \pgf@circ@res@step by 4 + \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{0pt}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}} + \pgfsetcolor{\ctikzvalof{color}} + \pgfusepath{draw} + \pgftransformshift{\pgfpoint{\pgf@circ@res@step}{0pt}} + \pgfnode{currarrow}{tip}{}{}{\pgfusepath{fill}} + \fi \endpgfscope } } diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex index 2759f80c9c8..8d9a4ad46ae 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex @@ -372,4 +372,23 @@ \fi} \fi +%% +%% generic tunable arrow for components that have no "variable" thing +%% +\def\ctikztunablearrow{\pgfutil@ifnextchar[{\ctikztunablearrow@full}{\ctikztunablearrow@simple}}% +\def\ctikztunablearrow@simple{\ctikztunablearrow@full[]}% +\def\ctikztunablearrow@full[#1]#2#3#4#5{% + % add tunable arrow to a component + % relative thickness, relative length, rotation from axis, name of the component + \begin{scope} + \draw + \pgfextra{\pgfcirc@set@arrows{tunable}{}{latexslim} + \pgfsetlinewidth{#2\pgflinewidth}} [#1] + let \p1=($(#5.north east)-(#5.south west)$), \p2=($(#5.east)-(#5.west)$), + \n1 = {veclen(\x1,\y1)}, + \n2 = {atan2(\y2,\x2)} in + % node[above]{\n1, \n2} + (#5.center) ++({\n2+(#4)}:{-0.5*(\n1)*(#3)}) -- ++({\n2+(#4)}:{(\n1)*(#3)}); + \end{scope}% +} \endinput diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex index 9a393d7d098..855331038d3 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex @@ -55,6 +55,10 @@ \ctikzset{v>/.style = {v={#1}, \circuitikzbasekey/bipole/voltage/direction = forward} } \ctikzset{v</.style = {v={#1}, \circuitikzbasekey/bipole/voltage/direction = backward} }% +\newif\ifpgfcirc@do@v@symbols\pgfcirc@do@v@symbolstrue +\ctikzset{no v symbols/.code={\pgfcirc@do@v@symbolsfalse}} +\ctikzset{v symbols/.code={\pgfcirc@do@v@symbolstrue}} + % Default position varies whether the component is a voltage source % or not \ctikzset{v/.code = { @@ -296,6 +300,7 @@ % called just to set the anchors) % \pgf@circ@ifkeyempty{bipole/voltage/label/name}\else + \ifpgfcirc@do@v@symbols \ifpgf@circuit@europeanvoltage \ifpgf@circuit@bipole@voltage@straight \ifpgf@circuit@bipole@voltage@backward @@ -341,6 +346,7 @@ \fi \fi \fi + \fi % closing the ...symbol \fi % Closing the ...ifempty } % %>>> @@ -385,6 +391,7 @@ coordinate (\pgfcirc@a@prefix-Vlab) at ($(\pgfcirc@a@prefix-Vto)!0.5!(\pgfcirc@a@prefix-Vfrom) $) coordinate (pgfcirc@Vdir) at (\pgfcirc@a@prefix-Vto) \pgf@circ@ifkeyempty{bipole/voltage/label/name}\else + \ifpgfcirc@do@v@symbols \ifpgf@circuit@europeanvoltage \ifpgf@circuit@bipole@voltage@backward (\pgfcirc@a@prefix-Vto) -- node[currarrow, sloped, allow upside down, pos=1, anchor=tip] {} (\pgfcirc@a@prefix-Vfrom) @@ -414,6 +421,7 @@ \fi \fi \fi + \fi % closes ... ifsymbol \fi % closes ...ifempty } % %>>> |