summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-06-24 03:01:43 +0000
committerNorbert Preining <norbert@preining.info>2023-06-24 03:01:43 +0000
commit36c52277a7e7e1b9f3de0286cfd1f5931a60d802 (patch)
treec1b84888133e9c7ea9039cca1f67b822629b6076 /graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex
parentddaf122566480fe48b9786c172e647ca0ea4c6d5 (diff)
CTAN sync 202306240301
Diffstat (limited to 'graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex')
-rw-r--r--graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex148
1 files changed, 114 insertions, 34 deletions
diff --git a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex
index 983f759a43..d331f510b5 100644
--- a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex
+++ b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex
@@ -249,6 +249,18 @@ The \texttt{use fpu reciprocal} key seems to have no side effects, but given tha
Here, we will provide a list of incompatibilities between different versions of \Circuitikz. We will try to hold this list short, but sometimes it is easier to break with old syntax than include 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 in your local installation by using the macro \verb!\pgfcircversion{}!.
\begin{itemize}
+ \item Since version \texttt{1.6.3} the default symbol for the minus sign changed from the simple \verb|$-$| to \verb|$\vphantom{+}-$|. The reason is that in some (most?) font, the minus sign is enclosed in a smaller bounding box than the plus sign and that leads to poorly aligned minus symbols in \texttt{american} and \texttt{raised} voltages. This was not noticed before because the two symbols share the same bounding box in the default Computer Modern font. You can look at \href{https://github.com/circuitikz/circuitikz/issues/721}{this issue on GitHub} for more details; if you want to go back to the previous definitions you can write
+ \begin{lstlisting}
+ \ctikzset{amplifiers/minus=$-$}
+ \ctikzset{bipoles/cvsourceam/inner minus=$-$}
+ \ctikzset{bipoles/vsourceam/inner minus=$-$}
+ \ctikzset{voltage/american minus=$-$}
+ \end{lstlisting}
+ \item Since version \texttt{1.6.3} the size of the solder dot and the connection dot of the body diodes for transistors has changed (now they are the same and are configurable). The new default scale of~\texttt{0.7} makes the dots \emph{area} more or less one half the one of the external connections. You can go back to the previous values with
+ \begin{lstlisting}
+ \ctikzset{transistor bodydiode/dot scale=0.5,
+ transistor solderdot scale=1.0}
+ \end{lstlisting}
\item Since version \texttt{1.6.2} \texttt{siunitx} will \textbf{not} work anymore with \ConTeXt{} (it was a very poor simulation layer, anyway); it has been disabled in upstream \ConTeXt, in favor of \href{https://www.pragma-ade.nl/general/manuals/units-mkiv.pdf}{its own \texttt{units} module}.
\item Version \texttt{1.6.0} has a big rewrite of the block's code. In principle the changes are backward-compatible, but there were several bugs (wrong anchors, errors with rotations, and so on) that have been fixed in the process.
\item Since \texttt{v1.5.1}\footnote{Do not use \texttt{v1.5.0}, it's buggy.} color management (see section~\ref{sec:colors}) and the details of how the shapes are drawn and protected by the external drawing options has changed. There should be no substantial changes to the circuits, though.
@@ -2712,6 +2724,24 @@ The transformer shapes vector group options can be specified for the primary (\t
\end{circuitikz}
\end{LTXexample}
+These two ``sources'' have additional anchors that reach the center of the symbol;\footnote{Suggested by \href{https://github.com/circuitikz/circuitikz/issues/725}{user @lapreindl on GitHub}.} they are used sometimes to add a (symbolic) connection there, like for example a ground connection.
+
+\begin{LTXexample}[varwidth=true]
+\begin{tikzpicture}[european, scale=2, transform shape,
+ smalldot/.style={draw, circle,red, inner sep=0.2pt}]
+ \draw (0,0) to[oosourcetrans, name=A,
+ prim=delta, sec=wye] ++(1,0)
+ to[ooosource, name=B, prim=wye, sec=zig,
+ tert=delta] ++(1,0)
+ (A.symbolsec) -- ++(-45:0.5) node[ground]{};
+ \node [smalldot] at (A.symbolprim) {};
+ \node [smalldot] at (A.symbolsec) {};
+ \node [smalldot] at (B.symbolprim) {};
+ \node [smalldot] at (B.symbolsec) {};
+ \node [smalldot] at (B.symboltert) {};
+\end{tikzpicture}
+\end{LTXexample}
+
\subsubsection{Nullator and norator}
These are special elements used in some approaches to model ideal amplifiers\footnote{See \href{https://en.m.wikipedia.org/wiki/Nullor}{the Wikipedia article}; suggested by \href{https://github.com/circuitikz/circuitikz/issues/615}{user atticus-sullivan on GitHub}.}.
@@ -2802,7 +2832,7 @@ If instead of an angle value you use \texttt{auto}, the symbol will be rotated s
\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).
+\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|$\vphantom{+}-$| 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). The reason of the \verb|\vphantom| can be found in section~\ref{sec:american-voltage-custom}.
You can do the same with the \texttt{american controlled voltage sources}, substituting \texttt{cvsourceam} to \texttt{vsourceam} (notice the initial ``\texttt{c}'').
@@ -2841,6 +2871,36 @@ the waveform ones (see above). Additionally, you can scale them up and down by c
\end{circuitikz}
\end{LTXexample}
+\subsubsection{Source borders}
+
+Unfortunately, the border of the sources is only easily accessed if some anchor is provided.
+The border anchors of the shapes are not tight on them (see section~\ref{sec:bipoles-border-anchors}), which is not easily changeable, given that the algorithm that positions the labels depends on it.
+
+On the other hand, \TikZ{} powerful partway coordinate calculation (around section 13.5.3 of the manual) makes it possible to easily identify points on a circle if the center and one point of the circle are known, as you can see in the following example.
+
+\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
+\begin{tikzpicture}[]
+ \path (0,0) to[oosourcetrans, name=T, ]++(2,0);
+ % Use partway modifiers to reach a point on the left circle
+ \draw ($(T.centerprim)!1!45:(T.left)$) -- ++(-135:0.2)
+ -- ++(0,-1) node[ground]{};
+ \begin{scope}[font=\tiny\ttfamily, pin distance=2mm, inner sep=0pt]
+ \foreach \a in {-90,-45,...,90}
+ \node [circ, scale=0.5, pin=\a:\a, color=red] at
+ ($(T.centersec)!1!\a:(T.right)$){};
+ \end{scope}
+\end{tikzpicture}
+\end{LTXexample}
+
+A similar approach can be used for dependent sources. Just remember that the anchors move (rotate) together with the component.
+
+\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
+ \begin{tikzpicture}[american]
+ \draw (0,0) to [cvsource, name=S] ++(0,2);
+ \node [circ,red] at ($(S.e)!0.3333!(S.n)$) {};
+ \node [circ,blue] at ($(S.e)!0.6666!(S.n)$) {};
+ \end{tikzpicture}
+\end{LTXexample}
\subsection{Instruments}
@@ -3813,7 +3873,7 @@ Basically they are the same as the normal \texttt{npn} and \texttt{pnp}, and the
\circuitdesc{GaN hemt}{Gallium Nitride hemt (a ``styled'' \texttt{hemt}, see~\ref{sec:hemt})}{Q}( G/180/0.2,D/0/0.2,S/0/0.2, nogate/-120/0.2)
\end{groupdesc}
-\textsc{nfet}s and \textsc{pfet}s have been incorporated based on code provided by Clemens Helfmeier and Theodor Borsche. Use the package options \texttt{fetsolderdot}/\texttt{nofetsolderdot} to enable/disable solderdot at some fet-transistors. Additionally, the solderdot option can be enabled/disabled for single transistors with the option \texttt{solderdot} and \texttt{nosolderdot}, respectively.
+\textsc{nfet}s and \textsc{pfet}s have been incorporated based on code provided by Clemens Helfmeier and Theodor Borsche. Use the package options \texttt{fetsolderdot}/\texttt{nofetsolderdot} to enable/disable solderdot at some fet-transistors. Additionally, the solderdot option can be enabled/disabled for single transistors with the option \texttt{solderdot} and \texttt{nosolderdot}, respectively (You can adjust the size of the solder dot, see section~\ref{sec:solderdot-scale}).
\begin{groupdesc}
\circuitdesc{nfet}{nfet}{Q}(G/180/0.1, D/0/0.1, S/0/0.1)
@@ -3940,6 +4000,33 @@ If the option \texttt{arrowmos} is used (or after the command \verb!\ctikzset{tr
You can go back to the no-arrows mos with \texttt{noarrowmos} locally or with
\texttt{\textbackslash ctikzset\{tripoles/mos style/no arrows\}}.
+To draw the PMOS circle non-solid, use the option \texttt{emptycircle} or the command
+\\\verb!\ctikzset{tripoles/pmos style/emptycircle}!. To remove the dot completely (only useful if you have \texttt{arrowmos} enabled, otherwise there will be no difference between P-MOS and N-MOS), you can use the option \texttt{nocircle} or \verb|\ctikzset{tripoles/pmos style/nocircle}|.
+
+\begin{groupdesc}
+ \circuitdesc{pmos,emptycircle}{pmos}{}
+ \circuitdesc{pmos,nocircle,arrowmos}{pmos}{}
+\end{groupdesc}
+
+This example show the combined effects of the arrows and gate-circle options:
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[
+ info/.style={left=1cm, blue, text width=5em, align=right},]
+ \draw (0,1) node{pmos} (2,1) node{nmos};
+ \draw (0,0) node[info]{default} node[pmos]{} (2,0) node[nmos]{};
+ \ctikzset{tripoles/mos style/arrows}
+ \draw (0,-2) node[info]{arrows} node[pmos]{} (2,-2) node[nmos]{};
+ \ctikzset{tripoles/pmos style/emptycircle}
+ \draw (0,-4) node[info]{emptycircle} node[pmos]{} (2,-4) node[nmos]{};
+ \ctikzset{tripoles/pmos style/nocircle}
+ \draw (0,-6) node[info]{nocircle} node[pmos]{} (2,-6) node[nmos]{};
+ \ctikzset{tripoles/mos style/no arrows}
+ \draw (0,-8) node[info, red]{no circle, no arrows, DON'T do it}
+ node[pmos]{} (2,-8) node[nmos]{};
+\end{circuitikz}
+\end{LTXexample}
+
You can also change\footnote{Thanks to the idea by \href{https://github.com/circuitikz/circuitikz/issues/655}{Dr. Matthias Jung on GitHub}.} the type of the arrow for the ``light rays'' of the phototransistors with the generic arrows options shown in~\ref{sec:tunablearrows}, using the name \texttt{opto}, like in the following (overdone) example. Also the \texttt{opto arrows} styling options (see section~\ref{sec:opto-arrows}).
\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
@@ -4125,14 +4212,6 @@ Normally, in bipolar IGBTs the outer base is the same size (height) of the inner
\end{circuitikz}
\end{LTXexample}
-To draw the PMOS circle non-solid, use the option \texttt{emptycircle} or the command
-\\\verb!\ctikzset{tripoles/pmos style/emptycircle}!. To remove the dot completely (only useful if you have \texttt{arrowmos} enabled, otherwise there will be no difference between P-MOS and N-MOS), you can use the option \texttt{nocircle} or \verb|\ctikzset{tripoles/pmos style/nocircle}|.
-
-\begin{groupdesc}
- \circuitdesc{pmos,emptycircle}{pmos}{}
- \circuitdesc{pmos,nocircle,arrowmos}{pmos}{}
-\end{groupdesc}
-
\paragraph{Bulk terminals.} You can add a bulk terminal\footnote{Thanks to Burak Kelleci <kellecib@hotmail.com>.} to \texttt{nmos} and \texttt{pmos} using the key \texttt{bulk} in the node (and \texttt{nobulk} if you set the bulk terminal by default); additional anchors \texttt{bulk} and \texttt{nobulk} are added (in the next example, \texttt{tripoles/mos style/arrows} is enacted, too):
\begin{groupdesc}
@@ -4146,21 +4225,19 @@ To draw the PMOS circle non-solid, use the option \texttt{emptycircle} or the co
\footnotetext{Since \texttt{v1.4.4}, noticed by \href{https://tex.stackexchange.com/q/619334/38080}{user \texttt{hinata exc} on Stack Exchange}.}
\end{groupdesc}
+
+\paragraph{Solder dots.}\label{sec:solderdot-scale}
+Solder dots are scaled-down\footnote{Since \texttt{v1.6.3}, suggested by \href{https://tex.stackexchange.com/q/687225/38080}{user Hartomes on TeX StackExchange}; previously, the default scale was \texttt{1.0}, which created a clash with body diodes.} version of the normal \texttt{circ} connection dot (\emph{pole}).
+This is to convey the information that the connection is \emph{internal} to the device, and not controllable from the outside. By default, they are scaled as the bodydiode connection dots (see section~\ref{sec:trans-bodydiode-custom}), but you can change them with the command \texttt{\textbackslash ctikzset\{transistor solderdot scale=\emph{x}\}}, where $x$ is the scale with respect to the normal \texttt{circ} node (default: \texttt{0.7}).
+
\begin{LTXexample}[varwidth=true]
-\begin{circuitikz}[
- info/.style={left=1cm, blue, text width=5em, align=right},]
- \draw (0,1) node{pmos} (2,1) node{nmos};
- \draw (0,0) node[info]{default} node[pmos]{} (2,0) node[nmos]{};
- \ctikzset{tripoles/mos style/arrows}
- \draw (0,-2) node[info]{arrows} node[pmos]{} (2,-2) node[nmos]{};
- \ctikzset{tripoles/pmos style/emptycircle}
- \draw (0,-4) node[info]{emptycircle} node[pmos]{} (2,-4) node[nmos]{};
- \ctikzset{tripoles/pmos style/nocircle}
- \draw (0,-6) node[info]{nocircle} node[pmos]{} (2,-6) node[nmos]{};
- \ctikzset{tripoles/mos style/no arrows}
- \draw (0,-8) node[info, red]{no circle, no arrows, DON'T do it}
- node[pmos]{} (2,-8) node[nmos]{};
-\end{circuitikz}
+\begin{tikzpicture}[]
+ \draw (0,0) to[short,*-] ++(.1,0)
+ node[nigfete, solderdot, anchor=G]{};
+ \ctikzset{transistor solderdot scale=1}
+ \draw (2,0) to[short,*-] ++(.1,0)
+ node[nigfete, solderdot, anchor=G]{};
+\end{tikzpicture}
\end{LTXexample}
\paragraph{Simplified symbols for depletion-mode MOSFETs}.
@@ -4342,6 +4419,7 @@ You can change the style of the bodydiode\footnote{Suggested by \href{https://te
color & default & stroke color: \texttt{default} is the same as the component \\
dash & default & dash pattern: \texttt{default} means not to change the setting for the component; \texttt{none} means unbroken line; every other input is a dash pattern\footnotemark \\
scale & 0.3 & scale of the diode, with respect to the basic (not scaled) diode dimension.\\
+ dot scale & 0.7 & scale of bodydiode connections dots, with respect to the \texttt{circ} pole. Use zero to remove them (useful if you have circles around the transistor).\\
\bottomrule
\end{tabular}
\footnotetext{Follows the syntax of the pattern sequence \texttt{\textbackslash pgfsetdash} --- see \TikZ{} manual for details; phase is always zero. Basically you pass pairs of dash-length -- blank-length dimensions, see the examples.}
@@ -4356,9 +4434,10 @@ The following is a quite extensive example. Obviously, a good strategy in this c
circuitikz/transistor bodydiode/relative thickness=0.3}]
\draw (0,0) node (mosfet1) [nigfete,anchor=D,bodydiode] {$Q_1$};
\draw[densely dashed] (3,0) node (mosfet1) [nigfete,anchor=D,bodydiode] {$Q_2$};
- \draw (6,0) node (mosfet1) [nigfete,anchor=D,bodydiode,
+ \draw (6,0) node (mosfet1) [nigfete,anchor=D,bodydiode, tr circle,
circuitikz/transistor bodydiode/color=gray,
- circuitikz/transistor bodydiode/scale=0.2] {$Q_3$};
+ circuitikz/transistor bodydiode/scale=0.2,
+ circuitikz/transistor bodydiode/dot scale=0] {$Q_3$};
\draw (0,-2) node (mosfet1) [nigfete,anchor=D,bodydiode,
circuitikz/transistor bodydiode/dash={{2pt}{1pt}}] {$Q_4$};
\draw[densely dashed] (3,-2) node (mosfet1) [nigfete,anchor=D,
@@ -4366,13 +4445,12 @@ The following is a quite extensive example. Obviously, a good strategy in this c
\ctikzset{transistor bodydiode/relative thickness=.5,
transistor bodydiode/scale=0.6}% from now on, in scope
\draw[densely dotted] (6,-2) node (mosfet1) [nigfete,anchor=D,bodydiode,
- circuitikz/transistor bodydiode/dash=none] {$Q_6$};
+ circuitikz/transistor bodydiode/dash=none,
+ circuitikz/transistor bodydiode/dot scale=1] {$Q_6$};
\path (7,0); %% adjust bounding box (node text is outside it!)
\end{tikzpicture}
\end{LTXexample}
-
-
\subsubsection{Transistors anchors}
For \textsc{nmos}, \textsc{pmos}, \textsc{nfet}, \textsc{nigfete}, \textsc{nigfetd}, \textsc{pfet}, \textsc{pigfete}, and \textsc{pigfetd} transistors one has \texttt{base}, \texttt{gate}, \texttt{source} and \texttt{drain} anchors (which can be abbreviated with \texttt{B}, \texttt{G}, \texttt{S} and \texttt{D}):
@@ -8334,7 +8412,7 @@ Negative values do work as expected:
\begin{LTXexample}[varwidth=true]
\begin{circuitikz}[raised voltages]
\draw (0,1.5) to[R, v^=$v_1$, i=$i_1$] ++(2,0);
- \draw (0,0) to[R, v^=$v_1$, i=$i_1$,
+ \draw (0,0) to[R, v^=$v_1$, i_=$i_1$,
voltage shift=-1.0] ++(2,0);
\end{circuitikz}
\end{LTXexample}
@@ -8378,7 +8456,7 @@ Additionally, the \texttt{open} component is treated differently; the voltage is
If you want or need to maintain the old behavior for \texttt{open} voltage, you can set the key \texttt{open voltage position} to \texttt{legacy} (the default is the new behavior, which corresponds to the value \texttt{center}).
-\subsubsection{American voltages customization}
+\subsubsection{American voltages customization}\label{sec:american-voltage-custom}
Since 0.9.0, you can change the font\footnote{There was a bug before, noticed by the user \texttt{dzereb} on \href{https://tex.stackexchange.com/questions/487683/odd-minus-style-when-drawing-american-voltage}{tex.stackexchange.com} which made the symbols using different fonts in a basically random way. In the same page, user \texttt{campa} found the problem. Thanks!} used by the \texttt{american voltages} style, by setting to something different from nothing the key \texttt{voltage/american font} (default: nothing, using the current font) style:
@@ -8393,7 +8471,9 @@ Since 0.9.0, you can change the font\footnote{There was a bug before, noticed by
\end{LTXexample}
Also, if you want to change the symbols (sometimes just the $+$ sign is drawn, for example, or for highlighting something),
-using the keys \texttt{voltage/american plus} and \texttt{voltage/american minus} (default \verb|$+$| and \verb|$-$|).
+using the keys \texttt{voltage/american plus} and \texttt{voltage/american minus} (default \verb|$+$| and \verb|$\vphantom{+}-$|).
+
+Notice that the definition of the minus sign is not simply \verb|$-$| because in most font (but not Computer Modern!) the size of the bounding box for the mathematical plus or minus are different. The \verb|\vphantom| forces the vertical size of the minus sign to be the same as the plus sign.\footnote{Changed in v1.6.3, you can look at \href{https://github.com/circuitikz/circuitikz/issues/721}{this issue on GitHub} for more details.}
\begin{LTXexample}[varwidth=true]
\begin{circuitikz}[american]
@@ -8546,13 +8626,13 @@ For example, you can do something like this:
\end{circuitikz}
\end{LTXexample}
-Or, for example, to have a different voltage style; normally you would define a macro:
+Or, for example, to have a different voltage style; normally you would define a macro (see~\ref{sec:american-voltage-custom} to understand the \verb|\vphantom|).
\begin{LTXexample}[varwidth=true]
\begin{circuitikz}[voltage shift=0.5]
\def\eurVPM#1#2{% node, label
\draw [thin, -{Stealth[width=8pt]}, shorten >=5pt,
- shorten <=5pt] (#1-Vfrom) node[font=\tiny]{$-$}
+ shorten <=5pt] (#1-Vfrom) node[font=\tiny]{$\vphantom{+}-$}
.. controls (#1-Vcont1) and (#1-Vcont2)..
(#1-Vto) node[font=\tiny]{$+$}
node[pos=0.5,anchor=\ctikzgetanchor{#1}{Vlab}]{#2};}