diff options
author | Karl Berry <karl@freefriends.org> | 2021-10-31 21:07:56 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-10-31 21:07:56 +0000 |
commit | 3510255768e52c447c3d8235956be041a40456f3 (patch) | |
tree | 207cc1c978b66953760d212d46adbac4d9c0278e /Master/texmf-dist/tex/generic/circuitikz | |
parent | 943863160772f86ad635c253e6f26cb2c15de76a (diff) |
circuitikz (31oct21)
git-svn-id: svn://tug.org/texlive/trunk@60910 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/circuitikz')
6 files changed, 114 insertions, 17 deletions
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex index d32e7d2e2ee..51af9705f5f 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex @@ -535,6 +535,8 @@ \ctikzset{bipole/name/.initial=} \newif\ifpgf@circuit@bipole@isvoltage \ctikzset{bipole/is voltage/.is if=pgf@circuit@bipole@isvoltage} +\newif\ifpgf@circuit@bipole@override@source@vif +\ctikzset{bipole/override source vif/.is if=pgf@circuit@bipole@override@source@vif} \newif\ifpgf@circuit@bipole@voltageoutsideofsymbol \ctikzset{bipole/is voltageoutsideofsymbol/.is if=pgf@circuit@bipole@voltageoutsideofsymbol} \newif\ifpgf@circuit@bipole@strokedsymbol diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex index d2c2dcbb845..447c2104fbb 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex @@ -3416,6 +3416,19 @@ \pgfusepath{draw} \fi } +% +% --and laser diode arrows - contributed by Andre Alves +% +\def\pgf@circ@draw@laserarrows{% + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfsetarrowsend{latexslim} + \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{1.1\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{-0.4\pgf@circ@res@right}{2.1\pgf@circ@res@up}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{1.1\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.2\pgf@circ@res@right}{2.1\pgf@circ@res@up}} + \pgfusepath{draw} +} %% Black light emitting diode \pgfcircdeclarebipolescaled{diodes} {% fix the anchor border @@ -3443,6 +3456,35 @@ \pgf@circ@draw@ledarrows } +%% Black laser diode - contributed by Andre Alves +\pgfcircdeclarebipolescaled{diodes} +{% fix the anchor border + \pgfcirc@border@extend@updown{1.8}{1} +} +{\ctikzvalof{bipoles/diode/height}} +{fulllaserdiode} +{\ctikzvalof{bipoles/diode/height}} +{\ctikzvalof{bipoles/diode/width}} +{ + + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgfscope + \pgftransformxshift{\pgf@circ@res@left} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} + \pgfusepath{draw,fill} + \endpgfscope + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \pgf@circ@draw@laserarrows +} + %% Black photodiode \pgfcircdeclarebipolescaled{diodes} {% fix the anchor border @@ -3639,6 +3681,30 @@ \pgf@circ@draw@ledarrows } +%% Empty laser diode - contributed by Andre Alves +\pgfcircdeclarebipolescaled{diodes} +{% fix the anchor border + \pgfcirc@border@extend@updown{1.8}{1} +} +{\ctikzvalof{bipoles/diode/height}} +{emptylaserdiode} +{\ctikzvalof{bipoles/diode/height}} +{\ctikzvalof{bipoles/diode/width}} +{ + + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgfscope + \pgf@circ@basicdiodeshape + \endpgfscope + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \pgf@circ@draw@laserarrows +} + %% Empty photodiode \pgfcircdeclarebipolescaled{diodes} {% fix the anchor border @@ -4056,6 +4122,8 @@ \pgfcirc@style@to@style{#1 tunnel diode}{tD#2} \pgfcirc@activate@bipole{l}{#1lediode}{#1lediode}{#1 led} \pgfcirc@style@to@style{#1 led}{leD#2} + \pgfcirc@activate@bipole{l}{#1laserdiode}{#1laserdiode}{#1 laser diode} + \pgfcirc@style@to@style{#1 laser diode}{lasD#2} \pgfcirc@activate@bipole{l}{#1pdiode}{#1pdiode}{#1 photodiode} \pgfcirc@style@to@style{#1 photodiode}{pD#2} \pgfcirc@activate@bipole{l}{#1varcap}{#1varcap}{#1 varcap} @@ -4090,6 +4158,8 @@ \pgfcirc@style@to@style{#1 tunnel diode}{tD#2} \pgfcirc@node@to@style{l}{emptylediode}{#1 led}{\circuitikzbasekey/bipole/is strokedsymbol=true} \pgfcirc@style@to@style{#1 led}{leD#2} + \pgfcirc@node@to@style{l}{emptylaserdiode}{#1 laser diode}{\circuitikzbasekey/bipole/is strokedsymbol=true} + \pgfcirc@style@to@style{#1 laser diode}{lasD#2} \pgfcirc@node@to@style{l}{emptypdiode}{#1 photodiode}{\circuitikzbasekey/bipole/is strokedsymbol=true} \pgfcirc@style@to@style{#1 photodiode}{pD#2} \pgfcirc@node@to@style{l}{emptyvarcap}{#1 varcap}{\circuitikzbasekey/bipole/is strokedsymbol=true} @@ -4126,6 +4196,10 @@ \pgfcirc@style@to@style{led}{leD} \pgfcirc@style@to@style{\pgfcircdiodestylemacro photodiode}{photodiode} \pgfcirc@style@to@style{photodiode}{pD} + +\pgfcirc@style@to@style{\pgfcircdiodestylemacro laser diode}{laser diode} +\pgfcirc@style@to@style{laser diode}{lasD} + \pgfcirc@style@to@style{\pgfcircdiodestylemacro varcap}{varcap} \pgfcirc@style@to@style{varcap}{VC} \pgfcirc@style@to@style{\pgfcircdiodestylemacro bidirectionaldiode}{bidirectionaldiode} diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirccurrent.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirccurrent.tex index e5c5c760a83..77b02d53195 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcirccurrent.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirccurrent.tex @@ -93,6 +93,10 @@ \ctikzset{i/.code = { \pgfcirc@has@itrue + \ifpgf@circuit@bipole@override@source@vif + \pgf@circuit@bipole@isvoltagefalse + \pgf@circuit@bipole@iscurrentfalse + \fi \pgfkeys{\circuitikzbasekey/bipole/current/direction = forward, \circuitikzbasekey/bipole/current/x position = after, \circuitikzbasekey/bipole/current/y position = above } diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircflow.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircflow.tex index d59325850d6..3d03925b527 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircflow.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircflow.tex @@ -99,6 +99,10 @@ \ctikzset{f/.code = { \pgfcirc@has@ftrue + \ifpgf@circuit@bipole@override@source@vif + \pgf@circuit@bipole@isvoltagefalse + \pgf@circuit@bipole@iscurrentfalse + \fi \pgfkeys{\circuitikzbasekey/bipole/flow/direction = forward, \circuitikzbasekey/bipole/flow/x position = after, \circuitikzbasekey/bipole/flow/y position = above } diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex index 2dd2eee9a90..6f07d6042f1 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex @@ -4403,6 +4403,10 @@ \northeast \pgf@y=-\ctikzvalof{tripoles/#1/gate height}\pgf@y } + \anchor{nobase}{ + \left + \pgf@x=\ctikzvalof{tripoles/#1/gate width}\pgf@x + } } { % add the circle if requested (before everything else, so we can fill it) @@ -4485,18 +4489,20 @@ \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}} \endpgfscope %draw gate - \ifpgf@circuit@trans@ntype - \pgfpathmoveto{\pgfpoint - {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left} - {\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}% - {\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}} - \else - \pgfpathmoveto{\pgfpoint - {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left} - {\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}% - {\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@up}} + \ifpgf@circuit@bpt@drawgate + \ifpgf@circuit@trans@ntype + \pgfpathmoveto{\pgfpoint + {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left} + {\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}% + {\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}} + \else + \pgfpathmoveto{\pgfpoint + {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left} + {\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}% + {\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@up}} + \fi \fi \pgfusepath{draw} } diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex index 855331038d3..75543f42a5d 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex @@ -63,6 +63,10 @@ % or not \ctikzset{v/.code = { \pgfcirc@has@vtrue + \ifpgf@circuit@bipole@override@source@vif + \pgf@circuit@bipole@isvoltagefalse + \pgf@circuit@bipole@iscurrentfalse + \fi \ifpgf@circuit@bipole@isvoltage \pgfkeys{\circuitikzbasekey/bipole/voltage/position=above, \circuitikzbasekey/bipole/voltage/direction=forward} @@ -533,7 +537,9 @@ % take into account scaling \setscaledRlenforclass - + % set the macro for detecting open + \edef\@@kind{\ctikzvalof{bipole/kind}}\edef\@@open{open} + % start voltage label adjustment \ifpgf@circuit@europeanvoltage \ifpgf@circuit@bipole@voltage@straight % check for straight @@ -543,6 +549,8 @@ % \typeout{ST:ADJUSTED\space for\space \ctikzvalof{bipole/kind} \space at \space \stdist} }{\edef\labeldist{\ctikzvalof{voltage/straight label distance}}} \ifpgf@circ@debugv\edef\whichtypeshift{STR}\fi + % do not labelshift for legacy straight open; 1.4 makes the shift null + \ifx\@@kind\@@open\ifpgf@adjust@open@voltage\else\edef\labeldist{1.4}\fi\fi \else % check for european \edef\pgf@temp{/tikz/circuitikz/bipoles/\ctikzvalof{bipole/kind}/voltage/european label distance} @@ -572,7 +580,6 @@ {\pgfmathsetmacro{\partheightf}{0.5*\ctikzvalof{bipoles/\ctikzvalof{bipole/kind}/height}} \edef\partheight{\partheightf\pgf@circ@scaled@Rlen}} {\edef\partheight{(.5\pgf@circ@scaled@Rlen)}} %fallback to fixed value - \ifpgf@circuit@bipole@isvoltage \pgfmathsetlength{\pgfcirc@labelshift}{(\labeldist-1.2)*\partheight} \else @@ -580,8 +587,7 @@ \fi % the value for the european was by default 1.4 \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners! - % set the macro for detecting open - \edef\@@kind{\ctikzvalof{bipole/kind}}\edef\@@open{open} + % stop the detection of open if I do not want special treatment \ifpgf@adjust@open@voltage\else\edef\@@open{this-will-nEver-match}\fi % \typeout{KIND\space\@@kind} }%end pgfextra @@ -608,7 +614,8 @@ \else \ifx\@@kind\@@open % override pgfcirc@Vlab - coordinate (\pgfcirc@a@prefix-Vlab) at ($(pgfcirc@Vfrom@flat)!0.5!(pgfcirc@Vto@flat)$)\fi + coordinate (\pgfcirc@a@prefix-Vlab) at ($(pgfcirc@Vfrom@flat)!0.5!(pgfcirc@Vto@flat)$) + \fi \fi \ifpgf@circ@debugv |