texlive[65005] Master/texmf-dist: circuitikz (13nov22)

commits+karl at tug.org commits+karl at tug.org
Sun Nov 13 22:23:10 CET 2022


Revision: 65005
          http://tug.org/svn/texlive?view=revision&revision=65005
Author:   karl
Date:     2022-11-13 22:23:09 +0100 (Sun, 13 Nov 2022)
Log Message:
-----------
circuitikz (13nov22)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/context/third/circuitikz/circuitikz-context.pdf
    trunk/Master/texmf-dist/doc/generic/circuitikz/CHANGELOG.md
    trunk/Master/texmf-dist/doc/latex/circuitikz/changelog.tex
    trunk/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.pdf
    trunk/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.tex
    trunk/Master/texmf-dist/tex/context/third/circuitikz/t-circuitikz.tex
    trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex
    trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex
    trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex
    trunk/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty

Modified: trunk/Master/texmf-dist/doc/context/third/circuitikz/circuitikz-context.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/circuitikz/CHANGELOG.md
===================================================================
--- trunk/Master/texmf-dist/doc/generic/circuitikz/CHANGELOG.md	2022-11-13 21:22:48 UTC (rev 65004)
+++ trunk/Master/texmf-dist/doc/generic/circuitikz/CHANGELOG.md	2022-11-13 21:23:09 UTC (rev 65005)
@@ -1,6 +1,16 @@
 <!--- CircuiTikz - Changelog --->
 The major changes among the different CircuiTikZ versions are listed here. See <https://github.com/circuitikz/circuitikz/commits> for a full list of changes.
 
+* Version 1.5.5 (2022-11-12)
+
+    New features for optoelectronic devices: a new component, arrow styling,
+    and anchors.
+
+    - Added styling of arrows on opto devices, thanks to a suggestion by [Dr Matthias Jung](https://github.com/circuitikz/circuitikz/issues/655)
+    - Added Light-Dependent resistor shape (by Romano)
+    - Added `arrows` anchors to the opto-components
+    - Documentation updates (rotating and flipping for path components)
+
 * Version 1.5.4 (2022-09-09)
 
     New components and enhancement for old ones in this version.

Modified: trunk/Master/texmf-dist/doc/latex/circuitikz/changelog.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuitikz/changelog.tex	2022-11-13 21:22:48 UTC (rev 65004)
+++ trunk/Master/texmf-dist/doc/latex/circuitikz/changelog.tex	2022-11-13 21:23:09 UTC (rev 65005)
@@ -5,6 +5,25 @@
 
 \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.

Modified: trunk/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.tex	2022-11-13 21:22:48 UTC (rev 65004)
+++ trunk/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.tex	2022-11-13 21:23:09 UTC (rev 65005)
@@ -1385,6 +1385,25 @@
 \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 @@
 
 \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 @@
     \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,6 +2032,7 @@
     \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}
 
@@ -2018,7 +2039,7 @@
 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 @@
 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 @@
     \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 @@
     \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 @@
     \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 @@
 \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 @@
     \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 @@
     \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,7 +3783,17 @@
 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.
 
 To add the circle to a single transistor, you use the \texttt{tr circle} keys in the node; if you want all of your transistors with a circle, you can set the property \texttt{tr circle} with a \verb|\ctikzset| command (it will respect normal grouping, of course); in that case, you can use \texttt{tr circle=false} to locally disable them.
@@ -4296,11 +4374,15 @@
 ;\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.

Modified: trunk/Master/texmf-dist/tex/context/third/circuitikz/t-circuitikz.tex
===================================================================
--- trunk/Master/texmf-dist/tex/context/third/circuitikz/t-circuitikz.tex	2022-11-13 21:22:48 UTC (rev 65004)
+++ trunk/Master/texmf-dist/tex/context/third/circuitikz/t-circuitikz.tex	2022-11-13 21:23:09 UTC (rev 65005)
@@ -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]

