summaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-06-02 03:04:23 +0000
committerNorbert Preining <norbert@preining.info>2021-06-02 03:04:23 +0000
commit138d0a6cfd5f2187973fb6b83ad2fb0dcf5a8348 (patch)
treea95fba7d01d57bba550f5114c936ec76d57a49ac /graphics
parent0f69e2fd4a9928663f0cc64b8cac1f0d8baee9d6 (diff)
CTAN sync 202106020304
Diffstat (limited to 'graphics')
-rw-r--r--graphics/pgf/contrib/circuitikz/doc/changelog.tex15
-rw-r--r--graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdfbin17727 -> 17727 bytes
-rw-r--r--graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdfbin1383374 -> 1415056 bytes
-rw-r--r--graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex293
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/circuitikz.sty4
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex47
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex4
7 files changed, 325 insertions, 38 deletions
diff --git a/graphics/pgf/contrib/circuitikz/doc/changelog.tex b/graphics/pgf/contrib/circuitikz/doc/changelog.tex
index 56a39de9a6..06f7943120 100644
--- a/graphics/pgf/contrib/circuitikz/doc/changelog.tex
+++ b/graphics/pgf/contrib/circuitikz/doc/changelog.tex
@@ -5,6 +5,21 @@ full list of changes.
\begin{itemize}
\item
+ version 1.3.7 (2021-06-01)
+
+ Minor release, mainly documentation upgrades.
+
+ \begin{itemize}
+ \tightlist
+ \item
+ New options for the line thickness, rotation and size of symbols
+ drawn in sources
+ \item
+ New tutorial: drawing a circuit around an operational amplifier
+ \item
+ Documentation fixes and small enhancements
+ \end{itemize}
+\item
version 1.3.6 (2021-05-09)
Mainly a bugfix release; fixing a bug in the \texttt{l2} stacked
diff --git a/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf b/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf
index 287f3012f8..97c9b5bad0 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 fd639196c7..716dc9abab 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 90e8ee9b9a..7b2a70245d 100644
--- a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex
+++ b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex
@@ -486,7 +486,165 @@ And finally, this is still \TikZ, so that you can freely mix other graphics elem
\end{LTXexample}
\clearpage
-\subsection{A more complex tutorial: circuits, Romano style.}
+
+\subsection{A non-inverting op-amp amplifier}
+
+\begin{minipage}[t]{0.55\linewidth}
+Let's now try to draw a non-inverting amplifier based on op-amps; the canonical implementation can be, for example, \href{https://www.electronics-tutorials.ws/opamp/opamp_3.html}{this one from ``electronics tutorials''}.
+Obviously, the style and form of drawing a circuit is often a matter of personal tastes and, maybe even more important, of the details you are focusing on; drawing a non-inverting amplifier will be different if you are drawing it to \emph{explain how it works} or if you are simply using it in a more complex circuit, assuming its operation well known by the reader. Anyway, the final objective is to have a circuit like the one on the right, drawn so that it is easy to reuse.
+\end{minipage}\hfill
+\begin{minipage}[t]{0.4\linewidth}
+\begin{circuitikz}[baseline=(OA.+), ]
+ \ctikzset{amplifiers/fill=cyan!20, component text=left}
+ \draw (0,0) node[above]{$v_i$} to[short, o-] ++(1,0)
+ node[op amp, noinv input up, anchor=+](OA){\texttt{OA1}}
+ (OA.-) -- ++(0,-1) coordinate(FB)
+ to[R=$R_1$] ++(0,-2) node[ground]{}
+ (FB) to[R=$R_2$, *-] (FB -| OA.out) -- (OA.out)
+ to [short, *-o] ++(1,0) node[above]{$v_o$}
+ ;
+\end{circuitikz}
+\end{minipage}
+
+We have to start the drawing from a generic point. Given that the idea is to have a reusable block, instead of positioning the op-amp and build around it, we will start from the input ``pole'':
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[]
+ \draw (0,0) node[above]{$v_i$} to[short, o-] ++(1,0)
+ node[op amp, noinv input up, anchor=+](OA){\texttt{OA1}}
+ ;
+\end{circuitikz}
+\end{LTXexample}
+
+In this snippet, notice that the only absolute coordinate is the first one; that will enable us to ``copy and paste'' the circuit in several places, or create a macro for it. We position a text node above it, and then draw a wire with a pole to a relative \texttt{(1,0)} coordinate: in other word, we \emph{move} 1~unit to the right drawing a short-circuit, which is the same as a wire. The usage of \texttt{to[short...]} simplifies the position of the pole, but notice that we could have also written:
+\begin{lstlisting}[numbers=none]
+ \draw (0,0) node[above]{$v_i$} node[ocirc]{} -- ++(1,0) ...
+\end{lstlisting}
+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.
+
+Anyway, the op-amp must be connected with the \texttt{+} anchor to our input wire, so we say \texttt{anchor=+} in the option lists; this shifts the whole element so that the named anchor will lie at the current position of the path. Moreover, normally the shape has the inverting input on the bottom side, and we want it the other way around, so we use also \texttt{noinv input up} in the keys defining the node. We could also have flipped the shape with \texttt{yscale=-1}, but in this case we should have considered the effects on anchors and on the text; see section~\ref{sec:mirroring-and-flipping}.
+
+Now we can draw the resistors; let's start with $R_1$. We will draw it going down vertically from the \texttt{-} anchor --- we have named the node \texttt{OA} so that will be \texttt{OA.-}. We will need to connect the $R_2$ also, so we do the following:
+\begin{itemize}
+ \item draw a wire going down, and mark a point where we want the feedback resistor to connect;
+ \item then draw $R_1$ and finally
+ \item draw the ground node.
+\end{itemize}
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[scale=0.8, transform shape]
+ \draw (0,0) node[above]{$v_i$} to[short, o-] ++(1,0)
+ node[op amp, noinv input up, anchor=+](OA){\texttt{OA1}}
+ (OA.-) -- ++(0,-1) coordinate(FB)
+ to[R=$R_1$] ++(0,-2) node[ground]{}
+ ;
+\end{circuitikz}
+\end{LTXexample}
+
+We only miss the feedback resistor now. We will use \emph{orthogonal coordinates}, writing:
+\begin{lstlisting}[numbers=none]
+ \draw (FB) to[R=$R_2$] (FB -| OA.out) -- (OA.out)
+\end{lstlisting}
+
+The meaning is the following:
+\begin{itemize}
+ \item move the current point to the coordinate named \texttt{FB};
+ \item put a resistor, with label $R_2$, from here \textbf{to}\dots
+ \item the coordinates which is on the horizontal of \texttt{FB} and on the vertical of \texttt{OA.out}: the \texttt{-|} coordinate operation is quite mnemonic;
+ \item then continue drawing to \texttt{OA.out}.
+\end{itemize}
+
+You can use a separate \verb|\draw| command or just continue the path you were writing; the choice is just personal preference, but be warned that it can affect the drawing of poles (see section~\ref{sec:bipole-nodes} about this if you notice strange things).
+
+Finally, we add the output and a couple of nodes:
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[scale=0.8, transform shape]
+ \draw (0,0) node[above]{$v_i$} to[short, o-] ++(1,0)
+ node[op amp, noinv input up, anchor=+](OA){\texttt{OA1}}
+ (OA.-) -- ++(0,-1) coordinate(FB)
+ to[R=$R_1$] ++(0,-2) node[ground]{}
+ (FB) to[R=$R_2$, *-] (FB -| OA.out) -- (OA.out)
+ to [short, *-o] ++(1,0) node[above]{$v_o$}
+ ;
+\end{circuitikz}
+\end{LTXexample}
+
+The last step to obtain the final look is to add a bit of styling. We want the op-amp filled with a light cyan color, and we prefer to have the label aligned with the left side of the device:
+
+\begin{LTXexample}[varwidth=true]
+\ctikzset{amplifiers/fill=cyan!20, component text=left}
+\begin{circuitikz}[scale=0.8, transform shape]
+ \draw (0,0) node[above]{$v_i$} to[short, o-] ++(1,0)
+ node[op amp, noinv input up, anchor=+](OA){\texttt{OA1}}
+ (OA.-) -- ++(0,-1) coordinate(FB)
+ to[R=$R_1$] ++(0,-2) node[ground]{}
+ (FB) to[R=$R_2$, *-] (FB -| OA.out) -- (OA.out)
+ to [short, *-o] ++(1,0) node[above]{$v_o$}
+ ;
+\end{circuitikz}
+\end{LTXexample}
+
+The \verb|\ctikzset| command choosing the style is better placed in the preamble, though. Style should be coherent for all the document body, so avoiding stating it for every circuit is normally the best strategy.
+
+\subsubsection{Reusing the circuit: the easy way}
+\begingroup % to keep changes local
+
+The easiest way to reuse the circuit is to put it in a macro. This is a very flexible way of doing it; the only drawback is that the only easy way to position it is using the first coordinate: you will not be able to move the component using ``anchors''; that is more complex and will need the use of subcircuits (but you will loose parameters\dots see section~\ref{sec:subcircuits}).
+
+Defining a macro for our amplifier could be as easy as this:
+
+\ctikzset{amplifiers/fill=cyan!20, component text=left}
+\newcommand\myNIA[4]{%1: name of this amplifier, %2 start coordinate, %3 R1, %4 R2
+ \draw #2 coordinate(#1-in) to[short] ++(1,0)
+ node[op amp, noinv input up, anchor=+](#1-OA){\texttt{#1}}
+ (#1-OA.-) -- ++(0,-1) coordinate(#1-FB)
+ to[R=#3] ++(0,-2) node[ground]{}
+ (#1-FB) to[R=#4, *-] (#1-FB -| #1-OA.out) -- (#1-OA.out)
+ to [short, *-] ++(1,0) coordinate(#1-out)
+ ;
+}
+\begin{lstlisting}
+\newcommand\myNIA[4]{%1: name of this amplifier, %2 start coordinate, %3 R1, %4 R2
+ \draw #2 coordinate(#1-in) to[short] ++(1,0)
+ node[op amp, noinv input up, anchor=+](#1-OA){\texttt{#1}}
+ (#1-OA.-) -- ++(0,-1) coordinate(#1-FB)
+ to[R=#3] ++(0,-2) node[ground]{}
+ (#1-FB) to[R=#4, *-] (#1-FB -| #1-OA.out) -- (#1-OA.out)
+ to [short, *-] ++(1,0) coordinate(#1-out)
+ ;
+}
+\end{lstlisting}
+
+We remove the open poles (it's better to draw them at the end to avoid artefacts) and then we make the names of the coordinates and of the nodes unique, by prepending a parameter that we will provide at every invocation. Then we remove the labels (for simplicity here) and add a couple of coordinates that we will be able to use from the outside when building our circuit.
+
+And we can use it like in the following:
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[scale=0.7, transform shape]
+ \myNIA{OA1}{(0,0)}{$R_1$}{$R_2$}
+ % start drawing from the output of OA1
+ \myNIA{OA2}{(OA1-out)}{$R_3$}{$R_4$}
+ \node [ocirc] at (OA1-in) {};
+ \node [above] at (OA1-in) {$v_i$};
+ \node [ocirc] at (OA2-out){};
+ \node [ocirc] at (OA1-in) {$v_o$};
+ \draw (OA1-out) -| (OA2-in);
+\end{circuitikz}
+\end{LTXexample}
+
+\endgroup % remove the changes of the op-amp tutorial subsection
+\clearpage
+
+\subsection{A transistor-based amplifier}
\begingroup % do not propagate to the rest of the manual
The idea is to draw a two-stage amplifier for a lesson, or exercise, on the different qualities of BJT and MOSFET transistors.
@@ -722,7 +880,7 @@ and you will obtain the following diagram with the exact same code (I just remov
\endgroup
\clearpage
-\subsection{Tutorial: a logic circuit}
+\subsection{A logic circuit}
\begingroup % let's keep the tutorial thing separated.
\tikzset{sr-ff/.style={flipflop, flipflop def={
@@ -1486,7 +1644,7 @@ If you want to add a setting to your style file that has been recently added to
thyristor style/.try=compact,
\end{lstlisting}
-\subsection{Subcircuits}
+\subsection{Subcircuits}\label{sec:subcircuits}
Starting from version \texttt{1.3.5}, there is an \textbf{experimental}\footnote{That means that in future releases the interface can change; use it at your risk and if you need it to continue working as-is, please use the \href{https://circuitikz.github.io/circuitikz/}{GitHub project page} and download and save the \texttt{circuitikzgit.sty} file for future-proof use!} support for generating sub-circuits, or circuits blocks. The creation and use of subcircuits is somewhat limited, to keep them simple and easy to define and maintain.
@@ -1499,7 +1657,7 @@ To define a block you use the \verb|\ctikzsubcircuitdef| macro; this macro has 3
\begin{itemize}
\item the first argument is the name of the subcircuit, and it must form a valid TeX command name when prepended with a backslash: so just letters (no spaces, nor numbers, nor symbols like underscores etc.);
\item the second one is a comma-separated list of anchors names; here you can use whatever you can use for naming a coordinate or a node (so it's much more relaxed that the first one);
- \item finally, the commands that will draw the circuit. You must suppose you are in a \verb|\draw| command, with the start coordinate already set-up. You can (and should) use \verb|#1| as the name of the current node, and you \emph{must} define the coordinates of all the anchors listed before as \texttt{coordinate(\#-\emph{anchorname})}. You should \textbf{not} finish the path here and use \textbf{only relative coordinates or named ones} .
+\item finally, the commands that will draw the circuit. You must suppose you are in a \verb|\draw| command, with the start coordinate already set-up. You can (and should) use \verb|#1| as the name of the current node, and you \emph{must} define the coordinates of all the anchors listed before as \texttt{coordinate(\#1-\emph{anchorname})}. You should \textbf{not} finish the path here and use \textbf{only relative coordinates} or \textbf{named ones}.
\end{itemize}
Let's see that with an example:
@@ -1545,7 +1703,7 @@ Let's see that with an example:
}
\end{lstlisting}
-Our element is a symbol for an optocoupler; in this case is the symbol used for once cell of the double \href{https://www.vishay.com/docs/84639/vo1263aa.pdf}{Vishay vo1263 device}.
+Our element is a symbol for an optocoupler; in this case is the symbol used for one cell of the double \href{https://www.vishay.com/docs/84639/vo1263aa.pdf}{Vishay vo1263 device}.
The name of the subcircuit is \texttt{optovishay} --- notice we can use only letters here, upper or lowercase, and nothing more.
Then we have a series of anchor names; here we can use letters, numbers, spaces and some symbol --- but avoid the dot (\texttt{.}) and the hyphen (\texttt{-}).
@@ -2307,17 +2465,18 @@ Notice that if you choose the dashed style, the noise sources are fillable:
\footnotetext{Added by André Alves in \texttt{v1.3.5}}
\circuitdescbip*[oosource]{ioosource}{Double Zero style current source}{}
\circuitdescbip*[oosource]{voosource}{Double Zero style voltage source}{}
- \circuitdescbip*[oosourcetrans]{oosourcetrans}{transformer source}{}
+ \circuitdescbip*[oosourcetrans]{oosourcetrans}{transformer source\footnotemark}{}
+ \footnotetext{The \texttt{oosourcetrans} and \texttt{ooosource} componentes have benn added by \href{https://github.com/circuitikz/circuitikz/pull/397}{user \texttt{@olfline} on GitHub}}.
\circuitdescbip*[ooosource]{ooosource}{transformer with three windings}{}(left/175/0.2, right/5/0.5, prim1/130/.2, prim2/-130/.2, sec1/45/.2, sec2/60/.2, sec3/90/.2, tert1/0/.2, tert2/-45/.2, tert3/-90/.2)
\end{groupdesc}
-The transformershapes vector group options can be specified for the primary (prim$=<value>$), the secondary (sec$=<value>$) and tertiary (tert$=<value>$) three-phase vector groups: \textbf{delta}, \textbf{wye} and \textbf{zig}.
+The transformer shapes vector group options can be specified for the primary (\texttt{prim=\emph{value}}), the secondary (\texttt{sec=\emph{value}}) and tertiary (\texttt{tert=\emph{value}}) three-phase vector groups: the value can be one of \texttt{delta}, \texttt{wye} and \texttt{zig}.
\begin{LTXexample}[varwidth=true]
\begin{circuitikz}
- \draw (0,0) to[oosourcetrans,prim=zig,sec=delta,o-] ++(2,0)
+ \draw (0,0) to[oosourcetrans, prim=zig, sec=delta, o-] ++(2,0)
to[oosourcetrans, prim=delta, sec=wye,-o] ++(0,-2)
- to[ooosource, prim=wye,sec=zig,tert=delta] (0,0);
+ to[ooosource, prim=wye, sec=zig, tert=delta] (0,0);
\end{circuitikz}
\end{LTXexample}
@@ -2340,12 +2499,42 @@ The size of the broken part of the DC current source is configurable by changing
\subsubsection{Sources customizations}\label{sec:tweak-sources}
+\paragraph{Size.}
You can change the scale of the batteries by setting the key \texttt{batteries/scale}, for the controlled (dependent) sources with \texttt{csources/scale}, and for all the other independent sources and generators with \texttt{sources/scale}, to something different from the default \texttt{1.0}.
-The symbols drawn into the \texttt{american voltage source}\footnote{Since version \texttt{1.1.0}, thanks to the suggestions and discussion
-\href{https://tex.stackexchange.com/questions/538723/circuitikz-what-should-i-do-to-put-the-and-on-the-appropriate-places-like-t}{in this TeX.SX question}.} can be changed by using the \verb|\ctikzset| keys \texttt{bipoles/vsourceam/inner plus} and \texttt{bipoles/vsourceam/inner minus} (by default they are \verb|$+$| and \verb|$-$| respectively, in the current font), and move them nearer of farther away by twiddling \texttt{bipoles/vsourceam/margin} (default \texttt{0.7}, less means nearer).
+Notice that the size of the double-circle sources (and of the triple-circle one) are tuned so that the full source occupy more or less the same horizontal space than one of the single-circle one; obviously, the circle are much smaller. If you want to have the same circle radius, you have to scale (locally!) those sources by one factor that is \texttt{1.5384} ($1/0.65$) for \texttt{oosource}, \texttt{1.6667} ($1/0.6$) for \texttt{oosourcetrans}, and \texttt{1.8182} ($1/0.55$) for \texttt{ooosource}.
-Moreover, you can move the two symbols nearer of farther away by twiddling \texttt{bipoles/vsourceam/margin} (default \texttt{0.7}, less means nearer).
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+ \draw[color=red] (0,0) to[esource] ++(3,0);
+ \draw (0,0) to[oosourcetrans, prim=delta, sec=wye,
+ sources/scale=1.667] ++(3,0);
+\end{circuitikz}
+\end{LTXexample}
+
+\paragraph{Waveform symbols.}
+Internal symbols of sinusoidal, triangular and square sources are drawn with the same line thickness as the component by default. You can modify this by setting the key \texttt{sources/symbols/thickness} for independent sources and the corresponding \texttt{csource/...} for dependent ones. The value used here is relative to the component (i.e. the circle) value.
+
+Normally the symbol is oriented in the same direction as the line, and rotate rigidly with the component; you can change this orientation using the key \texttt{sources/symbols/rotate} or \texttt{csource/...}. The default value is \texttt{90} which correspond to the ``line'' direction (remember, path component are defined as horizontal ones).
+If instead of an angle value you use \texttt{auto}, the symbol will be rotated so that the waveform is always vertical, similar to what happens in instruments:
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+ \draw (0,1) to[sqV] ++(3,0)
+ to[sqV] ++(1,-1)
+ to[sqV] ++(0,-3);
+ \ctikzset{sources/symbol/rotate=auto}
+ \ctikzset{sources/symbol/rotate=auto, sources/symbol/thickness=3}
+ \draw[color=red] (0,0) to[sqV] ++(3,0)
+ to[sqV] ++(0,-3)
+ to[sqV] (0,0);
+\end{circuitikz}
+\end{LTXexample}
+
+
+\paragraph{Polarity symbols.}
+The symbols drawn into the \texttt{american voltage source}\footnote{Since version \texttt{1.1.0}, thanks to the suggestions and discussion
+\href{https://tex.stackexchange.com/questions/538723/circuitikz-what-should-i-do-to-put-the-and-on-the-appropriate-places-like-t}{in this TeX.SX question}.} can be changed by using the \verb|\ctikzset| keys \texttt{bipoles/vsourceam/inner plus} and \texttt{.../inner minus} (by default they are \verb|$+$| and \verb|$-$| respectively, in the current font), and move them nearer of farther away by twiddling \texttt{bipoles/vsourceam/margin} (default \texttt{0.7}, less means nearer).
You can do the same with the \texttt{american controlled voltage sources}, substituting \texttt{cvsourceam} to \texttt{vsourceam} (notice the initial ``\texttt{c}'').
@@ -2363,6 +2552,27 @@ You can do the same with the \texttt{american controlled voltage sources}, subst
\end{circuitikz}
\end{LTXexample}
+\paragraph{Three-phase symbols.}
+The three-phase symbols \texttt{delta}, \texttt{wye}, and \texttt{zig} follows the line thickness exactly as
+the waveform ones (see above). Additionally, you can scale them up and down by changing the value of the keys
+\texttt{sources/symbol/delta scale}, \texttt{.../wye scale}, and \texttt{.../zig scale} (default \texttt{1}).
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[scale=1.8, transform shape]
+ \tikzset{myoosource/.style={ooosource,
+ prim=wye, sec=delta, tert=zig,
+ }}
+ \draw (0,2) to[myoosource] ++(2,0);
+ \ctikzset{%
+ sources/symbol/thickness=0.5,
+ sources/symbol/delta scale=1.2,
+ sources/symbol/wye scale=1.4,
+ sources/symbol/zig scale=1.3,
+ }
+ \draw (0,0) to[myoosource] ++(2,0);
+\end{circuitikz}
+\end{LTXexample}
+
\subsection{Instruments}
@@ -4227,7 +4437,7 @@ You can obviously define a style for a ``non-standard'' transformer. For example
Remember that the default \texttt{pgfkeys} directory is \texttt{/tikz} for nodes and for the options of the environment, so you \emph{have} to use the full path (with \texttt{circuitikz/}) there.
-\subsection{Amplifiers}
+\subsection{Amplifiers}\label{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 )
@@ -4243,7 +4453,7 @@ Remember that the default \texttt{pgfkeys} directory is \texttt{/tikz} for nodes
\circuitdesc*{buffer}{Buffer}{}(in/180/0.2, out/0/0.2, center/-30/0.6, bin/145/0.1, bout/45/0.3)
\end{groupdesc}
-\subsubsection{Amplifiers anchors}
+\subsubsection{Amplifiers anchors}\label{sec:amplifiers-anchors}
The op amp defines the inverting input (\texttt{-}), the non-inverting input (\texttt{+}) and the output (\texttt{out}) anchors:
@@ -4342,7 +4552,7 @@ Amplifiers have also ``border'' anchors (just add \texttt{b}, without space, to
\end{circuitikz}
\end{LTXexample}
-\subsubsection{Amplifiers customization}
+\subsubsection{Amplifiers customization}\label{sec:amplifiers-customization}
You can scale the amplifiers using the key \texttt{amplifiers/scale} and setting it to something different from \texttt{1.0}. The font used for symbols will not scale, so it's your responsibility to change it if the need arises.
@@ -4518,7 +4728,7 @@ But notice that the ``A'' is also flipped by the \texttt{xscale} parameter. So t
\end{LTXexample}
-\subsubsection{Designing your own amplifier}
+\subsubsection{Designing your own amplifier}\label{sec:muxdemux-amplis}
If you need a different kind of amplifier, you can use the \texttt{muxdemux}
(see section~\ref{sec:muxdemuxes}) shape for defining one that suits your needs (you need version \texttt{1.0.0} for this to work).
@@ -5905,7 +6115,11 @@ The code that implemented the printing of the numbers (which in \texttt{muxdemux
}
\end{lstlisting}
-You can use these shapes to draw a lot of symbols that are unavailable; using a bit of \LaTeX{} command trickery you can use them quite naturally too... For example, this was used before the introduction of the \texttt{double tgate} symbol in \texttt{1.2.4} (see ~\ref{sec:passgate}:
+\subsubsection{Mux-Demux special usage}
+
+You can use these shapes to draw a lot of symbols that are unavailable; using a bit of \LaTeX{} command trickery you can use them quite naturally too\dots. Examples with personalized amplifier shapes are listed in section~\ref{sec:muxdemux-amplis}.
+
+As an additional example, this was used before the introduction of the \texttt{double tgate} symbol in \texttt{1.2.4} (see ~\ref{sec:passgate}):
\begin{LTXexample}[varwidth=true]
\def\tgate#1{
@@ -5922,6 +6136,43 @@ You can use these shapes to draw a lot of symbols that are unavailable; using a
\end{circuitikz}
\end{LTXexample}
+Finally, you can play with them to create chips that have generic numbers of pins on the four sides, as in the following example (asked on \href{https://tex.stackexchange.com/q/596320/38080}{TeX.Stackexchange}):
+
+
+\begin{LTXexample}[varwidth=true]
+\begin{tikzpicture}[scale=0.8, transform shape]
+ \tikzset{ic555/.style={muxdemux,
+ muxdemux def={Lh=10, NL=5, Rh=10, NR=5,
+ NB=2, w=6, NT=2, square pins=1},
+ no input leads, external pins width=0.4,
+ circuitikz/muxdemuxes/fill=blue!10}
+ }
+ \node [ic555, font=\small\ttfamily,align=center](A)
+ at (0,0) {555\\Astable};
+ % left pins
+ \foreach \rawpin/\npin/\label in
+ {2/7/Discharge, 4/2/Trigger, 5/6/Threshold} {
+ \draw (A.lpin \rawpin) -- (A.blpin \rawpin)
+ node[midway, blue, font=\small, above]{\npin}
+ node[right, font=\small]{\label};
+ }
+ % top pins
+ \foreach \rawpin/\npin in {1/8, 2/4} {
+ \draw (A.tpin \rawpin) -- (A.btpin \rawpin)
+ node[midway, blue, font=\small, left]{\npin};
+ }
+ % bottom pins
+ \foreach \rawpin/\npin in {1/5, 2/1} {
+ \draw (A.bpin \rawpin) -- (A.bbpin \rawpin)
+ node[midway, blue, font=\small, left]{\npin};
+ }
+ % finally, left
+ \draw (A.rpin 3) -- (A.brpin 3)
+ node[midway, blue, font=\small, above]{3};
+\end{tikzpicture}
+\end{LTXexample}
+
+
\subsection{Chips (integrated circuits)}\label{sec:chips}
\texttt{CircuiTikZ} supports two types of variable-pin chips: DIP (Dual-in-Line Package) and QFP (Quad-Flat Package).
@@ -7857,7 +8108,7 @@ in your preamble.
But really, your circuit definition is buggy, so the best thing to do is fix that; if you want to name a point in you circuit, you should use a \texttt{coordinate}, not a \texttt{node}.\footnote{Yes, I understand from where the confusion arise --- in circuit theory they are called nodes.} Here is a small tutorial on \emph{why} you should change your circuit.
-Nodes, in \TikZ, have normally a non-zero size even when they are empty; moreover, connections are supposed to join the border of nodes. Please study the following (pure \TikZ, not \Circuitikz)
+Nodes, in \TikZ, have normally a non-zero size even when they are empty; moreover, connections are supposed to join the border of nodes. Please study the following (pure \TikZ, not \Circuitikz):
\begin{LTXexample}[varwidth=true]
\begin{tikzpicture}
@@ -7866,7 +8117,7 @@ Nodes, in \TikZ, have normally a non-zero size even when they are empty; moreove
\end{tikzpicture}
\end{LTXexample}
-The gap is there because the node has a non-zero size (more in detail, its \texttt{inner sep} is by default different from zero. You can see it easily if you draw the node shape:
+The gap is there because the node has a non-zero size (more in detail, its \texttt{inner sep} is by default different from zero). You can see it easily if you draw the node shape:
\begin{LTXexample}[varwidth=true]
\begin{tikzpicture}
@@ -7875,7 +8126,7 @@ The gap is there because the node has a non-zero size (more in detail, its \text
\end{tikzpicture}
\end{LTXexample}
-The problem is that you was want to name a coordinate, you should use a \texttt{coordinate}, \textbf{not} a node!
+The problem is that when you want to name a coordinate, in the sense of a dimensionless point, you should use a \texttt{coordinate}, \textbf{not} a node!
\begin{LTXexample}[varwidth=true]
\begin{tikzpicture}
@@ -7954,7 +8205,7 @@ The only problem with this approach is that the \texttt{edge}s are added \emph{a
\end{circuitikz}
\end{LTXexample}
-So it's better, in this case, to add the nodes manually after the path (there is no perfect solution!)
+So it's better, in this case, to add the nodes manually after the path (there is no perfect solution!):
\begin{LTXexample}[varwidth=true]
\begin{circuitikz}
diff --git a/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty b/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty
index dd8864f683..c87b1251d5 100644
--- a/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty
+++ b/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty
@@ -12,8 +12,8 @@
\NeedsTeXFormat{LaTeX2e}
-\def\pgfcircversion{1.3.6}
-\def\pgfcircversiondate{2021/05/09}
+\def\pgfcircversion{1.3.7}
+\def\pgfcircversiondate{2021/06/01}
\ProvidesPackage{circuitikz}%
[\pgfcircversiondate{} The CircuiTikz circuit drawing package version \pgfcircversion]
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
index b29aea5135..6fc5db6b93 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
@@ -1648,6 +1648,12 @@
% noise sources
\ctikzset{bipoles/noise sources/fillcolor/.initial=gray!50}
+% for special symbols in the sources: sin, square, triangle, delta, wye, zig, etc.
+\ctikzset{sources/symbol/thickness/.initial={1}}
+\ctikzset{csources/symbol/thickness/.initial={1}}
+\ctikzset{sources/symbol/rotate/.initial={90}}
+\ctikzset{csources/symbol/rotate/.initial={90}}
+
% % % ootransformer
\ctikzset{bipoles/oosourcetrans/height/.initial=.6}
\ctikzset{bipoles/oosourcetrans/width/.initial=.6}
@@ -1687,6 +1693,7 @@
\pgfkeys{tikz/tert/delta/.add code={}{\pgf@circ@tert@deltatrue}}
\pgfkeys{tikz/tert/wye/.add code={}{\pgf@circ@tert@wyetrue}}
\pgfkeys{tikz/tert/zig/.add code={}{\pgf@circ@tert@zigtrue}}%
+
%%>>>
%% Nodes definitions for sources%<<<
@@ -1803,6 +1810,17 @@
%% Round and diamond sources
%%%%%%%%%%%
+% % % symbol drawing macros (NOT for delta, wye, zig)
+\def\pgf@circ@sources@symbol@setup{% called in a pgfscope
+ \edef\@@@auto{auto}\edef\@@@rotate{\ctikzvalof{\ctikzclass/symbol/rotate}}
+ \ifx\@@@auto\@@@rotate
+ \pgfgettransformentries\a\b\temp\temp\temp\temp
+ \pgfmathsetmacro{\@@@rotate}{-atan2(\b,\a)}
+ \fi
+ \pgftransformrotate{\@@@rotate}%
+ \pgf@circ@set@relative@thickness{symbol/thickness}%
+}
+
%% Independent voltage source
\pgfcircdeclarebipolescaled{sources}
{}
@@ -1861,7 +1879,7 @@
\pgf@circ@res@up = .5\pgf@circ@res@up
\pgfscope
- \pgftransformrotate{90}
+ \pgf@circ@sources@symbol@setup
\pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
\pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
\pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
@@ -1884,7 +1902,7 @@
\pgf@circ@draworfill
\pgf@circ@res@up = .5\pgf@circ@res@up
\pgfscope
- \pgftransformrotate{90}
+ \pgf@circ@sources@symbol@setup
\pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}}
\pgfpathlineto{\pgfpoint{-1\pgf@circ@res@up}{1\pgf@circ@res@up}}
\pgfpathlineto{\pgfpoint{0\pgf@circ@res@up}{1\pgf@circ@res@up}}
@@ -1910,7 +1928,7 @@
\pgf@circ@res@up = .5\pgf@circ@res@up
\pgfscope
- \pgftransformrotate{90}
+ \pgf@circ@sources@symbol@setup
\pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}}
\pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@up}{0.75\pgf@circ@res@up}}
\pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@up}{-0.75\pgf@circ@res@up}}
@@ -2088,14 +2106,18 @@
}
% % % winding symbols
+\ctikzset{sources/symbol/delta scale/.initial={1}}
+\ctikzset{sources/symbol/wye scale/.initial={1}}
+\ctikzset{sources/symbol/zig scale/.initial={1}}
% triangle
\def\pgf@circ@delta#1{
\pgfscope
- \pgftransformscale{-.01\pgf@circ@res@left*#1}
+ \pgftransformscale{-.01*\ctikzvalof{\ctikzclass/symbol/delta scale}*\pgf@circ@res@left*#1}
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\pgftransformrotate{-\pgfcircmathresult}
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@set@relative@thickness{symbol/thickness}
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
\pgfpathlineto{\pgfpoint{0}{.866\pgf@circ@res@up}}
@@ -2107,11 +2129,12 @@
% star
\def\pgf@circ@wye#1{
\pgfscope
- \pgftransformscale{-.015\pgf@circ@res@left*#1}
+ \pgftransformscale{-.015*\ctikzvalof{\ctikzclass/symbol/wye scale}*\pgf@circ@res@left*#1}
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\pgftransformrotate{-\pgfcircmathresult}
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@set@relative@thickness{symbol/thickness}
\pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@down}}
\pgfpathlineto{\pgfpointorigin}
\pgfpathlineto{\pgfpointpolar{-30}{\pgf@circ@res@down}}
@@ -2124,11 +2147,12 @@
% zigzag
\def\pgf@circ@zig#1{
\pgfscope
- \pgftransformscale{-.015\pgf@circ@res@left*#1}
+ \pgftransformscale{-.015*\ctikzvalof{\ctikzclass/symbol/zig scale}*\pgf@circ@res@left*#1}
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\pgftransformrotate{-\pgfcircmathresult}
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@set@relative@thickness{symbol/thickness}
\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfpointpolar{90}{.5\pgf@circ@res@up}}
\pgfpathlineto{\pgfpointpolar{60}{\pgf@circ@res@up}}
@@ -2164,10 +2188,7 @@
\pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosourcetrans/circleoffset}\pgf@circ@res@left}{0}}
{\ctikzvalof{bipoles/oosourcetrans/circlesize}\pgf@circ@res@left}
\pgfusepath{draw}
-
-
-% % % % draw inner symbols
-
+ % % % % draw inner symbols
%%primary winding
\ifpgf@circ@prim@delta
\pgfscope
@@ -2441,7 +2462,7 @@
\pgf@circ@res@up = .5\pgf@circ@res@up
\pgfscope
- \pgftransformrotate{90}
+ \pgf@circ@sources@symbol@setup
\pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
\pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
\pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
@@ -2544,7 +2565,7 @@
\pgf@circ@res@up = .5\pgf@circ@res@up
\pgfscope
- \pgftransformrotate{90}
+ \pgf@circ@sources@symbol@setup
\pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
\pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
\pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
@@ -2576,7 +2597,7 @@
\pgf@circ@res@up = .5\pgf@circ@res@up
\pgfscope
- \pgftransformrotate{90}
+ \pgf@circ@sources@symbol@setup
\pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
\pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
\pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
diff --git a/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex b/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex
index 6349bd81be..671a47c952 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.3.6}
-\def\pgfcircversiondate{2021/05/09}
+\def\pgfcircversion{1.3.7}
+\def\pgfcircversiondate{2021/06/01}
\writestatus{loading}{\pgfcircversiondate{} The CircuiTikz circuit drawing package version \pgfcircversion}
\usemodule[tikz]