From d29d8c63c8b63c6dab84c18dffc4af2cf7515472 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 14 May 2023 19:37:07 +0000 Subject: circuitikz (14may23) git-svn-id: svn://tug.org/texlive/trunk@67111 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/generic/circuitikz/pgfcirc.defines.tex | 32 +++++++----- .../tex/generic/circuitikz/pgfcircmultipoles.tex | 43 ++++++++++++++++ .../tex/generic/circuitikz/pgfcircquadpoles.tex | 6 ++- .../tex/generic/circuitikz/pgfcircshapes.tex | 42 ++++++---------- .../tex/generic/circuitikz/pgfcirctripoles.tex | 58 +++++++++++++--------- 5 files changed, 117 insertions(+), 64 deletions(-) (limited to 'Master/texmf-dist/tex/generic') diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex index f3a7b7f42e6..ec9f2a8a710 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex @@ -448,6 +448,24 @@ \fi } +% set the color and dash pattern for a subset of the shape, following keys #1/color +% and #1/dash. The keys must exist, and check for none or default for both +\def\pgf@circ@subset@color@dash#1{% + % You *must* be sure that this is called inside a \pgfscope! + \edef\@@none{none}\edef\@@default{default} + \edef\@@tmp{\ctikzvalof{#1/color}} + \ifx\@@tmp\@@default\else + \pgfsetcolor{\@@tmp} + \fi + \edef\@@tmp{\ctikzvalof{#1/dash}} + \ifx\@@tmp\@@default\else + \ifx\@@tmp\@@none + \pgfsetdash{}{0pt}% solid line, override dash + \else + \expandafter\pgfsetdash\expandafter{\@@tmp}{0cm} + \fi + \fi +} %%>>> @@ -944,19 +962,7 @@ \def\pgf@circ@set@optoarrow@style{% % You *must* be sure that this is called inside a \pgfscope! \pgfsetlinewidth{\ctikzvalof{opto arrows/relative thickness}\pgflinewidth} - \edef\@@none{none}\edef\@@default{default} - \edef\@@tmp{\ctikzvalof{opto arrows/color}} - \ifx\@@tmp\@@default\else - \pgfsetcolor{\@@tmp} - \fi - \edef\@@tmp{\ctikzvalof{opto arrows/dash}} - \ifx\@@tmp\@@default\else - \ifx\@@tmp\@@none - \pgfsetdash{}{0pt}% solid line, override dash - \else - \expandafter\pgfsetdash\expandafter{\@@tmp}{0cm} - \fi - \fi + \pgf@circ@subset@color@dash{opto arrows} \pgfcirc@set@arrows{opto}{}{latexslim} } diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircmultipoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircmultipoles.tex index 31aa4eb0736..f48aaac10e4 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircmultipoles.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircmultipoles.tex @@ -1594,6 +1594,49 @@ \repeatpgfmathloop% }% } + +% clock wedge shape, for using in other shapes like muxdemuxes +\pgfdeclareshape{clockwedge}{ + \savedmacro{\ctikzclass}{\edef\ctikzclass{flipflops}} + \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}} + \savedanchor{\northeast}{ + \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen} + \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{multipoles/flipflop/clock wedge size}*\ctikzvalof{multipoles/flipflop/pin spacing}*\pgf@circ@scaled@Rlen} + \pgf@y=\pgf@circ@res@step + \pgf@x=\pgf@circ@res@step + } + \anchor{center}{\pgfpointorigin} + \anchor{north west}{\northeast\pgf@x=0pt } + \anchor{north east}{\northeast} + \anchor{south east}{\northeast\pgf@y=-\pgf@y} + \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=0pt } + \anchor{north}{\northeast\pgf@x=0.5\pgf@x } + \anchor{east}{\northeast\pgf@y=0pt } + \anchor{south}{\northeast\pgf@x=0.5\pgf@x\pgf@y=-\pgf@y} + \anchor{west}{\pgfpointorigin} + \anchor{nw}{\northeast\pgf@x=0pt } + \anchor{ne}{\northeast} + \anchor{se}{\northeast\pgf@y=-\pgf@y} + \anchor{sw}{\northeast\pgf@y=-\pgf@y\pgf@x=0pt } + \anchor{n}{\northeast\pgf@x=0.5\pgf@x } + \anchor{e}{\northeast\pgf@y=0pt } + \anchor{s}{\northeast\pgf@x=0.5\pgf@x\pgf@y=-\pgf@y} + \anchor{w}{\pgfpointorigin} + \anchor{left}{\pgfpointorigin} + \anchor{right}{\northeast\pgf@y=0pt } + \anchor{text}{\northeast\advance \pgf@x by 2pt + \pgf@y=\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax}% to adjust text + \pgf@circ@draw@component{% + \northeast + \pgf@circ@res@up=\pgf@y + \pgf@circ@res@right=\pgf@x + \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} + \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@up}} + \pgfusepath{stroke} + } +} + % %>>> %% Node shapes for mux-demuxes%<<< diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex index 127c2975df5..32a85cb0c9f 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex @@ -27,6 +27,9 @@ \ctikzset{quadpoles/transformer core/height/.initial=1.5} \ctikzset{quadpoles/transformer core/core height/.initial=.5} \ctikzset{quadpoles/transformer core/core width/.initial=.05} +\ctikzset{transformer core/relative thickness/.initial=1} +\ctikzset{transformer core/color/.initial=default} +\ctikzset{transformer core/dash/.initial=default} \ctikzset{quadpoles/gyrator/inner/.initial=0.4} \ctikzset{quadpoles/gyrator/width/.initial=1.5} \ctikzset{quadpoles/gyrator/height/.initial=1.5} @@ -291,7 +294,8 @@ \pgf@circ@drawtransformerbasicbody % use the chocke line thickness - \pgfsetlinewidth{\ctikzvalof{bipoles/cutechoke/cthick}\pgflinewidth} + \pgfsetlinewidth{\ctikzvalof{bipoles/cutechoke/cthick}*\ctikzvalof{transformer core/relative thickness}*\pgflinewidth} + \pgf@circ@subset@color@dash{transformer core} % Find the distance from center for the lines representing the core % the 2.5 is for backward compatibility --- the distance was calculated as a fraction diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex index 07f3ac987bb..6c0229c3d68 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex @@ -582,6 +582,10 @@ %% crossings%<<< % full nodes for wire crossing +% styling for the vertical wire (default: do none) +\ctikzset{crossing vertical/relative thickness/.initial=1} +\ctikzset{crossing vertical/color/.initial=default} +\ctikzset{crossing vertical/dash/.initial=default} \pgfdeclareshape{jump crossing} { @@ -591,18 +595,7 @@ \pgf@x=-\pgf@y } \anchor{center}{ \pgf@y=0pt \pgf@x=0pt } - \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x } - \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x } - \anchor{west}{ \northwest \pgf@y=0pt } - \anchor{w}{ \northwest \pgf@y=0pt } - \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y } - \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y } - \anchor{north}{ \northwest \pgf@x=0pt } - \anchor{n}{ \northwest \pgf@x=0pt } - \anchor{south west}{ \northwest \pgf@y=-\pgf@y } - \anchor{north east}{ \northwest \pgf@x=-\pgf@x } - \anchor{north west}{ \northwest } - \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y } + \pgfcirc@northwest@symmetric@geoanchors \pgf@circ@draw@component{ \northwest \pgf@circ@res@up = \pgf@y @@ -615,13 +608,17 @@ \pgfpatharc{0}{-180}{0.4*\pgf@circ@res@left} \pgfsetbeveljoin \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} + \pgfusepath{draw} % vertical, broken path + % styling of vertical line + \pgfsetlinewidth{\ctikzvalof{crossing vertical/relative thickness}\pgflinewidth} + \pgf@circ@subset@color@dash{crossing vertical} + % \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{0pt}{0.5\pgf@circ@res@up}} \pgfpathmoveto{\pgfpoint{0pt}{0.3\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} \pgfusepath{draw} - } } \pgfdeclareshape{plain crossing} @@ -632,18 +629,7 @@ \pgf@x=-\pgf@y } \anchor{center}{ \pgf@y=0pt \pgf@x=0pt } - \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x } - \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x } - \anchor{west}{ \northwest \pgf@y=0pt } - \anchor{w}{ \northwest \pgf@y=0pt } - \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y } - \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y } - \anchor{north}{ \northwest \pgf@x=0pt } - \anchor{n}{ \northwest \pgf@x=0pt } - \anchor{south west}{ \northwest \pgf@y=-\pgf@y } - \anchor{north east}{ \northwest \pgf@x=-\pgf@x } - \anchor{north west}{ \northwest } - \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y } + \pgfcirc@northwest@symmetric@geoanchors \pgf@circ@draw@component{ \northwest \pgf@circ@res@up = \pgf@y @@ -653,13 +639,17 @@ % horizontal jumper \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} + \pgfusepath{draw} % vertical, broken path + % styling of vertical line + \pgfsetlinewidth{\ctikzvalof{crossing vertical/relative thickness}\pgflinewidth} + \pgf@circ@subset@color@dash{crossing vertical} + % \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{0pt}{0.1\pgf@circ@res@up}} \pgfpathmoveto{\pgfpoint{0pt}{0.1\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} \pgfusepath{draw} - } } % %>>> diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex index d3bd3dd76cc..39a01b5d90b 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex @@ -3359,7 +3359,7 @@ \ctikzset{transistor circle/.is family} \ctikzset{transistor circle/relative thickness/.initial=1} \ctikzset{transistor circle/color/.initial=default} -\ctikzset{transistor circle/dash/.initial=none} +\ctikzset{transistor circle/dash/.initial=default} \ctikzset{transistor circle/scale circle radius/.initial=1} \ctikzset{transistor circle/default base in/.initial=0.9} \ctikzset{transistor circle/njfet base in/.initial=1.05} @@ -3380,7 +3380,37 @@ \ctikzset{transistor bodydiode/relative thickness/.initial=1} \ctikzset{transistor bodydiode/color/.initial=default} \ctikzset{transistor bodydiode/dash/.initial=default} - +% this is unfortunate, but needed for backward compatibility +\ctikzset{transistor bodydiode/scale/.code={% + \ctikzset{tripoles/nmos/bodydiode scale=#1}% + \ctikzset{tripoles/pmos/bodydiode scale=#1}% + \ctikzset{tripoles/nmosd/bodydiode scale=#1}% + \ctikzset{tripoles/pmosd/bodydiode scale=#1}% + \ctikzset{tripoles/hemt/bodydiode scale=#1}% + \ctikzset{tripoles/nfet/bodydiode scale=#1}% + \ctikzset{tripoles/pfet/bodydiode scale=#1}% + \ctikzset{tripoles/nfetd/bodydiode scale=#1}% + \ctikzset{tripoles/pfetd/bodydiode scale=#1}% + \ctikzset{tripoles/nigfete/bodydiode scale=#1}% + \ctikzset{tripoles/nigfetd/bodydiode scale=#1}% + \ctikzset{tripoles/nigfetebulk/bodydiode scale=#1}% + \ctikzset{tripoles/pigfete/bodydiode scale=#1}% + \ctikzset{tripoles/pigfetd/bodydiode scale=#1}% + \ctikzset{tripoles/pigfetebulk/bodydiode scale=#1}% + \ctikzset{tripoles/npn/bodydiode scale=#1}% + \ctikzset{tripoles/pnp/bodydiode scale=#1}% + \ctikzset{tripoles/pigbt/bodydiode scale=#1}% + \ctikzset{tripoles/nigbt/bodydiode scale=#1}% + \ctikzset{tripoles/Lpigbt/bodydiode scale=#1}% + \ctikzset{tripoles/Lnigbt/bodydiode scale=#1}% + \ctikzset{tripoles/njfet/bodydiode scale=#1}% + \ctikzset{tripoles/pjfet/bodydiode scale=#1}% + \ctikzset{tripoles/nujt/bodydiode scale=#1}% + \ctikzset{tripoles/pujt/bodydiode scale=#1}% + \ctikzset{tripoles/isfet/bodydiode scale=#1}% + \ctikzset{tripoles/pgfet/bodydiode scale=#1}% + \ctikzset{tripoles/ngfet/bodydiode scale=#1}% +}} %%>>> @@ -3441,15 +3471,7 @@ \pgfscope \pgf@circ@setlinewidth{tripoles}{\pgflinewidth} \pgfsetlinewidth{\ctikzvalof{transistor circle/relative thickness}\pgflinewidth} - \edef\@@none{none}\edef\@@default{default} - \edef\@@tmp{\ctikzvalof{transistor circle/color}} - \ifx\@@tmp\@@default\else - \pgfsetcolor{\@@tmp} - \fi - \edef\@@tmp{\ctikzvalof{transistor circle/dash}} - \ifx\@@tmp\@@none\else - \expandafter\pgfsetdash\expandafter{\@@tmp}{0cm} - \fi + \pgf@circ@subset@color@dash{transistor circle} % radius of the circle % \pgfmathsetlength{\pgf@circ@res@temp}{((#2+\extrabodydiodelen)-(#1)+(#3)*(#3)/((#2+\extrabodydiodelen)-(#1)))/2} % \pgfpathcircle{\pgfpoint{#1+\pgf@circ@res@temp}{0pt}}{\pgf@circ@res@temp} @@ -3940,19 +3962,7 @@ \ifpgf@circuit@fet@bodydiode \pgfscope \pgfsetlinewidth{\ctikzvalof{transistor bodydiode/relative thickness}\pgflinewidth} - \edef\@@none{none}\edef\@@default{default} - \edef\@@tmp{\ctikzvalof{transistor bodydiode/color}} - \ifx\@@tmp\@@default\else - \pgfsetcolor{\@@tmp} - \fi - \edef\@@tmp{\ctikzvalof{transistor bodydiode/dash}} - \ifx\@@tmp\@@default\else - \ifx\@@tmp\@@none - \pgfsetdash{}{0pt}% solid line, override dash - \else - \expandafter\pgfsetdash\expandafter{\@@tmp}{0cm} - \fi - \fi + \pgf@circ@subset@color@dash{transistor bodydiode} \drawbodydiode{#1} \endpgfscope \fi -- cgit v1.2.3