Modified: trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex	2022-11-13 21:22:48 UTC (rev 65004)
+++ trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex	2022-11-13 21:23:09 UTC (rev 65005)
@@ -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 at circ@set at 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 at set@arrows{opto}{}{latexslim}
+    }
 
 \ctikzset{batteries/scale/.initial=1.0}
 \ctikzset{batteries/fill/.initial=none}

Modified: trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex	2022-11-13 21:22:48 UTC (rev 65004)
+++ trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex	2022-11-13 21:23:09 UTC (rev 65005)
@@ -23,6 +23,7 @@
 \pgf at circ@declare at family@arrows{wiper}
 \pgf at circ@declare at family@arrows{switch}
 \pgf at circ@declare at family@arrows{gto gate}
+\pgf at circ@declare at 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 at circuit@europeanresistor
 \ctikzset{resistor/.is choice}
@@ -351,7 +360,9 @@
 
 %% Photoresistor
 \pgfcircdeclarebipolescaled{resistors}
-{}
+{% anchor for light arrows
+    \anchor{arrows}{\northeast\pgf at x=0.575\pgf at x\pgf at y=1.1\pgf at y}%
+}
 {\ctikzvalof{bipoles/photoresistor/height 2}}
 {photoresistor}
 {\ctikzvalof{bipoles/photoresistor/height}}
@@ -364,7 +375,7 @@
     \endpgfscope
 
     \pgfscope
-        \pgfsetarrowsend{latexslim}
+        \pgf at circ@set at optoarrow@style
         \pgfpathmoveto{\pgfpoint{.7\pgf at circ@res at right}{\pgf at circ@res at up}}
         \pgfpathlineto{\pgfpoint{.3\pgf at circ@res at right}{-1.2\pgf at circ@res at down}}
         \pgfusepath{draw}
@@ -524,6 +535,55 @@
     \endpgfscope
 }
 
