summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib/circuitikz/tex/pgfcircutils.tex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-07-15 03:01:01 +0000
committerNorbert Preining <norbert@preining.info>2021-07-15 03:01:01 +0000
commit55ae461252a599d6bc951065a37c16a8971fc560 (patch)
tree1b73269f29ae053c3fa9f00a365b009569df721a /graphics/pgf/contrib/circuitikz/tex/pgfcircutils.tex
parent3303a89b11161d66ec78811056b85306f696cc09 (diff)
CTAN sync 202107150300
Diffstat (limited to 'graphics/pgf/contrib/circuitikz/tex/pgfcircutils.tex')
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcircutils.tex19
1 files changed, 19 insertions, 0 deletions
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircutils.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircutils.tex
index 2759f80c9c..8d9a4ad46a 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcircutils.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircutils.tex
@@ -372,4 +372,23 @@
\fi}
\fi
+%%
+%% generic tunable arrow for components that have no "variable" thing
+%%
+\def\ctikztunablearrow{\pgfutil@ifnextchar[{\ctikztunablearrow@full}{\ctikztunablearrow@simple}}%
+\def\ctikztunablearrow@simple{\ctikztunablearrow@full[]}%
+\def\ctikztunablearrow@full[#1]#2#3#4#5{%
+ % add tunable arrow to a component
+ % relative thickness, relative length, rotation from axis, name of the component
+ \begin{scope}
+ \draw
+ \pgfextra{\pgfcirc@set@arrows{tunable}{}{latexslim}
+ \pgfsetlinewidth{#2\pgflinewidth}} [#1]
+ let \p1=($(#5.north east)-(#5.south west)$), \p2=($(#5.east)-(#5.west)$),
+ \n1 = {veclen(\x1,\y1)},
+ \n2 = {atan2(\y2,\x2)} in
+ % node[above]{\n1, \n2}
+ (#5.center) ++({\n2+(#4)}:{-0.5*(\n1)*(#3)}) -- ++({\n2+(#4)}:{(\n1)*(#3)});
+ \end{scope}%
+}
\endinput