summaryrefslogtreecommitdiff
path: root/graphics/pgf
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-11-13 03:01:42 +0000
committerNorbert Preining <norbert@preining.info>2022-11-13 03:01:42 +0000
commit1b59c3c45170420996d629b296e2214933ee1add (patch)
tree34082741a3498a4d6ccbe007c7866ac855e7ef72 /graphics/pgf
parent28e13f4c64ab0caee7ce56d51e9be2b93611d580 (diff)
CTAN sync 202211130301
Diffstat (limited to 'graphics/pgf')
-rw-r--r--graphics/pgf/contrib/circuitikz/doc/changelog.tex19
-rw-r--r--graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdfbin17645 -> 17645 bytes
-rw-r--r--graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdfbin1584894 -> 1599964 bytes
-rw-r--r--graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex130
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/circuitikz.sty4
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcirc.defines.tex24
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex166
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex40
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex4
9 files changed, 327 insertions, 60 deletions
diff --git a/graphics/pgf/contrib/circuitikz/doc/changelog.tex b/graphics/pgf/contrib/circuitikz/doc/changelog.tex
index a19eae619c..be5dc1e399 100644
--- a/graphics/pgf/contrib/circuitikz/doc/changelog.tex
+++ b/graphics/pgf/contrib/circuitikz/doc/changelog.tex
@@ -5,6 +5,25 @@ full list of changes.
\begin{itemize}
\item
+ Version 1.5.5 (2022-11-12)
+
+ New features for optoelectronic devices: a new component, arrow
+ styling, and anchors.
+
+ \begin{itemize}
+ \tightlist
+ \item
+ Added styling of arrows on opto devices, thanks to a suggestion by
+ \href{https://github.com/circuitikz/circuitikz/issues/655}{Dr
+ Matthias Jung}
+ \item
+ Added Light-Dependent resistor shape (by Romano)
+ \item
+ Added \texttt{arrows} anchors to the opto-components
+ \item
+ Documentation updates (rotating and flipping for path components)
+ \end{itemize}
+\item
Version 1.5.4 (2022-09-09)
New components and enhancement for old ones in this version.
diff --git a/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf b/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf
index 8ea75d8c2a..d8982740f9 100644
--- a/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf
+++ b/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf
index d8970028c9..4198c5a2dc 100644
--- a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf
+++ b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf
Binary files differ
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.
diff --git a/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty b/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty
index 8972832190..057df444f3 100644
--- a/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty
+++ b/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty
@@ -16,8 +16,8 @@
\providecommand\DeclareRelease[3]{}
\providecommand\DeclareCurrentRelease[2]{}
-\def\pgfcircversion{1.5.4}
-\def\pgfcircversiondate{2022/09/09}
+\def\pgfcircversion{1.5.5}
+\def\pgfcircversiondate{2022/11/12}
\DeclareRelease{0.4}{2012/12/20}{circuitikz-0.4-body.tex}
\DeclareRelease{v0.4}{2012/12/20}{circuitikz-0.4-body.tex}
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcirc.defines.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcirc.defines.tex
index 46ec314f57..5575b33a96 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcirc.defines.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcirc.defines.tex
@@ -933,6 +933,30 @@
\ctikzset{diodes/scale/.initial=1.0}
\ctikzset{diodes/fill/.initial=none}
\ctikzset{diodes/thickness/.initial=none}
+% we define opto arrows style here because they are used also
+% in transistors
+\ctikzset{opto arrows/.is family}
+\ctikzset{opto arrows/relative thickness/.initial=1}
+\ctikzset{opto arrows/color/.initial=default}
+\ctikzset{opto arrows/dash/.initial=default}
+\def\pgf@circ@set@optoarrow@style{%
+ % You *must* be sure that this is called inside a \pgfscope!
+ \pgfsetlinewidth{\ctikzvalof{opto arrows/relative thickness}\pgflinewidth}
+ \edef\@@none{none}\edef\@@default{default}
+ \edef\@@tmp{\ctikzvalof{opto arrows/color}}
+ \ifx\@@tmp\@@default\else
+ \pgfsetcolor{\@@tmp}
+ \fi
+ \edef\@@tmp{\ctikzvalof{opto arrows/dash}}
+ \ifx\@@tmp\@@default\else
+ \ifx\@@tmp\@@none
+ \pgfsetdash{}{0pt}% solid line, override dash
+ \else
+ \expandafter\pgfsetdash\expandafter{\@@tmp}{0cm}
+ \fi
+ \fi
+ \pgfcirc@set@arrows{opto}{}{latexslim}
+ }
\ctikzset{batteries/scale/.initial=1.0}
\ctikzset{batteries/fill/.initial=none}
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
index 8fd93c0873..7cf950c887 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
@@ -23,6 +23,7 @@
\pgf@circ@declare@family@arrows{wiper}
\pgf@circ@declare@family@arrows{switch}
\pgf@circ@declare@family@arrows{gto gate}
+\pgf@circ@declare@family@arrows{opto}
%>>>
@@ -49,6 +50,8 @@
\ctikzset{bipoles/generic potentiometer/width=#1}%
\ctikzset{bipoles/ageneric/width=#1}%
\ctikzset{bipoles/tgeneric/width=#1}%
+ \ctikzset{bipoles/ldresistor/width=#1}%
+ \ctikzset{bipoles/ldgeneric/width=#1}%
}}
\ctikzset{wiper pos/.code={%
\ctikzset{bipoles/potentiometer/wiper pos=#1}%
@@ -65,6 +68,9 @@
\ctikzset{bipoles/vresistor/width/.initial=.8}
\ctikzset{bipoles/resistivesens/height/.initial=.6}
\ctikzset{bipoles/resistivesens/width/.initial=.8}
+\ctikzset{bipoles/ldresistor/height/.initial=.8}
+\ctikzset{bipoles/ldresistor/width/.initial=.8}
+\ctikzset{bipoles/ldresistor/internal scale/.initial=.8}
% square resistors
\ctikzset{bipoles/photoresistor/height/.initial=.6}
\ctikzset{bipoles/photoresistor/height 2/.initial=.3}
@@ -96,6 +102,9 @@
\ctikzset{bipoles/memristor/height/.initial=.30}
\ctikzset{bipoles/memristor/wave height/.initial=.5}
\ctikzset{bipoles/memristor/width/.initial=.80}
+\ctikzset{bipoles/ldgeneric/height/.initial=.8}
+\ctikzset{bipoles/ldgeneric/width/.initial=.8}
+\ctikzset{bipoles/ldgeneric/internal scale/.initial=.8}
\newif\ifpgf@circuit@europeanresistor
\ctikzset{resistor/.is choice}
@@ -351,7 +360,9 @@
%% Photoresistor
\pgfcircdeclarebipolescaled{resistors}
-{}
+{% anchor for light arrows
+ \anchor{arrows}{\northeast\pgf@x=0.575\pgf@x\pgf@y=1.1\pgf@y}%
+}
{\ctikzvalof{bipoles/photoresistor/height 2}}
{photoresistor}
{\ctikzvalof{bipoles/photoresistor/height}}
@@ -364,7 +375,7 @@
\endpgfscope
\pgfscope
- \pgfsetarrowsend{latexslim}
+ \pgf@circ@set@optoarrow@style
\pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}
\pgfpathlineto{\pgfpoint{.3\pgf@circ@res@right}{-1.2\pgf@circ@res@down}}
\pgfusepath{draw}
@@ -524,6 +535,55 @@
\endpgfscope
}
+%% european style LDR
+\pgfcircdeclarebipolescaled{resistors}
+{% anchor for light arrows
+ \anchor{arrows}{\northeast\pgf@x=1.6\pgf@x\pgf@y=1.4\pgf@y}%
+ \savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}}
+}
+{\ctikzvalof{bipoles/ldgeneric/height}}
+{ldgeneric}
+{\ctikzvalof{bipoles/ldgeneric/height}}
+{\ctikzvalof{bipoles/ldgeneric/width}}
+{%
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+ \endpgfscope
+ \pgfscope
+ % arrows
+ \pgf@circ@set@optoarrow@style
+ \pgfpathmoveto{\pgfpoint{1.4\pgf@circ@res@right}{1.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.8\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{1.6\pgf@circ@res@right}{1.2\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1.0\pgf@circ@res@right}{0.6\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+ \edef\@@intscale{\ctikzvalof{bipoles/ldgeneric/internal scale}}%
+ \pgfmathsetmacro{\@@hscale}{0.5*\@@intscale}%
+ \pgftransformscale{\@@intscale}% the end of the bipole will deactivate it
+ % the generic will be reduced by @@intscale; let's undo the scaling to
+ % connect the leads to the end of the component.
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left/\@@intscale-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{+0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{+0pt}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right/\@@intscale+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{+0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{+0pt}}
+ \pgftransformationadjustments
+ \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/ldgeneric/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
+ \pgfusepath{draw}
+ \pgfscope
+ % reset the up at the "generic" thing
+ \pgf@circ@res@up=\ctikzvalof{bipoles/generic/height}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@up=0.5\pgf@circ@res@up
+ \pgf@circ@res@down=-\pgf@circ@res@up
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+}%
+
%% Zig-zag resistors
\def\pgf@circ@zigzag#1{%
\divide \pgf@circ@res@step by \numexpr4*\zigs\relax
@@ -655,7 +715,51 @@
\pgfpathlineto{\pgfpoint{-.9\pgf@circ@res@other}{\pgf@circ@res@down}}
\pgfusepath{draw}
\endpgfscope
-}% %>>>
+}%
+
+%% american style LDR
+\pgfcircdeclarebipolescaled{resistors}
+{% anchor for light arrows
+ \anchor{arrows}{\northeast\pgf@x=1.6\pgf@x\pgf@y=1.4\pgf@y}%
+ \savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}}
+ % \pgfcirc@border@extend@full{1.2}{1.2}{1.2}{1.2}
+}
+{\ctikzvalof{bipoles/ldresistor/height}}
+{ldresistor}
+{\ctikzvalof{bipoles/ldresistor/height}}
+{\ctikzvalof{bipoles/ldresistor/width}}
+{%
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+ \endpgfscope
+ \pgfscope
+ % arrows
+ \pgf@circ@set@optoarrow@style
+ \pgfpathmoveto{\pgfpoint{1.4\pgf@circ@res@right}{1.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.8\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{1.6\pgf@circ@res@right}{1.2\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1.0\pgf@circ@res@right}{0.6\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+ \edef\@@intscale{\ctikzvalof{bipoles/ldresistor/internal scale}}%
+ \pgfmathsetmacro{\@@hscale}{0.5*\@@intscale}%
+ \pgftransformscale{\@@intscale}% the end of the bipole will deactivate it
+ % the zigzag will be reduced by @@intscale; let's undo the scaling to
+ % connect the leads to the end of the component.
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left/\@@intscale-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{+0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{+0pt}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right/\@@intscale+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{+0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{+0pt}}
+ \pgftransformationadjustments
+ \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/ldresistor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
+ \pgf@circ@zigzag{\@@hscale}
+}%
+
+
+%>>>
%% Paths for resistive components: generic, resistors and wires% %<<<
@@ -697,6 +801,12 @@
\pgfcirc@node@to@style{l}{thermistor}{european resistive sensor}{}
\pgfcirc@style@to@style{resistive sensor}{sR}
+\def\pgf@circ@ldresistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{ldgeneric}{#1}\else\pgf@circ@bipole@path{ldresistor}{#1}\fi}
+\pgfcirc@path@to@style{l}{ldresistor}{light dependent resistor}{}
+\pgfcirc@node@to@style{l}{ldresistor}{american light dependent resistor}{}
+\pgfcirc@node@to@style{l}{ldgeneric}{european light dependent resistor}{}
+\pgfcirc@style@to@style{light dependent resistor}{ldR}
+
\def\pgf@circ@potentiometer@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{genericpotentiometer}{#1}\else\pgf@circ@bipole@path{potentiometer}{#1}\fi}
\pgfcirc@path@to@style{l}{potentiometer}{potentiometer}{}
\pgfcirc@node@to@style{l}{potentiometer}{american potentiometer}{}
@@ -3434,6 +3544,8 @@
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@up}}
\pgfusepath{draw}
}
+% the styling of optical arrows is defined in pgfcirc.define.tex because
+% they are common to phototransistors
%
% draw LED arrows
@@ -3441,7 +3553,7 @@
\def\pgf@circ@draw@ledarrows{%
\pgfsetlinewidth{\pgfstartlinewidth}
\pgf@circ@fill@strokecolor
- \pgfsetarrowsend{latexslim}
+ \pgf@circ@set@optoarrow@style
\ifpgf@led@fliparrows
\pgfpathmoveto{\pgfpoint{0pt}{0.8\pgf@circ@res@up}}
\pgfpathlineto{\pgfpoint{-0.6\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
@@ -3464,20 +3576,20 @@
\def\pgf@circ@draw@pdarrows{%
\pgfsetlinewidth{\pgfstartlinewidth}
\pgf@circ@fill@strokecolor
- \pgfsetarrowsstart{latexslim}
+ \pgf@circ@set@optoarrow@style
\ifpgf@pd@fliparrows
- \pgfpathmoveto{\pgfpoint{0pt}{0.8\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{-0.6\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{-0.6\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{0.8\pgf@circ@res@up}}
\pgfusepath{draw}
- \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@right}{0.6\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{0pt}{1.6\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{0pt}{1.6\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.6\pgf@circ@res@up}}
\pgfusepath{draw}
\else
- \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
\pgfusepath{draw}
- \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
\pgfusepath{draw}
\fi
}
@@ -3487,7 +3599,7 @@
\def\pgf@circ@draw@laserarrows{%
\pgfsetlinewidth{\pgfstartlinewidth}
\pgf@circ@fill@strokecolor
- \pgfsetarrowsend{latexslim}
+ \pgf@circ@set@optoarrow@style
\pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{1.1\pgf@circ@res@up}}
\pgfpathlineto{\pgfpoint{-0.4\pgf@circ@res@right}{2.1\pgf@circ@res@up}}
\pgfusepath{draw}
@@ -3495,10 +3607,26 @@
\pgfpathlineto{\pgfpoint{0.2\pgf@circ@res@right}{2.1\pgf@circ@res@up}}
\pgfusepath{draw}
}
+
+\def\pgf@circ@generate@diode@saved@arrows#1#2#3#4#5{%
+ \savedanchor{\arrows}{%
+ \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
+ \pgf@ya=\ctikzvalof{bipoles/diode/height}\pgf@circ@scaled@Rlen
+ \pgf@xa=\ctikzvalof{bipoles/diode/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@xa\pgf@y=.5\pgf@ya
+ \csname ifpgf@#5@fliparrows\endcsname
+ \pgf@x=#1\pgf@x\pgf@y=#2\pgf@y
+ \else
+ \pgf@x=#3\pgf@x\pgf@y=#4\pgf@y
+ \fi
+ }
+}
%% Black light emitting diode
\pgfcircdeclarebipolescaled{diodes}
{% fix the anchor border
\pgfcirc@border@extend@updown{1.8}{1}
+ \pgf@circ@generate@diode@saved@arrows{-0.2}{2.0}{1.0}{2.0}{led}
+ \anchor{arrows}{\arrows}
}
{\ctikzvalof{bipoles/diode/height}}
{fulllediode}
@@ -3519,6 +3647,8 @@
\pgfcircdeclarebipolescaled{diodes}
{% fix the anchor border
\pgfcirc@border@extend@updown{1.8}{1}
+ \pgf@circ@generate@diode@saved@arrows{-0.1}{2.2}{-0.1}{2.2}{pd}%pd or led dosen't matter
+ \anchor{arrows}{\arrows}
}
{\ctikzvalof{bipoles/diode/height}}
{fulllaserdiode}
@@ -3541,6 +3671,8 @@
\pgfcircdeclarebipolescaled{diodes}
{% fix the anchor border
\pgfcirc@border@extend@updown{1.8}{1}
+ \pgf@circ@generate@diode@saved@arrows{-0.2}{2.0}{1.0}{2.0}{pd}
+ \anchor{arrows}{\arrows}
}
{\ctikzvalof{bipoles/diode/height}}
{fullpdiode}
@@ -3709,6 +3841,8 @@
\pgfcircdeclarebipolescaled{diodes}
{% fix the anchor border
\pgfcirc@border@extend@updown{1.8}{1}
+ \pgf@circ@generate@diode@saved@arrows{-0.2}{2.0}{1.0}{2.0}{led}
+ \anchor{arrows}{\arrows}
}
{\ctikzvalof{bipoles/diode/height}}
{emptylediode}
@@ -3731,6 +3865,8 @@
\pgfcircdeclarebipolescaled{diodes}
{% fix the anchor border
\pgfcirc@border@extend@updown{1.8}{1}
+ \pgf@circ@generate@diode@saved@arrows{-0.1}{2.2}{-0.1}{2.2}{pd}%pd or led dosen't matter
+ \anchor{arrows}{\arrows}
}
{\ctikzvalof{bipoles/diode/height}}
{emptylaserdiode}
@@ -3755,6 +3891,8 @@
\pgfcircdeclarebipolescaled{diodes}
{% fix the anchor border
\pgfcirc@border@extend@updown{1.8}{1}
+ \pgf@circ@generate@diode@saved@arrows{-0.2}{2.0}{1.0}{2.0}{pd}
+ \anchor{arrows}{\arrows}
}
{\ctikzvalof{bipoles/diode/height}}
{emptypdiode}
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex
index 4887d89857..7b03c9b267 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex
@@ -3993,8 +3993,16 @@
\northeast
\pgf@y=-\ctikzvalof{tripoles/#1/base height}\pgf@y
}
+ \anchor{arrows}{
+ \northeast
+ \pgf@circ@res@up = \pgf@y
+ \left
+ \pgf@circ@res@left = \pgf@x
+ \pgf@x=\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left
+ \advance\pgf@x by 0.6\pgf@circ@res@left
+ \pgf@y=0.2\pgf@circ@res@up
+ }
}{
-
% add the circle if requested (before everything else, so we can fill it)
\pgfcirc@transistorcircle
@@ -4114,24 +4122,20 @@
\ifpgf@circuit@bpt@drawphoto
\pgfscope
\pgf@circ@fill@strokecolor
- \pgfsetarrowsstart{latexslim}
- \pgfpathmoveto{\pgfpointadd{\pgfpoint
- {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
- {\pgf@circ@res@up+\pgf@circ@res@down}}
- {\pgfpoint{0.05\pgf@circ@res@left}{0.1\pgf@circ@res@up}}}
- \pgfpathlineto{\pgfpointadd{\pgfpoint
- {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
- {\pgf@circ@res@up+\pgf@circ@res@down}}
- {\pgfpoint{0.5\pgf@circ@res@left}{0.3\pgf@circ@res@up}}}
+ \pgf@circ@set@optoarrow@style
+ \pgfpathmoveto{\pgfpoint
+ {(0.5+\ctikzvalof{tripoles/#1/base width})*\pgf@circ@res@left}
+ {0.3\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {(0.05+\ctikzvalof{tripoles/#1/base width})*\pgf@circ@res@left}
+ {0.1\pgf@circ@res@up}}
\pgfusepath{draw}
- \pgfpathmoveto{\pgfpointadd{\pgfpoint
- {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
- {\pgf@circ@res@up+\pgf@circ@res@down}}
- {\pgfpoint{0.05\pgf@circ@res@left}{-0.1\pgf@circ@res@up}}}
- \pgfpathlineto{\pgfpointadd{\pgfpoint
- {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
- {\pgf@circ@res@up+\pgf@circ@res@down}}
- {\pgfpoint{0.5\pgf@circ@res@left}{0.1\pgf@circ@res@up}}}
+ \pgfpathmoveto{\pgfpoint
+ {(0.5+\ctikzvalof{tripoles/#1/base width})*\pgf@circ@res@left}
+ {0.1\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {(0.05+\ctikzvalof{tripoles/#1/base width})*\pgf@circ@res@left}
+ {-0.1\pgf@circ@res@up}}
\pgfusepath{draw}
\endpgfscope
\else
diff --git a/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex b/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex
index e7b158d512..5743b9cfe3 100644
--- a/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex
@@ -10,8 +10,8 @@
%
% See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
-\def\pgfcircversion{1.5.4}
-\def\pgfcircversiondate{2022/09/09}
+\def\pgfcircversion{1.5.5}
+\def\pgfcircversiondate{2022/11/12}
\writestatus{loading}{\pgfcircversiondate{} The CircuiTikz circuit drawing package version \pgfcircversion}
\usemodule[tikz]