+%% european style LDR
+\pgfcircdeclarebipolescaled{resistors}
+{% anchor for light arrows
+    \anchor{arrows}{\northeast\pgf at x=1.6\pgf at x\pgf at y=1.4\pgf at y}%
+    \savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}}
+}
+{\ctikzvalof{bipoles/ldgeneric/height}}
+{ldgeneric}
+{\ctikzvalof{bipoles/ldgeneric/height}}
+{\ctikzvalof{bipoles/ldgeneric/width}}
+{%
+    \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+    \pgfscope
+        \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+        \pgf at circ@draworfill
+    \endpgfscope
+    \pgfscope
+        % arrows
+        \pgf at circ@set at optoarrow@style
+        \pgfpathmoveto{\pgfpoint{1.4\pgf at circ@res at right}{1.4\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{0.8\pgf at circ@res at right}{0.8\pgf at circ@res at up}}
+        \pgfusepath{draw}
+        \pgfpathmoveto{\pgfpoint{1.6\pgf at circ@res at right}{1.2\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{1.0\pgf at circ@res at right}{0.6\pgf at circ@res at 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 at circ@res at left/\@@intscale-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{+0pt}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{+0pt}}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right/\@@intscale+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{+0pt}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{+0pt}}
+    \pgftransformationadjustments
+    \pgfmathsetlength{\pgf at circ@res at step}{\ctikzvalof{bipoles/ldgeneric/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
+    \pgfusepath{draw}
+    \pgfscope
+        % reset the up at the "generic" thing
+        \pgf at circ@res at up=\ctikzvalof{bipoles/generic/height}\pgf at circ@scaled at Rlen
+        \pgf at circ@res at up=0.5\pgf at circ@res at up
+        \pgf at circ@res at down=-\pgf at circ@res at up
+        \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+        \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+        \pgfusepath{draw}
+    \endpgfscope
+}%
+
 %% Zig-zag resistors
 \def\pgf at circ@zigzag#1{%
     \divide \pgf at circ@res at step by \numexpr4*\zigs\relax
@@ -655,8 +715,52 @@
         \pgfpathlineto{\pgfpoint{-.9\pgf at circ@res at other}{\pgf at circ@res at down}}
         \pgfusepath{draw}
     \endpgfscope
-}% %>>>
+}%
 
+%% american style LDR
+\pgfcircdeclarebipolescaled{resistors}
+{% anchor for light arrows
+    \anchor{arrows}{\northeast\pgf at x=1.6\pgf at x\pgf at y=1.4\pgf at y}%
+    \savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}}
+    % \pgfcirc at border@extend at full{1.2}{1.2}{1.2}{1.2}
+}
+{\ctikzvalof{bipoles/ldresistor/height}}
+{ldresistor}
+{\ctikzvalof{bipoles/ldresistor/height}}
+{\ctikzvalof{bipoles/ldresistor/width}}
+{%
+    \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+    \pgfscope
+        \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+        \pgf at circ@draworfill
+    \endpgfscope
+    \pgfscope
+        % arrows
+        \pgf at circ@set at optoarrow@style
+        \pgfpathmoveto{\pgfpoint{1.4\pgf at circ@res at right}{1.4\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{0.8\pgf at circ@res at right}{0.8\pgf at circ@res at up}}
+        \pgfusepath{draw}
+        \pgfpathmoveto{\pgfpoint{1.6\pgf at circ@res at right}{1.2\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{1.0\pgf at circ@res at right}{0.6\pgf at circ@res at 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 at circ@res at left/\@@intscale-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{+0pt}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{+0pt}}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right/\@@intscale+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{+0pt}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{+0pt}}
+    \pgftransformationadjustments
+    \pgfmathsetlength{\pgf at circ@res at step}{\ctikzvalof{bipoles/ldresistor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
+    \pgf at circ@zigzag{\@@hscale}
+}%
+
+
+%>>>
+
 %% Paths for resistive components: generic, resistors and wires% %<<<
 
 %% GENERICS
@@ -697,6 +801,12 @@
 \pgfcirc at node@to at style{l}{thermistor}{european resistive sensor}{}
 \pgfcirc at style@to at style{resistive sensor}{sR}
 
+\def\pgf at circ@ldresistor at path#1{\ifpgf at circuit@europeanresistor\pgf at circ@bipole at path{ldgeneric}{#1}\else\pgf at circ@bipole at path{ldresistor}{#1}\fi}
+\pgfcirc at path@to at style{l}{ldresistor}{light dependent resistor}{}
+\pgfcirc at node@to at style{l}{ldresistor}{american light dependent resistor}{}
+\pgfcirc at node@to at style{l}{ldgeneric}{european light dependent resistor}{}
+\pgfcirc at style@to at style{light dependent resistor}{ldR}
+
 \def\pgf at circ@potentiometer at path#1{\ifpgf at circuit@europeanresistor\pgf at circ@bipole at path{genericpotentiometer}{#1}\else\pgf at circ@bipole at path{potentiometer}{#1}\fi}
 \pgfcirc at path@to at style{l}{potentiometer}{potentiometer}{}
 \pgfcirc at node@to at style{l}{potentiometer}{american potentiometer}{}
@@ -3434,6 +3544,8 @@
     \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-.6\pgf at circ@res at left}{\pgf at circ@res at 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 at circ@draw at ledarrows{%
     \pgfsetlinewidth{\pgfstartlinewidth}
     \pgf at circ@fill at strokecolor
-    \pgfsetarrowsend{latexslim}
+    \pgf at circ@set at optoarrow@style
     \ifpgf at led@fliparrows
         \pgfpathmoveto{\pgfpoint{0pt}{0.8\pgf at circ@res at up}}
         \pgfpathlineto{\pgfpoint{-0.6\pgf at circ@res at right}{1.8\pgf at circ@res at up}}
@@ -3464,20 +3576,20 @@
 \def\pgf at circ@draw at pdarrows{%
     \pgfsetlinewidth{\pgfstartlinewidth}
     \pgf at circ@fill at strokecolor
-    \pgfsetarrowsstart{latexslim}
+    \pgf at circ@set at optoarrow@style
     \ifpgf at pd@fliparrows
-        \pgfpathmoveto{\pgfpoint{0pt}{0.8\pgf at circ@res at up}}
-        \pgfpathlineto{\pgfpoint{-0.6\pgf at circ@res at right}{1.8\pgf at circ@res at up}}
+        \pgfpathmoveto{\pgfpoint{-0.6\pgf at circ@res at right}{1.8\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{0pt}{0.8\pgf at circ@res at up}}
         \pgfusepath{draw}
-        \pgfpathmoveto{\pgfpoint{0.6\pgf at circ@res at right}{0.6\pgf at circ@res at up}}
-        \pgfpathlineto{\pgfpoint{0pt}{1.6\pgf at circ@res at up}}
+        \pgfpathmoveto{\pgfpoint{0pt}{1.6\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{0.6\pgf at circ@res at right}{0.6\pgf at circ@res at up}}
         \pgfusepath{draw}
     \else
-        \pgfpathmoveto{\pgfpoint{-0.4\pgf at circ@res at right}{\pgf at circ@res at up}}
-        \pgfpathlineto{\pgfpoint{0.6\pgf at circ@res at right}{2\pgf at circ@res at up}}
+        \pgfpathmoveto{\pgfpoint{0.6\pgf at circ@res at right}{2\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{-0.4\pgf at circ@res at right}{\pgf at circ@res at up}}
         \pgfusepath{draw}
-        \pgfpathmoveto{\pgfpoint{0.2\pgf at circ@res at right}{0.8\pgf at circ@res at up}}
-        \pgfpathlineto{\pgfpoint{1.2\pgf at circ@res at right}{1.8\pgf at circ@res at up}}
+        \pgfpathmoveto{\pgfpoint{1.2\pgf at circ@res at right}{1.8\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{0.2\pgf at circ@res at right}{0.8\pgf at circ@res at up}}
         \pgfusepath{draw}
     \fi
 }
@@ -3487,7 +3599,7 @@
 \def\pgf at circ@draw at laserarrows{%
     \pgfsetlinewidth{\pgfstartlinewidth}
     \pgf at circ@fill at strokecolor
-    \pgfsetarrowsend{latexslim}
+    \pgf at circ@set at optoarrow@style
     \pgfpathmoveto{\pgfpoint{-0.4\pgf at circ@res at right}{1.1\pgf at circ@res at up}}
     \pgfpathlineto{\pgfpoint{-0.4\pgf at circ@res at right}{2.1\pgf at circ@res at up}}
     \pgfusepath{draw}
@@ -3495,10 +3607,26 @@
     \pgfpathlineto{\pgfpoint{0.2\pgf at circ@res at right}{2.1\pgf at circ@res at up}}
     \pgfusepath{draw}
 }
+
+\def\pgf at circ@generate at diode@saved at arrows#1#2#3#4#5{%
+    \savedanchor{\arrows}{%
+        \pgf at circ@scaled at Rlen=\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen
+        \pgf at ya=\ctikzvalof{bipoles/diode/height}\pgf at circ@scaled at Rlen
+        \pgf at xa=\ctikzvalof{bipoles/diode/width}\pgf at circ@scaled at Rlen
+        \pgf at x=.5\pgf at xa\pgf at y=.5\pgf at ya
+        \csname ifpgf@#5 at fliparrows\endcsname
+            \pgf at x=#1\pgf at x\pgf at y=#2\pgf at y
+        \else
+            \pgf at x=#3\pgf at x\pgf at y=#4\pgf at y
+        \fi
+    }
+}
 %% Black light emitting diode
 \pgfcircdeclarebipolescaled{diodes}
 {% fix the anchor border
     \pgfcirc at border@extend at updown{1.8}{1}
+    \pgf at circ@generate at diode@saved at 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 at border@extend at updown{1.8}{1}
+    \pgf at circ@generate at diode@saved at 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 at border@extend at updown{1.8}{1}
+    \pgf at circ@generate at diode@saved at 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 at border@extend at updown{1.8}{1}
+    \pgf at circ@generate at diode@saved at 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 at border@extend at updown{1.8}{1}
+    \pgf at circ@generate at diode@saved at 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 at border@extend at updown{1.8}{1}
+    \pgf at circ@generate at diode@saved at arrows{-0.2}{2.0}{1.0}{2.0}{pd}
+    \anchor{arrows}{\arrows}
 }
 {\ctikzvalof{bipoles/diode/height}}
 {emptypdiode}

Modified: trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex	2022-11-13 21:22:48 UTC (rev 65004)
+++ trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex	2022-11-13 21:23:09 UTC (rev 65005)
@@ -3993,8 +3993,16 @@
             \northeast
             \pgf at y=-\ctikzvalof{tripoles/#1/base height}\pgf at y
         }
+        \anchor{arrows}{
+            \northeast
+            \pgf at circ@res at up = \pgf at y
+            \left
+            \pgf at circ@res at left = \pgf at x
+            \pgf at x=\ctikzvalof{tripoles/#1/base width}\pgf at circ@res at left
+            \advance\pgf at x by 0.6\pgf at circ@res at left
+            \pgf at y=0.2\pgf at circ@res at up
+        }
         }{
-
         % add the circle if requested (before everything else, so we can fill it)
         \pgfcirc at transistorcircle
 
@@ -4114,24 +4122,20 @@
         \ifpgf at circuit@bpt at drawphoto
             \pgfscope
                 \pgf at circ@fill at strokecolor
-                \pgfsetarrowsstart{latexslim}
-                \pgfpathmoveto{\pgfpointadd{\pgfpoint
-                        {\ctikzvalof{tripoles/#1/base width}\pgf at circ@res at left}
-                    {\pgf at circ@res at up+\pgf at circ@res at down}}
-                {\pgfpoint{0.05\pgf at circ@res at left}{0.1\pgf at circ@res at up}}}
-                \pgfpathlineto{\pgfpointadd{\pgfpoint
-                        {\ctikzvalof{tripoles/#1/base width}\pgf at circ@res at left}
-                    {\pgf at circ@res at up+\pgf at circ@res at down}}
-                {\pgfpoint{0.5\pgf at circ@res at left}{0.3\pgf at circ@res at up}}}
+                \pgf at circ@set at optoarrow@style
+                \pgfpathmoveto{\pgfpoint
+                    {(0.5+\ctikzvalof{tripoles/#1/base width})*\pgf at circ@res at left}
+                    {0.3\pgf at circ@res at up}}
+                \pgfpathlineto{\pgfpoint
+                    {(0.05+\ctikzvalof{tripoles/#1/base width})*\pgf at circ@res at left}
+                    {0.1\pgf at circ@res at up}}
                 \pgfusepath{draw}
-                \pgfpathmoveto{\pgfpointadd{\pgfpoint
-                        {\ctikzvalof{tripoles/#1/base width}\pgf at circ@res at left}
-                    {\pgf at circ@res at up+\pgf at circ@res at down}}
-                {\pgfpoint{0.05\pgf at circ@res at left}{-0.1\pgf at circ@res at up}}}
-                \pgfpathlineto{\pgfpointadd{\pgfpoint
-                        {\ctikzvalof{tripoles/#1/base width}\pgf at circ@res at left}
-                    {\pgf at circ@res at up+\pgf at circ@res at down}}
-                {\pgfpoint{0.5\pgf at circ@res at left}{0.1\pgf at circ@res at up}}}
+                \pgfpathmoveto{\pgfpoint
+                    {(0.5+\ctikzvalof{tripoles/#1/base width})*\pgf at circ@res at left}
+                    {0.1\pgf at circ@res at up}}
+                \pgfpathlineto{\pgfpoint
+                    {(0.05+\ctikzvalof{tripoles/#1/base width})*\pgf at circ@res at left}
+                    {-0.1\pgf at circ@res at up}}
                 \pgfusepath{draw}
             \endpgfscope
             \else

Modified: trunk/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty	2022-11-13 21:22:48 UTC (rev 65004)
+++ trunk/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty	2022-11-13 21:23:09 UTC (rev 65005)
@@ -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}



More information about the tex-live-commits mailing list.