diff options
author | Karl Berry <karl@freefriends.org> | 2016-09-08 21:57:45 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-09-08 21:57:45 +0000 |
commit | 067cb21a3a797493d44fed615554c1e1e1b1ed1a (patch) | |
tree | 0ba609f19517cdb8728fe0b5380a84e92054de4f /Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex | |
parent | b7747c8d4d4d68a76509ac479f1967471d9a58a5 (diff) |
circuitikz (8sep16)
git-svn-id: svn://tug.org/texlive/trunk@42017 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex | 114 |
1 files changed, 77 insertions, 37 deletions
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex index 57fb00e0f0c..5a944419fd8 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex @@ -91,7 +91,33 @@ \def\pgf@circ@drawvoltagegeneric{ \pgfextra{ \ifnum \ctikzvalof{mirror value}=-1 - \ifpgf@circuit@bipole@voltage@below\pgf@circuit@bipole@voltage@belowfalse\else\pgf@circuit@bipole@voltage@belowtrue\fi + \ifpgf@circuit@bipole@inverted + \ifpgf@circuit@bipole@voltage@straight + \def\distfromline{\eudist} + \else + \def\distfromline{\ctikzvalof{voltage/distance from line}\pgf@circ@Rlen} + \fi + \else + \ifpgf@circuit@bipole@voltage@straight + \def\distfromline{-\eudist} + \else + \def\distfromline{-\ctikzvalof{voltage/distance from line}\pgf@circ@Rlen} + \fi + \fi + \else + \ifpgf@circuit@bipole@inverted + \ifpgf@circuit@bipole@voltage@straight + \def\distfromline{-\eudist} + \else + \def\distfromline{-\ctikzvalof{voltage/distance from line}\pgf@circ@Rlen} + \fi + \else + \ifpgf@circuit@bipole@voltage@straight + \def\distfromline{\eudist} + \else + \def\distfromline{\ctikzvalof{voltage/distance from line}\pgf@circ@Rlen} + \fi + \fi \fi \ifpgf@circuit@bipole@voltage@below @@ -109,12 +135,12 @@ { \edef\bumpb{\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/bump b}} } { \edef\bumpb{\ctikzvalof{voltage/bump b}} } } + - coordinate (pgfcirc@mid) at ($(\tikztostart) ! \distacefromnode ! (\ctikzvalof{bipole/name}.left)$) - coordinate (pgfcirc@Vfrom) at ($(pgfcirc@mid) ! -\ctikzvalof{voltage/distance from line}\pgf@circ@Rlen ! \pgf@circ@voltage@angle:(\ctikzvalof{bipole/name}.left)$) - - coordinate (pgfcirc@mid) at ($(\tikztotarget) ! \distacefromnode ! (\ctikzvalof{bipole/name}.right)$) - coordinate (pgfcirc@Vto) at ($(pgfcirc@mid) ! \ctikzvalof{voltage/distance from line}\pgf@circ@Rlen ! \pgf@circ@voltage@angle : (\ctikzvalof{bipole/name}.right)$) + coordinate (pgfcirc@midtmp) at ($(\tikztostart) ! \distacefromnode ! (anchorstartnode)$) + coordinate (pgfcirc@Vfrom) at ($(pgfcirc@midtmp) ! -\distfromline ! \pgf@circ@voltage@angle:(anchorstartnode)$) + coordinate (pgfcirc@mid) at ($(\tikztotarget) ! \distacefromnode ! (anchorendnode)$) + coordinate (pgfcirc@Vto) at ($(pgfcirc@mid) ! \distfromline ! \pgf@circ@voltage@angle : (anchorendnode)$) \ifpgf@circuit@bipole@voltage@below coordinate (pgfcirc@Vcont1) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.-110)$) @@ -125,15 +151,24 @@ \fi \ifpgf@circuit@europeanvoltage - \ifpgf@circuit@bipole@voltage@backward - (pgfcirc@Vto) .. controls (pgfcirc@Vcont2) and (pgfcirc@Vcont1) .. - node[currarrow, sloped, allow upside down, pos=1] {} - (pgfcirc@Vfrom) + \ifpgf@circuit@bipole@voltage@straight + \ifpgf@circuit@bipole@voltage@backward + (pgfcirc@Vto) --(pgfcirc@Vfrom) node[currarrow, sloped, allow upside down, pos=1] {} + \else + (pgfcirc@Vfrom) --(pgfcirc@Vto) node[currarrow, sloped, allow upside down, pos=1] {} + + \fi \else - (pgfcirc@Vfrom) .. controls (pgfcirc@Vcont1) and (pgfcirc@Vcont2) .. - node[currarrow, sloped, allow upside down, pos=1] {} - (pgfcirc@Vto) - \fi + \ifpgf@circuit@bipole@voltage@backward + (pgfcirc@Vto) .. controls (pgfcirc@Vcont2) and (pgfcirc@Vcont1) .. + node[currarrow, sloped, allow upside down, pos=1] {} + (pgfcirc@Vfrom) + \else + (pgfcirc@Vfrom) .. controls (pgfcirc@Vcont1) and (pgfcirc@Vcont2) .. + node[currarrow, sloped, allow upside down, pos=1] {} + (pgfcirc@Vto) + \fi + \fi \else \ifpgf@circuit@bipole@voltage@backward \ifpgf@circ@oldvoltagedirection @@ -178,7 +213,7 @@ \ifpgf@circuit@bipole@voltageoutsideofsymbol % if it is a battery, must put + and - \ifpgf@circuit@bipole@voltage@backward - (pgfcirc@Vcont2) node {$-$} (pgfcirc@Vcont1) node {$+$} + (pgfcirc@Vcont1) node {$-$} (pgfcirc@Vcont2) node {$+$} \else (pgfcirc@Vcont1) node {$+$} (pgfcirc@Vcont2) node {$-$} \fi @@ -247,48 +282,53 @@ \else\def\pgf@circ@bipole@voltage@label@anchor{south} \fi \fi\fi - + + \ifnum \ctikzvalof{mirror value}=-1 + \ifpgf@circuit@bipole@voltage@below + \pgf@circuit@bipole@voltage@belowfalse + \else + \pgf@circuit@bipole@voltage@belowtrue + \fi + \fi + + \ifpgf@circuit@bipole@inverted + \ifpgf@circuit@bipole@voltage@below + \pgf@circuit@bipole@voltage@belowfalse + \else + \pgf@circuit@bipole@voltage@belowtrue + \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 + - \edef\pgf@temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/european label distance} + \edef\pgf@temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/european label + distance} \pgfkeysifdefined{\pgf@temp} { \edef\eudist{\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/european label distance}} } { \edef\eudist{\ctikzvalof{voltage/european label distance}} } - } + + \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners! + } %end pgfextra \ifpgf@circuit@bipole@isvoltage \pgf@circ@drawvoltagegenerator \else \pgf@circ@drawvoltagegeneric \fi + + + (\ctikzvalof{bipole/name}.\pgf@circ@bipole@voltage@label@where) coordinate (Vlab) at ($(\ctikzvalof{bipole/name}.center) ! \ifpgf@circuit@europeanvoltage\eudist\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/} } + at (Vlab) { \pgf@circ@finallabels{voltage/label} } } - - - \endinput - -% coordinate (pgfcirc@Vcont1) at ($ (\ctikzvalof{bipole/name}.center) ! -% \ctikzvalof{voltage/bump b} ! -% (\ctikzvalof{bipole/name}.-110) $) -% coordinate (pgfcirc@Vcont2) at ($ (\ctikzvalof{bipole/name}.center) ! -% \ctikzvalof{voltage/bump b} ! -% (\ctikzvalof{bipole/name}.-70) $) -% \else -% coordinate (pgfcirc@Vcont1) at ($ (\ctikzvalof{bipole/name}.center) ! -% \ctikzvalof{voltage/bump b} ! -% (\ctikzvalof{bipole/name}.110) $) -% coordinate (pgfcirc@Vcont2) at ($ (\ctikzvalof{bipole/name}.center) ! -% \ctikzvalof{voltage/bump b} ! -% (\ctikzvalof{bipole/name}.70) $) -% \fi |