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.tex130
1 files changed, 106 insertions, 24 deletions
diff --git a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex
index d9ebe7a284..9302ccee3b 100644
--- a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex
+++ b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex
@@ -1385,6 +1385,25 @@ Several groups of components, on the other hand, have a special \texttt{scale} p
\end{circuitikz}
\end{LTXexample}
+Never use \texttt{scale}, \texttt{xscale} or~\texttt{yscale} in a path-style component (i.e., inside a \texttt{to[...]}) command.
+
+\paragraph{Mirroring and flipping path-style components}\label{sec:mirror-flip-path}
+
+To change the orientation of path-style components, \emph{never} use \texttt{xscale=-1} nor~\texttt{yscale=-1}. That will mess up the path completely. Use the \texttt{mirror} and \texttt{invert} options:
+\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
+\begin{tikzpicture}[N/.style={
+ font=\tiny\ttfamily, above}]
+ \draw (0,0) to [put] ++(0,2)
+ node[N]{no modifier};
+ \draw (1,0) to [put, mirror] ++(0,2)
+ node[N]{mirror};
+ \draw (2,0) to [put, invert] ++(0,2)
+ node[N]{invert};
+ \draw (3,0) to [put, mirror, invert] ++(0,2)
+ node[N]{both};
+\end{tikzpicture}
+\end{LTXexample}
+
\paragraph{Thickness of the lines}\label{sec:legacy-thickness} (globally)
The best way to alter the thickness of components is using styling, see section~\ref{sec:styling-thickness}. Alternatively, you can use ``legacy'' classes like \texttt{bipole}, \texttt{tripoles} and so on ---
@@ -1454,7 +1473,7 @@ Explanation of the parameters:\\
\subsubsection{Mirroring and flipping}\label{sec:mirroring-and-flipping}
-Mirroring and flipping of node components is obtained by using the \TikZ\ keys \texttt{xscale} and \texttt{yscale}. Notice that this parameters affect also text labels, so they need to be un-scaled by hand.
+Mirroring and flipping of node components is obtained by using the \TikZ\ keys \texttt{xscale} and \texttt{yscale}. Notice that this parameters affect also text labels, so they need to be un-scaled by hand. Notice that you \textbf{do not} use \texttt{xscale} or~\texttt{yscale} in a path-style component, see section~\ref{sec:mirror-flip-path} for that case.
\begin{LTXexample}[varwidth=true]
\begin{circuitikz}[scale=0.7, transform shape]
@@ -2002,7 +2021,8 @@ If \texttt{americanresistors} option is active (or the style \texttt{[american r
\circuitdescbip[resistor]{R}{Resistor}{american resistor}
\circuitdescbip[vresistor]{vR}{Variable resistor}{variable american resistor}
\circuitdescbip[potentiometer]{pR}{Potentiometer}{american potentiometer}( wiper/0/0.3 )
- \circuitdescbip[resistivesens]{sR}{Resisitive sensor}{american resisitive sensor}( label/0/0.3 )
+ \circuitdescbip[resistivesens]{sR}{Resistive sensor}{american resistive sensor}( label/0/0.3 )
+ \circuitdescbip*[ldresistor]{ldR}{Ligth-Dependent resistor}{american light dependent resistor}(arrows/-45/0.3)
\end{groupdesc}
If instead \texttt{europeanresistors} option is active (or the style \texttt{[european resistors]} is used), the resistors, variable resistors and potentiometers are displayed as follows:
@@ -2012,13 +2032,14 @@ If instead \texttt{europeanresistors} option is active (or the style \texttt{[e
\circuitdescbip*[tgeneric]{vR}{Variable resistor}{variable european resistor}
\circuitdescbip*[genericpotentiometer]{pR}{Potentiometer}{european potentiometer}( wiper/0/0.3 )
\circuitdescbip*[thermistor]{sR}{Resistive sensor}{european resistive sensor}( label/0/0.3 )
+ \circuitdescbip*[ldgeneric]{ldR}{Ligth-Dependent resistor}{european light dependent resistor}(arrows/-45/0.3)
\ctikzset{resistor=american} % reset default
\end{groupdesc}
Other miscellaneous resistor-like devices:
\begin{groupdesc}
\circuitdescbip*{varistor}{Varistor}{}
- \circuitdescbip*[photoresistor]{phR}{Photoresistor}{photoresistor}
+ \circuitdescbip*[photoresistor]{phR}{Photoresistor}{photoresistor}(arrows/0/0.3)
\circuitdescbip*[thermistor]{thR}{Thermistor}{thermistor}
\circuitdescbip*[thermistorptc]{thRp}{PTC thermistor}{thermistor ptc}
\circuitdescbip*[thermistorntc]{thRn}{NTC thermistor}{thermistor ntc}
@@ -2096,17 +2117,19 @@ We can call \emph{modifiers} the elements that are added to the basic shape to e
Also you can change the start arrow with the corresponding \texttt{tunable start arrow} or \texttt{wiper start arrow} (the default value ``\texttt{default}'' is equivalent to \texttt{\{\}} for both, which means no arrow).
You can change that globally or locally, as ever. The tip specification is the one you can find in the \TikZ{} manual (``Arrow Tip Specifications'').
+For the \texttt{photoresistor} and the two ``flavors'' of the light-dependent resistor (\texttt{ldR}, american or european), the style of the arrows follow the \texttt{opto} commands as in the photodiodes and phototransistor: see~\ref{sec:opto-arrows}.
\begin{LTXexample}[varwidth]
- \begin{circuitikz}[american]
- % globally all the potentiometrs
- \ctikzset{wiper end arrow={Kite[open]}}
- \draw (0,0) to[tgeneric] ++(2,0)
- % set locally on this variable resistor
- to[vR, tunable end arrow={Stealth[red]},
- tunable start arrow={Bar}, invert] ++(0,-2)
- to[pR] ++(-2,0);
- \end{circuitikz}
+\begin{tikzpicture}[american]
+ % globally all the potentiometrs
+ \ctikzset{wiper end arrow={Kite[open]},
+ opto arrows/color=blue, opto end arrow={Triangle}}
+ \draw (0,0) to[tgeneric] ++(2,0) to[phR] ++(2,0)
+ % set locally on this variable resistor
+ to[vR, tunable end arrow={Stealth[red]},
+ tunable start arrow={Bar}, invert] ++(0,-2)
+ to[pR, mirror] ++(-4,0);
+\end{tikzpicture}
\end{LTXexample}
@@ -2334,9 +2357,9 @@ The package options \texttt{fulldiode}, \texttt{strokediode}, and \texttt{emptyd
\circuitdescbip*[emptyzdiode]{empty Zener diode}{Empty Zener diode}{zDo}
\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*[emptylaserdiode]{empty laser diode}{Empty laser diode\footnotemark}{lasD}
+ \circuitdescbip*[emptypdiode]{empty photodiode}{Empty photodiode}{pDo}(arrows/-30/0.3)
+ \circuitdescbip*[emptylediode]{empty led}{Empty led}{leDo}(arrows/-30/0.3)
+ \circuitdescbip*[emptylaserdiode]{empty laser diode}{Empty laser diode\footnotemark}{lasD}(arrows/-30/0.3)
\footnotetext{Added by André Alves in \texttt{v1.4.4}}
\circuitdescbip*[emptyvarcap]{empty varcap}{Empty varcap}{VCo}
\circuitdescbip*[emptytvsdiode]{empty TVS diode}{Empty TVS diode, transorb\footnotemark}{tvsDo}
@@ -2349,9 +2372,9 @@ The package options \texttt{fulldiode}, \texttt{strokediode}, and \texttt{emptyd
\circuitdescbip[fullzdiode]{full Zener diode}{Full Zener diode}{zD*}
\circuitdescbip[fullzzdiode]{full ZZener diode}{Full ZZener diode}{zzD*}
\circuitdescbip[fulltdiode]{full tunnel diode}{Full tunnel diode}{tD*}
- \circuitdescbip[fullpdiode]{full photodiode}{Full photodiode}{pD*}
- \circuitdescbip[fulllediode]{full led}{Full led}{leD*}
- \circuitdescbip[fulllaserdiode]{full laser diode}{Full laser diode}{lasD*}
+ \circuitdescbip[fullpdiode]{full photodiode}{Full photodiode}{pD*}(arrows/-30/0.3)
+ \circuitdescbip[fulllediode]{full led}{Full led}{leD*}(arrows/-30/0.3)
+ \circuitdescbip[fulllaserdiode]{full laser diode}{Full laser diode}{lasD*}(arrows/-30/0.3)
\circuitdescbip[fullvarcap]{full varcap}{Full varcap}{VC*}
\circuitdescbip[fulltvsdiode]{full TVS diode}{Full TVS diode, transorb}{tvsD*}
\circuitdescbip[fullshdiode]{full Shockley diode}{Full Shockley diode}{shD*}
@@ -2366,9 +2389,9 @@ These shapes have no exact node-style counterpart, because the stroke line is bu
\circuitdescbip*[emptyzdiode]{stroke Zener diode}{Stroke Zener diode}{zD-}
\circuitdescbip*[emptyzzdiode]{stroke ZZener diode}{Stroke ZZener diode}{zzD-}
\circuitdescbip*[emptytdiode]{stroke tunnel diode}{Stroke tunnel diode}{tD-}
- \circuitdescbip*[emptypdiode]{stroke photodiode}{Stroke photodiode}{pD-}
- \circuitdescbip*[emptylediode]{stroke led}{Stroke led}{leD-}
- \circuitdescbip*[emptylaserdiode]{stroke laser diode}{Stroke laser diode}{lasD-}
+ \circuitdescbip*[emptypdiode]{stroke photodiode}{Stroke photodiode}{pD-}(arrows/-30/0.3)
+ \circuitdescbip*[emptylediode]{stroke led}{Stroke led}{leD-}(arrows/-30/0.3)
+ \circuitdescbip*[emptylaserdiode]{stroke laser diode}{Stroke laser diode}{lasD-}(arrows/-30/0.3)
\circuitdescbip*[emptyvarcap]{stroke varcap}{Stroke varcap}{VC-}
\end{groupdesc}
@@ -2457,7 +2480,7 @@ You can change the scale of the diodes by setting the key \texttt{diodes/scale}
\end{circuitikz}
\end{LTXexample}
-You can change the direction of the LEDs and photodiodes' arrows by using the binary keys \texttt{led arrows from cathode} and \texttt{pd arrows to cathode} (the default are \texttt{led arrows from anode} and \texttt{pd arrows to anode}), as you can see in the following example.
+\paragraph{Optical devices arrows}\label{sec:opto-arrows} You can change the direction of the LEDs and photodiodes' arrows by using the binary keys \texttt{led arrows from cathode} and \texttt{pd arrows to cathode} (the default are \texttt{led arrows from anode} and \texttt{pd arrows to anode}), as you can see in the following example.
\begin{LTXexample}[varwidth=true]
\begin{circuitikz}
@@ -2481,6 +2504,51 @@ You can change the direction of the LEDs and photodiodes' arrows by using the bi
\end{circuitikz}
\end{LTXexample}
+Since version \texttt{1.5.5}\footnote{Thanks to the idea by \href{https://github.com/circuitikz/circuitikz/issues/655}{Dr. Matthias Jung on GitHub}.}, you can change the arrows used for LEDs, photodiodes and laser diodes with the generic arrows options shown in~\ref{sec:tunablearrows}, using the name \texttt{opto}, like in the following (overdone) example. Normally you want just to change the \texttt{end arrow}\dots
+
+As you can see, you can also have the option to globally change the color, relative thickness, and dash pattern by setting keys with the \verb!\ctikzset! command (or, like in the following example, directly in the node instantiation) under the \texttt{opto arrows} hierarchy. The available keys are:
+
+\begin{center}
+ \begin{tabular}{>{\ttfamily}l>{\ttfamily}lp{0.5\linewidth}}
+ \toprule
+ parameter & default & description \\
+ \midrule
+ relative thickness & 1.0 & multiply the class thickness \\
+ 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 \\
+ \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.}
+\end{center}
+
+\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
+\begin{tikzpicture}
+\newcommand{\optos}{%
+ to[leD] ++(1.5,0) to[pD*] ++(1.5,0)
+ to[lasD] ++(1.5,0)}
+\begin{scope}
+ \draw (0,2) \optos;
+ \ctikzset{led arrows from cathode}
+ \ctikzset{pd arrows to cathode}
+ \ctikzset{opto arrows/.cd, color=red,
+ dash={{1pt}{1pt}}}
+ \draw (0,0) \optos;
+\end{scope}
+\begin{scope}[color=blue, yshift=-6cm]
+ \ctikzset{opto end arrow={Triangle[angle'=45]}}
+ \ctikzset{opto start arrow={Hooks[red]}}
+ \draw (0,4) \optos;
+ \ctikzset{opto arrows/color=black}
+ \ctikzset{opto arrows/relative thickness=2}
+ \draw (0,2) \optos;
+ \ctikzset{led arrows from cathode}
+ \ctikzset{pd arrows to cathode}
+ \draw (0,0) \optos;
+\end{scope}
+\end{tikzpicture}
+\end{LTXexample}
+
+
\subsection{Sources and generators}
Notice that source and generators are divided in three classes that can be styled independently: traditional battery symbols (class \texttt{batteries}), independent generators (class \texttt{sources}) and dependent generators (class \texttt{csources}). This is because they are often treated differently, and so you can choose to, for example, fill the dependent sources but not the independent ones.
@@ -3590,8 +3658,8 @@ To show that a device is optional, you can dash it. The inner symbol will be kep
\circuitdesc{npn, schottky base}{schottky npn}{}
\circuitdesc{pnp, schottky base}{schottky pnp}{}
\circuitdesc{npn, bodydiode}{npn}{}(body C in/60/0.2, body E in/-60/0.2,body C out/0/0.3, body E out/-0/0.3)
- \circuitdesc{npn,photo}{photo npn}{}( nobase/0/0.4 )
- \circuitdesc{pnp,photo}{photo pnp}{}
+ \circuitdesc{npn,photo}{photo npn}{}(nobase/0/0.4)
+ \circuitdesc{pnp,photo}{photo pnp}{}(arrows/180/0.1)
\circuitdesc{nigbt}{nigbt}{Q}
\circuitdesc{pigbt}{pigbt}{}(centergap/0/0.5)
\circuitdesc{Lnigbt}{Lnigbt}{Q}
@@ -3715,6 +3783,16 @@ 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\}}.
+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]
+\begin{tikzpicture}
+ \draw (0,2) node[npn, photo]{} ++(2,0) node[pnp, photo]{};
+ \ctikzset{opto end arrow={Triangle[angle'=60]}}
+ \ctikzset{opto arrows/.cd, color=red, dash={{1pt}{1pt}}}
+ \draw (0,0) node[npn, photo]{} ++(2,0) node[pnp, photo]{};
+\end{tikzpicture}
+\end{LTXexample}
\paragraph{Circles.} Since \texttt{1.2.6}, you can add a circle\footnote{Suggested by Matthias Jung \href{https://github.com/circuitikz/circuitikz/issues/442}{on GitHub}} to most of the transistor shapes --- with the exception of multi-terminal (\texttt{bjtnpn} and \texttt{bjtpnp}, where it would be awkward anyway) and graphene FETs. The circle is intended in some case as the component's housing, and used to distinguish discrete components from integrated ones.
@@ -4296,11 +4374,15 @@ Access to the gate and/or base nodes can be gained by naming the transistors wit
;\end{circuitikz}
\end{LTXexample}
+Transistor used in path are fully path-style components, so to flip and rotate them you should use \texttt{mirror} and \texttt{invert} as shown in section~\ref{sec:mirror-flip-path}.
+
Transistor paths have the possibility to use the poles syntax (see section~\ref{sec:bipole-nodes}) but they have \textbf{no} voltage, current, flow, annotation options.
Also, the positioning of the labels is very simple and is not foolproof for all rotations; if you need to control them more please name the node and position them by hand, or use the more natural node style for transistors.
The \texttt{name} property is available also for bipoles; this is useful mostly for triac, potentiometer and thyristor (see~\ref{sec:othertrip}).
+
+
\subsection{Electronic Tubes}
Electronic tubes, also known as vacuum tubes, control current flow between electrodes. They come in many different flavours.