diff options
author | Karl Berry <karl@freefriends.org> | 2021-09-06 21:14:19 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-09-06 21:14:19 +0000 |
commit | 6b55d156e26232afcb59f5e05cc912afa1fac942 (patch) | |
tree | f78c146770c654fdb41da39116858e44343f49e5 /Master/texmf-dist/tex/generic | |
parent | 413605d769296bf1a73c81b2438907ffe1ba1102 (diff) |
circuitikz (6sep21)
git-svn-id: svn://tug.org/texlive/trunk@60435 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic')
-rw-r--r-- | Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex | 103 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex | 20 |
2 files changed, 80 insertions, 43 deletions
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex index 228c46e935a..d2c2dcbb845 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex @@ -2164,7 +2164,18 @@ %% Independent double oo source \pgfcircdeclarebipolescaled{sources} -{} +{ + \anchor{centerprim}{ + \northeast + \pgf@y=0pt\relax + \pgf@x=-\ctikzvalof{bipoles/oosource/circleoffset}\pgf@x + } + \anchor{centersec}{ + \northeast + \pgf@y=0pt\relax + \pgf@x=\ctikzvalof{bipoles/oosource/circleoffset}\pgf@x + } +} {\ctikzvalof{bipoles/oosource/height}} {oosource} {\ctikzvalof{bipoles/oosource/height}} @@ -2248,7 +2259,18 @@ % % % % round three-phase transformer \pgfcircdeclarebipolescaled{sources} -{} +{ + \anchor{centerprim}{ + \northeast + \pgf@y=0pt\relax + \pgf@x=-\ctikzvalof{bipoles/oosourcetrans/circleoffset}\pgf@x + } + \anchor{centersec}{ + \northeast + \pgf@y=0pt\relax + \pgf@x=\ctikzvalof{bipoles/oosourcetrans/circleoffset}\pgf@x + } +} {\ctikzvalof{bipoles/oosourcetrans/height}} {oosourcetrans} {\ctikzvalof{bipoles/oosourcetrans/height}} @@ -2330,18 +2352,20 @@ \pgf@y=0pt } \savedanchor{\centerprim}{ - \pgf@circ@scaled@Rlen=\ctikzvalof{bipoles/ooosource/height}\pgf@circ@Rlen - \pgf@circ@scaled@Rlen=-\ctikzvalof{bipoles/ooosource/circleoffset}\pgf@circ@scaled@Rlen + \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen + \pgf@circ@res@other=\ctikzvalof{bipoles/ooosource/height}\pgf@circ@scaled@Rlen + \pgf@circ@res@other=-\ctikzvalof{bipoles/ooosource/circleoffset}\pgf@circ@res@other \pgf@y=0pt - \pgf@x=.5\pgf@circ@scaled@Rlen + \pgf@x=.5\pgf@circ@res@other } \anchor{centerprim}{ \centerprim } \savedanchor{\centersec}{ - \pgf@circ@scaled@Rlen=\ctikzvalof{bipoles/ooosource/height}\pgf@circ@Rlen - \pgf@circ@scaled@Rlen=-\ctikzvalof{bipoles/ooosource/circleoffset}\pgf@circ@scaled@Rlen - \pgfpointpolar{60}{.5\pgf@circ@scaled@Rlen} + \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen + \pgf@circ@res@other=\ctikzvalof{bipoles/ooosource/height}\pgf@circ@scaled@Rlen + \pgf@circ@res@other=-\ctikzvalof{bipoles/ooosource/circleoffset}\pgf@circ@res@other + \pgfpointpolar{60}{.5\pgf@circ@res@other} \pgf@y=-\pgf@y \pgf@x=-\pgf@x } @@ -2349,9 +2373,10 @@ \centersec } \savedanchor{\centertert}{ - \pgf@circ@scaled@Rlen=\ctikzvalof{bipoles/ooosource/height}\pgf@circ@Rlen - \pgf@circ@scaled@Rlen=-\ctikzvalof{bipoles/ooosource/circleoffset}\pgf@circ@scaled@Rlen - \pgfpointpolar{60}{.5\pgf@circ@scaled@Rlen} + \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen + \pgf@circ@res@other=\ctikzvalof{bipoles/ooosource/height}\pgf@circ@scaled@Rlen + \pgf@circ@res@other=-\ctikzvalof{bipoles/ooosource/circleoffset}\pgf@circ@res@other + \pgfpointpolar{60}{.5\pgf@circ@res@other} \pgf@y=\pgf@y \pgf@x=-\pgf@x } @@ -2361,44 +2386,52 @@ % add some anchors in case the are needed :) \anchor{prim1}{ - \pgf@circ@scaled@Rlen=\ctikzvalof{bipoles/ooosource/height}\pgf@circ@Rlen - \pgf@circ@scaled@Rlen=\ctikzvalof{bipoles/ooosource/circlesize}\pgf@circ@scaled@Rlen - \pgfpointadd{\centerprim}{\pgfpointpolar{135}{.5\pgf@circ@scaled@Rlen}} + \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen + \pgf@circ@res@other=\ctikzvalof{bipoles/ooosource/height}\pgf@circ@scaled@Rlen + \pgf@circ@res@other=\ctikzvalof{bipoles/ooosource/circlesize}\pgf@circ@res@other + \pgfpointadd{\centerprim}{\pgfpointpolar{135}{.5\pgf@circ@res@other}} } \anchor{prim2}{ - \pgf@circ@scaled@Rlen=\ctikzvalof{bipoles/ooosource/height}\pgf@circ@Rlen - \pgf@circ@scaled@Rlen=\ctikzvalof{bipoles/ooosource/circlesize}\pgf@circ@scaled@Rlen - \pgfpointadd{\centerprim}{\pgfpointpolar{-135}{.5\pgf@circ@scaled@Rlen}} + \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen + \pgf@circ@res@other=\ctikzvalof{bipoles/ooosource/height}\pgf@circ@scaled@Rlen + \pgf@circ@res@other=\ctikzvalof{bipoles/ooosource/circlesize}\pgf@circ@res@other + \pgfpointadd{\centerprim}{\pgfpointpolar{-135}{.5\pgf@circ@res@other}} } \anchor{sec1}{ - \pgf@circ@scaled@Rlen=\ctikzvalof{bipoles/ooosource/height}\pgf@circ@Rlen - \pgf@circ@scaled@Rlen=\ctikzvalof{bipoles/ooosource/circlesize}\pgf@circ@scaled@Rlen - \pgfpointadd{\centersec}{\pgfpointpolar{0}{.5\pgf@circ@scaled@Rlen}} + \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen + \pgf@circ@res@other=\ctikzvalof{bipoles/ooosource/height}\pgf@circ@scaled@Rlen + \pgf@circ@res@other=\ctikzvalof{bipoles/ooosource/circlesize}\pgf@circ@res@other + \pgfpointadd{\centersec}{\pgfpointpolar{0}{.5\pgf@circ@res@other}} } \anchor{sec2}{ - \pgf@circ@scaled@Rlen=\ctikzvalof{bipoles/ooosource/height}\pgf@circ@Rlen - \pgf@circ@scaled@Rlen=\ctikzvalof{bipoles/ooosource/circlesize}\pgf@circ@scaled@Rlen - \pgfpointadd{\centersec}{\pgfpointpolar{45}{.5\pgf@circ@scaled@Rlen}} + \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen + \pgf@circ@res@other=\ctikzvalof{bipoles/ooosource/height}\pgf@circ@scaled@Rlen + \pgf@circ@res@other=\ctikzvalof{bipoles/ooosource/circlesize}\pgf@circ@res@other + \pgfpointadd{\centersec}{\pgfpointpolar{45}{.5\pgf@circ@res@other}} } \anchor{sec3}{ - \pgf@circ@scaled@Rlen=\ctikzvalof{bipoles/ooosource/height}\pgf@circ@Rlen - \pgf@circ@scaled@Rlen=\ctikzvalof{bipoles/ooosource/circlesize}\pgf@circ@scaled@Rlen - \pgfpointadd{\centersec}{\pgfpointpolar{90}{.5\pgf@circ@scaled@Rlen}} + \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen + \pgf@circ@res@other=\ctikzvalof{bipoles/ooosource/height}\pgf@circ@scaled@Rlen + \pgf@circ@res@other=\ctikzvalof{bipoles/ooosource/circlesize}\pgf@circ@res@other + \pgfpointadd{\centersec}{\pgfpointpolar{90}{.5\pgf@circ@res@other}} } \anchor{tert1}{ - \pgf@circ@scaled@Rlen=\ctikzvalof{bipoles/ooosource/height}\pgf@circ@Rlen - \pgf@circ@scaled@Rlen=\ctikzvalof{bipoles/ooosource/circlesize}\pgf@circ@scaled@Rlen - \pgfpointadd{\centertert}{\pgfpointpolar{0}{.5\pgf@circ@scaled@Rlen}} + \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen + \pgf@circ@res@other=\ctikzvalof{bipoles/ooosource/height}\pgf@circ@scaled@Rlen + \pgf@circ@res@other=\ctikzvalof{bipoles/ooosource/circlesize}\pgf@circ@res@other + \pgfpointadd{\centertert}{\pgfpointpolar{0}{.5\pgf@circ@res@other}} } \anchor{tert2}{ - \pgf@circ@scaled@Rlen=\ctikzvalof{bipoles/ooosource/height}\pgf@circ@Rlen - \pgf@circ@scaled@Rlen=\ctikzvalof{bipoles/ooosource/circlesize}\pgf@circ@scaled@Rlen - \pgfpointadd{\centertert}{\pgfpointpolar{-45}{.5\pgf@circ@scaled@Rlen}} + \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen + \pgf@circ@res@other=\ctikzvalof{bipoles/ooosource/height}\pgf@circ@scaled@Rlen + \pgf@circ@res@other=\ctikzvalof{bipoles/ooosource/circlesize}\pgf@circ@res@other + \pgfpointadd{\centertert}{\pgfpointpolar{-45}{.5\pgf@circ@res@other}} } \anchor{tert3}{ - \pgf@circ@scaled@Rlen=\ctikzvalof{bipoles/ooosource/height}\pgf@circ@Rlen - \pgf@circ@scaled@Rlen=\ctikzvalof{bipoles/ooosource/circlesize}\pgf@circ@scaled@Rlen - \pgfpointadd{\centertert}{\pgfpointpolar{-90}{.5\pgf@circ@scaled@Rlen}} + \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen + \pgf@circ@res@other=\ctikzvalof{bipoles/ooosource/height}\pgf@circ@scaled@Rlen + \pgf@circ@res@other=\ctikzvalof{bipoles/ooosource/circlesize}\pgf@circ@res@other + \pgfpointadd{\centertert}{\pgfpointpolar{-90}{.5\pgf@circ@res@other}} } } {\ctikzvalof{bipoles/ooosource/height}} diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex index ae5fcf38def..e1d7314931e 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex @@ -75,18 +75,22 @@ %% https://github.com/pgf-tikz/pgf/issues/861 %% %% Thanks to "muzimuzhi Z" https://tex.stackexchange.com/a/547085/38080 +%% Thanks to Henri Menke for a faster approach https://github.com/circuitikz/circuitikz/commit/00966c45c42b464fab5429f89f2b7fb414e9b3f7#commitcomment-54592494 %% \pgfkeysifdefined{/pgf/fpu/install only/.@cmd}{% \pgfqkeys{/pgf}{use fpu reciprocal/.code={\pgfkeys{/pgf/fpu/install only={reciprocal}}}}% }{% - \pgfqkeys{/pgf}{use fpu reciprocal/.code={% - \def\pgfmathreciprocal@##1{% - \begingroup - \pgfkeys{/pgf/fpu=true,/pgf/fpu/output format=fixed}% - \pgfmathparse{1/##1}% - \pgfmath@smuggleone\pgfmathresult - \endgroup - }}}% + \pgfkeysifdefined{/pgf/use fpu reciprocal/.@cmd}{% use stock one + }{ + \pgfqkeys{/pgf}{use fpu reciprocal/.code={% + \def\pgfmathreciprocal@##1{% + \begingroup + \pgfmathfloatparsenumber{##1}% + \pgfmathfloatreciprocal@{\pgfmathresult}% + \pgfmathfloattofixed@{\pgfmathresult}% + \pgfmath@smuggleone\pgfmathresult + \endgroup + }}}}% } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |