From c2891584a71bef79217edf0f155772dae1f68b61 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 27 Nov 2009 01:23:48 +0000 Subject: circuitikz 0.2.3 (26nov09) git-svn-id: svn://tug.org/texlive/trunk@16183 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/circuitikz/CHANGELOG | 26 +- Master/texmf-dist/doc/latex/circuitikz/README | 10 +- .../doc/latex/circuitikz/circuitikzmanual.pdf | Bin 262939 -> 337782 bytes .../doc/latex/circuitikz/circuitikzmanual.tex | 500 ++++-- Master/texmf-dist/doc/latex/circuitikz/context.pdf | Bin 0 -> 48571 bytes Master/texmf-dist/doc/latex/circuitikz/context.tex | 20 + .../tex/latex/circuitikz/circuitikz.code.tex | 486 ++++++ .../texmf-dist/tex/latex/circuitikz/circuitikz.sty | 703 ++------ .../tex/latex/circuitikz/circuitikz1.code.tex | 437 +++++ .../tex/latex/circuitikz/pgfcircbipoles.sty | 417 +++-- .../tex/latex/circuitikz/pgfcirccurrent.sty | 26 +- .../tex/latex/circuitikz/pgfcirclabel.sty | 19 +- .../tex/latex/circuitikz/pgfcircmonopoles.sty | 7 +- .../tex/latex/circuitikz/pgfcircquadpoles.sty | 73 +- .../tex/latex/circuitikz/pgfcirctripoles.sty | 1747 ++++++++++++++++++-- .../tex/latex/circuitikz/pgfcircutils.sty | 19 +- .../tex/latex/circuitikz/pgfcircvoltage.sty | 120 +- .../tex/latex/circuitikz/t-circuitikz.tex | 95 ++ 18 files changed, 3613 insertions(+), 1092 deletions(-) create mode 100644 Master/texmf-dist/doc/latex/circuitikz/context.pdf create mode 100644 Master/texmf-dist/doc/latex/circuitikz/context.tex create mode 100644 Master/texmf-dist/tex/latex/circuitikz/circuitikz.code.tex create mode 100644 Master/texmf-dist/tex/latex/circuitikz/circuitikz1.code.tex create mode 100644 Master/texmf-dist/tex/latex/circuitikz/t-circuitikz.tex (limited to 'Master') diff --git a/Master/texmf-dist/doc/latex/circuitikz/CHANGELOG b/Master/texmf-dist/doc/latex/circuitikz/CHANGELOG index 64227cc2576..89e1fc2f755 100644 --- a/Master/texmf-dist/doc/latex/circuitikz/CHANGELOG +++ b/Master/texmf-dist/doc/latex/circuitikz/CHANGELOG @@ -1,12 +1,36 @@ CircuiTikz - Changelog +* Version 0.2.3 + - fixed compatibility problem with label option from tikz + - Fixed resizing problem for shape ground + - Variable capacitor + - polarized capacitor + - ConTeXt support (read the manual!) + - nfet, nigfete, nigfetd, pfet, pigfete, pigfetd (contribution of Clemens Helfmeier and Theodor +Borsche) + - njfet, pjfet (contribution of Danilo Piazzalunga) + - pigbt, nigbt + - *backward incompatibility* potentiometer is now the standard resistor-with-arrow-in-the-middle; the old potentiometer is now known as variable resistor (or vR), similarly to variable inductor and variable capacitor + - triac, thyristor, memristor + - new property "name" for bipoles + - fixed voltage problem for batteries in american voltage mode + - european logic gates + - *backward incompatibility* new american standard inductor. Old american inductor now called "cute inductor" + - *backward incompatibility* transformer now linked with the chosen type of inductor, and version with core, too. Similarly for variable inductor + - *backward incompatibility* styles for selecting shape variants now end are in the plural to avoid conflict with paths + - new placing option for some tripoles (mostly transistors) + - mirror path style + + * Version 0.2.2 - 20090520 - - Added the shape for lamps. + - Added the shape for lamps. - Added options \texttt{europeanresistor}, \texttt{europeaninductor}, \texttt{americanresistor} and \texttt{americaninductor}, with corresponding styles. - FIXED: error in transistor arrow positioning and direction under negative \texttt{xscale} and \texttt{yscale}. + * Version 0.2.1 - 20090503 - Op-amps added - added options arrowmos and noarrowmos, to add arrows to pmos and nmos + * Version 0.2 - 20090417 First public release on CTAN - *Backward incompatibility*: labels ending with \texttt{:}\textit{angle} are not parsed for positioning anymore. diff --git a/Master/texmf-dist/doc/latex/circuitikz/README b/Master/texmf-dist/doc/latex/circuitikz/README index 883d4728dc2..8dfab0ddae4 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.2. +This is CircuiTikz, version 0.2.3. This package provides a set of macros for naturally typesetting electrical and (somewhat less naturally, perhaps) electronical networks. @@ -9,8 +9,8 @@ So I based everything with the very impressive (if somewhat verbose at times) \T -------------- ** Requirements -Tikz graphics library - +Tikz graphics library, version 2 +xstrings not older than 2009/03/13 ** Installation Unpack everything in a directory in the TeX search path and refresh the TeX db. @@ -19,6 +19,10 @@ Unpack everything in a directory in the TeX search path and refresh the TeX db. Just place \usepackage{circuitikz} + +or, for ConTeXt, + + \usemodule[circuitikz] in the preamble and compile away, both with PS and PDF target output. diff --git a/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.pdf b/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.pdf index eeb44b5d24b..51eaa7711eb 100644 Binary files a/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.pdf and b/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.pdf differ diff --git a/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.tex b/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.tex index ffd294534d1..d00398a98eb 100644 --- a/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.tex +++ b/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.tex @@ -1,12 +1,12 @@ \documentclass[a4paper]{article} - +\usepackage{xltxtra} \usepackage[siunitx]{circuitikz} \usepackage{showexpl} \usepackage{framed} \usepackage{hyperref} \hypersetup{ bookmarks=false, % show bookmarks bar? - pdftitle={CircuitTikZ v. 0.2.2 - manual}, % title + pdftitle={CircuitTikZ v. \pgfcircversion\ - manual}, % title pdfauthor={Massimo Redaelli}, % author pdfsubject={CircuitTikZ manual}, % subject of the document pdfkeywords={}, % list of keywords @@ -17,22 +17,34 @@ urlcolor=black % color of external links } -\def\circuititem#1#2#3{\item #2 (\texttt{#1}) \par \begin{center}\begin{circuitikz} \draw (0,0) node[#1] {}; \end{circuitikz} \end{center} +%\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} \par} -\newcommand{\circuititembip}[3]{\item #2 (\texttt{#1}% +\newcommand{\circuititembip}[3]{\item {#2} (\texttt{#1}% \ifthenelse{\equal{#3}{}}{% }{% , or \texttt{#3}% }% )\par \begin{center}\begin{circuitikz} \draw (0,0) to[#1] (2,0); \end{circuitikz} \end{center}\par} + +\long\def\comment#1{} + \begin{document} +\setcounter{secnumdepth}{3} +\setcounter{tocdepth}{3} + \def\TikZ{Ti\emph{k}Z} +\def\Circuitikz{Circui\TikZ} +\def\ConTeXt{Con\TeX t} \lstset{frameround=fttt} \lstloadlanguages{TeX} -\title{Circui\TikZ \\{\large version 0.2.2}} +\title{\Circuitikz \\{\large version \pgfcircversion}} \author{Massimo A. Redaelli} \date{\today} @@ -73,7 +85,7 @@ Much appreciated: \href{mailto:mredaelli@elet.polimi.it}{\texttt{mredaelli@elet. \subsection{Requirements} \begin{itemize} \item \texttt{tikz}, version $\ge 2$; - \item \texttt{xstring}; + \item \texttt{xstring}, not older than 2009/03/13; \item \texttt{siunitx}, if using \texttt{siunitx} option. \end{itemize} @@ -81,31 +93,91 @@ Much appreciated: \href{mailto:mredaelli@elet.polimi.it}{\texttt{mredaelli@elet. None, as far as I know. +\subsection{Introduction to version 0.2.3} + +Having waited a long time before updating the package, many feature requests piled on my desk. They should all be implemented now. + +There are a number of backward incompatibilities — I'm sorry, but I had to make a choice in order not to have a schizophrenic interface. They are mostly, in my opinion, minor problems that can be dealt with with appropriate package options: +\begin{itemize} + \item \texttt{potentiometer} is now the standard resistor-with-arrow-in-the-middle; the old potentiometer is now known as \texttt{variable resistor} (or \texttt{vR}), similarly to \texttt{variable inductor} and \texttt{variable capacitor}; + \item \texttt{american inductor} was not really the standard american inductor. The old american inductor has been renamed \texttt{cute inductor}; + \item \texttt{transformer}, \texttt{transformer core} and \texttt{variable inductor} are now linked with the chosen type of \texttt{inductor}; + \item styles for selecting shape variants (like \texttt{[american resistors]}) are now in the plural to avoid conflict with paths (like \texttt{to[american resistor]}). +\end{itemize} + +\subsection{\ConTeXt\ compatibility} + +As requested by some users, I fixed the package for it to be compatible with \ConTeXt. Just use \verb!\usemodule[circuitikz]! in your preamble and include the code between \verb!\startcircuitikz! and \verb!\endcircuitikz!. Please notice that the package \texttt{siunitx} in \emph{not} available for \ConTeXt: the option \texttt{siunitx} simply defines a few measurement units typical in electric sciences. + +\medskip + +In actually using \Circuitikz\ with \TikZ\ version 2 in \ConTeXt\ an error comes up, saying something like +\begin{verbatim} +! Undefined control sequence. +\tikz@cc@mid@checks -> \pgfutil@ifnextchar! +\end{verbatim} + + +The solution has been suggested to me by Aditya Mahajan, and involves modifying a file in \TikZ: +\begin{verbatim} +Here is the fix. In tikzlibrarycalc.code.tex change + +\def\tikz@cc@mid@checks{ + \pgfutil@ifnextchar !{%AM: Added space + \tikz@cc@mid% + }{% + \advance\pgf@xa by\tikz@cc@factor\pgf@xb% + \advance\pgf@ya by\tikz@cc@factor\pgf@yb% + \tikz@cc@parse% continue + }% +} + +\def\tikz@cc@mid !{%AM Added space + \pgfutil@ifnextchar({% + \tikz@scan@one@point\tikz@cc@project% + }{% + \tikz@cc@mid@num% + }% +} +\end{verbatim} + +As far as I know, this is a bug in \TikZ, and I notified the author, but until he fixes it, you know the workaround. \section{Options} \begin{itemize} - \item \texttt{europeanvoltage}: uses arrows to define voltages, and uses european-style voltage sources; - \item \texttt{americanvoltage}: uses $-$ and $+$ to define voltages, and uses american-style voltage sources; - \item \texttt{europeancurrent}: uses european-style current sources; - \item \texttt{americancurrent}: uses american-style current sources; - \item \texttt{europeanresistor}: uses rectangular empty shape for resistors, as per european standards; - \item \texttt{americanresistor}: uses zig-zag shape for resistors, as per american standards; - \item \texttt{europeaninductor}: uses rectangular filled shape for inductors, as per european standards; - \item \texttt{americaninductor}: uses coil shape for inductors, as per american standards; - \item \texttt{european}: equivalent to \texttt{europeancurrent}, \texttt{europeanvoltage}, \texttt{europeanresistor}, \texttt{europeaninductor}; - \item \texttt{american}: equivalent to \texttt{americancurrent}, \texttt{americanvoltage}, \texttt{americanresistor}, \texttt{americaninductor}; + \item \texttt{europeanvoltages}: uses arrows to define voltages, and uses european-style voltage sources; + \item \texttt{americanvoltages}: uses $-$ and $+$ to define voltages, and uses american-style voltage sources; + \item \texttt{europeancurrents}: uses european-style current sources; + \item \texttt{americancurrents}: uses american-style current sources; + \item \texttt{europeanresistors}: uses rectangular empty shape for resistors, as per european standards; + \item \texttt{americanresistors}: uses zig-zag shape for resistors, as per american standards; + \item \texttt{europeaninductors}: uses rectangular filled shape for inductors, as per european standards; + \item \texttt{americaninductors}: uses "4-bumps" shape for inductors, as per american standards; + \item \texttt{cuteinductors}: uses my personal favorite, "pig-tailed" shape for inductors; + \item \texttt{americanports}: uses triangular logic ports, as per american standards; + \item \texttt{europeanports}: uses rectangular logic ports, as per european standards; + \item \texttt{european}: equivalent to \texttt{europeancurrents}, \texttt{europeanvoltages}, \texttt{europeanresistors}, \texttt{europeaninductors}, \texttt{europeanports}; + \item \texttt{american}: equivalent to \texttt{americancurrents}, \texttt{americanvoltages}, \texttt{americanresistors}, \texttt{americaninductors}, \texttt{americanports}; \item \texttt{siunitx}: integrates with \texttt{SIunitx} package. If labels, currents or voltages are of the form \verb!#1<#2>! then what is shown is actually \verb!\SI{#1}{#2}!; \item \texttt{nosiunitx}: labels are not interpreted as above; - \item \texttt{fulldiode}: 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{emptydiode}: 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{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. \end{itemize} +The old options in the singular (like \texttt{american voltage}) are still available for compatibility, but are discouraged. + +\medskip + Loading the package with no options is equivalent to my own personal liking, that is to the following options:\\ - \texttt{[european current, european voltage, american resistor, american inductor, nosiunitx, noarrowmos]}. + \texttt{[europeancurrents, europeanvoltages, americanresistors, cuteinductors, americanports, nosiunitx, noarrowmos]}. + +\medskip + +In \ConTeXt\ the options are similarly specified: \texttt{current=european|american}, \texttt{voltage=european|american}, \texttt{resistor=american|european}, \texttt{inductor=cute|american|european}, \texttt{logic=american|european}, \texttt{siunitx=true|false}, \texttt{arrowmos=false|true}. \section{The components} @@ -113,7 +185,7 @@ Here follows the list of all the shapes defined by Circui\TikZ. These are all \t \medskip -Each bipole is shown using the following command, where \verb!#1! is the name of the component\footnote{If \texttt{\#1} is the name of the bipole/the style, then the actual name of the shape is \texttt{\#1shape}.}: +Each bipole (plus triac and thyristors) are shown using the following command, where \verb!#1! is the name of the component\footnote{If \texttt{\#1} is the name of the bipole/the style, then the actual name of the shape is \texttt{\#1shape}.}: \begin{verbatim} \begin{center}\begin{circuitikz} \draw @@ -128,6 +200,8 @@ The other shapes are shown with: ; \end{circuitikz} \end{center} \end{verbatim} +Please notice that for user convenience transistors can also be inputted using the syntax for bipoles. See section~\ref{sec:transasbip}. + \subsection{Monopoles} \begin{itemize} \circuititem{ground}{Ground}{} @@ -136,39 +210,46 @@ The other shapes are shown with: \subsection{Bipoles} -\paragraph{Instruments} +\subsubsection{Instruments} \begin{itemize} \circuititembip{ammeter}{Ammeter}{} \circuititembip{voltmeter}{Voltmeter}{} \end{itemize} -\paragraph{Basic resistive bipoles} +\subsubsection{Basic resistive bipoles} \begin{itemize} \circuititembip{short}{Short circuit}{} \circuititembip{open}{Open circuit}{} - \circuititembip{pR}{Potentiometer}{potentiometer} \circuititembip{lamp}{Lamp}{} \circuititembip{generic}{Generic (symmetric) bipole}{} + \circuititembip{tgeneric}{Tunable generic bipole}{} \circuititembip{ageneric}{Generic asymmetric bipole}{} - \circuititembip{fullgeneric}{Generic asymmetric bipole}{} + \circuititembip{fullgeneric}{Generic asymmetric bipole (full)}{} + \circuititembip{tfullgeneric}{Tunable generic bipole (full)}{} + \circuititembip{memristor}{Memristor}{Mr} \end{itemize} -\paragraph{The resistor} +\subsubsection{Resistors and the like} -If \texttt{europeanresistor} option is active (or the style \texttt{[european resistor]} is used), the resistor is displayed as follows: +If (default behaviour) \texttt{americanresistors} option is active (or the style \texttt{[american resistors]} is used), the resistor is displayed as follows: \begin{itemize} - \ctikzset{european resistor=true} - \circuititembip{R}{Resistor}{resistor} + \ctikzset{resistor=american} + \circuititembip{R}{Resistor}{american resistor} + \circuititembip{vR}{Variable resistor}{american variable resistor} + \circuititembip{pR}{Potentiometer}{american potentiometer} \end{itemize} -If instead (default behaviour) \texttt{americanresistor} option is active (or the style \texttt{[american resistor]} is used), the resistor is displayed as follows: + +If instead \texttt{europeanresistors} option is active (or the style \texttt{[european resistors]} is used), the resistors, variable resistors and potentiometers are displayed as follows: \begin{itemize} - \ctikzset{european resistor=false} - \circuititembip{R}{Resistor}{resistor} + \ctikzset{resistor=european} + \circuititembip{R}{Resistor}{european resistor} + \circuititembip{vR}{Variable resistor}{european variable resistor} + \circuititembip{pR}{Potentiometer}{european potentiometer} + \ctikzset{resistor=american} % reset default \end{itemize} - -\paragraph{Stationary sources} +\subsubsection{Stationary sources} \begin{itemize} \circuititembip{battery}{Battery}{} \circuititembip{european voltage source}{Voltage source (european style)}{} @@ -178,13 +259,14 @@ If instead (default behaviour) \texttt{americanresistor} option is active (or th \end{itemize} \begin{framed} -The options \texttt{europeancurrent} [resp. \texttt{europeanvoltage}] (the default) and \texttt{americancurrent} [resp. \texttt{americanvoltage}] define which current [resp. voltage] source is selected by default when the abbreviated styles \texttt{current source}, \texttt{csource}, \texttt{I} [resp. \texttt{voltage source}, \texttt{vsource}, \texttt{V}] are used. +If (default behaviour) \texttt{europeancurrents} option is active (or the style \texttt{[european currents]} is used), the shorthands \texttt{current source}, \texttt{isource}, and \texttt{I} are equivalent to \texttt{european current source}. Otherwise, if \texttt{americancurrents} option is active (or the style \texttt{[american currents]} is used) they are equivalent to \texttt{american current source}. -One can also use the related styles \texttt{[european current]} [resp. \texttt{[european voltage]}] and \texttt{[american current]} [resp. \texttt{[american voltage]}]. +Similarly, if (default behaviour) \texttt{europeanvoltages} option is active (or the style \texttt{[european voltages]} is used), the shorthands \texttt{voltage source}, \texttt{vsource}, and \texttt{V} are equivalent to \texttt{european voltage source}. Otherwise, if \texttt{americanvoltages} option is active (or the style \texttt{[american voltages]} is used) they are equivalent to \texttt{american voltage source}. \end{framed} -\paragraph{Diodes and such} + +\subsubsection{Diodes and such} \begin{itemize} \circuititembip{empty diode}{Empty diode}{Do} \circuititembip{empty Schottky diode}{Empty Schottky diode}{sDo} @@ -203,27 +285,39 @@ One can also use the related styles \texttt{[european current]} [resp. \texttt{[ \end{itemize} \begin{framed} -The options \texttt{fulldiode} and \texttt{emptydiode} (and the styles \texttt{[full diode]} and \texttt{[full diode]}) 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}. +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} -\paragraph{Basic dynamical bipoles} +\subsubsection{Basic dynamical bipoles} \begin{itemize} \circuititembip{capacitor}{Capacitor}{C} + \circuititembip{polar capacitor}{Polar capacitor}{pC} + \circuititembip{variable capacitor}{Variable capacitor}{vC} \end{itemize} -If \texttt{europeaninductor} option is active (or the style \texttt{[european inductor]} is used), the inductor is displayed as follows: +If (default behaviour) \texttt{cuteinductors} option is active (or the style \texttt{[cute inductors]} is used), the inductors are displayed as follows: +\begin{itemize} + \ctikzset{inductor=cute} + \circuititembip{L}{Inductor}{cute inductor} + \circuititembip{vL}{Variable inductor}{variable cute inductor} +\end{itemize} + +If \texttt{americaninductors} option is active (or the style \texttt{[american inductors]} is used), the inductors are displayed as follows: \begin{itemize} - \ctikzset{european inductor=true} - \circuititembip{L}{Inductor}{inductor} + \ctikzset{inductor=american} + \circuititembip{L}{Inductor}{american inductor} + \circuititembip{vL}{Variable inductor}{variable american inductor} \end{itemize} -If instead (default behaviour) \texttt{americaninductor} option is active (or the style \texttt{[american inductor]} is used), the inductor is displayed as follows: + +Finally, if \texttt{europeaninductors} option is active (or the style \texttt{[european inductors]} is used), the inductors are displayed as follows: \begin{itemize} - \ctikzset{european inductor=false} - \circuititembip{L}{Inductor}{inductor} + \ctikzset{inductor=european} + \circuititembip{L}{Inductor}{european inductor} + \circuititembip{vL}{Variable inductor}{variable european inductor} \end{itemize} -\paragraph{Sinusoidal sources} Here because I was asked for them. But how do you distinguish one from the other?! +\subsubsection{Sinusoidal sources} Here because I was asked for them. But how do you distinguish one from the other?! \begin{itemize} \circuititembip{sinusoidal voltage source}{Sinusoidal voltage source}{vsourcesin, sV} \circuititembip{sinusoidal current source}{Sinusoidal current source}{isourcesin, sI} @@ -232,10 +326,10 @@ If instead (default behaviour) \texttt{americaninductor} option is active (or th %\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. -%One can also use the related styles \texttt{[european current]} [resp. \texttt{[european voltage]}] and \texttt{[american current]} [resp. \texttt{[american voltage]}]. +%One can also use the related styles \texttt{[european currents]} [resp. \texttt{[european voltages]}] and \texttt{[american currents]} [resp. \texttt{[american voltages]}]. %\end{framed} -\paragraph{Switch} +\subsubsection{Switch} \begin{itemize} \circuititembip{closing switch}{Closing switch}{cspst} \circuititembip{opening switch}{Opening switch}{ospst} @@ -244,7 +338,7 @@ If instead (default behaviour) \texttt{americaninductor} option is active (or th \subsection{Tripoles} -\paragraph{Controlled sources} Admittedly, graphically they are bipoles. But I couldn't\ldots +\subsubsection{Controlled sources} Admittedly, graphically they are bipoles. But I couldn't\ldots \begin{itemize} \circuititembip{european controlled voltage source}{Controlled voltage source (european style)}{} \circuititembip{american controlled voltage source}{Controlled voltage source (american style)}{} @@ -253,9 +347,9 @@ If instead (default behaviour) \texttt{americaninductor} option is active (or th \end{itemize} \begin{framed} -The options \texttt{europeancurrent} [resp. \texttt{europeanvoltage}] (the default) and \texttt{americancurrent} [resp. \texttt{americanvoltage}] define which controlled current [resp. voltage] source is selected by default when the abbreviated styles are used. +If (default behaviour) \texttt{europeancurrents} option is active (or the style \texttt{[european currents]} is used), the shorthands \texttt{controlled current source}, \texttt{cisource}, and \texttt{cI} are equivalent to \texttt{european controlled current source}. Otherwise, if \texttt{americancurrents} option is active (or the style \texttt{[american currents]} is used) they are equivalent to \texttt{american controlled current source}. -One can also use the related styles \texttt{[european current]} [resp. \texttt{[european voltage]}] and \texttt{[american current]} [resp. \texttt{[american voltage]}]. +Similarly, if (default behaviour) \texttt{europeanvoltages} option is active (or the style \texttt{[european voltages]} is used), the shorthands \texttt{controlled voltage source}, \texttt{cvsource}, and \texttt{cV} are equivalent to \texttt{european controlled voltage source}. Otherwise, if \texttt{americanvoltages} option is active (or the style \texttt{[american voltages]} is used) they are equivalent to \texttt{american controlled voltage source}. \end{framed} \begin{itemize} @@ -265,43 +359,104 @@ One can also use the related styles \texttt{[european current]} [resp. \texttt{[ -\paragraph{Transistors} +\subsubsection{Transistors} \begin{itemize} - \circuititem{nmos}{nmos}{} - \circuititem{pmos}{pmos}{} - \circuititem{npn}{npn}{} - \circuititem{pnp}{pnp}{} + \circuititem{nmos}{\scshape nmos}{} + \circuititem{pmos}{\scshape pmos}{} + \circuititem{npn}{\scshape npn}{} + \circuititem{pnp}{\scshape pnp}{} + \circuititem{nigbt}{\scshape npigbt}{} + \circuititem{pigbt}{\scshape pigbt}{} \end{itemize} If the option \texttt{arrowmos} is used (or after the commant \verb!\ctikzset{tripoles/mos style/arrows}! is given), this is the output: \ctikzset{tripoles/mos style/arrows} \begin{itemize} - \circuititem{nmos}{nmos}{} - \circuititem{pmos}{pmos}{} + \circuititem{nmos}{\scshape nmos}{} + \circuititem{pmos}{\scshape pmos}{} \end{itemize} \ctikzset{tripoles/mos style/no arrows} +\textsc{nfet}s and \textsc{pfet}s have been incorporated based on code provided by Clemens Helfmeier and Theodor +Borsche: +\begin{itemize} + \circuititem{nfet}{\scshape nfet}{} + \circuititem{nigfete}{\scshape nigfete}{} + \circuititem{nigfetd}{\scshape nigfetd}{} + \circuititem{pfet}{\scshape pfet}{} + \circuititem{pigfete}{\scshape pigfete}{} + \circuititem{pigfetd}{\scshape pigfetd}{} +\end{itemize} + +\textsc{njfet} and \textsc{pjfet} have been incorporated based on code provided by Danilo Piazzalunga: +\begin{itemize} + \circuititem{njfet}{\scshape njfet}{} + \circuititem{pjfet}{\scshape pjfet}{} +\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} + \circuititembip{thyristor}{thyristor}{Ty} + %\circuititembip{IGBT}{IGBT}{} +\end{itemize} + \subsection{Double bipoles} +Transformers automatically use the inductor shape currently selected. These are the three possibilities: \begin{itemize} - \circuititem{transformer}{Transformer}{} - \circuititem{gyrator}{Gyrator}{} + \ctikzset{inductor=cute} + \circuititem{transformer}{Transformer (cute inductor)}{} + \ctikzset{inductor=american} + \circuititem{transformer}{Transformer (american inductor)}{} + \ctikzset{inductor=european} + \circuititem{transformer}{Transformer (european inductor)}{} +\end{itemize} + + +Transformers with core are also available: +\begin{itemize} + \ctikzset{inductor=cute} + \circuititem{transformer core}{Transformer core (cute inductor)}{} + \ctikzset{inductor=american} + \circuititem{transformer core}{Transformer core (american inductor)}{} + \ctikzset{inductor=european} + \circuititem{transformer core}{Transformer core (european inductor)}{} + \ctikzset{inductor=cute} % reset default \end{itemize} +\begin{itemize} + \circuititem{gyrator}{Gyrator}{} +\end{itemize} \subsection{Logic gates} \begin{itemize} - \circuititem{and port}{AND port}{} - \circuititem{or port}{OR port}{} - \circuititem{not port}{NOT port}{} - \circuititem{nand port}{NAND port}{} - \circuititem{nor port}{NOR port}{} - \circuititem{xor port}{XOR port}{} - \circuititem{xnor port}{XNOR port}{} + \circuititem{american and port}{American \textsc{and} port}{} + \circuititem{american or port}{American \textsc{or} port}{} + \circuititem{american not port}{American \textsc{not} port}{} + \circuititem{american nand port}{American \textsc{nand} port}{} + \circuititem{american nor port}{American \textsc{nor} port}{} + \circuititem{american xor port}{American \textsc{xor} port}{} + \circuititem{american xnor port}{American \textsc{xnor} port}{} \end{itemize} +\begin{itemize} + \circuititem{european and port}{European \textsc{and} port}{} + \circuititem{european or port}{European \textsc{or} port}{} + \circuititem{european not port}{European \textsc{not} port}{} + \circuititem{european nand port}{European \textsc{nand} port}{} + \circuititem{european nor port}{European \textsc{nor} port}{} + \circuititem{european xor port}{European \textsc{xor} port}{} + \circuititem{european xnor port}{European \textsc{xnor} port}{} +\end{itemize} + +\begin{framed} +If (default behaviour) \texttt{americanports} option is active (or the style \texttt{[american 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 american version of the respective logic port. + +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} \begin{itemize} @@ -462,54 +617,54 @@ Also \subsection{Voltages} -\paragraph{European style} The default, with arrows. Use option \texttt{europeanvoltage} or style \verb![european voltage]!. +\subsubsection{European style} The default, with arrows. Use option \texttt{europeanvoltage} or style \verb![european voltages]!. \begin{LTXexample}[varwidth=true] -\begin{circuitikz}[european voltage] +\begin{circuitikz}[european voltages] \draw (0,0) to[R, v^>=$v_1$] (2,0); \end{circuitikz} \end{LTXexample} \begin{LTXexample}[varwidth=true] -\begin{circuitikz}[european voltage] +\begin{circuitikz}[european voltages] \draw (0,0) to[R, v^<=$v_1$] (2,0); \end{circuitikz} \end{LTXexample} \begin{LTXexample}[varwidth=true] -\begin{circuitikz}[european voltage] +\begin{circuitikz}[european voltages] \draw (0,0) to[R, v_>=$v_1$] (2,0); \end{circuitikz} \end{LTXexample} \begin{LTXexample}[varwidth=true] -\begin{circuitikz}[european voltage] +\begin{circuitikz}[european voltages] \draw (0,0) to[R, v_<=$v_1$] (2,0); \end{circuitikz} \end{LTXexample} -\paragraph{American style} For those who like it (not me). Use option \texttt{americanvoltage} or set \verb![american voltage]!. +\subsubsection{American style} For those who like it (not me). Use option \texttt{americanvoltage} or set \verb![american voltages]!. \begin{LTXexample}[varwidth=true] -\begin{circuitikz}[american voltage] +\begin{circuitikz}[american voltages] \draw (0,0) to[R, v^>=$v_1$] (2,0); \end{circuitikz} \end{LTXexample} \begin{LTXexample}[varwidth=true] -\begin{circuitikz}[american voltage] +\begin{circuitikz}[american voltages] \draw (0,0) to[R, v^<=$v_1$] (2,0); \end{circuitikz} \end{LTXexample} \begin{LTXexample}[varwidth=true] -\begin{circuitikz}[american voltage] +\begin{circuitikz}[american voltages] \draw (0,0) to[R, v_>=$v_1$] (2,0); \end{circuitikz} \end{LTXexample} \begin{LTXexample}[varwidth=true] -\begin{circuitikz}[american voltage] +\begin{circuitikz}[american voltages] \draw (0,0) to[R, v_<=$v_1$] (2,0); \end{circuitikz} \end{LTXexample} @@ -566,6 +721,7 @@ Also \end{circuitikz} \end{LTXexample} + \subsection{Special components} For some components label, current and voltage behave as one would expect: @@ -602,36 +758,36 @@ For some components label, current and voltage behave as one would expect: \end{circuitikz} \end{LTXexample} -The following results from using the option \texttt{americancurrent} or using the style \verb![american current]!. +The following results from using the option \texttt{americancurrent} or using the style \verb![american currents]!. \begin{LTXexample}[varwidth=true] -\begin{circuitikz}[american current] +\begin{circuitikz}[american currents] \draw (0,0) to[I=$a_1$] (2,0); \end{circuitikz} \end{LTXexample} \begin{LTXexample}[varwidth=true] -\begin{circuitikz}[american current] +\begin{circuitikz}[american currents] \draw (0,0) to[I, i=$a_1$] (2,0); \end{circuitikz} \end{LTXexample} \begin{LTXexample}[varwidth=true] -\begin{circuitikz}[american current] +\begin{circuitikz}[american currents] \draw (0,0) to[cI=$k\cdot a_1$] (2,0); \end{circuitikz} \end{LTXexample} \begin{LTXexample}[varwidth=true] -\begin{circuitikz}[american current] +\begin{circuitikz}[american currents] \draw (0,0) to[sI=$a_1$] (2,0); \end{circuitikz} \end{LTXexample} \begin{LTXexample}[varwidth=true] -\begin{circuitikz}[american current] +\begin{circuitikz}[american currents] \draw (0,0) to[csI=$k\cdot a_1$] (2,0); \end{circuitikz} \end{LTXexample} @@ -670,44 +826,43 @@ The same holds for voltage sources: \end{circuitikz} \end{LTXexample} -The following results from using the option \texttt{americanvoltage} or the style \verb![american voltage]!. +The following results from using the option \texttt{americanvoltage} or the style \verb![american voltages]!. \begin{LTXexample}[varwidth=true] -\begin{circuitikz}[american voltage] +\begin{circuitikz}[american voltages] \draw (0,0) to[V=$a_1$] (2,0); \end{circuitikz} \end{LTXexample} \begin{LTXexample}[varwidth=true] -\begin{circuitikz}[american voltage] +\begin{circuitikz}[american voltages] \draw (0,0) to[V, v=$a_1$] (2,0); \end{circuitikz} \end{LTXexample} \begin{LTXexample}[varwidth=true] -\begin{circuitikz}[american voltage] +\begin{circuitikz}[american voltages] \draw (0,0) to[cV=$k\cdot a_1$] (2,0); \end{circuitikz} \end{LTXexample} \begin{LTXexample}[varwidth=true] -\begin{circuitikz}[american voltage] +\begin{circuitikz}[american voltages] \draw (0,0) to[sV=$a_1$] (2,0); \end{circuitikz} \end{LTXexample} \begin{LTXexample}[varwidth=true] -\begin{circuitikz}[american voltage] +\begin{circuitikz}[american voltages] \draw (0,0) to[csV=$k\cdot a_1$] (2,0); \end{circuitikz} \end{LTXexample} - \subsection{Integration with {\ttfamily siunitx}} -If the option {\ttfamily siunitx} is active, then the following are equivalent: +If the option {\ttfamily siunitx} is active (and \emph{not} in \ConTeXt), then the following are equivalent: \begin{LTXexample}[varwidth=true] \begin{circuitikz} @@ -745,6 +900,45 @@ If the option {\ttfamily siunitx} is active, then the following are equivalent: \end{circuitikz} \end{LTXexample} + + +\subsection{Mirroring} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[pD] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[pD, mirror] (2,0); +\end{circuitikz} +\end{LTXexample} + +At the moment, placing labels and currents on mirrored bipoles works: +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[ospst=T] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[ospst=T, mirror, i=$i_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + +But voltages don't: + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[ospst=T, mirror, v=v] (2,0); +\end{circuitikz} +\end{LTXexample} + +Sorry about that. + \subsection{Putting them together} \begin{LTXexample}[varwidth=true] \begin{circuitikz} @@ -760,12 +954,11 @@ If the option {\ttfamily siunitx} is active, then the following are equivalent: \end{circuitikz} \end{LTXexample} -%} %comment \section{Not only bipoles} -Since only bipoles can be placed "along a line", components with more than two terminals are placed as nodes: +Since only bipoles (but see section~\ref{sec:transasbip}) can be placed "along a line", components with more than two terminals are placed as nodes: \begin{LTXexample}[varwidth=true] \tikz \node[npn] at (0,0) {}; \end{LTXexample} @@ -774,7 +967,7 @@ Since only bipoles can be placed "along a line", components with more than two t In order to allow connections with other components, all components define anchors. -\paragraph{Logical ports} All logical ports, except NOT, have to inputs and one output. They are called respectively \texttt{in 1}, \texttt{in 2}, \texttt{out}: +\subsubsection{Logical ports} All logical ports, except \textsc{not}, have to inputs and one output. They are called respectively \texttt{in 1}, \texttt{in 2}, \texttt{out}: \begin{LTXexample}[varwidth=true] \begin{circuitikz} \draw @@ -795,7 +988,7 @@ In order to allow connections with other components, all components define ancho ;\end{circuitikz} \end{LTXexample} -In the case of NOT, there are only \texttt{in} and \texttt{out}: +In the case of \textsc{not}, there are only \texttt{in} and \texttt{out} (although for compatibility reasons \texttt{in 1} is still defined and equal to \texttt{in}): \begin{LTXexample}[varwidth=true] \begin{circuitikz} \draw @@ -808,7 +1001,7 @@ In the case of NOT, there are only \texttt{in} and \texttt{out}: ;\end{circuitikz} \end{LTXexample} -\paragraph{Transistors} For MOS transistors one has \texttt{base}, \texttt{gate}, \texttt{source} and \texttt{drain} anchors (which can be abbreviated with \texttt{B}, \texttt{G}, \texttt{S} and \texttt{D}): +\subsubsection{Transistors} For \textsc{nmos}, \textsc{pmos}, \textsc{nfet}, \textsc{nigfete}, \textsc{nigfetd}, \textsc{pfet}, \textsc{pigfete}, and \textsc{pigfetd} transistors one has \texttt{base}, \texttt{gate}, \texttt{source} and \texttt{drain} anchors (which can be abbreviated with \texttt{B}, \texttt{G}, \texttt{S} and \texttt{D}): \begin{LTXexample}[varwidth=true] \begin{circuitikz} \draw @@ -822,15 +1015,26 @@ In the case of NOT, there are only \texttt{in} and \texttt{out}: \begin{LTXexample}[varwidth=true] \begin{circuitikz} \draw - (0,0) node[pmos] (mos) {} - (mos.B) node[anchor=west] {B} - (mos.G) node[anchor=east] {G} - (mos.D) node[anchor=north] {D} - (mos.S) node[anchor=south] {S} + (0,0) node[pigfete] (pigfete) {} + (pigfete.B) node[anchor=west] {B} + (pigfete.G) node[anchor=east] {G} + (pigfete.D) node[anchor=south] {D} + (pigfete.S) node[anchor=north] {S} ;\end{circuitikz} \end{LTXexample} -For BJT transistors the anchors are \texttt{base}, \texttt{emitter} and \texttt{collector} anchors (which can be abbreviated with \texttt{B}, \texttt{E} and \texttt{C}): +Similarly \textsc{njfet} and \textsc{pjfet} have \texttt{gate}, \texttt{source} and \texttt{drain} anchors (which can be abbreviated with \texttt{G}, \texttt{S} and \texttt{D}): + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} \draw + (0,0) node[pjfet] (pjfet) {} + (pjfet.G) node[anchor=east] {G} + (pjfet.D) node[anchor=north] {D} + (pjfet.S) node[anchor=south] {S} +;\end{circuitikz} +\end{LTXexample} + +For \textsc{npn}, \textsc{pnp}, \textsc{nigbt}, and \textsc{pigbt} transistors the anchors are \texttt{base}, \texttt{emitter} and \texttt{collector} anchors (which can be abbreviated with \texttt{B}, \texttt{E} and \texttt{C}): \begin{LTXexample}[varwidth=true] \begin{circuitikz} \draw @@ -843,10 +1047,10 @@ For BJT transistors the anchors are \texttt{base}, \texttt{emitter} and \texttt \begin{LTXexample}[varwidth=true] \begin{circuitikz} \draw - (0,0) node[pnp] (pnp) {} - (pnp.B) node[anchor=east] {B} - (pnp.C) node[anchor=north] {C} - (pnp.E) node[anchor=south] {E} + (0,0) node[pigbt] (pigbt) {} + (pigbt.B) node[anchor=east] {B} + (pigbt.C) node[anchor=north] {C} + (pigbt.E) node[anchor=south] {E} ;\end{circuitikz} \end{LTXexample} @@ -863,7 +1067,30 @@ Here is one composite example (please notice that the \texttt{xscale=-1} style w (pnp1.B) node[circ] {} |- (pnp2.C) node[circ] {} ;\end{circuitikz} \end{LTXexample} -\paragraph{Operational amplifier} The op amp defines the inverting input (\texttt{-}), the non-inverting input (\texttt{+}) and the output (\texttt{out}) anchors: + +Similarly, transistors can be reflected vertically: +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} \draw + (0,0) node[pigfete, yscale=-1] (pigfete) {} + (pigfete.B) node[anchor=west] {B} + (pigfete.G) node[anchor=east] {G} + (pigfete.D) node[anchor=north] {D} + (pigfete.S) node[anchor=south] {S} +;\end{circuitikz} +\end{LTXexample} + +\subsubsection{Other tripoles} When inserting a thrystor, a triac or a potentiometer, one needs to refer to the third node — gate (\texttt{gate} or \texttt{G}) for the former two; wiper (\texttt{wiper} or \texttt{W}) for the latter one. This is done by giving a name to the bipole: + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} \draw + (0,0) to[Tr, n=TRI] (2,0) + to[pR, n=POT] (4,0); + \draw[dashed] (TRI.G) -| (POT.wiper) +;\end{circuitikz} +\end{LTXexample} + + +\subsubsection{Operational amplifier} The op amp defines the inverting input (\texttt{-}), the non-inverting input (\texttt{+}) and the output (\texttt{out}) anchors: \begin{LTXexample}[varwidth=true] \begin{circuitikz} \draw @@ -888,7 +1115,7 @@ There are also two more anchors defined, \texttt{up} and \texttt{down}, for the \end{LTXexample} -\paragraph{Double bipoles} All the (few, actually) double bipoles/quadrupoles have +\subsubsection{Double bipoles} All the (few, actually) double bipoles/quadrupoles have the four anchors, two for each port. The first port, to the left, is port \texttt{A}, having the anchors \texttt{A1} (up) and \texttt{A2} (down); same for port \texttt{B}. They also expose the \texttt{base} anchor, for labelling: \begin{LTXexample}[varwidth=true] @@ -913,6 +1140,33 @@ the four anchors, two for each port. The first port, to the left, is port \textt ;\end{circuitikz} \end{LTXexample} +\subsection{Transistor paths}\label{sec:transasbip} + +For syntactical convenience transistors can be placed using the normal path notation used for bipoles. The transitor type can be specified by simply adding a ``T'' (for transistor) in front of the node name of the transistor. It will be placed with the base/gate orthogonal to the direction of the path: +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} \draw + (0,0) node[njfet] {1} + (-1,2) to[Tnjfet=2] (1,2) + to[Tnjfet=3, mirror] (3,2); +;\end{circuitikz} +\end{LTXexample} + +Access to the gate and/or base nodes can be gained by naming the transistors with the \texttt{n} or \texttt{name} path style: +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} \draw[yscale=1.1, xscale=.8] + (2,4.5) -- (0,4.5) to[Tpmos, n=p1] (0,3) + to[Tnmos, n=n1] (0,1.5) + to[Tnmos, n=n2] (0,0) node[ground] {} + (2,4.5) to[Tpmos,n=p2] (2,3) to[short, -*] (0,3) + (p1.G) -- (n1.G) to[short, *-o] ($(n1.G)+(3,0)$) + (n2.G) ++(2,0) node[circ] {} -| (p2.G) + (n2.G) to[short, -o] ($(n2.G)+(3,0)$) + (0,3) to[short, -o] (-1,3) +;\end{circuitikz} +\end{LTXexample} + +The \texttt{name} property is available also for bipoles, although this is useful mostly for triac, potentiometer and thyristor (see~\ref{sec:othertrip}). + \section{Customization} \subsection{Parameters} @@ -941,8 +1195,8 @@ All can be varied using the \verb!\ctikzset! command, anywhere in the code: \begin{LTXexample}[varwidth=true] \tikz \draw (0,0) node[nand port] {}; \par -\ctikzset{tripoles/nand port/input height=.2} -\ctikzset{tripoles/nand port/port width=.2} +\ctikzset{tripoles/american nand port/input height=.2} +\ctikzset{tripoles/american nand port/port width=.2} \tikz \draw (0,0) node[nand port] {}; \end{LTXexample} @@ -956,8 +1210,8 @@ All can be varied using the \verb!\ctikzset! command, anywhere in the code: Admittedly, not all graphical properties have understandable names, but for the time it will have to do: \begin{LTXexample}[varwidth=true] \tikz \draw (0,0) node[xnor port] {}; -\ctikzset{tripoles/xnor port/aaa=.2} -\ctikzset{tripoles/xnor port/bbb=.6} +\ctikzset{tripoles/american xnor port/aaa=.2} +\ctikzset{tripoles/american xnor port/bbb=.6} \tikz \draw (0,0) node[xnor port] {}; \end{LTXexample} @@ -1131,7 +1385,29 @@ And yes: this is a bug and \emph{not} a feature\ldots \section{Revision history} \begin{itemize} - +\item[\itshape version 0.2.3] (20091118). + \begin{enumerate} + \item fixed compatibility problem with label option from tikz + \item Fixed resizing problem for shape ground + \item Variable capacitor + \item polarized capacitor + \item ConTeXt support (read the manual!) + \item nfet, nigfete, nigfetd, pfet, pigfete, pigfetd (contribution of Clemens Helfmeier and Theodor +Borsche) + \item njfet, pjfet (contribution of Danilo Piazzalunga) + \item pigbt, nigbt + \item \emph{backward incompatibility} potentiometer is now the standard resistor-with-arrow-in-the-middle; the old potentiometer is now known as variable resistor (or vR), similarly to variable inductor and variable capacitor + \item triac, thyristor, memristor + \item new property "name" for bipoles + \item fixed voltage problem for batteries in american voltage mode + \item european logic gates + \item \emph{backward incompatibility} new american standard inductor. Old american inductor now called "cute inductor" + \item \emph{backward incompatibility} transformer now linked with the chosen type of inductor, and version with core, too. Similarly for variable inductor + \item \emph{backward incompatibility} styles for selecting shape variants now end are in the plural to avoid conflict with paths + \item new placing option for some tripoles (mostly transistors) + \item mirror path style +\end{enumerate} + \item[\itshape version 0.2.2] (20090520). \begin{enumerate} \item Added the shape for lamps. diff --git a/Master/texmf-dist/doc/latex/circuitikz/context.pdf b/Master/texmf-dist/doc/latex/circuitikz/context.pdf new file mode 100644 index 00000000000..ec6b653d1bd Binary files /dev/null and b/Master/texmf-dist/doc/latex/circuitikz/context.pdf differ diff --git a/Master/texmf-dist/doc/latex/circuitikz/context.tex b/Master/texmf-dist/doc/latex/circuitikz/context.tex new file mode 100644 index 00000000000..13f3ade1cde --- /dev/null +++ b/Master/texmf-dist/doc/latex/circuitikz/context.tex @@ -0,0 +1,20 @@ + +\usemodule[circuitikz] + +\starttext + +A simple example to test the installation. + +\startcircuitikz[scale=1.2] + \draw + (0,2) to[I=1\milli\ampere] (2,2) + to[R, l_=2\kilo\ohm, *-*] (0,0) + to[R, l_=2\kilo\ohm] (2,0) + to[V, v_=2\volt] (2,2) + to[cspst, l=$t_0$] (4,2) -- (4,1.5) + to [generic, i=$i_1$, v=$v_1$] (4,-.5) -- (4,-1.5) + (0,2) -- (0,-1.5) to[V, v_=4\volt] (2,-1.5) + to [R, l=1\kilo\ohm] (4,-1.5); +\stopcircuitikz + +\stoptext diff --git a/Master/texmf-dist/tex/latex/circuitikz/circuitikz.code.tex b/Master/texmf-dist/tex/latex/circuitikz/circuitikz.code.tex new file mode 100644 index 00000000000..d229aa280ff --- /dev/null +++ b/Master/texmf-dist/tex/latex/circuitikz/circuitikz.code.tex @@ -0,0 +1,486 @@ + +%% Options + + + + +%% Keys + +\long\def\pgf@circ@comment#1{} + +\def\circuitikzbasekey{/tikz/circuitikz} + +\pgfkeys{\circuitikzbasekey/.is family} + +\def\circuitikzset#1{\pgfkeys{\circuitikzbasekey,#1}} +\let\ctikzset\circuitikzset +\def\ctikzvalof#1{\pgfkeysvalueof{\circuitikzbasekey/#1}} +\def\ctikzsetvalof#1#2{\pgfkeyssetvalue{\circuitikzbasekey/#1}{#2}} + +\ctikzset{bipoles/.is family} +\ctikzset{bipoles/border margin/.initial=1.1} +\ctikzset{bipoles/thickness/.initial=2} +\ctikzset{bipoles/length/.initial=1.4cm} +\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{bipoles/resistor/height/.initial=.3} +\ctikzset{bipoles/resistor/width/.initial=.8} +\ctikzset{bipoles/potentiometer/height/.initial=.8} +\ctikzset{bipoles/potentiometer/height 2/.initial=.3} +\ctikzset{bipoles/potentiometer/width/.initial=.8} +\ctikzset{bipoles/vresistor/height/.initial=.6} +\ctikzset{bipoles/vresistor/width/.initial=.8} +\ctikzset{bipoles/cute inductor/height/.initial=.3} +\ctikzset{bipoles/cute inductor/width/.initial=.8} +\ctikzset{bipoles/cute inductor/coils/.initial=6} +\ctikzset{bipoles/american inductor/height/.initial=.3} +\ctikzset{bipoles/american inductor/height 2/.initial=.1} +\ctikzset{bipoles/american inductor/width/.initial=.8} +\ctikzset{bipoles/american inductor/coils/.initial=4} +\ctikzset{bipoles/vcuteinductor/height/.initial=.6} +\ctikzset{bipoles/vcuteinductor/coil height/.initial=.3} +\ctikzset{bipoles/vcuteinductor/width/.initial=.8} +\ctikzset{bipoles/vcuteinductor/coils/.initial=6} +\ctikzset{bipoles/vamerican inductor/height/.initial=.6} +\ctikzset{bipoles/vamerican inductor/height 2/.initial=.2} +\ctikzset{bipoles/vamerican inductor/width/.initial=.8} +\ctikzset{bipoles/vamerican inductor/coils/.initial=4} +\ctikzset{bipoles/isource/height/.initial=.60} +\ctikzset{bipoles/isource/width/.initial=.60} +\ctikzset{bipoles/isourceam/height/.initial=.60} +\ctikzset{bipoles/isourceam/width/.initial=.60} +\ctikzset{bipoles/vsource/height/.initial=.60} +\ctikzset{bipoles/vsource/width/.initial=.60} +\ctikzset{bipoles/vsourceam/height/.initial=.60} +\ctikzset{bipoles/vsourceam/width/.initial=.60} +\ctikzset{bipoles/vsourceam/margin/.initial=.7} +\ctikzset{bipoles/isourcesin/height/.initial=.60} +\ctikzset{bipoles/isourcesin/width/.initial=.60} +\ctikzset{bipoles/vsourcesin/height/.initial=.60} +\ctikzset{bipoles/vsourcesin/width/.initial=.60} +\ctikzset{bipoles/cisource/height/.initial=.7} +\ctikzset{bipoles/cisource/width/.initial=.7} +\ctikzset{bipoles/cisourceam/height/.initial=.7} +\ctikzset{bipoles/cisourceam/width/.initial=.7} +\ctikzset{bipoles/cvsource/height/.initial=.7} +\ctikzset{bipoles/cvsource/width/.initial=.7} +\ctikzset{bipoles/cvsourceam/height/.initial=.7} +\ctikzset{bipoles/cvsourceam/width/.initial=.7} +\ctikzset{bipoles/cvsourceam/margin/.initial=.7} +\ctikzset{bipoles/cvsourceam/text scale/.initial=1} +\ctikzset{bipoles/cisourcesin/width/.initial=.7} +\ctikzset{bipoles/cvsourcesin/height/.initial=.7} +\ctikzset{bipoles/cvsourcesin/width/.initial=.7} +\ctikzset{bipoles/capacitor/height/.initial=.6} +\ctikzset{bipoles/capacitor/width/.initial=.2} +\ctikzset{bipoles/pcapacitor/height/.initial=.6} +\ctikzset{bipoles/pcapacitor/width/.initial=.2} +\ctikzset{bipoles/pcapacitor/bend width/.initial=1.1} +\ctikzset{bipoles/vcapacitor/height/.initial=.6} +\ctikzset{bipoles/vcapacitor/width/.initial=.5} +\ctikzset{bipoles/vcapacitor/capacitor width/.initial=.4} +\ctikzset{bipoles/battery/height/.initial=.6} +\ctikzset{bipoles/battery/width/.initial=.3} +\ctikzset{bipoles/diode/height/.initial=.50} +\ctikzset{bipoles/diode/width/.initial=.40} +\ctikzset{bipoles/varcap/height/.initial=.50} +\ctikzset{bipoles/varcap/width/.initial=.45} +\ctikzset{bipoles/interr/height/.initial=.35} +\ctikzset{bipoles/interr/width/.initial=.35} +\ctikzset{bipoles/interr/height 2/.initial=.1} +\ctikzset{bipoles/generic/height/.initial=.30} +\ctikzset{bipoles/generic/width/.initial=.80} +\ctikzset{bipoles/generic potentiometer/height/.initial=.80} +\ctikzset{bipoles/generic potentiometer/height 2/.initial=.30} +\ctikzset{bipoles/generic potentiometer/width/.initial=.80} +\ctikzset{bipoles/ageneric/height/.initial=.30} +\ctikzset{bipoles/ageneric/width/.initial=.80} +\ctikzset{bipoles/memristor/height/.initial=.30} +\ctikzset{bipoles/memristor/wave height/.initial=.5} +\ctikzset{bipoles/memristor/width/.initial=.80} +\ctikzset{bipoles/tgeneric/height/.initial=.50} +\ctikzset{bipoles/tgeneric/width/.initial=.80} +\ctikzset{bipoles/tfullgeneric/height/.initial=.50} +\ctikzset{bipoles/tfullgeneric/width/.initial=.80} +\ctikzset{bipoles/fullgeneric/height/.initial=.30} +\ctikzset{bipoles/fullgeneric/width/.initial=.80} +\ctikzset{bipoles/open/height/.initial=.25} +\ctikzset{bipoles/open/width/.initial=.8} +\ctikzset{bipoles/ammeter/height/.initial=.60} +\ctikzset{bipoles/ammeter/width/.initial=.60} +\ctikzset{bipoles/voltmeter/height/.initial=.60} +\ctikzset{bipoles/voltmeter/width/.initial=.60} +\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} + +\newif\ifpgf@circuit@mos@arrows +\ctikzset{tripoles/mos style/.is choice} +\ctikzset{tripoles/mos style/no arrows/.code={\pgf@circuit@mos@arrowsfalse}} +\ctikzset{tripoles/mos style/arrows/.code={\pgf@circuit@mos@arrowstrue}} +\ctikzset{tripoles/nmos/width/.initial=.7} +\ctikzset{tripoles/nmos/gate height/.initial=.35} +\ctikzset{tripoles/nmos/base height/.initial=.5} +\ctikzset{tripoles/nmos/height/.initial=1.1} +\ctikzset{tripoles/nmos/base width/.initial=.5} +\ctikzset{tripoles/nmos/gate width/.initial=.62} +\ctikzset{tripoles/pmos/width/.initial=.7} +\ctikzset{tripoles/pmos/gate height/.initial=.35} +\ctikzset{tripoles/pmos/base height/.initial=.5} +\ctikzset{tripoles/pmos/height/.initial=1.1} +\ctikzset{tripoles/pmos/base width/.initial=.5} +\ctikzset{tripoles/pmos/gate width/.initial=.62} + +\ctikzset{tripoles/nfet/width/.initial=.7} +\ctikzset{tripoles/nfet/gate height/.initial=.35} +\ctikzset{tripoles/nfet/base height/.initial=.5} +\ctikzset{tripoles/nfet/height/.initial=1.1} +\ctikzset{tripoles/nfet/base width/.initial=.5} +\ctikzset{tripoles/nfet/gate width/.initial=.62} + +\ctikzset{tripoles/pfet/width/.initial=.7} +\ctikzset{tripoles/pfet/gate height/.initial=.35} +\ctikzset{tripoles/pfet/base height/.initial=.5} +\ctikzset{tripoles/pfet/height/.initial=1.1} +\ctikzset{tripoles/pfet/base width/.initial=.5} +\ctikzset{tripoles/pfet/gate width/.initial=.62} + +\ctikzset{tripoles/nigfete/width/.initial=.7} +\ctikzset{tripoles/nigfete/gate height/.initial=.35} +\ctikzset{tripoles/nigfete/base height/.initial=.5} +\ctikzset{tripoles/nigfete/height/.initial=1.1} +\ctikzset{tripoles/nigfete/base width/.initial=.5} +\ctikzset{tripoles/nigfete/gate width/.initial=.62} + +\ctikzset{tripoles/nigfetd/width/.initial=.7} +\ctikzset{tripoles/nigfetd/gate height/.initial=.35} +\ctikzset{tripoles/nigfetd/base height/.initial=.5} +\ctikzset{tripoles/nigfetd/height/.initial=1.1} +\ctikzset{tripoles/nigfetd/base width/.initial=.5} +\ctikzset{tripoles/nigfetd/gate width/.initial=.62} + +\ctikzset{tripoles/pigfete/width/.initial=.7} +\ctikzset{tripoles/pigfete/gate height/.initial=.35} +\ctikzset{tripoles/pigfete/base height/.initial=.5} +\ctikzset{tripoles/pigfete/height/.initial=1.1} +\ctikzset{tripoles/pigfete/base width/.initial=.5} +\ctikzset{tripoles/pigfete/gate width/.initial=.62} + +\ctikzset{tripoles/pigfetd/width/.initial=.7} +\ctikzset{tripoles/pigfetd/gate height/.initial=.35} +\ctikzset{tripoles/pigfetd/base height/.initial=.5} +\ctikzset{tripoles/pigfetd/height/.initial=1.1} +\ctikzset{tripoles/pigfetd/base width/.initial=.5} +\ctikzset{tripoles/pigfetd/gate width/.initial=.62} + +\ctikzset{tripoles/npn/width/.initial=.6} +\ctikzset{tripoles/npn/gate height/.initial=.45} +\ctikzset{tripoles/npn/gate height 2/.initial=.15} +\ctikzset{tripoles/npn/base height/.initial=.4} +\ctikzset{tripoles/npn/height/.initial=1.1} +\ctikzset{tripoles/npn/gate width/.initial=.5} + + + +\ctikzset{tripoles/pnp/width/.initial=.6} +\ctikzset{tripoles/pnp/gate height/.initial=.45} +\ctikzset{tripoles/pnp/gate height 2/.initial=.15} +\ctikzset{tripoles/pnp/base height/.initial=.4} +\ctikzset{tripoles/pnp/height/.initial=1.1} +\ctikzset{tripoles/pnp/gate width/.initial=.5} + +\ctikzset{tripoles/pigbt/width/.initial=.6} +\ctikzset{tripoles/pigbt/gate height/.initial=.45} +\ctikzset{tripoles/pigbt/gate height 2/.initial=.15} +\ctikzset{tripoles/pigbt/base height/.initial=.4} +\ctikzset{tripoles/pigbt/height/.initial=1.1} +\ctikzset{tripoles/pigbt/gate width/.initial=.62} +\ctikzset{tripoles/pigbt/base width/.initial=.5} +\ctikzset{tripoles/nigbt/width/.initial=.6} +\ctikzset{tripoles/nigbt/gate height/.initial=.45} +\ctikzset{tripoles/nigbt/gate height 2/.initial=.15} +\ctikzset{tripoles/nigbt/base height/.initial=.4} +\ctikzset{tripoles/nigbt/height/.initial=1.1} +\ctikzset{tripoles/nigbt/gate width/.initial=.62} +\ctikzset{tripoles/nigbt/base width/.initial=.5} + +\ctikzset{tripoles/njfet/width/.initial=.7} +\ctikzset{tripoles/njfet/gate height/.initial=.5} +\ctikzset{tripoles/njfet/gate height 2/.initial=.35} +\ctikzset{tripoles/njfet/gate width/.initial=.5} +\ctikzset{tripoles/njfet/height/.initial=1.1} +\ctikzset{tripoles/pjfet/width/.initial=.7} +\ctikzset{tripoles/pjfet/gate height/.initial=.5} +\ctikzset{tripoles/pjfet/gate height 2/.initial=.35} +\ctikzset{tripoles/pjfet/gate width/.initial=.5} +\ctikzset{tripoles/pjfet/height/.initial=1.1} + +\newif\ifpgf@circuit@europeanlogicport +\ctikzset{logic ports/.is choice} +\ctikzset{logic ports/european/.code= {\pgf@circuit@europeanlogicporttrue } } +\ctikzset{logic ports/american/.code= {\pgf@circuit@europeanlogicportfalse } } + +\newif\ifpgf@circuit@bipole@voltage@backward +\ctikzset{bipole/voltage/direction/.is choice} +\ctikzset{bipole/voltage/direction/forward/.code={\pgf@circuit@bipole@voltage@backwardfalse}} +\ctikzset{bipole/voltage/direction/backward/.code={\pgf@circuit@bipole@voltage@backwardtrue}} + +\ctikzset{tripoles/american and port/width/.initial=1.1} +\ctikzset{tripoles/american and port/height/.initial=.8} +\ctikzset{tripoles/american and port/port width/.initial=.7} +\ctikzset{tripoles/american and port/input height/.initial=.5} +\ctikzset{tripoles/american nand port/width/.initial=1.1} +\ctikzset{tripoles/american nand port/height/.initial=.8} +\ctikzset{tripoles/american nand port/port width/.initial=.7} +\ctikzset{tripoles/american nand port/circle width/.initial=.15} +\ctikzset{tripoles/american nand port/input height/.initial=.5} +\ctikzset{tripoles/american or port/width/.initial=1.1} +\ctikzset{tripoles/american or port/height/.initial=.8} +\ctikzset{tripoles/american or port/port width/.initial=.7} +\ctikzset{tripoles/american or port/input height/.initial=.5} +\ctikzset{tripoles/american or port/input skip/.initial=.25} +\ctikzset{tripoles/american or port/aaa/.initial=.6} +\ctikzset{tripoles/american or port/bbb/.initial=.4} +\ctikzset{tripoles/american or port/ccc/.initial=.5} +\ctikzset{tripoles/american or port/ddd/.initial=.0} +\ctikzset{tripoles/american nor port/width/.initial=1.1} +\ctikzset{tripoles/american nor port/height/.initial=.8} +\ctikzset{tripoles/american nor port/port width/.initial=.7} +\ctikzset{tripoles/american nor port/input height/.initial=.5} +\ctikzset{tripoles/american nor port/input skip/.initial=.25} +\ctikzset{tripoles/american nor port/circle width/.initial=.15} +\ctikzset{tripoles/american nor port/aaa/.initial=.6} +\ctikzset{tripoles/american nor port/bbb/.initial=.4} +\ctikzset{tripoles/american nor port/ccc/.initial=.5} +\ctikzset{tripoles/american nor port/ddd/.initial=.0} +\ctikzset{tripoles/american xor port/width/.initial=1.1} +\ctikzset{tripoles/american xor port/height/.initial=.8} +\ctikzset{tripoles/american xor port/port width/.initial=.7} +\ctikzset{tripoles/american xor port/input height/.initial=.5} +\ctikzset{tripoles/american xor port/input skip/.initial=.15} +\ctikzset{tripoles/american xor port/distance/.initial=.1} +\ctikzset{tripoles/american xor port/aaa/.initial=.6} +\ctikzset{tripoles/american xor port/bbb/.initial=.4} +\ctikzset{tripoles/american xor port/ccc/.initial=.5} +\ctikzset{tripoles/american xor port/ddd/.initial=.0} +\ctikzset{tripoles/american xnor port/width/.initial=1.1} +\ctikzset{tripoles/american xnor port/height/.initial=.8} +\ctikzset{tripoles/american xnor port/port width/.initial=.7} +\ctikzset{tripoles/american xnor port/input height/.initial=.5} +\ctikzset{tripoles/american xnor port/input skip/.initial=.15} +\ctikzset{tripoles/american xnor port/distance/.initial=.1} +\ctikzset{tripoles/american xnor port/aaa/.initial=.6} +\ctikzset{tripoles/american xnor port/bbb/.initial=.4} +\ctikzset{tripoles/american xnor port/ccc/.initial=.5} +\ctikzset{tripoles/american xnor port/ddd/.initial=.0} +\ctikzset{tripoles/american xnor port/circle width/.initial=.15} +\ctikzset{tripoles/european and port/width/.initial=1.4} +\ctikzset{tripoles/european and port/height/.initial=.65} +\ctikzset{tripoles/european and port/reserved/.initial=.6} +\ctikzset{tripoles/european and port/input height/.initial=.6} +\ctikzset{tripoles/european or port/width/.initial=1.4} +\ctikzset{tripoles/european or port/height/.initial=.65} +\ctikzset{tripoles/european or port/reserved/.initial=.6} +\ctikzset{tripoles/european or port/input height/.initial=.6} +\ctikzset{tripoles/european xor port/width/.initial=1.4} +\ctikzset{tripoles/european xor port/height/.initial=.65} +\ctikzset{tripoles/european xor port/reserved/.initial=.6} +\ctikzset{tripoles/european xor port/input height/.initial=.6} +\ctikzset{tripoles/european nand port/width/.initial=1.4} +\ctikzset{tripoles/european nand port/not height/.initial=.3} +\ctikzset{tripoles/european nand port/not width/.initial=.8} +\ctikzset{tripoles/european nand port/height/.initial=.65} +\ctikzset{tripoles/european nand port/reserved/.initial=.6} +\ctikzset{tripoles/european nand port/input height/.initial=.6} +\ctikzset{tripoles/european not port/width/.initial=1.4} +\ctikzset{tripoles/european not port/not height/.initial=.3} +\ctikzset{tripoles/european not port/not width/.initial=.8} +\ctikzset{tripoles/european not port/height/.initial=.65} +\ctikzset{tripoles/european not port/reserved/.initial=.6} +\ctikzset{tripoles/european not port/input height/.initial=0} +\ctikzset{tripoles/european xnor port/width/.initial=1.4} +\ctikzset{tripoles/european xnor port/not height/.initial=.3} +\ctikzset{tripoles/european xnor port/not width/.initial=.8} +\ctikzset{tripoles/european xnor port/height/.initial=.65} +\ctikzset{tripoles/european xnor port/reserved/.initial=.6} +\ctikzset{tripoles/european xnor port/input height/.initial=.6} +\ctikzset{tripoles/european nor port/width/.initial=1.4} +\ctikzset{tripoles/european nor port/not height/.initial=.3} +\ctikzset{tripoles/european nor port/not width/.initial=.8} +\ctikzset{tripoles/european nor port/height/.initial=.65} +\ctikzset{tripoles/european nor port/reserved/.initial=.6} +\ctikzset{tripoles/european nor port/input height/.initial=.6} +\ctikzset{tripoles/op amp/width/.initial=1.7} +\ctikzset{tripoles/op amp/port width/.initial=.7} +\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/thyristor/height/.initial=1.10} +\ctikzset{tripoles/thyristor/height 2/.initial=.5} +\ctikzset{tripoles/thyristor/width/.initial=1.0} +\ctikzset{tripoles/thyristor/diode height/.initial=.5} +\ctikzset{tripoles/thyristor/diode width left/.initial=.4} +\ctikzset{tripoles/thyristor/diode width right/.initial=.3} + +\ctikzset{tripoles/triac/height/.initial=1.1} +\ctikzset{tripoles/triac/width/.initial=1} +\ctikzset{tripoles/triac/diode width left/.initial=.3} +\ctikzset{tripoles/triac/diode width right/.initial=.3} + +\ctikzset{quadpoles/transformer/width/.initial=1.5} +\ctikzset{quadpoles/transformer/height/.initial=1.5} +\ctikzset{quadpoles/transformer core/width/.initial=1.5} +\ctikzset{quadpoles/transformer core/height/.initial=1.5} +\ctikzset{quadpoles/transformer core/core height/.initial=.5} +\ctikzset{quadpoles/transformer core/core width/.initial=.05} +\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 = } +\ctikzset{bipole/name/.initial = } +\newif\ifpgf@circuit@bipole@reversed +\ctikzset{bipole/reversed/.is if=pgf@circuit@bipole@reversed} +\newif\ifpgf@circuit@bipole@isvoltage +\ctikzset{bipole/is voltage/.is if=pgf@circuit@bipole@isvoltage} +\newif\ifpgf@circuit@bipole@iscurrent +\ctikzset{bipole/is current/.is if=pgf@circuit@bipole@iscurrent} + +\ctikzset{bipole/voltage/.is family} +\newif\ifpgf@circuit@bipole@voltage@backward +\ctikzset{bipole/voltage/direction/.is choice} +\ctikzset{bipole/voltage/direction/forward/.code={\pgf@circuit@bipole@voltage@backwardfalse}} +\ctikzset{bipole/voltage/direction/backward/.code={\pgf@circuit@bipole@voltage@backwardtrue}} +\newif\ifpgf@circuit@bipole@voltage@below +\ctikzset{bipole/voltage/position/.is choice} +\ctikzset{bipole/voltage/position/above/.code={\pgf@circuit@bipole@voltage@belowfalse}} +\ctikzset{bipole/voltage/position/below/.code={\pgf@circuit@bipole@voltage@belowtrue}} + +\ctikzset{bipole/voltage/label/unit/.initial=} +\ctikzset{bipole/voltage/label/name/.initial=} + +\ctikzset{bipole/current/.is family} +\newif\ifpgf@circuit@bipole@current@backward +\ctikzset{bipole/current/direction/.is choice} +\ctikzset{bipole/current/direction/forward/.code={\pgf@circuit@bipole@current@backwardfalse}} +\ctikzset{bipole/current/direction/backward/.code={\pgf@circuit@bipole@current@backwardtrue}} +\newif\ifpgf@circuit@bipole@current@before +\ctikzset{bipole/current/x position/.is choice} +\ctikzset{bipole/current/x position/after/.code={\pgf@circuit@bipole@current@beforefalse}} +\ctikzset{bipole/current/x position/before/.code={\pgf@circuit@bipole@current@beforetrue}} +\newif\ifpgf@circuit@bipole@current@below +\ctikzset{bipole/current/y position/.is choice} +\ctikzset{bipole/current/y position/above/.code={\pgf@circuit@bipole@current@belowfalse}} +\ctikzset{bipole/current/y position/below/.code={\pgf@circuit@bipole@current@belowtrue}} + +\ctikzset{bipole/current/label/unit/.initial=} +\ctikzset{bipole/current/label/name/.initial=} + +\ctikzset{bipole/label/.is family} +\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}}} +\ctikzset{bipole/nodes/left/empty/.code={\ctikzsetvalof{bipole/nodes/left}{empty}}} +\ctikzset{bipole/nodes/left/full/.code={\ctikzsetvalof{bipole/nodes/left}{full}}} +\ctikzset{bipole/nodes/right/.is choice} +\ctikzset{bipole/nodes/right/none/.code={\ctikzsetvalof{bipole/nodes/right}{none}}} +\ctikzset{bipole/nodes/right/empty/.code={\ctikzsetvalof{bipole/nodes/right}{empty}}} +\ctikzset{bipole/nodes/right/full/.code={\ctikzsetvalof{bipole/nodes/right}{full}}} + + +\newif\ifpgf@circuit@europeanresistor +\ctikzset{resistor/.is choice} +\ctikzset{resistor/american/.code = \pgf@circuit@europeanresistorfalse } +\ctikzset{resistor/european/.code = \pgf@circuit@europeanresistortrue } + +\ctikzset{inductor/.is choice} +\ctikzset{inductor/cute/.code={\ctikzsetvalof{inductor}{cute}}} +\ctikzset{inductor/european/.code={\ctikzsetvalof{inductor}{european}}} +\ctikzset{inductor/american/.code={\ctikzsetvalof{inductor}{american}}} + +\newif\ifpgf@circuit@fulldiode +\ctikzset{diode/.is if=pgf@circuit@fulldiode} +\ctikzset{diode/.is choice} +\ctikzset{diode/empty/.code = \pgf@circuit@fulldiodefalse } +\ctikzset{diode/full/.code = \pgf@circuit@fulldiodetrue } +\ctikzset{thickness/.initial=2} +\ctikzset{color/.initial=black} +\pgfkeys{/tikz/color/.add code={}{\ctikzset{color=#1}}} + + +\newif\ifpgf@circ@siunitx +\newif\ifpgf@circ@siunitx@res + +\ctikzset{voltage/.is family} +\ctikzset{voltage/distance from node/.initial=.5} %\pgf@circ@Rlen units +\ctikzset{voltage/distance from line/.initial=.08} % pos, tra 0 e 1 +\ctikzset{voltage/bump a/.initial=1.2} +\ctikzset{voltage/bump b/.initial=1.5} +\ctikzset{voltage/european label distance/.initial=1.4} +\ctikzset{voltage/american label distance/.initial=1.1} + +\ctikzset{current/.is family} +\ctikzset{current/distance/.initial = .5} + +\tikzset{american currents/.style = { \circuitikzbasekey/current = american } } +\tikzset{european currents/.style = { \circuitikzbasekey/current = european } } +\tikzset{american voltages/.style = { \circuitikzbasekey/voltage = american } } +\tikzset{european voltages/.style = { \circuitikzbasekey/voltage = european } } +\tikzset{american resistors/.style = { \circuitikzbasekey/resistor = american } } +\tikzset{european resistors/.style = { \circuitikzbasekey/resistor = european } } +\tikzset{american inductors/.style = { \circuitikzbasekey/inductor = american } } +\tikzset{european inductors/.style = { \circuitikzbasekey/inductor = european } } +\tikzset{cute inductors/.style = { \circuitikzbasekey/inductor = cute } } +\tikzset{full diodes/.style = { \circuitikzbasekey/diode = full } } +\tikzset{empty diodes/.style = { \circuitikzbasekey/diode = empty } } +\tikzset{american ports/.style = { \circuitikzbasekey/logic ports = american } } +\tikzset{european ports/.style = { \circuitikzbasekey/logic ports = european } } +\tikzset{european/.style = { european currents, european voltages, european resistors, european inductors, european ports } } +\tikzset{american/.style = { american currents, american voltages, american resistors, american inductors, american ports } } +\tikzset{cute/.style = { european currents, european voltages, american resistors, cute inductors, american ports } } + +% I should try to make the tree clearer (this voltaege conflicts with the options above) + +\newif\ifpgf@circuit@europeanvoltage +\ctikzset{voltage/.is choice} +\ctikzset{voltage/american/.code = {\pgf@circuit@europeanvoltagefalse } } +\ctikzset{voltage/european/.code = {\pgf@circuit@europeanvoltagetrue } } + +\newif\ifpgf@circuit@europeancurrent +\ctikzset{current/.is choice} +\ctikzset{current/american/.code = \pgf@circuit@europeancurrentfalse } +\ctikzset{current/european/.code = \pgf@circuit@europeancurrenttrue } + +%% dependencies + + +\input pgfcircutils.sty +\input pgfcircmath.sty + +\input pgfcircshapes.sty +\input pgfcircmonopoles.sty +\input pgfcircbipoles.sty +\input pgfcirctripoles.sty +\input pgfcircquadpoles.sty + +\input pgfcirclabel.sty +\input pgfcircvoltage.sty +\input pgfcirccurrent.sty + + + + + diff --git a/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty b/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty index ba41b39100d..7d17188cf48 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty +++ b/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty @@ -8,74 +8,92 @@ % See the file doc/LICENSE for more details. +%%%%% +%%%%% +%%%%% +%%%%% Se c'è l'opzione symbol, fallback to siunitx con warning +%%%%% +%%%%% + \NeedsTeXFormat{LaTeX2e} -\def\pgfcircversion{0.2.1} +\def\pgfcircversion{0.2.3} \ProvidesPackage{circuitikz}% - [2009/04/17 The CircuiTikz circuit drawing package version \pgfcircversion] + [2009/11/18 The CircuiTikz circuit drawing package version \pgfcircversion] %% Version 2.0 of pgf/TikZ is required \RequirePackage{tikz} -\RequirePackage{xstring} \usetikzlibrary{calc} \usepgflibrary{decorations.pathmorphing} +\DeclareOption{european}{ + \ctikzset{voltage=european} \ctikzset{current=european} \ctikzset{inductor=european} + \ctikzset{resistor=european} \ctikzset{logic ports=european} +} -%% Options +\DeclareOption{american}{ + \ctikzset{voltage=american} \ctikzset{current=american} \ctikzset{resistor=american} \ctikzset{inductor=american} + \ctikzset{logic ports = american} +} -\DeclareOption{fulldiode}{ - \ctikzset{full diode=true} +\DeclareOption{fulldiodes}{ + \ctikzset{diode = full} } -\DeclareOption{emptydiode}{ - \ctikzset{full diode=false} +\DeclareOption{emptydiodes}{ + \ctikzset{diode = empty} } -\DeclareOption{europeanvoltage}{ - \ctikzset{european voltage=true} +\DeclareOption{europeanvoltages}{ + \ctikzset{voltage=european} } -\DeclareOption{americanvoltage}{ - \ctikzset{european voltage=false} +\DeclareOption{americanvoltages}{ + \ctikzset{voltage=american} } -\DeclareOption{europeancurrent}{ - \ctikzset{european current=true} +\DeclareOption{europeancurrents}{ + \ctikzset{current = european} } -\DeclareOption{americancurrent}{ - \ctikzset{european current=false} +\DeclareOption{americancurrents}{ + \ctikzset{current = american} } -\DeclareOption{europeanvoltage}{ - \ctikzset{european voltage=true} +\DeclareOption{europeanvoltages}{ + \ctikzset{voltage = european} } -\DeclareOption{americanresistor}{ - \ctikzset{european resistor=false} +\DeclareOption{americanresistors}{ + \ctikzset{resistor = american} } -\DeclareOption{europeanresistor}{ - \ctikzset{european resistor=true} +\DeclareOption{europeanresistors}{ + \ctikzset{resistor = european} } -\DeclareOption{americaninductor}{ - \ctikzset{european inductor=false} +\DeclareOption{americaninductors}{ + \ctikzset{inductor = american} } -\DeclareOption{europeaninductor}{ - \ctikzset{european inductor=true} +\DeclareOption{europeaninductors}{ + \ctikzset{inductor = european} } -\DeclareOption{european}{ - \ctikzset{european voltage=true} \ctikzset{european current=true} \ctikzset{european inductor=true} \ctikzset{european resistor=true} +\DeclareOption{cuteinductors}{ + \ctikzset{inductor = cute} } -\DeclareOption{american}{ - \ctikzset{european voltage=false} \ctikzset{european current=false} \ctikzset{european resistor=false} \ctikzset{european inductor=false} +\DeclareOption{americanports}{ + \ctikzset{logic ports = american} } +\DeclareOption{europeanports}{ + \ctikzset{logic ports = european} +} + + \DeclareOption{siunitx}{ \pgf@circ@siunitxtrue } @@ -92,563 +110,92 @@ \pgf@circuit@mos@arrowsfalse } +%%%%%%%%% Compatibility + + +\DeclareOption{fulldiode}{ + \ctikzset{diode = full} +} + +\DeclareOption{emptydiode}{ + \ctikzset{diode = empty} +} + +\DeclareOption{europeanvoltage}{ + \ctikzset{voltage=european} +} -%% Keys - -\newcommand{\pgf@circ@comment}[1]{} - -\def\circuitikzbasekey{/tikz/circuitikz} - -\pgfkeys{\circuitikzbasekey/.is family} - -\def\circuitikzset#1{\pgfkeys{\circuitikzbasekey,#1}} -\let\ctikzset\circuitikzset -\def\ctikzvalof#1{\pgfkeysvalueof{\circuitikzbasekey/#1}} -\def\ctikzsetvalof#1#2{\pgfkeyssetvalue{\circuitikzbasekey/#1}{#2}} - -\ctikzset{bipoles/.is family} -\ctikzset{bipoles/border margin/.initial=1.1} -\ctikzset{bipoles/thickness/.initial=2} -\ctikzset{bipoles/length/.initial=1.4cm} -\ctikzset{nodes width/.initial=.04} -\newdimen\pgf@circ@Rlen -\ctikzset{bipoles/resistor/height/.initial=.3} -\ctikzset{bipoles/resistor/width/.initial=.8} -\ctikzset{bipoles/potentiometer/height/.initial=.6} -\ctikzset{bipoles/potentiometer/width/.initial=.8} -\ctikzset{bipoles/inductor/height/.initial=.3} -\ctikzset{bipoles/inductor/width/.initial=.8} -\ctikzset{bipoles/inductor/coils/.initial=6} -\ctikzset{bipoles/isource/height/.initial=.60} -\ctikzset{bipoles/isource/width/.initial=.60} -\ctikzset{bipoles/isourceam/height/.initial=.60} -\ctikzset{bipoles/isourceam/width/.initial=.60} -\ctikzset{bipoles/vsource/height/.initial=.60} -\ctikzset{bipoles/vsource/width/.initial=.60} -\ctikzset{bipoles/vsourceam/height/.initial=.60} -\ctikzset{bipoles/vsourceam/width/.initial=.60} -\ctikzset{bipoles/vsourceam/margin/.initial=.7} -\ctikzset{bipoles/isourcesin/height/.initial=.60} -\ctikzset{bipoles/isourcesin/width/.initial=.60} -\ctikzset{bipoles/vsourcesin/height/.initial=.60} -\ctikzset{bipoles/vsourcesin/width/.initial=.60} -\ctikzset{bipoles/cisource/height/.initial=.7} -\ctikzset{bipoles/cisource/width/.initial=.7} -\ctikzset{bipoles/cisourceam/height/.initial=.7} -\ctikzset{bipoles/cisourceam/width/.initial=.7} -\ctikzset{bipoles/cvsource/height/.initial=.7} -\ctikzset{bipoles/cvsource/width/.initial=.7} -\ctikzset{bipoles/cvsourceam/height/.initial=.7} -\ctikzset{bipoles/cvsourceam/width/.initial=.7} -\ctikzset{bipoles/cvsourceam/margin/.initial=.7} -\ctikzset{bipoles/cvsourceam/text scale/.initial=1} -\ctikzset{bipoles/cisourcesin/width/.initial=.7} -\ctikzset{bipoles/cvsourcesin/height/.initial=.7} -\ctikzset{bipoles/cvsourcesin/width/.initial=.7} -\ctikzset{bipoles/capacitor/height/.initial=.6} -\ctikzset{bipoles/capacitor/width/.initial=.2} -\ctikzset{bipoles/battery/height/.initial=.6} -\ctikzset{bipoles/battery/width/.initial=.3} -\ctikzset{bipoles/diode/height/.initial=.50} -\ctikzset{bipoles/diode/width/.initial=.40} -\ctikzset{bipoles/varcap/height/.initial=.50} -\ctikzset{bipoles/varcap/width/.initial=.45} -\ctikzset{bipoles/interr/height/.initial=.35} -\ctikzset{bipoles/interr/width/.initial=.35} -\ctikzset{bipoles/interr/height 2/.initial=.08} -\ctikzset{bipoles/generic/height/.initial=.30} -\ctikzset{bipoles/generic/width/.initial=.80} -\ctikzset{bipoles/ageneric/height/.initial=.30} -\ctikzset{bipoles/ageneric/width/.initial=.80} -\ctikzset{bipoles/fullgeneric/height/.initial=.30} -\ctikzset{bipoles/fullgeneric/width/.initial=.80} -\ctikzset{bipoles/open/height/.initial=.25} -\ctikzset{bipoles/open/width/.initial=.8} -\ctikzset{bipoles/ammeter/height/.initial=.60} -\ctikzset{bipoles/ammeter/width/.initial=.60} -\ctikzset{bipoles/voltmeter/height/.initial=.60} -\ctikzset{bipoles/voltmeter/width/.initial=.60} -\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} - -\newif\ifpgf@circuit@mos@arrows -\ctikzset{tripoles/mos style/.is choice} -\ctikzset{tripoles/mos style/no arrows/.code={\pgf@circuit@mos@arrowsfalse}} -\ctikzset{tripoles/mos style/arrows/.code={\pgf@circuit@mos@arrowstrue}} -\ctikzset{tripoles/nmos/width/.initial=.7} -\ctikzset{tripoles/nmos/gate height/.initial=.35} -\ctikzset{tripoles/nmos/base height/.initial=.5} -\ctikzset{tripoles/nmos/height/.initial=1.1} -\ctikzset{tripoles/nmos/base width/.initial=.5} -\ctikzset{tripoles/nmos/gate width/.initial=.6} -\ctikzset{tripoles/pmos/width/.initial=.7} -\ctikzset{tripoles/pmos/gate height/.initial=.35} -\ctikzset{tripoles/pmos/base height/.initial=.5} -\ctikzset{tripoles/pmos/height/.initial=1.1} -\ctikzset{tripoles/pmos/base width/.initial=.5} -\ctikzset{tripoles/pmos/gate width/.initial=.6} - -\ctikzset{tripoles/npn/width/.initial=.6} -\ctikzset{tripoles/npn/gate height/.initial=.45} -\ctikzset{tripoles/npn/gate height 2/.initial=.15} -\ctikzset{tripoles/npn/base height/.initial=.4} -\ctikzset{tripoles/npn/height/.initial=1.1} -\ctikzset{tripoles/npn/gate width/.initial=.5} - -\ctikzset{tripoles/pnp/width/.initial=.6} -\ctikzset{tripoles/pnp/gate height/.initial=.45} -\ctikzset{tripoles/pnp/gate height 2/.initial=.15} -\ctikzset{tripoles/pnp/base height/.initial=.4} -\ctikzset{tripoles/pnp/height/.initial=1.1} -\ctikzset{tripoles/pnp/gate width/.initial=.5} - -\ctikzset{tripoles/and port/width/.initial=1.1} -\ctikzset{tripoles/and port/height/.initial=.8} -\ctikzset{tripoles/and port/port width/.initial=.7} -\ctikzset{tripoles/and port/input height/.initial=.5} -\ctikzset{tripoles/nand port/width/.initial=1.1} -\ctikzset{tripoles/nand port/height/.initial=.8} -\ctikzset{tripoles/nand port/port width/.initial=.7} -\ctikzset{tripoles/nand port/circle width/.initial=.15} -\ctikzset{tripoles/nand port/input height/.initial=.5} -\ctikzset{tripoles/or port/width/.initial=1.1} -\ctikzset{tripoles/or port/height/.initial=.8} -\ctikzset{tripoles/or port/port width/.initial=.7} -\ctikzset{tripoles/or port/input height/.initial=.5} -\ctikzset{tripoles/or port/input skip/.initial=.25} -\ctikzset{tripoles/or port/aaa/.initial=.6} -\ctikzset{tripoles/or port/bbb/.initial=.4} -\ctikzset{tripoles/or port/ccc/.initial=.5} -\ctikzset{tripoles/or port/ddd/.initial=.0} -\ctikzset{tripoles/nor port/width/.initial=1.1} -\ctikzset{tripoles/nor port/height/.initial=.8} -\ctikzset{tripoles/nor port/port width/.initial=.7} -\ctikzset{tripoles/nor port/input height/.initial=.5} -\ctikzset{tripoles/nor port/input skip/.initial=.25} -\ctikzset{tripoles/nor port/circle width/.initial=.15} -\ctikzset{tripoles/nor port/aaa/.initial=.6} -\ctikzset{tripoles/nor port/bbb/.initial=.4} -\ctikzset{tripoles/nor port/ccc/.initial=.5} -\ctikzset{tripoles/nor port/ddd/.initial=.0} -\ctikzset{tripoles/xor port/width/.initial=1.1} -\ctikzset{tripoles/xor port/height/.initial=.8} -\ctikzset{tripoles/xor port/port width/.initial=.7} -\ctikzset{tripoles/xor port/input height/.initial=.5} -\ctikzset{tripoles/xor port/input skip/.initial=.15} -\ctikzset{tripoles/xor port/distance/.initial=.1} -\ctikzset{tripoles/xor port/aaa/.initial=.6} -\ctikzset{tripoles/xor port/bbb/.initial=.4} -\ctikzset{tripoles/xor port/ccc/.initial=.5} -\ctikzset{tripoles/xor port/ddd/.initial=.0} -\ctikzset{tripoles/xnor port/width/.initial=1.1} -\ctikzset{tripoles/xnor port/height/.initial=.8} -\ctikzset{tripoles/xnor port/port width/.initial=.7} -\ctikzset{tripoles/xnor port/input height/.initial=.5} -\ctikzset{tripoles/xnor port/input skip/.initial=.15} -\ctikzset{tripoles/xnor port/distance/.initial=.1} -\ctikzset{tripoles/xnor port/aaa/.initial=.6} -\ctikzset{tripoles/xnor port/bbb/.initial=.4} -\ctikzset{tripoles/xnor port/ccc/.initial=.5} -\ctikzset{tripoles/xnor port/ddd/.initial=.0} -\ctikzset{tripoles/xnor port/circle width/.initial=.15} -\ctikzset{tripoles/op amp/width/.initial=1.7} -\ctikzset{tripoles/op amp/port width/.initial=.7} -\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{quadpoles/transformer/width/.initial=1.5} -\ctikzset{quadpoles/transformer/height/.initial=1.5} -\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 = } -\ctikzset{bipole/name/.initial = } -\newif\ifpgf@circuit@bipole@reversed -\ctikzset{bipole/reversed/.is if=pgf@circuit@bipole@reversed} -\newif\ifpgf@circuit@bipole@isvoltage -\ctikzset{bipole/is voltage/.is if=pgf@circuit@bipole@isvoltage} -\newif\ifpgf@circuit@bipole@iscurrent -\ctikzset{bipole/is current/.is if=pgf@circuit@bipole@iscurrent} - -\ctikzset{bipole/voltage/.is family} -\newif\ifpgf@circuit@bipole@voltage@backward -\ctikzset{bipole/voltage/direction/.is choice} -\ctikzset{bipole/voltage/direction/forward/.code={\pgf@circuit@bipole@voltage@backwardfalse}} -\ctikzset{bipole/voltage/direction/backward/.code={\pgf@circuit@bipole@voltage@backwardtrue}} -\newif\ifpgf@circuit@bipole@voltage@below -\ctikzset{bipole/voltage/position/.is choice} -\ctikzset{bipole/voltage/position/above/.code={\pgf@circuit@bipole@voltage@belowfalse}} -\ctikzset{bipole/voltage/position/below/.code={\pgf@circuit@bipole@voltage@belowtrue}} - -\ctikzset{bipole/voltage/label/unit/.initial=} -\ctikzset{bipole/voltage/label/name/.initial=} - -\ctikzset{bipole/current/.is family} -\newif\ifpgf@circuit@bipole@current@backward -\ctikzset{bipole/current/direction/.is choice} -\ctikzset{bipole/current/direction/forward/.code={\pgf@circuit@bipole@current@backwardfalse}} -\ctikzset{bipole/current/direction/backward/.code={\pgf@circuit@bipole@current@backwardtrue}} -\newif\ifpgf@circuit@bipole@current@before -\ctikzset{bipole/current/x position/.is choice} -\ctikzset{bipole/current/x position/after/.code={\pgf@circuit@bipole@current@beforefalse}} -\ctikzset{bipole/current/x position/before/.code={\pgf@circuit@bipole@current@beforetrue}} -\newif\ifpgf@circuit@bipole@current@below -\ctikzset{bipole/current/y position/.is choice} -\ctikzset{bipole/current/y position/above/.code={\pgf@circuit@bipole@current@belowfalse}} -\ctikzset{bipole/current/y position/below/.code={\pgf@circuit@bipole@current@belowtrue}} - -\ctikzset{bipole/current/label/unit/.initial=} -\ctikzset{bipole/current/label/name/.initial=} - -\ctikzset{bipole/label/.is family} -\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}}} -\ctikzset{bipole/nodes/left/empty/.code={\ctikzsetvalof{bipole/nodes/left}{empty}}} -\ctikzset{bipole/nodes/left/full/.code={\ctikzsetvalof{bipole/nodes/left}{full}}} -\ctikzset{bipole/nodes/right/.is choice} -\ctikzset{bipole/nodes/right/none/.code={\ctikzsetvalof{bipole/nodes/right}{none}}} -\ctikzset{bipole/nodes/right/empty/.code={\ctikzsetvalof{bipole/nodes/right}{empty}}} -\ctikzset{bipole/nodes/right/full/.code={\ctikzsetvalof{bipole/nodes/right}{full}}} - - -\newif\ifpgf@circuit@europeanvoltage -\ctikzset{european voltage/.is if=pgf@circuit@europeanvoltage} -\newif\ifpgf@circuit@europeancurrent -\ctikzset{european current/.is if=pgf@circuit@europeancurrent} -\newif\ifpgf@circuit@europeanresistor -\ctikzset{european resistor/.is if=pgf@circuit@europeanresistor} -\newif\ifpgf@circuit@europeaninductor -\ctikzset{european inductor/.is if=pgf@circuit@europeaninductor} -\newif\ifpgf@circuit@fulldiode -\ctikzset{full diode/.is if=pgf@circuit@fulldiode} -\ctikzset{thickness/.initial=2} -\ctikzset{color/.initial=black} -\pgfkeys{/tikz/color/.add code={}{\ctikzset{color=#1}}} - -\tikzset{european voltage/.code= {\ctikzset{european voltage=true} } } -\tikzset{european current/.code= {\ctikzset{european current=true} } } -\tikzset{american voltage/.code= {\ctikzset{european voltage=false} } } -\tikzset{american current/.code= {\ctikzset{european current=false} } } -\tikzset{european inductor/.code= {\ctikzset{european inductor=true} } } -\tikzset{european resistor/.code= {\ctikzset{european resistor=true} } } -\tikzset{american inductor/.code= {\ctikzset{european inductor=false} } } -\tikzset{american resistor/.code= {\ctikzset{european resistor=false} } } -\tikzset{american/.code= {\ctikzset{european current=false} \ctikzset{european voltage=false} \ctikzset{european resistor=false} \ctikzset{european inductor=false}} } -\tikzset{european/.code= {\ctikzset{european current=true} \ctikzset{european voltage=true} \ctikzset{european resistor=true} \ctikzset{european inductor=true}} } -\tikzset{full diode/.code= {\ctikzset{full diode=true} } } -\tikzset{empty diode/.code= {\ctikzset{full diode=false} } } - -\newif\ifpgf@circ@siunitx -\newif\ifpgf@circ@siunitx@res - -\ctikzset{voltage/.is family} -\ctikzset{voltage/distance from node/.initial=.5} %\pgf@circ@Rlen units -\ctikzset{voltage/distance from line/.initial=.08} % pos, tra 0 e 1 -\ctikzset{voltage/bump a/.initial=1.2} -\ctikzset{voltage/bump b/.initial=1.5} -\ctikzset{voltage/european label distance/.initial=1.4} -\ctikzset{voltage/american label distance/.initial=1.1} - -\ctikzset{current/.is family} -\ctikzset{current/distance/.initial = .5} - - - -%% dependencies - - -\input pgfcircutils.sty -\input pgfcircmath.sty - -\input pgfcircshapes.sty -\input pgfcircmonopoles.sty -\input pgfcircbipoles.sty -\input pgfcirctripoles.sty -\input pgfcircquadpoles.sty - -\input pgfcirclabel.sty -\input pgfcircvoltage.sty -\input pgfcirccurrent.sty - - - -\ExecuteOptions{european current, european voltage, american resistor, american inductor, nosiunitx, noarrowmos} - -\ProcessOptions +\DeclareOption{americanvoltage}{ + \ctikzset{voltage=american} +} + +\DeclareOption{europeancurrent}{ + \ctikzset{current = european} +} + +\DeclareOption{americancurrent}{ + \ctikzset{current = american} +} + +\DeclareOption{europeanvoltage}{ + \ctikzset{voltage = european} +} + +\DeclareOption{americanresistor}{ + \ctikzset{resistor = american} +} + +\DeclareOption{europeanresistor}{ + \ctikzset{resistor = european} +} + +\DeclareOption{americaninductor}{ + \ctikzset{inductor = american} +} + +\DeclareOption{europeaninductor}{ + \ctikzset{inductor = european} +} + +\DeclareOption{cuteinductor}{ + \ctikzset{inductor = cute} +} + +\DeclareOption{americanport}{ + \ctikzset{logic ports = american} +} + +\DeclareOption{europeanport}{ + \ctikzset{logic ports = european} +} + + + +%%%%%%%%% + + + +\input circuitikz.code.tex + +\ExecuteOptions{europeancurrents,europeanvoltages,americanports,americanresistors,cuteinductors,nosiunitx,noarrowmos} + +\ProcessOptions\relax \ifpgf@circ@siunitx + \RequirePackage{xstring}[2009/03/13] + %\expandafter\let\csname angstrom\endcsname\relax \RequirePackage{siunitx} \fi - - -%%%%%%%%%%%% -%% Dimensions - -% coordinate bipoli -\newdimen\pgf@circ@res@up \newdimen\pgf@circ@res@down \newdimen\pgf@circ@res@zero -\newdimen\pgf@circ@res@left \newdimen\pgf@circ@res@right -\newdimen\pgf@circ@res@other -\newdimen\pgf@circ@res@step - -% thickness iniziale -\newdimen \pgfstartlinewidth - -\pgf@circ@Rlen = \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - - -% Initialize paths -\def\pgfcircresetpath{ - \ctikzset{bipole/name=, bipole/direction=, bipole/label/name=, bipole/label/position=90, - bipole/reversed=false, bipole/kind=, - 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 } -} - - -%% Generic bipole path -\def\pgf@circ@bipole@path#1#2{ - \pgfextra{ - \pgf@circ@Rlen = \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \ctikzset{bipole/kind = #1} - \def\pgf@temp{open} - \def\pgf@circ@temp{#1} - \pgfmathrandominteger{\pgf@circ@rand}{1000}{9999} - \ctikzset{bipole/name = #2\pgf@circ@rand} - } - \ifpgf@circuit@bipole@reversed - (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}end) {} - (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}start) {} - \else - (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}start) {} - (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}end) {} - \fi - \pgfextra{ - \pgf@circ@slope{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}} - {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}} - \edef\pgf@circ@direction{\pgfmathresult} - \ctikzset{bipole/direction = \pgfmathresult} - } - ($(\tikztostart)!.5!(\tikztotarget)$) - node[#1shape, rotate=\pgf@circ@direction] (\ctikzvalof{bipole/name}) {} - \ifx\pgf@temp\pgf@circ@temp % if it is an open - \else - (\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 - \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 - % reset - \pgfextra{ - \pgfcircresetpath - } - (\tikztotarget) \tikztonodes % e si continua -} - - -%% Path definitions - -\def\pgf@circ@resistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{generic}{#1}\else\pgf@circ@bipole@path{resistor}{#1}\fi} -\def\pgf@circ@potentiometer@path#1{\pgf@circ@bipole@path{potentiometer}{#1}} -\def\pgf@circ@capacitor@path#1{\pgf@circ@bipole@path{capacitor}{#1}} -\def\pgf@circ@battery@path#1{\pgf@circ@bipole@path{battery}{#1}} -\def\pgf@circ@inductor@path#1{\ifpgf@circuit@europeaninductor\pgf@circ@bipole@path{fullgeneric}{#1}\else\pgf@circ@bipole@path{inductor}{#1}\fi} -\def\pgf@circ@lamp@path#1{\pgf@circ@bipole@path{lamp}{#1}} -\def\pgf@circ@vsource@path#1{\pgf@circ@bipole@path{vsource}{#1}} -\def\pgf@circ@vsourceam@path#1{\pgf@circ@bipole@path{vsourceAM}{#1}} -\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@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}} -\def\pgf@circ@cvsourcesin@path#1{\pgf@circ@bipole@path{cvsourcesin}{#1}} -\def\pgf@circ@cisource@path#1{\pgf@circ@bipole@path{cisource}{#1}} -\def\pgf@circ@cisourceam@path#1{\pgf@circ@bipole@path{cisourceAM}{#1}} -\def\pgf@circ@cisourcesin@path#1{\pgf@circ@bipole@path{cisourcesin}{#1}} -\def\pgf@circ@fulldiode@path#1{\pgf@circ@bipole@path{fulldiode}{#1}} -\def\pgf@circ@fullzdiode@path#1{\pgf@circ@bipole@path{fullzdiode}{#1}} -\def\pgf@circ@fullsdiode@path#1{\pgf@circ@bipole@path{fullsdiode}{#1}} -\def\pgf@circ@fulltdiode@path#1{\pgf@circ@bipole@path{fulltdiode}{#1}} -\def\pgf@circ@fulllediode@path#1{\pgf@circ@bipole@path{fulllediode}{#1}} -\def\pgf@circ@fullpdiode@path#1{\pgf@circ@bipole@path{fullpdiode}{#1}} -\def\pgf@circ@fullvarcap@path#1{\pgf@circ@bipole@path{fullvarcap}{#1}} -\def\pgf@circ@emptydiode@path#1{\pgf@circ@bipole@path{emptydiode}{#1}} -\def\pgf@circ@emptyzdiode@path#1{\pgf@circ@bipole@path{emptyzdiode}{#1}} -\def\pgf@circ@emptysdiode@path#1{\pgf@circ@bipole@path{emptysdiode}{#1}} -\def\pgf@circ@emptytdiode@path#1{\pgf@circ@bipole@path{emptytdiode}{#1}} -\def\pgf@circ@emptylediode@path#1{\pgf@circ@bipole@path{emptylediode}{#1}} -\def\pgf@circ@emptypdiode@path#1{\pgf@circ@bipole@path{emptypdiode}{#1}} -\def\pgf@circ@emptyvarcap@path#1{\pgf@circ@bipole@path{emptyvarcap}{#1}} -\def\pgf@circ@short@path#1{\pgf@circ@bipole@path{short}{#1}} -\def\pgf@circ@cspst@path#1{\pgf@circ@bipole@path{cspst}{#1}} -\def\pgf@circ@ospst@path#1{\pgf@circ@bipole@path{ospst}{#1}} -\def\pgf@circ@open@path#1{\pgf@circ@bipole@path{open}{#1}} -\def\pgf@circ@generic@path#1{\pgf@circ@bipole@path{generic}{#1}} -\def\pgf@circ@ageneric@path#1{\pgf@circ@bipole@path{ageneric}{#1}} -\def\pgf@circ@fullgeneric@path#1{\pgf@circ@bipole@path{fullgeneric}{#1}} -\def\pgf@circ@ammeter@path#1{\pgf@circ@bipole@path{ammeter}{#1}} -\def\pgf@circ@voltmeter@path#1{\pgf@circ@bipole@path{voltmeter}{#1}} -\def\pgf@circ@empty@path#1{} - - -%% Styles - -\tikzset{resistor/.style= {to path=\pgf@circ@resistor@path, l=#1}} -\tikzset{ammeter/.style= {to path=\pgf@circ@ammeter@path, l=#1}} -\tikzset{voltmeter/.style= {to path=\pgf@circ@voltmeter@path, l=#1}} -\tikzset{potentiometer/.style = {to path=\pgf@circ@potentiometer@path, l=#1}} -\tikzset{capacitor/.style = {to path=\pgf@circ@capacitor@path, l=#1}} -\tikzset{battery/.style = {to path=\pgf@circ@battery@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} -\tikzset{inductor/.style = {to path=\pgf@circ@inductor@path, l=#1}} -\tikzset{european voltage source/.style = {to path=\pgf@circ@vsource@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} -\tikzset{american voltage source/.style = {to path=\pgf@circ@vsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} -\tikzset{european current source/.style = {to path=\pgf@circ@isource@path, \circuitikzbasekey/bipole/is current=true, i=#1}} -\tikzset{american current source/.style = {to path=\pgf@circ@isourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}} -\tikzset{european controlled voltage source/.style = {to path=\pgf@circ@cvsource@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} -\tikzset{american controlled voltage source/.style = {to path=\pgf@circ@cvsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} -\tikzset{european controlled current source/.style = {to path=\pgf@circ@cisource@path, \circuitikzbasekey/bipole/is current=true, i=#1}} -\tikzset{american controlled current source/.style = {to path=\pgf@circ@cisourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}} -\tikzset{sinusoidal voltage source/.style = {to path=\pgf@circ@vsourcesin@path, \circuitikzbasekey/bipole/is voltage=true, v=#1 }} -\tikzset{sinusoidal current source/.style = {to path=\pgf@circ@isourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}} -\tikzset{controlled sinusoidal voltage source/.style = {to path=\pgf@circ@cvsourcesin@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} -\tikzset{controlled sinusoidal current source/.style = {to path=\pgf@circ@cisourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}} - -\tikzset{voltage source/.style = {\ifpgf@circuit@europeanvoltage european \else american \fi voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}} -\tikzset{current source/.style = {\ifpgf@circuit@europeancurrent european \else american \fi current source, \circuitikzbasekey/bipole/is current=true, i=#1}} -\tikzset{controlled voltage source/.style = {\ifpgf@circuit@europeanvoltage european \else american \fi controlled voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}} -\tikzset{controlled current source/.style = {\ifpgf@circuit@europeancurrent european \else american \fi controlled current source, \circuitikzbasekey/bipole/is current=true, i=#1}} - - -\tikzset{generic/.style = {to path=\pgf@circ@generic@path, l=#1}} -\tikzset{ageneric/.style = {to path=\pgf@circ@ageneric@path, l=#1}} -\tikzset{fullgeneric/.style = {to path=\pgf@circ@fullgeneric@path, l=#1}} -\tikzset{short/.style = {to path=\pgf@circ@short@path}} -\tikzset{open/.style = {to path=\pgf@circ@open@path}} - -\tikzset{lamp/.style = {to path=\pgf@circ@lamp@path}} - -\tikzset{full diode/.style = {to path=\pgf@circ@fulldiode@path}} -\tikzset{full Schottky diode/.style = {to path=\pgf@circ@fullsdiode@path}} -\tikzset{full Zener diode/.style = {to path=\pgf@circ@fullzdiode@path}} -\tikzset{full tunnel diode/.style = {to path=\pgf@circ@fulltdiode@path}} -\tikzset{full photodiode/.style = {to path=\pgf@circ@fullpdiode@path}} -\tikzset{full led/.style = {to path=\pgf@circ@fulllediode@path}} -\tikzset{full varcap/.style = {to path=\pgf@circ@fullvarcap@path}} - -\tikzset{empty diode/.style = {to path=\pgf@circ@emptydiode@path}} -\tikzset{empty Schottky diode/.style = {to path=\pgf@circ@emptysdiode@path}} -\tikzset{empty Zener diode/.style = {to path=\pgf@circ@emptyzdiode@path}} -\tikzset{empty tunnel diode/.style = {to path=\pgf@circ@emptytdiode@path}} -\tikzset{empty photodiode/.style = {to path=\pgf@circ@emptypdiode@path}} -\tikzset{empty led/.style = {to path=\pgf@circ@emptylediode@path}} -\tikzset{empty varcap/.style = {to path=\pgf@circ@emptyvarcap@path}} - - \tikzset{Schottky diode/.style = {\ifpgf@circuit@fulldiode full \else empty \fi Schottky diode}} - \tikzset{Zener diode/.style = {\ifpgf@circuit@fulldiode full \else empty \fi Zener diode}} - \tikzset{tunnel diode/.style = {\ifpgf@circuit@fulldiode full \else empty \fi tunnel diode}} - \tikzset{photodiode/.style = {\ifpgf@circuit@fulldiode full \else empty \fi photodiode}} - \tikzset{led/.style = {\ifpgf@circuit@fulldiode full \else empty \fi led}} - \tikzset{varcap/.style = {\ifpgf@circuit@fulldiode full \else empty \fi varcap}} - \tikzset{diode/.style = {\ifpgf@circuit@fulldiode full \else empty \fi diode}} - -\tikzset{closing switch/.style = {to path=\pgf@circ@cspst@path, l=#1}} -\tikzset{opening switch/.style = {to path=\pgf@circ@ospst@path, l=#1}} - -\tikzset{ammeter/.style = {to path=\pgf@circ@ammeter@path}} -\tikzset{voltmeter/.style = {to path=\pgf@circ@voltmeter@path}} - -% short forms -\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{isourcesin/.style = {sinusoidal current source = #1}} -\tikzset{cisourcesin/.style = {controlled sinusoidal current source = #1}} -\tikzset{cvsourcesin/.style = {controlled sinusoidal voltage source = #1}} - -\tikzset{controlled vsource/.style = {controlled voltage source = #1}} -\tikzset{controlled isource/.style = {controlled current source = #1}} -\tikzset{controlled vsourcesin/.style = {controlled sinusoidal voltage source = #1}} -\tikzset{controlled isourcesin/.style = {controlled sinusoidal current source = #1}} - -\tikzset{R/.style= {resistor = #1}} -\tikzset{pR/.style= {potentiometer = #1}} -\tikzset{C/.style = {capacitor = #1}} -\tikzset{L/.style = {inductor = #1}} -\tikzset{V/.style = {voltage source = #1}} -\tikzset{cV/.style = {controlled voltage source = #1}} -\tikzset{sV/.style = {sinusoidal voltage source = #1}} -\tikzset{csV/.style = {controlled sinusoidal voltage source = #1}} -\def\pgf@temp#1{ - \tikzset{V#1/.style = {voltage source, v#1=##1} } - \tikzset{cV#1/.style = {controlled voltage source, v#1=##1} } - \tikzset{sV#1/.style = {sinusoidal voltage source, v#1=##1} } - \tikzset{csV#1/.style = {controlled sinusoidal voltage source, v#1=##1} } -} -\pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<} -\pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_} -\tikzset{I/.style = {current source = #1}} -\tikzset{cI/.style = {controlled current source = #1}} -\tikzset{sI/.style = {sinusoidal current source = #1}} -\tikzset{csI/.style = {controlled sinusoidal current source = #1}} -\def\pgf@temp#1{ - \tikzset{I#1/.style = {current source, i#1=##1} } - \tikzset{cI#1/.style = {controlled current source, i#1=##1} } - \tikzset{sI#1/.style = {sinusoidal current source, i#1=##1} } - \tikzset{csI#1/.style = {controlled sinusoidal current source, i#1=##1} } -} -\pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<} -\pgf@temp{>_} \pgf@temp{<_} \pgf@temp{>^} \pgf@temp{<^} -\pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_} -\tikzset{Do/.style = {empty diode}} -\tikzset{tDo/.style = {empty tunnel diode}} -\tikzset{zDo/.style = {empty Zener diode}} -\tikzset{sDo/.style = {empty Schottky diode}} -\tikzset{pDo/.style = {empty photodiode}} -\tikzset{leDo/.style = {empty led}} -\tikzset{VCo/.style = {empty varcap}} -\tikzset{D*/.style = {full diode}} -\tikzset{tD*/.style = {full tunnel diode}} -\tikzset{zD*/.style = {full Zener diode}} -\tikzset{sD*/.style = {full Schottky diode}} -\tikzset{pD*/.style = {full photodiode}} -\tikzset{leD*/.style = {full led}} -\tikzset{VC*/.style = {full varcap}} -\tikzset{D/.style = {diode}} -\tikzset{tD/.style = {tunnel diode}} -\tikzset{zD/.style = {Zener diode}} -\tikzset{sD/.style = {Schottky diode}} -\tikzset{pD/.style = {photodiode}} -\tikzset{leD/.style = {led}} -\tikzset{VC/.style = {varcap}} - -\tikzset{cspst/.style = {closing switch = #1}} -\tikzset{ospst/.style = {opening switch = #1}} - -%% The environment +\input circuitikz1.code.tex \newenvironment{circuitikz}{ \begin{tikzpicture}}{\end{tikzpicture}} \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 new file mode 100644 index 00000000000..5df83a52d05 --- /dev/null +++ b/Master/texmf-dist/tex/latex/circuitikz/circuitikz1.code.tex @@ -0,0 +1,437 @@ +%%%%%%%%%%%% +%% Dimensions + +% coordinate bipoli +\newdimen\pgf@circ@res@up \newdimen\pgf@circ@res@down \newdimen\pgf@circ@res@zero +\newdimen\pgf@circ@res@left \newdimen\pgf@circ@res@right +\newdimen\pgf@circ@res@other +\newdimen\pgf@circ@res@step + +% thickness iniziale +\newdimen \pgfstartlinewidth + +\pgf@circ@Rlen = \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + + + +% Names +\ctikzset{name/.style = { n=#1 } } +\ctikzset{n/.code = { + \pgfkeys{/tikz/circuitikz/bipole/name=#1} +}} + +% Reflect the node along +\ctikzset{mirrored/.is choice} +\ctikzset{mirror value/.initial=1} +\ctikzset{mirrored/true/.code = {\ctikzsetvalof{mirror value}{-1}} } +\ctikzset{mirrored/false/.code = {\ctikzsetvalof{mirror value}{1}} } +\ctikzset{mirror/.style = {/tikz/circuitikz/mirrored=true}} + +% Initialize paths +\def\pgfcircresetpath{ + \ctikzset{bipole/name=, bipole/direction=, bipole/label/name=, bipole/label/position=90, + bipole/reversed=false, bipole/kind=, + 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 } +} + + +%% Generic bipole path +\def\pgf@circ@bipole@path#1#2{ + \pgfextra{ + \ctikzset{bipole/kind = #1} + + \edef\pgf@temp{\pgfkeysvalueof{/tikz/circuitikz/bipole/name}} + \def\pgf@circ@temp{} + \ifx\pgf@temp\pgf@circ@temp % if it has not a name + \pgfmathrandominteger{\pgf@circ@rand}{1000}{9999} + \ctikzset{bipole/name = #2\pgf@circ@rand} % create it + \fi + + \def\pgf@temp{open} + \def\pgf@circ@temp{#1} + } + \ifpgf@circuit@bipole@reversed + (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}end) {} + (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}start) {} + \else + (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}start) {} + (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}end) {} + \fi + \pgfextra{ + \pgf@circ@slope{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}} + {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}} + \edef\pgf@circ@direction{\pgfmathresult} + \ctikzset{bipole/direction = \pgfmathresult} + } + ($(\tikztostart) ! .5 ! (\tikztotarget)$) + node[#1shape, rotate=\pgf@circ@direction, yscale=\ctikzvalof{mirror value}] + (\ctikzvalof{bipole/name}) {} + \ifx\pgf@temp\pgf@circ@temp % if it is an open + \else + (\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 + \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 + % reset + \pgfextra{ + \pgfcircresetpath + } + (\tikztotarget) \tikztonodes % e si continua +} + + +%% Path definitions + +\def\pgf@circ@resistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{generic}{#1}\else\pgf@circ@bipole@path{resistor}{#1}\fi} +\def\pgf@circ@vresistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{tgeneric}{#1}\else\pgf@circ@bipole@path{vresistor}{#1}\fi} +\def\pgf@circ@potentiometer@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{genericpotentiometer}{#1}\else\pgf@circ@bipole@path{potentiometer}{#1}\fi} +\def\pgf@circ@capacitor@path#1{\pgf@circ@bipole@path{capacitor}{#1}} +\def\pgf@circ@polarcapacitor@path#1{\pgf@circ@bipole@path{polarcapacitor}{#1}} +\def\pgf@circ@vcapacitor@path#1{\pgf@circ@bipole@path{vcapacitor}{#1}} +\def\pgf@circ@battery@path#1{\pgf@circ@bipole@path{battery}{#1}} +\def\pgf@circ@europeaninductor@path#1{\pgf@circ@bipole@path{fullgeneric}{#1}} +\def\pgf@circ@americaninductor@path#1{\pgf@circ@bipole@path{americaninductor}{#1}} +\def\pgf@circ@cuteinductor@path#1{\pgf@circ@bipole@path{cuteinductor}{#1}} +\def\pgf@circ@inductor@path#1{% + \pgfextra{ + \edef\pgf@circ@temp{\ctikzvalof{inductor}}% + \def\pgf@temp{european}% + } + \ifx\pgf@temp\pgf@circ@temp% + \pgf@circ@europeaninductor@path{#1}% + \else% + \pgfextra{ \def\pgf@temp{cute} }% + \ifx\pgf@temp\pgf@circ@temp% + \pgf@circ@cuteinductor@path{#1}% + \else% + \pgf@circ@americaninductor@path{#1}% + \fi% + \fi% +} +\def\pgf@circ@vinductor@path#1{ + \pgfextra{ + \edef\pgf@circ@temp{\ctikzvalof{inductor}}% + \def\pgf@temp{european}% + } + \ifx\pgf@temp\pgf@circ@temp% + \pgf@circ@veuropeaninductor@path{#1}% + \else% + \pgfextra{ \def\pgf@temp{cute} }% + \ifx\pgf@temp\pgf@circ@temp% + \pgf@circ@vcuteinductor@path{#1}% + \else% + \pgf@circ@vamericaninductor@path{#1}% + \fi% + \fi% +} +\def\pgf@circ@veuropeaninductor@path#1{\pgf@circ@bipole@path{tfullgeneric}{#1}} +\def\pgf@circ@vamericaninductor@path#1{\pgf@circ@bipole@path{vamericaninductor}{#1}} +\def\pgf@circ@vcuteinductor@path#1{\pgf@circ@bipole@path{vcuteinductor}{#1}} +\def\pgf@circ@lamp@path#1{\pgf@circ@bipole@path{lamp}{#1}} +\def\pgf@circ@vsource@path#1{\pgf@circ@bipole@path{vsource}{#1}} +\def\pgf@circ@vsourceam@path#1{\pgf@circ@bipole@path{vsourceAM}{#1}} +\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@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}} +\def\pgf@circ@cvsourcesin@path#1{\pgf@circ@bipole@path{cvsourcesin}{#1}} +\def\pgf@circ@cisource@path#1{\pgf@circ@bipole@path{cisource}{#1}} +\def\pgf@circ@cisourceam@path#1{\pgf@circ@bipole@path{cisourceAM}{#1}} +\def\pgf@circ@cisourcesin@path#1{\pgf@circ@bipole@path{cisourcesin}{#1}} +\def\pgf@circ@fulldiode@path#1{\pgf@circ@bipole@path{fulldiode}{#1}} +\def\pgf@circ@fullzdiode@path#1{\pgf@circ@bipole@path{fullzdiode}{#1}} +\def\pgf@circ@fullsdiode@path#1{\pgf@circ@bipole@path{fullsdiode}{#1}} +\def\pgf@circ@fulltdiode@path#1{\pgf@circ@bipole@path{fulltdiode}{#1}} +\def\pgf@circ@fulllediode@path#1{\pgf@circ@bipole@path{fulllediode}{#1}} +\def\pgf@circ@fullpdiode@path#1{\pgf@circ@bipole@path{fullpdiode}{#1}} +\def\pgf@circ@fullvarcap@path#1{\pgf@circ@bipole@path{fullvarcap}{#1}} +\def\pgf@circ@emptydiode@path#1{\pgf@circ@bipole@path{emptydiode}{#1}} +\def\pgf@circ@emptyzdiode@path#1{\pgf@circ@bipole@path{emptyzdiode}{#1}} +\def\pgf@circ@emptysdiode@path#1{\pgf@circ@bipole@path{emptysdiode}{#1}} +\def\pgf@circ@emptytdiode@path#1{\pgf@circ@bipole@path{emptytdiode}{#1}} +\def\pgf@circ@emptylediode@path#1{\pgf@circ@bipole@path{emptylediode}{#1}} +\def\pgf@circ@emptypdiode@path#1{\pgf@circ@bipole@path{emptypdiode}{#1}} +\def\pgf@circ@emptyvarcap@path#1{\pgf@circ@bipole@path{emptyvarcap}{#1}} +\def\pgf@circ@short@path#1{\pgf@circ@bipole@path{short}{#1}} +\def\pgf@circ@cspst@path#1{\pgf@circ@bipole@path{cspst}{#1}} +\def\pgf@circ@ospst@path#1{\pgf@circ@bipole@path{ospst}{#1}} +\def\pgf@circ@open@path#1{\pgf@circ@bipole@path{open}{#1}} +\def\pgf@circ@generic@path#1{\pgf@circ@bipole@path{generic}{#1}} +\def\pgf@circ@ageneric@path#1{\pgf@circ@bipole@path{ageneric}{#1}} +\def\pgf@circ@tgeneric@path#1{\pgf@circ@bipole@path{tgeneric}{#1}} +\def\pgf@circ@fullgeneric@path#1{\pgf@circ@bipole@path{fullgeneric}{#1}} +\def\pgf@circ@tfullgeneric@path#1{\pgf@circ@bipole@path{tfullgeneric}{#1}} +\def\pgf@circ@ammeter@path#1{\pgf@circ@bipole@path{ammeter}{#1}} +\def\pgf@circ@voltmeter@path#1{\pgf@circ@bipole@path{voltmeter}{#1}} +\def\pgf@circ@empty@path#1{} +\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}} + +%% Styles + +%% Aggiungere per thyristor e tripoli semplici + +%\def\ctikzsetbipole#1#2{% +% \tikzset{#1/.style= {to path=#2, \circuitikzbasekey, l=##1}}% +%} +%\ctikzsetbipole{resistor}{\pgf@circ@resistor@path} + +\tikzset{resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@resistor@path, l=#1}} +\tikzset{american resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{resistor}{#1}, l=#1}} +\tikzset{european resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{generic}{#1}, l=#1}} +\tikzset{ammeter/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@ammeter@path, l=#1}} +\tikzset{voltmeter/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@voltmeter@path, l=#1}} +\tikzset{potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@potentiometer@path, l=#1}} +\tikzset{american potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{potentiometer}{#1}, l=#1}} +\tikzset{european potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{genericpotentiometer}{#1}, l=#1}} +\tikzset{variable resistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vresistor@path, l=#1}} +\tikzset{variable american resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{vresistor}{#1}, l=#1}} +\tikzset{variable european resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{tgeneric}{#1}, l=#1}} +\tikzset{capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@capacitor@path, l=#1}} +\tikzset{polar capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@polarcapacitor@path, l=#1}} +\tikzset{variable capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcapacitor@path, l=#1}} +\tikzset{battery/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@battery@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\tikzset{inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@inductor@path, l=#1}} +\tikzset{american inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americaninductor@path, l=#1}} +\tikzset{cute inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteinductor@path, l=#1}} +\tikzset{european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeaninductor@path, l=#1}} +\tikzset{variable inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vinductor@path, l=#1}} +\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{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}} +\tikzset{american current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}} +\tikzset{european controlled voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsource@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\tikzset{american controlled voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\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{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}} + +\tikzset{voltage source/.style = {\ifpgf@circuit@europeanvoltage european \else american \fi voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\tikzset{current source/.style = {\ifpgf@circuit@europeancurrent european \else american \fi current source, \circuitikzbasekey/bipole/is current=true, i=#1}} +\tikzset{controlled voltage source/.style = {\ifpgf@circuit@europeanvoltage european \else american \fi controlled voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\tikzset{controlled current source/.style = {\ifpgf@circuit@europeancurrent european \else american \fi controlled current source, \circuitikzbasekey/bipole/is current=true, i=#1}} + + +\tikzset{generic/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@generic@path, l=#1}} +\tikzset{ageneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ageneric@path, l=#1}} +\tikzset{tgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tgeneric@path, l=#1}} +\tikzset{fullgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullgeneric@path, l=#1}} +\tikzset{tfullgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tfullgeneric@path, l=#1}} +\tikzset{short/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@short@path}} +\tikzset{open/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@open@path}} + +\tikzset{lamp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@lamp@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}} +\tikzset{full tunnel diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulltdiode@path}} +\tikzset{full photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullpdiode@path}} +\tikzset{full led/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulllediode@path}} +\tikzset{full varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullvarcap@path}} + +\tikzset{empty diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptydiode@path}} +\tikzset{empty Schottky diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptysdiode@path}} +\tikzset{empty Zener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyzdiode@path}} +\tikzset{empty tunnel diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptytdiode@path}} +\tikzset{empty photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptypdiode@path}} +\tikzset{empty led/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptylediode@path}} +\tikzset{empty varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyvarcap@path}} + + \tikzset{Schottky diode/.style = {\ifpgf@circuit@fulldiode full \else empty \fi Schottky diode}} + \tikzset{Zener diode/.style = {\ifpgf@circuit@fulldiode full \else empty \fi Zener diode}} + \tikzset{tunnel diode/.style = {\ifpgf@circuit@fulldiode full \else empty \fi tunnel diode}} + \tikzset{photodiode/.style = {\ifpgf@circuit@fulldiode full \else empty \fi photodiode}} + \tikzset{led/.style = {\ifpgf@circuit@fulldiode full \else empty \fi led}} + \tikzset{varcap/.style = {\ifpgf@circuit@fulldiode full \else empty \fi varcap}} + \tikzset{diode/.style = {\ifpgf@circuit@fulldiode full \else empty \fi diode}} + +\tikzset{thyristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thyristor@path}} +\tikzset{memristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@memristor@path}} +\tikzset{triac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@triac@path}} + +\tikzset{closing switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cspst@path, l=#1}} +\tikzset{opening switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ospst@path, l=#1}} + +\tikzset{ammeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ammeter@path}} +\tikzset{voltmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@voltmeter@path}} + +% short forms +\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{isourcesin/.style = {sinusoidal current source = #1}} +\tikzset{cisourcesin/.style = {controlled sinusoidal current source = #1}} +\tikzset{cvsourcesin/.style = {controlled sinusoidal voltage source = #1}} + +\tikzset{controlled vsource/.style = {controlled voltage source = #1}} +\tikzset{controlled isource/.style = {controlled current source = #1}} +\tikzset{controlled vsourcesin/.style = {controlled sinusoidal voltage source = #1}} +\tikzset{controlled isourcesin/.style = {controlled sinusoidal current source = #1}} + +\tikzset{R/.style= {resistor = #1}} +\tikzset{vR/.style= {variable resistor = #1}} +\tikzset{pR/.style= {potentiometer = #1}} +\tikzset{C/.style = {capacitor = #1}} +\tikzset{pC/.style = {polar capacitor = #1}} +\tikzset{vC/.style = {variable capacitor = #1}} +\tikzset{L/.style = {inductor = #1}} +\tikzset{vL/.style = {variable inductor = #1}} +\tikzset{V/.style = {voltage source = #1}} +\tikzset{cV/.style = {controlled voltage source = #1}} +\tikzset{sV/.style = {sinusoidal voltage source = #1}} +\tikzset{csV/.style = {controlled sinusoidal voltage source = #1}} +\def\pgf@temp#1{ + \tikzset{V#1/.style = {voltage source, v#1=##1} } + \tikzset{cV#1/.style = {controlled voltage source, v#1=##1} } + \tikzset{sV#1/.style = {sinusoidal voltage source, v#1=##1} } + \tikzset{csV#1/.style = {controlled sinusoidal voltage source, v#1=##1} } +} +\pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<} +\pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_} +\tikzset{I/.style = {current source = #1}} +\tikzset{cI/.style = {controlled current source = #1}} +\tikzset{sI/.style = {sinusoidal current source = #1}} +\tikzset{csI/.style = {controlled sinusoidal current source = #1}} +\def\pgf@temp#1{ + \tikzset{I#1/.style = {current source, i#1=##1} } + \tikzset{cI#1/.style = {controlled current source, i#1=##1} } + \tikzset{sI#1/.style = {sinusoidal current source, i#1=##1} } + \tikzset{csI#1/.style = {controlled sinusoidal current source, i#1=##1} } +} +\pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<} +\pgf@temp{>_} \pgf@temp{<_} \pgf@temp{>^} \pgf@temp{<^} +\pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_} +\tikzset{Do/.style = {empty diode}} +\tikzset{tDo/.style = {empty tunnel diode}} +\tikzset{zDo/.style = {empty Zener diode}} +\tikzset{sDo/.style = {empty Schottky diode}} +\tikzset{pDo/.style = {empty photodiode}} +\tikzset{leDo/.style = {empty led}} +\tikzset{VCo/.style = {empty varcap}} +\tikzset{D*/.style = {full diode}} +\tikzset{tD*/.style = {full tunnel diode}} +\tikzset{zD*/.style = {full Zener diode}} +\tikzset{sD*/.style = {full Schottky diode}} +\tikzset{pD*/.style = {full photodiode}} +\tikzset{leD*/.style = {full led}} +\tikzset{VC*/.style = {full varcap}} +\tikzset{D/.style = {diode}} +\tikzset{tD/.style = {tunnel diode}} +\tikzset{zD/.style = {Zener diode}} +\tikzset{sD/.style = {Schottky diode}} +\tikzset{pD/.style = {photodiode}} +\tikzset{leD/.style = {led}} +\tikzset{VC/.style = {varcap}} + +\tikzset{Tr/.style = {triac}} +\tikzset{Mr/.style = {memristor}} +\tikzset{Ty/.style = {thyristor}} + +\tikzset{cspst/.style = {closing switch = #1}} +\tikzset{ospst/.style = {opening switch = #1}} + +\def\inheritlogicport#1#2{ + \pgfdeclareshape{#2 port}{ + \inheritsavedanchors[from=#1 #2 port] + \inheritbackgroundpath[from=#1 #2 port] + \inheritanchor[from=#1 #2 port]{in} + \inheritanchor[from=#1 #2 port]{in 1} + \inheritanchor[from=#1 #2 port]{in 2} + \inheritanchor[from=#1 #2 port]{out} + \inheritanchor[from=#1 #2 port]{center} + \inheritanchor[from=#1 #2 port]{left} + } +} + +\ifpgf@circuit@europeanlogicport + \inheritlogicport{european}{and} + \inheritlogicport{european}{or} + \inheritlogicport{european}{xor} + \inheritlogicport{european}{not} + \inheritlogicport{european}{nand} + \inheritlogicport{european}{nor} + \inheritlogicport{european}{xnor} +\else + \inheritlogicport{american}{and} + \inheritlogicport{american}{or} + \inheritlogicport{american}{xor} + \inheritlogicport{american}{not} + \inheritlogicport{american}{nand} + \inheritlogicport{american}{nor} + \inheritlogicport{american}{xnor} +\fi + +% Transistor like bipoles + +\def\pgf@circ@trans@path#1#2{ + \pgfextra{ + \edef\pgf@temp{\pgfkeysvalueof{/tikz/circuitikz/bipole/name}} + \def\pgf@circ@temp{#2} + \ifx\pgf@temp\pgf@circ@temp % if it has not a name + \pgfmathrandominteger{\pgf@circ@rand}{1000}{9999} + \ctikzset{bipole/name = trans\pgf@circ@rand} % create it + \fi + } + \ifpgf@circuit@bipole@reversed + (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}end) {} + (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}start) {} + \else + (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}start) {} + (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}end) {} + \fi + \pgfextra{ + \pgf@circ@slope{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}} + {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}} + \pgfmathadd{\pgfmathresult}{-90} + \edef\pgf@circ@direction{\pgfmathresult} + \ctikzset{bipole/direction = \pgfmathresult} + } + ($(\tikztostart) ! .5 ! (\tikztotarget)$) + node[#1, /tikz/rotate=\pgf@circ@direction, xscale=\ctikzvalof{mirror value}] + (\ctikzvalof{bipole/name}) {} node {\ctikzvalof{bipole/label/name}} + (\ctikzvalof{bipole/name}start.center) -- (\ctikzvalof{bipole/name}.left) + (\ctikzvalof{bipole/name}.right) -- (\ctikzvalof{bipole/name}end.center) + \pgfextra{ + \pgfcircresetpath + } + (\tikztotarget) \tikztonodes % e si continua +} + + +\def\pgf@circ@definetranspath#1{ + \tikzset{T#1/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@trans@path{#1}{}, l=##1}} +} + +\pgf@circ@definetranspath{nmos} +\pgf@circ@definetranspath{pmos} +\pgf@circ@definetranspath{npn} +\pgf@circ@definetranspath{pnp} +\pgf@circ@definetranspath{nfet} +\pgf@circ@definetranspath{nigfete} +\pgf@circ@definetranspath{nigfetd} +\pgf@circ@definetranspath{pfet} +\pgf@circ@definetranspath{pigfete} +\pgf@circ@definetranspath{pigfetd} +\pgf@circ@definetranspath{njfet} +\pgf@circ@definetranspath{pjfet} +\pgf@circ@definetranspath{pigbt} +\pgf@circ@definetranspath{nigbt} diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcircbipoles.sty b/Master/texmf-dist/tex/latex/circuitikz/pgfcircbipoles.sty index 1e5a363a743..96cd4ca2551 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcircbipoles.sty +++ b/Master/texmf-dist/tex/latex/circuitikz/pgfcircbipoles.sty @@ -8,46 +8,48 @@ % See the file doc/LICENSE for more details. %% Generic macro for defining a bipole shape -% #1 - lower y-size of the bipole (from the center). If empty, same ad #3 -% #2 - #shape is the name of the shape -% #3 - upper y-size of the bipole (from the center) -% #4 - macros drawing the bipole +% #1 - additional anchors +% #2 - lower y-size of the bipole (from the center). +% #3 - #shape is the name of the shape +% #4 - upper y-size of the bipole (from the center) +% #5 - width of the bipole +% #6 - macros drawing the bipole -\newcommand{\pgfcircdeclarebipole}[5][]{ - \pgfdeclareshape{#2shape}{ +\long\def\pgfcircdeclarebipole#1#2#3#4#5#6{ + \pgfdeclareshape{#3shape}{ \savedanchor{\northeast}{ - \pgf@y=#3\pgf@circ@Rlen + \pgf@y=#4\pgf@circ@Rlen \pgf@y=.5\pgf@y - \pgf@x=#4\pgf@circ@Rlen + \pgf@x=#5\pgf@circ@Rlen \pgf@x=.5\pgf@x } \savedanchor{\northeastborder}{ - \pgf@y=#3\pgf@circ@Rlen + \pgf@y=#4\pgf@circ@Rlen \pgf@y=.5\pgf@y \pgf@y=\ctikzvalof{bipoles/border margin}\pgf@y - \pgf@x=#4\pgf@circ@Rlen + \pgf@x=#5\pgf@circ@Rlen \pgf@x=.5\pgf@x \pgf@x=\ctikzvalof{bipoles/border margin}\pgf@x } \savedanchor{\southwestborder}{ - \pgf@y=-#1\pgf@circ@Rlen + \pgf@y=-#2\pgf@circ@Rlen \pgf@y=.5\pgf@y \pgf@y=\ctikzvalof{bipoles/border margin}\pgf@y - \pgf@x=-#4\pgf@circ@Rlen + \pgf@x=-#5\pgf@circ@Rlen \pgf@x=.5\pgf@x \pgf@x=\ctikzvalof{bipoles/border margin}\pgf@x } \savedanchor{\southwest}{ - \pgf@y=-#1\pgf@circ@Rlen + \pgf@y=-#2\pgf@circ@Rlen \pgf@y=.5\pgf@y - \pgf@x=-#4\pgf@circ@Rlen + \pgf@x=-#5\pgf@circ@Rlen \pgf@x=.5\pgf@x } \savedanchor{\centerpoint}{ - \pgf@circ@res@down=-#1\pgf@circ@Rlen - \pgf@circ@res@up=#3\pgf@circ@Rlen + \pgf@circ@res@down=-#2\pgf@circ@Rlen + \pgf@circ@res@up=#4\pgf@circ@Rlen \pgfpointorigin \pgf@y=\pgf@circ@res@up \advance\pgf@y by\pgf@circ@res@down @@ -147,6 +149,9 @@ \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@right}}{\pgfpoint{-\pgf@x}{-\pgf@y}} \fi } + + #1 + \backgroundpath{ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} @@ -160,7 +165,7 @@ \pgfstartlinewidth=\pgflinewidth - #5 + #6 \pgfsetlinewidth{\pgfstartlinewidth} } @@ -171,7 +176,7 @@ %% Standard bipole shapes declarations %% Resistor -\pgfcircdeclarebipole[\ctikzvalof{bipoles/resistor/height}]{resistor}{\ctikzvalof{bipoles/resistor/height}}{\ctikzvalof{bipoles/resistor/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/resistor/height}}{resistor}{\ctikzvalof{bipoles/resistor/height}}{\ctikzvalof{bipoles/resistor/width}}{ \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen \divide \pgf@circ@res@step by 12 @@ -197,10 +202,10 @@ } -%% Potentiometer -\pgfcircdeclarebipole[\ctikzvalof{bipoles/potentiometer/height}]{potentiometer}{\ctikzvalof{bipoles/potentiometer/height}}{\ctikzvalof{bipoles/potentiometer/width}}{ - \pgf@circ@res@step = \ctikzvalof{bipoles/potentiometer/width}\pgf@circ@Rlen +%% Variable resistor +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vresistor/height}}{vresistor}{\ctikzvalof{bipoles/vresistor/height}}{\ctikzvalof{bipoles/vresistor/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/vresistor/width}\pgf@circ@Rlen \divide \pgf@circ@res@step by 12 \def\myfrac{.5} @@ -236,7 +241,7 @@ %% Capacitor -\pgfcircdeclarebipole[\ctikzvalof{bipoles/capacitor/height}]{capacitor}{\ctikzvalof{bipoles/capacitor/height}}{\ctikzvalof{bipoles/capacitor/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/capacitor/height}}{capacitor}{\ctikzvalof{bipoles/capacitor/height}}{\ctikzvalof{bipoles/capacitor/width}}{ \pgf@circ@res@step = \ctikzvalof{bipoles/capacitor/width}\pgf@circ@Rlen \divide \pgf@circ@res@step by 5 @@ -249,9 +254,32 @@ \pgfusepath{draw} } + +%% Polar Capacitor + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/pcapacitor/height}}{polarcapacitor}{\ctikzvalof{bipoles/pcapacitor/height}}{\ctikzvalof{bipoles/pcapacitor/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/pcapacitor/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 5 + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfscope + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left+ \ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgftransformrotate{-90} + \pgfpathsine{\pgfpoint{\pgf@circ@res@up}{-\ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}} + \pgfpathcosine{\pgfpoint{\pgf@circ@res@up}{\ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}} + \pgfusepath{draw} + \endpgfscope + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + +} + %% Battery -\pgfcircdeclarebipole[\ctikzvalof{bipoles/battery/height}]{battery}{\ctikzvalof{bipoles/battery/height}}{\ctikzvalof{bipoles/battery/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/battery/height}}{battery}{\ctikzvalof{bipoles/battery/height}}{\ctikzvalof{bipoles/battery/width}}{ \pgf@circ@res@step = \ctikzvalof{bipoles/battery/width}\pgf@circ@Rlen \divide \pgf@circ@res@step by 6 @@ -273,21 +301,41 @@ -%% Inductor +%% cute inductor -\pgfcircdeclarebipole[\ctikzvalof{bipoles/inductor/height}]{inductor}{\ctikzvalof{bipoles/inductor/height}}{\ctikzvalof{bipoles/inductor/width}}{ - \pgf@circ@res@step=\ctikzvalof{bipoles/inductor/width}\pgf@circ@Rlen - \divide \pgf@circ@res@step by \ctikzvalof{bipoles/inductor/coils} +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cute inductor/height}}{cuteinductor}{\ctikzvalof{bipoles/cute inductor/height}}{\ctikzvalof{bipoles/cute inductor/width}}{ + \pgf@circ@res@step=\ctikzvalof{bipoles/cute inductor/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by \ctikzvalof{bipoles/cute inductor/coils} - \pgfdecorationsegmentamplitude=\ctikzvalof{bipoles/inductor/height}\pgf@circ@Rlen + \pgfdecorationsegmentamplitude=\ctikzvalof{bipoles/cute inductor/height}\pgf@circ@Rlen \pgfdecorationsegmentamplitude=.5\pgfdecorationsegmentamplitude \pgfdecorationsegmentlength = \pgf@circ@res@step \pgfdecorationsegmentaspect=.6 - \begin{pgfdecoration}{{coil}{\pgfdecoratedremainingdistance}} + \pgfdecoration{{coil}{\pgfdecoratedremainingdistance}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} + \endpgfdecoration + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfusepath{stroke} +} + + + +%% american inductor + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/american inductor/height 2}}{americaninductor}{\ctikzvalof{bipoles/american inductor/height}}{\ctikzvalof{bipoles/american inductor/width}}{ + \pgf@circ@res@step=\ctikzvalof{bipoles/american inductor/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by \ctikzvalof{bipoles/american inductor/coils} + + \pgfdecorationsegmentamplitude=\ctikzvalof{bipoles/american inductor/height}\pgf@circ@Rlen + \pgfdecorationsegmentamplitude=.5\pgfdecorationsegmentamplitude + \pgfdecorationsegmentlength = 1.9\pgf@circ@res@step + + \pgfdecoration{{bumps}{\pgfdecoratedremainingdistance}} \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} - \end{pgfdecoration} + \endpgfdecoration \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} \pgfusepath{stroke} } @@ -295,9 +343,10 @@ + %% Independent voltage source -\pgfcircdeclarebipole[\ctikzvalof{bipoles/vsource/height}]{vsource}{\ctikzvalof{bipoles/vsource/height}}{\ctikzvalof{bipoles/vsource/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsource/height}}{vsource}{\ctikzvalof{bipoles/vsource/height}}{\ctikzvalof{bipoles/vsource/width}}{ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} @@ -310,7 +359,7 @@ %% Independent voltage source - American style -\pgfcircdeclarebipole[\ctikzvalof{bipoles/vsourceam/height}]{vsourceAM}{\ctikzvalof{bipoles/vsourceam/height}}{\ctikzvalof{bipoles/vsourceam/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsourceam/height}}{vsourceAM}{\ctikzvalof{bipoles/vsourceam/height}}{\ctikzvalof{bipoles/vsourceam/width}}{ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} @@ -327,7 +376,7 @@ %% Independent sinusoidal voltage source -\pgfcircdeclarebipole[\ctikzvalof{bipoles/vsourcesin/height}]{vsourcesin}{\ctikzvalof{bipoles/vsourcesin/height}}{\ctikzvalof{bipoles/vsourcesin/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsourcesin/height}}{vsourcesin}{\ctikzvalof{bipoles/vsourcesin/height}}{\ctikzvalof{bipoles/vsourcesin/width}}{ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} @@ -348,7 +397,7 @@ %% Independent current source -\pgfcircdeclarebipole[\ctikzvalof{bipoles/isource/height}]{isource}{\ctikzvalof{bipoles/isource/height}}{\ctikzvalof{bipoles/isource/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/isource/height}}{isource}{\ctikzvalof{bipoles/isource/height}}{\ctikzvalof{bipoles/isource/width}}{ \pgfpointorigin \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} @@ -362,7 +411,7 @@ %% Independent current source - American -\pgfcircdeclarebipole[\ctikzvalof{bipoles/isourceam/height}]{isourceAM}{\ctikzvalof{bipoles/isourceam/height}}{\ctikzvalof{bipoles/isourceam/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/isourceam/height}}{isourceAM}{\ctikzvalof{bipoles/isourceam/height}}{\ctikzvalof{bipoles/isourceam/width}}{ \pgfpointorigin \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} @@ -382,7 +431,7 @@ %% Independent sinusoidal current source -\pgfcircdeclarebipole[\ctikzvalof{bipoles/isource/height}]{isourcesin}{\ctikzvalof{bipoles/isource/height}}{\ctikzvalof{bipoles/isource/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/isource/height}}{isourcesin}{\ctikzvalof{bipoles/isource/height}}{\ctikzvalof{bipoles/isource/width}}{ \pgfpointorigin \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} @@ -404,7 +453,7 @@ %% Controlled voltage source -\pgfcircdeclarebipole[\ctikzvalof{bipoles/cvsource/height}]{cvsource}{\ctikzvalof{bipoles/cvsource/height}}{\ctikzvalof{bipoles/cvsource/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cvsource/height}}{cvsource}{\ctikzvalof{bipoles/cvsource/height}}{\ctikzvalof{bipoles/cvsource/width}}{ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} @@ -422,7 +471,7 @@ %% Controlled voltage source - American -\pgfcircdeclarebipole[\ctikzvalof{bipoles/cvsourceam/height}]{cvsourceAM}{\ctikzvalof{bipoles/cvsourceam/height}}{\ctikzvalof{bipoles/cvsourceam/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cvsourceam/height}}{cvsourceAM}{\ctikzvalof{bipoles/cvsourceam/height}}{\ctikzvalof{bipoles/cvsourceam/width}}{ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} @@ -439,7 +488,7 @@ %% Controlled sinusoidal voltage source -\pgfcircdeclarebipole[\ctikzvalof{bipoles/cvsourcesin/height}]{cvsourcesin}{\ctikzvalof{bipoles/cvsourcesin/height}}{\ctikzvalof{bipoles/cvsourcesin/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cvsourcesin/height}}{cvsourcesin}{\ctikzvalof{bipoles/cvsourcesin/height}}{\ctikzvalof{bipoles/cvsourcesin/width}}{ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} @@ -468,7 +517,7 @@ %% Controlled sinusoidal current source -\pgfcircdeclarebipole[\ctikzvalof{bipoles/cvsourcesin/height}]{cisourcesin}{\ctikzvalof{bipoles/cvsourcesin/height}}{\ctikzvalof{bipoles/cvsourcesin/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cvsourcesin/height}}{cisourcesin}{\ctikzvalof{bipoles/cvsourcesin/height}}{\ctikzvalof{bipoles/cvsourcesin/width}}{ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} @@ -498,7 +547,7 @@ %% Controlled current source -\pgfcircdeclarebipole[\ctikzvalof{bipoles/cisource/height}]{cisource}{\ctikzvalof{bipoles/cisource/height}}{\ctikzvalof{bipoles/cisource/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cisource/height}}{cisource}{\ctikzvalof{bipoles/cisource/height}}{\ctikzvalof{bipoles/cisource/width}}{ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} @@ -517,7 +566,7 @@ %% Controlled current source - American -\pgfcircdeclarebipole[\ctikzvalof{bipoles/cisourceam/height}]{cisourceAM}{\ctikzvalof{bipoles/cisourceam/height}}{\ctikzvalof{bipoles/cisourceam/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cisourceam/height}}{cisourceAM}{\ctikzvalof{bipoles/cisourceam/height}}{\ctikzvalof{bipoles/cisourceam/width}}{ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} @@ -539,7 +588,7 @@ %% Black generic diode -\pgfcircdeclarebipole[\ctikzvalof{bipoles/diode/height}]{fulldiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fulldiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} @@ -558,7 +607,7 @@ %% Black Zener diode -\pgfcircdeclarebipole[\ctikzvalof{bipoles/diode/height}]{fullzdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fullzdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} @@ -579,7 +628,7 @@ %% Black Schottky diode -\pgfcircdeclarebipole[\ctikzvalof{bipoles/diode/height}]{fullsdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fullsdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} \pgfscope @@ -604,7 +653,7 @@ %% Black tunnel diode -\pgfcircdeclarebipole[\ctikzvalof{bipoles/diode/height}]{fulltdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fulltdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} \pgfscope @@ -625,7 +674,7 @@ %% Black light emitting diode -\pgfcircdeclarebipole[\ctikzvalof{bipoles/diode/height}]{fulllediode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fulllediode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} \pgfscope @@ -654,7 +703,7 @@ %% Black photodiode -\pgfcircdeclarebipole[\ctikzvalof{bipoles/diode/height}]{fullpdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fullpdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} \pgfscope @@ -682,7 +731,7 @@ %% Black varcap -\pgfcircdeclarebipole[\ctikzvalof{bipoles/varcap/height}]{fullvarcap}{\ctikzvalof{bipoles/varcap/height}}{\ctikzvalof{bipoles/varcap/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/varcap/height}}{fullvarcap}{\ctikzvalof{bipoles/varcap/height}}{\ctikzvalof{bipoles/varcap/width}}{ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} \pgfscope @@ -704,7 +753,7 @@ %% Empty generic diode -\pgfcircdeclarebipole[\ctikzvalof{bipoles/diode/height}]{emptydiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptydiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} @@ -724,7 +773,7 @@ %% Empty Zener diode -\pgfcircdeclarebipole[\ctikzvalof{bipoles/diode/height}]{emptyzdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptyzdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} @@ -745,7 +794,7 @@ %% Empty Schottky diode -\pgfcircdeclarebipole[\ctikzvalof{bipoles/diode/height}]{emptysdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptysdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} \pgfscope @@ -770,7 +819,7 @@ %% Empty tunnel diode -\pgfcircdeclarebipole[\ctikzvalof{bipoles/diode/height}]{emptytdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptytdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} \pgfscope @@ -791,7 +840,7 @@ %% Empty light emitting diode -\pgfcircdeclarebipole[\ctikzvalof{bipoles/diode/height}]{emptylediode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptylediode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} \pgfscope @@ -819,7 +868,7 @@ %% Empty photodiode -\pgfcircdeclarebipole[\ctikzvalof{bipoles/diode/height}]{emptypdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptypdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} \pgfscope @@ -847,7 +896,7 @@ %% Empty varcap -\pgfcircdeclarebipole[\ctikzvalof{bipoles/varcap/height}]{emptyvarcap}{\ctikzvalof{bipoles/varcap/height}}{\ctikzvalof{bipoles/varcap/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/varcap/height}}{emptyvarcap}{\ctikzvalof{bipoles/varcap/height}}{\ctikzvalof{bipoles/varcap/width}}{ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} \pgfscope @@ -869,7 +918,7 @@ %% Closing SPST -\pgfcircdeclarebipole[\ctikzvalof{bipoles/interr/height 2}]{cspst}{\ctikzvalof{bipoles/interr/height}}{\ctikzvalof{bipoles/interr/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/interr/height 2}}{cspst}{\ctikzvalof{bipoles/interr/height}}{\ctikzvalof{bipoles/interr/width}}{ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} @@ -884,7 +933,7 @@ %% Opening SPST -\pgfcircdeclarebipole[\ctikzvalof{bipoles/interr/height 2}]{ospst}{\ctikzvalof{bipoles/interr/height}}{\ctikzvalof{bipoles/interr/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/interr/height 2}}{ospst}{\ctikzvalof{bipoles/interr/height}}{\ctikzvalof{bipoles/interr/width}}{ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} @@ -901,7 +950,7 @@ %% Ammeter -\pgfcircdeclarebipole[\ctikzvalof{bipoles/ammeter/height}]{ammeter}{\ctikzvalof{bipoles/ammeter/height}}{\ctikzvalof{bipoles/ammeter/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/ammeter/height}}{ammeter}{\ctikzvalof{bipoles/ammeter/height}}{\ctikzvalof{bipoles/ammeter/width}}{ \def\pgf@circ@temp{right} \ifx\tikz@res@label@pos\pgf@circ@temp \pgf@circ@res@step=-1.2\pgf@circ@res@up @@ -947,7 +996,7 @@ %% Voltmeter -\pgfcircdeclarebipole[\ctikzvalof{bipoles/voltmeter/height}]{voltmeter}{\ctikzvalof{bipoles/voltmeter/height}}{\ctikzvalof{bipoles/voltmeter/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/voltmeter/height}}{voltmeter}{\ctikzvalof{bipoles/voltmeter/height}}{\ctikzvalof{bipoles/voltmeter/width}}{ \def\pgf@circ@temp{right} \ifx\tikz@res@label@pos\pgf@circ@temp \pgf@circ@res@step=-1.2\pgf@circ@res@up @@ -993,17 +1042,17 @@ %% Short circuit -\pgfcircdeclarebipole[0]{short}{0}{0}{ } +\pgfcircdeclarebipole{}{0}{short}{0}{0}{ } %% Open circuit -\pgfcircdeclarebipole[\ctikzvalof{bipoles/open/height}]{open}{\ctikzvalof{bipoles/open/height}}{\ctikzvalof{bipoles/open/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/open/height}}{open}{\ctikzvalof{bipoles/open/height}}{\ctikzvalof{bipoles/open/width}}{ } %% Generic bipole - used as resistor by some (bleah) -\pgfcircdeclarebipole[\ctikzvalof{bipoles/generic/height}]{generic}{\ctikzvalof{bipoles/generic/height}}{\ctikzvalof{bipoles/generic/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/generic/height}}{generic}{\ctikzvalof{bipoles/generic/height}}{\ctikzvalof{bipoles/generic/width}}{ \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen \divide \pgf@circ@res@step by 14 @@ -1017,7 +1066,7 @@ %% Generic bipole, filled - used as inductor by some (bleah) -\pgfcircdeclarebipole[\ctikzvalof{bipoles/fullgeneric/height}]{fullgeneric}{\ctikzvalof{bipoles/fullgeneric/height}}{\ctikzvalof{bipoles/fullgeneric/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/fullgeneric/height}}{fullgeneric}{\ctikzvalof{bipoles/fullgeneric/height}}{\ctikzvalof{bipoles/fullgeneric/width}}{ \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen \divide \pgf@circ@res@step by 14 @@ -1031,12 +1080,40 @@ %% Generic asymmetric bipole -\pgfcircdeclarebipole[\ctikzvalof{bipoles/ageneric/height}]{ageneric}{\ctikzvalof{bipoles/ageneric/height}}{\ctikzvalof{bipoles/ageneric/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/ageneric/height}}{ageneric}{\ctikzvalof{bipoles/ageneric/height}}{\ctikzvalof{bipoles/ageneric/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 14 + + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfusepath{draw} + + \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{stroke,fill} +} + + + +%% Memristor + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/memristor/height}}{memristor}{\ctikzvalof{bipoles/memristor/height}}{\ctikzvalof{bipoles/memristor/width}}{ \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen \divide \pgf@circ@res@step by 14 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{.72*\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{.72*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{.35*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{.35*\pgf@circ@res@left}{-\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{-.05*\pgf@circ@res@left}{-\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{-.05*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{.42*\pgf@circ@res@right}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{.42*\pgf@circ@res@right}{0pt}} + \pgfpathlineto{\pgfpoint{.8*\pgf@circ@res@right}{0pt}} \pgfusepath{draw} @@ -1046,20 +1123,143 @@ + +%% Generic empty tunable + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/tgeneric/height}}{tgeneric}{\ctikzvalof{bipoles/tgeneric/height}}{\ctikzvalof{bipoles/tgeneric/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 14 + + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@down}} + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfusepath{draw} + + \pgfscope + \pgfsetarrowsend{to} + \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfusepath{draw} + \endpgfscope +} + +%% Generic full tunable + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/tfullgeneric/height}}{tfullgeneric}{\ctikzvalof{bipoles/tfullgeneric/height}}{\ctikzvalof{bipoles/tfullgeneric/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 14 + + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@down}} + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfusepath{draw,fill} + + \pgfscope + \pgfsetarrowsend{to} + \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfusepath{draw} + \endpgfscope +} + + +%% Variable Cute Inductor + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vcuteinductor/height}}{vcuteinductor}{\ctikzvalof{bipoles/vcuteinductor/height}}{\ctikzvalof{bipoles/vcuteinductor/width}}{ + \pgf@circ@res@step=\ctikzvalof{bipoles/vcuteinductor/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by \ctikzvalof{bipoles/vcuteinductor/coils} + + \pgfdecorationsegmentamplitude=\ctikzvalof{bipoles/vcuteinductor/coil height}\pgf@circ@Rlen + \pgfdecorationsegmentamplitude=.5\pgfdecorationsegmentamplitude + \pgfdecorationsegmentlength = \pgf@circ@res@step + \pgfdecorationsegmentaspect=.6 + + \pgfdecoration{{coil}{\pgfdecoratedremainingdistance}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} + \endpgfdecoration + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfusepath{stroke} + + \pgfscope + \pgfsetarrowsend{to} + \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfusepath{draw} + \endpgfscope +} + + +%% variable american inductor + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vamerican inductor/height 2}}{vamericaninductor}{\ctikzvalof{bipoles/vamerican inductor/height}}{\ctikzvalof{bipoles/vamerican inductor/width}}{ + \pgf@circ@res@step=\ctikzvalof{bipoles/vamerican inductor/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by \ctikzvalof{bipoles/vamerican inductor/coils} + + \pgfdecorationsegmentamplitude=\ctikzvalof{bipoles/vamerican inductor/height}\pgf@circ@Rlen + \pgfdecorationsegmentamplitude=.5\pgfdecorationsegmentamplitude + \pgfdecorationsegmentamplitude=.5\pgfdecorationsegmentamplitude % per freccia + \pgfdecorationsegmentlength = 1.9\pgf@circ@res@step + + \pgfdecoration{{bumps}{\pgfdecoratedremainingdistance}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} + \endpgfdecoration + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfusepath{stroke} + + \pgfscope + \pgfsetarrowsend{to} + \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfusepath{draw} + \endpgfscope +} + + + + +%% Variable Capacitor + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vcapacitor/height}}{vcapacitor}{\ctikzvalof{bipoles/vcapacitor/height}}{\ctikzvalof{bipoles/vcapacitor/width}}{ + %\pgf@circ@res@step = \ctikzvalof{bipoles/vcapacitor/width}\pgf@circ@Rlen + \pgf@circ@res@step = \ctikzvalof{bipoles/vcapacitor/capacitor width} \pgf@circ@res@right + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@down}} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \pgfscope + \pgfsetarrowsend{to} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + \endpgfscope + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{0pt}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}} + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfusepath{draw} +} + %%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Handling of terminals %% Easily usable styles -\tikzset{*-/.style = {\circuitikzbasekey/bipole/nodes/left=full, \circuitikzbasekey/bipole/nodes/right=none}} -\tikzset{*-o/.style = {\circuitikzbasekey/bipole/nodes/left=full, \circuitikzbasekey/bipole/nodes/right=empty}} -\tikzset{*-*/.style = {\circuitikzbasekey/bipole/nodes/left=full, \circuitikzbasekey/bipole/nodes/right=full}} -\tikzset{o-/.style = {\circuitikzbasekey/bipole/nodes/left=empty, \circuitikzbasekey/bipole/nodes/right=none}} -\tikzset{o-o/.style = {\circuitikzbasekey/bipole/nodes/left=empty, \circuitikzbasekey/bipole/nodes/right=empty}} -\tikzset{o-*/.style = {\circuitikzbasekey/bipole/nodes/left=empty, \circuitikzbasekey/bipole/nodes/right=full}} -\tikzset{-o/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=empty}} -\tikzset{-*/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=full}} +\ctikzset{*-/.style = {\circuitikzbasekey/bipole/nodes/left=full, \circuitikzbasekey/bipole/nodes/right=none}} +\ctikzset{*-o/.style = {\circuitikzbasekey/bipole/nodes/left=full, \circuitikzbasekey/bipole/nodes/right=empty}} +\ctikzset{*-*/.style = {\circuitikzbasekey/bipole/nodes/left=full, \circuitikzbasekey/bipole/nodes/right=full}} +\ctikzset{o-/.style = {\circuitikzbasekey/bipole/nodes/left=empty, \circuitikzbasekey/bipole/nodes/right=none}} +\ctikzset{o-o/.style = {\circuitikzbasekey/bipole/nodes/left=empty, \circuitikzbasekey/bipole/nodes/right=empty}} +\ctikzset{o-*/.style = {\circuitikzbasekey/bipole/nodes/left=empty, \circuitikzbasekey/bipole/nodes/right=full}} +\ctikzset{-o/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=empty}} +\ctikzset{-*/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=full}} \tikzset{reversed/.style = {\circuitikzbasekey/bipole/reversed=true}} @@ -1101,75 +1301,6 @@ -\pgfdeclareshape{not port} - { - \anchor{center}{\pgfpointorigin} - \savedanchor\northwest{% - \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/height}\pgf@y - \pgf@y=.5\pgf@y - \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \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 - } - \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 - - \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/circle width}\pgf@circ@res@right - - \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-\pgf@circ@res@other}{0pt}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}} - \pgfusepath{draw} - \pgfpathellipse - {\pgfpoint{\pgf@circ@res@step-.5\pgf@circ@res@other}{0pt}} - {\pgfpoint{.5\pgf@circ@res@other}{0pt}} - {\pgfpoint{0pt}{.5\pgf@circ@res@other}} - \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} - - } - } @@ -1177,7 +1308,7 @@ %% Lamp -\pgfcircdeclarebipole[\ctikzvalof{bipoles/lamp/height}]{lamp}{\ctikzvalof{bipoles/lamp/height}}{\ctikzvalof{bipoles/lamp/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/lamp/height}}{lamp}{\ctikzvalof{bipoles/lamp/height}}{\ctikzvalof{bipoles/lamp/width}}{ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcirccurrent.sty b/Master/texmf-dist/tex/latex/circuitikz/pgfcirccurrent.sty index c86d57635da..05926bbcbdb 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcirccurrent.sty +++ b/Master/texmf-dist/tex/latex/circuitikz/pgfcirccurrent.sty @@ -13,7 +13,7 @@ %% Options -\tikzset{i^>/.style = { +\ctikzset{i^>/.style = { i = #1, \circuitikzbasekey/bipole/current/direction = forward, \circuitikzbasekey/bipole/current/x position = after, @@ -21,7 +21,7 @@ } } -\tikzset{i_>/.style = { +\ctikzset{i_>/.style = { i = #1, \circuitikzbasekey/bipole/current/direction = forward, \circuitikzbasekey/bipole/current/x position = after, @@ -29,7 +29,7 @@ } } -\tikzset{i>^/.style = { +\ctikzset{i>^/.style = { i = #1, \circuitikzbasekey/bipole/current/direction = forward, \circuitikzbasekey/bipole/current/x position = before, @@ -37,7 +37,7 @@ } } -\tikzset{i>_/.style = { +\ctikzset{i>_/.style = { i = #1, \circuitikzbasekey/bipole/current/direction = forward, \circuitikzbasekey/bipole/current/x position = before, @@ -45,7 +45,7 @@ } } -\tikzset{i^/.style = {i = #1, \circuitikzbasekey/bipole/current/direction = forward } } -\tikzset{i^/.style = { i= #1, \circuitikzbasekey/bipole/current/y position = above } } +\ctikzset{i/.style = {i = #1, \circuitikzbasekey/bipole/current/direction = forward } } +\ctikzset{i^/.style = { i= #1, \circuitikzbasekey/bipole/current/y position = above } } \def\pgf@circ@drawnormalcurrent{ diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcirclabel.sty b/Master/texmf-dist/tex/latex/circuitikz/pgfcirclabel.sty index 436bd941666..8ce4a72d9a3 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcirclabel.sty +++ b/Master/texmf-dist/tex/latex/circuitikz/pgfcirclabel.sty @@ -11,8 +11,8 @@ %% Bipole label positioning %% Options -\tikzset{label/.style = { l=#1 } } -\tikzset{l/.code = { +\ctikzset{label/.style = { l=#1 } } +\ctikzset{l/.code = { \pgfkeys{/tikz/circuitikz/bipole/label/name=#1} \ctikzsetvalof{bipole/label/unit}{} \ifpgf@circ@siunitx @@ -28,20 +28,20 @@ \fi }} -\tikzset{label above/.code = { +\ctikzset{label above/.code = { l=#1, \circuitikzbasekey/bipole/label/position=90 } } -\tikzset{l^/.style = { +\ctikzset{l^/.style = { l=#1, \circuitikzbasekey/bipole/label/position=90 } } -\tikzset{label below/.code = { +\ctikzset{label below/.code = { l=#1, \circuitikzbasekey/bipole/label/position=-90 } } -\tikzset{l_/.style = { +\ctikzset{l_/.style = { l=#1, \circuitikzbasekey/bipole/label/position=-90 } } @@ -54,7 +54,12 @@ \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} - + + \ifnum \ctikzvalof{mirror value}=-1 + \pgfmathadd{\pgfcircmathresult}{+180} + \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil} + \fi + \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86 \ifnum\pgf@circ@temp>0 \def\pgf@circ@dir{south east} \else \def\pgf@circ@dir{north west} diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcircmonopoles.sty b/Master/texmf-dist/tex/latex/circuitikz/pgfcircmonopoles.sty index 4d24bd2d13e..1d8f46376d2 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcircmonopoles.sty +++ b/Master/texmf-dist/tex/latex/circuitikz/pgfcircmonopoles.sty @@ -17,12 +17,9 @@ \pgfpointorigin } \behindforegroundpath{ + \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen - \pgfscope - \pgf@circ@res@step = \pgf@circ@Rlen - \divide \pgf@circ@res@step by 4 - - + \pgfscope \pgfpathmoveto{\pgfpointorigin} \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}} \pgfusepath{draw} diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcircquadpoles.sty b/Master/texmf-dist/tex/latex/circuitikz/pgfcircquadpoles.sty index 29a8eb327f3..8a736173244 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcircquadpoles.sty +++ b/Master/texmf-dist/tex/latex/circuitikz/pgfcircquadpoles.sty @@ -10,7 +10,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Quadripoles -\newcommand{\pgfcircdeclarequadpole}[2]{ +\long\def\pgfcircdeclarequadpole#1#2{ \pgfdeclareshape{#1} { \anchor{center}{ @@ -84,12 +84,9 @@ +\def\pgf@circ@drawtransformerbasic{ - - -\pgfcircdeclarequadpole{transformer}{ - - \def\stretto{.4} +\def\stretto{.4} \pgfscope \pgfslopedattimetrue \pgfallowupsidedownattimetrue @@ -102,7 +99,21 @@ {\stretto\pgf@circ@res@left}% {\pgf@circ@res@down}% } - \pgfnode{inductorshape}{center}{}{pgf@inductor1}{\pgfusepath{stroke}} + + \edef\pgf@circ@temp{\ctikzvalof{inductor}}% + \def\pgf@temp{european}% + \ifx\pgf@temp\pgf@circ@temp% + \pgfnode{fullgenericshape}{center}{}{pgf@inductor1}{\pgfusepath{stroke}} + \else% + \def\pgf@temp{cute} + \ifx\pgf@temp\pgf@circ@temp% + \pgfnode{cuteinductorshape}{center}{}{pgf@inductor1}{\pgfusepath{stroke}} + \else% + \pgfnode{americaninductorshape}{center}{}{pgf@inductor1}{\pgfusepath{stroke}} + \fi% + \fi% + + \endpgfscope \pgfscope \pgfslopedattimetrue @@ -116,7 +127,20 @@ {\stretto\pgf@circ@res@right}% {\pgf@circ@res@up}% } - \pgfnode{inductorshape}{center}{}{pgf@inductor2}{\pgfusepath{stroke}} + + \edef\pgf@circ@temp{\ctikzvalof{inductor}}% + \def\pgf@temp{european}% + \ifx\pgf@temp\pgf@circ@temp% + \pgfnode{fullgenericshape}{center}{}{pgf@inductor2}{\pgfusepath{stroke}} + \else% + \def\pgf@temp{cute} + \ifx\pgf@temp\pgf@circ@temp% + \pgfnode{cuteinductorshape}{center}{}{pgf@inductor2}{\pgfusepath{stroke}} + \else% + \pgfnode{americaninductorshape}{center}{}{pgf@inductor2}{\pgfusepath{stroke}} + \fi% + \fi% + \endpgfscope \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} @@ -137,9 +161,42 @@ \pgfusepath{draw} +} + + +\pgfcircdeclarequadpole{transformer}{ + + \pgf@circ@drawtransformerbasic } +\pgfcircdeclarequadpole{transformer core}{ + + \pgf@circ@drawtransformerbasic + + \pgfmoveto{\pgfpoint% + {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@right}% + {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}% + } + \pgflineto{ + \pgfpoint + {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@right}% + {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}% + } + + \pgfmoveto{\pgfpoint% + {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@left}% + {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}% + } + \pgflineto{ + \pgfpoint + {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@left}% + {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}% + } + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth} + \pgfusepath{draw} +} \pgfcircdeclarequadpole{gyrator}{ diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcirctripoles.sty b/Master/texmf-dist/tex/latex/circuitikz/pgfcirctripoles.sty index f41034e0a6d..6fae7459b46 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcirctripoles.sty +++ b/Master/texmf-dist/tex/latex/circuitikz/pgfcirctripoles.sty @@ -12,15 +12,15 @@ -\newcommand{\pgfcircdeclarelogicport}[2]{ - \pgfdeclareshape{#1 port} +\long\def\pgfcircdeclarelogicport#1#2{ + \pgfdeclareshape{american #1 port} { \savedanchor\northwest{% \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1 port/height}\pgf@y + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/height}\pgf@y \pgf@y=.5\pgf@y \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1 port/width}\pgf@x + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/width}\pgf@x \pgf@x=.5\pgf@x } \anchor{south}{ @@ -32,16 +32,19 @@ } \savedanchor\inOne{% \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1 port/height}\pgf@y + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/height}\pgf@y \pgf@y=.5\pgf@y - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1 port/input height}\pgf@y + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/input height}\pgf@y \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1 port/width}\pgf@x + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/width}\pgf@x \pgf@x=.5\pgf@x } \anchor{in 1}{ \inOne } + \anchor{in}{ + \inOne + } \anchor{in 2}{ \inOne \pgf@y=-\pgf@y @@ -77,47 +80,47 @@ \pgfcircdeclarelogicport{and}{ \pgfpathmoveto{\pgfpoint {\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/and port/input height}\pgf@circ@res@up}} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/input height}\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/and port/port width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/and port/input height}\pgf@circ@res@up}} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/input height}\pgf@circ@res@up}} \pgfpathmoveto{\pgfpoint {\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/and port/input height}\pgf@circ@res@down}} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/input height}\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/and port/port width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/and port/input height}\pgf@circ@res@down}} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/input height}\pgf@circ@res@down}} \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/and port/port width}\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@right} {0pt}} \pgfusepath{draw} \pgfsetlinewidth{2\pgflinewidth} \pgfpathmoveto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/and port/port width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@left} {\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/and port/port width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@left} {\pgf@circ@res@down}} \pgfpathcurveto {\pgfpoint{.0\pgf@circ@res@left}{\pgf@circ@res@down}} {\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/and port/port width}\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@right} {.5\pgf@circ@res@down}} {\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/and port/port width}\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@right} {0pt}} \pgfpathcurveto {\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/and port/port width}\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@right} {.5\pgf@circ@res@up}} {\pgfpoint{.0\pgf@circ@res@left}{\pgf@circ@res@up}} {\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/and port/port width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@left} {\pgf@circ@res@up}} \pgfusepath{draw} } @@ -127,29 +130,29 @@ \pgfcircdeclarelogicport{nand}{ \pgfpathmoveto{\pgfpoint {\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nand port/input height}\pgf@circ@res@up}} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/input height}\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nand port/port width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nand port/input height}\pgf@circ@res@up}} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/input height}\pgf@circ@res@up}} \pgfpathmoveto{\pgfpoint {\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nand port/input height}\pgf@circ@res@down}} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/input height}\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nand port/port width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nand port/input height}\pgf@circ@res@down}} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/input height}\pgf@circ@res@down}} \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nand port/port width}\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@right} {0pt}} \pgfusepath{draw} \pgfsetlinewidth{2\pgflinewidth} - \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/nand port/circle width}\pgf@circ@res@right - \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/tripoles/nand port/port width}\pgf@circ@res@right + \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/circle width}\pgf@circ@res@right + \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@right \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}} @@ -161,7 +164,7 @@ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{.5\pgf@circ@res@up}} {\pgfpoint{.0\pgf@circ@res@left}{\pgf@circ@res@up}} {\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nand port/port width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@left} {\pgf@circ@res@up}} \pgfpathellipse {\pgfpoint{\pgf@circ@res@other-.5\pgf@circ@res@step}{0pt}} @@ -175,46 +178,46 @@ \pgfcircdeclarelogicport{nor}{ \pgfpathmoveto{\pgfpoint {\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nor port/input height}\pgf@circ@res@up}} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input height}\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint - {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/nor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/nor port/input skip})*\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nor port/input height}\pgf@circ@res@up}} + {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input skip})*\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input height}\pgf@circ@res@up}} \pgfpathmoveto{\pgfpoint {\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nor port/input height}\pgf@circ@res@down}} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input height}\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint - {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/nor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/nor port/input skip})*\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nor port/input height}\pgf@circ@res@down}} + {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input skip})*\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input height}\pgf@circ@res@down}} \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nor port/port width}\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/port width}\pgf@circ@res@right} {0pt}} \pgfusepath{draw} - \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nor port/port width}\pgf@circ@res@right - \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/nand port/circle width}\pgf@circ@res@right + \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/port width}\pgf@circ@res@right + \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/circle width}\pgf@circ@res@right \pgfsetlinewidth{2\pgflinewidth} \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}} \pgfpathcurveto - {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@up}} - {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nor port/ccc}\pgf@circ@res@up}} - {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nor port/bbb}\pgf@circ@res@left}{0pt}} + {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@up}} + {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ccc}\pgf@circ@res@up}} + {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/bbb}\pgf@circ@res@left}{0pt}} \pgfpathcurveto - {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nor port/ccc}\pgf@circ@res@down}} - {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@down}} + {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ccc}\pgf@circ@res@down}} + {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@down}} {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}} \pgfpathcurveto - {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@down}} - {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nor port/ccc}\pgf@circ@res@down}} + {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@down}} + {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ccc}\pgf@circ@res@down}} {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{0pt}} \pgfpathcurveto - {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nor port/ccc}\pgf@circ@res@up}} - {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@up}} + {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ccc}\pgf@circ@res@up}} + {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@up}} {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}} \pgfpathellipse @@ -233,43 +236,43 @@ \pgfpathmoveto{\pgfpoint {\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/or port/input height}\pgf@circ@res@up}} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input height}\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint - {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/or port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/or port/input skip})*\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/or port/input height}\pgf@circ@res@up}} + {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input skip})*\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input height}\pgf@circ@res@up}} \pgfpathmoveto{\pgfpoint {\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/or port/input height}\pgf@circ@res@down}} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input height}\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint - {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/or port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/or port/input skip})*\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/or port/input height}\pgf@circ@res@down}} + {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input skip})*\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input height}\pgf@circ@res@down}} \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/or port/port width}\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/port width}\pgf@circ@res@right} {0pt}} \pgfusepath{draw} - \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/or port/port width}\pgf@circ@res@right + \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/port width}\pgf@circ@res@right \pgfsetlinewidth{2\pgflinewidth} \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}} \pgfpathcurveto - {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/or port/aaa}\pgf@circ@res@left}{\pgf@circ@res@up}} - {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/or port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/or port/ccc}\pgf@circ@res@up}} - {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/or port/bbb}\pgf@circ@res@left}{0pt}} + {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/aaa}\pgf@circ@res@left}{\pgf@circ@res@up}} + {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ccc}\pgf@circ@res@up}} + {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/bbb}\pgf@circ@res@left}{0pt}} \pgfpathcurveto - {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/or port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/or port/ccc}\pgf@circ@res@down}} - {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/or port/aaa}\pgf@circ@res@left}{\pgf@circ@res@down}} + {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ccc}\pgf@circ@res@down}} + {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/aaa}\pgf@circ@res@left}{\pgf@circ@res@down}} {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}} \pgfpathcurveto - {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/or port/ddd}\pgf@circ@res@left}{\pgf@circ@res@down}} - {\pgfpoint{\pgf@circ@res@other}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/or port/ccc}\pgf@circ@res@down}} + {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ddd}\pgf@circ@res@left}{\pgf@circ@res@down}} + {\pgfpoint{\pgf@circ@res@other}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ccc}\pgf@circ@res@down}} {\pgfpoint{\pgf@circ@res@other}{0pt}} \pgfpathcurveto - {\pgfpoint{\pgf@circ@res@other}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/or port/ccc}\pgf@circ@res@up}} - {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/or port/ddd}\pgf@circ@res@left}{\pgf@circ@res@up}} + {\pgfpoint{\pgf@circ@res@other}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ccc}\pgf@circ@res@up}} + {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ddd}\pgf@circ@res@left}{\pgf@circ@res@up}} {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}} \pgfusepath{draw} } @@ -279,55 +282,55 @@ \pgfpathmoveto{\pgfpoint {\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/xor port/input height}\pgf@circ@res@up}} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input height}\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint - {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/xor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/xor port/input skip})*\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/xor port/input height}\pgf@circ@res@up}} + {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input skip})*\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input height}\pgf@circ@res@up}} \pgfpathmoveto{\pgfpoint {\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/xor port/input height}\pgf@circ@res@down}} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input height}\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint - {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/xor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/xor port/input skip})*\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/xor port/input height}\pgf@circ@res@down}} + {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input skip})*\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input height}\pgf@circ@res@down}} \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/xor port/port width}\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/port width}\pgf@circ@res@right} {0pt}} \pgfusepath{draw} - \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/xor port/port width}\pgf@circ@res@right + \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/port width}\pgf@circ@res@right \pgfsetlinewidth{2\pgflinewidth} \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}} \pgfpathcurveto - {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/xor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@up}} - {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/xor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/xor port/ccc}\pgf@circ@res@up}} - {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/xor port/bbb}\pgf@circ@res@left}{0pt}} + {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@up}} + {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf@circ@res@up}} + {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf@circ@res@left}{0pt}} \pgfpathcurveto - {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/xor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/xor port/ccc}\pgf@circ@res@down}} - {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/xor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@down}} + {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf@circ@res@down}} + {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@down}} {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}} \pgfpathcurveto - {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/xor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@down}} - {\pgfpoint{\pgf@circ@res@other}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/xor port/ccc}\pgf@circ@res@down}} + {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@down}} + {\pgfpoint{\pgf@circ@res@other}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf@circ@res@down}} {\pgfpoint{\pgf@circ@res@other}{0pt}} \pgfpathcurveto - {\pgfpoint{\pgf@circ@res@other}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/xor port/ccc}\pgf@circ@res@up}} - {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/xor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@up}} + {\pgfpoint{\pgf@circ@res@other}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf@circ@res@up}} + {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@up}} {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}} - \def\pgf@circ@temp{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/xor port/distance}\pgf@circ@res@right+} + \def\pgf@circ@temp{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/distance}\pgf@circ@res@right+} \pgfpathmoveto{\pgfpoint{\pgf@circ@temp-\pgf@circ@res@other}{\pgf@circ@res@up}} \pgfpathcurveto - {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/xor port/aaa}\pgf@circ@res@left}{.95*\pgf@circ@res@up}} - {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/xor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/xor port/ccc}\pgf@circ@res@up}} - {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/xor port/bbb}\pgf@circ@res@left}{0pt}} + {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/aaa}\pgf@circ@res@left}{.95*\pgf@circ@res@up}} + {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf@circ@res@up}} + {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf@circ@res@left}{0pt}} \pgfpathcurveto - {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/xor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/xor port/ccc}\pgf@circ@res@down}} - {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/xor port/aaa}\pgf@circ@res@left}{.95*\pgf@circ@res@down}} + {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf@circ@res@down}} + {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/aaa}\pgf@circ@res@left}{.95*\pgf@circ@res@down}} {\pgfpoint{\pgf@circ@temp-\pgf@circ@res@other}{.95*\pgf@circ@res@down}} \pgfusepath{draw} @@ -339,57 +342,57 @@ \pgfpathmoveto{\pgfpoint {\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/xnor port/input height}\pgf@circ@res@up}} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input height}\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint - {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/xnor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/xnor port/input skip})*\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/xnor port/input height}\pgf@circ@res@up}} + {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input skip})*\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input height}\pgf@circ@res@up}} \pgfpathmoveto{\pgfpoint {\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/xnor port/input height}\pgf@circ@res@down}} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input height}\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint - {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/xnor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/xnor port/input skip})*\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/xnor port/input height}\pgf@circ@res@down}} + {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input skip})*\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input height}\pgf@circ@res@down}} \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/xnor port/port width}\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}\pgf@circ@res@right} {0pt}} \pgfusepath{draw} - \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/xnor port/port width}\pgf@circ@res@right - \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/xnor port/circle width}\pgf@circ@res@right + \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}\pgf@circ@res@right + \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/circle width}\pgf@circ@res@right \pgfsetlinewidth{2\pgflinewidth} \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}} \pgfpathcurveto - {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/xnor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@up}} - {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/xnor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/xnor port/ccc}\pgf@circ@res@up}} - {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/xnor port/bbb}\pgf@circ@res@left}{0pt}} + {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@up}} + {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf@circ@res@up}} + {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf@circ@res@left}{0pt}} \pgfpathcurveto - {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/xnor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/xnor port/ccc}\pgf@circ@res@down}} - {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/xnor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@down}} + {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf@circ@res@down}} + {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@down}} {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}} \pgfpathcurveto - {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/xnor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@down}} - {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/xnor port/ccc}\pgf@circ@res@down}} + {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@down}} + {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf@circ@res@down}} {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{0pt}} \pgfpathcurveto - {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/xnor port/ccc}\pgf@circ@res@up}} - {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/xnor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@up}} + {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf@circ@res@up}} + {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@up}} {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}} - \def\pgf@circ@temp{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/xnor port/distance}\pgf@circ@res@right+} + \def\pgf@circ@temp{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/distance}\pgf@circ@res@right+} \pgfpathmoveto{\pgfpoint{\pgf@circ@temp-\pgf@circ@res@other}{\pgf@circ@res@up}} \pgfpathcurveto - {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/xnor port/aaa}\pgf@circ@res@left}{.95*\pgf@circ@res@up}} - {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/xnor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/xnor port/ccc}\pgf@circ@res@up}} - {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/xnor port/bbb}\pgf@circ@res@left}{0pt}} + {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/aaa}\pgf@circ@res@left}{.95*\pgf@circ@res@up}} + {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf@circ@res@up}} + {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf@circ@res@left}{0pt}} \pgfpathcurveto - {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/xnor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/xnor port/ccc}\pgf@circ@res@down}} - {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/xnor port/aaa}\pgf@circ@res@left}{.95*\pgf@circ@res@down}} + {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf@circ@res@down}} + {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/aaa}\pgf@circ@res@left}{.95*\pgf@circ@res@down}} {\pgfpoint{\pgf@circ@temp-\pgf@circ@res@other}{.95*\pgf@circ@res@down}} @@ -402,19 +405,228 @@ } +\pgfdeclareshape{american not port} + { + \anchor{center}{\pgfpointorigin} + \savedanchor\northwest{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \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 + } + \anchor{in}{ + \northwest + \pgf@y=0pt + } + \anchor{out}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{center}{ + \pgfpointorigin + } + + \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/bipoles/not port/circle width}\pgf@circ@res@right + + \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-\pgf@circ@res@other}{0pt}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}} + \pgfusepath{draw} + \pgfpathellipse + {\pgfpoint{\pgf@circ@res@step-.5\pgf@circ@res@other}{0pt}} + {\pgfpoint{.5\pgf@circ@res@other}{0pt}} + {\pgfpoint{0pt}{.5\pgf@circ@res@other}} + \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} + + } + } + + + + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% #1 - name +% #2 - text inside +% #3 - number of inputs +% #4 - is it a not + +\long\def\pgfcircdeclareeurologicport#1#2#3#4{ + \pgfdeclareshape{european #1 port} + { + \savedanchor\northwest{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \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 + } + \savedanchor\inOne{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/input height}\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/width}\pgf@x + \pgf@x=.5\pgf@x + } + \anchor{in}{ + \inOne + } + \anchor{in 1}{ + \inOne + } + \anchor{in 2}{ + \inOne + \pgf@y=-\pgf@y + } + \anchor{out}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{center}{ + \northwest + \pgf@y=0pt + \pgf@x=-.8\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 + \def\pgf@temp{1} + \def\pgf@circ@temp{#3} + \ifx\pgftemp\pgf@circ@temp % one input + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfpathlineto{ + \pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@left}{0pt}} + \else % two inputs + \pgfpathmoveto{ + \pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/input height}\pgf@circ@res@up}} + \pgfpathlineto{ + \pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/input height}\pgf@circ@res@up}} + % + \pgfpathmoveto{ + \pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/input height}\pgf@circ@res@down}} + \pgfpathlineto{ + \pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/input height}\pgf@circ@res@down}} + \fi% + % + % + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} + \pgfpathlineto{ + \pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@right}{0pt}} + % + \edef\pgf@temp{not} + \edef\pgf@circ@temp{#4} + \ifx\pgf@temp\pgf@circ@temp % is a not + \pgfpathmoveto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/not width}\pgf@circ@res@right}{0pt}} + \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@right}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/not height}\pgf@circ@res@up}} + \fi + % + \pgfusepath{draw} + % + \pgfpathmoveto{\pgfpointorigin} + \pgftext{#2} + % + % + % + \pgfsetlinewidth{2\pgflinewidth} + \pgfpathrectanglecorners + {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@left}{\pgf@circ@res@up}} + {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} +% +% + } + } +} + + +\pgfcircdeclareeurologicport{and}{$\&$}{2}{} +\pgfcircdeclareeurologicport{or}{$\ge 1$}{2}{} +\pgfcircdeclareeurologicport{xor}{$=1$}{2}{} +\pgfcircdeclareeurologicport{not}{$1$}{1}{not} +\pgfcircdeclareeurologicport{nand}{$\&$}{2}{not} +\pgfcircdeclareeurologicport{nor}{$\ge 1$}{2}{not} +\pgfcircdeclareeurologicport{xnor}{$=1$}{2}{not} -\newcommand{\pgfcircdeclaretransistor}[3]{ + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\long\def\pgfcircdeclaretransistor#1#2#3{ \pgfdeclareshape{#1} { - \anchor{center}{\pgfpointorigin} + \anchor{center}{\pgfpointorigin} \savedanchor\north{% \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 @@ -424,20 +636,35 @@ \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} + } + % + % pseudo-bipole + \anchor{left}{ + \north + \pgf@y=-\pgf@y + } + \anchor{right}{ + \north + } #2 \backgroundpath{ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} - - + % + % \north \pgf@circ@res@up = \pgf@y \pgf@circ@res@down = -\pgf@y \pgf@circ@res@right = \pgf@x \left \pgf@circ@res@left = \pgf@x - + % #3 - + % } } } @@ -447,7 +674,7 @@ -\newcommand{\pgfcircdeclaremos}[3]{ +\long\def\pgfcircdeclaremos#1#2#3{ \pgfcircdeclaretransistor{#1}{ \anchor{G}{ \left @@ -492,33 +719,33 @@ \pgf@y=-\pgf@y } }{% - \pgfmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgflineto{\pgfpoint{\pgf@circ@res@right} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@up}} - \pgflineto{\pgfpoint + \pgfpathlineto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@up}} - \pgfmoveto{\pgfpoint + \pgfpathmoveto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base height}\pgf@circ@res@up}} - \pgflineto{\pgfpoint + \pgfpathlineto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base height}\pgf@circ@res@down}} - \pgfmoveto{\pgfpoint + \pgfpathmoveto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}} - \pgflineto{\pgfpoint{\pgf@circ@res@right} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}} - \pgflineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} \pgfusepath{draw} \pgfscope - \pgfmoveto{\pgfpoint + \pgfpathmoveto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@up}} - \pgflineto{\pgfpoint + \pgfpathlineto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}} \pgfsetlinewidth{2\pgflinewidth} @@ -544,10 +771,10 @@ \fi - \pgfmoveto{\pgfpoint + \pgfpathmoveto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left} {\pgf@circ@res@up+\pgf@circ@res@down}} - \pgflineto{\pgfpoint{\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} } @@ -568,10 +795,10 @@ \pgf@y=-\pgf@y } }{% - \pgfmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgflineto{\pgfpoint{\pgf@circ@res@right} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}} - \pgflineto{\pgfpoint + \pgfpathlineto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}} \pgfusepath{draw} @@ -595,34 +822,34 @@ \fi \pgfscope - \pgfmoveto{\pgfpoint + \pgfpathmoveto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base height}\pgf@circ@res@up}} - \pgflineto{\pgfpoint + \pgfpathlineto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base height}\pgf@circ@res@down}} \pgfsetlinewidth{2\pgflinewidth} \pgfusepath{draw} \endpgfscope - \pgfmoveto{\pgfpoint + \pgfpathmoveto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}} - \pgflineto{\pgfpoint{\pgf@circ@res@right} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}} - \pgflineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} - \pgfmoveto{\pgfpoint + \pgfpathmoveto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}} - \pgflineto{\pgfpoint + \pgfpathlineto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}} - \pgfmoveto{\pgfpoint + \pgfpathmoveto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left} {\pgf@circ@res@up+\pgf@circ@res@down}} - \pgflineto{\pgfpoint{\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} } @@ -654,31 +881,31 @@ \pgf@y=-\pgf@y } }{ - \pgfmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgflineto{\pgfpoint{\pgf@circ@res@right} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate height}\pgf@circ@res@up}} - \pgflineto{\pgfpoint + \pgfpathlineto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate width}\pgf@circ@res@left} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate height 2}\pgf@circ@res@up}} \pgfusepath{draw} \pgfscope - \pgfmoveto{\pgfpoint + \pgfpathmoveto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate width}\pgf@circ@res@left} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/base height}\pgf@circ@res@up}} - \pgflineto{\pgfpoint + \pgfpathlineto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate width}\pgf@circ@res@left} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/base height}\pgf@circ@res@down}} \pgfsetlinewidth{2\pgflinewidth} \pgfusepath{draw} \endpgfscope - \pgfmoveto{\pgfpoint + \pgfpathmoveto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate width}\pgf@circ@res@left} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate height 2}\pgf@circ@res@down}} - \pgflineto{\pgfpoint{\pgf@circ@res@right} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate height}\pgf@circ@res@down}} - \pgflineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} \pgfusepath{draw} \pgfscope @@ -697,13 +924,11 @@ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} \endpgfscope - \pgfmoveto{\pgfpoint + \pgfpathmoveto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate width}\pgf@circ@res@left} {\pgf@circ@res@up+\pgf@circ@res@down}} - \pgflineto{\pgfpoint{\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} - - } @@ -732,32 +957,32 @@ \north \pgf@y=-\pgf@y } -}{ - \pgfmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgflineto{\pgfpoint{\pgf@circ@res@right} +}{% + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate height}\pgf@circ@res@up}} - \pgflineto{\pgfpoint + \pgfpathlineto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate width}\pgf@circ@res@left} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate height 2}\pgf@circ@res@up}} \pgfusepath{draw} \pgfscope - \pgfmoveto{\pgfpoint + \pgfpathmoveto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate width}\pgf@circ@res@left} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/base height}\pgf@circ@res@up}} - \pgflineto{\pgfpoint + \pgfpathlineto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate width}\pgf@circ@res@left} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/base height}\pgf@circ@res@down}} \pgfsetlinewidth{2\pgflinewidth} \pgfusepath{draw} \endpgfscope - \pgfmoveto{\pgfpoint + \pgfpathmoveto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate width}\pgf@circ@res@left} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate height 2}\pgf@circ@res@down}} - \pgflineto{\pgfpoint{\pgf@circ@res@right} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate height}\pgf@circ@res@down}} - \pgflineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} \pgfusepath{draw} \pgfscope @@ -775,20 +1000,1137 @@ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} \endpgfscope - \pgfmoveto{\pgfpoint + \pgfpathmoveto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate width}\pgf@circ@res@left} {\pgf@circ@res@up+\pgf@circ@res@down}} - \pgflineto{\pgfpoint{\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} + + +} + + + +\pgfcircdeclaretransistor{pigbt}{ + \anchor{E}{ + \north + } + \anchor{emitter}{ + \north + } + \anchor{B}{ + \left + } + \anchor{base}{ + \left + } + \anchor{C}{ + \north + \pgf@y=-\pgf@y + } + \anchor{collector}{ + \north + \pgf@y=-\pgf@y + } +}{ + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/gate height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/gate height 2}\pgf@circ@res@up}} + \pgfusepath{draw} + + \pgfscope + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base height}\pgf@circ@res@down}} + %\pgfsetlinewidth{2\pgflinewidth} + \pgfusepath{draw} + \endpgfscope + + \pgfscope + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base height}\pgf@circ@res@down}} + \pgfsetlinewidth{2\pgflinewidth} + \pgfusepath{draw} + \endpgfscope + + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/gate height 2}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/gate height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \pgfscope + \pgfslopedattimetrue + \pgfallowupsidedownattimetrue + \pgfresetnontranslationattimefalse + \pgftransformlineattime{.5}{% + \pgfpoint% + {\pgf@circ@res@right}% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/gate height}\pgf@circ@res@up}% + }{% + \pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base width}\pgf@circ@res@left}% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/gate height 2}\pgf@circ@res@up}% + } + \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} + \endpgfscope + + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/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} + + +} + + + +\pgfcircdeclaretransistor{nigbt}{ + \anchor{C}{ + \north + } + \anchor{collector}{ + \north + } + \anchor{B}{ + \left + } + \anchor{base}{ + \left + } + \anchor{E}{ + \north + \pgf@y=-\pgf@y + } + \anchor{emitter}{ + \north + \pgf@y=-\pgf@y + } +}{ + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/gate height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/gate height 2}\pgf@circ@res@up}} + \pgfusepath{draw} + + \pgfscope + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base height}\pgf@circ@res@down}} + \pgfsetlinewidth{2\pgflinewidth} + \pgfusepath{draw} + \endpgfscope + + \pgfscope + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base height}\pgf@circ@res@down}} + %\pgfsetlinewidth{2\pgflinewidth} + \pgfusepath{draw} + \endpgfscope + + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/gate height 2}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/gate height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \pgfscope + \pgfslopedattimetrue + \pgfallowupsidedownattimetrue + \pgfresetnontranslationattimefalse + \pgftransformlineattime{.5}{% + \pgfpoint% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base width}\pgf@circ@res@left}% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/gate height 2}\pgf@circ@res@down}% + }{% + \pgfpoint{\pgf@circ@res@right}% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/gate height}\pgf@circ@res@down}% + } + \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} + \endpgfscope + + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/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} + + +} + + + + + + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%% Contrib + + +%% +% IGFET (e.g. MOSFET) +\long\def\pgfcircdeclarefet#1#2#3{ + \pgfcircdeclaretransistor{#1}{ + \anchor{G}{ + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/width}\pgf@x + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@y= -\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@y + } + \anchor{gate}{ + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/width}\pgf@x + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@y= -\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@y + } + \anchor{B}{ + \left + \pgf@x=\pgf@circ@res@right + } + \anchor{base}{ + \left + \pgf@x=\pgf@circ@res@right + } + #2 + } + {#3} +} + + + +\pgfcircdeclarefet{nfet}{ + \anchor{D}{ + \north + } + \anchor{drain}{ + \north + } + \anchor{S}{ + \north + \pgf@y=-\pgf@y + } + \anchor{source}{ + \north + \pgf@y=-\pgf@y + } + +}{% + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/gate height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/gate height}\pgf@circ@res@up}} + + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base height}\pgf@circ@res@up*0.45}} + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base height}\pgf@circ@res@up*0.25}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base height}\pgf@circ@res@down*0.25}} + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base height}\pgf@circ@res@down*0.45}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base height}\pgf@circ@res@down}} + + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base width}\pgf@circ@res@left} + {\pgf@circ@res@up+\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgf@circ@res@up+\pgf@circ@res@down}} + + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/gate height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/gate height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \pgfscope + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/gate height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/gate height}\pgf@circ@res@down}} + \pgfsetlinewidth{2\pgflinewidth} + \pgfusepath{draw} + \endpgfscope + + \pgfscope + \pgfslopedattimetrue + \pgfallowupsidedownattimetrue + \pgfresetnontranslationattimefalse + \pgftransformlineattime{.6}{% + \pgfpoint + {\pgf@circ@res@right}% + {\pgf@circ@res@up+\pgf@circ@res@down}% + }{% + \pgfpoint% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base width}\pgf@circ@res@left}% + {\pgf@circ@res@up+\pgf@circ@res@down}% + } + \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} + \endpgfscope + + + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/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} +} + + +\pgfcircdeclarefet{pfet}{ + \anchor{D}{ + \north + } + \anchor{drain}{ + \north + } + \anchor{S}{ + \north + \pgf@y=-\pgf@y + } + \anchor{source}{ + \north + \pgf@y=-\pgf@y + } +}{% + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/gate height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/gate height}\pgf@circ@res@up}} + \pgfusepath{draw} + + \pgfscope + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/base height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/base height}\pgf@circ@res@up*0.45}} + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/base height}\pgf@circ@res@up*0.25}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/base height}\pgf@circ@res@down*0.25}} + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/base height}\pgf@circ@res@down*0.45}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/base height}\pgf@circ@res@down}} + \pgfsetlinewidth{2\pgflinewidth} + \pgfusepath{draw} + \endpgfscope + + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/base width}\pgf@circ@res@left} + {\pgf@circ@res@up+\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgf@circ@res@up+\pgf@circ@res@down}} + + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/gate height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/gate height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \pgfscope + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/gate height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/gate height}\pgf@circ@res@down}} + %\pgfsetlinewidth{2\pgflinewidth} + \pgfusepath{draw} + \endpgfscope + + \pgfscope + \pgfslopedattimetrue + \pgfallowupsidedownattimetrue + \pgfresetnontranslationattimefalse + \pgftransformlineattime{.6}{% + \pgfpoint + {\pgf@circ@res@right}% + {\pgf@circ@res@up+\pgf@circ@res@down}% + }{% + \pgfpoint% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base width}\pgf@circ@res@left}% + {\pgf@circ@res@up+\pgf@circ@res@down}% + } + \pgftransformrotate{180} + \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} + \endpgfscope + + + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/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} +} + + + +% N-CHANNEL IGFET ENHANCEMENT TYPE +\pgfcircdeclarefet{nigfete}{ + \anchor{D}{ + \north + } + \anchor{drain}{ + \north + } + \anchor{S}{ + \north + \pgf@y=-\pgf@y + } + \anchor{source}{ + \north + \pgf@y=-\pgf@y + } +}{% + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + % DRAIN CONNECTION + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@up}} + % DRAIN + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@up}} + + % GATE, ENHANCEMENT TYPE (DASHED) + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base height}\pgf@circ@res@up*0.45}} + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base height}\pgf@circ@res@up*0.25}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base height}\pgf@circ@res@down*0.25}} + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base height}\pgf@circ@res@down*0.45}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base height}\pgf@circ@res@down}} + + % BULK + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base width}\pgf@circ@res@left} + {\pgf@circ@res@up+\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgf@circ@res@up+\pgf@circ@res@down}} + + % SOURCE + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}} + % SOURCE CONNECTION + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + % GATE + \pgfscope + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}} + \pgfsetlinewidth{2\pgflinewidth} + \pgfusepath{draw} + \endpgfscope + + % ARROW + \pgfscope + \pgfslopedattimetrue + \pgfallowupsidedownattimetrue + \pgfresetnontranslationattimefalse + \pgftransformlineattime{.6}{% + \pgfpoint + {\pgf@circ@res@right}% + {\pgf@circ@res@up+\pgf@circ@res@down}% + }{% + \pgfpoint% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base width}\pgf@circ@res@left}% + {\pgf@circ@res@up+\pgf@circ@res@down}% + } + \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} + \endpgfscope + + % GATE CONNECTION + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}} + \pgfusepath{draw} +} + +% N-CHANNEL IGFET DEPLETION TYPE +\pgfcircdeclarefet{nigfetd}{ + \anchor{D}{ + \north + } + \anchor{drain}{ + \north + } + \anchor{S}{ + \north + \pgf@y=-\pgf@y + } + \anchor{source}{ + \north + \pgf@y=-\pgf@y + } +}{% + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + % DRAIN CONNECTION + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/gate height}\pgf@circ@res@up}} + % DRAIN + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/gate height}\pgf@circ@res@up}} + + % GATE, DEPLETION TYPE + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/base height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/base height}\pgf@circ@res@down}} + + % BULK + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/base width}\pgf@circ@res@left} + {\pgf@circ@res@up+\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgf@circ@res@up+\pgf@circ@res@down}} + + % SOURCE + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/gate height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/gate height}\pgf@circ@res@down}} + % SOURCE CONNECTION + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + % GATE + \pgfscope + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/gate height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/gate height}\pgf@circ@res@down}} + \pgfsetlinewidth{2\pgflinewidth} + \pgfusepath{draw} + \endpgfscope + + % ARROW + \pgfscope + \pgfslopedattimetrue + \pgfallowupsidedownattimetrue + \pgfresetnontranslationattimefalse + \pgftransformlineattime{.6}{% + \pgfpoint + {\pgf@circ@res@right}% + {\pgf@circ@res@up+\pgf@circ@res@down}% + }{% + \pgfpoint% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/base width}\pgf@circ@res@left}% + {\pgf@circ@res@up+\pgf@circ@res@down}% + } + \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} + \endpgfscope + + % GATE CONNECTION + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/gate height}\pgf@circ@res@down}} + %\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/gate height}\pgf@circ@res@down}} + \pgfusepath{draw} +} + +% P-CHANNEL IGFET ENHANCEMENT TYPE +\pgfcircdeclarefet{pigfete}{ + \anchor{D}{ + \north + } + \anchor{drain}{ + \north + } + \anchor{S}{ + \north + \pgf@y=-\pgf@y + } + \anchor{source}{ + \north + \pgf@y=-\pgf@y + } +}{% + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + % DRAIN CONNECTION + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate height}\pgf@circ@res@up}} + % DRAIN + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate height}\pgf@circ@res@up}} + \pgfusepath{draw} + + % GATE, DASHED, BOLD + \pgfscope + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/base height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/base height}\pgf@circ@res@up*0.45}} + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/base height}\pgf@circ@res@up*0.25}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/base height}\pgf@circ@res@down*0.25}} + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/base height}\pgf@circ@res@down*0.45}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/base height}\pgf@circ@res@down}} + \pgfsetlinewidth{2\pgflinewidth} + \pgfusepath{draw} + \endpgfscope + + % BULK + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/base width}\pgf@circ@res@left} + {\pgf@circ@res@up+\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgf@circ@res@up+\pgf@circ@res@down}} + + % SOURCE + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate height}\pgf@circ@res@down}} + % SOURCE CONNECTION + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + % GATE + \pgfscope + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate height}\pgf@circ@res@down}} + %\pgfsetlinewidth{2\pgflinewidth} + \pgfusepath{draw} + \endpgfscope + + % ARROW + \pgfscope + \pgfslopedattimetrue + \pgfallowupsidedownattimetrue + \pgfresetnontranslationattimefalse + % Arrow has to be rotated, as this is a p-channel fet + \pgftransformrotate{180} + \pgftransformlineattime{-.6}{% + \pgfpoint + {\pgf@circ@res@right}% + {\pgf@circ@res@up+\pgf@circ@res@down}% + }{% + \pgfpoint% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/base width}\pgf@circ@res@left}% + {\pgf@circ@res@up+\pgf@circ@res@down}% + } + \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} + \endpgfscope + + % GATE CONNECTION (in line with source) + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate height}\pgf@circ@res@down}} + %\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate height}\pgf@circ@res@down}} + \pgfusepath{draw} +} + +% P-CHANNEL IGFET DEPLETION TYPE +\pgfcircdeclarefet{pigfetd}{ + \anchor{D}{ + \north + } + \anchor{drain}{ + \north + } + \anchor{S}{ + \north + \pgf@y=-\pgf@y + } + \anchor{source}{ + \north + \pgf@y=-\pgf@y + } +}{% + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + % DRAIN CONNECTION + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/gate height}\pgf@circ@res@up}} + % DRAIN + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/gate height}\pgf@circ@res@up}} + + \pgfusepath{draw} + + + % GATE DEPLETION TYPE + \pgfscope + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/base height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/base height}\pgf@circ@res@down}} + \pgfsetlinewidth{2\pgflinewidth} + \pgfusepath{draw} + \endpgfscope + + % BULK + + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/base width}\pgf@circ@res@left} + {\pgf@circ@res@up+\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgf@circ@res@up+\pgf@circ@res@down}} + + + % SOURCE + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/gate height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/gate height}\pgf@circ@res@down}} + % SOURCE CONNECTION + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + % GATE + \pgfscope + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/gate height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/gate height}\pgf@circ@res@down}} + %\pgfsetlinewidth{2\pgflinewidth} + \pgfusepath{draw} + \endpgfscope + + % ARROW + \pgfscope + \pgfslopedattimetrue + \pgfallowupsidedownattimetrue + \pgfresetnontranslationattimefalse + % PFET! + \pgftransformrotate{180} + \pgftransformlineattime{-.6}{% + \pgfpoint + {\pgf@circ@res@right}% + {\pgf@circ@res@up+\pgf@circ@res@down}% + }{% + \pgfpoint% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/base width}\pgf@circ@res@left}% + {\pgf@circ@res@up+\pgf@circ@res@down}% + } + \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} + \endpgfscope + + % GATE CONNECTION + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/gate height}\pgf@circ@res@down}} + %\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/gate height}\pgf@circ@res@down}} + \pgfusepath{draw} +} + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Contrib Danilo Piazzalunga + + + + + + +\pgfcircdeclaretransistor{njfet}{ + \anchor{G}{ + \left + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/height}\pgf@y + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@y + \pgf@y=-.5\pgf@y + } + \anchor{gate}{ + \left + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/height}\pgf@y + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@y + \pgf@y=-.5\pgf@y + } + \anchor{D}{ + \north + } + \anchor{drain}{ + \north + } + \anchor{S}{ + \north + \pgf@y=-\pgf@y + } + \anchor{source}{ + \north + \pgf@y=-\pgf@y + } +}{% + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@up}} + + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \pgfscope + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height}\pgf@circ@res@down}} + \pgfsetlinewidth{2\pgflinewidth} + \pgfusepath{draw} + \endpgfscope + + \pgfscope + \pgfslopedattimetrue + \pgfallowupsidedownattimetrue + \pgfresetnontranslationattimefalse + \pgftransformlineattime{.6}{% + \pgfpoint{\pgf@circ@res@left}% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}% + }{% + \pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}% + } + \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} + \endpgfscope + + + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}} + \pgfusepath{draw} +} + + +\pgfcircdeclaretransistor{pjfet}{ + \anchor{G}{ + \left + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/height}\pgf@y + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@y + \pgf@y=.5\pgf@y + } + \anchor{gate}{ + \left + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/height}\pgf@y + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@y + \pgf@y=.5\pgf@y + } + \anchor{S}{ + \north + } + \anchor{source}{ + \north + } + \anchor{D}{ + \north + \pgf@y=-\pgf@y + } + \anchor{drain}{ + \north + \pgf@y=-\pgf@y + } +}{% + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}} + + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} \pgfusepath{draw} + \pgfscope + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height}\pgf@circ@res@down}} + \pgfsetlinewidth{2\pgflinewidth} + \pgfusepath{draw} + \endpgfscope + \pgfscope + \pgfslopedattimetrue + \pgfallowupsidedownattimetrue + \pgfresetnontranslationattimefalse + \pgftransformlineattime{.4}{% + \pgfpoint% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}% + }{% + \pgfpoint{\pgf@circ@res@left}% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}% + } + \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} + \endpgfscope + + + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}} + \pgfusepath{draw} +} + + + + + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + + + + + + + + + + + + + + + + + + + +%% Black thyristor + +\pgfcircdeclarebipole{ + \anchor{gate}{ + \northeast + } + \anchor{anode}{ + \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi + \pgf@y=0cm + } + \anchor{G}{ + \northeast + } + \anchor{cathode}{ + \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi + \pgf@y=0cm + } +}{\ctikzvalof{tripoles/thyristor/height 2}}{thyristor}{\ctikzvalof{tripoles/thyristor/height}}{\ctikzvalof{tripoles/thyristor/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgf@circ@res@other = \ctikzvalof{tripoles/thyristor/diode width left}\pgf@circ@res@left + \pgf@circ@res@step = \ctikzvalof{tripoles/thyristor/diode width right}\pgf@circ@res@right + + \pgfscope + \pgftransformxshift{\pgf@circ@res@other} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}} + + \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}} + \pgfusepath{draw,fill} + + \pgfsetlinewidth{\pgfstartlinewidth} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}} + \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\ctikzvalof{tripoles/thyristor/diode height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\pgf@circ@res@up}} + \pgfusepath{draw} + \endpgfscope + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@down}} + + \pgfusepath{draw} + + \pgfsetlinewidth{\pgfstartlinewidth} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} + + \pgfusepath{draw} + } +%% Empty triac +\pgfcircdeclarebipole{ + \anchor{gate}{ + \northeast + } + \anchor{G}{ + \northeast + } + \anchor{anode}{ + \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi + \pgf@y=0cm + } + \anchor{cathode}{ + \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi + \pgf@y=0cm + } +}{\ctikzvalof{tripoles/triac/height}}{triac}{\ctikzvalof{tripoles/triac/height}}{\ctikzvalof{tripoles/triac/width}}{ + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgf@circ@res@other = \ctikzvalof{tripoles/triac/diode width left}\pgf@circ@res@left + \pgf@circ@res@step = \ctikzvalof{tripoles/triac/diode width right}\pgf@circ@res@right + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}} + \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2) + \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}} + \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2) + \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} + + \pgfusepath{draw} + + \pgfsetlinewidth{\pgfstartlinewidth} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2) + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2) + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} % sqrt(1/2) + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} + + \pgfusepath{draw} + +} @@ -922,4 +2264,77 @@ + +%% Potentiometer +\pgfcircdeclarebipole{ + \anchor{wiper}{ + \northeast + \pgfpoint{0pt}{\pgf@y} + } + \anchor{W}{ + \northeast + \pgfpoint{0pt}{\pgf@y} + } +}{\ctikzvalof{bipoles/potentiometer/height 2}}{potentiometer}{\ctikzvalof{bipoles/potentiometer/height}}{\ctikzvalof{bipoles/potentiometer/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/potentiometer/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 12 + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgf@circ@res@other = \pgf@circ@res@left + \advance\pgf@circ@res@other by \pgf@circ@res@step + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}} + \advance\pgf@circ@res@other by 2\pgf@circ@res@step + \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}} + \advance\pgf@circ@res@other by 2\pgf@circ@res@step + \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}} + \advance\pgf@circ@res@other by 2\pgf@circ@res@step + \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}} + \advance\pgf@circ@res@other by 2\pgf@circ@res@step + \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}} + \advance\pgf@circ@res@other by 2\pgf@circ@res@step + \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}} + \advance\pgf@circ@res@other by \pgf@circ@res@step + \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}} + \pgfusepath{draw} + + \pgfscope + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfsetarrowsend{to} + \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}} + \pgfusepath{draw} + \endpgfscope +} + + +%% Generic bipole - used as resistor by some (bleah) + +\pgfcircdeclarebipole{ + \anchor{wiper}{ + \northeast + \pgfpoint{0pt}{\pgf@y} + } +}{\ctikzvalof{bipoles/generic potentiometer/height 2}}{genericpotentiometer}{\ctikzvalof{bipoles/generic potentiometer/height}}{\ctikzvalof{bipoles/generic potentiometer/width}}{ + + \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 14 + + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfusepath{draw} + + \pgfscope + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfsetarrowsend{to} + \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}} + \pgfusepath{draw} + \endpgfscope +} + + + \endinput diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcircutils.sty b/Master/texmf-dist/tex/latex/circuitikz/pgfcircutils.sty index 49c3cef228a..9ac9ade73d6 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcircutils.sty +++ b/Master/texmf-dist/tex/latex/circuitikz/pgfcircutils.sty @@ -7,9 +7,24 @@ % % See the file doc/LICENSE for more details. +%\def\pgf@circ@handleSI#1{% + % \pgf@circ@siunitx@resfalse +% + % \edef\len{\stringlength[e]{#1}} + %\testmatchingchar[e]{#1}{\len}{>}% + %\ifmatchingchar% + % \ifnum\findchars{#1}{<}=0 + % \def\pgf@circ@handleSI@val{\substring{#1}{1}{\findchars{#1}{<}-1}} + %\def\pgf@circ@handleSI@unit{\substring{#1}{\findchars{#1}{<}-1}+1}{\stringlength{#1}} + %\pgf@circ@siunitx@restrue +% \else +% \fi + %\else + %\fi +%} \def\pgf@circ@handleSI#1{ -% \noexpandarg + \noexpandarg \def\pgf@temp{} \StrBetween{#1}{<}{>}[\pgf@circ@handleSI@unit] \StrLen{\pgf@circ@handleSI@unit}[\pgf@circ@handleSI@unit@len] @@ -19,7 +34,7 @@ \else \IfEndWith{#1}{>}{ \pgf@circ@siunitx@restrue -% \noexpandarg + \noexpandarg \StrBefore{#1}{<}[\pgf@circ@handleSI@val] }{ \pgf@circ@siunitx@resfalse diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcircvoltage.sty b/Master/texmf-dist/tex/latex/circuitikz/pgfcircvoltage.sty index ecd97c2869b..bccd7eb9859 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcircvoltage.sty +++ b/Master/texmf-dist/tex/latex/circuitikz/pgfcircvoltage.sty @@ -11,28 +11,28 @@ %% Voltage management -\tikzset{v^>/.style = { +\ctikzset{v^>/.style = { v = #1, \circuitikzbasekey/bipole/voltage/direction = forward, \circuitikzbasekey/bipole/voltage/position = above } } -\tikzset{v^/.style = { +\ctikzset{v_>/.style = { v = #1, \circuitikzbasekey/bipole/voltage/direction = forward, \circuitikzbasekey/bipole/voltage/position = below } } -\tikzset{v_/.style = {v = #1, \circuitikzbasekey/bipole/voltage/direction = forward} } -\tikzset{v/.style = {v = #1, \circuitikzbasekey/bipole/voltage/direction = forward} } +\ctikzset{v\ctikzset{voltage=european}, + american=>\ctikzset{voltage=american} + ] + +\processaction[\currentmoduleparameter{current}] + [ european=>\ctikzset{ current=european}, + american=>\ctikzset{ current=american} + ] + +\processaction[\currentmoduleparameter{resistor}] + [ european=>\ctikzset{ resistor=european}, + american=>\ctikzset{ resistor=american} + ] + +\processaction[\currentmoduleparameter{inductor}] + [ european=>\ctikzset{ inductor=european}, + american=>\ctikzset{ inductor=american}, + cute=>\ctikzset{ inductor=cute} + ] + +\processaction[\currentmoduleparameter{diode}] + [ full=>\ctikzset{ diode=full}, + empty=>\ctikzset{ diode=empty} + ] + +\processaction[\currentmoduleparameter{logic}] + [ european=>\ctikzset{ logic ports=european}, + american=>\ctikzset{ logic ports=american} + ] + +\processaction[\currentmoduleparameter{siunitx}] + [ true=>\def\SI#1#2{#1\,#2} + \def\ampere{\rm{A}} + \def\volt{\rm{V}} + \def\ohm{\Omega} + \def\siemens{\rm{S}} + \def\farad{\rm{F}} + \def\henry{\rm{H}} + \def\second{\rm{s}} + \def\coulomb{\rm{C}} + \def\siemens{\rm{S}} + \def\radians{\rm{rad}} + \def\milli{\rm{m}} + \def\micro{\mu} + \def\nano{\rm{n}} + \def\pico{\rm{p}} + \def\kilo{\rm{k}} + \def\mega{\rm{M}} + \def\giga{\rm{G}} + \def\tera{\rm{T}}, + false=>%, +% \s!default=>\pgf@circ@siunitxtrue + ] + +\processaction[\currentmoduleparameter{arrowmos}] + [ true=>\pgf@circuit@mos@arrowstrue, + false=>\pgf@circuit@mos@arrowsfalse%, +% \s!default=>\pgf@circuit@mos@arrowstrue + ] + + +\ifpgf@circ@siunitx + % nothing! siunitx and xstrings don't work in context +\fi + + +\input circuitikz1.code.tex + + +% define the environment +\long\def\startcircuitikz#1\stopcircuitikz{\starttikzpicture#1\stoptikzpicture} + +\protect + +\stopmodule + + +\endinput -- cgit v1.2.3