summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex')
-rw-r--r--graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex110
1 files changed, 65 insertions, 45 deletions
diff --git a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex
index 8cf24b70db..f299603351 100644
--- a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex
+++ b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex
@@ -5,10 +5,10 @@
% !TeX spellcheck = en_US
% !TeX encoding = utf8
-% Copyright 2018-2021 by Romano Giannetti
-% Copyright 2015-2021 by Stefan Lindner
-% Copyright 2013-2021 by Stefan Erhardt
-% Copyright 2007-2021 by Massimo Redaelli
+% Copyright 2018-2022 by Romano Giannetti
+% Copyright 2015-2022 by Stefan Lindner
+% Copyright 2013-2022 by Stefan Erhardt
+% Copyright 2007-2022 by Massimo Redaelli
%
% This file may be distributed and/or modified
%
@@ -53,13 +53,13 @@
\def\tightlist{} % needed for latest pandoc-versions(pandoc used for including changelog)
\usepackage{microtype}
+\usepackage{imakeidx}
+\makeindex[title=Index of the components, intoc=true]
+
% Local utilities packages
\usepackage{ctikzmanutils}
%
-\usepackage{imakeidx}
-\makeindex[title=Index of the components, intoc=true]
-
\begin{document}
% change numbering to roman to avoid a duplicate hyperref target on page 1
% Thanks to Ulrike Fischer for helping here
@@ -125,10 +125,10 @@ The use of \Circuitikz\ is, of course, not limited to academic teaching. The pac
\subsection{License}
Copyright \copyright{}
-2007--2021 by Massimo Redaelli,
-2013--2021 by Stefan Erhardt,
-2015--2021 by Stefan Lindner,
-and 2018--2021 by Romano Giannetti.
+2007--2022 by Massimo Redaelli,
+2013--2022 by Stefan Erhardt,
+2015--2022 by Stefan Lindner,
+and 2018--2022 by Romano Giannetti.
This package is author-maintained. Permission is granted to copy, distribute and/or modify this software under the terms of the \LaTeX\ Project Public License, version 1.3.1, or the GNU Public License. This software is provided ‘as is’, without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose.
\subsection{Loading the package}
@@ -198,6 +198,20 @@ 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.
+Also, notice that most components will interact in a funny way with global path options, like \texttt{rounded corners} or the arrow options (like \texttt{->} or \texttt{shorten <} and so on). Depending on the specific component, some parameter is inherited by the internal shape, and some other is reset,\footnote{This is not easy to fix. We want some option to go through --- fill color, dashed pattern for example --- and some other to stay only in the outer path; and if the background shape need some option for drawing the internal shape, like for example a rounded corner, it \emph{must} reset the external option. So there is no perfect solution.} so basically it's better not to use them.
+Arrows with \texttt{to[]} components don't work, anyway, so basically avoid this situation.
+
+\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
+\begin{circuitikz}[]
+ \draw (0,3) to[R] ++(3,0) node[npn, anchor=B]{};
+ % arrows will not work and give bad results
+ % so basically do not use them!
+ \draw[<->] (0,1.5) to[R] ++(3,0) node[npn, anchor=B]{};
+ \draw[shorten <=10pt] (0,0) to[R] ++(3,0)
+ node[npn, anchor=B]{};
+\end{circuitikz}
+\end{LTXexample}
+
\subsection{Scale factors inaccuracies}\label{sec:usefpu}
@@ -267,7 +281,7 @@ If unsure, you can check the version at your local installation using the macro
If you have older projects that show compatibility problems, you have two options:
\begin{itemize}
\item you can use an older version locally using the git-version and picking the correct commit from the repository (branch gh-pages) or the main GitHub site directly;
- \item if you are using \LaTeX, the distribution has embedded several important old versions: \texttt{0.4}, \texttt{0.6}, \texttt{0.7}, \texttt{0.8.3}, \texttt{0.9.3}, \texttt{0.9.6}, \texttt{1.0}, \texttt{1.1.2} and \texttt{1.2.7}.
+ \item if you are using \LaTeX, the distribution has embedded several important old versions: \texttt{0.4}, \texttt{0.6}, \texttt{0.7}, \texttt{0.8.3}, \texttt{0.9.3}, \texttt{0.9.6}, \texttt{1.0}, \texttt{1.1.2}, \texttt{1.2.7}, and \texttt{1.4.6}.
To switch to use them, since \texttt{v1.4.0} you simply use the \href{https://www.latex-project.org/publications/2018-FMi-TUB-tb122mitt-version-rollback.pdf}{new LaTeX kernel rollback system}, changing your \verb|\usepackage| invocation to something like:
\begin{lstlisting}[numbers=none]
\usepackage[]{circuitikz}[=v0.8.3] % or v0.4, v0.6, ...
@@ -285,7 +299,7 @@ If you have older projects that show compatibility problems, you have two option
which is an inferior solution because it can fool any package you use that depend on \texttt{circuitikz}.
Both ways, you have to take care of the options that may have changed between versions (and sometime syles, if you use them).
- \item if you are using \ConTeXt, only versions \texttt{0.8.3}, \texttt{0.9.3}, \texttt{0.9.6}, \texttt{1.0}, \texttt{1.1.2} and \texttt{1.2.7} are packaged; if can use it with
+ \item if you are using \ConTeXt, only versions \texttt{0.8.3}, \texttt{0.9.3}, \texttt{0.9.6}, \texttt{1.0}, \texttt{1.1.2}, \texttt{1.2.7}, and \texttt{1.4.6} are packaged; if can use it with
\begin{lstlisting}[numbers=none]
\usemodule[circuitikz-0.8.3]
\end{lstlisting}
@@ -1217,11 +1231,12 @@ Alternatively, that you can use the shape form, and then use the \texttt{left} a
\begin{circuitikz}[baseline, scale=0.8, transform shape]
\node[#1shape, name=bip] at(0,0) {};
\foreach \a in {0,30,...,359} \draw[red] (bip.\a) -- ++(\a:0.7) node[font=\tiny, fill=white, inner sep=0.5pt]{\a};
+ \foreach \a in {15,45,...,359} \draw[red] (bip.\a) -- ++(\a:0.4);
\node [font=\ttfamily\small, black, below] at (bip.-90) {\detokenize\expandafter{#1}};
\end{circuitikz}
}
-Bipoles have also installed generic border anchors --- that means, anchors that start at an angle. For complexity reason, these are for most of the components simply a generic enclosing rectangle. They interact in a non-trivial way with the \texttt{mirror} and \texttt{invert} keys, so it's best not to use them directly.
+Bipoles have also installed generic border anchors --- that means, anchors that start at an angle. For complexity reason, these are for most of the components simply a generic enclosing rectangle (even for most of the round ones!\footnote{This is needed for the correct label/voltage etc. placement, and it's too much work to change it.}). They interact in a non-trivial way with the \texttt{mirror} and \texttt{invert} keys, so it's best not to use them directly.
\begin{quote}
\showbordersfornode{generic}
@@ -1251,6 +1266,7 @@ The above diagram has been obtained with the code:
\node[#1shape, name=bip] at(0,0) {};
\foreach \a in {0,30,...,359} \draw[red] (bip.\a) -- ++(\a:0.7)
node[font=\tiny, fill=white, inner sep=0.5pt]{\a};
+ \foreach \a in {15,45,...,359} \draw[red] (bip.\a) -- ++(\a:0.4);
\node [font=\ttfamily\small, black, below] at (bip.-90)
{\detokenize\expandafter{#1}};
\end{circuitikz}}
@@ -2291,7 +2307,7 @@ The package options \texttt{fulldiode}, \texttt{strokediode}, and \texttt{emptyd
\circuitdescbip*[emptyzzdiode]{empty ZZener diode}{Empty ZZener diode}{zzDo}
\circuitdescbip*[emptytdiode]{empty tunnel diode}{Empty tunnel diode}{tDo}
\circuitdescbip*[emptypdiode]{empty photodiode}{Empty photodiode}{pDo}
- \circuitdescbip*[emptylediode]{empty led}{Empty led}{leDo}
+ \circuitdescbip*[emptylediode]{empty led}{Empty led}{leDo}
\circuitdescbip*[emptylaserdiode]{empty laser diode}{Empty laser diode\footnotemark}{lasD}
\footnotetext{Added by André Alves in \texttt{v1.4.4}}
\circuitdescbip*[emptyvarcap]{empty varcap}{Empty varcap}{VCo}
@@ -3395,8 +3411,11 @@ Some devices have the possibility to add a box around them. The inner symbol sca
To show that a device is optional, you can dash it. The inner symbol will be kept with solid lines.
\begin{LTXexample}[varwidth=true]
\begin{circuitikz}
- \draw (0,0) to[amp,l=\SI{10}{dB}] ++(2.5,0);
- \draw[dashed] (2.5,0) to[lowpass,l=opt.] ++(2.5,0);
+\draw (0,2) to[amp,l=\SI{10}{dB}] ++(2.5,0);
+\draw[dashed] (2.5,2) to[lowpass,l=opt.] ++(2.5,0);
+% or just the block
+\draw (0,0) to[amp,l=\SI{10}{dB}] ++(2.5,0)
+ to[lowpass,l=opt., dashed] ++(2.5,0);
\end{circuitikz}
\end{LTXexample}
@@ -8237,9 +8256,9 @@ The color of the components is stored in the key \verb!\circuitikzbasekey/color!
Compare for instance
\begin{LTXexample}[varwidth=true]
\begin{circuitikz} \draw[red]
- (0,2) node[and port] (myand1) {}
- (0,0) node[and port] (myand2) {}
- (2,1) node[xnor port] (myxnor) {}
+ (0,2) node[and port](myand1){1}
+ (0,0) node[and port](myand2){2}
+ (2,1) node[xnor port](myxnor){3}
(myand1.out) -| (myxnor.in 1)
(myand2.out) -| (myxnor.in 2)
;\end{circuitikz}
@@ -8249,9 +8268,9 @@ and
\begin{LTXexample}[varwidth=true]
\begin{circuitikz} \draw[color=red]
- (0,2) node[and port] (myand1) {}
- (0,0) node[and port] (myand2) {}
- (2,1) node[xnor port] (myxnor) {}
+ (0,2) node[and port](myand1){1}
+ (0,0) node[and port](myand2){2}
+ (2,1) node[xnor port](myxnor){3}
(myand1.out) -| (myxnor.in 1)
(myand2.out) -| (myxnor.in 2)
;\end{circuitikz}
@@ -8260,20 +8279,20 @@ and
One can of course change the color \emph{in medias res}:
\begin{LTXexample}[pos=t, varwidth=true]
\begin{circuitikz} \draw
- (0,0) node[pnp, color=blue] (pnp2) {}
- (pnp2.B) node[pnp, xscale=-1, anchor=B, color=brown] (pnp1) {}
- (pnp1.C) node[npn, anchor=C, color=green] (npn1) {}
- (pnp2.C) node[npn, xscale=-1, anchor=C, color=magenta] (npn2) {}
+ (0,0) node[pnp, color=blue](pnp2){q1}
+ (pnp2.B) node[pnp, xscale=-1, anchor=B, color=brown](pnp1){\ctikzflipx{q2}}
+ (pnp1.C) node[npn, anchor=C, color=green](npn1){q3}
+ (pnp2.C) node[npn, xscale=-1, anchor=C, color=magenta](npn2){\ctikzflipx{q4}}
(pnp1.E) -- (pnp2.E) (npn1.E) -- (npn2.E)
- (pnp1.B) node[circ] {} |- (pnp2.C) node[circ] {}
+ (pnp1.B) node[circ]{} |- (pnp2.C) node[circ]{}
;\end{circuitikz}
\end{LTXexample}
-The all-in-one stream of bipoles poses some challanges, as only the actual body of the bipole, and not the connecting lines, will be rendered in the specified color. Also, please notice the curly braces around the \texttt{to}:
+The all-in-one stream of bipoles poses some challanges, as only the actual body of the bipole, and not the connecting lines, will be rendered in the specified color.
\begin{LTXexample}[varwidth=true]
\begin{circuitikz} \draw
(0,0) to[V=1<\volt>] (0,2)
- { to[R=1<\ohm>, color=red] (2,2) }
+ to[R=1<\ohm>, color=red] (2,2)
to[C=1<\farad>] (2,0) -- (0,0)
;\end{circuitikz}
\end{LTXexample}
@@ -8304,9 +8323,9 @@ Since version 0.9.0, you can also fill most shapes with a color (the manual spec
\begin{LTXexample}[varwidth=true]
\begin{circuitikz} \draw
- (0,2) node[and port, fill=yellow] (myand1) {}
- (0,0) node[and port, fill=cyan] (myand2) {}
- (2,1) node[xnor port,fill=red!30!white] (myxnor) {}
+ (0,2) node[and port, fill=yellow](myand1){1}
+ (0,0) node[and port, fill=cyan](myand2){2}
+ (2,1) node[xnor port,fill=red!30!white](myxnor){3}
(myand1.out) -| (myxnor.in 1)
(myand2.out) -| (myxnor.in 2)
;\end{circuitikz}
@@ -8321,9 +8340,10 @@ This fill color will override any color defined by the style (see section~\ref{s
\draw[red] (-0.5,3) -- (-0.5, -1);
\draw[red] (1.5,3) -- (1.5, -1);
\draw
- (0,2) node[and port, ] (myand1) {}
- (0,0) node[and port, fill=cyan] (myand2) {}
- (2,1) node[xnor port, circuitikz/logic ports/fill=none] (myxnor) {}
+ (0,2) node[and port](myand1){1}
+ (0,0) node[and port, fill=cyan](myand2){2}
+ (2,1) node[xnor port, circuitikz/logic ports/fill=none
+ ](myxnor){3}
(myand1.out) -| (myxnor.in 1)
(myand2.out) -| (myxnor.in 2)
;\end{circuitikz}
@@ -8332,9 +8352,9 @@ You can combine shape colors with fill colors, too, but you should use the \text
\begin{LTXexample}[varwidth=true]
\begin{circuitikz} \draw[color=red]
- (0,2) node[and port, fill=yellow] (myand1) {1}
- (0,0) node[and port, fill=cyan] (myand2) {2}
- (2,1) node[xnor port,fill=red!30!white] (myxnor) {3}
+ (0,2) node[and port, fill=yellow](myand1) {1}
+ (0,0) node[and port, fill=cyan] (myand2){2}
+ (2,1) node[xnor port,fill=red!30!white](myxnor){3}
(myand1.out) -| (myxnor.in 1)
(myand2.out) -| (myxnor.in 2)
;\end{circuitikz}
@@ -8345,9 +8365,9 @@ A workaround is shown in port \texttt{3}:
\begin{LTXexample}[varwidth=true]
\begin{circuitikz} \draw
- (0,2) node[and port, color=black] (myand1) {1}
- (0,0) node[and port, color=blue, fill=cyan] (myand2) {2}
- (2,1) {[color=blue] node[xnor port, fill=cyan] (myxnor) {3}}
+ (0,2) node[and port, color=black](myand1){1}
+ (0,0) node[and port, color=blue, fill=cyan](myand2){2}
+ (2,1) {[color=blue] node[xnor port, fill=cyan](myxnor){3}}
(myand1.out) -| (myxnor.in 1)
(myand2.out) -| (myxnor.in 2)
;\end{circuitikz}
@@ -8894,10 +8914,10 @@ Here a series of example, contributed by several people, is shown with their cod
(0,0) to[C, l=10<\micro\farad>] (0,2) -- (0,3)
to[R, l=2.2<\kilo\ohm>] (4,3) -- (4,2)
to[L, l=12<\milli\henry>, i=$i_1$,v=b] (4,0) -- (0,0)
- (4,2) { to[D*, *-*, color=red] (2,0) }
+ (4,2) to[D*, color=red] (2,0)
(0,2) to[R, l=1<\kilo\ohm>, *-] (2,2)
- to[cV, i=1,v=$\SI{.3}{\kilo\ohm}\, i_1$] (4,2)
- (2,0) to[I, i=1<\milli\ampere>, -*] (2,2)
+ to[cV, i=1, -*, v=$\SI{.3}{\kilo\ohm}\, i_1$] (4,2)
+ (2,0) to[I, i=1<\milli\ampere>, *-*] (2,2)
;\end{circuitikz}
\end{LTXexample}