summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib/circuitikz/tex/pgfcirccurrent.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/pgfcirccurrent.tex
parent3303a89b11161d66ec78811056b85306f696cc09 (diff)
CTAN sync 202107150300
Diffstat (limited to 'graphics/pgf/contrib/circuitikz/tex/pgfcirccurrent.tex')
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcirccurrent.tex14
1 files changed, 13 insertions, 1 deletions
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcirccurrent.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcirccurrent.tex
index 49378d367b..e5c5c760a8 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcirccurrent.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcirccurrent.tex
@@ -87,6 +87,10 @@
}
}
+\newif\ifpgfcirc@do@i@symbols\pgfcirc@do@i@symbolstrue
+\ctikzset{no i symbols/.code={\pgfcirc@do@i@symbolsfalse}}
+\ctikzset{i symbols/.code={\pgfcirc@do@i@symbolstrue}}
+
\ctikzset{i/.code = {
\pgfcirc@has@itrue
\pgfkeys{\circuitikzbasekey/bipole/current/direction = forward,
@@ -211,10 +215,18 @@
}
\fi
coordinate (\pgfcirc@a@prefix-Ipos) at ($(\pgfcirc@a@prefix-Ifrom)! \ctikzvalof{current/distance} !(\pgfcirc@a@prefix-Ito)$)
+ % export the current direction
+ \pgfextra{\expandafter\xdef\csname pgfcirc@\pgfcirc@a@prefix-Iarrow-direction\endcsname{\pgf@circ@rounded@dir}}
% if the current label is not empty (in which case we have already all the anchors)
\pgf@circ@ifkeyempty{bipole/current/label/name}\else
% put the arrow node
- node[currarrow, rotate=\pgf@circ@rounded@dir, anchor=center](Iarrow) at (\pgfcirc@a@prefix-Ipos) {}
+ % if we do not want the arrow, just put an empty node (needed to maintain the exact same distances)
+ \ifpgfcirc@do@i@symbols
+ node[currarrow, rotate=\pgf@circ@rounded@dir, anchor=center](Iarrow) at (\pgfcirc@a@prefix-Ipos) {}
+ \else
+ node[currarrow, rotate=\pgf@circ@rounded@dir, anchor=center,
+ circuitikz/phantom@currarrow](Iarrow) at (\pgfcirc@a@prefix-Ipos) {}
+ \fi
% put the label
node[anchor=\pgf@circ@dir, \circuitikzbasekey/bipole current style]
(\ctikzvalof{bipole/name}current)