summaryrefslogtreecommitdiff
path: root/graphics
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
parent3303a89b11161d66ec78811056b85306f696cc09 (diff)
CTAN sync 202107150300
Diffstat (limited to 'graphics')
-rw-r--r--graphics/pgf/contrib/circuitikz/doc/changelog.tex26
-rw-r--r--graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdfbin17706 -> 17688 bytes
-rw-r--r--graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdfbin1428626 -> 1441257 bytes
-rw-r--r--graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex116
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/circuitikz.sty4
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/ctikzstyle-romano.tex2
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex108
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcirccurrent.tex14
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcircflow.tex15
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcirclabel.tex10
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcircpath.tex2
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcircshapes.tex52
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcircutils.tex19
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcircvoltage.tex8
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex4
15 files changed, 300 insertions, 80 deletions
diff --git a/graphics/pgf/contrib/circuitikz/doc/changelog.tex b/graphics/pgf/contrib/circuitikz/doc/changelog.tex
index 1266d82007..ceccd2d6a0 100644
--- a/graphics/pgf/contrib/circuitikz/doc/changelog.tex
+++ b/graphics/pgf/contrib/circuitikz/doc/changelog.tex
@@ -5,6 +5,32 @@ full list of changes.
\begin{itemize}
\item
+ Version 1.4.1 (2021-07-14)
+
+ This version has an important bug fix for label positioning when
+ once-relative style coordinates are used (the ones with a single
+ \texttt{+}, like \texttt{+(1,1)}. Moreover, the possibility to have
+ voltage, current and flow labels \emph{without} the symbols (arrows,
+ etc) has been added, which greatly simplify some kind of
+ personalization of these elements.
+
+ \begin{itemize}
+ \tightlist
+ \item
+ Added the generic tunable macro
+ \item
+ Added \texttt{no\ v\ symbols} (and also for \texttt{i} and
+ \texttt{f}), thanks to a
+ \href{https://github.com/circuitikz/circuitikz/issues/567}{head-up
+ by user judober on GitHub}, see also
+ \href{https://github.com/circuitikz/circuitikz/issues/448}{issue
+ 448}
+ \item
+ Fixed
+ \href{https://github.com/circuitikz/circuitikz/issues/569}{label
+ position for +() style coordinates}
+ \end{itemize}
+\item
Version 1.4.0 (2021-07-06)
The main news is that \emph{package rollback} for \texttt{circuitikz}
diff --git a/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf b/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf
index 2db662486d..62a082a633 100644
--- a/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf
+++ b/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf
index 239c0f6a5d..0f13dab3cf 100644
--- a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf
+++ b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex
index 10a4a9b483..d2d3ee394b 100644
--- a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex
+++ b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex
@@ -46,6 +46,7 @@
% pdflatex
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
+ \usepackage{lmodern}
% \usepackage{babel}
\fi
\fi
@@ -192,6 +193,7 @@ Correcting this will need a big rewrite of the path routines, and although the a
This same issue create a lot of problem of compatibility between \Circuitikz{} and the new \texttt{pic} Ti\emph{k}Z feature, so basically don't put components into \texttt{pic}s.
+
\subsection{Scale factors inaccuracies}\label{sec:usefpu}
Sometimes, when using fractional scaling factors and big values for the coordinates, the basic layer inaccuracies from \TeX{} can bite you, producing results like the following one:
@@ -224,7 +226,9 @@ The \texttt{use fpu reciprocal} key seems to have no side effects, but given tha
Here, we will provide a list of incompabilitys between different version of \Circuitikz. We will try to hold this list short, but sometimes it is easier to break with old syntax than including a lot of switches and compatibility layers. In general, changes that would invalidate a circuit (changes of polarity of components and so on) are almost always protected by a flag; the same is not true for purely aesthetic changes.
If unsure, you can check the version at your local installation using the macro \verb!\pgfcircversion{}!.
\begin{itemize}
- \item \texttt{v1.4.0} introduce the rollback system for the package when using LaTeX; that (at least in principle) should be completely backeard-compatible.
+ \item The \TikZ{} fix for \texttt{to[...] +(x,y)} behavior (see~\ref{sec:path-relative-coordinates}) uncovered a bug in the positioning of the labels in \Circuitikz{} that is present since \texttt{v0.8}. So you \textbf{must} upgrade to \texttt{v1.4.1} or better if you have \TikZ{} newer than \texttt{3.1.8} (and you want/need to use the \texttt{+(x,y)} syntax).
+ \item There have been changes in (internal) parameters for capacitors in \texttt{v1.4.1}; now to change them you should use the style interface (see~\ref{sec:capacitors-styling}).
+ \item \Circuitikz{} \texttt{v1.4.0} introduce the rollback system for the package when using LaTeX; that (at least in principle) should be completely backward-compatible.
\item The path construction in \texttt{v1.4.0} has been changed a bit (again). The change shouldn't break any circuit and correct a behavior that should have been fixed with the \texttt{v1.2.1} change (see below).
\item Version 1.3.6 fixes several problems with the stacked labels; the most important change is that now the bracing of arguments is respected as in version 1.3.0 for the other labels. The special treatment in stacked labels (and only in stacked labels!) for the (still experimental\footnote{and, really, not advised\dots}) \texttt{siunitx} compact syntax \texttt{<...>} has been removed: it was completely buggy before, and silently ignored, now will throw an error.
\item Version 1.3.3 fixes the direction of the arrows in tunable elements; before this version, they were more or less random, now the arrow goes from bottom left to top right. You have the option to go back to the old behavior with \texttt{\textbackslash ctikzset\{bipoles/fix tunable direction=false\}}. As a compensation for the fuss, now the arrows are configurable. To learn more, see the FAQ:~\ref{faq:tunable-arrow}.
@@ -542,10 +546,12 @@ In this snippet, notice that the only absolute coordinate is the first one; that
with the same result.
The second step is to position the op-amp. We can check the manual and see the component's description (section~\ref{sec:amplifiers}):
+
\begin{groupdesc}
\circuitdesc*{op amp}{Operational amplifier}{}( +/180/0.2, -/180/0.2, out/0/
0.2, up/90/0.2, down/-90/0.2 )
\end{groupdesc}
+
where we notice the type of the component (it is a node-type component, so we have to use
\texttt{node} to position it) and the available ``anchors'': points we can use to position the shape or to connect to. Not all the anchors are \emph{explicitly} printed in the description box; you should read further in the manual and you'll see a ``\emph{component} anchors'' (\ref{sec:amplifiers-anchors}) section with the relevant information.
@@ -655,7 +661,7 @@ And we can use it like in the following:
\node [ocirc] at (OA1-in) {};
\node [above] at (OA1-in) {$v_i$};
\node [ocirc] at (OA2-out){};
- \node [ocirc] at (OA1-in) {$v_o$};
+ \node [above] at (OA2-out) {$v_o$};
\draw (OA1-out) -| (OA2-in);
\end{circuitikz}
\end{LTXexample}
@@ -786,7 +792,10 @@ This is the final circuit, with the nodes still marked:
}}
\def\killdepth#1{{\raisebox{0pt}[\height][0pt]{#1}}}
\def\coord(#1){coordinate(#1)}
-\def\coord(#1){coordinate(#1) node[circle, red, draw, inner sep=1pt,pin={[red, overlay, inner sep=0.5pt, font=\tiny, pin distance=0.1cm, pin edge={red, overlay,}]45:#1}](#1-node){}}
+\def\coord(#1){coordinate(#1) node[circle, red, draw, inner sep=1pt,
+ pin={[red, overlay, inner sep=0.5pt, font=\tiny, pin distance=0.1cm,
+ % we reset the arrow in pin edge to avoid carrying over the path one!
+ pin edge={red, overlay,-}]45:#1}](#1-node){}}
\begin{circuitikz}[american, ]
\draw (0,0) node[nmos,](Q1){\killdepth{Q1}};
\draw (Q1.S) to[R, l2^=$R_S$ and \SI{5}{k\ohm}] ++(0,-3) node[vee](VEE){$V_{EE}=\SI{-10}{V}$}; %define VEE level
@@ -824,7 +833,10 @@ This is the final circuit, with the nodes still marked:
}}
\def\killdepth#1{{\raisebox{0pt}[\height][0pt]{#1}}}
\def\coord(#1){coordinate(#1)}
-\def\coord(#1){coordinate(#1) node[circle, red, draw, inner sep=1pt,pin={[red, overlay, inner sep=0.5pt, font=\tiny, pin distance=0.1cm, pin edge={red, overlay,}]45:#1}](){}}
+\def\coord(#1){coordinate(#1) node[circle, red, draw, inner sep=1pt,
+ pin={[red, overlay, inner sep=0.5pt, font=\tiny, pin distance=0.1cm,
+ % we reset the arrow in pin edge to avoid carrying over the path one!
+ pin edge={red, overlay,-}]45:#1}](#1-node){}}
\begin{circuitikz}[american, ]
\draw (0,0) node[nmos,](Q1){\killdepth{Q1}};
\draw (Q1.S) to[R, l2^=$R_S$ and \SI{5}{k\ohm}] ++(0,-3) node[vee](VEE){$V_{EE}=\SI{-10}{V}$}; %define VEE level
@@ -1240,18 +1252,23 @@ The above diagram has been obtained with the code:
\showbordersfornode{capacitivesens}
\end{lstlisting}
+\endgroup
+
\subsubsection{Relative coordinates}\label{sec:path-relative-coordinates}
-As \href{https://github.com/circuitikz/circuitikz/issues/460}{noticed by user \texttt{septatrix}}, although relative coordinates after a component work as expected when using \texttt{++(x,y)}-style coordinates,
-that is not true for the \texttt{+(x,y)}-style coordinates (which are supposed to set a temporary relative coordinate and then going back to the starting point).
+As \href{https://github.com/circuitikz/circuitikz/issues/460}{noticed by user \texttt{septatrix}},
+although full relative coordinates after a component work as expected when using \texttt{++(x,y)}-style coordinates,
+often there are problems when using
+the \texttt{+(x,y)}-style coordinates (which are supposed to set a temporary relative coordinate and then going back to the starting point).
-This behavior, although not optimal, was standard in \texttt{to} operation in plain \TikZ{} before version 3.1.8; it was changed by Henri Menke in later versions. Notice that the change revealed a problem in \Circuitikz{} that should hopefully fixed in \texttt{v1.2.7}.
+These kind of coordinate have in practice little use for the building of circuits, so have been only (very) lightly tested; avoid them if you can --- the behavior will depend not only on the \Circuitikz{} version, but also on the \TikZ{} layer underneath.
+
+This behavior, although not optimal, was standard in \texttt{to} operation in plain \TikZ{} before version 3.1.8; it was changed by Henri Menke in later versions. Notice that the change revealed a problem in \Circuitikz{} that should hopefully fixed in \texttt{v1.4.1}; for more details see \href{https://github.com/circuitikz/circuitikz/issues/569}{this issue on GitHub}.
You can see from the example below (notice the blue curve using a spline line). If all the vertical lines are at the left, the manual has been compiled with a new \Circuitikz{} and \TikZ. Otherwise, the red and/or blue curve will have the vertical line at the right (which in principle is wrong).
In the last (green) example, you can see a workaround using local path and the key \texttt{current point is local} that will work for older (and do not create problem in newer) versions.
-
\begin{LTXexample}[varwidth=true, pos=t]
Plotted using Ti\emph{k}Z version \pgfversion{} and CircuiTi\emph{k}Z version \pgfcircversion{}.
@@ -1273,7 +1290,6 @@ Plotted using Ti\emph{k}Z version \pgfversion{} and CircuiTi\emph{k}Z version \p
\end{tikzpicture}
\end{LTXexample}
-\endgroup
\subsubsection{Customization}
\label{sec:components-size}
@@ -2081,7 +2097,8 @@ You can change that globally or locally, as ever. The tip specification is the o
\footnotetext{suggested by \href{https://github.com/circuitikz/circuitikz/issues/515}{Mayeul Cantan}}
\end{groupdesc}
-Ferroelectric capacitors are fillable because that could be used to show the state of the hysteresis of the component.
+Capacitors are fillable since \texttt{v1.4.1}; this is normally just a stylistic option but in the case of
+ferroelectric capacitors that could be used to show the state of the hysteresis of the component.
\begin{LTXexample}[varwidth]
\begin{tikzpicture}[]
@@ -2104,12 +2121,29 @@ There is also the (deprecated\footnote{Thanks to \href{https://tex.stackexchange
For capacitive sensors, see section~\ref{sec:sensors-anchors}.
-\subsubsection{Capacitors customizations}
+\subsubsection{Capacitors customizations}\label{sec:capacitors-styling}
You can change the scale of the capacitors by setting the key \texttt{capacitors/scale} to something different from the default \texttt{1.0}. For thickness, you can use the same keys (applied to the \texttt{capacitors} class) as for resistors in~\ref{sec:resistor-thickness}.
Variable capacitors arrow tips follow the settings of resistors, see section~\ref{sec:tunablearrows}.
+The relative size of the capacitors is a bit of a mixed bag, because each one has historically different internal parameters that makes maintaining coherence quite difficult. In \texttt{v1.4.1} this has changed and now you can use styling options to change the way the capacitors look. The main parameter you can set is \texttt{capacitors/width} (default \texttt{0.2}), which controls the standard distance between plates. That will change all the components (notice that the \texttt{piezoelectric} component is twice the size of a standard capacitor).
+
+The \texttt{capacitors/height} key is available also to set the height of the capacitor; the default is \texttt{0.6} for most of the capacitors, but \texttt{0.5} for electrolytic ones and \texttt{0.7} for piezoelectric. When used, it will set all of them at the same value, which is a good thing.
+
+If you want that only a specific kind of capacitor has a different value for a key, you can always use a style which will have a local scope, as in the following example.
+
+\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
+ \begin{tikzpicture}
+ \draw (0,1) to [C] ++(1,0) to [elko] ++(1,0);
+ \ctikzset{capacitors/width=0.15, capacitors/height=0.5}
+ \draw (0,0) to [C] ++(1,0) to [elko] ++(1,0);
+ \tikzset{big elko/.style={elko=#1, capacitors/width=0.3}}
+ \draw (0,-1) to [C] ++(1,0) to[big elko] ++(1,0);
+ \end{tikzpicture}
+\end{LTXexample}
+
+
\subsubsection{Inductors}
If the \texttt{cuteinductors} option is active (default behaviour), or the style \texttt{[cute inductors]} is used, the inductors are displayed as follows:
@@ -3028,6 +3062,34 @@ Moreover, you have the arrow tip \texttt{latexslim} which is an arrow similar to
\end{circuitikz}
\end{LTXexample}
+\subsubsection{Generic Tunable Arrows}
+
+The basic passive components (resistors, capacitors and inductors) come with a ``tunable version'' (see for example~\ref{sec:tunablearrows}) that conveys the information that their value is adjustable. For generic components you can obtain a similar effect with the extra macro \verb|\ctikztunablearrow|, introduced in version \texttt{1.4.1}. The macro should be called as:
+\begin{quote}
+ \ttfamily
+ \textbackslash ctikztunablearrow[\emph{extra options}]\{\emph{thickness}\}\{\emph{length}\}\{\emph{angle}\}\{\emph{name}\}
+\end{quote}
+where \emph{extra options} is an optional argument with generic \TikZ{} keys, \emph{thickness} is the relative thickness (referred to the current line width when the macro is invoked), \emph{length} is the length of the arrow with respect to the diagonal size of the component, \emph{angle} is the inclination with respect to the normal direction of the component\footnote{which is the left-to-right direction of the component when shown in the component box in this manual.}, and finally \emph{name} is the reference name of the bipole or node.
+
+The arrows are the ones set with the keys \texttt{tunable start arrow} and \texttt{tunable end arrow} (to maintain coherency across the circuit), but you can override them in the \emph{extra options} argument as shown in the following example.
+
+\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
+\begin{circuitikz}
+ \draw (0,0) node[tlground]{} to[sV, name=A] ++(0,3)
+ node[op amp, anchor=+](B){};
+ \ctikztunablearrow{1}{1.2}{30}{A}
+ \ctikzset{tunable start arrow={Bar},
+ tunable end arrow={Stealth}}
+ \ctikztunablearrow[color=green,
+ {Latex[reversed]}-Circle]{1}{1.2}{90}{A}
+ \ctikztunablearrow[color=blue, densely dashed]{1}{1.2}{-30}{A}
+ \begin{scope}[transparency group, opacity=0.5]
+ \ctikztunablearrow[red, shorten <=3mm]{6}{0.8}{110}{B}
+ \end{scope}
+\end{circuitikz}
+\end{LTXexample}
+
+Notice also the need to force a transparency group if you want a semitransparent arrow.
\subsection{Terminal shapes}\label{sec:terminals}
These are the so-called ``bipole nodes'' shapes, or poles (see section~\ref{sec:bipole-nodes}). These nodes are always filled; the ``open'' versions (starting with an \texttt{o}) are by default filled with the color specified by the key \texttt{open nodes fill} (by default \texttt{white}), but you can override locally it with the \texttt{fill} parameter.
@@ -7430,7 +7492,7 @@ pin={[draw, blue, font=\tiny, align=left]#1:{#2 \\ dir: \ctikzgetdirection{#2#3}
\subsection{Advanced voltages, currents and flows}\label{sec:vif-anchors}
-Since version \texttt{1.2.1}, it is possible to access the anchors of the ``ornaments'' --- voltage, current and flows, together with some additional information that makes it possible to personalize them.
+Since version \texttt{1.2.1}\footnote{some options have been added in \texttt{v1.4.1}}, it is possible to access the anchors of the ``ornaments'' --- voltage, current and flows, together with some additional information that makes it possible to personalize them.
Normally, voltages and flow and currents are drawn into the path of the bipoles, so that it is not possible, for example, to change the line type or color of the arrows, or the type of arrows\footnote{in regular voltages, the arrows are not real \TikZ{} arrows, but the auxiliary arrow shapes of \Circuitikz{}}. Access to the anchors allows to do all this things, and more.
For example, you can do something like this:
@@ -7461,6 +7523,30 @@ Or, for example, to have a different voltage style; normally you would define a
\end{circuitikz}
\end{LTXexample}
+Since \texttt{v1.4.1} you can also keep the voltage, current and flow labels and suppress the output of the symbols (arrows or plus/minus depending on the style) with the keys \texttt{no v symbols}, \texttt{no i symbols}, \texttt{no f symbols} (there are also the corresponding \texttt{v symbols}, \texttt{i symbols} and \texttt{f symbols} in case you want to switch the behavior off/on globally). This for example simplify an often requested feature, like having all the current in one color and the voltages in another one, which is not possible natively because the arrows are part of the same path One possible implementation is the following one:
+
+\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
+\newcommand{\iarronly}[1]{% name
+ \node [currarrow, color=red, anchor=center,
+ rotate=\ctikzgetdirection{#1-Iarrow}] at (#1-Ipos) {};
+}
+\newcommand{\varronly}[1]{% name
+ \draw [color=blue] (#1-Vfrom) .. controls (#1-Vcont1)
+ and (#1-Vcont2).. (#1-Vto) node [currarrow,
+ sloped, anchor=tip, allow upside down,pos=1]{};
+}
+\begin{circuitikz}[]
+ \ctikzset{!vi/.style={no v symbols, no i symbols}}
+ \ctikzset{bipole voltage style/.style={color=blue},
+ bipole current style/.style={color=red}}
+ \draw (120:6) to[R, *-, name=R, v^=$v_R$, !vi]
+ (120:3) to[short, i=$i_R$, name=SR, !vi] (0,0);
+ \draw (180:4) to[L, o-, l=$L$, name=L2, v=$v_L$, !vi]
+ (180:2) to[V, -*, name=V2, v_=$v_2$, !vi] (0:0);
+ \iarronly{SR}\varronly{R}\varronly{L2}\varronly{V2}
+\end{circuitikz}
+\end{LTXexample}
+
\subsubsection{Activating the anchors}
You will have access to the anchors for voltages, currents and flows when, in the bipole, you have both a \texttt{v}, \texttt{i}, \texttt{f} specification (one or more of them) \textbf{and} a \texttt{name} key, to give the bipole a name. Otherwise, the anchors and the associated functions are not defined.
@@ -7500,7 +7586,7 @@ The meaning of the anchors is the following:
\item
\texttt{Vlab} is where the text label for the voltage is normally positioned. The anchor used for such label is available using the auxiliary macro \verb|\ctikzgetanchor| (see below)
\item
- \texttt{Ipos} and \texttt{Fpos} are the position for the arrowhead or the small flow arrow (which is a \texttt{currarrow} or \texttt{flowarrow} node normally) is positioned, respectively. The label is then added to the correct side of it using the anchor available via \verb|\ctikzgetanchor|.\footnote{In this case, the exact position of the label is not available if you do not position the element, for this there is no \texttt{Flab} or \texttt{Ilab} coordinate; you have to use the \texttt{Fpos} and \texttt{Ipos} coordinate with the corresponding \texttt{Ilab} and \texttt{Flab} anchors.}
+ \texttt{Ipos} and \texttt{Fpos} are the position for the arrowhead or the small flow arrow (which is a \texttt{currarrow} or \texttt{flowarrow} node normally) is positioned, respectively. The label is then added to the correct side of it using the anchor available via \verb|\ctikzgetanchor| (see below,~\ref{sec:advances-aux-info}). In this case, the exact position of the label is not available if you do not position the element, for this there is no \texttt{Flab} or \texttt{Ilab} coordinate; you have to use the \texttt{Fpos} and \texttt{Ipos} coordinate with the corresponding \texttt{Ilab} and \texttt{Flab} anchors.
\end{itemize}
Changing the options of the elements, will change the anchors acoordingly:
@@ -7579,12 +7665,13 @@ Finally, as ever, generators are treated differently, but you have all your anch
}
\end{circuitikz}
-\subsubsection{Auxiliary information}
+\subsubsection{Auxiliary information}\label{sec:advances-aux-info}
When the anchors are activated, there are additional macros that you can use:
\begin{itemize}
\item \texttt{\textbackslash ctikzgetanchor\{\emph{<name>}\}\{\emph{<anchor>}\}}: \emph{name} is the name of the bipole, and \emph{anchor} can be \texttt{Vlab}, \texttt{Fpos} or \texttt{Ipos}. This macro expands to the normal anchor position (something like \texttt{north}, \texttt{south west}). Notice that if you have not activated the corresponding anchor, the content of this macro is not specified. It could be equivalent to \verb|\relax| (basically, empty) or contains the anchor of a bipole with the same name from another drawing --- it's a global macro like the coordinates.
\item \texttt{\textbackslash ctikzgetdirection\{\emph{<name>}\}}: a number which is the direction of the \emph{name}d bipole.
+ \item \texttt{\textbackslash ctikzgetdirection\{\emph{<name>}-Iarrow\}}: a number which is the direction of the current arrow requested for the \emph{name}d bipole; using \texttt{\emph{<name>}-Farrow} you get the same information for flow arrows.
\end{itemize}
For example, you could like the voltage label oriented with the bipole:
@@ -7633,6 +7720,7 @@ You can then define a kind of ``power flow'' style:
\end{LTXexample}
+
\subsubsection{Fixed voltage arrows: an example of advanced voltage usage}
\begingroup % to contain example definitions
diff --git a/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty b/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty
index ca09a62930..4a291574ac 100644
--- a/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty
+++ b/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty
@@ -16,8 +16,8 @@
\providecommand\DeclareRelease[3]{}
\providecommand\DeclareCurrentRelease[2]{}
-\def\pgfcircversion{1.4.0}
-\def\pgfcircversiondate{2021/07/06}
+\def\pgfcircversion{1.4.1}
+\def\pgfcircversiondate{2021/07/14}
\DeclareRelease{0.4}{2012/12/20}{circuitikz-0.4-body.tex}
\DeclareRelease{v0.4}{2012/12/20}{circuitikz-0.4-body.tex}
diff --git a/graphics/pgf/contrib/circuitikz/tex/ctikzstyle-romano.tex b/graphics/pgf/contrib/circuitikz/tex/ctikzstyle-romano.tex
index c244c605c6..d53f87cfc6 100644
--- a/graphics/pgf/contrib/circuitikz/tex/ctikzstyle-romano.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/ctikzstyle-romano.tex
@@ -14,6 +14,8 @@ resistors/thickness=1.0,
% Capacitors
capacitors/scale=0.7,
capacitors/thickness=1.0,
+capacitors/width/.try=0.15, % from 1.4.1
+capacitors/height/.try=0.6, % from 1.4.1
%
% Inductors (and transformers)
inductors/scale=0.8,
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
index 6fc5db6b93..19d377e45c 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
@@ -728,13 +728,40 @@
\ctikzset{bipoles/pcapacitor/width/.initial=.2}
\ctikzset{bipoles/pcapacitor/bend width/.initial=1.1}
\ctikzset{bipoles/ccapacitor/height/.initial=.6}
-\ctikzset{bipoles/ccapacitor/width/.initial=.12}
+\ctikzset{bipoles/ccapacitor/width/.initial=.2}
\ctikzset{bipoles/ccapacitor/bend width/.initial=1.1}
\ctikzset{bipoles/vcapacitor/height/.initial=.6}
-\ctikzset{bipoles/vcapacitor/width/.initial=.5}
-\ctikzset{bipoles/vcapacitor/capacitor width/.initial=.4}
+\ctikzset{bipoles/vcapacitor/width/.initial=.2}
+\ctikzset{bipoles/vcapacitor/tunable width/.initial=3}
+\ctikzset{bipoles/vcapacitor/capacitor width/.code={%
+ \pgfutil@packagewarning{circuitikz}{vcapacitor/capacitor width deprecated; ignored}%
+}}% deprecated
\ctikzset{bipoles/piezoelectric/height/.initial=.7}
-\ctikzset{bipoles/piezoelectric/width/.initial=.5}%
+\ctikzset{bipoles/piezoelectric/width/.initial=.4}%
+%
+% style settings
+%
+\ctikzset{capacitors/width/.code={%
+ \pgfmathsetmacro{\pgfcirc@@double}{2*#1}%
+ \ctikzset{bipoles/.cd,
+ capacitor/width=#1, ecapacitor/width=#1, ccapacitor/width=#1,
+ vcapacitor/width=#1,
+ piezoelectric/width=\pgfcirc@@double,
+}}}
+\ctikzset{capacitors/height/.code={%
+ \ctikzset{bipoles/.cd,
+ capacitor/height=#1, ecapacitor/height=#1, ccapacitor/height=#1,
+ vcapacitor/height=#1,
+ piezoelectric/height=#1,
+}}}
+\def\pgfcirc@maybe@fill@straight@capacitor{%
+ \pgfscope
+ \pgfpathrectanglecorners
+ {\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@maybefill
+ \endpgfscope
+}
%>>>
%% Shapes for capacitors%<<<
@@ -746,6 +773,8 @@
{\ctikzvalof{bipoles/capacitor/height}}
{\ctikzvalof{bipoles/capacitor/width}}
{
+ \pgfcirc@maybe@fill@straight@capacitor
+
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
@@ -767,6 +796,7 @@
{\ctikzvalof{bipoles/capacitor/height}}
{\ctikzvalof{bipoles/capacitor/width}}
{
+ \pgfcirc@maybe@fill@straight@capacitor
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
@@ -791,8 +821,11 @@
{\ctikzvalof{bipoles/pcapacitor/height}}
{\ctikzvalof{bipoles/pcapacitor/width}}
{
+
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfutil@packagewarning{circuitikz}{polar capacitor has been deprecated; change to curved capacitor (see manual)}%
+
\pgfscope
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left+ \ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}{\pgf@circ@res@up}}
\pgftransformrotate{-90}
@@ -818,24 +851,37 @@
{\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}}
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\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/pcapacitor/bend width}\pgf@circ@res@right}}
+ \pgftransformrotate{90}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathclose{}
+ \pgf@circ@maybefill
+ \endpgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope
+ % \pgfsetcolor{red}
+ \pgfpathmoveto{\pgfpoint{\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/pcapacitor/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}
\endpgfscope
-
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ % extend wire to the curved capacitor
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
\pgfusepath{draw}
}
-
-
-
%% Electrolytic Capacitor
\pgfcircdeclarebipolescaled{capacitors}
{}
@@ -875,33 +921,30 @@
{\ctikzvalof{bipoles/vcapacitor/height}}
{\ctikzvalof{bipoles/vcapacitor/width}}
{
- \pgf@circ@res@step = \ctikzvalof{bipoles/vcapacitor/capacitor width} \pgf@circ@res@right
+ \pgfcirc@maybe@fill@straight@capacitor
+ \pgf@circ@res@step = \ctikzvalof{bipoles/vcapacitor/tunable width} \pgf@circ@res@right
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
- \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@right}{\pgf@circ@res@down}}
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
\pgfusepath{draw}
\pgfscope
\pgf@circ@set@relative@thickness{modifier thickness}
\pgfcirc@set@arrows{tunable}{}{latexslim}
\ifpgf@circ@fixtunable@dir
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
\else
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
\fi
\pgfusepath{draw}
\endpgfscope
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{0pt}}
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
\pgfsetlinewidth{\pgfstartlinewidth}
\pgfusepath{draw}
}
@@ -954,12 +997,7 @@
{\ctikzvalof{bipoles/capacitor/height}}
{\ctikzvalof{bipoles/capacitor/width}}
{
- \pgfscope
- \pgfpathrectanglecorners
- {\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
- {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
- \pgf@circ@maybefill
- \endpgfscope
+ \pgfcirc@maybe@fill@straight@capacitor
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
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)
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircflow.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircflow.tex
index 77d240cef7..d59325850d 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcircflow.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircflow.tex
@@ -93,6 +93,10 @@
\ctikzset{f>/.style = { f={#1}, \circuitikzbasekey/bipole/flow/direction = forward } }
\ctikzset{f^/.style = { f={#1}, \circuitikzbasekey/bipole/flow/y position = above } }
+\newif\ifpgfcirc@do@f@symbols\pgfcirc@do@f@symbolstrue
+\ctikzset{no f symbols/.code={\pgfcirc@do@f@symbolsfalse}}
+\ctikzset{f symbols/.code={\pgfcirc@do@f@symbolstrue}}
+
\ctikzset{f/.code = {
\pgfcirc@has@ftrue
\pgfkeys{\circuitikzbasekey/bipole/flow/direction = forward,
@@ -214,15 +218,20 @@
%
% coordinate (\pgfcirc@a@prefix-Fpos) at
% ([yshift=\flow@offset]$(\pgfcirc@a@prefix-Ffrom)! \ctikzvalof{flow/distance} !(\pgfcirc@a@prefix-Fto)$)
+ % export the flow direction
+ \pgfextra{\expandafter\xdef\csname pgfcirc@\pgfcirc@a@prefix-Farrow-direction\endcsname{\pgf@circ@rounded@dir}}
% if the flow label is not empty (in which case we have already all the anchors)
\pgf@circ@ifkeyempty{bipole/flow/label/name}\else
% the flow arrow is really a node "flowarrow", not a real arrow
- node[flowarrow, rotate=\pgf@circ@rounded@dir, anchor=center](Farrowpos) at (\pgfcirc@a@prefix-Fpos) {}
-
+ \ifpgfcirc@do@f@symbols
+ node[flowarrow, rotate=\pgf@circ@rounded@dir, anchor=center](Farrowpos) at (\pgfcirc@a@prefix-Fpos) {}
+ \else
+ node[flowarrow, rotate=\pgf@circ@rounded@dir, anchor=center,
+ circuitikz/phantom@flowarrow](Farrowpos) at (\pgfcirc@a@prefix-Fpos) {}
+ \fi
node[anchor=\pgf@circ@dir, \circuitikzbasekey/bipole flow style]
(\ctikzvalof{bipole/name}flow) at (Farrowpos.\pgf@circ@bipole@flow@label@where) {\pgf@circ@finallabels{flow/label}}
\fi
-
% adjust from and to before exporting --- it's much more simple like this then rework the algorithm above
\ifpgf@circuit@bipole@flow@backward
\pgfcirc@swap@coordinates{\pgfcirc@a@prefix-Ffrom}{\pgfcirc@a@prefix-Fto}
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcirclabel.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcirclabel.tex
index 21fc6e8883..ef115d4c5d 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcirclabel.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcirclabel.tex
@@ -215,7 +215,8 @@
\expandafter\xdef\csname pgfcirc@\pgfcirc@a@prefix-#1-anchor\endcsname{mid}%
}
% reset cm is not working correctly here
- (pgfcirc@labelcoor)++(\pgf@circ@labposangle:\the\pgf@circ@res@temp) coordinate(pgfcirc@labelcoor)
+ % relative ++ movement disrupt to[] +()
+ ($(pgfcirc@labelcoor)+(\pgf@circ@labposangle:\the\pgf@circ@res@temp)$) coordinate(pgfcirc@labelcoor)
node[anchor=mid, rotate=\pgfcirclabrot, \circuitikzbasekey/bipole #1 style]
(\ctikzvalof{bipole/name}#1){\pgf@circ@finallabels{#1}}
}
@@ -264,7 +265,8 @@
% the inner sep, so recover it by shifting the anchor
% reset cm is not working sometime, use @marmot solution
% see https://tex.stackexchange.com/a/476018/38080
- (pgfcirc@labelcoor) ++(-\pgf@circ@labanc:\pgf@circ@res@temp) coordinate(pgfcirc@labelcoor)
+ % notice that relative ++ movement disrupt to[] +()
+ ($(pgfcirc@labelcoor)+(-\pgf@circ@labanc:\pgf@circ@res@temp)$) coordinate(pgfcirc@labelcoor)
\pgfextra{\def\pgf@circ@labanctext{base}}%base
\else
\pgfextra{\def\pgf@circ@labanctext{north}}%north
@@ -272,13 +274,13 @@
\else
\ifnum \pgf@circ@labanc < 90
% shift, as above
- (pgfcirc@labelcoor) ++(-\pgf@circ@labanc:\pgf@circ@res@temp) coordinate(pgfcirc@labelcoor)
+ ($(pgfcirc@labelcoor)+(-\pgf@circ@labanc:\pgf@circ@res@temp)$) coordinate(pgfcirc@labelcoor)
\pgfextra{\def\pgf@circ@labanctext{base}}%base
\else
\ifnum \pgf@circ@labanc > 180
% this shouldn't happen, but somehow it does (270 degree anchors)
% shift, as above
- (pgfcirc@labelcoor) ++(-\pgf@circ@labanc:\pgf@circ@res@temp) coordinate(pgfcirc@labelcoor)
+ ($(pgfcirc@labelcoor)+(-\pgf@circ@labanc:\pgf@circ@res@temp)$) coordinate(pgfcirc@labelcoor)
\pgfextra{\def\pgf@circ@labanctext{base}}%base
\else
\pgfextra{\def\pgf@circ@labanctext{north}}%north
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircpath.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircpath.tex
index ee9d285fff..405cfd45bb 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcircpath.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircpath.tex
@@ -130,6 +130,8 @@
\pgfmathanglebetweenpoints{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}}
{\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}}
\edef\pgf@circ@direction{\pgfmathresult}
+ % the global macro pgfcirc@whatever-direction is accessible as \ctikzgetdirection{whatever}
+ % this gives access to the element path direction
\expandafter\xdef\csname pgfcirc@\pgfcirc@a@prefix-direction\endcsname{\pgf@circ@direction}
}
% position the component in the middle of the path. We DO NOT MOVE the current position!
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircshapes.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircshapes.tex
index ce6e78680b..4ee224cc9d 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcircshapes.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircshapes.tex
@@ -551,6 +551,12 @@
%% Current arrow
+%% we need a phantom version of this shape for advanced v-i-f
+%% use strange names to keep ot private
+\newif\ifpgfcirc@really@draw@currarrow\pgfcirc@really@draw@currarrowtrue
+\ctikzset{phantom@currarrow/.code=\pgfcirc@really@draw@currarrowfalse}
+\ctikzset{normal@currarrow/.code=\pgfcirc@really@draw@currarrowtrue}
+
\pgfdeclareshape{currarrow}{
\savedanchor{\northeast}{%
\pgf@circ@res@step = \pgf@circ@Rlen
@@ -577,22 +583,28 @@
}
\behindforegroundpath{
\pgfscope
- \pgf@circ@res@step = \pgf@circ@Rlen
- \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
-
- \pgfpathmoveto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}}
- \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
- \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{0pt}}
- \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{.8\pgf@circ@res@step}}
- \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}}
- \pgfsetcolor{\ctikzvalof{color}}
- \pgfusepath{draw,fill}
-
+ \ifpgfcirc@really@draw@currarrow
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
+
+ \pgfpathmoveto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfusepath{draw,fill}
+ \fi
\endpgfscope
}
}
%% Flow arrow
+%% we need a phantom version of this shape for advanced v-i-f
+%% use strange names to keep ot private
+\newif\ifpgfcirc@really@draw@flowarrow\pgfcirc@really@draw@flowarrowtrue
+\ctikzset{phantom@flowarrow/.code=\pgfcirc@really@draw@flowarrowfalse}
+\ctikzset{normal@flowarrow/.code=\pgfcirc@really@draw@vlowarrowtrue}
\pgfdeclareshape{flowarrow}{
\savedanchor{\northeast}{%
@@ -626,14 +638,16 @@
}
\behindforegroundpath{
\pgfscope
- \pgf@circ@res@step = \pgf@circ@Rlen
- \divide \pgf@circ@res@step by 4
- \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{0pt}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
- \pgfsetcolor{\ctikzvalof{color}}
- \pgfusepath{draw}
- \pgftransformshift{\pgfpoint{\pgf@circ@res@step}{0pt}}
- \pgfnode{currarrow}{tip}{}{}{\pgfusepath{fill}}
+ \ifpgfcirc@really@draw@flowarrow
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 4
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfusepath{draw}
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfnode{currarrow}{tip}{}{}{\pgfusepath{fill}}
+ \fi
\endpgfscope
}
}
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
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircvoltage.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircvoltage.tex
index 9a393d7d09..855331038d 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcircvoltage.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircvoltage.tex
@@ -55,6 +55,10 @@
\ctikzset{v>/.style = {v={#1}, \circuitikzbasekey/bipole/voltage/direction = forward} }
\ctikzset{v</.style = {v={#1}, \circuitikzbasekey/bipole/voltage/direction = backward} }%
+\newif\ifpgfcirc@do@v@symbols\pgfcirc@do@v@symbolstrue
+\ctikzset{no v symbols/.code={\pgfcirc@do@v@symbolsfalse}}
+\ctikzset{v symbols/.code={\pgfcirc@do@v@symbolstrue}}
+
% Default position varies whether the component is a voltage source
% or not
\ctikzset{v/.code = {
@@ -296,6 +300,7 @@
% called just to set the anchors)
%
\pgf@circ@ifkeyempty{bipole/voltage/label/name}\else
+ \ifpgfcirc@do@v@symbols
\ifpgf@circuit@europeanvoltage
\ifpgf@circuit@bipole@voltage@straight
\ifpgf@circuit@bipole@voltage@backward
@@ -341,6 +346,7 @@
\fi
\fi
\fi
+ \fi % closing the ...symbol
\fi % Closing the ...ifempty
}
% %>>>
@@ -385,6 +391,7 @@
coordinate (\pgfcirc@a@prefix-Vlab) at ($(\pgfcirc@a@prefix-Vto)!0.5!(\pgfcirc@a@prefix-Vfrom) $)
coordinate (pgfcirc@Vdir) at (\pgfcirc@a@prefix-Vto)
\pgf@circ@ifkeyempty{bipole/voltage/label/name}\else
+ \ifpgfcirc@do@v@symbols
\ifpgf@circuit@europeanvoltage
\ifpgf@circuit@bipole@voltage@backward
(\pgfcirc@a@prefix-Vto) -- node[currarrow, sloped, allow upside down, pos=1, anchor=tip] {} (\pgfcirc@a@prefix-Vfrom)
@@ -414,6 +421,7 @@
\fi
\fi
\fi
+ \fi % closes ... ifsymbol
\fi % closes ...ifempty
}
% %>>>
diff --git a/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex b/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex
index 7ee36f058f..2d307a86cc 100644
--- a/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex
@@ -10,8 +10,8 @@
%
% See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
-\def\pgfcircversion{1.4.0}
-\def\pgfcircversiondate{2021/07/06}
+\def\pgfcircversion{1.4.1}
+\def\pgfcircversiondate{2021/07/14}
\writestatus{loading}{\pgfcircversiondate{} The CircuiTikz circuit drawing package version \pgfcircversion}
\usemodule[tikz]