% Copyright 2007-2009 by Massimo Redaelli % % This file may be distributed and/or modified % % 1. under the LaTeX Project Public License and/or % 2. under the GNU Public License. % % See the file doc/LICENSE for more details. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Voltage management \tikzset{v^>/.style = { v = #1, \circuitikzbasekey/bipole/voltage/direction = forward, \circuitikzbasekey/bipole/voltage/position = above } } \tikzset{v^/.style = { v = #1, \circuitikzbasekey/bipole/voltage/direction = forward, \circuitikzbasekey/bipole/voltage/position = below } } \tikzset{v_/.style = {v = #1, \circuitikzbasekey/bipole/voltage/direction = forward} } \tikzset{v4 \ifnum\pgfcircmathresult <86 \ifpgf@circuit@bipole@voltage@below \def\pgf@circ@bipole@voltage@label@anchor{north west} \else \def\pgf@circ@bipole@voltage@label@anchor{south east} \fi \fi\fi \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95 \ifpgf@circuit@bipole@voltage@below \def\pgf@circ@bipole@voltage@label@anchor{west} \else \def\pgf@circ@bipole@voltage@label@anchor{east} \fi \fi\fi \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176 \ifpgf@circuit@bipole@voltage@below \def\pgf@circ@bipole@voltage@label@anchor{south west} \else \def\pgf@circ@bipole@voltage@label@anchor{north east} \fi \fi\fi \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185 \ifpgf@circuit@bipole@voltage@below \def\pgf@circ@bipole@voltage@label@anchor{south} \else\def\pgf@circ@bipole@voltage@label@anchor{north} \fi \fi\fi \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <256 \ifpgf@circuit@bipole@voltage@below \def\pgf@circ@bipole@voltage@label@anchor{south east} \else\def\pgf@circ@bipole@voltage@label@anchor{north west} \fi \fi\fi \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275 \ifpgf@circuit@bipole@voltage@below \def\pgf@circ@bipole@voltage@label@anchor{east} \else \def\pgf@circ@bipole@voltage@label@anchor{west} \fi \fi\fi \ifnum\pgfcircmathresult >284 \ifnum\pgfcircmathresult <356 \ifpgf@circuit@bipole@voltage@below \def\pgf@circ@bipole@voltage@label@anchor{north east} \else\def\pgf@circ@bipole@voltage@label@anchor{south west} \fi \fi\fi \ifnum\pgfcircmathresult <5 \ifpgf@circuit@bipole@voltage@below \def\pgf@circ@bipole@voltage@label@anchor{north} \else\def\pgf@circ@bipole@voltage@label@anchor{south} \fi \fi \ifnum\pgfcircmathresult >355 \ifpgf@circuit@bipole@voltage@below \def\pgf@circ@bipole@voltage@label@anchor{north} \else\def\pgf@circ@bipole@voltage@label@anchor{south} \fi \fi \ifpgf@circuit@bipole@voltage@below \def\pgf@circ@bipole@voltage@label@where{-90} \else \def\pgf@circ@bipole@voltage@label@where{90} \fi } \ifpgf@circuit@bipole@isvoltage \pgf@circ@drawvoltagegenerator \else \pgf@circ@drawvoltagegeneric \fi coordinate (Vlab) at ($(\ctikzvalof{bipole/name}.center)! \ifpgf@circuit@europeanvoltage\ctikzvalof{voltage/european label distance}\else\ctikzvalof{voltage/american label distance}\fi! (\ctikzvalof{bipole/name}.\pgf@circ@bipole@voltage@label@where)$) node [anchor=\pgf@circ@bipole@voltage@label@anchor, inner sep=0] at (Vlab) { \pgf@circ@finallabel{voltage/} } }