summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-10-13 03:01:18 +0000
committerNorbert Preining <norbert@preining.info>2019-10-13 03:01:18 +0000
commit3afcae17b4a1a6dffbaa749a6fd0b6406c4d34a9 (patch)
tree2b39e772bb90bd186f6430ee996d04279e10f7f4 /graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
parent2e4672ed6f7b49c9d1c44b6ca850cfe7024fc639 (diff)
CTAN sync 201910130301
Diffstat (limited to 'graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex')
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex179
1 files changed, 152 insertions, 27 deletions
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
index 0048efb892..2eaa1cf8e5 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
@@ -386,7 +386,7 @@
\pgfusepath{draw}
\pgfsetlinewidth{\pgfstartlinewidth}
- \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\tiny$\vartheta$}
+ \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\pgf@circ@font@tiny$\vartheta$}
\pgfsetarrowsend{latexslim}
\pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}}
\pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}}
@@ -416,7 +416,7 @@
\pgfusepath{draw}
\pgfsetlinewidth{\pgfstartlinewidth}
- \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\tiny$\vartheta$}
+ \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\pgf@circ@font@tiny$\vartheta$}
\pgfsetarrowsend{latexslim}
\pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}}
\pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}}
@@ -427,11 +427,17 @@
}
%% Generic tunable
-\pgfcircdeclarebipolescaled{resistors}{
- \anchor{wiper}{
- \northeast
- \pgfpoint{0pt}{\pgf@y}
- }
+\pgfcircdeclarebipolescaled{resistors}
+{
+ \savedanchor{\wiper}{
+ \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
+ \pgf@ya=\ctikzvalof{bipoles/generic potentiometer/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@ya
+ \pgf@xa=\ctikzvalof{bipoles/generic potentiometer/width}\pgf@circ@scaled@Rlen
+ \pgfmathsetlength{\pgf@x}{(\ctikzvalof{bipoles/generic potentiometer/wiper pos}-0.5)*\pgf@xa}
+ }
+ \anchor{wiper}{\wiper}
+ \anchor{W}{\wiper}
}
{\ctikzvalof{bipoles/generic potentiometer/height 2}}
{genericpotentiometer}
@@ -450,8 +456,9 @@
\pgfscope
%\pgfsetlinewidth{\pgfstartlinewidth}
\pgfsetarrowsend{latexslim}
- \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
+ \pgfextractx{\pgf@circ@res@other}{\wiper}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}}
\pgfusepath{draw}
\endpgfscope
}
@@ -526,12 +533,20 @@
%% Potentiometer
\pgfcircdeclarebipolescaled{resistors}
{
- \anchor{wiper}{\northeast\pgfpoint{0pt}{\pgf@y}}
- \anchor{W}{\northeast\pgfpoint{0pt}{\pgf@y}}
+ \savedanchor{\wiper}{
+ \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
+ \pgf@ya=\ctikzvalof{bipoles/potentiometer/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@ya
+ \pgf@xa=\ctikzvalof{bipoles/potentiometer/width}\pgf@circ@scaled@Rlen
+ \pgfmathsetlength{\pgf@x}{(\ctikzvalof{bipoles/potentiometer/wiper pos}-0.5)*\pgf@xa}
+ }
+ \anchor{wiper}{\wiper}
+ \anchor{W}{\wiper}
\savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}}
}
{\ctikzvalof{bipoles/potentiometer/height 2}}
-{potentiometer}{\ctikzvalof{bipoles/potentiometer/height}}
+{potentiometer}
+{\ctikzvalof{bipoles/potentiometer/height}}
{\ctikzvalof{bipoles/potentiometer/width}}
{
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
@@ -542,8 +557,9 @@
\pgfscope
%\pgfsetlinewidth{\pgfstartlinewidth}
\pgfsetarrowsend{latexslim}
- \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
+ \pgfextractx{\pgf@circ@res@other}{\wiper}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}}
\pgfusepath{draw}
\endpgfscope
}
@@ -619,7 +635,7 @@
\endpgfscope
}
-%% Polar Capacitor
+%% Polar Capacitor (DEPRECATED)
\pgfcircdeclarebipolescaled{capacitors}
{}
{\ctikzvalof{bipoles/pcapacitor/height}}
@@ -640,9 +656,38 @@
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
\pgfusepath{draw}
+}
+
+
+%% Curved capacitor
+% see https://tex.stackexchange.com/questions/509594/polar-capacitor-orientation-in-circuitikz-seems-wrong
+% for a rationale
+%
+\pgfcircdeclarebipolescaled{capacitors}
+{}
+{\ctikzvalof{bipoles/ccapacitor/height}}
+{ccapacitor}
+{\ctikzvalof{bipoles/ccapacitor/height}}
+{\ctikzvalof{bipoles/ccapacitor/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right+ \ctikzvalof{bipoles/ccapacitor/bend width}\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgftransformrotate{-90}
+ \pgfpathsine{\pgfpoint{\pgf@circ@res@up}{-\ctikzvalof{bipoles/ccapacitor/bend width}\pgf@circ@res@right}}
+ \pgfpathcosine{\pgfpoint{\pgf@circ@res@up}{\ctikzvalof{bipoles/ccapacitor/bend width}\pgf@circ@res@right}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
}
+
+
+
%% Electrolytic Capacitor
\pgfcircdeclarebipolescaled{capacitors}
{}
@@ -666,9 +711,9 @@
\pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@down}}
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
- \pgfsetfillcolor{black}
+ \pgfsetfillcolor{\ctikzvalof{color}}
\pgfusepath{draw,fill}
- \pgfsetfillcolor{black}
+ \pgfsetfillcolor{\ctikzvalof{color}}
% % plus pole annotation
\pgftext[right,at=\pgfpoint{1.2\pgf@circ@res@left}{.6\pgf@circ@res@up}]
{\ctikzvalof{bipoles/ecapacitor/font} $+$}
@@ -746,7 +791,18 @@
%% cute inductor
\pgfcircdeclarebipolescaled{inductors}
-{}
+{
+ \savedanchor{\midtap}{%
+ \pgf@x=0pt\relax
+ \pgfmathsetlength{\pgf@y}{%
+ (mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?%
+ \ctikzvalof{bipoles/cuteinductor/height} :% even
+ -\ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd
+ *\pgf@circ@scaled@Rlen/2
+ }
+ }
+ \anchor{midtap}{\midtap}
+}
{\ctikzvalof{bipoles/cuteinductor/lower coil height}}
{cuteinductor}
{\ctikzvalof{bipoles/cuteinductor/height}}
@@ -778,6 +834,16 @@
\pgfcircdeclarebipolescaled{inductors}
{% anchor for labelling the type of dependency
\anchor{label}{\southwest\pgf@x=0.8\pgf@x\pgf@y=2.6\pgf@y}%
+ \savedanchor{\midtap}{%
+ \pgf@x=0pt\relax
+ \pgfmathsetlength{\pgf@y}{%
+ (mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?%
+ \ctikzvalof{bipoles/cuteinductor/height} :% even
+ -\ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd
+ *\pgf@circ@scaled@Rlen/2
+ }
+ }
+ \anchor{midtap}{\midtap}
}
{\ctikzvalof{bipoles/cuteinductor/lower coil height}}
{scuteinductor}
@@ -814,7 +880,18 @@
%% cute choke
\pgfcircdeclarebipolescaled{inductors}
-{}
+{
+ \savedanchor{\midtap}{%
+ \pgf@x=0pt\relax
+ \pgfmathsetlength{\pgf@y}{%
+ (mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?%
+ \ctikzvalof{bipoles/cuteinductor/height} :% even
+ -\ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd
+ *\pgf@circ@scaled@Rlen/2
+ }
+ }
+ \anchor{midtap}{\midtap}
+}
{\ctikzvalof{bipoles/cutechoke/lower coil height}}
{cutechoke}
{\ctikzvalof{bipoles/cutechoke/height}}
@@ -858,7 +935,18 @@
%% variable cute inductor
\pgfcircdeclarebipolescaled{inductors}
-{}
+{
+ \savedanchor{\midtap}{%
+ \pgf@x=0pt\relax
+ \pgfmathsetlength{\pgf@y}{%
+ (mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?%
+ \ctikzvalof{bipoles/cuteinductor/height} :% even
+ -\ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd
+ *\pgf@circ@scaled@Rlen/2
+ }
+ }
+ \anchor{midtap}{\midtap}
+}
{\ctikzvalof{bipoles/vcuteinductor/lower coil height}}
{vcuteinductor}
{\ctikzvalof{bipoles/vcuteinductor/height}}
@@ -895,7 +983,18 @@
%% american inductor
\pgfcircdeclarebipolescaled{inductors}
-{}
+{
+ \savedanchor{\midtap}{%
+ \pgf@x=0pt\relax
+ \pgfmathsetlength{\pgf@y}{%
+ (mod(\ctikzvalof{bipoles/americaninductor/coils},2) ?%
+ 2*\ctikzvalof{bipoles/americaninductor/coil height} :% even
+ 0) %odd
+ *\pgf@circ@scaled@Rlen/2
+ }
+ }
+ \anchor{midtap}{\midtap}
+}
{\ctikzvalof{bipoles/americaninductor/height 2}}
{americaninductor}
{\ctikzvalof{bipoles/americaninductor/height}}
@@ -924,6 +1023,16 @@
\pgfcircdeclarebipolescaled{inductors}
{% anchor for labelling the type of dependency
\anchor{label}{\southwest\pgf@x=0.8\pgf@x\pgf@y=2.6\pgf@y}%
+ \savedanchor{\midtap}{%
+ \pgf@x=0pt\relax
+ \pgfmathsetlength{\pgf@y}{%
+ (mod(\ctikzvalof{bipoles/americaninductor/coils},2) ?%
+ 2*\ctikzvalof{bipoles/americaninductor/coil height} :% even
+ 0) %odd
+ *\pgf@circ@scaled@Rlen/2
+ }
+ }
+ \anchor{midtap}{\midtap}
}
{\ctikzvalof{bipoles/americaninductor/height 2}}
{samericaninductor}
@@ -956,7 +1065,18 @@
%% variable american inductor
\pgfcircdeclarebipolescaled{inductors}
-{}
+{
+ \savedanchor{\midtap}{%
+ \pgf@x=0pt\relax
+ \pgfmathsetlength{\pgf@y}{%
+ (mod(\ctikzvalof{bipoles/vamericaninductor/coils},2) ?%
+ 2*\ctikzvalof{bipoles/vamericaninductor/coil height} :% even
+ 0) %odd
+ *\pgf@circ@scaled@Rlen/2
+ }
+ }
+ \anchor{midtap}{\midtap}
+}
{\ctikzvalof{bipoles/vamericaninductor/height 2}}
{vamericaninductor}
{\ctikzvalof{bipoles/vamericaninductor/height}}
@@ -989,7 +1109,9 @@
%% Generic bipole, filled - used as inductor by some
\pgfcircdeclarebipolescaled{inductors}
-{}
+{
+ \anchor{midtap}{\northeast\pgf@x=0pt\relax}
+}
{\ctikzvalof{bipoles/fullgeneric/height}}
{fullgeneric}
{\ctikzvalof{bipoles/fullgeneric/height}}
@@ -1005,6 +1127,7 @@
\pgfcircdeclarebipolescaled{inductors}
{% anchor for labelling the type of dependency
\anchor{label}{\southwest\pgf@x=0.4\pgf@x\pgf@y=2\pgf@y}%
+ \anchor{midtap}{\northeast\pgf@x=0pt\relax}
}
{\ctikzvalof{bipoles/fullgeneric/height}}
{sfullgeneric}
@@ -1025,7 +1148,9 @@
%% Generic full tunable
\pgfcircdeclarebipolescaled{inductors}
-{}
+{
+ \anchor{midtap}{\northeast\pgf@x=0pt\relax}
+}
{\ctikzvalof{bipoles/tfullgeneric/height}}
{tfullgeneric}
{\ctikzvalof{bipoles/tfullgeneric/height}}
@@ -2815,7 +2940,7 @@
{\ctikzvalof{bipoles/ammeter/width}}
{
\drawmeteringcircle
- \pgfnode{circle}{center}{\textbf{A}}{}{}
+ \pgfnode{circle}{center}{\pgf@circ@font@bold{A}}{}{}
}
%OHMMETER
\pgfcircdeclarebipolescaled{instruments}
@@ -2837,7 +2962,7 @@
{\ctikzvalof{bipoles/voltmeter/width}}
{
\drawmeteringcircle
- \pgfnode{circle}{center}{\textbf{V}}{}{}
+ \pgfnode{circle}{center}{\pgf@circ@font@bold{V}}{}{}
}
@@ -3276,7 +3401,7 @@
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
\pgfusepath{draw}
- \pgftext[top,x=.65\pgf@circ@res@left,y=1.2\pgf@circ@res@down]{{\tiny\textsf{U}}}
+ \pgftext[top,x=.65\pgf@circ@res@left,y=1.2\pgf@circ@res@down]{{\pgf@circ@font@tiny\textsf{U}}}
}
%%%%%%%%%%%%%%