diff options
author | Norbert Preining <norbert@preining.info> | 2023-10-11 03:02:59 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2023-10-11 03:02:59 +0000 |
commit | 366cf31a771ded1f10860be3212058d48020398d (patch) | |
tree | 99ee483a9fd05dfd4ec908582abb44028bdffbd1 /graphics | |
parent | 48eedda2cb4d2644886b862409b24a1d8e9a136f (diff) |
CTAN sync 202310110302
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/pgf/contrib/circuitikz/doc/changelog.tex | 47 | ||||
-rw-r--r-- | graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf | bin | 13465 -> 13459 bytes | |||
-rw-r--r-- | graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf | bin | 1683675 -> 1695110 bytes | |||
-rw-r--r-- | graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex | 89 | ||||
-rw-r--r-- | graphics/pgf/contrib/circuitikz/tex/circuitikz.sty | 4 | ||||
-rw-r--r-- | graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex | 290 | ||||
-rw-r--r-- | graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex | 39 | ||||
-rw-r--r-- | graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex | 4 | ||||
-rw-r--r-- | graphics/pgf/contrib/tkz-bernoulli/doc/tkz-bernoulli-doc.pdf | bin | 182354 -> 188693 bytes | |||
-rw-r--r-- | graphics/pgf/contrib/tkz-bernoulli/doc/tkz-bernoulli-doc.tex | 68 | ||||
-rw-r--r-- | graphics/pgf/contrib/tkz-bernoulli/tex/tkz-bernoulli.sty | 91 |
11 files changed, 562 insertions, 70 deletions
diff --git a/graphics/pgf/contrib/circuitikz/doc/changelog.tex b/graphics/pgf/contrib/circuitikz/doc/changelog.tex index 87c6966223..a0c556df40 100644 --- a/graphics/pgf/contrib/circuitikz/doc/changelog.tex +++ b/graphics/pgf/contrib/circuitikz/doc/changelog.tex @@ -5,6 +5,41 @@ full list of changes. \begin{itemize} \item + Version 1.6.4 (2023-10-10) + + A bit of enhancement and fixes for the European-style logic ports, + more switches (and a bit more configurabilityi for them), more option + for some sources. + + \begin{itemize} + \tightlist + \item + The symbol in European logic ports is now rotation-invariant, and + its font can be customized (suggested by + \href{https://github.com/circuitikz/circuitikz/issues/730}{user + \texttt{@sputeanus} on GitHub}) + \item + Added a couple of ``blank'' (no symbol) European logic ports + \item + Added new ``traditional'' switches (contributed by + \href{https://github.com/circuitikz/circuitikz/issues/734}{Jakob + ``DraUX'' on GitHub}) + \item + Added configurability (color, thickness, dash) to switch arrows + \item + Added ``eyw''-symbol (reverse star) for ``oo''-type sources + (contributed by + \href{https://github.com/circuitikz/circuitikz/pull/742}{Jakob + ``DraUX'' on GitHub}) + \item + Added configurable open shape to the sinusoidal current source + (contributed by + \href{https://github.com/circuitikz/circuitikz/pull/737}{Maximilian + Martin}) + \item + Documentation fixes + \end{itemize} +\item Version 1.6.3 (2023-06-23) The main change is that the definition of the ``plus'' and ``minus'' @@ -31,10 +66,10 @@ full list of changes. configurable} \item Add anchors for the symbols on the \texttt{oo}-type sources, - suggested - \href{https://github.com/circuitikz/circuitikz/issues/725}{by user - @lapreindl on GitHub}; the symbols have been slightly changed and - repositioned in the process + suggested by + \href{https://github.com/circuitikz/circuitikz/issues/725}{user + \texttt{@lapreindl} on GitHub}; the symbols have been slightly + changed and repositioned in the process \item several documentation fixes \end{itemize} @@ -218,7 +253,7 @@ full list of changes. B. Cameron, user \texttt{@cameroncb1} on GitHub) \item Added Shockley diode (suggested by - \href{https://tex.stackexchange.com/questions/646039/creating-a-shockley-diode-in-circuitikz}{@dauph}) + {[}@dauph{]}(https://tex.stackexchange.com/questions/646039/creating-a-shockley-diode-in-circuitikz)) \end{itemize} \item Version 1.5.2 (2022-05-08) @@ -1396,7 +1431,7 @@ A detailed list of changes can be seen below. \item Fixed varcap symbol at small scalings \item - New packet-option ``straightvoltages, to draw straight(no curved) + New packet-option "straightvoltages, to draw straight(no curved) voltage arrows \item New option ``invert'' to revert the node direction at paths diff --git a/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf b/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf Binary files differindex cb7c63ffd9..e7bc7af850 100644 --- a/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf +++ b/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf diff --git a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf Binary files differindex 89935d1d3b..5eef804aa8 100644 --- a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf +++ b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf diff --git a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex index d331f510b5..1982bca452 100644 --- a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex +++ b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex @@ -2500,7 +2500,7 @@ Notice that you can set both \texttt{gto gate end arrow} and \texttt{gto gate st \subsubsection{Diode customizations}\label{sec:tweak-d} -You can change the scale of the diodes by setting the key \texttt{diodes/scale} to something different from the default \texttt{1.0}. In Romano's opinion, diodes are somewhat big with the default style of the package, so a setting like \verb|\ctikzset{diode/scale=0.6}| is recommended. +You can change the scale of the diodes by setting the key \texttt{diodes/scale} to something different from the default \texttt{1.0}. In Romano's opinion, diodes are somewhat big with the default style of the package, so a setting like \verb|\ctikzset{diodes/scale=0.6}| is recommended. \begin{LTXexample}[varwidth=true] \begin{circuitikz} @@ -2590,6 +2590,8 @@ Notice that source and generators are divided in three classes that can be style \circuitdescbip{battery}{Battery}{} \circuitdescbip{battery1}{Single battery cell}{} \circuitdescbip{battery2}{Single battery cell}{} + \circuitdescbip{baertty}{Randall Munroe's baertty\footnotemark}{} + \footnotetext{\href{https://xkcd.com/2818}{Mandatory xkcd}} \end{groupdesc} \subsubsection{Stationary sources} @@ -2609,17 +2611,20 @@ Similarly, if (default behavior) \texttt{europeanvoltages} option is active (or \end{framed} -\subsubsection{Sinusoidal sources}\label{sec:sinusoidal-vi} These two are basically the same symbol; to distinguish among them, you have to add a label, which will be a voltage or a current. +\subsubsection{Sinusoidal sources}\label{sec:sinusoidal-vi} These two are basically the same symbol; to distinguish among them, you have to add a label, which will be a voltage or a current. Another option would be to configure the \texttt{sinusoidal current source} as an open shape using \texttt{\textbackslash ctikzset\string{bipoles/isourcesin/angle=80\string}} similar to the \texttt{dcisource} in section~\ref{sec:dc-sources}. \begin{groupdesc} \circuitdescbip*[vsourcesin]{sinusoidal voltage source}{Sinusoidal voltage source}{vsourcesin, sV} - \circuitdescbip*[isourcesin]{sinusoidal current source}{Sinusoidal current source}{isourcesin, sI} + \circuitdescbip*[isourcesin]{sinusoidal current source}{Sinusoidal current source\footnotemark}{isourcesin, sI} + \footnotetext{The configurable open shape of the \texttt{sinusoidal current source} has been added by \href{https://github.com/circuitikz/circuitikz/pull/737}{Maximilian Martin}}. \end{groupdesc} \begin{LTXexample}[varwidth=true] \begin{circuitikz}[american] - \draw (0,1) to[sV=$V$] ++(3,0); - \draw (0,0) to[sI=$I$] ++(3,0); + \draw (0,2) to[sV=$V$] ++(3,0); + \draw (0,1) to[sI=$I$] ++(3,0); + \ctikzset{bipoles/isourcesin/angle=80} + \draw (0,0) to[sI] ++(3,0); \end{circuitikz} \end{LTXexample} @@ -2714,13 +2719,13 @@ Notice that if you choose the dashed style, the noise sources are fillable: \endgroup \end{groupdesc} -The transformer shapes vector group options can be specified for the primary (\texttt{prim=\emph{value}}), the secondary (\texttt{sec=\emph{value}}) and tertiary (\texttt{tert=\emph{value}}) three-phase vector groups: the value can be one of \texttt{delta}, \texttt{wye} and \texttt{zig}. +The transformer shapes vector group options can be specified for the primary (\texttt{prim=\emph{value}}), the secondary (\texttt{sec=\emph{value}}) and tertiary (\texttt{tert=\emph{value}}) three-phase vector groups: the value can be one of \texttt{delta}, \texttt{wye}, \texttt{eyw}\footnote{The \texttt{eyw} symbol was suggested by \href{https://github.com/circuitikz/circuitikz/pull/742}{Jakob «DraUX» on GitHub}} and \texttt{zig}. \begin{LTXexample}[varwidth=true] \begin{circuitikz} \draw (0,0) to[oosourcetrans, prim=zig, sec=delta, o-] ++(2,0) to[oosourcetrans, prim=delta, sec=wye,-o] ++(0,-2) - to[ooosource, prim=wye, sec=zig, tert=delta] (0,0); + to[ooosource, prim=eyw, sec=zig, tert=delta] (0,0); \end{circuitikz} \end{LTXexample} @@ -2731,7 +2736,7 @@ These two ``sources'' have additional anchors that reach the center of the symbo smalldot/.style={draw, circle,red, inner sep=0.2pt}] \draw (0,0) to[oosourcetrans, name=A, prim=delta, sec=wye] ++(1,0) - to[ooosource, name=B, prim=wye, sec=zig, + to[ooosource, name=B, prim=eyw, sec=zig, tert=delta] ++(1,0) (A.symbolsec) -- ++(-45:0.5) node[ground]{}; \node [smalldot] at (A.symbolprim) {}; @@ -2778,7 +2783,7 @@ The symbol shapes used here seems to be the most common in publications; if you \end{tikzpicture} \end{LTXexample} -\subsubsection{DC sources} +\subsubsection{DC sources}\label{sec:dc-sources} \begin{groupdesc} \circuitdescbip*{dcvsource}{DC voltage source}{} \circuitdescbip*{dcisource}{DC current source}{} @@ -2851,9 +2856,9 @@ You can do the same with the \texttt{american controlled voltage sources}, subst \end{LTXexample} \paragraph{Three-phase symbols.} -The three-phase symbols \texttt{delta}, \texttt{wye}, and \texttt{zig} follows the line thickness exactly as +The three-phase symbols \texttt{delta}, \texttt{wye}, \texttt{eyw}, and \texttt{zig} follows the line thickness exactly as the waveform ones (see above). Additionally, you can scale them up and down by changing the value of the keys -\texttt{sources/symbol/delta scale}, \texttt{.../wye scale}, and \texttt{.../zig scale} (default \texttt{1}). +\texttt{sources/symbol/delta scale}, \texttt{.../wye scale}, \texttt{.../eyw scale}, and \texttt{.../zig scale} (default \texttt{1}). \begin{LTXexample}[varwidth=true] \begin{circuitikz}[scale=1.8, transform shape] @@ -5728,6 +5733,11 @@ These are all of the to-style type: \circuitdescbip[ospst]{opening switch}{Opening switch}{ospst} \circuitdescbip[nos]{normal open switch}{Normally open switch}{nos} \circuitdescbip[ncs]{normal closed switch}{Normally closed switch}{ncs} + \circuitdescbip[oncs]{opening normal closed switch}{Opening normally closed switch}{oncs} + \circuitdescbip[cncs]{closing normal closed switch}{Closing normally closed switch}{cncs} + \circuitdescbip[onos]{opening normal open switch}{Opening normally open switch}{onos} + \circuitdescbip[cnos]{closing normal open switch}{Closing normally open switch\footnotemark}{cnos} + \footnotetext{These last four were contributed by \href{https://tex.stackexchange.com/questions/693446/new-switch-components-for-circuitikz}{Jakob «DraUX»}} \circuitdescbip[pushbutton]{push button}{Normally open push button}{normally open push button, nopb}(tip/0/0.2) \circuitdescbip[ncpushbutton]{normally closed push button}{Normally closed push button}{ncpb}(tip/0/0.2) \circuitdescbip[pushbuttonc]{normally open push button closed}{Normally open push button (in closed position)}{nopbc}(tip/0/0.2) @@ -6035,6 +6045,32 @@ You can change that globally or locally, as ever. The tip specification is the o \end{circuitikz} \end{LTXexample} +You can also have the option to change the color, relative thickness, and dash pattern by setting keys with the \verb!\ctikzset! command under the \texttt{switch 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{circuitikz} +\draw (0,2) to[spst] ++(1,0) to[cogsw] + ++(1,0) to[oncs] ++(1,0); +\ctikzset{switch arrows/color=red} +\ctikzset{switch arrows/relative thickness=0.5} +\ctikzset{switch arrows/dash={{1pt}{1pt}}} +\draw (0,0) to[spst] ++(1,0) to[cogsw, switch arrows/dash=none] + ++(1,0) to[oncs, switch arrows/color=blue] ++(1,0); +\end{circuitikz} +\end{LTXexample} \paragraph{Rotary switch arrows.} You can change the rotary switch arrow shape in the same way as you change the ones in regular switches. Notice however that if you set either \texttt{switch end arrow} or \texttt{switch start arrow} they will be followed only if you have set both arrows with \texttt{<->} or equivalent, otherwise just one will be used. @@ -6207,6 +6243,8 @@ The transmission gate (also known as ``bowtie'') components are not described in \circuitdesc*{european xnor port}{European \textsc{xnor} port}{} \circuitdesc*{european buffer port}{European \textsc{buffer} port}{} \circuitdesc*{european not port}{European \textsc{not} port}{} + \circuitdesc*{european blank port}{European blank port}{A} + \circuitdesc*{european blank not port}{European blank not port}{B} \end{groupdesc} \begin{framed} @@ -6767,7 +6805,30 @@ The anchors for the tgate's control point are called \texttt{gate} and \texttt{n \subsubsection{European logic port usage} -European logic port are the same class as american and IEEE-style ones, and they obey the same class modifier. Moreover, you can use the \texttt{no inputs pin} as in the other logic ports to suppress input pins. +European logic port are in the same class as american and IEEE-style ones, and they obey the same class modifier. Moreover, you can use the \texttt{no inputs pin} as in the other logic ports to suppress input pins. + +The standard text inside the port does not rotate (not flip) with the component\footnote{since \texttt{1.6.4}, thanks to a suggestion by \href{https://github.com/circuitikz/circuitikz/issues/730}{user \texttt{@sputeanus} on GitHub}.}, but you can change the font (and color and so on) with the key \texttt{european ports font} (default nothing, which means it uses the standard font and color). +For more complex customization, you can use the two ``blank'' European ports, and add the text you want on them. + +\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily] +\begin{tikzpicture} + \ctikzset{ + logic ports=european, + logic ports origin=center, + logic ports/scale=1.5, + tripoles/european not symbol=ieee circle, + } + % Draw the Nand with big AND symbol + \ctikzset{european ports font=\Huge\color{red}} + \draw(0,0) node [nand port, rotate=90, + number inputs=4]{}; + \draw(3,0) node [nand port, xscale=-1]{}; + % the un-rotation is not automatic for node text! + \draw(0,-3) node [blank port, rotate=90, + ]{\rotatebox{-90}{\Huge ?}}; + \draw(3,-3) node [blank not port, xscale=-1]{?}; +\end{tikzpicture} +\end{LTXexample} \paragraph{European logic port customization} Normally the European-style logic port with inverted output are marked with a small triangle; if you want you can change it with the key \texttt{tripoles/european not symbol}; its default is \texttt{triangle} but you can set it to \texttt{circle} like in the following example. As you can see, the circle size is the same as the circuit poles; if you prefer the size used in the IEEE standard ports, you can use set it to \texttt{ieee circle}. @@ -8994,7 +9055,7 @@ You can add nodes to the bipoles, positioned at the coordinates surrounding the \end{circuitikz} \end{LTXexample} -These bipole nodes are added after the path is drawn, as every node in \TikZ\ --- this is the reason why they are always filled (with the main color the normal nodes, with white the open ones), in order to ``hide'' the wire below. You can override the fill color if you want; but notice that if you draw things in two different paths, you will have ``strange'' results; notice that in the second line of resistors the second wire is starting from the center of the white \texttt{ocirc} of the previous path. +These bipole nodes are added \emph{after} any single path is drawn, as every node in \TikZ\ --- this is the reason why they are always filled (with the main color the normal nodes, with white the open ones), in order to ``hide'' the wire below. You can override the fill color if you want; but notice that if you draw things in two different paths, you will have ``strange'' results; notice that in the second line of resistors the second wire is starting from the center of the white \texttt{ocirc} of the previous path. \begin{LTXexample}[varwidth=true, pos=t @@ -9112,7 +9173,7 @@ There are several predefined shorthand as the above; in the following pages you \subsubsection{Transparent poles}\label{sec:transparent-poles} -``Open-poles'' terminals (\texttt{ocirc}, \texttt{odiamondpole}, and \texttt{osquarepole}) are normally filled with the background color at full opacity. This is because, for simplicity of operation, the nodes are placed \emph{after} the wires are drawn and have to ``white-out'' the underlying lines. +``Open-poles'' terminals (\texttt{ocirc}, \texttt{odiamondpole}, and \texttt{osquarepole}) are normally filled with the background color at full opacity. The is reason is that \TikZ{}, when stroking a path, places and draws the nodes \emph{after} the lines are drawn; that way the poles ``white-out'' the underlying lines. Clearly this works if the wires and poles are written \emph{in the same path command}, otherwise the explicit order is respected. Anyway, \emph{if you know what you are doing}, you can change it with the key \texttt{poles/open fill opacity} (with \verb|\ctikzset|) or the style \texttt{open poles opacity}. Notice that you will have artifacts if you don't use the border anchors of the poles to connect wires, and you need to do that by hand. diff --git a/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty b/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty index 6cc3af44a2..464ad23f13 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.6.3} -\def\pgfcircversiondate{2023/06/23} +\def\pgfcircversion{1.6.4} +\def\pgfcircversiondate{2023/10/10} \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/pgfcircbipoles.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex index 1acb5a8d65..82e841212a 100644 --- a/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex +++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex @@ -1791,7 +1791,7 @@ \ifx\pgf@temp\pgf@circ@temp% \pgf@circ@europeaninductor@path{#1}% \else% - \pgfextra{ \def\pgf@temp{cute} }% + \pgfextra{ \def\pgf@temp{cute} }% \ifx\pgf@temp\pgf@circ@temp% \pgf@circ@cuteinductor@path{#1}% \else% @@ -1813,7 +1813,7 @@ \ifx\pgf@temp\pgf@circ@temp% \pgf@circ@veuropeaninductor@path{#1}% \else% - \pgfextra{ \def\pgf@temp{cute} }% + \pgfextra{ \def\pgf@temp{cute} }% \ifx\pgf@temp\pgf@circ@temp% \pgf@circ@vcuteinductor@path{#1}% \else% @@ -1835,7 +1835,7 @@ \ifx\pgf@temp\pgf@circ@temp% \pgf@circ@europeaninductivesens@path{#1}% \else% - \pgfextra{ \def\pgf@temp{cute} }% + \pgfextra{ \def\pgf@temp{cute} }% \ifx\pgf@temp\pgf@circ@temp% \pgf@circ@cuteinductivesens@path{#1}% \else% @@ -1884,6 +1884,7 @@ \ctikzset{bipoles/vsourceam/height/.initial=.60} \ctikzset{bipoles/vsourceam/width/.initial=.60} \ctikzset{bipoles/vsourceam/margin/.initial=.7} +\ctikzset{bipoles/isourcesin/angle/.initial=90} \ctikzset{bipoles/isourcesin/height/.initial=.60} \ctikzset{bipoles/isourcesin/width/.initial=.60} \ctikzset{bipoles/vsourcesin/height/.initial=.60} @@ -1914,7 +1915,7 @@ % noise sources \ctikzset{bipoles/noise sources/fillcolor/.initial=gray!50} -% for special symbols in the sources: sin, square, triangle, delta, wye, zig, etc. +% for special symbols in the sources: sin, square, triangle, delta, wye, eyw, zig, etc. \ctikzset{sources/symbol/thickness/.initial={1}} \ctikzset{csources/symbol/thickness/.initial={1}} \ctikzset{sources/symbol/rotate/.initial={90}} @@ -1936,28 +1937,34 @@ % % % primary windings \newif\ifpgf@circ@prim@delta \newif\ifpgf@circ@prim@wye +\newif\ifpgf@circ@prim@eyw \newif\ifpgf@circ@prim@zig \pgfkeys{tikz/prim/.is choice} \pgfkeys{tikz/prim/delta/.add code={}{\pgf@circ@prim@deltatrue}} \pgfkeys{tikz/prim/wye/.add code={}{\pgf@circ@prim@wyetrue}} +\pgfkeys{tikz/prim/eyw/.add code={}{\pgf@circ@prim@eywtrue}} \pgfkeys{tikz/prim/zig/.add code={}{\pgf@circ@prim@zigtrue}} % % % secondary windings \newif\ifpgf@circ@sec@delta \newif\ifpgf@circ@sec@wye +\newif\ifpgf@circ@sec@eyw \newif\ifpgf@circ@sec@zig \pgfkeys{tikz/sec/.is choice} \pgfkeys{tikz/sec/delta/.add code={}{\pgf@circ@sec@deltatrue}} \pgfkeys{tikz/sec/wye/.add code={}{\pgf@circ@sec@wyetrue}} +\pgfkeys{tikz/sec/eyw/.add code={}{\pgf@circ@sec@eywtrue}} \pgfkeys{tikz/sec/zig/.add code={}{\pgf@circ@sec@zigtrue}} % % % tertiary windings (ooosource) \newif\ifpgf@circ@tert@delta \newif\ifpgf@circ@tert@wye +\newif\ifpgf@circ@tert@eyw \newif\ifpgf@circ@tert@zig \pgfkeys{tikz/tert/.is choice} \pgfkeys{tikz/tert/delta/.add code={}{\pgf@circ@tert@deltatrue}} \pgfkeys{tikz/tert/wye/.add code={}{\pgf@circ@tert@wyetrue}} +\pgfkeys{tikz/tert/eyw/.add code={}{\pgf@circ@tert@eywtrue}} \pgfkeys{tikz/tert/zig/.add code={}{\pgf@circ@tert@zigtrue}}% % nullator and norator @@ -2078,11 +2085,38 @@ \pgfusepath{draw} } +%%% +%%% https://xkcd.com/2818/ +%%% Also https://chat.stackexchange.com/transcript/message/64238058#64238058 +%%% +\pgfcircdeclarebipolescaled{batteries} +{} +{\ctikzvalof{bipoles/battery/height}} +{baertty} +{\ctikzvalof{bipoles/battery/height}} +{\ctikzvalof{bipoles/battery/width}} +{ + \pgf@circ@res@step = \ctikzvalof{bipoles/battery/width}\pgf@circ@scaled@Rlen + \divide \pgf@circ@res@step by 6 + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}} + \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{.5\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{.5\pgf@circ@res@down}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} +} +\pgfcirc@activate@bipole@simple@opt{v}{baertty}{\circuitikzbasekey/bipole/is voltage=true, + \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true} + %%%%%%%%%%% %% Round and diamond sources %%%%%%%%%%% -% % % symbol drawing macros (NOT for delta, wye, zig) +% % % symbol drawing macros (NOT for delta, wye, eyw, zig) \def\pgf@circ@sources@symbol@setup{% called in a pgfscope \edef\@@@auto{auto}\edef\@@@rotate{\ctikzvalof{\ctikzclass/symbol/rotate}} \ifx\@@@auto\@@@rotate @@ -2397,6 +2431,7 @@ % % % winding symbols \ctikzset{sources/symbol/delta scale/.initial={1}} \ctikzset{sources/symbol/wye scale/.initial={1}} +\ctikzset{sources/symbol/eyw scale/.initial={1}} \ctikzset{sources/symbol/zig scale/.initial={1}} % triangle \def\pgf@circ@delta#1{ @@ -2436,6 +2471,24 @@ \endpgfscope } +% reverse star +\def\pgf@circ@eyw#1{ + \pgfscope + \pgftransformscale{-.015*\ctikzvalof{\ctikzclass/symbol/eyw scale}*\pgf@circ@res@left*#1} + \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} + \pgftransformrotate{-\pgfcircmathresult} + + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgf@circ@set@relative@thickness{symbol/thickness} + \pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpointorigin} + \pgfpathlineto{\pgfpointpolar{30}{\pgf@circ@res@down}} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpointpolar{150}{\pgf@circ@res@down}} + \pgfusepath{stroke} + \endpgfscope +} + % zigzag \def\pgf@circ@zig#1{ \pgfscope @@ -2514,13 +2567,19 @@ \pgftransformxshift{\ctikzvalof{bipoles/oosourcetrans/circlesize}\pgf@circ@res@left} \pgf@circ@wye{\ctikzvalof{bipoles/oosourcetrans/vectorgroupscale}} \endpgfscope + + \else\ifpgf@circ@prim@eyw + \pgfscope + \pgftransformxshift{\ctikzvalof{bipoles/oosourcetrans/circlesize}\pgf@circ@res@left} + \pgf@circ@eyw{\ctikzvalof{bipoles/oosourcetrans/vectorgroupscale}} + \endpgfscope \else\ifpgf@circ@prim@zig \pgfscope \pgftransformxshift{\ctikzvalof{bipoles/oosourcetrans/circlesize}\pgf@circ@res@left} \pgf@circ@zig{\ctikzvalof{bipoles/oosourcetrans/vectorgroupscale}} \endpgfscope - \fi\fi\fi + \fi\fi\fi\fi %%secondary winding \ifpgf@circ@sec@delta @@ -2534,13 +2593,19 @@ \pgftransformxshift{\ctikzvalof{bipoles/oosourcetrans/circlesize}\pgf@circ@res@right} \pgf@circ@wye{\ctikzvalof{bipoles/oosourcetrans/vectorgroupscale}} \endpgfscope + + \else\ifpgf@circ@sec@eyw + \pgfscope + \pgftransformxshift{\ctikzvalof{bipoles/oosourcetrans/circlesize}\pgf@circ@res@right} + \pgf@circ@eyw{\ctikzvalof{bipoles/oosourcetrans/vectorgroupscale}} + \endpgfscope \else\ifpgf@circ@sec@zig \pgfscope \pgftransformxshift{\ctikzvalof{bipoles/oosourcetrans/circlesize}\pgf@circ@res@right} \pgf@circ@zig{\ctikzvalof{bipoles/oosourcetrans/vectorgroupscale}} \endpgfscope - \fi\fi\fi + \fi\fi\fi\fi } @@ -2716,13 +2781,19 @@ \pgftransformxshift{.6\pgf@circ@res@left} \pgf@circ@wye{\ctikzvalof{bipoles/ooosource/vectorgroupscale}} \endpgfscope + + \else\ifpgf@circ@prim@eyw + \pgfscope + \pgftransformxshift{.6\pgf@circ@res@left} + \pgf@circ@eyw{\ctikzvalof{bipoles/ooosource/vectorgroupscale}} + \endpgfscope \else\ifpgf@circ@prim@zig \pgfscope \pgftransformxshift{.6\pgf@circ@res@left} \pgf@circ@zig{\ctikzvalof{bipoles/ooosource/vectorgroupscale}} \endpgfscope - \fi\fi\fi + \fi\fi\fi\fi % % secondary winding \ifpgf@circ@sec@delta @@ -2737,13 +2808,19 @@ \pgftransformshift{\pgfpointpolar{60}{0.6\pgf@circ@res@right}} \pgf@circ@wye{\ctikzvalof{bipoles/ooosource/vectorgroupscale}} \endpgfscope + + \else\ifpgf@circ@sec@eyw + \pgfscope + \pgftransformshift{\pgfpointpolar{60}{0.6\pgf@circ@res@right}} + \pgf@circ@eyw{\ctikzvalof{bipoles/ooosource/vectorgroupscale}} + \endpgfscope \else\ifpgf@circ@sec@zig \pgfscope \pgftransformshift{\pgfpointpolar{60}{0.6\pgf@circ@res@right}} \pgf@circ@zig{\ctikzvalof{bipoles/ooosource/vectorgroupscale}} \endpgfscope - \fi\fi\fi + \fi\fi\fi\fi % % tertiary winding \ifpgf@circ@tert@delta @@ -2757,13 +2834,19 @@ \pgftransformshift{\pgfpointpolar{-60}{0.6\pgf@circ@res@right}} \pgf@circ@wye{\ctikzvalof{bipoles/ooosource/vectorgroupscale}} \endpgfscope + + \else\ifpgf@circ@tert@eyw + \pgfscope + \pgftransformshift{\pgfpointpolar{-60}{0.6\pgf@circ@res@right}} + \pgf@circ@eyw{\ctikzvalof{bipoles/ooosource/vectorgroupscale}} + \endpgfscope \else\ifpgf@circ@tert@zig \pgfscope \pgftransformshift{\pgfpointpolar{-60}{0.6\pgf@circ@res@right}} \pgf@circ@zig{\ctikzvalof{bipoles/ooosource/vectorgroupscale}} \endpgfscope - \fi\fi\fi + \fi\fi\fi\fi } %% Independent current source - American @@ -2788,7 +2871,7 @@ \endpgfscope } -%% Independent sinusoidal current source +%% Independent sinusoidal current source with open shape \pgfcircdeclarebipolescaled{sources} {} {\ctikzvalof{bipoles/isource/height}} @@ -2798,8 +2881,16 @@ { \pgfpointorigin \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} - \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} - \pgf@circ@draworfill + \pgfscope + \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} + \pgf@circ@maybefill + \endpgfscope + \edef\@@angle{\ctikzvalof{bipoles/isourcesin/angle}} + \pgfpathmoveto{\pgfpointpolar{\@@angle}{\pgf@circ@res@up}} + \pgfpatharc{\@@angle}{-\@@angle}{\pgf@circ@res@up} + \pgfpathmoveto{\pgfpointpolar{180-\@@angle}{\pgf@circ@res@up}} + \pgfpatharc{180-\@@angle}{180+\@@angle}{\pgf@circ@res@up} + \pgfusepath{draw} \pgf@circ@res@up = .5\pgf@circ@res@up \pgfscope @@ -4635,6 +4726,17 @@ \ctikzset{tripoles/toggleswitch/height/.initial=.8} \ctikzset{tripoles/toggleswitch/height 2/.initial=.0} \ctikzset{tripoles/toggleswitch/width/.initial=.80} +%% arrow configurability +\ctikzset{switch arrows/.is family} +\ctikzset{switch arrows/relative thickness/.initial=1} +\ctikzset{switch arrows/color/.initial=default} +\ctikzset{switch arrows/dash/.initial=default} +\def\pgf@circ@set@switcharrow@style{% + % You *must* be sure that this is called inside a \pgfscope! + \pgfsetlinewidth{\ctikzvalof{switch arrows/relative thickness}\pgflinewidth} + \pgf@circ@subset@color@dash{switch arrows} + \pgfcirc@set@arrows{switch}{}{latexslim} + } %%>>> %% Shapes Node for bipoles switches and similar things%<<< @@ -4650,12 +4752,11 @@ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}} \pgfusepath{draw} - \pgfscope \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} \pgfpathmoveto{\pgfpointpolar{90}{1.2\pgf@circ@res@right}} \pgfpatharc{90}{-20}{1.2\pgf@circ@res@right} - \pgfcirc@set@arrows{switch}{}{latexslim} + \pgf@circ@set@switcharrow@style \pgfsetbeveljoin \pgfusepath{draw} \endpgfscope @@ -4669,17 +4770,15 @@ {\ctikzvalof{bipoles/spst/height}} {\ctikzvalof{bipoles/spst/width}} { - \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}} \pgfusepath{draw} - \pgfscope \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} \pgfpathmoveto{\pgfpointpolar{-10}{1.2\pgf@circ@res@right}} \pgfpatharc{-10}{90}{1.2\pgf@circ@res@right} - \pgfcirc@set@arrows{switch}{}{latexslim} + \pgf@circ@set@switcharrow@style \pgfsetbeveljoin \pgfusepath{draw} \endpgfscope @@ -4693,7 +4792,6 @@ {\ctikzvalof{bipoles/nos/height}} {\ctikzvalof{bipoles/nos/width}} { - \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@up}} @@ -4720,6 +4818,118 @@ \pgfusepath{draw} } +% Opening normal closed Switch +\pgfcircdeclarebipolescaled{switches} +{} +{\ctikzvalof{bipoles/ncs/depth}} +{oncs} +{\ctikzvalof{bipoles/ncs/height}} +{\ctikzvalof{bipoles/ncs/width}} +{ + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfusepath{draw} + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} + \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{0pt}} + \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfusepath{draw} + \pgfscope + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfpathmoveto{\pgfpointpolar{-10}{.9\pgf@circ@res@right}} + \pgfpatharc{-10}{95}{.9\pgf@circ@res@right} + \pgf@circ@set@switcharrow@style + \pgfsetbeveljoin + \pgfusepath{draw} + \endpgfscope +} + +%% Closing normal closed Switch +\pgfcircdeclarebipolescaled{switches} +{} +{\ctikzvalof{bipoles/ncs/depth}} +{cncs} +{\ctikzvalof{bipoles/ncs/height}} +{\ctikzvalof{bipoles/ncs/width}} +{ + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfusepath{draw} + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} + \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{0pt}} + \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfusepath{draw} + \pgfscope + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfpathmoveto{\pgfpointpolar{90}{.9\pgf@circ@res@right}} + \pgfpatharc{90}{-35}{.9\pgf@circ@res@right} + \pgf@circ@set@switcharrow@style + \pgfsetbeveljoin + \pgfusepath{draw} + \endpgfscope +} + +%% Opening normal open Switch +\pgfcircdeclarebipolescaled{switches} +{} +{\ctikzvalof{bipoles/ncs/depth}} +{onos} +{\ctikzvalof{bipoles/ncs/height}} +{\ctikzvalof{bipoles/ncs/width}} +{ + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfusepath{draw} + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} + \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{0pt}} + \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{.4\pgf@circ@res@up}} + \pgfusepath{draw} + \pgfscope + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfpathmoveto{\pgfpointpolar{-10}{.9\pgf@circ@res@right}} + \pgfpatharc{-10}{95}{.9\pgf@circ@res@right} + \pgf@circ@set@switcharrow@style + \pgfsetbeveljoin + \pgfusepath{draw} + \endpgfscope +} + +%% Closing normal open Switch +\pgfcircdeclarebipolescaled{switches} +{} +{\ctikzvalof{bipoles/ncs/depth}} +{cnos} +{\ctikzvalof{bipoles/ncs/height}} +{\ctikzvalof{bipoles/ncs/width}} +{ + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfusepath{draw} + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} + \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{0pt}} + \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{.4\pgf@circ@res@up}} + \pgfusepath{draw} + \pgfscope + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfpathmoveto{\pgfpointpolar{90}{.9\pgf@circ@res@right}} + \pgfpatharc{90}{-35}{.9\pgf@circ@res@right} + \pgf@circ@set@switcharrow@style + \pgfsetbeveljoin + \pgfusepath{draw} + \endpgfscope +} + %% Push Button \pgfcircdeclarebipolescaled{switches} { @@ -4938,7 +5148,7 @@ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node \pgfpathmoveto{\pgfpointpolar{70}{1.2\pgf@circ@res@right}} \pgfpatharc{70}{-10}{1.2\pgf@circ@res@right} - \pgfcirc@set@arrows{switch}{}{latexslim} + \pgf@circ@set@switcharrow@style \pgfusepath{draw} } @@ -4950,19 +5160,19 @@ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node \pgfpathmoveto{\pgfpointpolar{-10}{1.2\pgf@circ@res@right}} \pgfpatharc{-10}{60}{1.2\pgf@circ@res@right} - \pgfcirc@set@arrows{switch}{}{latexslim} + \pgf@circ@set@switcharrow@style \pgfusepath{draw} } \pgfcircdeclarebipole{ - \anchor{out 1}{ - \northeast - \pgf@y=0cm - } - \anchor{out 2}{ - \northeast - \pgf@y=.8\pgf@y - } + \anchor{out 1}{ + \northeast + \pgf@y=0cm + } + \anchor{out 2}{ + \northeast + \pgf@y=.8\pgf@y + } } {\ctikzvalof{tripoles/toggleswitch/height 2}} {toggleswitch} @@ -5235,10 +5445,12 @@ {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up-1.5\pgf@circ@res@temp}} { \pgf@circ@setlinewidth{bipoles}{\pgflinewidth} + \pgfsetlinewidth{\ctikzvalof{switch arrows/relative thickness}\pgflinewidth} + \pgf@circ@subset@color@dash{switch arrows} + \pgfcirc@set@arrows{switch}{}{latexslim} \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node \pgfpathmoveto{\pgfpointpolar{70}{1.5\pgf@circ@res@right}} \pgfpatharc{70}{-50}{1.5\pgf@circ@res@right} - \pgfcirc@set@arrows{switch}{}{latexslim} \pgfusepath{draw} } @@ -5246,8 +5458,10 @@ {\pgfpoint{\pgf@circ@res@right}{0pt}} { \pgf@circ@setlinewidth{bipoles}{\pgflinewidth} - \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node + \pgfsetlinewidth{\ctikzvalof{switch arrows/relative thickness}\pgflinewidth} + \pgf@circ@subset@color@dash{switch arrows} \pgfcirc@set@arrows{switch}{latexslim}{latexslim} + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node \pgfpathmoveto{\pgfpointpolar{-60}{1.5\pgf@circ@res@right}} \pgfpatharc{-60}{60}{1.5\pgf@circ@res@right} \pgfusepath{draw} @@ -5257,10 +5471,12 @@ {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down+1.5\pgf@circ@res@temp}} { \pgf@circ@setlinewidth{bipoles}{\pgflinewidth} + \pgfsetlinewidth{\ctikzvalof{switch arrows/relative thickness}\pgflinewidth} + \pgf@circ@subset@color@dash{switch arrows} + \pgfcirc@set@arrows{switch}{}{latexslim} \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node \pgfpathmoveto{\pgfpointpolar{-50}{1.5\pgf@circ@res@right}} \pgfpatharc{-50}{70}{1.5\pgf@circ@res@right} - \pgfcirc@set@arrows{switch}{}{latexslim} \pgfusepath{draw} } % %>>> @@ -5278,6 +5494,14 @@ \pgfcirc@style@to@style{nos}{normal open switch} \pgfcirc@activate@bipole@simple{l}{ncs} \pgfcirc@style@to@style{ncs}{normal closed switch} +\pgfcirc@activate@bipole@simple{l}{oncs} +\pgfcirc@style@to@style{oncs}{opening normal closed switch} +\pgfcirc@activate@bipole@simple{l}{cncs} +\pgfcirc@style@to@style{cncs}{closing normal closed switch} +\pgfcirc@activate@bipole@simple{l}{onos} +\pgfcirc@style@to@style{onos}{opening normal open switch} +\pgfcirc@activate@bipole@simple{l}{cnos} +\pgfcirc@style@to@style{cnos}{closing normal open switch} \pgfcirc@activate@bipole{l}{pushbutton}{pushbutton}{push button} \pgfcirc@style@to@style{push button}{nopb} @@ -6810,7 +7034,7 @@ {\ctikzvalof{bipoles/american gas filled surge arrester/width}}{ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} - \pgfpointorigin \pgf@circ@res@other = \pgf@x \advance \pgf@circ@res@other by -\pgf@circ@res@up + \pgfpointorigin \pgf@circ@res@other = \pgf@x \advance \pgf@circ@res@other by -\pgf@circ@res@up \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}} \pgfusepath{draw} diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex index 2cef035890..826c3eaad3 100644 --- a/graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex +++ b/graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex @@ -25,7 +25,8 @@ % \pgfkeys{/tikz/number inputs/.initial=0} \pgfkeys{/tikz/number inputs/.default=0} - +% by default, use the default font (and color, etc.) +\ctikzset{european ports font/.initial={}} \newif\ifpgf@circuit@europeanlogicport \ctikzset{logic ports/.is choice} \ctikzset{logic ports/european/.code= {\pgf@circuit@europeanlogicporttrue @@ -37,6 +38,8 @@ \tikzset{nand port/.style={shape=european nand port}}% \tikzset{nor port/.style={shape=european nor port}}% \tikzset{xnor port/.style={shape=european xnor port}}% + \tikzset{blank port/.style={shape=european blank port}}% + \tikzset{blank not port/.style={shape=european blank not port}}% % there is no Schmitt ports in european style (yet) \tikzset{schmitt port/.style={shape=schmitt}}% \tikzset{invschmitt port/.style={shape=invschmitt}}% @@ -52,6 +55,9 @@ \tikzset{xnor port/.style={shape=american xnor port}}% \tikzset{schmitt port/.style={shape=schmitt}}% \tikzset{invschmitt port/.style={shape=invschmitt}}% + %%% there are no blank ports for american (no sense to have them) + \tikzset{blank port/.style={shape=european blank port}}% + \tikzset{blank not port/.style={shape=european blank not port}}% }} \ctikzset{logic ports origin/.is choice} @@ -70,6 +76,8 @@ \ctikzset{tripoles/european xnor port/origin/.initial=0.8}% \ctikzset{tripoles/european buffer port/origin/.initial=0.8}% \ctikzset{tripoles/european not port/origin/.initial=0.8}% + \ctikzset{tripoles/european blank port/origin/.initial=0.8}% + \ctikzset{tripoles/european blank not port/origin/.initial=0.8}% }% } \ctikzset{logic ports origin/center/.code={% @@ -87,6 +95,8 @@ \ctikzset{tripoles/european xnor port/origin/.initial=0}% \ctikzset{tripoles/european buffer port/origin/.initial=0}% \ctikzset{tripoles/european not port/origin/.initial=0}% + \ctikzset{tripoles/european blank port/origin/.initial=0}% + \ctikzset{tripoles/european blank not port/origin/.initial=0}% }% } @@ -195,7 +205,7 @@ \ctikzset{tripoles/american xnor port/inputs/.initial=2} \ctikzset{tripoles/american xnor port/angle/.initial=70} \ctikzset{tripoles/american xnor port/inner/.initial=0.3} - +% \ctikzset{tripoles/european and port/width/.initial=1.4} \ctikzset{tripoles/european and port/height/.initial=.65} \ctikzset{tripoles/european and port/reserved/.initial=.6} @@ -255,6 +265,21 @@ \ctikzset{tripoles/european buffer port/inputs/.initial=1}% \ctikzset{tripoles/european not port/origin/.initial=0.8} \ctikzset{tripoles/european not port/inputs/.initial=1}% +%% "blank" ports +\ctikzset{tripoles/european blank port/width/.initial=1.4} +\ctikzset{tripoles/european blank port/height/.initial=.65} +\ctikzset{tripoles/european blank port/reserved/.initial=.6} +\ctikzset{tripoles/european blank port/input height/.initial=.6} +\ctikzset{tripoles/european blank not port/width/.initial=1.4} +\ctikzset{tripoles/european blank not port/not height/.initial=.3} +\ctikzset{tripoles/european blank not port/not width/.initial=.9} +\ctikzset{tripoles/european blank not port/height/.initial=.65} +\ctikzset{tripoles/european blank not port/reserved/.initial=.6} +\ctikzset{tripoles/european blank not port/input height/.initial=.6} +\ctikzset{tripoles/european blank port/origin/.initial=0.8} +\ctikzset{tripoles/european blank port/inputs/.initial=2} +\ctikzset{tripoles/european blank not port/origin/.initial=0.8} +\ctikzset{tripoles/european blank not port/inputs/.initial=2} %%% parameters that are not used anymore after multi-input %%% gates --- left for compatibility of source code. \ctikzset{tripoles/american xor port/aaa/.initial=.6} @@ -1547,8 +1572,11 @@ \fi \pgf@circ@text@strokecolor \pgfpathmoveto{\pgfpointorigin} - \pgftext{#2} - % + \pgfscope + % text is always in standard direction + \pgftransformresetnontranslations + \pgftext{\ctikzvalof{european ports font}#2}% + \endpgfscope } } } @@ -1560,7 +1588,8 @@ \pgfcircdeclareeurologicport{nand}{\&}{\pgf@circ@res@count}{not} \pgfcircdeclareeurologicport{nor}{$\ge 1$}{\pgf@circ@res@count}{not} \pgfcircdeclareeurologicport{xnor}{$=1$}{\pgf@circ@res@count}{not} - +\pgfcircdeclareeurologicport{blank}{}{\pgf@circ@res@count}{} +\pgfcircdeclareeurologicport{blank not}{}{\pgf@circ@res@count}{not} %% end european logic ports % %>>> diff --git a/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex b/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex index 44cf1e70ad..e76a91d957 100644 --- a/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex +++ b/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex @@ -16,8 +16,8 @@ \startmodule[circuitikz] \usemodule[tikz] -\def\pgfcircversion{1.6.3} -\def\pgfcircversiondate{2023/06/23} +\def\pgfcircversion{1.6.4} +\def\pgfcircversiondate{2023/10/10} \writestatus{loading}{\pgfcircversiondate{} The CircuiTikz circuit drawing package version \pgfcircversion} diff --git a/graphics/pgf/contrib/tkz-bernoulli/doc/tkz-bernoulli-doc.pdf b/graphics/pgf/contrib/tkz-bernoulli/doc/tkz-bernoulli-doc.pdf Binary files differindex c4fb7fd8e2..dd6c2d0407 100644 --- a/graphics/pgf/contrib/tkz-bernoulli/doc/tkz-bernoulli-doc.pdf +++ b/graphics/pgf/contrib/tkz-bernoulli/doc/tkz-bernoulli-doc.pdf diff --git a/graphics/pgf/contrib/tkz-bernoulli/doc/tkz-bernoulli-doc.tex b/graphics/pgf/contrib/tkz-bernoulli/doc/tkz-bernoulli-doc.tex index ea284f4350..56a57312d0 100644 --- a/graphics/pgf/contrib/tkz-bernoulli/doc/tkz-bernoulli-doc.tex +++ b/graphics/pgf/contrib/tkz-bernoulli/doc/tkz-bernoulli-doc.tex @@ -34,8 +34,8 @@ \hypersetup{pdfborder=0 0 0} \usepackage[margin=1.5cm]{geometry} \setlength{\parindent}{0pt} -\def\TPversion{0.1.0} -\def\TPdate{9 septembre 2023} +\def\TPversion{0.1.1} +\def\TPdate{10 octobre 2023} \usepackage{tcolorbox} \tcbuselibrary{skins,hooks} \usepackage{soul} @@ -308,6 +308,40 @@ Les \textsf{clés} relatives aux commandes précédentes permettent de modifier \tkzSchemBernoulli* \end{demohigh} +\subsection{La commande pour une épreuve de Bernoulli} + +Il existe une commande, \MontreCode{\textbackslash tkzEpreuvBernoulli}, pour afficher un arbre \textit{simple}, avec le même fonctionnement que les arbres \textit{complets}. + +Certaines clés n'ont pas d'effet, donc il n'y aura pas de d'explications dédiées pour cette commande. + +\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] +%commande dans un environnement tikzpicture +\begin{tikzpicture} + \tkzEpreuvBernoulli[clés] +\end{tikzpicture} +\end{codehigh} + +\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] +\begin{tikzpicture} + \tkzEpreuvBernoulli +\end{tikzpicture} +~~ +\begin{tikzpicture} + \tkzEpreuvBernoulli[Racine=false] +\end{tikzpicture} +\end{demohigh} + +\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] +%commande autonome +\tkzEpreuvBernoulli*[clés] +\end{codehigh} + +\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] +\tkzEpreuvBernoulli*[Probas={$p$/$q$}] +~~ +\tkzEpreuvBernoulli* +\end{demohigh} + \pagebreak \section{English commands} @@ -354,6 +388,34 @@ Default styles are given by : \tkzBernTreeStyleDefault \end{codehigh} +\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] +%command in an environment tikzpicture for a single Bernoulli trial +\begin{tikzpicture} + tkzBernoulliTrial[keys] +\end{tikzpicture} +\end{codehigh} + +\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] +\begin{tikzpicture} + \tkzBernoulliTrial +\end{tikzpicture} +~~ +\begin{tikzpicture} + \tkzBernoulliTrial[Root=false] +\end{tikzpicture} +\end{demohigh} + +\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] +%stand-alone command for a single Bernoulli trial +\tkzBernoulliTrial*[keys] +\end{codehigh} + +\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] +\tkzBernoulliTrial*[Probs={$p$/$q$}] +~~ +\tkzBernoulliTrial* +\end{demohigh} + \subsection{Examples} \begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] @@ -363,7 +425,7 @@ Default styles are given by : \end{demohigh} \begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] -\tkzBernoulliTree*[Help,ShowProbs=false,LevelSep=3.25,NodeSep=0.75,N=4,Guide,var=Z] +\tkzBernoulliTree*[Help,ShowProbs=false,LevelSep=3.25,NodeSep=0.75,N=4,Guide,Var=Z] \end{demohigh} \begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10] diff --git a/graphics/pgf/contrib/tkz-bernoulli/tex/tkz-bernoulli.sty b/graphics/pgf/contrib/tkz-bernoulli/tex/tkz-bernoulli.sty index 88e3ebaed4..5398bbbb0c 100644 --- a/graphics/pgf/contrib/tkz-bernoulli/tex/tkz-bernoulli.sty +++ b/graphics/pgf/contrib/tkz-bernoulli/tex/tkz-bernoulli.sty @@ -2,9 +2,10 @@ % licence : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txtf \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{tkz-bernoulli}[2023/09/09 0.1.0 Draw Bernoulli tree with tikz] +\ProvidesPackage{tkz-bernoulli}[2023/10/10 0.1.1 Draw Bernoulli tree with tikz] %====HISTORIQUE +% v 0.1.1 Correction de bugs + ajout d'une commande pour une épreuve de Bernoulli % v 0.1.0 Version initiale [fr] et [en] %====BASE @@ -83,6 +84,45 @@ N=3 } +\NewDocumentCommand\tkzEpreuvBernoulli{ s O{} D<>{} }{% + \useKVdefault[ArbreBernoulli]% + \setKV[ArbreBernoulli]{#2}% + \saveexpandmode\expandarg + \StrCut{\ArBinEvts}{/}{\ArBinSucces}{\ArBinEchec}% + \StrCut{\ArBinProbas}{/}{\ArBinProbSucces}{\ArBinProbEchec}% + \restoreexpandmode + \IfBooleanT{#1}% + {% + \begin{tikzpicture}[#3] + }% + \IfStrEq{\ArBinRacine}{false}% + {% + \coordinate (A0-1) at (0,0) ;% + \coordinate (B0-1) at (0,0) ;% + }% + {% + \coordinate (A0-1) at (0,0) ;% + \node[BernRacine] (B0-1) at (A0-1) {\ArBinRacine} ;% + }% + \coordinate (A1-1) at ($(A0-1)+({\ArBinIN},{0.5*\ArBinIF})$) ; + \coordinate (A1-2) at ($(A0-1)+({\ArBinIN},{-0.5*\ArBinIF})$) ; + \node[BernNoeudS] (B1-1) at (A1-1) {\ArBinSucces} ;%succès + \node[BernNoeudE] (B1-2) at (A1-2) {\ArBinEchec} ;%échec + \ifboolKV[ArbreBernoulli]{AffProbas}% + {% + \draw[BernBranche] (B0-1) -- (B1-1) node[BernProbaS] {\ArBinProbSucces} ; + \draw[BernBranche] (B0-1) -- (B1-2) node[BernProbaE] {\ArBinProbEchec} ; + }% + {% + \draw[BernBranche] (B0-1) -- (B1-1) ; + \draw[BernBranche] (B0-1) -- (B1-2) ; + }% + \IfBooleanT{#1}% + {% + \end{tikzpicture}% + }% +} + \NewDocumentCommand\tkzSchemBernoulli{ s O{} D<>{} }{% \useKVdefault[ArbreBernoulli]% \setKV[ArbreBernoulli]{#2}% @@ -104,6 +144,7 @@ %Racine \IfStrEq{\ArBinRacine}{false}% {% + \coordinate (A0-1) at (0,0) ;% \coordinate (B0-1) at (0,0) ;% }% {% @@ -160,7 +201,7 @@ \foreach \i in {1,...,\fpeval{2**\ArBinN}}{% \def\itmp{\fpeval{2**\ArBinN-\i}}% \def\ArBenTmpBin{\xintDecToBin{\itmp}}% - \draw (B\ArBinN-\i) node[BernNotice] {$\longrightarrow X=\StrCount{\ArBenTmpBin}{1}$} ; + \draw (B\ArBinN-\i) node[BernNotice] {$\longrightarrow \ArBinVar=\StrCount{\ArBenTmpBin}{1}$} ; }% }% {}% @@ -227,7 +268,7 @@ \setKVdefault[BernoulliTree]{% LevelSep=2.25,% NodeSep=1,% - Events={$S$/$E$},% + Events={$S$/$F$},% Probs={$p$/$1-p$},% Grid=false,% ShowProbs=true,% @@ -238,6 +279,45 @@ N=3 } +\NewDocumentCommand\tkzBernoulliTrial{ s O{} D<>{} }{% + \useKVdefault[BernoulliTree]% + \setKV[BernoulliTree]{#2}% + \saveexpandmode\expandarg + \StrCut{\ArBinEvts}{/}{\ArBinSucces}{\ArBinEchec}% + \StrCut{\ArBinProbas}{/}{\ArBinProbSucces}{\ArBinProbEchec}% + \restoreexpandmode + \IfBooleanT{#1}% + {% + \begin{tikzpicture}[#3] + }% + \IfStrEq{\ArBinRacine}{false}% + {% + \coordinate (A0-1) at (0,0) ;% + \coordinate (B0-1) at (0,0) ;% + }% + {% + \coordinate (A0-1) at (0,0) ;% + \node[BernRoot] (B0-1) at (A0-1) {\ArBinRacine} ;% + }% + \coordinate (A1-1) at ($(A0-1)+({\ArBinIN},{0.5*\ArBinIF})$) ; + \coordinate (A1-2) at ($(A0-1)+({\ArBinIN},{-0.5*\ArBinIF})$) ; + \node[BernNodeS] (B1-1) at (A1-1) {\ArBinSucces} ;%succès + \node[BernNodeF] (B1-2) at (A1-2) {\ArBinEchec} ;%échec + \ifboolKV[BernoulliTree]{ShowProbs}% + {% + \draw[BernEdge] (B0-1) -- (B1-1) node[BernProbS] {\ArBinProbSucces} ; + \draw[BernEdge] (B0-1) -- (B1-2) node[BernProbF] {\ArBinProbEchec} ; + }% + {% + \draw[BernEdge] (B0-1) -- (B1-1) ; + \draw[BernEdge] (B0-1) -- (B1-2) ; + }% + \IfBooleanT{#1}% + {% + \end{tikzpicture}% + }% +} + \NewDocumentCommand\tkzBernoulliTree{ s O{} D<>{} }{% \useKVdefault[BernoulliTree]% \setKV[BernoulliTree]{#2}% @@ -259,6 +339,7 @@ %Racine \IfStrEq{\ArBinRacine}{false}% {% + \coordinate (A0-1) at (0,0) ;% \coordinate (B0-1) at (0,0) ;% }% {% @@ -267,7 +348,7 @@ }% %Aide Racine \ifboolKV[BernoulliTree]{Help}% - {\draw[teal] (B0-1) node[below=4pt,font=\tiny\ttfamily] {A00} ;}% + {\draw[teal] (B0-1) node[below=4pt,font=\tiny\ttfamily] {B0-1} ;}% {}% %générations des nœuds du premier chemin \foreach \i in {1,...,\ArBinN}{% @@ -315,7 +396,7 @@ \foreach \i in {1,...,\fpeval{2**\ArBinN}}{% \def\itmp{\fpeval{2**\ArBinN-\i}}% \def\ArBenTmpBin{\xintDecToBin{\itmp}}% - \draw (B\ArBinN-\i) node[BernGuide] {$\longrightarrow X=\StrCount{\ArBenTmpBin}{1}$} ; + \draw (B\ArBinN-\i) node[BernGuide] {$\longrightarrow \ArBinVar=\StrCount{\ArBenTmpBin}{1}$} ; }% }% {}% |