summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib/circuitikz/tex/pgfcirclabel.tex
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/pgf/contrib/circuitikz/tex/pgfcirclabel.tex')
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcirclabel.tex11
1 files changed, 8 insertions, 3 deletions
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcirclabel.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcirclabel.tex
index 465f704ded..8e2b4372c6 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcirclabel.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcirclabel.tex
@@ -30,6 +30,11 @@
\ctikzset{bipole annotation style/.append style={#1}}
}}
+\ctikzset{label distance/.initial={0pt}}
+\ctikzset{annotation distance/.initial={0pt}}
+\tikzset{label distance/.code={\ctikzset{label distance={#1}}}}
+\tikzset{annotation distance/.code={\ctikzset{annotation distance={#1}}}}
+
%% Options
\ctikzset{label/.style = { l={#1} } }
\ctikzset{l/.code = {
@@ -182,13 +187,13 @@
% scale the distances in function of zoom, so that they are not
% dependent on it but on font size. Thanks to @marmot
% https://tex.stackexchange.com/a/476018/38080
- % the coeffcient is adjusted so that the distance is more or less
+ % the coefficient is adjusted so that the distance is more or less
% the same for rotated labels and straight ones (although it will
% depend on the font, so it's not exact).
\pgfgettransformentries{\tmpa}{\tmpb}{\tmpc}{\tmpd}{\tmp}{\tmp}%
\pgfmathsetmacro{\myscale}{sqrt(abs(\tmpa*\tmpd-\tmpb*\tmpc))}% abs should not be needed
% \typeout{ROT\tmpa\space\tmpb\space\tmpc\space\tmpd\space\myscale}
- \pgfmathsetlength\pgf@circ@res@temp{1.5*\pgf@circ@ls/\myscale}
+ \pgfmathsetlength\pgf@circ@res@temp{1.5*\pgf@circ@ls/\myscale+\ctikzvalof{#1 distance}/\myscale}
\ifnum \ctikzvalof{bipole/#1/position}>0
%we need some more space for placement below, due to mid-anchor
\else % we do not have <= in \ifnum...
@@ -227,7 +232,7 @@
\pgfgettransformentries{\tmpa}{\tmpb}{\tmpc}{\tmpd}{\tmp}{\tmp}%
\pgfmathsetmacro{\myscale}{sqrt(abs(\tmpa*\tmpd-\tmpb*\tmpc))}% abs should not be needed
% \typeout{ROT\tmpa\space\tmpb\space\tmpc\space\tmpd\space\myscale}
- \pgfmathsetlength\pgf@circ@res@temp{\pgf@circ@ls/\myscale}
+ \pgfmathsetlength\pgf@circ@res@temp{\pgf@circ@ls/\myscale+\ctikzvalof{#1 distance}/\myscale}
\pgfmathadd{\pgf@circ@labanc}{90}
\pgfmathround{\pgfmathresult}
\def\pgf@circ@labanctext{\pgf@circ@labanc}