summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-circuits.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-circuits.tex')
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-circuits.tex182
1 files changed, 103 insertions, 79 deletions
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-circuits.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-circuits.tex
index c211fa49ca4..f4fe43c28ed 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-circuits.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-circuits.tex
@@ -22,11 +22,23 @@ logical circuits. There is not a single library for this, but a whole hierarchy
of libraries that work in concert. The main design goal was to create a balance
between ease-of-use and ease-of-extending, while creating high-quality
graphical representations of circuits.
+%
+\begin{codeexample}[setup code,hidden]
+\tikzset{
+ % from `shape` library
+ shape example/.style= {color = black!30,
+ draw,
+ fill = yellow!30,
+ line width = .5cm,
+ inner xsep = 2.5cm,
+ inner ysep = 0.5cm}
+}
+\end{codeexample}
\subsubsection{A First Example}
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\begin{tikzpicture}[circuit ee IEC,x=3cm,y=2cm,semithick,
every info/.style={font=\footnotesize},
small circuit symbols,
@@ -72,12 +84,13 @@ graphical representations of circuits.
\end{tikzpicture}
\end{codeexample}
-An important feature of the circuit library is that the appearance of a circuit
-can be configured in general ways and that the labels are placed automatically
-by default. Here is the graphic once more, generated from \emph{exactly the
-same source code}, with only the options of the |{tikzpicture}| environment
-replaced by |[rotate=-90,circuit ee IEC,x=3.25cm,y=2.25cm]|:
-
+An important feature of the |circuits| library is that the appearance of a
+circuit can be configured in general ways and that the labels are placed
+automatically by default. Here is the graphic once more, generated from
+\emph{exactly the same source code}, with only the options of the
+|{tikzpicture}| environment replaced by
+|[rotate=-90,circuit ee IEC,x=3.25cm,y=2.25cm]|:
+%
\begin{tikzpicture}[rotate=-90,circuit ee IEC,x=3cm,y=2.25cm]
% Let us start with some contacts:
\foreach \contact/\y in {1/1,2/2,3/3.5,4/4.5,5/5.5}
@@ -173,7 +186,7 @@ Here is an overview of the different kinds of circuit libraries:
the above library, you can change which symbol graphics are
used ``on the fly''.
\end{itemize}
- \item The \tikzname-library |cirucits.ee| defines keys for symbols from
+ \item The \tikzname-library |circuits.ee| defines keys for symbols from
electrical engineering like resistors or capacitors. Again,
sublibraries define the actual symbol graphics.
%
@@ -203,7 +216,7 @@ appropriate symbol graphic for rendering an |and gate|. Using the
|circuit logic IEC| instead will set up |and gate| to use another symbol
graphic.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.logic.US}}]
\begin{tikzpicture}[circuit logic US]
\matrix[column sep=7mm]
{
@@ -223,7 +236,7 @@ graphic.
\end{tikzpicture}
\end{codeexample}
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.logic.IEC}}]
\begin{tikzpicture}[circuit logic IEC]
\matrix[column sep=7mm]
{
@@ -255,7 +268,7 @@ diode'', there is just one |diode| symbol, but you can add the |light emitting|
annotation to it. This is done by passing the annotation as a parameter to the
symbol as in the following example:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\tikz [circuit ee IEC]
\draw (0,0) to [diode={light emitting}] (3,0)
to [resistor={adjustable}] (3,2);
@@ -290,7 +303,7 @@ symbol as in the following example:
Note, that it is still possible to overwrite the size of any particular
symbol. These settings apply only to the default sizes.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\begin{tikzpicture}[circuit ee IEC]
\draw (0,1) to [resistor] (3.5,1);
\draw[circuit symbol unit=14pt]
@@ -326,7 +339,7 @@ symbol as in the following example:
value. Thus, this option can be used with a node command to set the size of
the node as a multiple of the circuit symbol unit.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\begin{tikzpicture}[circuit ee IEC]
\draw (0,1) to [resistor] (2,1) to[inductor] (4,1);
@@ -373,7 +386,7 @@ symbol as in the following example:
This key gets graphic options as parameter that will be set when a symbol
|foo| should be shown:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits}}]
\begin{tikzpicture}
[circuit declare symbol=foo,
set foo graphic={draw,shape=rectangle,minimum size=5mm}]
@@ -458,14 +471,14 @@ symbol as in the following example:
node. Another effect is that you can use this key multiple times on a path
to add several node to a path, provided they do not overlap.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits}}]
\begin{tikzpicture}[circuit]
\draw (0,0) to [circuit handle symbol={draw,shape=rectangle,near start},
circuit handle symbol={draw,shape=circle,near end}] (3,2);
\end{tikzpicture}
\end{codeexample}
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits}}]
\begin{tikzpicture}[transform shape,circuit]
\draw (0,0) to [circuit handle symbol={draw,shape=rectangle,at start},
circuit handle symbol={draw,shape=circle,near end}] (3,2);
@@ -488,7 +501,7 @@ of achieving such rotations:
like this: \tikz[circuit ee IEC]\node[inductor]{};) is automatically
rotated around:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\tikz [circuit ee IEC]
\draw (3,0) to[inductor] (1,0) to[inductor] (0,2);
\end{codeexample}
@@ -503,7 +516,7 @@ of achieving such rotations:
\begin{key}{/tikz/point up}
This is the same as |rotate=90|.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\tikz [circuit ee IEC] \node [diode,point up] {};
\end{codeexample}
\end{key}
@@ -511,7 +524,7 @@ of achieving such rotations:
\begin{key}{/tikz/point down}
This is the same as |rotate=-90|.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\tikz [circuit ee IEC] \node [diode,point down] {};
\end{codeexample}
\end{key}
@@ -519,7 +532,7 @@ of achieving such rotations:
\begin{key}{/tikz/point left}
This is the same as |rotate=-180|.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\tikz [circuit ee IEC] \node [diode,point left] {};
\end{codeexample}
\end{key}
@@ -527,7 +540,7 @@ of achieving such rotations:
\begin{key}{/tikz/point right}
This key has no effect.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\tikz [circuit ee IEC] \node [diode,point right] {};
\end{codeexample}
\end{key}
@@ -558,7 +571,7 @@ that are especially useful in conjunction with circuits.
The \meta{options} and \meta{angle} are passed directly to the |label|
command.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\begin{tikzpicture}[circuit ee IEC,every info/.style=red]
\node [resistor,info=$3\Omega$] {};
\end{tikzpicture}
@@ -570,7 +583,7 @@ that are especially useful in conjunction with circuits.
Hint: To place some text \emph{on} the main node, use |center| as the
\meta{angle}:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\begin{tikzpicture}[circuit ee IEC,every info/.style=red]
\node [resistor,info=center:$3\Omega$] {};
\node [resistor,point up,info=center:$R_1$] at (2,0) {};
@@ -587,7 +600,7 @@ that are especially useful in conjunction with circuits.
you get a label below the node. In case the node has been rotated, the
positions of the info nodes are rotated accordingly.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\begin{tikzpicture}[circuit ee IEC,every info/.style=red]
\draw (0,0) to[resistor={info={$3\Omega$},info'={$R_1$}}] (3,0)
to[resistor={info={$4\Omega$},info'={$R_2$}}] (3,2);
@@ -600,7 +613,7 @@ that are especially useful in conjunction with circuits.
This key works like |info|, only the |transform shape| option is set when
the label is drawn, causing it to follow the sloping of the main node.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\begin{tikzpicture}[circuit ee IEC,every info/.style=red]
\draw (0,0) to[resistor={info sloped={$3\Omega$}}] (3,0)
to[resistor={info sloped={$4\Omega$}}] (3,2);
@@ -612,7 +625,7 @@ that are especially useful in conjunction with circuits.
\begin{key}{/tikz/info' sloped=}
This is a combination of |info'| and |info sloped|.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\begin{tikzpicture}[circuit ee IEC,every info/.style=red]
\draw (0,0) to[resistor={info' sloped={$3\Omega$}}] (3,0)
to[resistor={info' sloped={$4\Omega$}}] (3,2);
@@ -642,7 +655,7 @@ that are especially useful in conjunction with circuits.
is used internally, by changing the |every info| style, you can change the
appearance of all units infos.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\begin{tikzpicture}[circuit ee IEC,circuit declare unit={my ohm}{O}]
\draw (0,0) to[resistor={my ohm' sloped=3}] (3,2);
\end{tikzpicture}
@@ -709,7 +722,13 @@ Annotations can be declared using the following key:
{8pt}
{(0pt,8pt) arc (-270:80:3.5pt)}
}
-\begin{codeexample}[]
+\begin{codeexample}[
+ preamble={\usetikzlibrary{circuits.ee.IEC}}
+ pre={\tikzset{circuit declare annotation=
+ {circular annotation}
+ {8pt}
+ {(0pt,8pt) arc (-270:80:3.5pt)}
+}}]
\tikz[circuit ee IEC]
\draw (0,0) to [resistor={circular annotation}] (3,0);
\end{codeexample}
@@ -719,7 +738,7 @@ Annotations can be declared using the following key:
node an nothing else. This path is not drawn or filled, so we do not see
anything. What we must do is to use an |edge| path operation:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\tikzset{circuit declare annotation={circular annotation}{9pt}
{(0pt,8pt) edge[to path={arc(-270:80:3.5pt)}] ()}
}
@@ -738,7 +757,12 @@ Annotations can be declared using the following key:
\tikzset{circuit declare annotation={circular annotation}{9pt}
{(0pt,8pt) edge[to path={arc (-270:80:3.5pt)}] ()}
}
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}
+ pre={\tikzset{circuit declare annotation=
+ {circular annotation}
+ {8pt}
+ {(0pt,8pt) arc (-270:80:3.5pt)}
+}}]
\tikz[circuit ee IEC]
\draw (0,0) to [resistor={circular annotation,ohm=5}] (2,0)
to [resistor={circular annotation={ohm=5}}] (4,0);
@@ -765,7 +789,7 @@ the symbol. You can modify this graphical representation in several ways:
For instance, in the following picture the symbols are ridiculously
thick and resistors are red.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\begin{tikzpicture}
[circuit ee IEC,
every circuit symbol/.style={ultra thick},
@@ -784,7 +808,7 @@ the symbol. You can modify this graphical representation in several ways:
some area. For instance, the IEC version of a resistor is an open
symbol.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\tikz [circuit ee IEC,
circuit symbol open/.style={thick,draw,fill=yellow}]
\draw (0,0) to [inductor] ++(right:3) to [resistor] ++(up:2);
@@ -801,7 +825,7 @@ the symbol. You can modify this graphical representation in several ways:
This style is used with symbols that consist only of lines that do
not surround anything. Examples are a capacitor.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\tikz [circuit ee IEC,
circuit symbol lines/.style={thick,draw=red}]
\draw (0,0) to [capacitor] ++(right:3) to [resistor] ++(up:2);
@@ -818,7 +842,7 @@ the symbol. You can modify this graphical representation in several ways:
Compare
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\tikz [circuit ee IEC,circuit symbol lines/.style={draw,very thick}]
\draw (0,0) to [capacitor={near start},
make contact={near end}] (3,0);
@@ -826,7 +850,7 @@ the symbol. You can modify this graphical representation in several ways:
%
to
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\tikz [circuit ee IEC,circuit symbol wires/.style={draw,very thick}]
\draw (0,0) to [capacitor={near start},
make contact={near end}] (3,0);
@@ -864,7 +888,7 @@ graphic; for instance, there are two variants for the resistor graphic in the
IEC library. In this case you can set the graphic for the resistor to this
variant (or back to the original) by saying |set resistor graphic| yourself:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\begin{tikzpicture}[circuit ee IEC]
% Standard resistor
\draw (0,2) to [resistor] (3,2);
@@ -923,7 +947,7 @@ graphical representations of the symbols declared in the following library:
Since the |circuits.logic| library does not define any actual graphics, you need
to use one of the following libraries, instead:
-\begin{pgflibrary}{circuits.logic.IEC}
+\begin{tikzlibrary}{circuits.logic.IEC}
This library provides graphics based on gates recommended by the
International Electrotechnical Commission. When you include this library,
you can use the following key to set up a scope that contains a logical
@@ -938,7 +962,7 @@ to use one of the following libraries, instead:
appearance. These keys are called |and gate IEC graphic|,
|or gate IEC graphic|, and so on.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.logic.IEC}}]
\begin{tikzpicture}[circuit logic IEC,
every circuit symbol/.style={
logic gate IEC symbol color=black,
@@ -961,9 +985,9 @@ to use one of the following libraries, instead:
\end{tikzpicture}
\end{codeexample}
\end{key}
-\end{pgflibrary}
+\end{tikzlibrary}
-\begin{pgflibrary}{circuits.logic.US}
+\begin{tikzlibrary}{circuits.logic.US}
This library provides graphics showing ``American'' logic gates. It defines
the following key:
@@ -977,7 +1001,7 @@ set and gate graphic = and gate US graphic
Here is an example:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.logic.CDH}}]
\begin{tikzpicture}[circuit logic CDH,
tiny circuit symbols,
every circuit symbol/.style={
@@ -1000,9 +1024,9 @@ set and gate graphic = and gate US graphic
\end{tikzpicture}
\end{codeexample}
\end{key}
-\end{pgflibrary}
+\end{tikzlibrary}
-\begin{pgflibrary}{circuits.logic.CDH}
+\begin{tikzlibrary}{circuits.logic.CDH}
This library provides graphics based on the logic symbols used in A. Croft,
R. Davidson, and M. Hargreaves (1992), \emph{Engineering Mathematics},
Addison-Wesley, 82--95. They are identical to the US-style symbols, except
@@ -1013,7 +1037,7 @@ set and gate graphic = and gate US graphic
nand-gates, that is, it uses |set and gate graphic| with
|and gate CDH graphic| and likewise for nand-gates.
\end{key}
-\end{pgflibrary}
+\end{tikzlibrary}
Inside |circuit logic XYZ| scopes, you can now use the keys shown in
Section~\ref{section-logic-symbols}. We have a more detailed look at one of
@@ -1025,11 +1049,11 @@ them, all the other work the same way:
dictated by the which circuit environment is used. To further configure the
appearance of the |and gate|, see Section~\ref{section-theming-symbols}.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.logic.IEC}}]
\tikz [circuit logic IEC] \node [and gate] {$A$};
\end{codeexample}
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.logic.US}}]
\tikz [circuit logic US]
{
\node [and gate,point down] {$A$};
@@ -1055,7 +1079,7 @@ them, all the other work the same way:
supports one input the anchor is simply called |input| with no
numerical index.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.logic.IEC}}]
\begin{tikzpicture}[circuit logic IEC]
\node[and gate,inputs={inini}] (A) {};
\foreach \a in {1,...,5}
@@ -1133,7 +1157,7 @@ Let us begin with the base library that defines the handling of inputs.
supports one input the anchor is simply called |input| with no
numerical index.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.logic.IEC}}]
\begin{tikzpicture}[minimum height=0.75cm]
\node[and gate IEC, draw, logic gate inputs={inverted, normal, inverted}]
(A) {};
@@ -1150,7 +1174,7 @@ Let us begin with the base library that defines the handling of inputs.
\emph{without the commas}. So, for example, |ini| is equivalent to
|inverted, normal, inverted|.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.logic.US}}]
\begin{tikzpicture}[minimum height=0.75cm]
\node[or gate US, draw,logic gate inputs=inini] (A) {};
\foreach \a in {1,...,5}
@@ -1176,7 +1200,7 @@ Let us begin with the base library that defines the handling of inputs.
This is also the radius of the circle used for the inverted output of
the |nand|, |nor|, |xnor| and |not| gates.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.logic.CDH}}]
\begin{tikzpicture}[minimum height=0.75cm]
\tikzset{every node/.style={shape=nand gate CDH, draw, logic gate inputs=ii}}
\node[logic gate inverted radius=2pt] {A};
@@ -1190,7 +1214,7 @@ Let us begin with the base library that defines the handling of inputs.
Set the distance between the \emph{centers} of the inputs to the logic
gate.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.logic.IEC}}]
\begin{tikzpicture}[minimum size=0.75cm]
\draw [help lines] grid (3,2);
\tikzset{every node/.style={shape=and gate IEC, draw, logic gate inputs=ini}}
@@ -1235,7 +1259,7 @@ Let us begin with the base library that defines the handling of inputs.
by shape basis: whether the bounding box is used is determined by value
of this key when the anchor is accessed.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.logic.US}}]
\begin{tikzpicture}[minimum height=1.5cm]
\node[xnor gate US, draw, gray!50,line width=2pt] (A) {};
\foreach \x/\y/\z in {false/blue/1pt, true/red/2pt}
@@ -1274,7 +1298,7 @@ Let us begin with the base library that defines the handling of inputs.
this gate with two non-inverted inputs (using the normal compass point
anchors) are shown below. Anchor |30| is an example of a border anchor.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.logic.US}}]
\Huge
\begin{tikzpicture}
\node[name=s,shape=nand gate US,shape example, inner sep=0cm,
@@ -1376,7 +1400,7 @@ Let us begin with the base library that defines the handling of inputs.
node and the outer edge of the symbol is determined by the values of
the |inner xsep| and |inner ysep|.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{shapes.gates.logic.IEC}}]
\begin{tikzpicture}[minimum size=1cm, use IEC style logic gates]
\tikzset{every node/.style={nor gate, draw}}
\node (A) at (0,1.5) {};
@@ -1418,7 +1442,7 @@ Let us begin with the base library that defines the handling of inputs.
gate with two inverted inputs are shown below. Anchor |30| is an
example of a border anchor.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.logic.IEC}}]
\Huge
\begin{tikzpicture}
\node[name=s,shape=nand gate IEC ,shape example, inner xsep=1cm, inner ysep=1cm,
@@ -1503,7 +1527,7 @@ later sections.
When used with a node, it will cause this node to ``look like'' a resistor
(by default, in the IEC library, this is just a simple rectangle).
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\tikz [circuit ee IEC]
\node [resistor] {};
\end{codeexample}
@@ -1512,7 +1536,7 @@ later sections.
in |node [resistor] {foo}|). Instead, the labeling of resistors should be
done using the |label|, |info| and |ohm| options.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\tikz [circuit ee IEC]
\node [resistor,ohm=5] {};
\end{codeexample}
@@ -1521,7 +1545,7 @@ later sections.
with a normal node, you can just as well given them to the |node| itself.
Thus, the following has the same effect as the above example:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\tikz [circuit ee IEC]
\node [resistor={ohm=5}] {};
\end{codeexample}
@@ -1531,7 +1555,7 @@ later sections.
useful. They are just shorthands for appropriate rotations like
|rotate=90|.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\tikz [circuit ee IEC] {
\node (R1) [resistor,point up,ohm=5] at (3,1) {};
\node (R2) [resistor,ohm=10k] at (0,0) {};
@@ -1561,7 +1585,7 @@ later sections.
resistor node on the path, you can use it to add labels to the node. Here
is a simple example:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\tikz [circuit ee IEC]
\draw (0,0) to [resistor=red] (3,0)
to [resistor={ohm=2\mu}] (3,2);
@@ -1594,21 +1618,21 @@ predefined units are listed in Section~\ref{section-circuits-units}.
you get $\mathrm{5k\Omega}$, |ohm=5p| yields $\mathrm{5p\Omega}$, and
|ohm=5.6\cdot 10^{2}\mu| yields $\mathrm{5.6\cdot 10^{2}\mu\Omega}$.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\tikz [circuit ee IEC] \draw (0,0) to [resistor={ohm=5M}] (0,2);
\end{codeexample}
Instead of |ohm| you can also use |ohm'|, which places the label on the
other side.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\tikz [circuit ee IEC] \draw (0,0) to [resistor={ohm'=5M}] (0,2);
\end{codeexample}
Finally, there are also keys |ohm sloped| and |ohm' sloped| for having the
info label rotate together with the main node.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\tikz [circuit ee IEC]
\draw (0,0) to [resistor={ohm sloped=5M}] (0,2)
(2,0) to [resistor={ohm' sloped=6f}] (2,2);
@@ -1627,7 +1651,7 @@ Section~\ref{section-circuits-annotations}.
node. It causes some drawings (in this case, two parallel lines) to be
placed next to the node.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\tikz [circuit ee IEC] \draw (0,0) to [diode=light emitting] (2,0);
\end{codeexample}
@@ -1644,7 +1668,7 @@ Section~\ref{section-circuits-annotations}.
been changed to accommodate for the space taken up by the
annotation.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\tikz [circuit ee IEC]
{
\draw (0,2) to [diode={light emitting,info=not good}] (2,2);
@@ -1925,7 +1949,7 @@ automatically. Usually, you will not need to use these shapes directly.
The anchors of this shape are just the compass anchors, which lie on a
rectangle whose width and height are the above-computed height and width.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\begin{tikzpicture}
\pgfsetarrowoptions{direction ee}{6cm}
\node[name=s,shape=direction ee,shape example,minimum height=0.7654*6cm] {};
@@ -1939,7 +1963,7 @@ automatically. Usually, you will not need to use these shapes directly.
\end{tikzpicture}
\end{codeexample}
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\begin{tikzpicture}[direction ee arrow=angle 45]
\node[name=s,shape=direction ee,shape example,minimum height=1.75cm] {};
\foreach \anchor/\placement in {north/above, south/below,
@@ -1982,7 +2006,7 @@ automatically. Usually, you will not need to use these shapes directly.
%
Here is an examples of how to use this shape:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\tikz \node [generic circle IEC,
/pgf/generic circle IEC/before background={
\pgfpathmoveto{\pgfpointorigin}
@@ -2002,7 +2026,7 @@ automatically. Usually, you will not need to use these shapes directly.
rectangle around the diode, see the below example. The diode's size is
based on the current settings of |minimum width| and |minimum height|.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\begin{tikzpicture}
\node[name=s,shape=generic diode IEC,shape example,minimum size=6cm] {};
\foreach \anchor/\placement in
@@ -2032,7 +2056,7 @@ automatically. Usually, you will not need to use these shapes directly.
The idea is that you use this key to draw different kinds of diode
endings.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\tikz \node [minimum size=1cm,generic diode IEC,
/pgf/generic diode IEC/before background={
\pgfpathmoveto{\pgfqpoint{-.5pt}{-1pt}}
@@ -2053,7 +2077,7 @@ automatically. Usually, you will not need to use these shapes directly.
size is based on the current settings of |minimum width| and
|minimum height|.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\begin{tikzpicture}
\node[name=s,shape=breakdown diode IEC,shape example,minimum width=6cm,minimum height=4cm] {};
\foreach \anchor/\placement in
@@ -2082,7 +2106,7 @@ automatically. Usually, you will not need to use these shapes directly.
All of this means that, in general, the shape should be much wider than
high.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\begin{tikzpicture}
\node[name=s,shape=var resistor IEC,shape example,minimum width=7cm,minimum height=1cm] {};
\foreach \anchor/\placement in
@@ -2108,7 +2132,7 @@ automatically. Usually, you will not need to use these shapes directly.
|minimum height|. The |center| of the shape is just above the |south|
anchor, at a distance of the |outer ysep|.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\begin{tikzpicture}
\node[name=s,shape=inductor IEC,shape example,minimum width=7cm,minimum height=1cm] {};
\foreach \anchor/\placement in
@@ -2130,7 +2154,7 @@ automatically. Usually, you will not need to use these shapes directly.
the background path, only the ``left and right lines'' that make up the
rectangle are drawn.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\begin{tikzpicture}
\node[name=s,shape=capacitor IEC,shape example,
minimum width=2cm,minimum height=3cm,inner sep=0pt] {};
@@ -2150,7 +2174,7 @@ automatically. Usually, you will not need to use these shapes directly.
This shape is similar to a |capacitor IEC|, however, the right line is only
half the height of the left line.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\tikz \node[shape=battery IEC,shape example,minimum size=2cm,
inner sep=0pt] {};
\end{codeexample}
@@ -2161,7 +2185,7 @@ automatically. Usually, you will not need to use these shapes directly.
This shape is similar to a |batter IEC|, only three lines of different
heights are drawn.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\tikz \node[shape=ground IEC,shape example,minimum size=2cm,
inner sep=0pt] {};
\end{codeexample}
@@ -2173,7 +2197,7 @@ automatically. Usually, you will not need to use these shapes directly.
right corner. The size and anchors of this shape are computed in the same
way as for an |inductor IEC|.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\begin{tikzpicture}
\node[name=s,shape=make contact IEC,shape example,minimum width=3cm,minimum height=1cm] {};
\foreach \anchor/\placement in
@@ -2193,7 +2217,7 @@ automatically. Usually, you will not need to use these shapes directly.
the path at the lower left corner. The radius of this circle is one twelfth
of the width of the node.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\tikz \node[shape=var make contact IEC,shape example,
minimum height=1cm,minimum width=3cm,inner sep=0pt] {};
\end{codeexample}
@@ -2204,7 +2228,7 @@ automatically. Usually, you will not need to use these shapes directly.
This shape depicts a contact that can be broken. It works like
|make contact IEC|.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{circuits.ee.IEC}}]
\tikz \node[shape=break contact IEC,shape example,
minimum height=1cm,minimum width=3cm,inner sep=0pt] {};
\end{codeexample}