diff options
Diffstat (limited to 'Master')
18 files changed, 1266 insertions, 214 deletions
diff --git a/Master/texmf-dist/doc/latex/circuitikz/CHANGELOG b/Master/texmf-dist/doc/latex/circuitikz/CHANGELOG index 89e1fc2f755..2e088f2bb79 100644 --- a/Master/texmf-dist/doc/latex/circuitikz/CHANGELOG +++ b/Master/texmf-dist/doc/latex/circuitikz/CHANGELOG @@ -1,5 +1,18 @@ CircuiTikz - Changelog +* Version 0.2.4 + - added square voltage source (contributed by Alistair Kwan) + - added buffer and plain amplifier (contributed by Danilo Piazzalunga) + - added squid and barrier (contributed by Cor Molenaar) + - added antenna and transmission line symbols contributed by Leonardo Azzinnari + - added the changeover switch spdt (suggestion of Fabio Maria Antoniali) + - rename of context.tex and context.pdf (thanks to Karl Berry) + - updated the email address + - in documentation, fixed wrong (non-standard) labelling of the axis in an example (thanks to prof. Claudio Beccaria) + - fixed scaling inconsistencies in quadrupoles + - fixed division by zero error on certain vertical paths + - introduced options straighlabels, rotatelabels, smartlabels + * Version 0.2.3 - fixed compatibility problem with label option from tikz - Fixed resizing problem for shape ground diff --git a/Master/texmf-dist/doc/latex/circuitikz/README b/Master/texmf-dist/doc/latex/circuitikz/README index 8dfab0ddae4..91d47e08612 100644 --- a/Master/texmf-dist/doc/latex/circuitikz/README +++ b/Master/texmf-dist/doc/latex/circuitikz/README @@ -1,4 +1,4 @@ -This is CircuiTikz, version 0.2.3. +This is CircuiTikz, version 0.2.4. This package provides a set of macros for naturally typesetting electrical and (somewhat less naturally, perhaps) electronical networks. @@ -31,7 +31,7 @@ mredaelli@elet.polimi.it ------------- -Copyright 2007-9 by Massimo Redaelli +Copyright 2007-11 by Massimo Redaelli This file may be distributed and/or modified diff --git a/Master/texmf-dist/doc/latex/circuitikz/circuitikz-context.pdf b/Master/texmf-dist/doc/latex/circuitikz/circuitikz-context.pdf Binary files differnew file mode 100644 index 00000000000..cb8662d2979 --- /dev/null +++ b/Master/texmf-dist/doc/latex/circuitikz/circuitikz-context.pdf diff --git a/Master/texmf-dist/doc/latex/circuitikz/context.tex b/Master/texmf-dist/doc/latex/circuitikz/circuitikz-context.tex index 13f3ade1cde..13f3ade1cde 100644 --- a/Master/texmf-dist/doc/latex/circuitikz/context.tex +++ b/Master/texmf-dist/doc/latex/circuitikz/circuitikz-context.tex diff --git a/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.pdf b/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.pdf Binary files differindex 51eaa7711eb..517b5b62621 100644 --- a/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.pdf +++ b/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.pdf diff --git a/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.tex b/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.tex index d00398a98eb..9cd6691e57c 100644 --- a/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.tex +++ b/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.tex @@ -1,6 +1,16 @@ \documentclass[a4paper]{article} -\usepackage{xltxtra} + +\usepackage{fontspec} +\defaultfontfeatures{Ligatures=TeX, Numbers=OldStyle, SmallCapsFeatures={LetterSpace=8, Numbers=OldStyle}} + +\setmainfont +% {Linux Libertine} + {Gentium Book Basic} + +\usepackage{microtype} + \usepackage[siunitx]{circuitikz} +\sisetup{load=derived} % loading \siemens \usepackage{showexpl} \usepackage{framed} \usepackage{hyperref} @@ -16,15 +26,14 @@ filecolor=black, % color of file links urlcolor=black % color of external links } +\usepackage{imakeidx} +\makeindex[title=Index of the components, intoc=true] -%\usepackage{xeindex} - -%\IndexList{mylist}{resistor, } - -\def\circuititem#1#2#3{\item {#2} (\texttt{#1}) \par \begin{center}\begin{circuitikz} \draw (0,0) node[#1] {}; \end{circuitikz} \end{center} +\def\circuititem#1#2#3{\item {#2} (\texttt{#1}) \index{#1} \par \begin{center}\begin{circuitikz} \draw (0,0) node[#1] {}; \end{circuitikz} \end{center} \par} -\newcommand{\circuititembip}[3]{\item {#2} (\texttt{#1}% +\newcommand{\circuititembip}[3]{\item {#2} \index{#1} +\tikz\foreach \i in {#3} {\index{\i|see{#1}} }; (\texttt{#1}% \ifthenelse{\equal{#3}{}}{% }{% , or \texttt{#3}% @@ -53,7 +62,7 @@ \tableofcontents \section{Introduction} -After two years of little exposure only on my personal website\footnote{\url{http://home.dei.polimi.it/mredaelli}.}, I did a major rehauling of the code of Circui\TikZ, fixing several problems and converting everything to \TikZ\ version $2.0$. +After two years of little exposure only on my personal website\footnote{\url{http://home.dei.polimi.it/mredaelli}, now deceased. You might want to check \url{http://www.redaelli.name}.}, I did a major rehauling of the code of Circui\TikZ, fixing several problems and converting everything to \TikZ\ version $2.0$. I'm not too sure about the result, because my (La)\TeX\ skills are much to be improved, but it seems it's time for more user feedback. So, here it is\ldots @@ -74,13 +83,13 @@ So I based everything with the very impressive (if somewhat verbose at times) \T \TikZ\ will be automatically loaded. \subsection{License} -Copyright \copyright\ 2007--2009 Massimo Redaelli. This package is author-maintained. +Copyright \copyright\ 2007--2011 Massimo Redaelli. This package is author-maintained. Permission is granted to copy, distribute and/or modify this software under the terms of the \LaTeX Project Public License, version 1.3.1, or the GNU Public License. This software is provided ‘as is’, without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. \subsection{Feedback} -Much appreciated: \href{mailto:mredaelli@elet.polimi.it}{\texttt{mredaelli@elet.polimi.it}}. Although I don't guarantee quick answers. +Much appreciated: \href{mailto:massimo@redaelli.name}{\texttt{massimo@redaelli.name}}. Although I don't guarantee quick answers. \subsection{Requirements} \begin{itemize} @@ -165,7 +174,10 @@ As far as I know, this is a bug in \TikZ, and I notified the author, but until h \item \texttt{fulldiodes}: the various diodes are drawn \emph{and} filled by default, i.e. when using styles such as \texttt{diode}, \texttt{D}, \texttt{sD}, \ldots Un-filled diode can always be forced with \texttt{Do}, \texttt{sDo}, \ldots \item \texttt{emptydiodes}: the various diodes are drawn \emph{but not} filled by default, i.e. when using styles such as \texttt{diode}, \texttt{D}, \texttt{sD}, \ldots Filled diode can always be forced with \texttt{D*}, \texttt{sD*}, \ldots \item \texttt{arrowmos}: pmos and nmos have arrows analogous to those of pnp and npn transistors; - \item \texttt{noarrowmos}: pmos and nmos do not have arrows analogous to those of pnp and npn transistors. + \item \texttt{noarrowmos}: pmos and nmos do not have arrows analogous to those of pnp and npn transistors; + \item \texttt{straighlabels}: labels on bipoles are always printed straigh up, i.e.~with horizontal baseline; + \item \texttt{rotatelabels}: labels on bipoles are always printed aligned along the bipole; + \item \texttt{smartlabels}: labels on bipoles are rotated along the bipoles, unless the rotation is very close to multiples of 90°. \end{itemize} The old options in the singular (like \texttt{american voltage}) are still available for compatibility, but are discouraged. @@ -173,7 +185,7 @@ The old options in the singular (like \texttt{american voltage}) are still avail \medskip Loading the package with no options is equivalent to my own personal liking, that is to the following options:\\ - \texttt{[europeancurrents, europeanvoltages, americanresistors, cuteinductors, americanports, nosiunitx, noarrowmos]}. + \texttt{[europeancurrents, europeanvoltages, americanresistors, cuteinductors, americanports, nosiunitx, noarrowmos, smartlabels]}. \medskip @@ -205,6 +217,10 @@ Please notice that for user convenience transistors can also be inputted using t \subsection{Monopoles} \begin{itemize} \circuititem{ground}{Ground}{} + \circuititem{antenna}{Antenna}{} + \circuititem{rxantenna}{Transmitting antenna}{} + \circuititem{txantenna}{Receiving antenna}{} + \circuititem{tlinestub}{Transmission line stub}{} \end{itemize} @@ -288,6 +304,11 @@ Similarly, if (default behaviour) \texttt{europeanvoltages} option is active (or The options \texttt{fulldiodes} and \texttt{emptydiodes} (and the styles \texttt{[full diodes]} and \texttt{[empty diodes]}) define which shape will be used by abbreviated commands such that \texttt{D}, \texttt{sD}, \texttt{zD}, \texttt{tD}, \texttt{pD}, \texttt{leD}, and \texttt{VC}. \end{framed} +\begin{itemize} + \circuititembip{squid}{Squid}{} + \circuititembip{barrier}{Barrier}{} +\end{itemize} + \subsubsection{Basic dynamical bipoles} \begin{itemize} \circuititembip{capacitor}{Capacitor}{C} @@ -316,6 +337,10 @@ Finally, if \texttt{europeaninductors} option is active (or the style \texttt{[e \circuititembip{vL}{Variable inductor}{variable european inductor} \end{itemize} +There is also a transmission line: +\begin{itemize} +\circuititembip{TL}{Transmission line}{transmission line, tline} +\end{itemize} \subsubsection{Sinusoidal sources} Here because I was asked for them. But how do you distinguish one from the other?! \begin{itemize} @@ -323,6 +348,10 @@ Finally, if \texttt{europeaninductors} option is active (or the style \texttt{[e \circuititembip{sinusoidal current source}{Sinusoidal current source}{isourcesin, sI} \end{itemize} +\subsubsection{Square sources} +\begin{itemize} + \circuititembip{square voltage source}{Square voltage source}{vsourcesquare, sqV} +\end{itemize} %\begin{framed} %The options \texttt{europeancurrent} [resp. \texttt{europeanvoltage}] (the default) and \texttt{americancurrent} [resp. \texttt{americanvoltage}] define which sinusoidal current [resp. voltage] source is selected by default when the abbreviated styles \texttt{sinusoidal current source}, \texttt{csourcesin}, \texttt{cI} [resp. \texttt{sinusoidal voltage source}, \texttt{vsourcesin}, \texttt{cV}] are used. @@ -394,6 +423,11 @@ Borsche: \circuititem{pjfet}{\scshape pjfet}{} \end{itemize} +\subsubsection{Changeover switch} +\begin{itemize} +\circuititem{spdt}{\scshape spdt}{} +\end{itemize} + \subsubsection{Other bipole-like tripoles}\label{sec:othertrip} The following tripoles are entered with the usual command of the form \begin{itemize} \circuititembip{triac}{triac}{Tr} @@ -458,9 +492,11 @@ If (default behaviour) \texttt{americanports} option is active (or the style \te If otherwise \texttt{europeanports} option is active (or the style \texttt{[european ports]} is used), the shorthands \texttt{and port}, \texttt{or port}, \texttt{not port}, \texttt{nand port}, \texttt{not port}, \texttt{xor port}, and \texttt{xnor port} are equivalent to the european version of the respective logic port. \end{framed} -\subsection{Operational Amplifier} +\subsection{Amplifiers} \begin{itemize} \circuititem{op amp}{Operational amplifier}{} + \circuititem{plain amp}{Plain amplifier}{} + \circuititem{buffer}{Buffer}{} \end{itemize} \subsection{Support shapes} @@ -534,8 +570,34 @@ Long names/styles for the bipoles can be used: \end{circuitikz} \end{LTXexample} - - +\noindent The default orientation of labels is controlled by the options \texttt{smartlabels}, \texttt{rotatelabels} and \texttt{straightlabels} (or the corresponding \texttt{label/align} keys). Here are examples to see the differences: +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} +\ctikzset{label/align = straight} +\def\DIR{0,45,90,135,180,-90,-45,-135} +\foreach \i in \DIR { + \draw (0,0) to[R=\i, *-o] (\i:2.5); +} +\end{circuitikz} +\end{LTXexample} +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} +\ctikzset{label/align = rotate} +\def\DIR{0,45,90,135,180,-90,-45,-135} +\foreach \i in \DIR { + \draw (0,0) to[R=\i, *-o] (\i:2.5); +} +\end{circuitikz} +\end{LTXexample} +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} +\ctikzset{label/align = smart} +\def\DIR{0,45,90,135,180,-90,-45,-135} +\foreach \i in \DIR { + \draw (0,0) to[R=\i, *-o] (\i:2.5); +} +\end{circuitikz} +\end{LTXexample} \subsection{Currents} @@ -1226,7 +1288,7 @@ can be interpreted as the length of a resistor (including reasonable connections to[short, o-*] (1,0) to[R=20<\ohm>, *-*] (1,2) to[R=10<\ohm>, v=$v_x$] (3,2) -- (4,2) - to[cI=$\frac{\siemens}{5} v_x$, *-*] (4,0) -- (3,0) + to[cI=$\frac{\si{\siemens}}{5} v_x$, *-*] (4,0) -- (3,0) to[R=5<\ohm>, *-*] (3,2) (3,0) -- (1,0) (1,2) to[short, -o] (0,2) node[anchor=east]{A} @@ -1332,7 +1394,7 @@ And yes: this is a bug and \emph{not} a feature\ldots \begin{circuitikz}[scale=1.2]\draw (0,0) node[ground] {} to[V=$e(t)$, *-*] (0,2) to[C=4<\nano\farad>] (2,2) - to[R, l_=1/4<\kilo\ohm>, *-*] (2,0) + to[R, l_=.25<\kilo\ohm>, *-*] (2,0) (2,2) to[R=1<\kilo\ohm>] (4,2) to[C, l_=2<\nano\farad>, *-*] (4,0) (5,0) to[I, i_=$a(t)$, -*] (5,2) -- (4,2) @@ -1369,8 +1431,8 @@ And yes: this is a bug and \emph{not} a feature\ldots to [R, l=1<\kilo\ohm>] (4,-1.5); \begin{scope}[xshift=6.5cm, yshift=.5cm] - \draw [->] (-2,0) -- (2.5,0) node[anchor=west] {$v_1 [\volt]$}; - \draw [->] (0,-2) -- (0,2) node[anchor=west] {$i_1 [\SI{}{\milli\ampere}]$} ; + \draw [->] (-2,0) -- (2.5,0) node[anchor=west] {$v_1/\volt$}; + \draw [->] (0,-2) -- (0,2) node[anchor=west] {$i_1/\SI{}{\milli\ampere}$} ; \draw (-1,0) node[anchor=north] {-2} (1,0) node[anchor=south] {2} (0,1) node[anchor=west] {4} (0,-1) node[anchor=east] {-4} (2,0) node[anchor=north west] {4} @@ -1385,6 +1447,20 @@ And yes: this is a bug and \emph{not} a feature\ldots \section{Revision history} \begin{itemize} +\item[\itshape version 0.2.4] (20110911). + \begin{enumerate} + \item added square voltage source (contributed by Alistair Kwan) + \item added buffer and plain amplifier (contributed by Danilo Piazzalunga) + \item added squid and barrier (contributed by Cor Molenaar) + \item added antenna and transmission line symbols contributed by Leonardo Azzinnari + \item added the changeover switch spdt (suggestion of Fabio Maria Antoniali) + \item rename of context.tex and context.pdf (thanks to Karl Berry) + \item updated the email address + \item in documentation, fixed wrong (non-standard) labelling of the axis in an example (thanks to prof. Claudio Beccaria) + \item fixed scaling inconsistencies in quadrupoles + \item fixed division by zero error on certain vertical paths + \item introduced options straighlabels, rotatelabels, smartlabels + \end{enumerate} \item[\itshape version 0.2.3] (20091118). \begin{enumerate} \item fixed compatibility problem with label option from tikz @@ -1438,6 +1514,8 @@ Borsche) \end{itemize} +\printindex + \end{document} diff --git a/Master/texmf-dist/doc/latex/circuitikz/context.pdf b/Master/texmf-dist/doc/latex/circuitikz/context.pdf Binary files differdeleted file mode 100644 index ec6b653d1bd..00000000000 --- a/Master/texmf-dist/doc/latex/circuitikz/context.pdf +++ /dev/null diff --git a/Master/texmf-dist/tex/latex/circuitikz/circuitikz.code.tex b/Master/texmf-dist/tex/latex/circuitikz/circuitikz.code.tex index d229aa280ff..5a33b71a775 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/circuitikz.code.tex +++ b/Master/texmf-dist/tex/latex/circuitikz/circuitikz.code.tex @@ -24,8 +24,20 @@ \ctikzset{nodes width/.initial=.04} \newdimen\pgf@circ@Rlen \ctikzset{bipoles/length/.code={\pgf@circ@Rlen = #1}} + \ctikzset{monopoles/.is family} \ctikzset{monopoles/ground/width/.initial=.25} +\ctikzset{monopoles/tlinestub/width/.initial=.25} +\ctikzset{monopoles/antenna/width/.initial=.25} +\ctikzset{monopoles/antenna/label/xanchor/.initial=.4} +\ctikzset{monopoles/antenna/label/yanchor/.initial=.75} +\ctikzset{monopoles/txantenna/label/xanchor/.initial=.4} +\ctikzset{monopoles/txantenna/label/yanchor/.initial=.75} +\ctikzset{monopoles/txantenna/width/.initial=.25} +\ctikzset{monopoles/rxantenna/label/xanchor/.initial=.4} +\ctikzset{monopoles/rxantenna/label/yanchor/.initial=.75} +\ctikzset{monopoles/rxantenna/width/.initial=.25} + \ctikzset{bipoles/resistor/height/.initial=.3} \ctikzset{bipoles/resistor/width/.initial=.8} \ctikzset{bipoles/potentiometer/height/.initial=.8} @@ -61,6 +73,8 @@ \ctikzset{bipoles/isourcesin/width/.initial=.60} \ctikzset{bipoles/vsourcesin/height/.initial=.60} \ctikzset{bipoles/vsourcesin/width/.initial=.60} +\ctikzset{bipoles/vsourcesquare/height/.initial=.60} +\ctikzset{bipoles/vsourcesquare/width/.initial=.60} \ctikzset{bipoles/cisource/height/.initial=.7} \ctikzset{bipoles/cisource/width/.initial=.7} \ctikzset{bipoles/cisourceam/height/.initial=.7} @@ -113,11 +127,19 @@ \ctikzset{bipoles/ammeter/width/.initial=.60} \ctikzset{bipoles/voltmeter/height/.initial=.60} \ctikzset{bipoles/voltmeter/width/.initial=.60} +\ctikzset{bipoles/buffer/height/.initial=1} +\ctikzset{bipoles/buffer/width/.initial=1} \ctikzset{bipoles/not port/width/.initial=1} \ctikzset{bipoles/not port/height/.initial=.8} \ctikzset{bipoles/not port/circle width/.initial=.15} \ctikzset{bipoles/lamp/height/.initial=.60} \ctikzset{bipoles/lamp/width/.initial=.60} +\ctikzset{bipoles/tline/height/.initial=.3} +\ctikzset{bipoles/tline/width/.initial=.8} +\ctikzset{bipoles/squid/height/.initial=.60} +\ctikzset{bipoles/squid/width/.initial=.60} +\ctikzset{bipoles/barrier/height/.initial=.60} +\ctikzset{bipoles/barrier/width/.initial=.60} \newif\ifpgf@circuit@mos@arrows \ctikzset{tripoles/mos style/.is choice} @@ -320,6 +342,11 @@ \ctikzset{tripoles/op amp/height/.initial=1.4} \ctikzset{tripoles/op amp/input height/.initial=.5} \ctikzset{tripoles/op amp/up pos/.initial=.45} +\ctikzset{tripoles/plain amp/width/.initial=1.7} +\ctikzset{tripoles/plain amp/port width/.initial=.7} +\ctikzset{tripoles/plain amp/height/.initial=1.4} +\ctikzset{tripoles/plain amp/input height/.initial=.5} +\ctikzset{tripoles/plain amp/up pos/.initial=.45} \ctikzset{tripoles/thyristor/height/.initial=1.10} \ctikzset{tripoles/thyristor/height 2/.initial=.5} @@ -333,8 +360,18 @@ \ctikzset{tripoles/triac/diode width left/.initial=.3} \ctikzset{tripoles/triac/diode width right/.initial=.3} +\ctikzset{tripoles/spdt/width/.initial=.85} +\ctikzset{tripoles/spdt/height/.initial=.45} +\ctikzset{tripoles/spdt/margin/.initial=.45} + +\ctikzset{tripoles/mixer/height/.initial=.85} +\ctikzset{tripoles/mixer/width/.initial=.85} +\ctikzset{tripoles/mixer/margin/.initial=.75} + \ctikzset{quadpoles/transformer/width/.initial=1.5} +\ctikzset{quadpoles/transformer/width1/.initial=.4} \ctikzset{quadpoles/transformer/height/.initial=1.5} +\ctikzset{quadpoles/transformer/height1/.initial=.8} \ctikzset{quadpoles/transformer core/width/.initial=1.5} \ctikzset{quadpoles/transformer core/height/.initial=1.5} \ctikzset{quadpoles/transformer core/core height/.initial=.5} @@ -342,6 +379,8 @@ \ctikzset{quadpoles/gyrator/width/.initial=1.5} \ctikzset{quadpoles/gyrator/height/.initial=1.5} + + \ctikzset{bipole/.is family} \ctikzset{bipole/direction/.initial = 0} \ctikzset{bipole/kind/.initial = } @@ -387,9 +426,6 @@ \ctikzset{bipole/label/position/.initial=90} \ctikzset{bipole/label/unit/.initial=} \ctikzset{bipole/label/name/.initial=} - - - \ctikzset{bipole/nodes/.is family} \ctikzset{bipole/nodes/left/.is choice} \ctikzset{bipole/nodes/left/none/.code={\ctikzsetvalof{bipole/nodes/left}{none}}} @@ -464,6 +500,10 @@ \ctikzset{current/american/.code = \pgf@circuit@europeancurrentfalse } \ctikzset{current/european/.code = \pgf@circuit@europeancurrenttrue } +\ctikzset{label/align/.is choice} +\ctikzset{label/align/straight/.code={\ctikzsetvalof{label/align}{straight}}} +\ctikzset{label/align/rotate/.code={\ctikzsetvalof{label/align}{rotate}}} +\ctikzset{label/align/smart/.code={\ctikzsetvalof{label/align}{smart}}} %% dependencies diff --git a/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty b/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty index 7d17188cf48..2d201ce2a5b 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty +++ b/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty @@ -17,7 +17,7 @@ \NeedsTeXFormat{LaTeX2e} -\def\pgfcircversion{0.2.3} +\def\pgfcircversion{0.2.4} \ProvidesPackage{circuitikz}% [2009/11/18 The CircuiTikz circuit drawing package version \pgfcircversion] @@ -110,6 +110,19 @@ \pgf@circuit@mos@arrowsfalse } +\DeclareOption{straightlabels}{ + \ctikzset{label/align = straight} +} + +\DeclareOption{rotatelabels}{ + \ctikzset{label/align = rotate} +} + +\DeclareOption{smartlabels}{ + \ctikzset{label/align = smart} +} + + %%%%%%%%% Compatibility @@ -169,6 +182,9 @@ \ctikzset{logic ports = european} } +\DeclareOption{europeanport}{ + \ctikzset{logic ports = european} +} %%%%%%%%% @@ -177,7 +193,7 @@ \input circuitikz.code.tex -\ExecuteOptions{europeancurrents,europeanvoltages,americanports,americanresistors,cuteinductors,nosiunitx,noarrowmos} +\ExecuteOptions{europeancurrents,europeanvoltages,americanports,americanresistors,cuteinductors,nosiunitx,noarrowmos,smartlabels} \ProcessOptions\relax @@ -194,8 +210,3 @@ \endinput -* Da fare - -Uniformare il path dei bipoli e dei transistor -Perché non ribalda gli induttori? -Uniformare i casi dell'induttore tra il path del bipolo e la scelta del nodo nel trasformatore diff --git a/Master/texmf-dist/tex/latex/circuitikz/circuitikz1.code.tex b/Master/texmf-dist/tex/latex/circuitikz/circuitikz1.code.tex index 5df83a52d05..746d83ebe3b 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/circuitikz1.code.tex +++ b/Master/texmf-dist/tex/latex/circuitikz/circuitikz1.code.tex @@ -34,7 +34,9 @@ bipole/voltage/direction=backward, bipole/voltage/label/name=, bipole/voltage/position=below, bipole/nodes/left=none, bipole/nodes/right=none, bipole/is voltage=false, bipole/is current=false, bipole/current/label/name=, bipole/current/x position=after, - bipole/current/y position=above, bipole/current/direction=forward, mirrored=false } + bipole/current/y position=above, bipole/current/direction=forward, + mirrored=false + } } @@ -74,8 +76,7 @@ (\ctikzvalof{bipole/name}start.center) -- (\ctikzvalof{bipole/name}.left) (\ctikzvalof{bipole/name}.right) -- (\ctikzvalof{bipole/name}end.center) \fi - \pgf@circ@ifkeyempty{bipole/label/name}\else - \pgf@circ@drawlabel\fi + \pgf@circ@ifkeyempty{bipole/label/name}\else\pgf@circ@drawlabel\fi \drawpoles \pgf@circ@ifkeyempty{bipole/voltage/label/name}\else\pgf@circ@drawvoltage\fi \pgf@circ@ifkeyempty{bipole/current/label/name}\else\pgf@circ@drawcurrent\fi @@ -140,6 +141,7 @@ \def\pgf@circ@vsourcesin@path#1{\pgf@circ@bipole@path{vsourcesin}{#1}} \def\pgf@circ@isource@path#1{\pgf@circ@bipole@path{isource}{#1}} \def\pgf@circ@isourcesin@path#1{\pgf@circ@bipole@path{isourcesin}{#1}} +\def\pgf@circ@vsourcesquare@path#1{\pgf@circ@bipole@path{vsourcesquare}{#1}} \def\pgf@circ@isourceam@path#1{\pgf@circ@bipole@path{isourceAM}{#1}} \def\pgf@circ@cvsource@path#1{\pgf@circ@bipole@path{cvsource}{#1}} \def\pgf@circ@cvsourceam@path#1{\pgf@circ@bipole@path{cvsourceAM}{#1}} @@ -176,7 +178,9 @@ \def\pgf@circ@thyristor@path#1{\pgf@circ@bipole@path{thyristor}{#1}} \def\pgf@circ@memristor@path#1{\pgf@circ@bipole@path{memristor}{#1}} \def\pgf@circ@triac@path#1{\pgf@circ@bipole@path{triac}{#1}} - +\def\pgf@circ@tline@path#1{\pgf@circ@bipole@path{tline}{#1}} +\def\pgf@circ@squid@path#1{\pgf@circ@bipole@path{squid}{#1}} +\def\pgf@circ@barrier@path#1{\pgf@circ@bipole@path{barrier}{#1}} %% Styles %% Aggiungere per thyristor e tripoli semplici @@ -209,6 +213,9 @@ \tikzset{variable european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@veuropeaninductor@path, l=#1}} \tikzset{variable american inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vamericaninductor@path, l=#1}} \tikzset{variable cute inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcuteinductor@path, l=#1}} +\tikzset{tline/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tline@path, l=#1}} +\tikzset{transmission line/.style = {tline = #1}} +\tikzset{TL/.style = {tline = #1}} \tikzset{european voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsource@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} \tikzset{american voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} \tikzset{european current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isource@path, \circuitikzbasekey/bipole/is current=true, i=#1}} @@ -218,6 +225,7 @@ \tikzset{european controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisource@path, \circuitikzbasekey/bipole/is current=true, i=#1}} \tikzset{american controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}} \tikzset{sinusoidal voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcesin@path, \circuitikzbasekey/bipole/is voltage=true, v=#1 }} +\tikzset{square voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcesquare@path, \circuitikzbasekey/bipole/is voltage=true, v=#1 }} \tikzset{sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}} \tikzset{controlled sinusoidal voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsourcesin@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} \tikzset{controlled sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}} @@ -238,6 +246,11 @@ \tikzset{lamp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@lamp@path}} +\tikzset{squid/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@squid@path}} +\tikzset{barrier/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@barrier@path}} + + + \tikzset{full diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulldiode@path}} \tikzset{full Schottky diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullsdiode@path}} \tikzset{full Zener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullzdiode@path}} @@ -276,8 +289,9 @@ \tikzset{vsource/.style = {voltage source = #1}} \tikzset{isource/.style = {current source = #1}} \tikzset{cisource/.style = {controlled current source = #1}} -\tikzset{cvsource/.style = {controlled voltage source = #1}} -\tikzset{vsourcesin/.style = {sinusoidal voltage source = #1}} +\tikzset{cvsource/.style = {controlled voltage source = #1}} +\tikzset{vsourcesin/.style = {sinusoidal voltage source = #1}} +\tikzset{vsourcesquare/.style = {square voltage source = #1}} \tikzset{isourcesin/.style = {sinusoidal current source = #1}} \tikzset{cisourcesin/.style = {controlled sinusoidal current source = #1}} \tikzset{cvsourcesin/.style = {controlled sinusoidal voltage source = #1}} @@ -298,6 +312,7 @@ \tikzset{V/.style = {voltage source = #1}} \tikzset{cV/.style = {controlled voltage source = #1}} \tikzset{sV/.style = {sinusoidal voltage source = #1}} +\tikzset{sqV/.style = {square voltage source = #1}} \tikzset{csV/.style = {controlled sinusoidal voltage source = #1}} \def\pgf@temp#1{ \tikzset{V#1/.style = {voltage source, v#1=##1} } diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcircbipoles.sty b/Master/texmf-dist/tex/latex/circuitikz/pgfcircbipoles.sty index 96cd4ca2551..340b78f14a2 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcircbipoles.sty +++ b/Master/texmf-dist/tex/latex/circuitikz/pgfcircbipoles.sty @@ -395,6 +395,29 @@ } + + +% contributed by Alistair Kwan +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsourcesquare/height}}{vsourcesquare}{\ctikzvalof{bipoles/vsourcesquare/height}}{\ctikzvalof{bipoles/vsourcesquare/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} + \pgfusepath{draw} + + \pgf@circ@res@up = .5\pgf@circ@res@up + \pgfscope + \pgftransformrotate{90} + \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}} + \pgfpathlineto{\pgfpoint{-1\pgf@circ@res@up}{1\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0\pgf@circ@res@up}{1\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0\pgf@circ@res@up}{-1\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{-1\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{0\pgf@circ@res@up}} + \pgfusepath{draw} + \endpgfscope +} + + %% Independent current source \pgfcircdeclarebipole{}{\ctikzvalof{bipoles/isource/height}}{isource}{\ctikzvalof{bipoles/isource/height}}{\ctikzvalof{bipoles/isource/width}}{ @@ -1320,6 +1343,245 @@ \pgfusepath{draw} } +% Contributed by Leonardo Azzinnari + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/tline/height} + }{tline}{\ctikzvalof{bipoles/tline/height} + }{\ctikzvalof{bipoles/tline/width} + }{\pgf@circ@res@step=\ctikzvalof{bipoles/tline/width} \pgf@circ@Rlen + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathellipse{\pgfpoint{0.5\pgf@circ@res@step}{0\pgf@circ@res@step} + }{\pgfpoint{0.125\pgf@circ@res@step}{0\pgf@circ@res@step} + }{\pgfpoint{0\pgf@circ@res@step}{0.25\pgf@circ@res@step}} + \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@step+0.125\pgf@circ@res@step}{0.25\pgf@circ@res@step}} + \pgfpatharc{-90}{90}{-0.125\pgf@circ@res@step and -0.25\pgf@circ@res@step} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-0.25\pgf@circ@res@step}} + \pgfusepath{draw} + } + + + + +%% SQUID added by Cor Molenaar 5 March 2010 + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/squid/height}}{squid}{\ctikzvalof{bipoles/squid/height}}{\ctikzvalof{bipoles/squid/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} + \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{1.35*\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.65*\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.65*\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{1.35*\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{1.35*\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.65*\pgf@circ@res@down}} + \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.65*\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{1.35*\pgf@circ@res@down}} + + \pgfusepath{draw} +} + + + +% Generic barrier added by Cor Molenaar 5 March 2010 + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/barrier/height}}{barrier}{\ctikzvalof{bipoles/barrier/height}}{\ctikzvalof{bipoles/barrier/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@step}} + \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.35*\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.35*\pgf@circ@res@down}} + \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.35*\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.35*\pgf@circ@res@up}} + + \pgfusepath{draw} +} + + +% Contributed by Danilo Piazzalunga + +\pgfdeclareshape{buffer} + { + \anchor{center}{\pgfpointorigin} + \savedanchor\northwest{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/buffer/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/buffer/width}\pgf@x + \pgf@x=.5\pgf@x + } + \anchor{south}{ + \northwest + \pgf@y=-\pgf@y + } + \savedanchor\left{% + \pgf@y=0pt + } + \anchor{in}{ + \northwest + \pgf@y=0pt + } + \anchor{out}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + + \backgroundpath{ + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + + + \northwest + \pgf@circ@res@up = \pgf@y + \pgf@circ@res@down = -\pgf@y + \pgf@circ@res@right = -\pgf@x + \pgf@circ@res@left = \pgf@x + + \pgfscope + \pgfsetlinewidth{2\pgflinewidth} + \pgftransformxshift{.7\pgf@circ@res@left} + \pgf@circ@res@step=\pgf@circ@res@right + \advance\pgf@circ@res@step by -\pgf@circ@res@left + \pgf@circ@res@step=.7\pgf@circ@res@step + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}} + \pgfusepath{draw} + \endpgfscope + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} + \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}} + + \pgfusepath{draw} + + } + } + + + +\pgfdeclareshape{plain amp} + { + \anchor{center}{\pgfpointorigin} + \savedanchor\northwest{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/width}\pgf@x + \pgf@x=.5\pgf@x + } + \anchor{south}{ + \northwest + \pgf@y=-\pgf@y + } + \savedanchor\left{% + \pgf@y=0pt + } + \savedanchor\inOne{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/width}\pgf@x + \pgf@x=.5\pgf@x + } + \anchor{-}{ + \inOne + } + \anchor{+}{ + \inOne + \pgf@y=-\pgf@y + } + \savedanchor\up{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/width}\pgf@x + \pgf@x=.5\pgf@x + \pgf@circ@res@up = \pgf@y + \pgf@circ@res@right = -\pgf@x + \pgf@circ@res@left = \pgf@x + \pgfpointlineattime{ + \pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/up pos}}{ + \pgfpoint{ + \pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/port width}\pgf@circ@res@left} + {\pgf@circ@res@up}} + {\pgfpoint{.7\pgf@circ@res@right}{0pt}} + } + \anchor{up}{ + \up + } + \anchor{down}{ + \up + \pgf@y=-\pgf@y + } + \anchor{out}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + + \backgroundpath{ + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + + + \northwest + \pgf@circ@res@up = \pgf@y + \pgf@circ@res@down = -\pgf@y + \pgf@circ@res@right = -\pgf@x + \pgf@circ@res@left = \pgf@x + + \pgfpathmoveto{\pgfpoint + {\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/port width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@up}} + + + \pgfpathmoveto{\pgfpoint + {\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/port width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@down}} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} + \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}} + + \pgfusepath{draw} + + + \pgfscope + \pgfsetlinewidth{2\pgflinewidth} + \pgftransformxshift{.7\pgf@circ@res@left} + \pgf@circ@res@step=\pgf@circ@res@right + \advance\pgf@circ@res@step by -\pgf@circ@res@left + \pgf@circ@res@step=.7\pgf@circ@res@step + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}} + \pgfusepath{draw} + \endpgfscope + + + + } + } + \endinput diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcirclabel.sty b/Master/texmf-dist/tex/latex/circuitikz/pgfcirclabel.sty index 8ce4a72d9a3..120fa7f8cb3 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcirclabel.sty +++ b/Master/texmf-dist/tex/latex/circuitikz/pgfcirclabel.sty @@ -46,69 +46,86 @@ \circuitikzbasekey/bipole/label/position=-90 } } + + +\def\pgf@circ@drawlabel{ + \pgfextra{ + \edef\pgf@temp{\ctikzvalof{label/align}} + \def\pgf@circ@temp{straight} + } + \ifx\pgf@temp\pgf@circ@temp %straight + \pgf@circ@drawreglabel + \else + \pgfextra{\def\pgf@circ@temp{rotate}} + \ifx\pgf@temp\pgf@circ@temp %rotate + \pgf@circ@drawrotlabel + \else % smart + \pgf@circ@drawsmartlabel + \fi + \fi +} + +\def\pgf@circ@drawsmartlabel{ + \pgfextra{ + %\pgfmathadd{\pgf@circ@direction}{360} + \pgfmathmod{\pgf@circ@direction}{90} + \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil} + } + \ifnum \pgfcircmathresult > 20 + \ifnum \pgfcircmathresult < 70 % NON quasi retto + \pgf@circ@drawrotlabel + \else + \pgf@circ@drawreglabel + \fi + \else + \pgf@circ@drawreglabel + \fi +} + %% Output routing %% #1 - node name -\def\pgf@circ@drawlabel{ +\def\pgf@circ@drawrotlabel{ \pgfextra{ - \def\pgf@circ@temp{\ctikzvalof{bipole/label/position}} - \edef\pgf@circ@ffffff{\pgf@circ@direction} - \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@ffffff\pgf@nil} + % calcolo rotazione label + \def\pgf@circ@temp{\ctikzvalof{bipole/label/position}} %%% àncora label + \edef\pgfcirclabrot{\pgf@circ@direction} % primo e quarto quadrante + \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} + \ifnum \pgfcircmathresult > 90 \ifnum \pgfcircmathresult < 270 % terzo e secondo + \pgfmathsubtract{\pgf@circ@direction}{180} + \edef\pgfcirclabrot{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil} + \pgfmathadd{\pgf@circ@temp}{180} %%% + \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil} %%% + \fi\fi - \ifnum \ctikzvalof{mirror value}=-1 - \pgfmathadd{\pgfcircmathresult}{+180} - \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil} + \ifnum \ctikzvalof{mirror value} = -1 + \pgfmathadd{\pgf@circ@temp}{180} + \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil} \fi + } + coordinate (labelcoor) at ($(\ctikzvalof{bipole/name})!2!(\ctikzvalof{bipole/name}.north)$) + (labelcoor) node [transform shape, rotate=\pgfcirclabrot] {\pgf@circ@finallabel{}} +} + +\def\pgf@circ@drawreglabel{ + \pgfextra{ + \pgfmathsubtract{\pgf@circ@direction}{90} + \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil} - \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86 - \ifnum\pgf@circ@temp>0 - \def\pgf@circ@dir{south east} \else \def\pgf@circ@dir{north west} - \fi - \fi\fi - \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95 - \ifnum\pgf@circ@temp>0 - \def\pgf@circ@dir{east} \else \def\pgf@circ@dir{west} - \fi - \fi\fi - \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176 - \ifnum\pgf@circ@temp>0 - \def\pgf@circ@dir{north east} \else \def\pgf@circ@dir{south west} - \fi - \fi\fi - \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185 - \ifnum\pgf@circ@temp>0 - \def\pgf@circ@dir{north} \else \def\pgf@circ@dir{south} - \fi - \fi\fi - \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <256 - \ifnum\pgf@circ@temp>0 - \def\pgf@circ@dir{north west}\else \def\pgf@circ@dir{south east} - \fi - \fi\fi - \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275 - \ifnum\pgf@circ@temp>0 - \def\pgf@circ@dir{west} \else \def\pgf@circ@dir{east} - \fi - \fi\fi - \ifnum\pgfcircmathresult >284 \ifnum\pgfcircmathresult <356 - \ifnum\pgf@circ@temp>0 - \def\pgf@circ@dir{south west} \else \def\pgf@circ@dir{north east} - \fi - \fi\fi - \ifnum\pgfcircmathresult <5 - \ifnum\pgf@circ@temp>0 - \def\pgf@circ@dir{south} \else \def\pgf@circ@dir{north} - \fi + \edef\pgf@circ@temp{\ctikzvalof{bipole/label/position}} %%% àncora label + \ifnum \pgf@circ@temp < 0 + \pgfmathadd{\pgf@circ@labanc}{180} + \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil} \fi - \ifnum\pgfcircmathresult >355 - \ifnum\pgf@circ@temp>0 - \def\pgf@circ@dir{south} \else \def\pgf@circ@dir{north} - \fi + + \ifnum \ctikzvalof{mirror value} = -1 + \pgfmathadd{\pgf@circ@labanc}{180} + \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil} \fi } - node [anchor=\pgf@circ@dir] at (\ctikzvalof{bipole/name}.\pgf@circ@temp) { - \pgf@circ@finallabel{} - } + node [ anchor = \pgf@circ@labanc] + at (\ctikzvalof{bipole/name}.\pgf@circ@temp) {\pgf@circ@finallabel{}} } + \endinput diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcircmath.sty b/Master/texmf-dist/tex/latex/circuitikz/pgfcircmath.sty index f7095d337a2..bcde183dd9a 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcircmath.sty +++ b/Master/texmf-dist/tex/latex/circuitikz/pgfcircmath.sty @@ -20,15 +20,23 @@ \pgf@process{#2}% \advance\pgf@x by-\pgf@xa% \advance\pgf@y by-\pgf@ya% - \ifdim\pgf@x=0pt - \ifdim\pgf@y<0pt - \def\pgfmathresult{-90.0} - \else - \def\pgfmathresult{+90.0} - \fi - \else - \pgfmathdivide{\pgf@y}{\pgf@x} - \pgfmathatan{\pgfmathresult} + \ifdim\pgf@x<0.0001pt + \ifdim\pgf@x>-0.0001pt % vertical + \ifdim\pgf@y<0pt + \def\pgfmathresult{-90.0} + \else + \def\pgfmathresult{+90.0} + \fi + \else % oblique with dx < 0 + \pgfmathdivide{\pgf@y}{\pgf@x} + \pgfmathatan{\pgfmathresult} + \ifdim\pgf@x<0pt + \pgfmathsubtract{\pgfmathresult}{+180} + \fi + \fi + \else % oblique with dx > 0 + \pgfmathdivide{\pgf@y}{\pgf@x} + \pgfmathatan{\pgfmathresult} \ifdim\pgf@x<0pt \pgfmathsubtract{\pgfmathresult}{+180} \fi @@ -40,3 +48,4 @@ } \endinput + diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcircmonopoles.sty b/Master/texmf-dist/tex/latex/circuitikz/pgfcircmonopoles.sty index 1d8f46376d2..569c12039e6 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcircmonopoles.sty +++ b/Master/texmf-dist/tex/latex/circuitikz/pgfcircmonopoles.sty @@ -49,4 +49,172 @@ } + +% Contributed by Leonardo Azzinnari +\pgfdeclareshape{tlinestub}{ + \anchor{center}{\pgfpointorigin} + \behindforegroundpath{ + \pgfstartlinewidth=\pgflinewidth + + \pgf@circ@res@step=\ctikzvalof{bipoles/tline/width} \pgf@circ@Rlen + \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}} + + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0pt}} + \pgfusepath{draw} + \pgfscope + \pgfpathellipse{\pgfpoint{0.5\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0.125\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0\pgf@circ@res@step}{0.25\pgf@circ@res@step}} + \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{1.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}} + \pgfpatharc{90}{-90}{0.125\pgf@circ@res@step and 0.25\pgf@circ@res@step} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-0.25\pgf@circ@res@step}} + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfusepath{draw} + \endpgfscope + } +} + + + + +\pgfdeclareshape{antenna}{ +\anchor{center}{\pgfpointorigin} + \savedanchor{\northeast}{ + \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@Rlen + \pgf@x=5\pgf@circ@res@step%-0.5\pgflinewidth + \pgf@y=6\pgf@circ@res@step + } + \anchor{text}{ + \northeast + \pgf@x=\ctikzvalof{monopoles/antenna/label/xanchor}\pgf@x + \pgf@y=\ctikzvalof{monopoles/antenna/label/yanchor}\pgf@y + } + \behindforegroundpath{ + \pgfstartlinewidth=\pgflinewidth + \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@Rlen + + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}} + \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{0pt}} + \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} + + \pgfusepath{draw} + + \pgfscope + \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{5\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{4\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{3\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfusepath{draw} + \endpgfscope + \pgfsetlinewidth{\pgfstartlinewidth} + + } + } + + +\pgfdeclareshape{txantenna}{ + \anchor{center}{\pgfpointorigin} + \savedanchor{\northeast}{ + \pgf@circ@res@step=\ctikzvalof{monopoles/txantenna/width}\pgf@circ@Rlen + \pgf@x=5\pgf@circ@res@step%-0.5\pgflinewidth + \pgf@y=6\pgf@circ@res@step + } + \anchor{text}{ + \northeast + \pgf@x=\ctikzvalof{monopoles/txantenna/label/xanchor}\pgf@x + \pgf@y=\ctikzvalof{monopoles/txantenna/label/yanchor}\pgf@y + } + \behindforegroundpath{ + \pgfstartlinewidth=\pgflinewidth + \pgf@circ@res@step=\ctikzvalof{monopoles/txantenna/width}\pgf@circ@Rlen + + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}} + \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{0pt}} + \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} + + \pgfusepath{draw} + + \pgfscope + \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{5\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{4\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{3\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfusepath{draw} + \endpgfscope + \pgfpathmoveto{\pgfpoint{5.5\pgf@circ@res@step}{6\pgf@circ@res@step}} +% \pgfpatharc{60}{-60}{\pgf@circ@res@step and \pgf@circ@res@step} + \pgfpatharc{30}{-30}{2\pgf@circ@res@step} \pgfpathmoveto{\pgfpoint{6\pgf@circ@res@step}{6.25\pgf@circ@res@step}} + \pgfpatharc{30}{-30}{2.5\pgf@circ@res@step} + \pgfpathmoveto{\pgfpoint{6.5\pgf@circ@res@step}{6.5\pgf@circ@res@step}} + \pgfpatharc{30}{-30}{3\pgf@circ@res@step} + \pgfpathmoveto{\pgfpoint{7\pgf@circ@res@step}{6.75\pgf@circ@res@step}} + \pgfpatharc{30}{-30}{3.5\pgf@circ@res@step} + \pgfpathmoveto{\pgfpoint{7.5\pgf@circ@res@step}{7\pgf@circ@res@step}} + \pgfpatharc{30}{-30}{4\pgf@circ@res@step} + \pgfusepath{draw} + \pgfsetlinewidth{\pgfstartlinewidth} + + } + } + + +\pgfdeclareshape{rxantenna}{ + \anchor{center}{\pgfpointorigin} + \savedanchor{\northeast}{ + \pgf@circ@res@step=\ctikzvalof{monopoles/txantenna/width}\pgf@circ@Rlen + \pgf@x=5\pgf@circ@res@step%-0.5\pgflinewidth + \pgf@y=6\pgf@circ@res@step + } + \anchor{text}{ + \northeast + \pgf@x=\ctikzvalof{monopoles/rxantenna/label/xanchor}\pgf@x + \pgf@y=\ctikzvalof{monopoles/rxantenna/label/yanchor}\pgf@y + } + \behindforegroundpath{ + \pgfstartlinewidth=\pgflinewidth + \pgf@circ@res@step=\ctikzvalof{monopoles/rxantenna/width}\pgf@circ@Rlen + + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}} + \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{0pt}} + \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} + + \pgfusepath{draw} + + \pgfscope + \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{5\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{4\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{3\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfusepath{draw} + \endpgfscope + + \pgfpathmoveto{\pgfpoint{6\pgf@circ@res@step}{7\pgf@circ@res@step}} +% \pgfpatharc{60}{-60}{\pgf@circ@res@step and \pgf@circ@res@step} + \pgfpatharc{150}{210}{4\pgf@circ@res@step} \pgfpathmoveto{\pgfpoint{6.5\pgf@circ@res@step}{6.75\pgf@circ@res@step}} + \pgfpatharc{150}{210}{3.5\pgf@circ@res@step} + \pgfpathmoveto{\pgfpoint{7\pgf@circ@res@step}{6.5\pgf@circ@res@step}} + \pgfpatharc{150}{210}{3\pgf@circ@res@step} + \pgfpathmoveto{\pgfpoint{7.5\pgf@circ@res@step}{6.25\pgf@circ@res@step}} + \pgfpatharc{150}{210}{2.5\pgf@circ@res@step} + \pgfpathmoveto{\pgfpoint{8\pgf@circ@res@step}{6\pgf@circ@res@step}} + \pgfpatharc{150}{210}{2\pgf@circ@res@step} + \pgfusepath{draw} + \pgfsetlinewidth{\pgfstartlinewidth} + + } +} + + \endinput diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcircquadpoles.sty b/Master/texmf-dist/tex/latex/circuitikz/pgfcircquadpoles.sty index 8a736173244..33e63e6be85 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcircquadpoles.sty +++ b/Master/texmf-dist/tex/latex/circuitikz/pgfcircquadpoles.sty @@ -10,7 +10,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Quadripoles -\long\def\pgfcircdeclarequadpole#1#2{ +\long\def\pgfcircdeclarequadpole#1#2#3{ \pgfdeclareshape{#1} { \anchor{center}{ @@ -25,46 +25,61 @@ \pgf@x=.5\pgf@x \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/width}\pgf@x } - \anchor{south west}{ + \anchor{A2}{ \northwest \pgf@y=-\pgf@y } - \anchor{north east}{ + \anchor{B1}{ \northwest \pgf@x=-\pgf@x } - \anchor{north west}{ + \anchor{A1}{ \northwest } - \anchor{south east}{ + \anchor{B2}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y } - \anchor{A2}{ + \anchor{north}{ + \northwest + \pgf@x=0pt + } + \anchor{south}{ + \northwest + \pgf@x=0pt + \pgf@y=-\pgf@y + } + \anchor{west}{ + \northwest + \pgf@y=0pt + } + \anchor{east}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{south west}{ \northwest \pgf@y=-\pgf@y } - \anchor{B1}{ + \anchor{north east}{ \northwest \pgf@x=-\pgf@x } - \anchor{A1}{ + \anchor{north west}{ \northwest } - \anchor{B2}{ + \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y - } - \anchor{north}{ - \northwest - \pgf@x=0pt - } + } \anchor{base}{ \northwest \pgf@x=0pt } + #3 \backgroundpath{ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} @@ -74,7 +89,7 @@ \pgf@circ@res@right = -\pgf@x \pgf@circ@res@left = \pgf@x - \pgf@circ@Rlen=\pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + %\pgf@circ@Rlen=\pgfkeysvalueof{/tikz/circuitikz/bipoles/length} #2 @@ -84,9 +99,40 @@ -\def\pgf@circ@drawtransformerbasic{ +\def\pgf@circ@drawtransformerbasicanchor{ + \pgfkeysvalueof{/tikz/circuitikz/quadpoles/trans/height} + \anchor{AA2}{ + \northwest + \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x + \pgf@x=.7\pgf@x + \pgf@y=-\pgf@y + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y + } + \anchor{BB1}{ + \northwest + \pgf@x=-\pgf@x + \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x + \pgf@x=.7\pgf@x + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y + } + \anchor{AA1}{ + \northwest + \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x + \pgf@x=.7\pgf@x + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y + } + \anchor{BB2}{ + \northwest + \pgf@x=-\pgf@x + \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x + \pgf@x=.7\pgf@x + \pgf@y=-\pgf@y + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y + } +} -\def\stretto{.4} +\def\pgf@circ@drawtransformerbasicbody{ + \def\stretto{.4} \pgfscope \pgfslopedattimetrue \pgfallowupsidedownattimetrue @@ -166,13 +212,13 @@ \pgfcircdeclarequadpole{transformer}{ - \pgf@circ@drawtransformerbasic + \pgf@circ@drawtransformerbasicbody -} +}{\pgf@circ@drawtransformerbasicanchor} \pgfcircdeclarequadpole{transformer core}{ - \pgf@circ@drawtransformerbasic + \pgf@circ@drawtransformerbasicbody \pgfmoveto{\pgfpoint% {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@right}% @@ -196,7 +242,7 @@ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth} \pgfusepath{draw} -} +}{\pgf@circ@drawtransformerbasicanchor} \pgfcircdeclarequadpole{gyrator}{ @@ -223,4 +269,4 @@ \pgfpatharc{-90}{90}{.7*\stretto\pgf@circ@res@down} \pgfusepath{draw} -} +}{} diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcircshapes.sty b/Master/texmf-dist/tex/latex/circuitikz/pgfcircshapes.sty index c2f1826db5a..52ee97a00c8 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcircshapes.sty +++ b/Master/texmf-dist/tex/latex/circuitikz/pgfcircshapes.sty @@ -50,6 +50,12 @@ \anchor{center}{ \pgfpointorigin } + \anchorborder{ + \pgf@circ@res@left=\pgf@x + \pgf@circ@res@up=\pgf@y + \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up} +}{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}} + } \behindforegroundpath{ \pgfscope @@ -67,6 +73,13 @@ \anchor{center}{ \pgfpointorigin } + \anchorborder{ + \pgf@circ@res@left=\pgf@x + \pgf@circ@res@up=\pgf@y + \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up} +}{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}} + } + \behindforegroundpath{ \pgfscope diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcirctripoles.sty b/Master/texmf-dist/tex/latex/circuitikz/pgfcirctripoles.sty index 6fae7459b46..d077f87b73b 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcirctripoles.sty +++ b/Master/texmf-dist/tex/latex/circuitikz/pgfcirctripoles.sty @@ -11,6 +11,243 @@ %% Tripoles +%\long\def\pgfcircdeclaremixed{ + \pgfdeclareshape{mixer} + { + \savedanchor\northwest{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/mixer/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/mixer/width}\pgf@x + \pgf@x=.5\pgf@x + } + \anchor{left}{% + \northwest + \pgf@y=0pt + } + \anchor{in 1}{ + \northwest + \pgf@y=0pt + } + \anchor{in}{ + \northwest + \pgf@y=0pt + } + \anchor{in 2}{ + \northwest + \pgf@y=-\pgf@y + \pgf@x=0pt + } + \anchor{out}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{center}{ + \pgf@y=0pt + \pgf@x=0pt + } + \anchor{east}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{west}{ + \northwest + \pgf@y=0pt + } + \anchor{south}{ + \northwest + \pgf@x=0pt + \pgf@y=-\pgf@y + } + \anchor{north}{ + \northwest + \pgf@x=0pt + } + \anchor{south west}{ + \northwest + \pgf@y=-\pgf@y + } + \anchor{north east}{ + \northwest + \pgf@x=-\pgf@x + } + \anchor{north west}{ + \northwest + } + \anchor{south east}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-\pgf@y + } + \backgroundpath{ + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + + + \northwest + \pgf@circ@res@up = \pgf@y + \pgf@circ@res@down = -\pgf@y + \pgf@circ@res@right = -\pgf@x + \pgf@circ@res@left = \pgf@x + \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/tripoles/mixer/margin}\pgf@circ@res@up + + \pgfscope + \pgfpathellipse + {\pgfpoint{0pt}{0pt}} + {\pgfpoint{\pgf@circ@res@other}{0pt}} + {\pgfpoint{0pt}{\pgf@circ@res@other}} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathmoveto{\pgfpointpolar{135}{\pgf@circ@res@other}} + \pgfpathlineto{\pgfpointpolar{-45}{\pgf@circ@res@other}} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathmoveto{\pgfpointpolar{45}{\pgf@circ@res@other}} + \pgfpathlineto{\pgfpointpolar{-135}{\pgf@circ@res@other}} + \pgfsetlinewidth{2\pgflinewidth} + \pgfusepath{draw} + \endpgfscope + + \pgfpathmoveto{\pgfpoint{0pt}{-\pgf@circ@res@other}} + \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{0pt}} + \pgfpathlineto{\pgfpoint{-\pgf@circ@res@up}{0pt}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@up}{0pt}} + + \pgfusepath{draw} + + } + } +%} + + + + \pgfdeclareshape{spdt} + { + \savedanchor\northwest{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/width}\pgf@x + \pgf@x=.5\pgf@x + } + \anchor{left}{% + \northwest + \pgf@y=0pt + } + \anchor{in}{ + \northwest + \pgf@y=0pt + } + \anchor{out 1}{ + \northwest + \pgf@x=-\pgf@x + } + \anchor{out 2}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-\pgf@y + } + \anchor{center}{ + \pgf@y=0pt + \pgf@x=0pt + } + \anchor{east}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{west}{ + \northwest + \pgf@y=0pt + } + \anchor{south}{ + \northwest + \pgf@x=0pt + \pgf@y=-\pgf@y + } + \anchor{north}{ + \northwest + \pgf@x=0pt + } + \anchor{south west}{ + \northwest + \pgf@y=-\pgf@y + } + \anchor{north east}{ + \northwest + \pgf@x=-\pgf@x + } + \anchor{north west}{ + \northwest + } + \anchor{south east}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-\pgf@y + } + \backgroundpath{ + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + + + \northwest + \pgf@circ@res@up = \pgf@y + \pgf@circ@res@down = -\pgf@y + \pgf@circ@res@right = -\pgf@x + \pgf@circ@res@left = \pgf@x + \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/margin}\pgf@circ@res@left + + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}} + + \pgfusepath{draw} + + \pgfscope + \pgftransformshift{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}} + \pgfnode{ocirc}{center}{}{spdt1}{\pgfusepath{stroke}} + \endpgfscope + \pgfscope + \pgftransformshift{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}} + \pgfnode{ocirc}{center}{}{}{\pgfusepath{stroke}} + \endpgfscope + \pgfscope + \pgftransformshift{\pgfpoint{\pgf@circ@res@other}{0pt}} + \pgfnode{ocirc}{center}{}{spdt2}{\pgfusepath{stroke}} + \endpgfscope + + + \pgfscope + \pgfpathmoveto{\pgfpointshapeborder{spdt2}{\pgfpointorigin}} + \pgfpathlineto{ + \pgfpointadd{\pgfpointshapeborder{spdt1}{\pgfpoint{-\pgf@circ@res@other}{-100pt}}} + {\pgfpoint{-.05\pgf@circ@res@up}{-.05\pgf@circ@res@up}} + } + \pgfsetlinewidth{2\pgflinewidth} + \pgfusepath{draw} + \endpgfscope + } + } + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% +%% Logic ports +%% + + + + + \long\def\pgfcircdeclarelogicport#1#2{ \pgfdeclareshape{american #1 port} @@ -23,10 +260,6 @@ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/width}\pgf@x \pgf@x=.5\pgf@x } - \anchor{south}{ - \north - \pgf@y=-\pgf@y - } \savedanchor\left{% \pgf@y=0pt } @@ -59,7 +292,38 @@ \pgf@y=0pt \pgf@x=-.8\pgf@x } - + \anchor{east}{ + \left + \pgf@x=-.8\pgf@x + } + \anchor{west}{ + \left + } + \anchor{south}{ + \northwest + \pgf@x=0pt + \pgf@y=-\pgf@y + } + \anchor{north}{ + \northwest + \pgf@x=0pt + } + \anchor{south west}{ + \northwest + \pgf@y=-\pgf@y + } + \anchor{north east}{ + \northwest + \pgf@x=-\pgf@x + } + \anchor{north west}{ + \northwest + } + \anchor{south east}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-\pgf@y + } \backgroundpath{ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} @@ -416,10 +680,6 @@ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/width}\pgf@x \pgf@x=.5\pgf@x } - \anchor{south}{ - \northwest - \pgf@y=-\pgf@y - } \savedanchor\left{% \pgf@y=0pt } @@ -435,7 +695,38 @@ \anchor{center}{ \pgfpointorigin } - + \anchor{east}{ + \left + \pgf@x=-.8\pgf@x + } + \anchor{west}{ + \left + } + \anchor{south}{ + \northwest + \pgf@x=0pt + \pgf@y=-\pgf@y + } + \anchor{north}{ + \northwest + \pgf@x=0pt + } + \anchor{south west}{ + \northwest + \pgf@y=-\pgf@y + } + \anchor{north east}{ + \northwest + \pgf@x=-\pgf@x + } + \anchor{north west}{ + \northwest + } + \anchor{south east}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-\pgf@y + } \backgroundpath{ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} @@ -501,10 +792,6 @@ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/width}\pgf@x \pgf@x=.5\pgf@x } - \anchor{south}{ - \north - \pgf@y=-\pgf@y - } \savedanchor\left{% \pgf@y=0pt } @@ -537,7 +824,38 @@ \pgf@y=0pt \pgf@x=-.8\pgf@x } - + \anchor{east}{ + \left + \pgf@x=-.8\pgf@x + } + \anchor{west}{ + \left + } + \anchor{south}{ + \northwest + \pgf@x=0pt + \pgf@y=-\pgf@y + } + \anchor{north}{ + \northwest + \pgf@x=0pt + } + \anchor{south west}{ + \northwest + \pgf@y=-\pgf@y + } + \anchor{north east}{ + \northwest + \pgf@x=-\pgf@x + } + \anchor{north west}{ + \northwest + } + \anchor{south east}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-\pgf@y + } \backgroundpath{ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} \northwest @@ -610,53 +928,91 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \long\def\pgfcircdeclaretransistor#1#2#3{ \pgfdeclareshape{#1} { - \anchor{center}{\pgfpointorigin} - \savedanchor\north{% + \anchor{center}{\pgfpointorigin} + \savedanchor\northeast{% upper right \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/height}\pgf@y \pgf@y=.5\pgf@y \pgf@x=0pt } - \savedanchor\northeast{% - \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/height}\pgf@y - \pgf@y=.5\pgf@y - \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/width}\pgf@x - } - \anchor{south}{ - \north - \pgf@y=-\pgf@y - } - \savedanchor\left{% +% \savedanchor\northeast{% +% \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} +% \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/height}\pgf@y +% \pgf@y=.5\pgf@y +% \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} +% \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/width}\pgf@x +% } + \savedanchor\left{%center left \pgf@y=0pt \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/width}\pgf@x } \anchor{text}{ - \north - \pgfpoint - {12\pgf@circ@res@right +0.2*(\pgf@circ@res@right-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left)} - {0.6\pgf@y} + \northeast + \pgfpoint + {12\pgf@circ@res@right +0.2*(\pgf@circ@res@right-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left)} + {0.6\pgf@y} } % % pseudo-bipole - \anchor{left}{ - \north + \anchor{left}{ % south + \northeast \pgf@y=-\pgf@y } \anchor{right}{ - \north + \northeast + } + \anchor{north}{ + \northeast + \pgf@circ@res@step=\pgf@y + \left + \pgf@y=\pgf@circ@res@step + \pgf@x=.5\pgf@x + } + \anchor{west}{ + \left + } + \anchor{east}{ + \pgf@x=0pt + \pgf@y=0pt } + \anchor{south}{ + \northeast + \pgf@circ@res@step=\pgf@y + \left + \pgf@y=-\pgf@circ@res@step + \pgf@x=.5\pgf@x + } + \anchor{south west}{ + \northeast + \pgf@circ@res@step=\pgf@y + \left + \pgf@y=-\pgf@circ@res@step + } + \anchor{north east}{ + \northeast + } + \anchor{north west}{ + \northeast + \pgf@circ@res@step=\pgf@y + \left + \pgf@y=\pgf@circ@res@step + } + \anchor{south east}{ + \northeast + \pgf@y=-\pgf@y + } + #2 \backgroundpath{ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} % % - \north + \northeast \pgf@circ@res@up = \pgf@y \pgf@circ@res@down = -\pgf@y \pgf@circ@res@right = \pgf@x @@ -705,17 +1061,17 @@ \pgfcircdeclaremos{nmos}{ \anchor{D}{ - \north + \northeast } \anchor{drain}{ - \north + \northeast } \anchor{S}{ - \north + \northeast \pgf@y=-\pgf@y } \anchor{source}{ - \north + \northeast \pgf@y=-\pgf@y } }{% @@ -781,17 +1137,17 @@ \pgfcircdeclaremos{pmos}{ \anchor{S}{ - \north + \northeast } \anchor{source}{ - \north + \northeast } \anchor{D}{ - \north + \northeast \pgf@y=-\pgf@y } \anchor{drain}{ - \north + \northeast \pgf@y=-\pgf@y } }{% @@ -846,11 +1202,18 @@ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}} + \pgfpathmoveto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left} {\pgf@circ@res@up+\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}} \pgfusepath{draw} + + \pgfpathcircle{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left - \pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}} + {\pgf@circ@res@up+\pgf@circ@res@down}}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}} + \pgfusepath{draw,fill} + } @@ -861,10 +1224,10 @@ \pgfcircdeclaretransistor{pnp}{ \anchor{E}{ - \north + \northeast } \anchor{emitter}{ - \north + \northeast } \anchor{B}{ \left @@ -873,11 +1236,11 @@ \left } \anchor{C}{ - \north + \northeast \pgf@y=-\pgf@y } \anchor{collector}{ - \north + \northeast \pgf@y=-\pgf@y } }{ @@ -938,10 +1301,10 @@ \pgfcircdeclaretransistor{npn}{ \anchor{C}{ - \north + \northeast } \anchor{collector}{ - \north + \northeast } \anchor{B}{ \left @@ -950,11 +1313,11 @@ \left } \anchor{E}{ - \north + \northeast \pgf@y=-\pgf@y } \anchor{emitter}{ - \north + \northeast \pgf@y=-\pgf@y } }{% @@ -1013,10 +1376,10 @@ \pgfcircdeclaretransistor{pigbt}{ \anchor{E}{ - \north + \northeast } \anchor{emitter}{ - \north + \northeast } \anchor{B}{ \left @@ -1025,11 +1388,11 @@ \left } \anchor{C}{ - \north + \northeast \pgf@y=-\pgf@y } \anchor{collector}{ - \north + \northeast \pgf@y=-\pgf@y } }{ @@ -1100,10 +1463,10 @@ \pgfcircdeclaretransistor{nigbt}{ \anchor{C}{ - \north + \northeast } \anchor{collector}{ - \north + \northeast } \anchor{B}{ \left @@ -1112,11 +1475,11 @@ \left } \anchor{E}{ - \north + \northeast \pgf@y=-\pgf@y } \anchor{emitter}{ - \north + \northeast \pgf@y=-\pgf@y } }{ @@ -1230,17 +1593,17 @@ \pgfcircdeclarefet{nfet}{ \anchor{D}{ - \north + \northeast } \anchor{drain}{ - \north + \northeast } \anchor{S}{ - \north + \northeast \pgf@y=-\pgf@y } \anchor{source}{ - \north + \northeast \pgf@y=-\pgf@y } @@ -1323,17 +1686,17 @@ \pgfcircdeclarefet{pfet}{ \anchor{D}{ - \north + \northeast } \anchor{drain}{ - \north + \northeast } \anchor{S}{ - \north + \northeast \pgf@y=-\pgf@y } \anchor{source}{ - \north + \northeast \pgf@y=-\pgf@y } }{% @@ -1423,17 +1786,17 @@ % N-CHANNEL IGFET ENHANCEMENT TYPE \pgfcircdeclarefet{nigfete}{ \anchor{D}{ - \north + \northeast } \anchor{drain}{ - \north + \northeast } \anchor{S}{ - \north + \northeast \pgf@y=-\pgf@y } \anchor{source}{ - \north + \northeast \pgf@y=-\pgf@y } }{% @@ -1524,17 +1887,17 @@ % N-CHANNEL IGFET DEPLETION TYPE \pgfcircdeclarefet{nigfetd}{ \anchor{D}{ - \north + \northeast } \anchor{drain}{ - \north + \northeast } \anchor{S}{ - \north + \northeast \pgf@y=-\pgf@y } \anchor{source}{ - \north + \northeast \pgf@y=-\pgf@y } }{% @@ -1614,17 +1977,17 @@ % P-CHANNEL IGFET ENHANCEMENT TYPE \pgfcircdeclarefet{pigfete}{ \anchor{D}{ - \north + \northeast } \anchor{drain}{ - \north + \northeast } \anchor{S}{ - \north + \northeast \pgf@y=-\pgf@y } \anchor{source}{ - \north + \northeast \pgf@y=-\pgf@y } }{% @@ -1723,17 +2086,17 @@ % P-CHANNEL IGFET DEPLETION TYPE \pgfcircdeclarefet{pigfetd}{ \anchor{D}{ - \north + \northeast } \anchor{drain}{ - \north + \northeast } \anchor{S}{ - \north + \northeast \pgf@y=-\pgf@y } \anchor{source}{ - \north + \northeast \pgf@y=-\pgf@y } }{% @@ -1848,17 +2211,17 @@ \pgf@y=-.5\pgf@y } \anchor{D}{ - \north + \northeast } \anchor{drain}{ - \north + \northeast } \anchor{S}{ - \north + \northeast \pgf@y=-\pgf@y } \anchor{source}{ - \north + \northeast \pgf@y=-\pgf@y } }{% @@ -1929,17 +2292,17 @@ \pgf@y=.5\pgf@y } \anchor{S}{ - \north + \northeast } \anchor{source}{ - \north + \northeast } \anchor{D}{ - \north + \northeast \pgf@y=-\pgf@y } \anchor{drain}{ - \north + \northeast \pgf@y=-\pgf@y } }{% @@ -2161,6 +2524,9 @@ \northwest \pgf@y=-\pgf@y } + \anchor{north}{ + \northwest + } \savedanchor\left{% \pgf@y=0pt } @@ -2209,6 +2575,13 @@ \pgf@y=0pt \pgf@x=-\pgf@x } + \anchor{west}{ + \left + } + \anchor{east}{ + \left + \pgf@x=-\pgf@x + } \backgroundpath{ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} diff --git a/Master/texmf-dist/tex/latex/circuitikz/t-circuitikz.tex b/Master/texmf-dist/tex/latex/circuitikz/t-circuitikz.tex index 12671123ff3..0af74491c15 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/t-circuitikz.tex +++ b/Master/texmf-dist/tex/latex/circuitikz/t-circuitikz.tex @@ -24,6 +24,13 @@ american=>\ctikzset{ current=american} ] +\processaction[\currentmoduleparameter{label}] + [ + straight=>\ctikzset{label/align = straight} + align=>\ctikzset{label/align = rotate} + smart=>\ctikzset{label/align = smart} + ] + \processaction[\currentmoduleparameter{resistor}] [ european=>\ctikzset{ resistor=european}, american=>\ctikzset{ resistor=american} |