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.tex122
1 files changed, 104 insertions, 18 deletions
diff --git a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex
index f0f68f16ff..c775d7f9fc 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-2023 by Romano Giannetti
-% Copyright 2015-2023 by Stefan Lindner
-% Copyright 2013-2023 by Stefan Erhardt
-% Copyright 2007-2023 by Massimo Redaelli
+% Copyright 2018-2024 by Romano Giannetti
+% Copyright 2015-2024 by Stefan Lindner
+% Copyright 2013-2024 by Stefan Erhardt
+% Copyright 2007-2024 by Massimo Redaelli
%
% This file may be distributed and/or modified
%
@@ -30,7 +30,8 @@
}
% \setmainfont{Gentium Book Basic}
}
-
+% to check thanks to Max Chernoff https://tex.stackexchange.com/a/705682/38080
+% \usepackage[version=latest]{pgf}
% do not split this line in more lines, otherwise "make git-manual" will show the wrong version
\usepackage[siunitx, RPvoltages]{circuitikz}
% Let this be the same as the chosen voltage direction for coherence
@@ -114,7 +115,7 @@
Lorenzo and Mirella, 57 years ago, started a trip that eventually lead to a lot of things --- among them, \Circuitikz{} \texttt{v1.0}.
In loving memory
- --- R.\@G.\@, 2020-02-04
+ --- R.\,G., 2020-02-04
\end{minipage}
\subsection{About}
@@ -125,10 +126,10 @@ The use of \Circuitikz\ is, of course, not limited to academic teaching. The pac
\subsection{License}
Copyright \copyright{}
-2007--2023 by Massimo Redaelli,
-2013--2023 by Stefan Erhardt,
-2015--2023 by Stefan Lindner,
-and 2018--2023 by Romano Giannetti.
+2007--2024 by Massimo Redaelli,
+2013--2024 by Stefan Erhardt,
+2015--2024 by Stefan Lindner,
+and 2018--2024 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}
@@ -190,6 +191,16 @@ Another thing to take into account is that any \TikZ{} figure (and \Circuitikz{}
Finally, the \TikZ{} library \texttt{bending} is loaded by the package, and its effects (the bending of the arrows on curved paths) will also affect the rest of your drawings.
+\subsection{Related and extension packages}
+
+\Circuitikz{} is meant to be, as much as possible, format-agnostic (which means that it can be used from \LaTeX{}, plain \TeX{} and~\ConTeXt). It is growing in functionality and components, but not everything can be added to the package. In this section, there is a list of packages, available at CTAN, that extend or enhance \Circuitikz{} but are distributed separately.\footnote{If you have a package or know a package that should be listed here, please contact the \Circuitikz{} authors, or, better, send a pull request to the project and it will be added.}
+
+\begin{description}
+ \item [\href{https://ctan.org/pkg/tikzquads}{tikzquads}] is a package for easily drawing the equivalent electrical circuits for quadrupoles and similar blocks. \LaTeX{} only.
+ \item [\href{https://ctan.org/pkg/tikzdotncross}{tikzdotncross}] offers a few alternative ways for declaring and marking coordinates and drawing a line with "jumps" over an already existent path\footnote{\dots read the introduction: try not to overuse the jumping symbol; it's not a standard for the last 25 years. Nevertheless, sometimes is very useful, especially for didactic reasons (Romano's personal opinion in this comment).}. \LaTeX{} only.
+\end{description}
+
+
\subsection{Known bugs and limitation}\label{sec:bugs}
\Circuitikz{} will \textbf{not work} correctly with global (in the main \texttt{circuitikz} environment, or in \texttt{scope} environments) \emph{negative} scale parameters (\texttt{scale}, \texttt{xscale} or \texttt{yscale}), unless \texttt{transform shape} is also used, and even in this cases the behavior is not guaranteed.
@@ -1435,14 +1446,29 @@ for example changing the parameter \texttt{bipoles/thickness} (default 2). The n
\paragraph{Shape of the components} (on a per-component-class basis)
The shape of the components are adjustable with a lot of parameters; in this manual we will comment the main ones, but you can look into the source files specified above to find more.
+Notice however that the ``internal'' parameters, the ones not commented in this manual, are not part of the public interface so they can disappear or change in future versions.
+
+It is recommended to use the styling parameters to change the shapes; they are not so fine-grained (for example, you can change the width of resistor), but they are more stable and coherent across your circuit.
+
\begin{LTXexample}[varwidth=true]
- \tikz \draw (0,0) to[R=1<\ohm>] (2,0); \par
- \ctikzset{bipoles/resistor/height=.6}
- \tikz \draw (0,0) to[R=1<\ohm>] (2,0);
+ \tikz \draw (0,0) to[R=1<\ohm>] (3,0); \par
+ \ctikzset{resistors/width=2}
+ \tikz \draw (0,0) to[R=1<\ohm>] (3,0);
\end{LTXexample}
-It is recommended to use the styling parameters to change the shapes; they are not so fine-grained (for example, you can change the width of resistor, not the height at the moment), but they are more stable and coherent across your circuit.
+To change the height, you can use (locally) the class scale parameter and the width; you can even define a style that will work across the resistor styles:
+
+\begin{LTXexample}[varwidth=true]
+ \ctikzset{american}
+ \tikz \draw (0,0) to[R=1<\ohm>] (4,0);
+
+ \ctikzset{tallR/.style={
+ resistors/scale=2, resistors/width=0.4}}
+ \tikz \draw (0,0) to[R=1<\ohm>, tallR] (4,0);
+ \ctikzset{european}
+ \tikz \draw (0,0) to[R=1<\ohm>, tallR] (4,0);
+\end{LTXexample}
\subsubsection{Descriptions}
The typical entry in the component list will be like this:
@@ -2856,6 +2882,31 @@ You can do the same with the \texttt{american controlled voltage sources}, subst
\end{circuitikz}
\end{LTXexample}
+\paragraph{Orientation of the polarity symbols.}
+
+When rotating the sources, they usually move rigidly. This results in the fact that American voltage sources look nice when vertical but could be better in other directions. Since \texttt{v1.6.7}\footnote{Thanks to the suggestions and discussion
+\href{https://github.com/circuitikz/circuitikz/issues/773}{by user @jotagah on GitHub}.}, you can choose several rotation modes for those symbols (independent and dependent sources).
+
+ You can obtain several different rotations or rotation modes by changing the value of the key \texttt{sources/symbol/sign rotation} (with \verb!\ctikzset!). The value \texttt{default} (also the default value!) uses the legacy, ``rigid'' position.
+
+If you provide a number, the symbols are rotated by that value (\texttt{0} means that the minus sign is aligned with the wire, \texttt{90} is very similar to \texttt{default}\footnote{Not exactly equal; the position of the symbols could be slightly different depending on the font.}).
+If you use \texttt{straight}, the symbols are rotated to be always horizontal. With \texttt{auto}, the symbols are drawn in the same way as \texttt{0} for inclination less the \SI{45}{\degree}, and as \texttt{90} otherwise.The following drawing shows the results for several different parameter values.
+
+\begin{LTXexample}[varwidth=true, pos=t]
+\begin{tikzpicture}[american, scale=0.6, transform shape]
+ %\ctikzset{sources/symbol/sign rotation=default}
+ \foreach \a in {0,30,...,359} \draw (0,0) -- ++(\a:1) to[V] ++(\a:2);
+ \ctikzset{sources/symbol/sign rotation=0}
+ \foreach \a in {0,30,...,359} \draw[color=red] (6,0) -- ++(\a:1) to[V] ++(\a:2);
+ \ctikzset{sources/symbol/sign rotation=auto}
+ \foreach \a in {0,30,...,359} \draw[color=blue] (12,0) -- ++(\a:1) to[V] ++(\a:2);
+ \ctikzset{sources/symbol/sign rotation=straight}
+ \foreach \a in {0,30,...,359} \draw (18,0) -- ++(\a:1) to[V] ++(\a:2);
+\end{tikzpicture}
+\end{LTXexample}
+
+
+
\paragraph{Three-phase symbols.}
The three-phase symbols \texttt{delta}, \texttt{wye}, \texttt{eyw}, 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
@@ -3581,7 +3632,8 @@ You can use the \texttt{plug center} anchor to add the IEC ``multiplier'':
\circuitdescbip*{dac}{D/A converter}{}
\circuitdescbip*{dsp}{DSP}{}
\circuitdescbip*{fft}{FFT}{}
- \circuitdescbip*{amp}{amplifier}{}
+ \circuitdescbip*{amp}{amplifier; use \texttt{t=\dots} to add a text}{}(up/90/0.2, down/-90/0.2)
+ \circuitdescbip*{iamp}{instrumentation amplifier; use \texttt{t=\dots} to add a text}{}(up/90/0.2, down/-90/0.2)
\circuitdescbip*{vamp}{VGA}{}
\circuitdescbip*{piattenuator}{$\pi$ attenuator}{}
\circuitdescbip*{vpiattenuator}{var. $\pi$ attenuator}{}
@@ -3590,6 +3642,11 @@ You can use the \texttt{plug center} anchor to add the IEC ``multiplier'':
\circuitdescbip*{phaseshifter}{phase shifter}{}
\circuitdescbip*{vphaseshifter}{var.\ phase shifter}{}
\circuitdescbip*{detector}{detector}{}
+ \circuitdescbip*{saturation}{Saturation\footnotemark}{}
+ \footnotetext{Contributed by \href{https://github.com/circuitikz/circuitikz/issues/758}{P. Sacco \texttt{<paul.sacco@estaca.eu>}}}
+ \circuitdescbip*{sigmoid}{Sigmoid}{}
+ \circuitdescbip*{allornothing}{Comparison, all-or-nothing}{}
+ \circuitdescbip*{fiber}{Optical Fiber}{}
\circuitdescbip*{sdcdc}{single wire DC/DC converter\footnotemark}{}(dc up in/135/.3, dc down in/185/.3, dc up out/45/.3, dc down out/-35/.3)
\footnotetext{the converter blocks added by \texttt{olfline}}
\circuitdescbip*{sacdc}{single phase AC/DC converter}{}(ac up in/135/.3, ac down in/185/.3, dc up out/45/.3, dc down out/-35/.3)
@@ -3627,20 +3684,36 @@ In addition, since \texttt{v1.6.0}, most blocks also have the \texttt{left up},
(bp.left up) node[circ, red]{}
(bp.left down) node[circ, blue]{}
(bp.right up) node[circ, green]{}
- (bp.right down) node[circ, yellow]{}
+ (bp.right down) node[circ, orange]{}
;\end{circuitikz}
\end{LTXexample}
-You can use those anchors to build ``mixed-type'' circuits, positioning the node-shapes:
+Since \texttt{1.6.7} you can change the relative position of the lateral generic anchors\footnote{Suggested by \href{https://github.com/circuitikz/circuitikz/issues/769}{user @sputeanus} on GitHub} using the keys \texttt{block left anchors pos} and \texttt{block right anchor pos} (default \texttt{0.5}, as in previous releases) which set the position as a fraction of the top to center segment.
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+ \ctikzset{block left anchors pos=0.8, block right anchors pos=0.2}
+ \draw (0,0) to[bandpass, name=bp] ++(2,0)
+ (bp.left up) node[circ, red]{}
+ (bp.left down) node[circ, blue]{}
+ (bp.right up) node[circ, green]{}
+ (bp.right down) node[circ, orange]{}
+;\end{circuitikz}
+\end{LTXexample}
+
+To set both left and right at the same value, you can use the key \texttt{block lateral anchors pos}, which set both to the same number.
+You can use those anchors to build ``mixed-type'' circuits, using the node-shapes (the following drawing is a bit silly, but shows that the anchor position can be changed locally):
\begin{LTXexample}[pos=t, varwidth=true]
\begin{tikzpicture}[
big/.style={circuitikz/blocks/scale=1.5},
long/.style={circuitikz/bipoles/twoportsplit/width=1.5}]
- \path (0,0) node[sacdcshape, big](A){}
+ \ctikzset{block lateral anchors pos=0.8}
+ \path (0,0) node[sacdcshape, big, circuitikz/block right anchors pos=0.2](A){}
(5,0) node[twoportsplitshape, big, long, t1=LNA, t2=Digital](B){};
\draw (A.right up) -- (B.left up) (A.right down) to[cute choke] (B.left down);
\end{tikzpicture}
\end{LTXexample}
+
Notice also from the previous example that the generic blocks (\texttt{twoport} and \texttt{twoportsplit}) can be made ``longer'' by setting different \texttt{width} and \texttt{height} (the other blocks are square, and just use the \texttt{width} key for both dimensions).
Also, for \texttt{amp} and \texttt{vamp}, the \texttt{up} and \texttt{down} anchors follow the shape when they are not boxed.
@@ -3766,6 +3839,19 @@ With the option \texttt{>} you can draw an arrow to the input of the block diagr
\end{circuitikz}
\end{LTXexample}
+You can also change the width for the generic block:
+
+\begin{LTXexample}[pos=t, varwidth=t, basicstyle=\small\ttfamily]
+\begin{circuitikz}[european]
+ \draw (0,0) to[amp, >, t=$K_{\mathrm{p}}$] ++(2,0)
+ to[saturation, >, name=sat] ++(2,0) -- ++(0.5,0)
+ to[twoport, t=$\displaystyle\frac{\tau s +1}{\tau s}$, >,
+ bipoles/twoport/width=1.5] ++(3,0);
+ \node[above] at (sat.ne) {$+I_{\mathrm{max}}$};
+ \node[below] at (sat.sw) {$-I_{\mathrm{max}}$};
+\end{circuitikz}
+\end{LTXexample}
+
\paragraph{Multi ports}
Since inputs and outputs can vary, input arrows can be placed as nodes. Note that you have to rotate the arrow on your own: