From 838842fa4625160270947ca654e7492e3c7afc44 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sun, 10 Nov 2019 03:01:01 +0000 Subject: CTAN sync 201911100301 --- graphics/pgf/contrib/circuitikz/doc/changelog.tex | 36 ++ .../contrib/circuitikz/doc/circuitikz-context.pdf | Bin 15498 -> 15492 bytes .../contrib/circuitikz/doc/circuitikzmanual.pdf | Bin 773291 -> 801448 bytes .../contrib/circuitikz/doc/circuitikzmanual.tex | 244 ++++++++-- graphics/pgf/contrib/circuitikz/tex/circuitikz.sty | 4 +- .../pgf/contrib/circuitikz/tex/pgfcirc.defines.tex | 36 +- .../pgf/contrib/circuitikz/tex/pgfcirccurrent.tex | 3 +- .../pgf/contrib/circuitikz/tex/pgfcircflow.tex | 2 +- .../contrib/circuitikz/tex/pgfcircquadpoles.tex | 31 +- .../pgf/contrib/circuitikz/tex/pgfcircshapes.tex | 94 ++++ .../pgf/contrib/circuitikz/tex/pgfcirctripoles.tex | 500 +++++++++++++++++++-- .../pgf/contrib/circuitikz/tex/pgfcircvoltage.tex | 8 +- .../pgf/contrib/circuitikz/tex/t-circuitikz.tex | 4 +- 13 files changed, 855 insertions(+), 107 deletions(-) (limited to 'graphics') diff --git a/graphics/pgf/contrib/circuitikz/doc/changelog.tex b/graphics/pgf/contrib/circuitikz/doc/changelog.tex index 5d22e52f18..dc8c445417 100644 --- a/graphics/pgf/contrib/circuitikz/doc/changelog.tex +++ b/graphics/pgf/contrib/circuitikz/doc/changelog.tex @@ -4,6 +4,42 @@ here. See \url{https://github.com/circuitikz/circuitikz/commits} for a full list of changes. \begin{itemize} +\item + Version 0.9.6 (2019-11-09) + + The highlights of this release are the new multiple terminals BJTs and + several stylistic addition and fixes; if you like to pixel-peep, you + will like the fixed transistors arrows. Additionally, the transforms + are much more configurable now, the ``pmos'' and ``nmos'' elements + have grown an optional bulk connection, and you can use the ``flow'' + arrows outside of a path. + + Several small and less small bugs have been fixed. + + \begin{itemize} + \tightlist + \item + Added multi-collectors and multi-emitter bipolar transistors + \item + Added the possibility to style each one of the two coils in a + transformer independently + \item + Added bulk connection to normal MOSFETs and the respective anchors + \item + Added ``text'' anchor to the flow arrows, to use them alone in a + consistent way + \item + Fixed flow, voltage, and current arrow positioning when ``auto'' is + active on the path + \item + Fixed transistors arrows overshooting the connection point, added a + couple of anchors + \item + Fixed a spelling error on op-amp key ``noinv input down'' + \item + Fixed a problem with ``quadpoles style=inner'' and ``transformer + core'' having the core lines running too near + \end{itemize} \item Version 0.9.5 (2019-10-12) diff --git a/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf b/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf index a87cc0a40e..491e98af5f 100644 Binary files a/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf and b/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf differ diff --git a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf index c325cc1d07..b88ed1d0d0 100644 Binary files a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf and b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf differ diff --git a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex index b9808d3ba7..d2606034ff 100644 --- a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex +++ b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex @@ -138,7 +138,7 @@ (a2-|GND); \draw (C.pin 3) to[D, fill=green] ++(0,-5)-- ++(0.5,0) to[R] ++(2,0) coordinate(a3) to[short, -*] - node[above left, blue]{Stefan Erhart} + node[above left, blue]{Stefan Erhardt} node[below left,]{\email{stefan.erhardt@fau.de}} (a3-|GND); \draw (C.pin 1) to[D, fill=yellow] ++(0,-7)-- ++(0.5,0) to[R] ++(2,0) @@ -358,7 +358,7 @@ somewhere in your document preamble. It will load automatically the needed packa Let's say we want to prepare a circuit to teach how a current shunt works; the idea is to draw a current generator, a couple of resistors in parallel, and the indication of currents and voltages for the discussion. -A circuit in \Circuitikz is drawn into a \texttt{circuitikz} environment (which is really an alias for \texttt{tikzpicture}). In this first example we will use absolute coordinates. +A circuit in \Circuitikz{} is drawn into a \texttt{circuitikz} environment (which is really an alias for \texttt{tikzpicture}). In this first example we will use absolute coordinates. The electrical components can be divided in two main categories: the one that are bipoles and are placed along a path (also known as \texttt{to}-style component, for their usage), and components that are nodes and can have any number of poles or connections. Let's start with the first type of component, and build a basic mesh: @@ -1362,7 +1362,7 @@ You can change the scale of the inductors by setting the key \texttt{inductors/s You can change the width of these components (all the inductors together, unless you use style or scoping) by setting the key \texttt{inductors/width} to something different from the default, which is \texttt{0.8} for american and european inductors, and \texttt{0.6} for cute inductors. Moreover, you can change the number of ``coils'' drawn by setting the key -\texttt{inductors/coils} (default value \texttt{5} for cute inductors and \texttt{4} for american ones). +\texttt{inductors/coils} (default value \texttt{5} for cute inductors and \texttt{4} for american ones). \textbf{Notice} that the minimum number of \texttt{coils} is \texttt{1} for american inductors, and \texttt{2} for cute ones. \begin{LTXexample}[varwidth=true] \begin{circuitikz}[ @@ -1942,11 +1942,13 @@ The size of the crossing elements can be changed with the key \texttt{bipoles/cr \subsection{Arrows}\label{sec:arrows} -These are pseudo-arrows used in lot of places in the packages (for transistors, flows, currents, and so on). +These are pseudo-arrows used in lot of places in the packages (for transistors, flows, currents, and so on). The first three arrows are magnified by a factor~3 in the boxes below; for the \texttt{trarrow}, the anchor \texttt{tip} is exactly on the tip and \texttt{btip} is slightly receded. \begin{groupdesc} - \circuitdesc{currarrow}{Arrows (current and voltage)}{}(center/0/0.2) - \circuitdesc{inputarrow}{Arrow to draw at its tip, useful for block diagrams.}{}(center/0/0.2) + \circuitdesc[3]{currarrow}{Arrow for current and voltage}{}(center/0/0.2) + \circuitdesc[3]{inputarrow}{Arrow that is anchored at its tip, useful for block diagrams.}{}(center/0/0.2) + \circuitdesc[3]{trarrow}{Arrow the same size of \texttt{currarrow} but only filled.}{}(center/90/0.2, tip/0/0.2, btip/-90/0.2) + \circuitdesc{flowarrow}{Arrow used for the flows, with a \texttt{text} anchor}{$I_p$}(center/-90/0.2, east/0/0.2, west/180/0.2, text/45/0.2) \end{groupdesc} \subsubsection{Arrows size}\label{sec:currarrow-size} @@ -2193,10 +2195,9 @@ To show that a device is optional, you can dash it. The inner symbol will be kep \subsection{Transistors} +\subsubsection{Standard bipolar transistors} + \begin{groupdesc} - \circuitdesc{nmos}{nmos}{}( G/180/0.2,D/0/0.2,S/0/0.2 ) - \circuitdesc{pmos}{pmos}{} - \circuitdesc{hemt}{hemt}{} \circuitdesc{npn}{npn}{}( B/180/0.2,C/0/0.2,E/0/0.2 ) \circuitdesc{pnp}{pnp}{} \circuitdesc{npn,photo}{npn}{}( nobase/0/0.4 ) @@ -2207,7 +2208,69 @@ To show that a device is optional, you can dash it. The inner symbol will be kep \circuitdesc{Lpigbt}{Lpigbt}{} \end{groupdesc} -For all transistors a body diode (or freewheeling diode) can automatically be drawn. Just use the global option bodydiode, or for single transistors, the tikz-option bodydiode: +\subsubsection{Multi-terminal bipolar transistors} + +In addition to the standard BJTs transistors, since version~\texttt{0.9.6} the \texttt{bjtnpn} and \texttt{bjtpnp} are also available; these are devices where you can have more collectors and emitters (on the other hand, they have no \texttt{photo} nor \texttt{bodydiode} options --- they are silently ignored). + +Basically they are the same as the normal \texttt{npn} and \texttt{pnp}, and they (by default) have similar sizes; the options \texttt{collectors} and \texttt{emitters} will change the number of the relative terminals. The base terminal is connected midway from the collector and the emitter, \emph{not} on the center of the base; a \texttt{cbase} anchor is available if you prefer to use it. The label of the component (the text) is set on the right side, vertically centered around the base terminal. + +\begin{groupdesc} + \circuitdesc{bjtnpn, collectors=1, emitters=2}{bjt npn}{Q}(B/180/0.2, C/45/0.2, E/-45/0.2, C1/0/0.4, E1/0/0.4, E2/0/0.4, nobase/135/0.4, cbase/-135/0.4, center/0/0.6) + \circuitdesc{bjtpnp, collectors=3, emitters=2}{bjt pnp}{Q}(B/180/0.2, C/-45/0.2, E/45/0.2, C1/0/0.4, C2/0/0.4, C3/0/0.4, E1/0/0.4, E2/0/0.4, nobase/135/0.4, cbase/-135/0.4) +\end{groupdesc} + +\subsubsection{Field-effect transistors} + +\begin{groupdesc} + \circuitdesc{nmos}{nmos}{}( G/180/0.2,D/0/0.2,S/0/0.2 ) + \circuitdesc{pmos}{pmos}{} + \circuitdesc{hemt}{hemt}{} +\end{groupdesc} + +\textsc{nfet}s and \textsc{pfet}s have been incorporated based on code provided by Clemens Helfmeier and Theodor Borsche. Use the package options \texttt{fetsolderdot}/\texttt{nofetsolderdot} to enable/disable solderdot at some fet-transistors. Additionally, the solderdot option can be enabled/disabled for single transistors with the option "solderdot" and "nosolderdot", respectm ively. + +\begin{groupdesc} + \circuitdesc{nfet}{nfet}{} + \circuitdesc{nigfete}{nigfete}{} + \circuitdesc{nigfete,solderdot}{nigfete}{} + \circuitdesc{nigfetebulk}{nigfetebulk}{} + \circuitdesc{nigfetd}{nigfetd}{} + \circuitdesc{pfet}{pfet}{} + \circuitdesc{pigfete}{pigfete}{} + \circuitdesc{pigfetebulk}{pigfetebulk}{} + \circuitdesc{pigfetd}{pigfetd}{} +\end{groupdesc} + +\textsc{njfet} and \textsc{pjfet} have been incorporated based on code provided by Danilo Piazzalunga: +\begin{groupdesc} + \circuitdesc{njfet}{njfet}{} + \circuitdesc{pjfet}{pjfet}{} +\end{groupdesc} + +\textsc{isfet} +\begin{groupdesc} + \circuitdesc{isfet}{isfet}{} +\end{groupdesc} + +\subsubsection{Transistors customization}\label{sec:styling-transistors} + +The default position of the arrows in transistors is somewhat in the middle of the terminal; if you prefer you can move them to the end with the style key \texttt{transistors/arrow pos=end} (the default value is \texttt{legacy}). + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \ctikzset{tripoles/mos style=arrows} + \ctikzset{transistors/arrow pos=end} + \draw (0,0) node[npn, ](npn){}; + \draw (2,0) node[pnp, ](npn){}; + \draw (0,-2) node[nmos, ](npn){}; + \draw (2,-2) node[pmos, ](npn){}; +\end{circuitikz} +\end{LTXexample} + +You can change the scale of all the transistors by setting the key \texttt{transistors/scale} (default \texttt{1.0}). +The size of the arrows (if any) is controlled by the same parameters as \texttt{currarrow} (see section~\ref{sec:currarrow-size}) and the dots on P-type transistors (if any) are the same as the nodes/poles (see section~\ref{sec:bipole-nodes}). + +For all transistors (minus \texttt{bjtnpn} and \texttt{bjtpnp}) a body diode (or freewheeling diode) can automatically be drawn. Just use the global option bodydiode, or for single transistors, the tikz-option bodydiode: \begin{LTXexample}[varwidth=true] \begin{circuitikz} @@ -2246,6 +2309,14 @@ To draw the PMOS circle non-solid, use the option \texttt{emptycircle} or the co \circuitdesc{pmos,nocircle,arrowmos}{pmos}{} \end{groupdesc} +You can add a bulk terminal\footnote{Thanks to Burak Kelleci .} to \texttt{nmos} and \texttt{pmos} using the key \texttt{bulk} in the node (and \texttt{nobulk} if you set the bulk terminal by default); additional anchors \texttt{bulk} and \texttt{nobulk} are added (in the next example, \texttt{tripoles/mos style/arrows} is enacted, too): + +\begin{groupdesc} + \ctikzset{tripoles/mos style/arrows} + \circuitdesc{nmos, bulk}{pmos}{}(bulk/45/0.3, nobulk/-30/.4) + \circuitdesc{pmos, bulk}{pmos}{} +\end{groupdesc} + \begin{LTXexample}[varwidth=true] \begin{circuitikz}[ info/.style={left=1cm, blue, text width=5em, align=right},] @@ -2262,30 +2333,14 @@ To draw the PMOS circle non-solid, use the option \texttt{emptycircle} or the co node[pmos]{} (2,-8) node[nmos]{}; \end{circuitikz}\end{LTXexample} -\textsc{nfet}s and \textsc{pfet}s have been incorporated based on code provided by Clemens Helfmeier and Theodor Borsche. Use the package options \texttt{fetsolderdot}/\texttt{nofetsolderdot} to enable/disable solderdot at some fet-transistors. Additionally, the solderdot option can be enabled/disabled for single transistors with the option "solderdot" and "nosolderdot", respectm ively. +\subsubsection{Multiple terminal transistors customization} -\begin{groupdesc} - \circuitdesc{nfet}{nfet}{} - \circuitdesc{nigfete}{nigfete}{} - \circuitdesc{nigfete,solderdot}{nigfete}{} - \circuitdesc{nigfetebulk}{nigfetebulk}{} - \circuitdesc{nigfetd}{nigfetd}{} - \circuitdesc{pfet}{pfet}{} - \circuitdesc{pigfete}{pigfete}{} - \circuitdesc{pigfetebulk}{pigfetebulk}{} - \circuitdesc{pigfetd}{pigfetd}{} -\end{groupdesc} +You can create completely ``bare'' transistors (without the connection leads to the \texttt{B}, \texttt{C} y \texttt{E} terminals), by changing the parameter \texttt{tripoles/bjt/pins width} (default \texttt{0.3}; it is expressed as a fraction of the basic (scaled) length) or using the style \texttt{bjt pins width}; and you can change the distance between multiple collectors/emitters setting with \verb|\ctikzset{}| the parameter \texttt{tripoles/bjt/multi height/} (default \texttt{0.5}) or the style \texttt{bjt multi height}. -\textsc{njfet} and \textsc{pjfet} have been incorporated based on code provided by Danilo Piazzalunga: \begin{groupdesc} - \circuitdesc{njfet}{njfet}{} - \circuitdesc{pjfet}{pjfet}{} + \circuitdesc{bjtnpn, collectors=2, emitters=2, bjt pins width=0, bjt multi height=0.8}{bjt npn with parameters}{Q}(B/180/0.2, C/45/0.2, E/-45/0.2, C1/0/0.4, C2/0/0.4, E1/0/0.4, E2/0/0.4, nobase/-135/0.4, cbase/135/0.4) \end{groupdesc} -\textsc{isfet} -\begin{groupdesc} - \circuitdesc{isfet}{isfet}{} -\end{groupdesc} \subsubsection{Transistors anchors} @@ -2341,6 +2396,55 @@ For \textsc{npn}, \textsc{pnp}, \textsc{nigbt} and \textsc{pigbt} transistors, t ;\end{circuitikz} \end{LTXexample} +Finally, all transistors, except the multi-terminal \texttt{bjtnpn} and \texttt{bjtpnp}, (since \texttt{0.9.6}) have internal nodes on the terminal corners, called \texttt{inner up} and \texttt{inner down}; you do not normally need them, but they are here for special applications: + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \node [npn](A) at(0,2) {}; + \node [pmos](B) at(0,0) {}; + \foreach \e in {A, B} + \foreach \a in {inner up, inner down} { + \node[red, circle, inner sep=1pt, draw] + at (\e.\a) {}; + \node [right, font=\tiny, blue] + at (\e.\a) {\a}; + } +\end{circuitikz} +\end{LTXexample} + + +The multi-terminal transistors have all the geographical anchors; note though that the \texttt{center} anchor is not the geometrical center of the component, but the logical one (at the same height than the base). +The additional anchors \texttt{vcenter} (vertical geometric center of the collector--emitter zone) and \texttt{gcenter} (graphical center) are provided, as shown in the following picture. + +\begin{quote} +\geocoord{bjtnpn, collectors=1, emitters=2} +\showanchors{bjtpnp, collectors=4, emitters=1, bjt pins width=0.6}{}(north/90/0.4, east/0/0.4, south/-90/0.4, west/180/0.4, center/120/0.3, vcenter/0/0.4, gcenter/-120/0.4, cbase/-60/0.6) +\end{quote} + +A complete example of multiple terminal transistor application is the following PNP double current mirror circuit. + +\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily] +\begin{circuitikz} + \ctikzset{transistors/arrow pos=end} + \draw (0,0) node[bjtpnp, xscale=-1](Q1){% + \scalebox{-1}[1]{Q1}}; + \draw (Q1.B) node[bjtpnp, anchor=B, collectors=2] + (Q2){Q2} (Q1.B) node[circ]{}; + \draw (Q1.E) node[circ]{} node[vcc]{} (Q2.E) + node[vcc]{} (Q1.E) -| (Q1.B); + \draw (Q1.C) to[R, l_=$R_0$, f=$I_0$] ++(0,-3.5) + node[ground](GND){}; + \draw (Q2.C) -- ++(0,-0.5) coordinate(a); + \draw (Q2.C1) -- ++(1,0) coordinate(b) -- (b|-a); + \draw (a) ++(0,-0.1) node[flowarrow, rotate=-90, + anchor=west]{\rotatebox{90}{$I_0$}}; + \draw (b|-a) ++(0,-0.1) node[flowarrow, rotate=-90, + anchor=west]{\rotatebox{90}{$I_0$}}; + \path (b) ++(0.5,0); % bounding box adjust +\end{circuitikz} +\end{LTXexample} + + Here is one composite example (please notice that the \texttt{xscale=-1} style would also reflect the label of the transistors, so here a new node is added and its text is used, instead of that of \texttt{pnp1}): \begin{LTXexample}[varwidth=true] @@ -2397,22 +2501,6 @@ Transistor paths have the possibility to use the poles syntax (see section~\ref{ The \texttt{name} property is available also for bipoles; this is useful mostly for triac, potentiometer and thyristor (see~\ref{sec:othertrip}). -\subsubsection{Transistors customization}\label{sec:styling-transistors} - -The default position of the arrows in transistors is somewhat in the middle of the terminal; if you prefer you can move them to the end with the style key \texttt{transistors/arrow pos=end} (the default value is \texttt{legacy}). - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \ctikzset{transistors/arrow pos=end} - \draw (0,0) node[npn, ](npn){}; - \draw (2,0) node[pnp, ](npn){}; - \draw (0,-2) node[nmos, ](npn){}; - \draw (2,-2) node[pmos, ](npn){}; -\end{circuitikz} -\end{LTXexample} - -You can change the scale of all the transistors by setting the key \texttt{transistors/scale} (default \texttt{1.0}). -The size of the arrows (if any) is controlled by the same parameters as \texttt{currarrow} (see section~\ref{sec:currarrow-size}) and the dots on P-type transistors (if any) are the same as the nodes/poles (see section~\ref{sec:bipole-nodes}). \subsection{Electronic Tubes} @@ -2801,6 +2889,8 @@ You can change the aspect of a quadpole using the corresponding parameters \text Transformers also inherits the \texttt{inductors/scale} (see~\ref{sec:tweak-l}) and similar parameters. It's your responsibility to set the aforementioned parameters if you change the scale or width of inductors. +Transformers core line distance is specified by the parameter \texttt{quadpoles/transformer core/core width} (default \texttt{0.05}) and the thickness of the lines follows the choke one; in other words, you can set it changing \texttt{bipoles/cutechoke/cthick}. + Another very useful parameter is \texttt{quadpoles/*/inner} (default \texttt{0.4}) that determine which part of the component is the ``vertical'' one. So, setting that parameter to 1 will eliminate the horizontal part of the component (obviously, to maintain the general aspect ratio you need to change the width also): @@ -2837,6 +2927,66 @@ This can be useful if you want to put seamlessly something in series with either \end{LTXexample} +\subsubsection{Styling transformer's coils independently} + +Since \texttt{0.9.6}, you can tweak the style of each of the coils of the transformers by +changing the value of the two styles \texttt{transformer L1} and \texttt{transformer L2}; +the default for both are \texttt{\{\}}, that means inherit the inductors style in force. + +\begin{LTXexample}[pos=t, basicstyle=\small\ttfamily] +\begin{circuitikz}[american] + \begin{scope} + \ctikzset{transformer L1/.style={inductors/coils=1, inductors/width=0.2}} + \draw (0,0) node[transformer core](T1){}; + \end{scope} + \draw (3,0) node[transformer](T2){}; + \ctikzset{cute inductors, quadpoles style=inline} + \ctikzset{transformer L1/.style={inductors/coils=2, inductors/width=0.2}} + \draw (6,0) node[transformer core](T3){}; + \ctikzset{transformer L1/.style={american inductors, inductors/coils=1, inductors/width=0.2}} + \ctikzset{transformer L2/.style={inductors/coils=7, inductors/width=1.0}} + \draw (9,0) node[transformer ](T4){}; + \foreach \t in {T1, T2, T3, T4} { + \foreach \l in {L1, L2} { + \foreach \a/\c in {a/blue, b/red} + \node [circle, fill=\c, inner sep=1pt] at (\t-\l.\a) {}; + } + } +\end{circuitikz} +\end{LTXexample} + +\textbf{Caveat:} the size of the transformer is independent from the styles for \texttt{L1} and \texttt{L2}, so they follow whatever the parameters for the inductances were before applying them. In other words, the size of the transformer could result too small if you are not careful. + +\begin{LTXexample}[varwidth, basicstyle=\small\ttfamily] +\begin{circuitikz} + \ctikzset{transformer L1/.style={inductors/width=1.8, inductors/coils=13}} + % too small! + \draw (0,0) node[transformer core](T1){}; + % adjust it + \ctikzset{quadpoles/transformer core/height=2.4} + \draw (2.5,0) node[transformer core](T1){}; +\end{circuitikz} +\end{LTXexample} + +You can obviously define a style for a ``non-standard'' transformer. For example, you can have a current transformer\footnote{Suggested by Alex Pacini on \href{https://github.com/circuitikz/circuitikz/issues/297}{GitHub}} defined like this: + +\begin{LTXexample}[varwidth, basicstyle=\small\ttfamily] +\begin{circuitikz}[ + TA core/.style={transformer core, + % at tikz level, you have to use circuitikz/ explicitly + circuitikz/quadpoles style=inline, + circuitikz/transformer L1/.style={ + american inductors, inductors/coils=1, + inductors/width=0.3}, + } ] + \draw (0,0) node[TA core](T1){}; + % changes are local + \draw (0,-3) node[transformer]{}; +\end{circuitikz} +\end{LTXexample} + +Remember that the default \texttt{pgfkeys} directory is \texttt{/tikz} for nodes and for the options of the environment, so you \emph{have} to use the full path (with \texttt{circuitikz/}) there. + \subsection{Amplifiers} \begin{groupdesc} @@ -3373,8 +3523,8 @@ If otherwise \texttt{europeanports} option is active (or the style \texttt{[euro There is no ``european'' version of these symbols. \begin{groupdesc} - \circuitdesc*{schmitt}{Non-Inverting \textsc{Schmitttrigger}}{} - \circuitdesc*{invschmitt}{Inverting \textsc{Schmitttrigger}}{} + \circuitdesc*{schmitt}{Non-Inverting Schmitt trigger}{} + \circuitdesc*{invschmitt}{Inverting Schmitt trigger}{} \end{groupdesc} \subsubsection{Logic port customization} diff --git a/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty b/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty index 12893f68b8..2801bfcaf3 100644 --- a/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty +++ b/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty @@ -9,8 +9,8 @@ \NeedsTeXFormat{LaTeX2e} -\def\pgfcircversion{0.9.5} -\def\pgfcircversiondate{2019/10/12} +\def\pgfcircversion{0.9.6} +\def\pgfcircversiondate{2019/11/09} \ProvidesPackage{circuitikz}% [\pgfcircversiondate{} The CircuiTikz circuit drawing package version \pgfcircversion] diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcirc.defines.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcirc.defines.tex index 28e41a24d0..8f4777543d 100644 --- a/graphics/pgf/contrib/circuitikz/tex/pgfcirc.defines.tex +++ b/graphics/pgf/contrib/circuitikz/tex/pgfcirc.defines.tex @@ -743,6 +743,13 @@ \pgfkeys{/tikz/photo/.add code={}{\pgf@circuit@bpt@drawphototrue}} \ctikzset{photo/.add code={}{\pgf@circuit@bpt@drawphototrue}} +% Option draw fet without bulk connection -- Added by Burak Kelleci +\newif\ifpgf@circuit@bpt@drawbulk +\pgfkeys{/tikz/bulk/.add code={}{\pgf@circuit@bpt@drawbulktrue}} +\ctikzset{bulk/.add code={}{\pgf@circuit@bpt@drawbulktrue}} +\pgfkeys{/tikz/nobulk/.add code={}{\pgf@circuit@bpt@drawbulkfalse}} +\ctikzset{nobulk/.add code={}{\pgf@circuit@bpt@drawbulkfalse}} + % Option draw pmos with empty circle \newif\ifpgf@circuit@pmos@emptycircle \pgf@circuit@pmos@emptycirclefalse @@ -1017,6 +1024,31 @@ \ctikzset{tripoles/isfet/bodydiode distance/.initial=.3} \ctikzset{tripoles/isfet/bodydiode conn/.initial=.6} \ctikzset{tripoles/isfet/curr direction/.initial=1} +% +% multi-emitter and multi-collector BJTs by Romano Giannetti +% +\ctikzset{tripoles/bjt/emitters/.initial=1} +\ctikzset{tripoles/bjt/collectors/.initial=1} +\pgfkeys{/tikz/emitters/.add code={}{\ctikzset{tripoles/bjt/emitters=#1}}} +\pgfkeys{/tikz/collectors/.add code={}{\ctikzset{tripoles/bjt/collectors=#1}}} +\ctikzset{tripoles/bjt/pins width/.initial=0.3} +\pgfkeys{/tikz/bjt pins width/.add code={}{\ctikzset{tripoles/bjt/pins width=#1}}} +\ctikzset{tripoles/bjt/multi height/.initial=.5} +\pgfkeys{/tikz/bjt multi height/.add code={}{\ctikzset{tripoles/bjt/multi height/.initial=#1}}} +% +\ctikzset{tripoles/bjt/width/.initial=.3} +\ctikzset{tripoles/bjt/base height 2/.initial=.4} +\ctikzset{tripoles/bjt/base height/.initial=1.1} +\ctikzset{tripoles/bjt/height/.initial=.4} +\ctikzset{tripoles/bjt/base width/.initial=1} +\ctikzset{tripoles/bjt/arrow pos/.initial=.5} +% do NOT touch these two! +\ctikzset{tripoles/bjt/npn/curr direction/.initial=1} +\ctikzset{tripoles/bjt/pnp/curr direction/.initial=-1} + +%% transistors stop here + +%% Logic ports \newif\ifpgf@circuit@europeanlogicport \ctikzset{logic ports/.is choice} @@ -1221,8 +1253,8 @@ \newif\ifpgf@circuit@oa@iplusup\pgf@circuit@oa@iplusupfalse \pgfkeys{/tikz/noinv input up/.add code={}{\pgf@circuit@oa@iplusuptrue}} \ctikzset{noinv input up/.add code={}{\pgf@circuit@oa@iplusuptrue}} -\pgfkeys{/tikz/input noinv down/.add code={}{\pgf@circuit@oa@iplusupfalse}} -\ctikzset{input noinv down/.add code={}{\pgf@circuit@oa@iplusupfalse}} +\pgfkeys{/tikz/noinv input down/.add code={}{\pgf@circuit@oa@iplusupfalse}} +\ctikzset{noinv input down/.add code={}{\pgf@circuit@oa@iplusupfalse}} % % changing output polarity (for fully diff objects) % diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcirccurrent.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcirccurrent.tex index cc2bf8de14..b0d2a989bd 100644 --- a/graphics/pgf/contrib/circuitikz/tex/pgfcirccurrent.tex +++ b/graphics/pgf/contrib/circuitikz/tex/pgfcirccurrent.tex @@ -200,7 +200,8 @@ \edef\pgf@circ@ffffff{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil} } \fi - coordinate[currarrow,pos=\ctikzvalof{current/distance},rotate=\pgf@circ@ffffff](Iarrow) + coordinate[currarrow,pos=\ctikzvalof{current/distance},rotate=\pgf@circ@ffffff, + anchor=center](Iarrow) (Iarrow.\pgf@circ@bipole@current@label@where) node[anchor=\pgf@circ@dir, \circuitikzbasekey/bipole current style] (\ctikzvalof{bipole/name}current){\pgf@circ@finallabels{current/label}} diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircflow.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircflow.tex index 6af0af0ee0..c90b986eba 100644 --- a/graphics/pgf/contrib/circuitikz/tex/pgfcircflow.tex +++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircflow.tex @@ -195,7 +195,7 @@ \fi \fi } - coordinate[flowarrow,pos=\ctikzvalof{flow/distance},rotate=\pgf@circ@ffffff,yshift=\flow@offset](Farrowpos) + coordinate[flowarrow,pos=\ctikzvalof{flow/distance},rotate=\pgf@circ@ffffff,yshift=\flow@offset, anchor=center](Farrowpos) (Farrowpos.\pgf@circ@bipole@flow@label@where) node[anchor=\pgf@circ@dir, \circuitikzbasekey/bipole flow style] (\ctikzvalof{bipole/name}flow){\pgf@circ@finallabels{flow/label}} } diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircquadpoles.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircquadpoles.tex index facb041eff..31890ea44d 100644 --- a/graphics/pgf/contrib/circuitikz/tex/pgfcircquadpoles.tex +++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircquadpoles.tex @@ -180,6 +180,12 @@ } } +%% Null styles that can be used to change individually the L1 and L2 +%% inductors of the transformer. + +\ctikzset{transformer L1/.style={}} +\ctikzset{transformer L2/.style={}} + \def\pgf@circ@drawtransformerbasicbody{ \pgfscope \pgfslopedattimetrue @@ -194,6 +200,7 @@ {\pgf@circ@res@down}% } + \pgfkeys{\circuitikzbasekey/.cd, transformer L1} \edef\pgf@circ@temp{\ctikzvalof{inductor}}% \def\pgf@temp{european}% \ifx\pgf@temp\pgf@circ@temp% @@ -222,6 +229,7 @@ {\pgf@circ@res@up}% } + \pgfkeys{\circuitikzbasekey/.cd, transformer L2} \edef\pgf@circ@temp{\ctikzvalof{inductor}}% \def\pgf@temp{european}% \ifx\pgf@temp\pgf@circ@temp% @@ -266,23 +274,34 @@ \pgf@circ@drawtransformerbasicbody + % use the chocke line thickness + \pgfsetlinewidth{\ctikzvalof{bipoles/cutechoke/cthick}\pgflinewidth} + + % Find the distance from center for the lines representing the core + % the 2.5 is for backward compatibility --- the distance was calculated as a fraction + % of the whole component, now as a fraction of the distance between coils, to be + % compatible with the quadpoles "inner" style. + \pgfmathsetlength{\pgf@circ@res@other}{2.5*\stretto*\ctikzvalof{quadpoles/transformer core/core width}*\pgf@circ@res@right} + \pgfmoveto{\pgfpoint% - {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@right}% + {\pgf@circ@res@other}% {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}% } \pgflineto{ - \pgfpoint - {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@right}% + \pgfpoint% + {\pgf@circ@res@other}% {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}% } + %% this should be just -\pgf@circ@res@other, but in case someone define an asymmetric trafo someday... + \pgfmathsetlength{\pgf@circ@res@other}{2.5*\stretto*\ctikzvalof{quadpoles/transformer core/core width}*\pgf@circ@res@left} \pgfmoveto{\pgfpoint% - {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@left}% + {\pgf@circ@res@other}% {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}% } \pgflineto{ - \pgfpoint - {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@left}% + \pgfpoint% + {\pgf@circ@res@other}% {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}% } diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircshapes.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircshapes.tex index fdaad445ce..724f5ee350 100644 --- a/graphics/pgf/contrib/circuitikz/tex/pgfcircshapes.tex +++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircshapes.tex @@ -443,6 +443,96 @@ } } +%% transistor arrow + +\def\pgf@circ@find@linescale{ + % find the scale inverse of the scale factor: line width do not scale + % with scale=..., transform shape so we have to counteract it. + \iftikz@fullytransformed % this is true if `transform shape` is active + % from @Circumscribe https://tex.stackexchange.com/a/474035/38080 + % Note that this trick is not working inside a `spy` environment... + \pgfgettransformentries{\scaleA}{\scaleB}{\scaleC}{\scaleD}{\whatevs}{\whatevs}% + \pgfmathsetmacro{\@@factor}{1.0/sqrt(abs(\scaleA*\scaleD-\scaleB*\scaleC))}% + \else + \pgfmathsetmacro{\@@factor}{1.0} + \fi +} + +\pgfdeclareshape{trarrow}{% + % this arrow is only filled but grows with the linewidth, more or less + % like currarrow do + \savedanchor{\northeast}{% + \pgf@circ@res@step = \pgf@circ@Rlen + \pgf@circ@find@linescale + \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale} + \pgfpoint{0.7*\pgf@circ@res@step +0.5*\@@factor*\pgflinewidth} + {0.8*\pgf@circ@res@step+0.7593*\@@factor*\pgflinewidth} + } + % The arrow size should be more or less the same of a currarrow, which is + % both filled and stroke, for backward output compatibility (more or less) + % + % angle \beta W is \pgf@circ@Rlen/\ctikzvalof{current arrow scale} + % |-\__ currarrow as the tip at (W,0) + % | | and the upper tail at (-0.7*W, 0.8*W) + % | \__ it then "overshoot" do to the linew width L + % | \__ xangle \alpha + % ---0-------> + % + % \beta = atan(0.7/0.8) \alpha=atan(0.8/1.7) + % tip overshoot is (L/2)/sin(\alpha) = 1.743*L only in x direction + % tail overshoot is -(L/2) in x, and (L/2)/sin(\beta) = 0.7539*L in y + % + \savedanchor{\northwest}{% + \pgf@circ@res@step = \pgf@circ@Rlen + \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale} + \pgf@circ@find@linescale + \pgfpoint{-0.7*\pgf@circ@res@step -0.5*\@@factor*\pgflinewidth} + {0.8*\pgf@circ@res@step+0.7593*\@@factor*\pgflinewidth} + } + \savedanchor{\tip}{% + \pgf@circ@res@step = \pgf@circ@Rlen + \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale} + \pgf@circ@find@linescale + \pgfpoint{\pgf@circ@res@step + 1.743*\@@factor*\pgflinewidth}{0pt} + } + \anchor{north}{\northeast\pgf@x=0cm\relax} + \anchor{east}{\northeast\pgf@y=0cm\relax} + \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax} + \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x} + \anchor{north east}{\northeast} + \anchor{north west}{\northeast\pgf@x=-\pgf@x} + \anchor{south east}{\northeast\pgf@y=-\pgf@y} + \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x} + \anchor{center}{ + \pgfpointorigin + } + \anchor{tip}{ + \tip + } + \anchor{btip}{% this anchor is behind the tip of half a linewidth + \tip + \pgf@circ@find@linescale + \pgf@circ@res@temp=\@@factor\pgflinewidth + \advance\pgf@x by -.5\pgf@circ@res@temp + } + \behindforegroundpath{ + \pgfscope + \northwest + \pgf@circ@res@up=\pgf@y + \pgf@circ@res@left=\pgf@x + \tip + \pgf@circ@res@step = \pgf@x + % + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{0pt}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}} + \pgfpathclose + \pgfsetcolor{\ctikzvalof{color}} + \pgfusepath{fill} % just fill + \endpgfscope + } +} %% Current arrow @@ -506,6 +596,10 @@ \anchor{north west}{\northeast\pgf@x=-\pgf@x} \anchor{south east}{\northeast\pgf@y=-\pgf@y} \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x} + \anchor{text}{% text centered above + \pgfpointorigin + \pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox} + } \anchor{center}{ \pgfpointorigin } diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex index 73f1485b2b..0f193cedcc 100644 --- a/graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex +++ b/graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex @@ -1343,6 +1343,10 @@ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen} \pgf@x=-\ctikzvalof{tripoles/#1/width}\pgf@circ@scaled@Rlen } + \savedanchor\right{%center right -- added by Burak Kelleci % this is really 0,0 + \pgf@y=0pt + \pgf@x=0pt + } \anchor{text}{ \northeast \pgf@y=.7\pgf@y @@ -1409,6 +1413,16 @@ \left \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@circ@res@step } + \anchor{bulk}{ %added by Burak Kelleci + \northeast + \pgf@circ@res@step=\ctikzvalof{tripoles/#1/conn height}\pgf@y + \right + \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@circ@res@step + } + \anchor{nobulk}{ %added by Burak Kelleci + \left + \pgf@x=\ctikzvalof{tripoles/#1/base width}\pgf@x + } \anchor{G}{ \northeast \pgf@circ@res@step=\ctikzvalof{tripoles/#1/conn height}\pgf@y @@ -1537,7 +1551,16 @@ } \long\def\declarebpt#1{ - \pgfcircdeclaretransistor{#1}{}{ + \pgfcircdeclaretransistor{#1}{ + \anchor{inner up}{ + \northeast + \pgf@y=\ctikzvalof{tripoles/#1/base height}\pgf@y + } + \anchor{inner down}{ + \northeast + \pgf@y=-\ctikzvalof{tripoles/#1/base height}\pgf@y + } + }{ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up}} @@ -1572,7 +1595,7 @@ \edef\@@anchor{center} \ifpgf@circuit@trans@ntype \ifpgf@circuit@trans@arrowatend - \edef\@@anchor{tip} + \edef\@@anchor{btip} \pgftransformlineattime{1.0}{% \pgfpoint% {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}% @@ -1591,7 +1614,7 @@ {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down}% } \fi - \else + \else % p-type \ifpgf@circuit@trans@arrowatend \edef\@@anchor{tip} \pgftransformlineattime{1.0}{% @@ -1611,7 +1634,7 @@ } \fi \fi - \pgfnode{currarrow}{\@@anchor}{}{}{\pgfusepath{stroke}} + \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}} \endpgfscope \ifpgf@circuit@bpt@drawphoto @@ -1650,9 +1673,327 @@ \declarebpt{npn} \declarebpt{pnp} +% +% multi-emitter and multi-collector BJTs by Romano Giannetti +% +\def\pgf@circ@bjt@C@anchor#1{% #1: collector number + \pgfextractx{\pgf@circ@res@temp}{\basedimension} + \pgfextracty{\pgf@circ@res@other}{\basedimension} + \ifnum\cdir>0 % NPN, above + \pgfpoint{\pgf@circ@res@temp}{% + \pgf@circ@res@other+\pgfverticaltransformationadjustment*.5*\pgflinewidth+(#1-1)*\multistep} + \else % PNP, below + \pgfpoint{\pgf@circ@res@temp}{% + -\pgf@circ@res@other-\pgfverticaltransformationadjustment*.5*\pgflinewidth-(#1-1)*\multistep} + \fi +} +\def\pgf@circ@bjt@E@anchor#1{% #1: collector number + \pgfextractx{\pgf@circ@res@temp}{\basedimension} + \pgfextracty{\pgf@circ@res@other}{\basedimension} + \ifnum\cdir<0 % PNP, above + \pgfpoint{\pgf@circ@res@temp}{% + \pgf@circ@res@other+\pgfverticaltransformationadjustment*.5*\pgflinewidth+(#1-1)*\multistep} + \else % PNP, below + \pgfpoint{\pgf@circ@res@temp}{% + -\pgf@circ@res@other-\pgfverticaltransformationadjustment*.5*\pgflinewidth-(#1-1)*\multistep} + \fi +} + +\long\def\declarebjt#1{ + \pgfdeclareshape{bjt#1}{ + \savedmacro{\ctikzclass}{\edef\ctikzclass{transistors}} + \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}} + % \cdir is 1 for npn, -1 for pnp + \savedmacro{\cdir}{\edef\cdir{\ctikzvalof{tripoles/bjt/#1/curr direction}}} + \savedmacro{\numE}{\edef\numE{\ctikzvalof{tripoles/bjt/emitters}}} + \savedmacro{\numC}{\edef\numC{\ctikzvalof{tripoles/bjt/collectors}}} + % step up or down for the additional C/Es + \saveddimen{\multistep}{\pgfmathsetlength{\pgf@x}{% + \ctikzvalof{tripoles/bjt/height}*\ctikzvalof{tripoles/bjt/multi height}* + \ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}} + \saveddimen{\external}{\pgfmathsetlength{\pgf@x}{% + \ctikzvalof{tripoles/bjt/pins width}*\ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}} + \savedanchor\basedimension{% these are the dimensions if nC=1 y nE=1 + \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen} + \pgf@y=\ctikzvalof{tripoles/bjt/height}\pgf@circ@scaled@Rlen + \pgf@y=.5\pgf@y + \pgf@x=\ctikzvalof{tripoles/bjt/width}\pgf@circ@scaled@Rlen + \pgf@x=.5\pgf@x + } + \savedanchor\northeast{% upper right + \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen} + \pgfmathsetlength{\pgf@circ@res@step}{% + \ctikzvalof{tripoles/bjt/height}*\ctikzvalof{tripoles/bjt/multi height}* + \ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen} + \ifnum\cdir> 0 + \edef\numup{\numC}\edef\numdown{\numE} + \else + \edef\numup{\numE}\edef\numdown{\numC} + \fi + \pgfmathsetlength{\pgf@y}{0.5*\ctikzvalof{tripoles/bjt/height}\pgf@circ@scaled@Rlen + + (\numup-1)*\pgf@circ@res@step+\pgfverticaltransformationadjustment*.5*\pgflinewidth + + \ctikzvalof{tripoles/bjt/pins width}*\ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen} + \pgf@x=\ctikzvalof{tripoles/bjt/width}\pgf@circ@scaled@Rlen + \pgf@x=.5\pgf@x + } + \savedanchor\southeast{% lower right + \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen} + \pgfmathsetlength{\pgf@circ@res@step}{% + \ctikzvalof{tripoles/bjt/height}*\ctikzvalof{tripoles/bjt/multi height}* + \ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen} + \ifnum\cdir> 0 + \edef\numup{\numC}\edef\numdown{\numE} + \else + \edef\numup{\numE}\edef\numdown{\numC} + \fi + \pgfmathsetlength{\pgf@y}{-0.5*\ctikzvalof{tripoles/bjt/height}\pgf@circ@scaled@Rlen + - (\numdown-1)*\pgf@circ@res@step-\pgfverticaltransformationadjustment*.5*\pgflinewidth + - \ctikzvalof{tripoles/bjt/pins width}*\ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen} + \pgf@x=\ctikzvalof{tripoles/bjt/width}\pgf@circ@scaled@Rlen + \pgf@x=.5\pgf@x + } + \savedanchor\southwest{% lower left + \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen} + \pgfmathsetlength{\pgf@circ@res@step}{% + \ctikzvalof{tripoles/bjt/height}*\ctikzvalof{tripoles/bjt/multi height}* + \ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen} + \ifnum\cdir> 0 + \edef\numup{\numC}\edef\numdown{\numE} + \else + \edef\numup{\numE}\edef\numdown{\numC} + \fi + \pgfmathsetlength{\pgf@y}{-0.5*\ctikzvalof{tripoles/bjt/height}\pgf@circ@scaled@Rlen + - (\numdown-1)*\pgf@circ@res@step-\pgfverticaltransformationadjustment*.5*\pgflinewidth + - \ctikzvalof{tripoles/bjt/pins width}*\ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen} + \pgfmathsetlength{\pgf@x}{-0.5*\ctikzvalof{tripoles/bjt/width}*\pgf@circ@scaled@Rlen + - \ctikzvalof{tripoles/bjt/pins width}*\ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen} + } + \anchor{center}{\pgfpointorigin} + \anchor{north}{\northeast\pgf@x=0cm\relax} + \anchor{east}{\northeast\pgf@y=0cm\relax} + \anchor{south}{\southwest\pgf@x=0cm\relax} + \anchor{west}{\southwest\pgf@y=0cm} + \anchor{north east}{\northeast} + \anchor{north west}{\northeast\pgf@ya=\pgf@y\southwest\pgf@y=\pgf@ya} + \anchor{south west}{\southwest} + \anchor{south east}{\southeast} + + \anchor{text}{\northeast\pgf@y=\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax} + \anchor{B}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x\advance\pgf@x by -\external} + \anchor{base}{\basedimension\pgf@y=0cm\pgf@x=-\pgf@x\advance\pgf@x by -\external} + \anchor{nobase}{\basedimension\pgf@y=0cm\pgf@x=-\pgf@x} + % center of the base "bar" + \anchor{cbase}{\basedimension\pgf@x=-\pgf@x + \pgfmathsetlength{\pgf@y}{\cdir*(\numC-\numE)*\multistep/2}% + } + % geometrical centers + \anchor{vcenter}{\pgf@x=0cm\relax + \pgfmathsetlength{\pgf@y}{\cdir*(\numC-\numE)*\multistep/2}% + } + \anchor{gcenter}{% + \northeast\pgf@xa=0.5\pgf@x + \southwest\advance\pgf@xa by 0.5\pgf@x + \pgf@x=\pgf@xa + \pgfmathsetlength{\pgf@y}{\cdir*(\numC-\numE)*\multistep/2}% + } + % external connections + \anchor{E}{ + \ifnum\cdir>0% npn, emitter down + \southeast + \else + \northeast + \fi + }% first emitter + \anchor{emitter}{\ifnum\cdir>0\southeast\else\northeast\fi}% first emitter + \anchor{C}{\ifnum\cdir<0\southeast\else\northeast\fi} + \anchor{collector}{\ifnum\cdir<0\southeast\else\northeast\fi} + + \backgroundpath{ + \pgftransformationadjustments + \pgfsetcolor{\ctikzvalof{color}} + % + % set the type and up and down number of connections + % + \ifnum\cdir> 0 + \pgf@circuit@trans@ntypetrue + \edef\numup{\numC} + \edef\numdown{\numE} + \else + \pgf@circuit@trans@ntypefalse + \edef\numup{\numE} + \edef\numdown{\numC} + \fi + \basedimension + \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@scaled@Rlen=\scaledRlen + \pgf@circ@res@step=\multistep + % + % set arrow positions options + % + \edef\@@anchor{center}\edef\@@pos{\ctikzvalof{tripoles/#1/arrow pos}} + \ifpgf@circuit@trans@arrowatend + \edef\@@pos{1.0} + \ifpgf@circuit@trans@ntype % arrow is toward outside, push it a bit + \edef\@@anchor{btip} + \else + \edef\@@anchor{tip} + \fi + \fi + % + % Drawing upper connections + % + \pgfscope + \pgf@circ@count@a=\numup\relax + \pgfmathloop% + \ifnum\pgf@circ@count@a>0 + \advance\pgf@circ@count@a-1\relax + \pgfmathsetlength{\pgf@circ@res@other}{\the\pgf@circ@count@a*\multistep}% + \ifnum\pgf@circ@count@a=\numexpr\numup-1\relax % draw the external pin connection + \pgfpathmoveto{\pgfpoint + {\pgf@circ@res@right}% + {\pgf@circ@res@up+\external+\pgfverticaltransformationadjustment*.5*\pgflinewidth+\pgf@circ@res@other}}% + \pgfpathlineto{\pgfpoint + {\pgf@circ@res@right}% + {\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth+\pgf@circ@res@other}}% + \else + \pgfpathmoveto{\pgfpoint + {\pgf@circ@res@right}% + {\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth+\pgf@circ@res@other}}% + \fi + \pgfpathlineto{\pgfpoint + {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}% + {\ctikzvalof{tripoles/bjt/base height 2}\pgf@circ@res@up+\pgf@circ@res@other}}% + \pgfsetroundcap % better when connecting to sloped lines + \pgfusepath{draw} + \ifpgf@circuit@trans@ntype\else % it's a PNP; draw arrow + \pgfscope + \pgfslopedattimetrue + \pgfallowupsidedownattimetrue + \pgfresetnontranslationattimefalse + \pgftransformlineattime{\@@pos}{% + \pgfpoint + {\pgf@circ@res@right}% + {\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth+\pgf@circ@res@other}% + }{\pgfpoint + {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}% + {\ctikzvalof{tripoles/bjt/base height 2}\pgf@circ@res@up+\pgf@circ@res@other}% + } + \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}} + \endpgfscope + \fi + \repeatpgfmathloop + \endpgfscope + % + % Drawing base + % + \pgfscope + \pgfpathmoveto{\pgfpoint + {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left} + {\ctikzvalof{tripoles/bjt/base height}\pgf@circ@res@up+(\numup-1)*\multistep}} + \pgfpathlineto{\pgfpoint + {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left} + {\ctikzvalof{tripoles/bjt/base height}\pgf@circ@res@down-(\numdown-1)*\multistep}} + \pgf@circ@setlinewidth{tripoles}{\pgflinewidth} + \pgfsetroundcap % I like it more... + \pgfusepath{draw} + \endpgfscope + % + % draw base external connection + % + \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left-\external}{0pt}} + \pgfusepath{draw} + % + % Drawing lower connections + % + \pgfscope + \pgf@circ@count@a=\numdown\relax + \pgfmathloop% + \ifnum\pgf@circ@count@a>0 + \advance\pgf@circ@count@a-1\relax + \pgfmathsetlength{\pgf@circ@res@other}{\the\pgf@circ@count@a*\multistep}% + \pgfpathmoveto{\pgfpoint + {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left} + {\ctikzvalof{tripoles/bjt/base height 2}\pgf@circ@res@down-\pgf@circ@res@other}} + \pgfpathlineto{\pgfpoint + {\pgf@circ@res@right} + {\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth-\pgf@circ@res@other}} + \ifnum\pgf@circ@count@a=\numexpr\numdown-1\relax % draw the external pin connection + \pgfpathlineto{\pgfpoint + {\pgf@circ@res@right} + {\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth-\pgf@circ@res@other-\external}} + \fi + \pgfsetroundcap % better when connecting to sloped lines + \pgfusepath{draw} + \ifpgf@circuit@trans@ntype % it's a NPN; draw arrow + \pgfscope + \pgfslopedattimetrue + \pgfallowupsidedownattimetrue + \pgfresetnontranslationattimefalse + \pgftransformlineattime{\@@pos}{% + \pgfpoint + {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}% + {\ctikzvalof{tripoles/bjt/base height 2}\pgf@circ@res@down-\pgf@circ@res@other}% + }{\pgfpoint + {\pgf@circ@res@right}% + {\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth-\pgf@circ@res@other}% + } + \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}} + \endpgfscope + \fi + \repeatpgfmathloop + \endpgfscope + } + % \pgf@sh@s@ contains all the code for the shape + % and is executed just before a node is drawn. + \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@bjt#1\endcsname{% + % Start with the maximum collector number and go backwards. + \pgf@circ@count@a=\numC\relax + \pgfmathloop% + \ifnum\pgf@circ@count@a>0 + % we will create two anchors per pin: the "normal one" like `pin 1` for the + % electrical contact, and the "border one" like `bpin 1` for labels. + % they will coincide if `external pins width` is set to 0. + \expandafter\xdef\csname pgf@anchor@bjt#1@C\the\pgf@circ@count@a\endcsname{% + \noexpand\pgf@circ@bjt@C@anchor{\the\pgf@circ@count@a}% + } + \advance\pgf@circ@count@a by -1\relax% + \repeatpgfmathloop% + % and emitters + \pgf@circ@count@a=\numE\relax + \pgfmathloop% + \ifnum\pgf@circ@count@a>0 + % we will create two anchors per pin: the "normal one" like `pin 1` for the + % electrical contact, and the "border one" like `bpin 1` for labels. + % they will coincide if `external pins width` is set to 0. + \expandafter\xdef\csname pgf@anchor@bjt#1@E\the\pgf@circ@count@a\endcsname{% + \noexpand\pgf@circ@bjt@E@anchor{\the\pgf@circ@count@a}% + } + \advance\pgf@circ@count@a by -1\relax% + \repeatpgfmathloop% + }% + } +} + +\declarebjt{npn} +\declarebjt{pnp} + +% end of multi-bjts \long\def\declareigbt#1{ - \pgfcircdeclaretransistor{#1}{} + \pgfcircdeclaretransistor{#1}{ + \anchor{inner up}{ + \northeast + \pgf@y=\ctikzvalof{tripoles/#1/gate height}\pgf@y + } + \anchor{inner down}{ + \northeast + \pgf@y=-\ctikzvalof{tripoles/#1/gate height}\pgf@y + } + } { %draw upper connection \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}} @@ -1694,7 +2035,11 @@ \pgfallowupsidedownattimetrue \pgfresetnontranslationattimefalse \ifpgf@circuit@trans@arrowatend - \edef\@@anchor{tip}\edef\@@pos{1.0} + \ifpgf@circuit@trans@ntype + \edef\@@anchor{btip}\edef\@@pos{1.0} + \else + \edef\@@anchor{tip}\edef\@@pos{1.0} + \fi \else \edef\@@anchor{center}\edef\@@pos{0.5} \fi @@ -1716,7 +2061,7 @@ {\ctikzvalof{tripoles/#1/gate height 2}\pgf@circ@res@up}% } \fi - \pgfnode{currarrow}{\@@anchor}{}{}{\pgfusepath{stroke}} + \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}} \endpgfscope %draw gate \ifpgf@circuit@trans@ntype @@ -1741,7 +2086,16 @@ \declareigbt{Lnigbt} \declareigbt{Lpigbt} -\pgfcircdeclaretransistor{nmos}{}{% +\pgfcircdeclaretransistor{nmos}{ + \anchor{inner up}{ + \northeast + \pgf@y=\ctikzvalof{tripoles/nmos/gate height}\pgf@y + } + \anchor{inner down}{ + \northeast + \pgf@y=-\ctikzvalof{tripoles/nmos/gate height}\pgf@y + } + }{% \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@up}} @@ -1780,7 +2134,7 @@ {\pgf@circ@res@right}% {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@down}% } - \pgfnode{currarrow}{tip}{}{}{\pgfusepath{stroke}} + \pgfnode{trarrow}{btip}{}{}{\pgfusepath{stroke}} \else \pgfslopedattimetrue \pgfallowupsidedownattimetrue @@ -1806,9 +2160,26 @@ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}} \pgfusepath{draw} \fi + + \ifpgf@circuit@bpt@drawbulk % added by Burak Kelleci + \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/nmos/base width}\pgf@circ@res@left} + {\pgf@circ@res@up+\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth} + {\pgf@circ@res@up+\pgf@circ@res@down}} + \pgfusepath{draw} + \fi } -\pgfcircdeclaretransistor{pmos}{}{% +\pgfcircdeclaretransistor{pmos}{ + \anchor{inner up}{ + \northeast + \pgf@y=\ctikzvalof{tripoles/pmos/gate height}\pgf@y + } + \anchor{inner down}{ + \northeast + \pgf@y=-\ctikzvalof{tripoles/pmos/gate height}\pgf@y + } + }{% \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@up}} @@ -1825,7 +2196,7 @@ {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@up}% } \pgftransformrotate{180} - \pgfnode{currarrow}{tip}{}{}{\pgfusepath{stroke}} + \pgfnode{trarrow}{tip}{}{}{\pgfusepath{stroke}} \else \pgfslopedattimetrue \pgfallowupsidedownattimetrue @@ -1877,7 +2248,16 @@ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}} \pgfusepath{draw} \fi - \ifpgf@circuit@pmos@nocircle\else + + \ifpgf@circuit@bpt@drawbulk % added by Burak Kelleci + \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/pmos/base width}\pgf@circ@res@left} + {\pgf@circ@res@up+\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth} + {\pgf@circ@res@up+\pgf@circ@res@down}} + \pgfusepath{draw} + \fi + + \ifpgf@circuit@pmos@nocircle\else % we are not scaling the circle with the MOS --- I think it's better to have it % coherent with the poles/nodes of the rest of the circuit. \pgfpathcircle{\pgfpoint @@ -1891,7 +2271,16 @@ } %% HEMT FET Transistor -\pgfcircdeclaretransistor{hemt}{}{% +\pgfcircdeclaretransistor{hemt}{ + \anchor{inner up}{ + \northeast + \pgf@y=\ctikzvalof{tripoles/hemt/gate height}\pgf@y + } + \anchor{inner down}{ + \northeast + \pgf@y=-\ctikzvalof{tripoles/hemt/gate height}\pgf@y + } + }{% \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} {\ctikzvalof{tripoles/hemt/gate height}\pgf@circ@res@up}} @@ -1998,10 +2387,11 @@ \pgfallowupsidedownattimetrue \pgfresetnontranslationattimefalse \ifpgf@circuit@trans@arrowatend - \edef\@@anchor{tip} \ifpgf@circuit@trans@ntype + \edef\@@anchor{tip} \edef\@@pos{1.0} \else + \edef\@@anchor{btip} \edef\@@pos{0.0} \fi \else @@ -2020,7 +2410,7 @@ \else \pgftransformrotate{180} \fi - \pgfnode{currarrow}{\@@anchor}{}{}{\pgfusepath{stroke}} + \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}} \endpgfscope % GATE CONNECTION @@ -2045,6 +2435,14 @@ {\pgfcircdeclaretransistor{#1}{ \anchor{bulk}{\left\pgf@x=0pt} \anchor{B}{\left\pgf@x=0pt}%override Base anchor from npn&igbt + \anchor{inner up}{ + \northeast + \pgf@y=\ctikzvalof{tripoles/#1/gate height}\pgf@y + } + \anchor{inner down}{ + \northeast + \pgf@y=-\ctikzvalof{tripoles/#1/gate height}\pgf@y + } #2 } {#3} @@ -2163,7 +2561,16 @@ \fi } -\pgfcircdeclaretransistor{njfet}{}{% +\pgfcircdeclaretransistor{njfet}{ + \anchor{inner up}{ + \northeast + \pgf@y=\ctikzvalof{tripoles/njfet/gate height 2}\pgf@y + } + \anchor{inner down}{ + \northeast + \pgf@y=-\ctikzvalof{tripoles/njfet/gate height 2}\pgf@y + } + }{% \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@up}} @@ -2208,7 +2615,7 @@ {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left}% {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}% } - \pgfnode{currarrow}{\@@anchor}{}{}{\pgfusepath{stroke}} + \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}} \endpgfscope \pgfpathmoveto{\pgfpoint @@ -2219,7 +2626,16 @@ \pgfusepath{draw} } -\pgfcircdeclaretransistor{pjfet}{}{% +\pgfcircdeclaretransistor{pjfet}{ + \anchor{inner up}{ + \northeast + \pgf@y=\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@y + } + \anchor{inner down}{ + \northeast + \pgf@y=-\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@y + } + }{% \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}} @@ -2251,7 +2667,7 @@ \pgfallowupsidedownattimetrue \pgfresetnontranslationattimefalse \ifpgf@circuit@trans@arrowatend - \edef\@@anchor{tip}\edef\@@pos{1.0} + \edef\@@anchor{btip}\edef\@@pos{1.0} \else \edef\@@anchor{center}\edef\@@pos{0.4} \fi @@ -2263,7 +2679,7 @@ \pgfpoint{\pgf@circ@res@left}% {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}% } - \pgfnode{currarrow}{\@@anchor}{}{}{\pgfusepath{stroke}} + \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}} \endpgfscope \pgfpathmoveto{\pgfpoint @@ -2342,7 +2758,7 @@ {\ctikzvalof{tripoles/isfet/base width}\pgf@circ@res@left}% {\pgf@circ@res@up+\pgf@circ@res@down}% } - \pgfnode{currarrow}{\@@anchor}{}{}{\pgfusepath{stroke}} + \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}} \endpgfscope \pgfusepath{draw} @@ -2856,33 +3272,33 @@ \pgf@circ@res@step=\pgf@circ@res@right \advance\pgf@circ@res@step by -\pgf@circ@res@left \pgf@circ@res@step=\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@step - + % Initial point (right vertex) \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}} - + % Negative output terminal \pgfpathlineto{\pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}{\pgfpoint{\pgf@circ@res@step}{0pt}}{\pgfpoint{0pt}{\pgf@circ@res@up}}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\ctikzvalof{tripoles/fd op amp/output height}\pgf@circ@res@up}} \pgfpathlineto{\pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}{\pgfpoint{\pgf@circ@res@step}{0pt}}{\pgfpoint{0pt}{\pgf@circ@res@up}}} - + % Top vertex \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} - + % Bottom vertex \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} - + % Positive output terminal \pgfpathlineto{\pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}{\pgfpoint{\pgf@circ@res@step}{0pt}}{\pgfpoint{0pt}{\pgf@circ@res@down}}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\ctikzvalof{tripoles/fd op amp/output height}\pgf@circ@res@down}} \pgfpathlineto{\pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}{\pgfpoint{\pgf@circ@res@step}{0pt}}{\pgfpoint{0pt}{\pgf@circ@res@down}}} - + % Right vertex \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}} - + \pgfpathclose \pgf@circ@draworfill \endpgfscope - + % Negative input terminal \pgfpathmoveto{\pgfpoint {\pgf@circ@res@left} @@ -3092,7 +3508,7 @@ \pgfscope \newdimen\pgf@circ@res@right@double \pgf@circ@res@right@double=2\pgf@circ@res@right - + \pgf@circ@setlinewidth{tripoles}{\pgflinewidth} \pgftransformxshift{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left} \pgf@circ@res@step=\pgf@circ@res@right @@ -3110,7 +3526,7 @@ \pgfpathclose \pgf@circ@draworfill \endpgfscope - + % input terminal up \pgfpathmoveto{\pgfpoint {\pgf@circ@res@left} @@ -3131,12 +3547,12 @@ {\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left} {\ctikzvalof{tripoles/fd inst amp/input height}\pgf@circ@res@down}} \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/fd inst amp/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/fd inst amp/font} \ifpgf@circuit@oa@iplusup$-$\else$+$\fi} - + % output leads down and up \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@down}} % \pgftext[right, at=\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/fd inst amp/font}\ifpgf@circuit@oa@oplusup$-\;$\else$+\;$\fi} - + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@up}} % \pgftext[right, at=\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/fd inst amp/font}\ifpgf@circuit@oa@oplusup$+\;$\else$-\;$\fi} @@ -3260,8 +3676,8 @@ \pgfscope \newdimen\pgf@circ@res@right@double - \pgf@circ@res@right@double=2\pgf@circ@res@right - + \pgf@circ@res@right@double=2\pgf@circ@res@right + \pgf@circ@setlinewidth{tripoles}{\pgflinewidth} \pgftransformxshift{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@left} \pgf@circ@res@step=\pgf@circ@res@right @@ -3452,7 +3868,7 @@ \pgfscope \newdimen\pgf@circ@res@right@double \pgf@circ@res@right@double=2\pgf@circ@res@right - + \pgf@circ@setlinewidth{tripoles}{\pgflinewidth} \pgftransformxshift{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left} \pgf@circ@res@step=\pgf@circ@res@right @@ -3470,7 +3886,7 @@ \pgfpathclose \pgf@circ@draworfill \endpgfscope - + % Negative input terminal \pgfpathmoveto{\pgfpoint {\pgf@circ@res@left} @@ -3491,7 +3907,7 @@ {\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left} {\ctikzvalof{tripoles/inst amp/input height}\pgf@circ@res@down}} \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/inst amp/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/inst amp/font} \ifpgf@circuit@oa@iplusup$-$\else$+$\fi} - + % Output terminal \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@right}{0pt}} % @@ -3675,7 +4091,7 @@ \pgf@circ@res@right = -\pgf@x \pgf@circ@res@left = \pgf@x \pgf@circ@scaled@Rlen=\scaledRlen - + \newdimen\pgf@circ@res@right@double \pgf@circ@res@right@double=2\pgf@circ@res@right @@ -3715,8 +4131,8 @@ \pgfpathlineto{\pgfpoint {\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left} {-\ctikzvalof{tripoles/inst amp ra/ra pos}\pgf@circ@Rlen}} - - % Negative input terminal + + % Negative input terminal \pgfpathmoveto{\pgfpoint {\pgf@circ@res@left} {\ctikzvalof{tripoles/inst amp ra/input height}\pgf@circ@res@up}} @@ -3736,7 +4152,7 @@ {\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left} {\ctikzvalof{tripoles/inst amp ra/input height}\pgf@circ@res@down}} \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/inst amp ra/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/inst amp ra/font} \ifpgf@circuit@oa@iplusup$-$\else$+$\fi} - + % Output terminal \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@right}{0pt}} % diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircvoltage.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircvoltage.tex index bad64d1bd8..d793320247 100644 --- a/graphics/pgf/contrib/circuitikz/tex/pgfcircvoltage.tex +++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircvoltage.tex @@ -262,11 +262,11 @@ \else \ifpgf@circuit@bipole@voltage@backward (pgfcirc@Vto) .. controls (pgfcirc@Vcont2) and (pgfcirc@Vcont1) .. - node[currarrow, sloped, allow upside down, pos=1] {} + node[currarrow, sloped, allow upside down, pos=1, anchor=tip] {} (pgfcirc@Vfrom) \else (pgfcirc@Vfrom) .. controls (pgfcirc@Vcont1) and (pgfcirc@Vcont2) .. - node[currarrow, sloped, allow upside down, pos=1] {} + node[currarrow, sloped, allow upside down, pos=1, anchor=tip] {} (pgfcirc@Vto) \fi \fi @@ -320,9 +320,9 @@ coordinate (pgfcirc@Vcont2) at (pgfcirc@Vfrom) \ifpgf@circuit@europeanvoltage \ifpgf@circuit@bipole@voltage@backward - (pgfcirc@Vto) -- node[currarrow, sloped, allow upside down, pos=1] {} (pgfcirc@Vfrom) + (pgfcirc@Vto) -- node[currarrow, sloped, allow upside down, pos=1, anchor=tip] {} (pgfcirc@Vfrom) \else - (pgfcirc@Vfrom) -- node[currarrow, sloped, allow upside down, pos=1] {} (pgfcirc@Vto) + (pgfcirc@Vfrom) -- node[currarrow, sloped, allow upside down, pos=1, anchor=tip] {} (pgfcirc@Vto) \fi \else% american voltage \ifpgf@circuit@bipole@voltageoutsideofsymbol diff --git a/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex b/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex index c1b973efb2..301118a9cb 100644 --- a/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex +++ b/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex @@ -1,5 +1,5 @@ -\def\pgfcircversion{0.9.5} -\def\pgfcircversiondate{2019/10/12} +\def\pgfcircversion{0.9.6} +\def\pgfcircversiondate{2019/11/09} \writestatus{loading}{\pgfcircversiondate{} The CircuiTikz circuit drawing package version \pgfcircversion} \usemodule[tikz] -- cgit v1.2.3