From ad669530a9056a6c30abd6a337d481e646c5bc82 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 15 May 2015 21:47:32 +0000 Subject: circuitikz (15may15) git-svn-id: svn://tug.org/texlive/trunk@37410 c570f23f-e606-0410-a88d-b1316a301751 --- .../third/circuitikz/circuitikz-context.tex | 20 + Master/texmf-dist/doc/generic/circuitikz/CHANGELOG | 91 + Master/texmf-dist/doc/generic/circuitikz/README | 40 + Master/texmf-dist/doc/latex/circuitikz/CHANGELOG | 74 - Master/texmf-dist/doc/latex/circuitikz/README | 40 - .../doc/latex/circuitikz/circuitikz-context.pdf | Bin 14426 -> 0 bytes .../doc/latex/circuitikz/circuitikz-context.tex | 20 - .../doc/latex/circuitikz/circuitikzmanual.ltx | 1962 +++++++++++ .../doc/latex/circuitikz/circuitikzmanual.pdf | Bin 317305 -> 376834 bytes .../doc/latex/circuitikz/circuitikzmanual.tex | 1698 --------- .../doc/latex/circuitikz/compatibility.ltx | 17 + .../doc/latex/circuitikz/compatibility.pdf | Bin 0 -> 16233 bytes .../tex/context/third/circuitikz/t-circuitikz.tex | 123 + .../tex/generic/circuitikz/circuitikz.code.tex | 710 ++++ .../tex/generic/circuitikz/circuitikz1.code.tex | 548 +++ .../tex/generic/circuitikz/pgfcircbipoles.tex | 2868 +++++++++++++++ .../tex/generic/circuitikz/pgfcirccurrent.tex | 239 ++ .../tex/generic/circuitikz/pgfcircinputarrows.tex | 23 + .../tex/generic/circuitikz/pgfcirclabel.tex | 136 + .../tex/generic/circuitikz/pgfcircmath.tex | 51 + .../tex/generic/circuitikz/pgfcircmonopoles.tex | 565 +++ .../tex/generic/circuitikz/pgfcircnpoles.tex | 599 ++++ .../tex/generic/circuitikz/pgfcircquadpoles.tex | 595 ++++ .../tex/generic/circuitikz/pgfcircshapes.tex | 151 + .../tex/generic/circuitikz/pgfcirctripoles.tex | 3639 ++++++++++++++++++++ .../tex/generic/circuitikz/pgfcircutils.tex | 66 + .../tex/generic/circuitikz/pgfcircvoltage.tex | 285 ++ .../tex/latex/circuitikz/circuitikz.code.tex | 604 ---- .../texmf-dist/tex/latex/circuitikz/circuitikz.sty | 95 +- .../tex/latex/circuitikz/circuitikz1.code.tex | 479 --- .../tex/latex/circuitikz/pgfcircbipoles.sty | 1779 ---------- .../tex/latex/circuitikz/pgfcirccurrent.sty | 239 -- .../tex/latex/circuitikz/pgfcirclabel.sty | 131 - .../tex/latex/circuitikz/pgfcircmath.sty | 51 - .../tex/latex/circuitikz/pgfcircmonopoles.sty | 374 -- .../tex/latex/circuitikz/pgfcircquadpoles.sty | 426 --- .../tex/latex/circuitikz/pgfcircshapes.sty | 120 - .../tex/latex/circuitikz/pgfcirctripoles.sty | 2914 ---------------- .../tex/latex/circuitikz/pgfcircutils.sty | 64 - .../tex/latex/circuitikz/pgfcircvoltage.sty | 285 -- .../tex/latex/circuitikz/t-circuitikz.tex | 102 - 41 files changed, 12813 insertions(+), 9410 deletions(-) create mode 100644 Master/texmf-dist/doc/context/third/circuitikz/circuitikz-context.tex create mode 100644 Master/texmf-dist/doc/generic/circuitikz/CHANGELOG create mode 100644 Master/texmf-dist/doc/generic/circuitikz/README delete mode 100644 Master/texmf-dist/doc/latex/circuitikz/CHANGELOG delete mode 100644 Master/texmf-dist/doc/latex/circuitikz/README delete mode 100644 Master/texmf-dist/doc/latex/circuitikz/circuitikz-context.pdf delete mode 100644 Master/texmf-dist/doc/latex/circuitikz/circuitikz-context.tex create mode 100644 Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.ltx delete mode 100644 Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.tex create mode 100644 Master/texmf-dist/doc/latex/circuitikz/compatibility.ltx create mode 100644 Master/texmf-dist/doc/latex/circuitikz/compatibility.pdf create mode 100644 Master/texmf-dist/tex/context/third/circuitikz/t-circuitikz.tex create mode 100644 Master/texmf-dist/tex/generic/circuitikz/circuitikz.code.tex create mode 100644 Master/texmf-dist/tex/generic/circuitikz/circuitikz1.code.tex create mode 100644 Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex create mode 100644 Master/texmf-dist/tex/generic/circuitikz/pgfcirccurrent.tex create mode 100644 Master/texmf-dist/tex/generic/circuitikz/pgfcircinputarrows.tex create mode 100644 Master/texmf-dist/tex/generic/circuitikz/pgfcirclabel.tex create mode 100644 Master/texmf-dist/tex/generic/circuitikz/pgfcircmath.tex create mode 100644 Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex create mode 100644 Master/texmf-dist/tex/generic/circuitikz/pgfcircnpoles.tex create mode 100644 Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex create mode 100644 Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex create mode 100644 Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex create mode 100644 Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex create mode 100644 Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex delete mode 100644 Master/texmf-dist/tex/latex/circuitikz/circuitikz.code.tex delete mode 100644 Master/texmf-dist/tex/latex/circuitikz/circuitikz1.code.tex delete mode 100644 Master/texmf-dist/tex/latex/circuitikz/pgfcircbipoles.sty delete mode 100644 Master/texmf-dist/tex/latex/circuitikz/pgfcirccurrent.sty delete mode 100644 Master/texmf-dist/tex/latex/circuitikz/pgfcirclabel.sty delete mode 100644 Master/texmf-dist/tex/latex/circuitikz/pgfcircmath.sty delete mode 100644 Master/texmf-dist/tex/latex/circuitikz/pgfcircmonopoles.sty delete mode 100644 Master/texmf-dist/tex/latex/circuitikz/pgfcircquadpoles.sty delete mode 100644 Master/texmf-dist/tex/latex/circuitikz/pgfcircshapes.sty delete mode 100644 Master/texmf-dist/tex/latex/circuitikz/pgfcirctripoles.sty delete mode 100644 Master/texmf-dist/tex/latex/circuitikz/pgfcircutils.sty delete mode 100644 Master/texmf-dist/tex/latex/circuitikz/pgfcircvoltage.sty delete mode 100644 Master/texmf-dist/tex/latex/circuitikz/t-circuitikz.tex diff --git a/Master/texmf-dist/doc/context/third/circuitikz/circuitikz-context.tex b/Master/texmf-dist/doc/context/third/circuitikz/circuitikz-context.tex new file mode 100644 index 00000000000..13f3ade1cde --- /dev/null +++ b/Master/texmf-dist/doc/context/third/circuitikz/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/doc/generic/circuitikz/CHANGELOG b/Master/texmf-dist/doc/generic/circuitikz/CHANGELOG new file mode 100644 index 00000000000..f9dd95f78a6 --- /dev/null +++ b/Master/texmf-dist/doc/generic/circuitikz/CHANGELOG @@ -0,0 +1,91 @@ +CircuiTikz - Changelog + +* Version 0.4 + - minor improvements to documentation + - comply with TDS + - merge high frequency symbols by Stefan Erhardt + - added switch (not opening nor closing) + - added added solder dot in some transistors + - improved ConTeXt compatibility + +* Version 0.3.1 + - different management of color... + - fixed typo in documentation + - fixed an error in the angle computation in voltage and current routines + - fixed problem with label size when scaling a tikz picture + - added gas filled surge arrester + - added compatibility option to work with Tikz's own circuit library + - fixed infinite in arctan computation + +* Version 0.3.0 + - fixed gate node for a few transistors + - added mixer + - added fully differential op amp (by Kristofer M. Monisit) + - now general settings for the drawing of voltage can be overridden for specific components + - made arrows more homogeneous (either the current one, or latex' bt pgf) + - added the single battery cell + - added fuse and asymmetric fuse + - added toggle switch + - added varistor, photoresistor, thermocouple, push button + - added thermistor, thermistor ptc, thermistor ptc + - fixed misalignment of voltage label in vertical bipoles with names + - added isfet + - added noiseless, protective, chassis, signal and reference grounds (Luigi «Liverpool») + +* Version 0.2.4 + - added square voltage source (contributed by Alistair Kwan) + - added buffer and plain amplifier (contributed by Danilo Piazzalunga) + - added squid and barrier (contributed by Cor Molenaar) + - added antenna and transmission line symbols contributed by Leonardo Azzinnari + - added the changeover switch spdt (suggestion of Fabio Maria Antoniali) + - rename of context.tex and context.pdf (thanks to Karl Berry) + - updated the email address + - in documentation, fixed wrong (non-standard) labelling of the axis in an example (thanks to prof. Claudio Beccaria) + - fixed scaling inconsistencies in quadrupoles + - fixed division by zero error on certain vertical paths + - introduced options straighlabels, rotatelabels, smartlabels + +* Version 0.2.3 + - fixed compatibility problem with label option from tikz + - Fixed resizing problem for shape ground + - 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 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. + - Full use of \TikZ\ keyval features. + - White background is not filled anymore: now the network can be drawn on a background picture as well. + - Several new components added (logical ports, transistors, double bipoles, \ldots). + - Color support. + - Integration with {\ttfamily siunitx}. + - Voltage, american style. + - Better code, perhaps. General cleanup at the very least. + +* Version 0.1 - 2007-10-29 +First public release diff --git a/Master/texmf-dist/doc/generic/circuitikz/README b/Master/texmf-dist/doc/generic/circuitikz/README new file mode 100644 index 00000000000..af83ad27ed3 --- /dev/null +++ b/Master/texmf-dist/doc/generic/circuitikz/README @@ -0,0 +1,40 @@ +This is CircuiTikz, version 0.4. + +This package provides a set of macros for naturally typesetting electrical and (somewhat less naturally, perhaps) electronical networks. + +It was born mainly for writing my own exercise book and exams sheets for the Elettrotecnica courses at Politecnico di Milano, Italy. I wanted a tool that was easy to use, with a lean syntax, native to \LaTeX, and supporting directly PDF output format. + +So I based everything with the very impressive (if somewhat verbose at times) \TikZ\ package. + +-------------- + +** Requirements +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. + +** Usage +Just place + + \usepackage{circuitikz} + +or, for ConTeXt, + + \usemodule[circuitikz] + +in the preamble and compile away, both with PS and PDF target output. + +** Contact the author +m.redaelli@gmail.com +git: https://github.com/mredaelli/circuitikz + +------------- + +Copyright 2007-13 by Massimo Redaelli + +This file may be distributed and/or modified + +1. under the LaTeX Project Public License and/or +2. under the GNU Public License. diff --git a/Master/texmf-dist/doc/latex/circuitikz/CHANGELOG b/Master/texmf-dist/doc/latex/circuitikz/CHANGELOG deleted file mode 100644 index a49872bbed3..00000000000 --- a/Master/texmf-dist/doc/latex/circuitikz/CHANGELOG +++ /dev/null @@ -1,74 +0,0 @@ -CircuiTikz - Changelog - -* Version 0.3.0 - - fixed gate node for a few transistors - - added mixer - - added fully differential op amp (by Kristofer M. Monisit) - - now general settings for the drawing of voltage can be overridden for specific components - - made arrows more homogeneous (either the current one, or latex' bt pgf) - - added the single battery cell - - added fuse and asymmetric fuse - - added toggle switch - - added varistor, photoresistor, thermocouple, push button - - added thermistor, thermistor ptc, thermistor ptc - - fixed misalignment of voltage label in vertical bipoles with names - - added isfet - - added noiseless, protective, chassis, signal and reference grounds (Luigi «Liverpool») - -* Version 0.2.4 - - added square voltage source (contributed by Alistair Kwan) - - added buffer and plain amplifier (contributed by Danilo Piazzalunga) - - added squid and barrier (contributed by Cor Molenaar) - - added antenna and transmission line symbols contributed by Leonardo Azzinnari - - added the changeover switch spdt (suggestion of Fabio Maria Antoniali) - - rename of context.tex and context.pdf (thanks to Karl Berry) - - updated the email address - - in documentation, fixed wrong (non-standard) labelling of the axis in an example (thanks to prof. Claudio Beccaria) - - fixed scaling inconsistencies in quadrupoles - - fixed division by zero error on certain vertical paths - - introduced options straighlabels, rotatelabels, smartlabels - -* Version 0.2.3 - - fixed compatibility problem with label option from tikz - - Fixed resizing problem for shape ground - - 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 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. - - Full use of \TikZ\ keyval features. - - White background is not filled anymore: now the network can be drawn on a background picture as well. - - Several new components added (logical ports, transistors, double bipoles, \ldots). - - Color support. - - Integration with {\ttfamily siunitx}. - - Voltage, american style. - - Better code, perhaps. General cleanup at the very least. - -* Version 0.1 - 2007-10-29 -First public release diff --git a/Master/texmf-dist/doc/latex/circuitikz/README b/Master/texmf-dist/doc/latex/circuitikz/README deleted file mode 100644 index bad2a7f3b04..00000000000 --- a/Master/texmf-dist/doc/latex/circuitikz/README +++ /dev/null @@ -1,40 +0,0 @@ -This is CircuiTikz, version 0.3.0. - -This package provides a set of macros for naturally typesetting electrical and (somewhat less naturally, perhaps) electronical networks. - -It was born mainly for writing my own exercise book and exams sheets for the Elettrotecnica courses at Politecnico di Milano, Italy. I wanted a tool that was easy to use, with a lean syntax, native to \LaTeX, and supporting directly PDF output format. - -So I based everything with the very impressive (if somewhat verbose at times) \TikZ\ package. - --------------- - -** Requirements -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. - -** Usage -Just place - - \usepackage{circuitikz} - -or, for ConTeXt, - - \usemodule[circuitikz] - -in the preamble and compile away, both with PS and PDF target output. - -** Contact the author -m.redaelli@gmail.com -git: https://github.com/mredaelli/circuitikz - -------------- - -Copyright 2007-12 by Massimo Redaelli - -This file may be distributed and/or modified - -1. under the LaTeX Project Public License and/or -2. under the GNU Public License. diff --git a/Master/texmf-dist/doc/latex/circuitikz/circuitikz-context.pdf b/Master/texmf-dist/doc/latex/circuitikz/circuitikz-context.pdf deleted file mode 100644 index cb8662d2979..00000000000 Binary files a/Master/texmf-dist/doc/latex/circuitikz/circuitikz-context.pdf and /dev/null differ diff --git a/Master/texmf-dist/doc/latex/circuitikz/circuitikz-context.tex b/Master/texmf-dist/doc/latex/circuitikz/circuitikz-context.tex deleted file mode 100644 index 13f3ade1cde..00000000000 --- a/Master/texmf-dist/doc/latex/circuitikz/circuitikz-context.tex +++ /dev/null @@ -1,20 +0,0 @@ - -\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/doc/latex/circuitikz/circuitikzmanual.ltx b/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.ltx new file mode 100644 index 00000000000..5404efe77c0 --- /dev/null +++ b/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.ltx @@ -0,0 +1,1962 @@ +\documentclass[a4paper]{article} + + +\def\modern{ + \usepackage{fontspec} + \defaultfontfeatures{Ligatures=TeX, Numbers=OldStyle,Mapping=tex-text ,SmallCapsFeatures={LetterSpace=8, Numbers=OldStyle}} + \setmainfont{Gentium Book Basic} +} + +\usepackage[siunitx]{circuitikz} + +\usepackage{ifxetex,ifluatex} +\ifxetex + \modern +\else + \ifluatex + \modern + \else + % pdflatex + \usepackage[T1]{fontenc} + \usepackage[utf8]{inputenc} + %\usepackage{babel} + \fi +\fi + + +\usepackage{microtype} + +\sisetup{load=derived} % loading \siemens +\usepackage{showexpl} +\lstset{pos=l,width=-99pt, overhang=0pt,hsep=\columnsep,vsep=\bigskipamount,rframe=single,numbers=left,numberstyle=\tiny,numbersep=.3em, xleftmargin=1em, columns=flexible, language=[LaTeX]TEX} + +\usepackage{booktabs} +\renewcommand{\arraystretch}{1.2} + +\usepackage{framed, xtab} +\usepackage{hyperref} +\hypersetup{ + bookmarks=false, % show bookmarks bar? + pdftitle={CircuitTikZ v. \pgfcircversion\ - manual}, % title + pdfauthor={Massimo Redaelli}, % author + pdfsubject={CircuitTikZ manual}, % subject of the document + pdfkeywords={}, % list of keywords + colorlinks=true, % false: boxed links; true: colored links + linkcolor=black, % color of internal links + citecolor=black, % color of links to bibliography + filecolor=black, % color of file links + urlcolor=black % color of external links +} +\usepackage{imakeidx} +\usepackage{textcomp} +\makeindex[title=Index of the components, intoc=true] + +\def\circuititem#1#2#3{\item {#2} (\texttt{#1}) \index{#1} \par \begin{center}\begin{circuitikz} \draw (0,0) node[#1] {}; \end{circuitikz} \end{center} +\par} + +\newcommand{\circuititembip}[3]{\item {#2} \index{#1} +\tikz\foreach \i in {#3} {\index{\i|see{#1}} }; (\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} + +\usepackage{marvosym} +\newcommand{\email}[2][]{\def\temp{#1}\ifx\temp\empty\Email~\fi\href{mailto:#2}{#2}} + +\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{\Circuitikz \\{\large version \pgfcircversion}} +\author{Massimo A. Redaelli} +\date{\today} + +\maketitle + +\tableofcontents + +\section{Introduction} +After two years of little exposure only on my personal website\footnote{Now the package is moved to its own git repository: \url{https://github.com/mredaelli/circuitikz}. Contributions are welcome.}, I did a major rehauling of the code of Circui\TikZ, fixing several problems and converting everything to \TikZ\ version $2.0$. + +I'm not too sure about the result, because my (La)\TeX\ skills are much to be improved, but it seems it's time for more user feedback. So, here it is\ldots + +\medskip + +I know the documentation is somewhat scant. Hope to have time to improve it a bit. + +\subsection{About} +This package provides a set of macros for naturally typesetting electrical and (somewhat less naturally, perhaps) electronical networks. + +It was born mainly for writing my own exercise book and exams sheets for the Elettrotecnica courses at Politecnico di Milano, Italy. I wanted a tool that was easy to use, with a lean syntax, native to \LaTeX, and supporting directly PDF output format. + +So I based everything with the very impressive (if somewhat verbose at times) \TikZ\ package. + +\subsection{Loading the package} + + +\begin{table}[h] +\centering +\begin{tabular}{ll}\toprule + \LaTeX & \ConTeXt\footnotemark \\ \midrule + \verb!\usepackage{circuitikz}! & \verb!\usemodule[circuitikz]!\\ + \bottomrule +\end{tabular} +\end{table} +\footnotetext{\ConTeXt\ suppurt was added mostly thanks to Mojca Miklavec and Aditya Mahajan.} + +\noindent \TikZ\ will be automatically loaded. + +\noindent Circui\TikZ\ commands are just \TikZ\ commands, so a minimum usage example would be: + +\begin{LTXexample}[varwidth=true] +\tikz \draw (0,0) to[R=$R_1$] (2,0); +\end{LTXexample} + +\subsection{License} +Copyright \copyright\ 2007--2011 Massimo Redaelli. This package is author-maintained. +Permission is granted to copy, distribute and/or modify this software under the +terms of the \LaTeX Project Public License, version 1.3.1, or the GNU Public License. This software is provided ‘as is’, without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a +particular purpose. + +\subsection{Feedback} +Much appreciated: \email{mailto:m.redaelli@gmail.com}. Although I don't guarantee quick answers. + +\subsection{Requirements} +\begin{itemize} + \item \texttt{tikz}, version $\ge 2$; + \item \texttt{xstring}, not older than 2009/03/13; + \item \texttt{siunitx}, if using \texttt{siunitx} option. +\end{itemize} + +\subsection{Incompatible packages} + +\TikZ's own \texttt{circuit} library, which is based on \Circuitikz, (re?)defines several styles used by this library. In order to have them work together I added the \texttt{compatibility} package option, which basically prefixes the names of all \Circuitikz\ \texttt{to[]} styles with an asterisk. + +So, if loaded with said option, one must write \verb!(0,0) to[*R] (2,0)! and, for transistors on a path, \verb!(0,0) to[*Tnmos] (2,0)!, and so on (but \verb!(0,0) node [nmos] {}!). See example at page~\pageref{ex:compatibility}. + +\subsection{Introduction to version 0.3.0} + +Probably nobody is hoping or caring for a new version of the package at this point, seeing how long it took me for this next release. But here it is, fixing a big problem (voltage labels in the wrong place, in some cases) and adding several components. + +Thanks for bug reporting and suggesting improvements. + +\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} + + +\section{Package options} + +\noindent Circuit people are very opinionated about their symbols. The package, left to its own devices, loads with drawing conventions that \emph{I} like, so for instance you get this: +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[R=2<\ohm>, i=?, v=84<\volt>] (2,0) -- + (2,2) to[V=84<\volt>] (0,2) + -- (0,0); +\end{circuitikz} +\end{LTXexample} + +But if you really, \emph{really} want your circuit ugly, you can load the package with: + + +\begin{center} +\begin{tabular}{ll}\toprule + \LaTeX & \ConTeXt \\ \midrule + \verb!\usepackage[american]{circuitikz}! & \verb!\usemodule[circuitikz][american]!\\ + \bottomrule +\end{tabular} +\end{center} + +\noindent and you get (don't blame me) + +\begin{center} +\begin{circuitikz}[circuitikz/voltage=american, circuitikz/resistor=american] + \draw (0,0) to[R=2<\ohm>, i=?, v=84<\volt>] (2,0) -- + (2,2) to[V=84<\volt>] (0,2) + -- (0,0); +\end{circuitikz} +\end{center} + +\medskip{} + +\noindent Here is the list of all the options: +\begin{itemize} + \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{americangfsurgearrester}: uses round gas filled surge arresters, as per american standards; + \item \texttt{europeangfsurgearrester}: uses rectangular gas filled surge arresters, as per european standards; + \item \texttt{european}: equivalent to \texttt{europeancurrents}, \texttt{europeanvoltages}, \texttt{europeanresistors}, \texttt{europeaninductors}, \texttt{europeanports}, \texttt{europeangfsurgearrester}; + \item \texttt{american}: equivalent to \texttt{americancurrents}, \texttt{americanvoltages}, \texttt{americanresistors}, \texttt{americaninductors}, \texttt{americanports}, \texttt{americangfsurgearrester}; + \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{fulldiodes}: the various diodes are drawn \emph{and} filled by default, i.e. when using styles such as \texttt{diode}, \texttt{D}, \texttt{sD}, \ldots Un-filled diode can always be forced with \texttt{Do}, \texttt{sDo}, \ldots + \item \texttt{emptydiodes}: the various diodes are drawn \emph{but not} filled by default, i.e. when using styles such as \texttt{diode}, \texttt{D}, \texttt{sD}, \ldots Filled diode can always be forced with \texttt{D*}, \texttt{sD*}, \ldots + \item \texttt{arrowmos}: pmos and nmos have arrows analogous to those of pnp and npn transistors; + \item \texttt{noarrowmos}: pmos and nmos do not have arrows analogous to those of pnp and npn transistors; + \item \texttt{straightlabels}: labels on bipoles are always printed straight up, i.e.~with horizontal baseline; + \item \texttt{rotatelabels}: labels on bipoles are always printed aligned along the bipole; + \item \texttt{smartlabels}: labels on bipoles are rotated along the bipoles, unless the rotation is very close to multiples of 90°; + \item \texttt{compatibility}: makes it possibile to load \Circuitikz\ and \TikZ\ circuit library together. +\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{[europeancurrents, europeanvoltages, americanresistors, cuteinductors, americanports, nosiunitx, noarrowmos, smartlabels]}. + +\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} + +Here follows the list of all the shapes defined by Circui\TikZ. These are all \texttt{pgf} nodes, so they are usable in both \texttt{pgf} and \TikZ. + +\medskip + +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 + (0,0) to[ #1 ] (2,0) +; \end{circuitikz} \end{center} +\end{verbatim} + +The other shapes are shown with: +\begin{verbatim} +\begin{center}\begin{circuitikz} \draw + (0,0) node[ #1 ] {} +; \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}. + +\begin{framed} + If using the \verb!\tikzexternalize! feature, as of Ti\emph{k}z 2.1 all pictures must end with \verb!\end{tikzpicture}!. Thus you \emph{cannot} use the \verb!circuitikz! environment. + + Which is ok: just use \verb!tikzpicture!: everything will work there just fine. +\end{framed} + +\subsection{Monopoles} +\begin{itemize} + \circuititem{ground}{Ground}{} + \circuititem{rground}{Reference ground}{} + \circuititem{sground}{Signal ground}{} + \circuititem{nground}{Noiseless ground}{} + \circuititem{pground}{Protective ground}{} + \circuititem{cground}{Chassis ground\footnote{These last three were contributed by Luigi «Liverpool»)}}{} + \circuititem{antenna}{Antenna}{} + \circuititem{rxantenna}{Receiving antenna}{} + \circuititem{txantenna}{Transmitting antenna}{} + \circuititem{tlinestub}{Transmission line stub}{} + \circuititem{vcc}{VCC}{} + \circuititem{match}{match}{} + \circuititem{oscillator}{LO\footnote{These last three come from Stefan Erhardt's contribution of HF components}}{} +\end{itemize} + + +\subsection{Bipoles} + +\subsubsection{Instruments} +\begin{itemize} + \circuititembip{ammeter}{Ammeter}{} + \circuititembip{voltmeter}{Voltmeter}{} + \circuititembip{ohmmeter}{Ohmmeter}{} +\end{itemize} + +\subsubsection{Basic resistive bipoles} +\begin{itemize} + \circuititembip{short}{Short circuit}{} + \circuititembip{open}{Open circuit}{} + + \circuititembip{lamp}{Lamp}{} + \circuititembip{generic}{Generic (symmetric) bipole}{} + \circuititembip{tgeneric}{Tunable generic bipole}{} + \circuititembip{ageneric}{Generic asymmetric bipole}{} + \circuititembip{fullgeneric}{Generic asymmetric bipole (full)}{} + \circuititembip{tfullgeneric}{Tunable generic bipole (full)}{} + \circuititembip{memristor}{Memristor}{Mr} +\end{itemize} + +\subsubsection{Resistors and the like} + +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{resistor=american} + \circuititembip{R}{Resistor}{american resistor} + \circuititembip{vR}{Variable resistor}{variable american resistor} + \circuititembip{pR}{Potentiometer}{american potentiometer} +\end{itemize} + +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{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} + +Other miscellaneous resistor-like devices: +\begin{itemize} + \circuititembip{varistor}{Varistor}{} + \circuititembip{phR}{Photoresistor}{photoresistor} + \circuititembip{thermocouple}{Thermocouple}{} + \circuititembip{thR}{Thermistor}{thermistor} + \circuititembip{thRp}{PTC thermistor}{thermistor ptc} + \circuititembip{thRn}{NTC thermistor}{thermistor ntc} + \circuititembip{fuse}{Fuse}{} + \circuititembip{afuse}{Asymmetric fuse}{asymmetric fuse} +\end{itemize} + +\subsubsection{Stationary sources} +\begin{itemize} + \circuititembip{battery}{Battery}{} + \circuititembip{battery1}{Single battery cell}{} + \circuititembip{european voltage source}{Voltage source (european style)}{} + \circuititembip{american voltage source}{Voltage source (american style)}{} + \circuititembip{european current source}{Current source (european style)}{} + \circuititembip{american current source}{Current source (american style)}{} +\end{itemize} + +\begin{framed} +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}. + +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} + + + +\subsubsection{Diodes and such} +\begin{itemize} + \circuititembip{empty diode}{Empty diode}{Do} + \circuititembip{empty Schottky diode}{Empty Schottky diode}{sDo} + \circuititembip{empty Zener diode}{Empty Zener diode}{zDo} + \circuititembip{empty tunnel diode}{Empty tunnel diode}{tDo} + \circuititembip{empty photodiode}{Empty photodiode}{pDo} + \circuititembip{empty led}{Empty led}{leDo} + \circuititembip{empty varcap}{Empty varcap}{VCo} + \circuititembip{full diode}{Full diode}{D*} + \circuititembip{full Schottky diode}{Full Schottky diode}{sD*} + \circuititembip{full Zener diode}{Full Zener diode}{zD*} + \circuititembip{full tunnel diode}{Full tunnel diode}{tD*} + \circuititembip{full photodiode}{Full photodiode}{pD*} + \circuititembip{full led}{Full led}{leD*} + \circuititembip{full varcap}{Full varcap}{VC*} + \end{itemize} + +\begin{framed} +The options \texttt{fulldiodes} and \texttt{emptydiodes} (and the styles \texttt{[full diodes]} and \texttt{[empty diodes]}) define which shape will be used by abbreviated commands such that \texttt{D}, \texttt{sD}, \texttt{zD}, \texttt{tD}, \texttt{pD}, \texttt{leD}, and \texttt{VC}. +\end{framed} + +\begin{itemize} + \circuititembip{squid}{Squid}{} + \circuititembip{barrier}{Barrier}{} +\end{itemize} + +\begin{itemize} + \circuititembip{european gas filled surge arrester}{European gas filled surge arrester}{} + \circuititembip{american gas filled surge arrester}{American gas filled surge arrester}{} +\end{itemize} + +\begin{framed} +If (default behaviour) \texttt{europeangfsurgearrester} option is active (or the style \texttt{[european gas filled surge arrester]} is used), the shorthands \texttt{gas filled surge arrester} and \texttt{gf surge arrester} are equivalent to the european version of the component. + +If otherwise \texttt{americangfsurgearrester} option is active (or the style \texttt{[american gas filled surge arrester]} is used), the shorthands the shorthands \texttt{gas filled surge arrester} and \texttt{gf surge arrester} are equivalent to the american version of the component. +\end{framed} + +\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 (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{inductor=american} + \circuititembip{L}{Inductor}{american inductor} + \circuititembip{vL}{Variable inductor}{variable american inductor} +\end{itemize} + +Finally, if \texttt{europeaninductors} option is active (or the style \texttt{[european inductors]} is used), the inductors are displayed as follows: +\begin{itemize} + \ctikzset{inductor=european} + \circuititembip{L}{Inductor}{european inductor} + \circuititembip{vL}{Variable inductor}{variable european inductor} +\end{itemize} + +There is also a transmission line: +\begin{itemize} +\circuititembip{TL}{Transmission line}{transmission line, tline} +\end{itemize} + +\subsubsection{Sinusoidal sources} Here because I was asked for them. But how do you distinguish one from the other?! +\begin{itemize} + \circuititembip{sinusoidal voltage source}{Sinusoidal voltage source}{vsourcesin, sV} + \circuititembip{sinusoidal current source}{Sinusoidal current source}{isourcesin, sI} +\end{itemize} + +\subsubsection{Special sources} +\begin{itemize} + \circuititembip{square voltage source}{Square voltage source}{vsourcesquare, sqV} + \circuititembip{vsourcetri}{Square voltage source}{} + \circuititembip{esource}{Empty voltage source}{} +\end{itemize} + +\subsubsection{DC sources} +\begin{itemize} + \circuititembip{dcvsource}{DC voltage source}{} + \circuititembip{dcisource}{DC current source}{} +\end{itemize} + +%\begin{framed} +%The options \texttt{europeancurrent} [resp. \texttt{europeanvoltage}] (the default) and \texttt{americancurrent} [resp. \texttt{americanvoltage}] define which sinusoidal current [resp. voltage] source is selected by default when the abbreviated styles \texttt{sinusoidal current source}, \texttt{csourcesin}, \texttt{cI} [resp. \texttt{sinusoidal voltage source}, \texttt{vsourcesin}, \texttt{cV}] are used. + +%One can also use the related styles \texttt{[european currents]} [resp. \texttt{[european voltages]}] and \texttt{[american currents]} [resp. \texttt{[american voltages]}]. +%\end{framed} + +\subsubsection{Switch} +\begin{itemize} + \circuititembip{switch}{Switch}{spst} + \circuititembip{closing switch}{Closing switch}{cspst} + \circuititembip{opening switch}{Opening switch}{ospst} + \circuititembip{push button}{Push button}{} +\end{itemize} + +\subsubsection{HF components} +\noindent Contributed by Stefan Erhardt. +\begin{itemize} + \circuititembip{twoport}{generic two port\footnote{To specify text to be put in the component: \texttt{twoport[t=text]}): \tikz \draw[scale=.5, transform shape] (0,0) to[twoport,>,t=text] (2,0); }}{} + \circuititembip{vco}{vco}{} + \circuititembip{bandpass}{bandpass}{} + \circuititembip{highpass}{highpass}{} + \circuititembip{lowpass}{lowpass}{} + \circuititembip{adc}{A/D converter}{} + \circuititembip{dac}{D/A converter}{} + \circuititembip{dsp}{DSP}{} + \circuititembip{fft}{FFT}{} + \circuititembip{amp}{amplifier}{} + \circuititembip{vamp}{VGA}{} + \circuititembip{piattenuator}{$\pi$ attenuator}{} + \circuititembip{vpiattenuator}{var. $\pi$ attenuator}{} + \circuititembip{tattenuator}{T attenuator}{} + \circuititembip{vtattenuator}{var.\ T attenuator}{} + \circuititembip{phaseshifter}{phase shifter}{} + \circuititembip{vphaseshifter}{var.\ phase shifter}{} + \circuititembip{detector}{detector}{} +\end{itemize} + + + + +\subsection{Tripoles} +\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)}{} + \circuititembip{european controlled current source}{Controlled current source (european style)}{} + \circuititembip{american controlled current source}{Controlled current source (american style)}{} +\end{itemize} + +\begin{framed} +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}. + +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} + \circuititembip{controlled sinusoidal voltage source}{Controlled sinusoidal voltage source}{controlled vsourcesin, cvsourcesin, csV} + \circuititembip{controlled sinusoidal current source}{Controlled sinusoidal current source}{controlled isourcesin, cisourcesin, csI} + \end{itemize} + + +\subsubsection{Transistors} +\begin{itemize} + \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}{\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{nigfetebulk}{\scshape nigfetebulk}{} + \circuititem{nigfetd}{\scshape nigfetd}{} + \circuititem{pfet}{\scshape pfet}{} + \circuititem{pigfete}{\scshape pigfete}{} + \circuititem{pigfetebulk}{\scshape pigfetebulk}{} + \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} + +\textsc{isfet} +\begin{itemize} + \circuititem{isfet}{\scshape isfet}{} +\end{itemize} + +\subsubsection{HF} +These come from Stefan Erhardt's contribution of HF components. +\begin{itemize} + \circuititem{circulator}{\scshape circulator}{} + \circuititem{wilkinson}{\scshape wilkinson divider}{} +\end{itemize} + + + + +\subsubsection{Switch} +\begin{itemize} + \circuititem{spdt}{\scshape spdt}{} + \circuititembip{toggle switch}{Toggle switch}{} +\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} + +\subsubsection{Misc} +\begin{itemize} + \circuititem{mixer}{Mixer}{} +\end{itemize} + +\subsection{Double bipoles} + +Transformers automatically use the inductor shape currently selected. These are the three possibilities: +\begin{itemize} + \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}{} + \circuititem{coupler}{Coupler}{} + \circuititem{coupler2}{Coupler, 2}{} +\end{itemize} + + +\subsection{Logic gates} + +\begin{itemize} + \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{Amplifiers} + +\begin{itemize} + \circuititem{op amp}{Operational amplifier}{} + \circuititem{fd op amp}{Fully differential operational amplifier\footnote{Contributed by Kristofer M. Monisit.}}{} + \circuititem{gm amp}{transconductance amplifier}{} + \circuititem{plain amp}{Plain amplifier}{} + \circuititem{buffer}{Buffer}{} +\end{itemize} + +\subsection{Support shapes} + +\begin{itemize} + \circuititem{currarrow}{Arrows (current and voltage)}{} + \circuititem{circ}{Connected terminal}{} + \circuititem{ocirc}{Unconnected terminal}{} +\end{itemize} + + + +\section{Usage} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[R, l=$R_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[R=$R_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[R, i=$i_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[R, v=$v_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[R=$R_1$, i=$i_1$, v=$v_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[R=$R_1$, i=$i_1$, v=$v_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + + +Long names/styles for the bipoles can be used: +\begin{LTXexample}[varwidth=true] +\begin{circuitikz}\draw + (0,0) to[resistor=1<\kilo\ohm>] (2,0) +;\end{circuitikz} +\end{LTXexample} + +\subsection{Labels} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[R, l^=$R_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[R, l_=$R_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + +\noindent The default orientation of labels is controlled by the options \texttt{smartlabels}, \texttt{rotatelabels} and \texttt{straightlabels} (or the corresponding \texttt{label/align} keys). Here are examples to see the differences: +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} +\ctikzset{label/align = straight} +\def\DIR{0,45,90,135,180,-90,-45,-135} +\foreach \i in \DIR { + \draw (0,0) to[R=\i, *-o] (\i:2.5); +} +\end{circuitikz} +\end{LTXexample} +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} +\ctikzset{label/align = rotate} +\def\DIR{0,45,90,135,180,-90,-45,-135} +\foreach \i in \DIR { + \draw (0,0) to[R=\i, *-o] (\i:2.5); +} +\end{circuitikz} +\end{LTXexample} +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} +\ctikzset{label/align = smart} +\def\DIR{0,45,90,135,180,-90,-45,-135} +\foreach \i in \DIR { + \draw (0,0) to[R=\i, *-o] (\i:2.5); +} +\end{circuitikz} +\end{LTXexample} + +\subsection{Currents} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[R, i^>=$i_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[R, i_>=$i_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[R, i^<=$i_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[R, i_<=$i_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[R, i>^=$i_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[R, i>_=$i_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[R, i<^=$i_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[R, i<_=$i_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + +Also + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[R, i<=$i_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[R, i>=$i_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[R, i^=$i_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[R, i_=$i_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + + + +\subsection{Voltages} + +\subsubsection{European style} The default, with arrows. Use option \texttt{europeanvoltage} or style \verb![european voltages]!. + +\begin{LTXexample}[varwidth=true] +\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 voltages] + \draw (0,0) to[R, v^<=$v_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\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 voltages] + \draw (0,0) to[R, v_<=$v_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + +\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 voltages] + \draw (0,0) to[R, v^>=$v_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\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 voltages] + \draw (0,0) to[R, v_>=$v_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz}[american voltages] + \draw (0,0) to[R, v_<=$v_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + + + +\subsection{Nodes} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[R, o-o] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[R, -o] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[R, o-] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[R, *-*] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[R, -*] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[R, *-] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[R, o-*] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[R, *-o] (2,0); +\end{circuitikz} +\end{LTXexample} + + +\subsection{Special components} + +For some components label, current and voltage behave as one would expect: + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[I=$a_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[I, i=$a_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[cI=$k\cdot a_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[sI=$a_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[csI=$k\cdot a_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + +The following results from using the option \texttt{americancurrent} or using the style \verb![american currents]!. + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz}[american currents] + \draw (0,0) to[I=$a_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\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 currents] + \draw (0,0) to[cI=$k\cdot a_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz}[american currents] + \draw (0,0) to[sI=$a_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz}[american currents] + \draw (0,0) to[csI=$k\cdot a_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + +The same holds for voltage sources: + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[V=$a_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[V, v=$a_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[cV=$k\cdot a_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[sV=$a_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[csV=$k\cdot a_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + +The following results from using the option \texttt{americanvoltage} or the style \verb![american voltages]!. + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz}[american voltages] + \draw (0,0) to[V=$a_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\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 voltages] + \draw (0,0) to[cV=$k\cdot a_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz}[american voltages] + \draw (0,0) to[sV=$a_1$] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\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 (and \emph{not} in \ConTeXt), then the following are equivalent: + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[R, l=1<\kilo\ohm>] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[R, l=$\SI{1}{\kilo\ohm}$] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[R, i=1<\milli\ampere>] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[R, i=$\SI{1}{\milli\ampere}$] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[R, v=1<\volt>] (2,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[R, v=$\SI{1}{\volt}$] (2,0); +\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} + \draw (0,0) to[R=1<\kilo\ohm>, + i>_=1<\milli\ampere>, o-*] (3,0); +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,0) to[D*, v=$v_D$, + i=1<\milli\ampere>, o-*] (3,0); +\end{circuitikz} +\end{LTXexample} + + + +\section{Not only bipoles} + +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] +\begin{circuitikz} +\draw (0,0) node[npn](npn) at (0,0) {}; +\draw (npn.C) --++(0,0.5) node[vcc]{+5\,\textnormal{V}}; +\draw (npn.E) --++(0,-0.5) node[vee]{-5\,\textnormal{V}}; +\end{circuitikz} +\end{LTXexample} + +\subsection{Anchors} + +In order to allow connections with other components, all components define anchors. + +\subsubsection{Logical ports} All logical ports, except \textsc{not}, have two inputs and one output. They are called respectively \texttt{in 1}, \texttt{in 2}, \texttt{out}: + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} \draw + (0,0) node[and port] (myand) {} + (myand.in 1) node[anchor=east] {1} + (myand.in 2) node[anchor=east] {2} + (myand.out) node[anchor=west] {3} +;\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} \draw + (0,2) node[and port] (myand1) {} + (0,0) node[and port] (myand2) {} + (2,1) node[xnor port] (myxnor) {} + (myand1.out) -| (myxnor.in 1) + (myand2.out) -| (myxnor.in 2) +;\end{circuitikz} +\end{LTXexample} + +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 + (1,0) node[not port] (not1) {} + (3,0) node[not port] (not2) {} + (0,0) -- (not1.in) + (not2.in) -- (not1.out) + ++(0,-1) node[ground] {} to[C] (not1.out) + (not2.out) -| (4,1) -| (0,0) +;\end{circuitikz} +\end{LTXexample} + +\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 + (0,0) node[nmos] (mos) {} + (mos.base) node[anchor=west] {B} + (mos.gate) node[anchor=east] {G} + (mos.drain) node[anchor=south] {D} + (mos.source) node[anchor=north] {S} +;\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} \draw + (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} + +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 + (0,0) node[npn] (npn) {} + (npn.base) node[anchor=east] {B} + (npn.collector) node[anchor=south] {C} + (npn.emitter) node[anchor=north] {E} +;\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} \draw + (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} + +Here is one composite example (please notice that the \texttt{xscale=-1} style would also reflect the label of the transistors, so here a new node is added and its text is used, instead of that of \texttt{pnp1}): + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} \draw + (0,0) node[pnp] (pnp2) {2} + (pnp2.B) node[pnp, xscale=-1, anchor=B] (pnp1) {} + (pnp1) node {1} + (pnp1.C) node[npn, anchor=C] (npn1) {} + (pnp2.C) node[npn, xscale=-1, anchor=C] (npn2) {} + (pnp1.E) -- (pnp2.E) (npn1.E) -- (npn2.E) + (pnp1.B) node[circ] {} |- (pnp2.C) node[circ] {} +;\end{circuitikz} +\end{LTXexample} + +Similarly, transistors and other components 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} + +\begin{LTXexample} + \begin{circuitikz} + \draw (0,2) + node[rground, yscale=-1] {} + to[R=$R_1$] (0,0) + node[sground] {}; + \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} + +As for the switches: +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} \draw + (0,0) node[spdt] (Sw) {} + (Sw.in) node[left] {in} + (Sw.out 1) node[right] {out 1} + (Sw.out 2) node[right] {out 2} +;\end{circuitikz} +\end{LTXexample} +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} \draw + (0,0) to[C] (1,0) to[toggle switch , n=Sw] (2.5,0) + -- (2.5,-1) to[battery1] (1.5,-1) to[R] (0,-1) -| (0,0) + (Sw.out 2) -| (2.5, 1) to[R] (0,1) -- (0,0) +;\end{circuitikz} +\end{LTXexample} + +And the mixer: +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} \draw + (0,0) node[mixer] (mix) {} + (mix.in 1) node[left] {in 1} + (mix.in 2) node[below] {in 2} + (mix.out) node[right] {out} +;\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 + (0,0) node[op amp] (opamp) {} + (opamp.+) node[left] {$v_+$} + (opamp.-) node[left] {$v_-$} + (opamp.out) node[right] {$v_o$} +;\end{circuitikz} +\end{LTXexample} + +There are also two more anchors defined, \texttt{up} and \texttt{down}, for the power supplies: +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} \draw + (0,0) node[op amp] (opamp) {} + (opamp.+) node[left] {$v_+$} + (opamp.-) node[left] {$v_-$} + (opamp.out) node[right] {$v_o$} + (opamp.down) node[ground] {} + (opamp.up) ++ (0,.5) node[above] {\SI{12}{\volt}} + -- (opamp.up) +;\end{circuitikz} +\end{LTXexample} + +The fully differential op amp defines two outputs: +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} \draw + (0,0) node[fd op amp] (opamp) {} + (opamp.+) node[left] {$v_+$} + (opamp.-) node[left] {$v_-$} + (opamp.out +) node[right] {out +} + (opamp.out -) node[right] {out -} + (opamp.down) node[ground] {} +;\end{circuitikz} +\end{LTXexample} + + +The circulator defined ports 1, 2 and 3: +\begin{LTXexample}[varwidth=true] + \begin{circuitikz} \draw + (0,0) node[circulator] (c) {} + (c.1) node[left] {\texttt{1}} + (c.2) node[right] {\texttt{2}} + (c.3) node[below] {\texttt{3}} + ; + \end{circuitikz} +\end{LTXexample} + +The Wilkinson divider has: + \begin{LTXexample}[varwidth=true] + \begin{circuitikz} \draw + (0,0) node[wilkinson] (w) {\SI{3}{dB}} + (w.in) to[short,-o] ++(-0.5,0) + (w.out1) to[short,-o] ++(0.5,0) + (w.out2) to[short,-o] ++(0.5,0) + (w.in) node[below left] {\texttt{in}} + (w.out1) node[below right] {\texttt{out1}} + (w.out2) node[above right] {\texttt{out2}} + ; + \end{circuitikz} +\end{LTXexample} + +\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] +\begin{circuitikz} \draw + (0,0) node[transformer] (T) {} + (T.A1) node[anchor=east] {A1} + (T.A2) node[anchor=east] {A2} + (T.B1) node[anchor=west] {B1} + (T.B2) node[anchor=west] {B2} + (T.base) node{K} +;\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} \draw + (0,0) node[gyrator] (G) {} + (G.A1) node[anchor=east] {A1} + (G.A2) node[anchor=east] {A2} + (G.B1) node[anchor=west] {B1} + (G.B2) node[anchor=west] {B2} + (G.base) node{K} +;\end{circuitikz} +\end{LTXexample} + +However: +\begin{LTXexample}[varwidth=true] + \begin{circuitikz} \draw + (0,0) node[coupler] (c) {\SI{10}{dB}} + (c.1) to[short,-o] ++(-0.5,0) + (c.2) to[short,-o] ++(0.5,0) + (c.3) to[short,-o] ++(0.5,0) + (c.4) to[short,-o] ++(-0.5,0) + (c.1) node[below left] {\texttt{1}} + (c.2) node[below right] {\texttt{2}} + (c.3) node[above right] {\texttt{3}} + (c.4) node[above left] {\texttt{4}} + ; + \end{circuitikz} + \end{LTXexample} + + \begin{LTXexample}[varwidth=true] + \begin{circuitikz} \draw + (0,0) node[coupler2] (c) {\SI{3}{dB}} + (c.1) to[short,-o] ++(-0.5,0) + (c.2) to[short,-o] ++(0.5,0) + (c.3) to[short,-o] ++(0.5,0) + (c.4) to[short,-o] ++(-0.5,0) + (c.1) node[below left] {\texttt{1}} + (c.2) node[below right] {\texttt{2}} + (c.3) node[above right] {\texttt{3}} + (c.4) node[above left] {\texttt{4}} + ; + \end{circuitikz} +\end{LTXexample} + + +\subsection{Input arrows} +\subsubsection*{two ports} +The new two ports all have a defined direction. If one needs opposite direction, just place them from right to left. With the option \texttt{>} a input arrow is drawn: +\begin{LTXexample}[varwidth=true] + \begin{circuitikz} \draw + (0,0) to[short,o-] ++(0.3,0) + to[lowpass,>] ++(2,0) + to[adc,>] ++(2,0) + to[fft,>] ++(2,0) + to[short,-o] ++(0.3,0); + \end{circuitikz} +\end{LTXexample} + +\subsubsection*{multi ports} +Since inputs and outputs can vary, input arrows can be placed as nodes: +\begin{LTXexample}[varwidth=true] + \begin{circuitikz} \draw + (0,0) node[mixer] (m) {} + (m.in1) to[short,-o] ++(-1,0) + (m.in2) to[short,-o] ++(0,-1) + (m.out) to[short,-o] ++(1,0) + (m.in1) node[inputarrow] {} + (m.in2) node[inputarrow,rotate=90] {}; + \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} + +Pretty much all Circui\TikZ\ relies heavily on \texttt{pgfkeys} for value handling and configuration. Indeed, at the beginning of \texttt{circuitikz.sty} a series of key definitions can be found that modify all the graphical characteristics of the package. + +All can be varied using the \verb!\ctikzset! command, anywhere in the code. + +\paragraph{Shape of the components} (on a per-component-class basis) +\begin{LTXexample}[varwidth=true] +\tikz \draw (0,0) to[R=1<\ohm>] (2,0); \par +\ctikzset{bipoles/resistor/height=.6} +\tikz \draw (0,0) to[R=1<\ohm>] (2,0); +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\tikz \draw (0,0) node[nand port] {}; \par +\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} + +\paragraph{Thickness of the lines} (globally) +\begin{LTXexample}[varwidth=true] +\tikz \draw (0,0) to[C=1<\farad>] (2,0); \par +\ctikzset{bipoles/thickness=1} +\tikz \draw (0,0) to[C=1<\farad>] (2,0); +\end{LTXexample} + + +\paragraph{Global properties} Of voltage and current +\begin{LTXexample}[varwidth=true] +\tikz \draw (0,0) to[R, v=1<\volt>] (2,0); \par +\ctikzset{voltage/distance from node=.1} +\tikz \draw (0,0) to[R, v=1<\volt>] (2,0); +\end{LTXexample} + +\begin{LTXexample}[varwidth=true] +\tikz \draw (0,0) to[C, i=$\imath$] (2,0); \par +\ctikzset{current/distance = .2} +\tikz \draw (0,0) to[C, i=$\imath$] (2,0); +\end{LTXexample} + +\noindent However, you can override the properties \verb!voltage/distance from node!\footnote{That is, how distant from the initial and final points of the path the arrow starts and ends.}, \verb!voltage/bump b!\footnote{Controlling how high the bump of the arrow is --- how curved it is.} and \verb!voltage/european label distance!\footnote{Controlling how distant from the bipole the voltage label will be.} on a per-component basis, in order to fine-tune the voltages: + +\begin{LTXexample}[varwidth=true] +\tikz \draw (0,0) to[R, v=1<\volt>] (1.5,0) + to[C, v=2<\volt>] (3,0); \par +\ctikzset{bipoles/capacitor/voltage/% + distance from node/.initial=.7} +\tikz \draw (0,0) to[R, v=1<\volt>] (1.5,0) + to[C, v=2<\volt>] (3,0); \par +\end{LTXexample} + +\noindent 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/american xnor port/aaa=.2} +\ctikzset{tripoles/american xnor port/bbb=.6} +\tikz \draw (0,0) node[xnor port] {}; +\end{LTXexample} + +\subsection{Components size} +Perhaps the most important parameter is \verb!\circuitikzbasekey/bipoles/length!, which +can be interpreted as the length of a resistor (including reasonable connections): all other lenghts are relative to this value. For instance: + +\begin{LTXexample}[pos=t,varwidth=true] +\ctikzset{bipoles/length=1.4cm} +\begin{circuitikz}[scale=1.2]\draw + (0,0) node[anchor=east] {B} + to[short, o-*] (1,0) + to[R=20<\ohm>, *-*] (1,2) + to[R=10<\ohm>, v=$v_x$] (3,2) -- (4,2) + to[cI=$\frac{\si{\siemens}}{5} v_x$, *-*] (4,0) -- (3,0) + to[R=5<\ohm>, *-*] (3,2) + (3,0) -- (1,0) + (1,2) to[short, -o] (0,2) node[anchor=east]{A} +;\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[pos=t,varwidth=true] +\ctikzset{bipoles/length=.8cm} +\begin{circuitikz}[scale=1.2]\draw + (0,0) node[anchor=east] {B} + to[short, o-*] (1,0) + to[R=20<\ohm>, *-*] (1,2) + to[R=10<\ohm>, v=$v_x$] (3,2) -- (4,2) + to[cI=$\frac{\siemens}{5} v_x$, *-*] (4,0) -- (3,0) + to[R=5<\ohm>, *-*] (3,2) + (3,0) -- (1,0) + (1,2) to[short, -o] (0,2) node[anchor=east]{A} +;\end{circuitikz} +\end{LTXexample} + +\subsection{Colors} + +The color of the components is stored in the key \verb!\circuitikzbasekey/color!. Circui\TikZ\ tries to follow the color set in \TikZ, although sometimes it fails. If you change color in the picture, please do not use just the color name as a style, like \verb![red]!, but rather assign the style \verb![color=red]!. + +Compare for instance +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} \draw[red] + (0,2) node[and port] (myand1) {} + (0,0) node[and port] (myand2) {} + (2,1) node[xnor port] (myxnor) {} + (myand1.out) -| (myxnor.in 1) + (myand2.out) -| (myxnor.in 2) +;\end{circuitikz} +\end{LTXexample} + +and + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} \draw[color=red] + (0,2) node[and port] (myand1) {} + (0,0) node[and port] (myand2) {} + (2,1) node[xnor port] (myxnor) {} + (myand1.out) -| (myxnor.in 1) + (myand2.out) -| (myxnor.in 2) +;\end{circuitikz} +\end{LTXexample} + +One can of course change the color \emph{in medias res}: +\begin{LTXexample}[pos=t, varwidth=true] +\begin{circuitikz} \draw + (0,0) node[pnp, color=blue] (pnp2) {} + (pnp2.B) node[pnp, xscale=-1, anchor=B, color=brown] (pnp1) {} + (pnp1.C) node[npn, anchor=C, color=green] (npn1) {} + (pnp2.C) node[npn, xscale=-1, anchor=C, color=magenta] (npn2) {} + (pnp1.E) -- (pnp2.E) (npn1.E) -- (npn2.E) + (pnp1.B) node[circ] {} |- (pnp2.C) node[circ] {} +;\end{circuitikz} +\end{LTXexample} + +The all-in-one stream of bipoles poses some challanges, as only the actual body of the bipole, and not the connecting lines, will be rendered in the specified color. Also, please notice the curly braces around the \texttt{to}: +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} \draw + (0,0) to[V=1<\volt>] (0,2) + { to[R=1<\ohm>, color=red] (2,2) } + to[C=1<\farad>] (2,0) -- (0,0) +;\end{circuitikz} +\end{LTXexample} + +Which, for some bipoles, can be frustrating: +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} \draw + (0,0){to[V=1<\volt>, color=red] (0,2) } + to[R=1<\ohm>] (2,2) + to[C=1<\farad>] (2,0) -- (0,0) +;\end{circuitikz} +\end{LTXexample} + +The only way out is to specify different paths: +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} \draw[color=red] + (0,0) to[V=1<\volt>, color=red] (0,2); + \draw (0,2) to[R=1<\ohm>] (2,2) + to[C=1<\farad>] (2,0) -- (0,0) +;\end{circuitikz} +\end{LTXexample} + +And yes: this is a bug and \emph{not} a feature\ldots + +\section{FAQ} + +\noindent Q: When using \verb!\tikzexternalize! I get the following error: +\begin{verbatim} + ! Emergency stop. +\end{verbatim} + +\noindent A: The \TikZ\ manual states: +\begin{quotation} +Furthermore, the library assumes that all \LaTeX\ pictures are ended + with \verb!\end{tikzpicture}!. +\end{quotation} + +Just substitute every occurrence of the environment \verb!circuitikz! with \verb!tikzpicture!. They are actually pretty much the same. + +\bigskip + +\noindent Q: How do I draw the voltage between two nodes? + +\noindent A: Between any two nodes there is an open circuit! +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} \draw + node[ocirc] (A) at (0,0) {} + node[ocirc] (B) at (2,1) {} + (A) to[open, v=$v$] (B) +;\end{circuitikz} +\end{LTXexample} + +\bigskip + +\noindent Q: I cannot write \verb!to[R = $R_1=12V$]! nor \verb!to[ospst = open, 3s]!: I get errors. + +\noindent A: It is a limitation of the \TikZ\ parser. Use \verb!to[R = $R_1{=}12V$]! and \verb!to[ospst = open{,} 3s]! instead. + + +\section{Examples} +\begin{LTXexample}[pos=t,varwidth=true] +\begin{circuitikz}[scale=1.4]\draw + (0,0) to[C, l=10<\micro\farad>] (0,2) -- (0,3) + to[R, l=2.2<\kilo\ohm>] (4,3) -- (4,2) + to[L, l=12<\milli\henry>, i=$i_1$] (4,0) -- (0,0) + (4,2) { to[D*, *-*, color=red] (2,0) } + (0,2) to[R, l=1<\kilo\ohm>, *-] (2,2) + to[cV, v=$\SI{.3}{\kilo\ohm} i_1$] (4,2) + (2,0) to[I, i=1<\milli\ampere>, -*] (2,2) +;\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[pos=t,varwidth=true] +\begin{circuitikz}[scale=1.2]\draw + (0,0) node[ground] {} + to[V=$e(t)$, *-*] (0,2) to[C=4<\nano\farad>] (2,2) + to[R, l_=.25<\kilo\ohm>, *-*] (2,0) + (2,2) to[R=1<\kilo\ohm>] (4,2) + to[C, l_=2<\nano\farad>, *-*] (4,0) + (5,0) to[I, i_=$a(t)$, -*] (5,2) -- (4,2) + (0,0) -- (5,0) + (0,2) -- (0,3) to[L, l=2<\milli\henry>] (5,3) -- (5,2) + + {[anchor=south east] (0,2) node {1} (2,2) node {2} (4,2) node {3}} +;\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[pos=t,varwidth=true] +\begin{circuitikz}[scale=1.2]\draw + (0,0) node[anchor=east] {B} + to[short, o-*] (1,0) + to[R=20<\ohm>, *-*] (1,2) + to[R=10<\ohm>, v=$v_x$] (3,2) -- (4,2) + to[cI=$\frac{\siemens}{5} v_x$, *-*] (4,0) -- (3,0) + to[R=5<\ohm>, *-*] (3,2) + (3,0) -- (1,0) + (1,2) to[short, -o] (0,2) node[anchor=east]{A} +;\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[pos=t,varwidth=true] +\begin{circuitikz}[scale=1]\draw + (0,0) node[transformer] (T) {} + (T.B2) to[pD] ($(T.B2)+(2,0)$) -| (3.5, -1) + (T.B1) to[pD] ($(T.B1)+(2,0)$) -| (3.5, -1) +;\end{circuitikz} +\end{LTXexample} + + +\begin{LTXexample}[pos=t,varwidth=true] +\begin{circuitikz}[scale=1]\draw + (5,.5) node [op amp] (opamp) {} + (0,0) node [left] {$U_{we}$} to [R, l=$R_d$, o-*] (2,0) + to [R, l=$R_d$, *-*] (opamp.+) + to [C, l_=$C_{d2}$, *-] ($(opamp.+)+(0,-2)$) node [ground] {} + (opamp.out) |- (3.5,2) to [C, l_=$C_{d1}$, *-] (2,2) to [short] (2,0) + (opamp.-) -| (3.5,2) + (opamp.out) to [short, *-o] (7,.5) node [right] {$U_{wy}$} +;\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[pos=t,varwidth=true] +\begin{circuitikz}[scale=1.2, american]\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); + + \begin{scope}[xshift=6.5cm, yshift=.5cm] + \draw [->] (-2,0) -- (2.5,0) node[anchor=west] {$v_1/\volt$}; + \draw [->] (0,-2) -- (0,2) node[anchor=west] {$i_1/\SI{}{\milli\ampere}$} ; + \draw (-1,0) node[anchor=north] {-2} (1,0) node[anchor=south] {2} + (0,1) node[anchor=west] {4} (0,-1) node[anchor=east] {-4} + (2,0) node[anchor=north west] {4} + (-1.5,0) node[anchor=south east] {-3}; + \draw [thick] (-2,-1) -- (-1,1) -- (1,-1) -- (2,0) -- (2.5,.5); + \draw [dotted] (-1,1) -- (-1,0) (1,-1) -- (1,0) + (-1,1) -- (0,1) (1,-1) -- (0,-1); + \end{scope} +\end{circuitikz} +\end{LTXexample} + +\begin{LTXexample}[pos=t,varwidth=true] + \begin{circuitikz}[scale=1] + \ctikzset{bipoles/detector/width=.35} + \ctikzset{quadpoles/coupler/width=1} + \ctikzset{quadpoles/coupler/height=1} + \ctikzset{tripoles/wilkinson/width=1} + \ctikzset{tripoles/wilkinson/height=1} + %\draw[help lines,red,thin,dotted] (0,-5) grid (5,5); + \draw + (-2,0) node[wilkinson](w1){} + (2,0) node[coupler] (c1) {} + (0,2) node[coupler,rotate=90] (c2) {} + (0,-2) node[coupler,rotate=90] (c3) {} + (w1.out1) .. controls ++(0.8,0) and ++(0,0.8) .. (c3.3) + (w1.out2) .. controls ++(0.8,0) and ++(0,-0.8) .. (c2.4) + (c1.1) .. controls ++(-0.8,0) and ++(0,0.8) .. (c3.2) + (c1.4) .. controls ++(-0.8,0) and ++(0,-0.8) .. (c2.1) + (w1.in) to[short,-o] ++(-1,0) + (w1.in) node[left=30] {LO} + (c1.2) node[match,yscale=1] {} + (c1.3) to[short,-o] ++(1,0) + (c1.3) node[right=30] {RF} + (c2.3) to[detector,-o] ++(0,1.5) + (c2.2) to[detector,-o] ++(0,1.5) + (c3.1) to[detector,-o] ++(0,-1.5) + (c3.4) to[detector,-o] ++(0,-1.5) + ; + \end{circuitikz} +\end{LTXexample} + + +\begin{tabular}{l}\label{ex:compatibility} + \fbox{\includegraphics{compatibility.pdf}} + \\ + \begin{lstlisting} +\documentclass{standalone} + +\usepackage{tikz} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{positioning} + +\usepackage[compatibility]{circuitikz} +\ctikzset{bipoles/length=.9cm} + +\begin{document} + \begin{tikzpicture}[circuit ee IEC] + \draw (0,0) to [resistor={name=R}] (0,2) + to[diode={name=D}] (3,2); + \draw (0,0) to[*R=$R_1$] (1.5,0) to[*Tnpn] (3,0) + to[*D](3,2); + \end{tikzpicture} +\end{document} + \end{lstlisting} +\end{tabular} + +\section{Revision history} + +\begin{itemize} + \item[\itshape version 0.4] (in progress) + \begin{enumerate} + \item minor improvements to documentation + \item comply with TDS + \item merge high frequency symbols by Stefan Erhardt + \item added switch (not opening nor closing) + \item added added solder dot in some transistors + \item improved ConTeXt compatibility + \end{enumerate} +\item[\itshape version 0.3.1] + \begin{enumerate} + \item typo in documentation + \item fixed an error in the angle computation in voltage and current routines + \item fixed problem with label size when scaling a tikz picture + \item added gas filled surge arrester + \item added compatibility option to work with Tikz's own circuit library + \end{enumerate} +\item[\itshape version 0.3.0] (20121229) + \begin{enumerate} + \item fixed gate node for a few transistors + \item added mixer + \item added fully differential op amp (by Kristofer M.~Monisit) + \item now general settings for the drawing of voltage can be overridden for specific components + \item made arrows more homogeneous (either the current/voltage one, or latex' by pgf) + \item added the single battery cell + \item added fuse and asymmetric fuse + \item added toggle switch + \item added varistor, photoresistor, thermocouple, push button + \item added thermistor, thermistor ptc, thermistor ptc + \item fixed misalignment of voltage label in vertical bipoles with names + \item added isfet + \item added noiseless, protective, chassis, signal and reference grounds (Luigi Luigi «Liverpool») + \end{enumerate} +\item[\itshape version 0.2.4] (20110911). + \begin{enumerate} + \item added square voltage source (contributed by Alistair Kwan) + \item added buffer and plain amplifier (contributed by Danilo Piazzalunga) + \item added squid and barrier (contributed by Cor Molenaar) + \item added antenna and transmission line symbols contributed by Leonardo Azzinnari + \item added the changeover switch spdt (suggestion of Fabio Maria Antoniali) + \item rename of context.tex and context.pdf (thanks to Karl Berry) + \item updated the email address + \item in documentation, fixed wrong (non-standard) labelling of the axis in an example (thanks to prof. Claudio Beccaria) + \item fixed scaling inconsistencies in quadrupoles + \item fixed division by zero error on certain vertical paths + \item introduced options straighlabels, rotatelabels, smartlabels + \end{enumerate} +\item[\itshape version 0.2.3] (20091118). + \begin{enumerate} + \item fixed compatibility problem with label option from tikz + \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. + \item Added options \texttt{europeanresistor}, \texttt{europeaninductor}, \texttt{americanresistor} and \texttt{americaninductor}, with corresponding styles. + \item \textbf{Fixed}: error in transistor arrow positioning and direction under negative \texttt{xscale} and \texttt{yscale}. + \end{enumerate} + + +\item[\itshape version 0.2.1] (20090503). + \begin{enumerate} + \item Op-amps added. + \item Added options \texttt{arrowmos} and \texttt{noarrowmos}. + \end{enumerate} + + +\item[\itshape version 0.2] First public release on CTAN (20090417). + \begin{enumerate} + \item \textbf{Backward incompatibility}: labels ending with \texttt{:}\textit{angle} are not parsed for positioning anymore. + \item Full use of \TikZ\ keyval features. + \item White background is not filled anymore: now the network can be drawn on a background picture as well. + \item Several new components added (logical ports, transistors, double bipoles, \ldots). + \item Color support. + \item Integration with {\ttfamily siunitx}. + \item Voltage, american style. + \item Better code, perhaps. General cleanup at the very least. + \end{enumerate} +\item[\itshape version 0.1] First public release (2007). +\end{itemize} + + +\printindex + + +\end{document} + + + diff --git a/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.pdf b/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.pdf index 98e580d26e6..d88e58e7101 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 deleted file mode 100644 index 5a939f0ce99..00000000000 --- a/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.tex +++ /dev/null @@ -1,1698 +0,0 @@ -\documentclass[a4paper]{article} - -\usepackage{fontspec} -\defaultfontfeatures{Ligatures=TeX, Numbers=OldStyle, SmallCapsFeatures={LetterSpace=8, Numbers=OldStyle}} - -\setmainfont -% {Linux Libertine} - {Gentium Book Basic} - -\usepackage{microtype} - -\usepackage[siunitx]{circuitikz} -\sisetup{load=derived} % loading \siemens -\usepackage{showexpl} -\usepackage{framed} -\usepackage{hyperref} -\hypersetup{ - bookmarks=false, % show bookmarks bar? - pdftitle={CircuitTikZ v. \pgfcircversion\ - manual}, % title - pdfauthor={Massimo Redaelli}, % author - pdfsubject={CircuitTikZ manual}, % subject of the document - pdfkeywords={}, % list of keywords - colorlinks=true, % false: boxed links; true: colored links - linkcolor=black, % color of internal links - citecolor=black, % color of links to bibliography - filecolor=black, % color of file links - urlcolor=black % color of external links -} -\usepackage{imakeidx} -\makeindex[title=Index of the components, intoc=true] - -\def\circuititem#1#2#3{\item {#2} (\texttt{#1}) \index{#1} \par \begin{center}\begin{circuitikz} \draw (0,0) node[#1] {}; \end{circuitikz} \end{center} -\par} - -\newcommand{\circuititembip}[3]{\item {#2} \index{#1} -\tikz\foreach \i in {#3} {\index{\i|see{#1}} }; (\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} - -\usepackage{marvosym} -\newcommand{\email}[2][]{\def\temp{#1}\ifx\temp\empty\Email~\fi\href{mailto:#2}{#2}} - -\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{\Circuitikz \\{\large version \pgfcircversion}} -\author{Massimo A. Redaelli} -\date{\today} - -\maketitle - -\tableofcontents - -\section{Introduction} -After two years of little exposure only on my personal website\footnote{Now the package is moved to its own git repository: \url{https://github.com/mredaelli/circuitikz}. Contributions are welcome.}, I did a major rehauling of the code of Circui\TikZ, fixing several problems and converting everything to \TikZ\ version $2.0$. - -I'm not too sure about the result, because my (La)\TeX\ skills are much to be improved, but it seems it's time for more user feedback. So, here it is\ldots - -\medskip - -I know the documentation is somewhat scant. Hope to have time to improve it a bit. - -\subsection{About} -This package provides a set of macros for naturally typesetting electrical and (somewhat less naturally, perhaps) electronical networks. - -It was born mainly for writing my own exercise book and exams sheets for the Elettrotecnica courses at Politecnico di Milano, Italy. I wanted a tool that was easy to use, with a lean syntax, native to \LaTeX, and supporting directly PDF output format. - -So I based everything with the very impressive (if somewhat verbose at times) \TikZ\ package. - -\subsection{Loading the package} -\verb!\usepackage{circuitikz}! - -\TikZ\ will be automatically loaded. - -\subsection{License} -Copyright \copyright\ 2007--2011 Massimo Redaelli. This package is author-maintained. -Permission is granted to copy, distribute and/or modify this software under the -terms of the \LaTeX Project Public License, version 1.3.1, or the GNU Public License. This software is provided ‘as is’, without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a -particular purpose. - -\subsection{Feedback} -Much appreciated: \email{mailto:m.redaelli@gmail.com}. Although I don't guarantee quick answers. - -\subsection{Requirements} -\begin{itemize} - \item \texttt{tikz}, version $\ge 2$; - \item \texttt{xstring}, not older than 2009/03/13; - \item \texttt{siunitx}, if using \texttt{siunitx} option. -\end{itemize} - -\subsection{Incompatible packages} - -None, as far as I know. - -\subsection{Introduction to version 0.3.0} - -Probably nobody is hoping or caring for a new version of the package at this point, seeing how long it took me for this next release. But here it is, fixing a big problem (voltage labels in the wrong place, in some cases) and adding several components. - -Thanks for bug reporting and suggesting improvements. - -\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{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{fulldiodes}: the various diodes are drawn \emph{and} filled by default, i.e. when using styles such as \texttt{diode}, \texttt{D}, \texttt{sD}, \ldots Un-filled diode can always be forced with \texttt{Do}, \texttt{sDo}, \ldots - \item \texttt{emptydiodes}: the various diodes are drawn \emph{but not} filled by default, i.e. when using styles such as \texttt{diode}, \texttt{D}, \texttt{sD}, \ldots Filled diode can always be forced with \texttt{D*}, \texttt{sD*}, \ldots - \item \texttt{arrowmos}: pmos and nmos have arrows analogous to those of pnp and npn transistors; - \item \texttt{noarrowmos}: pmos and nmos do not have arrows analogous to those of pnp and npn transistors; - \item \texttt{straighlabels}: labels on bipoles are always printed straigh up, i.e.~with horizontal baseline; - \item \texttt{rotatelabels}: labels on bipoles are always printed aligned along the bipole; - \item \texttt{smartlabels}: labels on bipoles are rotated along the bipoles, unless the rotation is very close to multiples of 90°. -\end{itemize} - -The old options in the singular (like \texttt{american voltage}) are still available for compatibility, but are discouraged. - -\medskip - -Loading the package with no options is equivalent to my own personal liking, that is to the following options:\\ - \texttt{[europeancurrents, europeanvoltages, americanresistors, cuteinductors, americanports, nosiunitx, noarrowmos, smartlabels]}. - -\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} - -Here follows the list of all the shapes defined by Circui\TikZ. These are all \texttt{pgf} nodes, so they are usable in both \texttt{pgf} and \TikZ. - -\medskip - -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 - (0,0) to[ #1 ] (2,0) -; \end{circuitikz} \end{center} -\end{verbatim} - -The other shapes are shown with: -\begin{verbatim} -\begin{center}\begin{circuitikz} \draw - (0,0) node[ #1 ] {} -; \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}. - -\begin{framed} - If using the \verb!\tikzexternalize! feature, as of Ti\emph{k}z 2.1 all pictures must end with \verb!\end{tikzpicture}!. Thus you \emph{cannot} use the \verb!circuitikz! environment. - - Which is ok: just use \verb!tikzpicture!: everything will work there just fine. -\end{framed} - -\subsection{Monopoles} -\begin{itemize} - \circuititem{ground}{Ground}{} - \circuititem{rground}{Reference ground}{} - \circuititem{sground}{Signal ground}{} - \circuititem{nground}{Noiseless ground}{} - \circuititem{pground}{Protective ground}{} - \circuititem{cground}{Chassis ground\footnote{These last three were contributed by Luigi «Liverpool»)}}{} - \circuititem{antenna}{Antenna}{} - \circuititem{rxantenna}{Transmitting antenna}{} - \circuititem{txantenna}{Receiving antenna}{} - \circuititem{tlinestub}{Transmission line stub}{} -\end{itemize} - - -\subsection{Bipoles} - -\subsubsection{Instruments} -\begin{itemize} - \circuititembip{ammeter}{Ammeter}{} - \circuititembip{voltmeter}{Voltmeter}{} -\end{itemize} - -\subsubsection{Basic resistive bipoles} -\begin{itemize} - \circuititembip{short}{Short circuit}{} - \circuititembip{open}{Open circuit}{} - - \circuititembip{lamp}{Lamp}{} - \circuititembip{generic}{Generic (symmetric) bipole}{} - \circuititembip{tgeneric}{Tunable generic bipole}{} - \circuititembip{ageneric}{Generic asymmetric bipole}{} - \circuititembip{fullgeneric}{Generic asymmetric bipole (full)}{} - \circuititembip{tfullgeneric}{Tunable generic bipole (full)}{} - \circuititembip{memristor}{Memristor}{Mr} -\end{itemize} - -\subsubsection{Resistors and the like} - -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{resistor=american} - \circuititembip{R}{Resistor}{american resistor} - \circuititembip{vR}{Variable resistor}{american variable resistor} - \circuititembip{pR}{Potentiometer}{american potentiometer} -\end{itemize} - -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{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} - -Other miscellaneous resistor-like devices: -\begin{itemize} - \circuititembip{varistor}{Varistor}{} - \circuititembip{phR}{Photoresistor}{photoresistor} - \circuititembip{thermocouple}{Thermocouple}{} - \circuititembip{thR}{Thermistor}{thermistor} - \circuititembip{thRp}{PTC thermistor}{thermistor ptc} - \circuititembip{thRn}{NTC thermistor}{thermistor ntc} - \circuititembip{fuse}{Fuse}{} - \circuititembip{afuse}{Asymmetric fuse}{asymmetric fuse} -\end{itemize} - -\subsubsection{Stationary sources} -\begin{itemize} - \circuititembip{battery}{Battery}{} - \circuititembip{battery1}{Single battery cell}{} - \circuititembip{european voltage source}{Voltage source (european style)}{} - \circuititembip{american voltage source}{Voltage source (american style)}{} - \circuititembip{european current source}{Current source (european style)}{} - \circuititembip{american current source}{Current source (american style)}{} -\end{itemize} - -\begin{framed} -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}. - -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} - - - -\subsubsection{Diodes and such} -\begin{itemize} - \circuititembip{empty diode}{Empty diode}{Do} - \circuititembip{empty Schottky diode}{Empty Schottky diode}{sDo} - \circuititembip{empty Zener diode}{Empty Zener diode}{zDo} - \circuititembip{empty tunnel diode}{Empty tunnel diode}{tDo} - \circuititembip{empty photodiode}{Empty photodiode}{pDo} - \circuititembip{empty led}{Empty led}{leDo} - \circuititembip{empty varcap}{Empty varcap}{VCo} - \circuititembip{full diode}{Full diode}{D*} - \circuititembip{full Schottky diode}{Full Schottky diode}{sD*} - \circuititembip{full Zener diode}{Full Zener diode}{zD*} - \circuititembip{full tunnel diode}{Full tunnel diode}{tD*} - \circuititembip{full photodiode}{Full photodiode}{pD*} - \circuititembip{full led}{Full led}{leD*} - \circuititembip{full varcap}{Full varcap}{VC*} - \end{itemize} - -\begin{framed} -The options \texttt{fulldiodes} and \texttt{emptydiodes} (and the styles \texttt{[full diodes]} and \texttt{[empty diodes]}) define which shape will be used by abbreviated commands such that \texttt{D}, \texttt{sD}, \texttt{zD}, \texttt{tD}, \texttt{pD}, \texttt{leD}, and \texttt{VC}. -\end{framed} - -\begin{itemize} - \circuititembip{squid}{Squid}{} - \circuititembip{barrier}{Barrier}{} -\end{itemize} - -\subsubsection{Basic dynamical bipoles} -\begin{itemize} - \circuititembip{capacitor}{Capacitor}{C} - \circuititembip{polar capacitor}{Polar capacitor}{pC} - \circuititembip{variable capacitor}{Variable capacitor}{vC} -\end{itemize} - -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{inductor=american} - \circuititembip{L}{Inductor}{american inductor} - \circuititembip{vL}{Variable inductor}{variable american inductor} -\end{itemize} - -Finally, if \texttt{europeaninductors} option is active (or the style \texttt{[european inductors]} is used), the inductors are displayed as follows: -\begin{itemize} - \ctikzset{inductor=european} - \circuititembip{L}{Inductor}{european inductor} - \circuititembip{vL}{Variable inductor}{variable european inductor} -\end{itemize} - -There is also a transmission line: -\begin{itemize} -\circuititembip{TL}{Transmission line}{transmission line, tline} -\end{itemize} - -\subsubsection{Sinusoidal sources} Here because I was asked for them. But how do you distinguish one from the other?! -\begin{itemize} - \circuititembip{sinusoidal voltage source}{Sinusoidal voltage source}{vsourcesin, sV} - \circuititembip{sinusoidal current source}{Sinusoidal current source}{isourcesin, sI} -\end{itemize} - -\subsubsection{Square sources} -\begin{itemize} - \circuititembip{square voltage source}{Square voltage source}{vsourcesquare, sqV} -\end{itemize} -%\begin{framed} -%The options \texttt{europeancurrent} [resp. \texttt{europeanvoltage}] (the default) and \texttt{americancurrent} [resp. \texttt{americanvoltage}] define which sinusoidal current [resp. voltage] source is selected by default when the abbreviated styles \texttt{sinusoidal current source}, \texttt{csourcesin}, \texttt{cI} [resp. \texttt{sinusoidal voltage source}, \texttt{vsourcesin}, \texttt{cV}] are used. - -%One can also use the related styles \texttt{[european currents]} [resp. \texttt{[european voltages]}] and \texttt{[american currents]} [resp. \texttt{[american voltages]}]. -%\end{framed} - -\subsubsection{Switch} -\begin{itemize} - \circuititembip{closing switch}{Closing switch}{cspst} - \circuititembip{opening switch}{Opening switch}{ospst} - \circuititembip{push button}{Push button}{} -\end{itemize} - - - -\subsection{Tripoles} -\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)}{} - \circuititembip{european controlled current source}{Controlled current source (european style)}{} - \circuititembip{american controlled current source}{Controlled current source (american style)}{} -\end{itemize} - -\begin{framed} -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}. - -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} - \circuititembip{controlled sinusoidal voltage source}{Controlled sinusoidal voltage source}{controlled vsourcesin, cvsourcesin, csV} - \circuititembip{controlled sinusoidal current source}{Controlled sinusoidal current source}{controlled isourcesin, cisourcesin, csI} - \end{itemize} - - -\subsubsection{Transistors} -\begin{itemize} - \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}{\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} - -\textsc{isfet} -\begin{itemize} - \circuititem{isfet}{\scshape isfet}{} -\end{itemize} - -\subsubsection{Switch} -\begin{itemize} - \circuititem{spdt}{\scshape spdt}{} - \circuititembip{toggle switch}{Toggle switch}{} -\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} - -\subsubsection{Misc} -\begin{itemize} - \circuititem{mixer}{Mixer}{} -\end{itemize} - -\subsection{Double bipoles} - -Transformers automatically use the inductor shape currently selected. These are the three possibilities: -\begin{itemize} - \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{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{Amplifiers} - -\begin{itemize} - \circuititem{op amp}{Operational amplifier}{} - \circuititem{fd op amp}{Fully differential operational amplifier\footnote{Contributed by Kristofer M. Monisit.}}{} - \circuititem{plain amp}{Plain amplifier}{} - \circuititem{buffer}{Buffer}{} -\end{itemize} - -\subsection{Support shapes} - -\begin{itemize} - \circuititem{currarrow}{Arrows (current and voltage)}{} - \circuititem{circ}{Connected terminal}{} - \circuititem{ocirc}{Unconnected terminal}{} -\end{itemize} - - - -\section{Usage} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[R, l=$R_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[R=$R_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[R, i=$i_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[R, v=$v_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[R=$R_1$, i=$i_1$, v=$v_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[R=$R_1$, i=$i_1$, v=$v_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - - -Long names/styles for the bipoles can be used: -\begin{LTXexample}[varwidth=true] -\begin{circuitikz}\draw - (0,0) to[resistor=1<\kilo\ohm>] (2,0) -;\end{circuitikz} -\end{LTXexample} - -\subsection{Labels} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[R, l^=$R_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[R, l_=$R_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - -\noindent The default orientation of labels is controlled by the options \texttt{smartlabels}, \texttt{rotatelabels} and \texttt{straightlabels} (or the corresponding \texttt{label/align} keys). Here are examples to see the differences: -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} -\ctikzset{label/align = straight} -\def\DIR{0,45,90,135,180,-90,-45,-135} -\foreach \i in \DIR { - \draw (0,0) to[R=\i, *-o] (\i:2.5); -} -\end{circuitikz} -\end{LTXexample} -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} -\ctikzset{label/align = rotate} -\def\DIR{0,45,90,135,180,-90,-45,-135} -\foreach \i in \DIR { - \draw (0,0) to[R=\i, *-o] (\i:2.5); -} -\end{circuitikz} -\end{LTXexample} -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} -\ctikzset{label/align = smart} -\def\DIR{0,45,90,135,180,-90,-45,-135} -\foreach \i in \DIR { - \draw (0,0) to[R=\i, *-o] (\i:2.5); -} -\end{circuitikz} -\end{LTXexample} - -\subsection{Currents} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[R, i^>=$i_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[R, i_>=$i_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[R, i^<=$i_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[R, i_<=$i_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[R, i>^=$i_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[R, i>_=$i_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[R, i<^=$i_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[R, i<_=$i_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - -Also - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[R, i<=$i_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[R, i>=$i_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[R, i^=$i_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[R, i_=$i_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - - - -\subsection{Voltages} - -\subsubsection{European style} The default, with arrows. Use option \texttt{europeanvoltage} or style \verb![european voltages]!. - -\begin{LTXexample}[varwidth=true] -\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 voltages] - \draw (0,0) to[R, v^<=$v_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\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 voltages] - \draw (0,0) to[R, v_<=$v_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - -\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 voltages] - \draw (0,0) to[R, v^>=$v_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\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 voltages] - \draw (0,0) to[R, v_>=$v_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz}[american voltages] - \draw (0,0) to[R, v_<=$v_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - - - -\subsection{Nodes} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[R, o-o] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[R, -o] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[R, o-] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[R, *-*] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[R, -*] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[R, *-] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[R, o-*] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[R, *-o] (2,0); -\end{circuitikz} -\end{LTXexample} - - -\subsection{Special components} - -For some components label, current and voltage behave as one would expect: - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[I=$a_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[I, i=$a_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[cI=$k\cdot a_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[sI=$a_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[csI=$k\cdot a_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - -The following results from using the option \texttt{americancurrent} or using the style \verb![american currents]!. - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz}[american currents] - \draw (0,0) to[I=$a_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\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 currents] - \draw (0,0) to[cI=$k\cdot a_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz}[american currents] - \draw (0,0) to[sI=$a_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz}[american currents] - \draw (0,0) to[csI=$k\cdot a_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - -The same holds for voltage sources: - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[V=$a_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[V, v=$a_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[cV=$k\cdot a_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[sV=$a_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[csV=$k\cdot a_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - -The following results from using the option \texttt{americanvoltage} or the style \verb![american voltages]!. - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz}[american voltages] - \draw (0,0) to[V=$a_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\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 voltages] - \draw (0,0) to[cV=$k\cdot a_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz}[american voltages] - \draw (0,0) to[sV=$a_1$] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\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 (and \emph{not} in \ConTeXt), then the following are equivalent: - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[R, l=1<\kilo\ohm>] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[R, l=$\SI{1}{\kilo\ohm}$] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[R, i=1<\milli\ampere>] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[R, i=$\SI{1}{\milli\ampere}$] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[R, v=1<\volt>] (2,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[R, v=$\SI{1}{\volt}$] (2,0); -\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} - \draw (0,0) to[R=1<\kilo\ohm>, - i>_=1<\milli\ampere>, o-*] (3,0); -\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} - \draw (0,0) to[D*, v=$v_D$, - i=1<\milli\ampere>, o-*] (3,0); -\end{circuitikz} -\end{LTXexample} - - - -\section{Not only bipoles} - -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} - -\subsection{Anchors} - -In order to allow connections with other components, all components define anchors. - -\subsubsection{Logical ports} All logical ports, except \textsc{not}, have two inputs and one output. They are called respectively \texttt{in 1}, \texttt{in 2}, \texttt{out}: - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} \draw - (0,0) node[and port] (myand) {} - (myand.in 1) node[anchor=east] {1} - (myand.in 2) node[anchor=east] {2} - (myand.out) node[anchor=west] {3} -;\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} \draw - (0,2) node[and port] (myand1) {} - (0,0) node[and port] (myand2) {} - (2,1) node[xnor port] (myxnor) {} - (myand1.out) -| (myxnor.in 1) - (myand2.out) -| (myxnor.in 2) -;\end{circuitikz} -\end{LTXexample} - -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 - (1,0) node[not port] (not1) {} - (3,0) node[not port] (not2) {} - (0,0) -- (not1.in) - (not2.in) -- (not1.out) - ++(0,-1) node[ground] {} to[C] (not1.out) - (not2.out) -| (4,1) -| (0,0) -;\end{circuitikz} -\end{LTXexample} - -\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 - (0,0) node[nmos] (mos) {} - (mos.base) node[anchor=west] {B} - (mos.gate) node[anchor=east] {G} - (mos.drain) node[anchor=south] {D} - (mos.source) node[anchor=north] {S} -;\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} \draw - (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} - -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 - (0,0) node[npn] (npn) {} - (npn.base) node[anchor=east] {B} - (npn.collector) node[anchor=south] {C} - (npn.emitter) node[anchor=north] {E} -;\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} \draw - (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} - -Here is one composite example (please notice that the \texttt{xscale=-1} style would also reflect the label of the transistors, so here a new node is added and its text is used, instead of that of \texttt{pnp1}): - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} \draw - (0,0) node[pnp] (pnp2) {2} - (pnp2.B) node[pnp, xscale=-1, anchor=B] (pnp1) {} - (pnp1) node {1} - (pnp1.C) node[npn, anchor=C] (npn1) {} - (pnp2.C) node[npn, xscale=-1, anchor=C] (npn2) {} - (pnp1.E) -- (pnp2.E) (npn1.E) -- (npn2.E) - (pnp1.B) node[circ] {} |- (pnp2.C) node[circ] {} -;\end{circuitikz} -\end{LTXexample} - -Similarly, transistors and other components 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} - -\begin{LTXexample} - \begin{circuitikz} - \draw (0,2) - node[rground, yscale=-1] {} - to[R=$R_1$] (0,0) - node[sground] {}; - \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} - -As for the switches: -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} \draw - (0,0) node[spdt] (Sw) {} - (Sw.in) node[left] {in} - (Sw.out 1) node[right] {out 1} - (Sw.out 2) node[right] {out 2} -;\end{circuitikz} -\end{LTXexample} -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} \draw - (0,0) to[C] (1,0) to[toggle switch , n=Sw] (2.5,0) - -- (2.5,-1) to[battery1] (1.5,-1) to[R] (0,-1) -| (0,0) - (Sw.out 2) -| (2.5, 1) to[R] (0,1) -- (0,0) -;\end{circuitikz} -\end{LTXexample} - -And the mixer: -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} \draw - (0,0) node[mixer] (mix) {} - (mix.in 1) node[left] {in 1} - (mix.in 2) node[below] {in 2} - (mix.out) node[right] {out} -;\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 - (0,0) node[op amp] (opamp) {} - (opamp.+) node[left] {$v_+$} - (opamp.-) node[left] {$v_-$} - (opamp.out) node[right] {$v_o$} -;\end{circuitikz} -\end{LTXexample} - -There are also two more anchors defined, \texttt{up} and \texttt{down}, for the power supplies: -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} \draw - (0,0) node[op amp] (opamp) {} - (opamp.+) node[left] {$v_+$} - (opamp.-) node[left] {$v_-$} - (opamp.out) node[right] {$v_o$} - (opamp.down) node[ground] {} - (opamp.up) ++ (0,.5) node[above] {\SI{12}{\volt}} - -- (opamp.up) -;\end{circuitikz} -\end{LTXexample} - -The fully differential op amp defines two outputs: -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} \draw - (0,0) node[fd op amp] (opamp) {} - (opamp.+) node[left] {$v_+$} - (opamp.-) node[left] {$v_-$} - (opamp.out +) node[right] {out +} - (opamp.out -) node[right] {out -} - (opamp.down) node[ground] {} -;\end{circuitikz} -\end{LTXexample} - -\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] -\begin{circuitikz} \draw - (0,0) node[transformer] (T) {} - (T.A1) node[anchor=east] {A1} - (T.A2) node[anchor=east] {A2} - (T.B1) node[anchor=west] {B1} - (T.B2) node[anchor=west] {B2} - (T.base) node{K} -;\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} \draw - (0,0) node[gyrator] (G) {} - (G.A1) node[anchor=east] {A1} - (G.A2) node[anchor=east] {A2} - (G.B1) node[anchor=west] {B1} - (G.B2) node[anchor=west] {B2} - (G.base) node{K} -;\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} - -Pretty much all Circui\TikZ\ relies heavily on \texttt{pgfkeys} for value handling and configuration. Indeed, at the beginning of \texttt{circuitikz.sty} a series of key definitions can be found that modify all the graphical characteristics of the package. - -All can be varied using the \verb!\ctikzset! command, anywhere in the code. - -\paragraph{Shape of the components} (on a per-component-class basis) -\begin{LTXexample}[varwidth=true] -\tikz \draw (0,0) to[R=1<\ohm>] (2,0); \par -\ctikzset{bipoles/resistor/height=.6} -\tikz \draw (0,0) to[R=1<\ohm>] (2,0); -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\tikz \draw (0,0) node[nand port] {}; \par -\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} - -\paragraph{Thickness of the lines} (globally) -\begin{LTXexample}[varwidth=true] -\tikz \draw (0,0) to[C=1<\farad>] (2,0); \par -\ctikzset{bipoles/thickness=1} -\tikz \draw (0,0) to[C=1<\farad>] (2,0); -\end{LTXexample} - - -\paragraph{Global properties} Of voltage and current -\begin{LTXexample}[varwidth=true] -\tikz \draw (0,0) to[R, v=1<\volt>] (2,0); \par -\ctikzset{voltage/distance from node=.1} -\tikz \draw (0,0) to[R, v=1<\volt>] (2,0); -\end{LTXexample} - -\begin{LTXexample}[varwidth=true] -\tikz \draw (0,0) to[C, i=$\imath$] (2,0); \par -\ctikzset{current/distance = .2} -\tikz \draw (0,0) to[C, i=$\imath$] (2,0); -\end{LTXexample} - -\noindent However, you can override the properties \verb!voltage/distance from node!\footnote{That is, how distant from the initial and final points of the path the arrow starts and ends.}, \verb!voltage/bump b!\footnote{Controlling how high the bump of the arrow is --- how curved it is.} and \verb!voltage/european label distance!\footnote{Controlling how distant from the bipole the voltage label will be.} on a per-component basis, in order to fine-tune the voltages: - -\begin{LTXexample}[varwidth=true] -\tikz \draw (0,0) to[R, v=1<\volt>] (1.5,0) - to[C, v=2<\volt>] (3,0); \par -\ctikzset{bipoles/capacitor/voltage/% - distance from node/.initial=.7} -\tikz \draw (0,0) to[R, v=1<\volt>] (1.5,0) - to[C, v=2<\volt>] (3,0); \par -\end{LTXexample} - -\noindent 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/american xnor port/aaa=.2} -\ctikzset{tripoles/american xnor port/bbb=.6} -\tikz \draw (0,0) node[xnor port] {}; -\end{LTXexample} - -\subsection{Components size} -Perhaps the most important parameter is \verb!\circuitikzbasekey/bipoles/length!, which -can be interpreted as the length of a resistor (including reasonable connections): all other lenghts are relative to this value. For instance: - -\begin{LTXexample}[pos=t,varwidth=true] -\ctikzset{bipoles/length=1.4cm} -\begin{circuitikz}[scale=1.2]\draw - (0,0) node[anchor=east] {B} - to[short, o-*] (1,0) - to[R=20<\ohm>, *-*] (1,2) - to[R=10<\ohm>, v=$v_x$] (3,2) -- (4,2) - to[cI=$\frac{\si{\siemens}}{5} v_x$, *-*] (4,0) -- (3,0) - to[R=5<\ohm>, *-*] (3,2) - (3,0) -- (1,0) - (1,2) to[short, -o] (0,2) node[anchor=east]{A} -;\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[pos=t,varwidth=true] -\ctikzset{bipoles/length=.8cm} -\begin{circuitikz}[scale=1.2]\draw - (0,0) node[anchor=east] {B} - to[short, o-*] (1,0) - to[R=20<\ohm>, *-*] (1,2) - to[R=10<\ohm>, v=$v_x$] (3,2) -- (4,2) - to[cI=$\frac{\siemens}{5} v_x$, *-*] (4,0) -- (3,0) - to[R=5<\ohm>, *-*] (3,2) - (3,0) -- (1,0) - (1,2) to[short, -o] (0,2) node[anchor=east]{A} -;\end{circuitikz} -\end{LTXexample} - -\subsection{Colors} - -The color of the components is stored in the key \verb!\circuitikzbasekey/color!. Circui\TikZ\ tries to follow the color set in \TikZ, although sometimes it fails. If you change color in the picture, please do not use just the color name as a style, like \verb![red]!, but rather assign the style \verb![color=red]!. - -Compare for instance -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} \draw[red] - (0,2) node[and port] (myand1) {} - (0,0) node[and port] (myand2) {} - (2,1) node[xnor port] (myxnor) {} - (myand1.out) -| (myxnor.in 1) - (myand2.out) -| (myxnor.in 2) -;\end{circuitikz} -\end{LTXexample} - -and - -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} \draw[color=red] - (0,2) node[and port] (myand1) {} - (0,0) node[and port] (myand2) {} - (2,1) node[xnor port] (myxnor) {} - (myand1.out) -| (myxnor.in 1) - (myand2.out) -| (myxnor.in 2) -;\end{circuitikz} -\end{LTXexample} - -One can of course change the color \emph{in medias res}: -\begin{LTXexample}[pos=t, varwidth=true] -\begin{circuitikz} \draw - (0,0) node[pnp, color=blue] (pnp2) {} - (pnp2.B) node[pnp, xscale=-1, anchor=B, color=brown] (pnp1) {} - (pnp1.C) node[npn, anchor=C, color=green] (npn1) {} - (pnp2.C) node[npn, xscale=-1, anchor=C, color=magenta] (npn2) {} - (pnp1.E) -- (pnp2.E) (npn1.E) -- (npn2.E) - (pnp1.B) node[circ] {} |- (pnp2.C) node[circ] {} -;\end{circuitikz} -\end{LTXexample} - -The all-in-one stream of bipoles poses some challanges, as only the actual body of the bipole, and not the connecting lines, will be rendered in the specified color. Also, please notice the curly braces around the \texttt{to}: -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} \draw - (0,0) to[V=1<\volt>] (0,2) - { to[R=1<\ohm>, color=red] (2,2) } - to[C=1<\farad>] (2,0) -- (0,0) -;\end{circuitikz} -\end{LTXexample} - -Which, for some bipoles, can be frustrating: -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} \draw - (0,0){to[V=1<\volt>, color=red] (0,2) } - to[R=1<\ohm>] (2,2) - to[C=1<\farad>] (2,0) -- (0,0) -;\end{circuitikz} -\end{LTXexample} - -The only way out is to specify different paths: -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} \draw[color=red] - (0,0) to[V=1<\volt>, color=red] (0,2); - \draw (0,2) to[R=1<\ohm>] (2,2) - to[C=1<\farad>] (2,0) -- (0,0) -;\end{circuitikz} -\end{LTXexample} - -And yes: this is a bug and \emph{not} a feature\ldots - -\section{FAQ} - -\noindent Q: When using \verb!\tikzexternalize! I get the following error: -\begin{verbatim} - ! Emergency stop. -\end{verbatim} - -\noindent A: The \TikZ\ manual states: -\begin{quotation} -Furthermore, the library assumes that all \LaTeX\ pictures are ended - with \verb!\end{tikzpicture}\verb!. -\end{quotation} - -Just substitute every occurrence of the environment \verb!circuitikz! with \verb!tikzpicture!. They are actually pretty much the same. - -\bigskip - -\noindent Q: How do I draw the voltage between two nodes? - -\noindent A: Between any two nodes there is an open circuit! -\begin{LTXexample}[varwidth=true] -\begin{circuitikz} \draw - node[ocirc] (A) at (0,0) {} - node[ocirc] (B) at (2,1) {} - (A) to[open, v=$v$] (B) -;\end{circuitikz} -\end{LTXexample} - -\bigskip - -\noindent Q: I cannot write \verb!to[R = $R_1=12V$]! nor \verb!to[ospst = open, 3s]!: I get errors. - -\noindent A: It is a limitation of the \TikZ\ parser. Use \verb!to[R = $R_1{=}12V$]! and \verb!to[ospst = open{,} 3s]! instead. - - -\section{Examples} -\begin{LTXexample}[pos=t,varwidth=true] -\begin{circuitikz}[scale=1.4]\draw - (0,0) to[C, l=10<\micro\farad>] (0,2) -- (0,3) - to[R, l=2.2<\kilo\ohm>] (4,3) -- (4,2) - to[L, l=12<\milli\henry>, i=$i_1$] (4,0) -- (0,0) - (4,2) { to[D*, *-*, color=red] (2,0) } - (0,2) to[R, l=1<\kilo\ohm>, *-] (2,2) - to[cV, v=$\SI{.3}{\kilo\ohm} i_1$] (4,2) - (2,0) to[I, i=1<\milli\ampere>, -*] (2,2) -;\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[pos=t,varwidth=true] -\begin{circuitikz}[scale=1.2]\draw - (0,0) node[ground] {} - to[V=$e(t)$, *-*] (0,2) to[C=4<\nano\farad>] (2,2) - to[R, l_=.25<\kilo\ohm>, *-*] (2,0) - (2,2) to[R=1<\kilo\ohm>] (4,2) - to[C, l_=2<\nano\farad>, *-*] (4,0) - (5,0) to[I, i_=$a(t)$, -*] (5,2) -- (4,2) - (0,0) -- (5,0) - (0,2) -- (0,3) to[L, l=2<\milli\henry>] (5,3) -- (5,2) - - {[anchor=south east] (0,2) node {1} (2,2) node {2} (4,2) node {3}} -;\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[pos=t,varwidth=true] -\begin{circuitikz}[scale=1.2]\draw - (0,0) node[anchor=east] {B} - to[short, o-*] (1,0) - to[R=20<\ohm>, *-*] (1,2) - to[R=10<\ohm>, v=$v_x$] (3,2) -- (4,2) - to[cI=$\frac{\siemens}{5} v_x$, *-*] (4,0) -- (3,0) - to[R=5<\ohm>, *-*] (3,2) - (3,0) -- (1,0) - (1,2) to[short, -o] (0,2) node[anchor=east]{A} -;\end{circuitikz} -\end{LTXexample} - -\begin{LTXexample}[pos=t,varwidth=true] -\begin{circuitikz}[scale=1]\draw - (0,0) node[transformer] (T) {} - (T.B2) to[pD] ($(T.B2)+(2,0)$) -| (3.5, -1) - (T.B1) to[pD] ($(T.B1)+(2,0)$) -| (3.5, -1) -;\end{circuitikz} -\end{LTXexample} - - -\begin{LTXexample}[pos=t,varwidth=true] -\begin{circuitikz}[scale=1]\draw - (5,.5) node [op amp] (opamp) {} - (0,0) node [left] {$U_{we}$} to [R, l=$R_d$, o-*] (2,0) - to [R, l=$R_d$, *-*] (opamp.+) - to [C, l_=$C_{d2}$, *-] ($(opamp.+)+(0,-2)$) node [ground] {} - (opamp.out) |- (3.5,2) to [C, l_=$C_{d1}$, *-] (2,2) to [short] (2,0) - (opamp.-) -| (3.5,2) - (opamp.out) to [short, *-o] (7,.5) node [right] {$U_{wy}$} -;\end{circuitikz} -\end{LTXexample} - - \begin{LTXexample}[pos=t,varwidth=true] -\begin{circuitikz}[scale=1.2, american]\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); - - \begin{scope}[xshift=6.5cm, yshift=.5cm] - \draw [->] (-2,0) -- (2.5,0) node[anchor=west] {$v_1/\volt$}; - \draw [->] (0,-2) -- (0,2) node[anchor=west] {$i_1/\SI{}{\milli\ampere}$} ; - \draw (-1,0) node[anchor=north] {-2} (1,0) node[anchor=south] {2} - (0,1) node[anchor=west] {4} (0,-1) node[anchor=east] {-4} - (2,0) node[anchor=north west] {4} - (-1.5,0) node[anchor=south east] {-3}; - \draw [thick] (-2,-1) -- (-1,1) -- (1,-1) -- (2,0) -- (2.5,.5); - \draw [dotted] (-1,1) -- (-1,0) (1,-1) -- (1,0) - (-1,1) -- (0,1) (1,-1) -- (0,-1); - \end{scope} -\end{circuitikz} -\end{LTXexample} - -\section{Revision history} - -\begin{itemize} -\item[\itshape version 0.3.0] (20121229) - \begin{enumerate} - \item fixed gate node for a few transistors - \item added mixer - \item added fully differential op amp (by Kristofer M.~Monisit) - \item now general settings for the drawing of voltage can be overridden for specific components - \item made arrows more homogeneous (either the current/voltage one, or latex' by pgf) - \item added the single battery cell - \item added fuse and asymmetric fuse - \item added toggle switch - \item added varistor, photoresistor, thermocouple, push button - \item added thermistor, thermistor ptc, thermistor ptc - \item fixed misalignment of voltage label in vertical bipoles with names - \item added isfet - \item added noiseless, protective, chassis, signal and reference grounds (Luigi Luigi «Liverpool») - \end{enumerate} -\item[\itshape version 0.2.4] (20110911). - \begin{enumerate} - \item added square voltage source (contributed by Alistair Kwan) - \item added buffer and plain amplifier (contributed by Danilo Piazzalunga) - \item added squid and barrier (contributed by Cor Molenaar) - \item added antenna and transmission line symbols contributed by Leonardo Azzinnari - \item added the changeover switch spdt (suggestion of Fabio Maria Antoniali) - \item rename of context.tex and context.pdf (thanks to Karl Berry) - \item updated the email address - \item in documentation, fixed wrong (non-standard) labelling of the axis in an example (thanks to prof. Claudio Beccaria) - \item fixed scaling inconsistencies in quadrupoles - \item fixed division by zero error on certain vertical paths - \item introduced options straighlabels, rotatelabels, smartlabels - \end{enumerate} -\item[\itshape version 0.2.3] (20091118). - \begin{enumerate} - \item fixed compatibility problem with label option from tikz - \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. - \item Added options \texttt{europeanresistor}, \texttt{europeaninductor}, \texttt{americanresistor} and \texttt{americaninductor}, with corresponding styles. - \item \textbf{Fixed}: error in transistor arrow positioning and direction under negative \texttt{xscale} and \texttt{yscale}. - \end{enumerate} - - -\item[\itshape version 0.2.1] (20090503). - \begin{enumerate} - \item Op-amps added. - \item Added options \texttt{arrowmos} and \texttt{noarrowmos}. - \end{enumerate} - - -\item[\itshape version 0.2] First public release on CTAN (20090417). - \begin{enumerate} - \item \textbf{Backward incompatibility}: labels ending with \texttt{:}\textit{angle} are not parsed for positioning anymore. - \item Full use of \TikZ\ keyval features. - \item White background is not filled anymore: now the network can be drawn on a background picture as well. - \item Several new components added (logical ports, transistors, double bipoles, \ldots). - \item Color support. - \item Integration with {\ttfamily siunitx}. - \item Voltage, american style. - \item Better code, perhaps. General cleanup at the very least. - \end{enumerate} -\item[\itshape version 0.1] First public release (2007). -\end{itemize} - - -\printindex - - -\end{document} - - - diff --git a/Master/texmf-dist/doc/latex/circuitikz/compatibility.ltx b/Master/texmf-dist/doc/latex/circuitikz/compatibility.ltx new file mode 100644 index 00000000000..7259479e78b --- /dev/null +++ b/Master/texmf-dist/doc/latex/circuitikz/compatibility.ltx @@ -0,0 +1,17 @@ +\documentclass{standalone} + +\usepackage{tikz} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{positioning} + +\usepackage[compatibility]{circuitikz} +\ctikzset{bipoles/length=.9cm} + +\begin{document} + \begin{tikzpicture}[circuit ee IEC] + \draw (0,0) to [resistor={name=R}] (0,2) + to[diode={name=D}] (3,2); + \draw (0,0) to[*R=$R_1$] (1.5,0) to[*Tnpn] (3,0) + to[*D](3,2); + \end{tikzpicture} +\end{document} diff --git a/Master/texmf-dist/doc/latex/circuitikz/compatibility.pdf b/Master/texmf-dist/doc/latex/circuitikz/compatibility.pdf new file mode 100644 index 00000000000..a6cd2514c8f Binary files /dev/null and b/Master/texmf-dist/doc/latex/circuitikz/compatibility.pdf differ diff --git a/Master/texmf-dist/tex/context/third/circuitikz/t-circuitikz.tex b/Master/texmf-dist/tex/context/third/circuitikz/t-circuitikz.tex new file mode 100644 index 00000000000..4184114b75b --- /dev/null +++ b/Master/texmf-dist/tex/context/third/circuitikz/t-circuitikz.tex @@ -0,0 +1,123 @@ +\def\pgfcircversion{0.4} +\writestatus{loading}{2015/05/15 The CircuiTikz circuit drawing package version \pgfcircversion} + +\usemodule[tikz] + +\startmodule[circuitikz] + +\unprotect + +\edef\tikzatcode{\the\catcode`\@} +\edef\tikzbarcode{\the\catcode`\|} +\edef\tikzexclaimcode{\the\catcode`\!} +\catcode`\@=11 +\catcode`\|=12 +\catcode`\!=12 + +\usepgflibrary [decorations.pathmorphing] +\usetikzlibrary[calc] + +\input circuitikz.code.tex + +% defaults + +\setupmodule + [current=european, + voltage=european, + resistor=american, + inductor=cute, + logic=american, + siunitx=true, + arrowmos=false] + +\processaction + [\currentmoduleparameter{voltage}] + [european=>\ctikzset{voltage=european}, + american=>\ctikzset{voltage=american}] + +\processaction + [\currentmoduleparameter{current}] + [european=>\ctikzset{ current=european}, + american=>\ctikzset{ current=american}] + +\processaction + [\currentmoduleparameter{label}] + [straight=>\ctikzset{label/align = straight}, + align=>\ctikzset{label/align = rotate}, + smart=>\ctikzset{label/align = smart}] + +\processaction + [\currentmoduleparameter{resistor}] + [european=>\ctikzset{ resistor=european}, + american=>\ctikzset{ resistor=american}] + +\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 + + +% Context specific + +\ctikzset{tripoles/op amp/font/.initial=\switchtobodyfont[small]} + +\input circuitikz1.code.tex + +\catcode`\@=\tikzatcode +\catcode`\|=\tikzbarcode +\catcode`\!=\tikzexclaimcode + +% define the environment +\long\def\startcircuitikz#1\stopcircuitikz{\starttikzpicture#1\stoptikzpicture} + +\protect + +\stopmodule + +\endinput diff --git a/Master/texmf-dist/tex/generic/circuitikz/circuitikz.code.tex b/Master/texmf-dist/tex/generic/circuitikz/circuitikz.code.tex new file mode 100644 index 00000000000..4dfe979f86b --- /dev/null +++ b/Master/texmf-dist/tex/generic/circuitikz/circuitikz.code.tex @@ -0,0 +1,710 @@ + +%% 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}} + + +\newif\ifpgf@circ@siunitx +\newif\ifpgf@circuit@compat + +\newif\ifpgf@circuit@inputarrow +\ctikzset{inputarrow/.is choice} +\ctikzset{inputarrow/true/.code={\pgf@circuit@inputarrowtrue}} +\ctikzset{inputarrow/false/.code={\pgf@circuit@inputarrowfalse}} + +\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{monopoles/tground/thickness/.initial=3} +\ctikzset{monopoles/vcc/width/.initial=.2} +\ctikzset{monopoles/match/width/.initial=.4} +\ctikzset{monopoles/oscillator/width/.initial=.7} +\ctikzset{monopoles/chassis/width/.initial=.25} +\ctikzset{monopoles/alternative chassis/width/.initial=.25} +\ctikzset{monopoles/equipotentiality/width/.initial=.25} +\ctikzset{monopoles/tlinestub/width/.initial=.25} +\ctikzset{monopoles/antenna/width/.initial=.25} +\ctikzset{monopoles/antenna/label/xanchor/.initial=.4} +\ctikzset{monopoles/antenna/label/yanchor/.initial=.75} +\ctikzset{monopoles/txantenna/label/xanchor/.initial=.4} +\ctikzset{monopoles/txantenna/label/yanchor/.initial=.75} +\ctikzset{monopoles/txantenna/width/.initial=.25} +\ctikzset{monopoles/rxantenna/label/xanchor/.initial=.4} +\ctikzset{monopoles/rxantenna/label/yanchor/.initial=.75} +\ctikzset{monopoles/rxantenna/width/.initial=.25} + +\ctikzset{bipoles/resistor/height/.initial=.3} +\ctikzset{bipoles/resistor/width/.initial=.8} +\ctikzset{bipoles/potentiometer/height/.initial=.8} +\ctikzset{bipoles/potentiometer/height 2/.initial=.3} +\ctikzset{bipoles/potentiometer/width/.initial=.8} +\ctikzset{bipoles/photoresistor/height/.initial=.6} +\ctikzset{bipoles/photoresistor/height 2/.initial=.3} +\ctikzset{bipoles/photoresistor/width/.initial=.8} +\ctikzset{bipoles/thermistor/main/.initial=.7} +\ctikzset{bipoles/thermistor/height/.initial=.428}%.3/.7 +\ctikzset{bipoles/thermistorntc/width/.initial=.8} +\ctikzset{bipoles/thermistorntc/main/.initial=.7} +\ctikzset{bipoles/thermistorntc/height/.initial=.428}%.3/.7 +\ctikzset{bipoles/thermistorntc/height 2/.initial=.75}%.3/.7 +\ctikzset{bipoles/thermistorptc/width/.initial=.8} +\ctikzset{bipoles/thermistorptc/main/.initial=.7} +\ctikzset{bipoles/thermistorptc/height/.initial=.428}%.3/.7 +\ctikzset{bipoles/thermistorptc/height 2/.initial=.75}%.3/.7 +\ctikzset{bipoles/thermistor/width/.initial=.8} +\ctikzset{bipoles/varistor/main/.initial=.7} +\ctikzset{bipoles/varistor/height/.initial=.428}%.3/.7 +\ctikzset{bipoles/varistor/width/.initial=.8} +\ctikzset{bipoles/vresistor/height/.initial=.6} +\ctikzset{bipoles/vresistor/width/.initial=.8} +\ctikzset{bipoles/cuteinductor/height/.initial=.3} +\ctikzset{bipoles/cuteinductor/width/.initial=.6} +\ctikzset{bipoles/cuteinductor/coils/.initial=6} +\ctikzset{bipoles/cuteinductor/coil height/.initial=.15} +\ctikzset{bipoles/cuteinductor/coil aspect/.initial=.25} +\ctikzset{bipoles/cuteinductor/lower coil height/.initial=.05} +\ctikzset{bipoles/americaninductor/height/.initial=.3} +\ctikzset{bipoles/americaninductor/height 2/.initial=.1} +\ctikzset{bipoles/americaninductor/width/.initial=.8} +\ctikzset{bipoles/americaninductor/coils/.initial=4} +\ctikzset{bipoles/americaninductor/coil height/.initial=.15} +\ctikzset{bipoles/vcuteinductor/height/.initial=.3} +\ctikzset{bipoles/vcuteinductor/width/.initial=.6} +\ctikzset{bipoles/vcuteinductor/coils/.initial=6} +\ctikzset{bipoles/vcuteinductor/coil height/.initial=.15} +\ctikzset{bipoles/vcuteinductor/coil aspect/.initial=.25} +\ctikzset{bipoles/vcuteinductor/lower coil height/.initial=.05} +\ctikzset{bipoles/vamericaninductor/height/.initial=.6} +\ctikzset{bipoles/vamericaninductor/height 2/.initial=.2} +\ctikzset{bipoles/vamericaninductor/width/.initial=.8} +\ctikzset{bipoles/vamericaninductor/coils/.initial=4} +\ctikzset{bipoles/vamericaninductor/coil height/.initial=.15} +\ctikzset{bipoles/esource/height/.initial=.60} +\ctikzset{bipoles/esource/width/.initial=.60} +\ctikzset{bipoles/isource/height/.initial=.60} +\ctikzset{bipoles/isource/width/.initial=.60} +\ctikzset{bipoles/dcisource/height/.initial=.60} +\ctikzset{bipoles/dcisource/width/.initial=.60} +\ctikzset{bipoles/dcvsource/height/.initial=.60} +\ctikzset{bipoles/dcvsource/width/.initial=.60} +\ctikzset{bipoles/vsourcetri/height/.initial=.60} +\ctikzset{bipoles/vsourcetri/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/vsourcesquare/height/.initial=.60} +\ctikzset{bipoles/vsourcesquare/width/.initial=.60} +\ctikzset{bipoles/cisource/height/.initial=.7} +\ctikzset{bipoles/cisource/width/.initial=.7} +\ctikzset{bipoles/cisourceam/height/.initial=.7} +\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/battery1/height/.initial=.6} +\ctikzset{bipoles/battery1/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/european gas filled surge arrester/height/.initial=.30} +\ctikzset{bipoles/european gas filled surge arrester/width/.initial=.80} +\ctikzset{bipoles/european gas filled surge arrester/inside/.initial=.30} +\ctikzset{bipoles/american gas filled surge arrester/height/.initial=.60} +\ctikzset{bipoles/american gas filled surge arrester/width/.initial=.60} +\ctikzset{bipoles/american gas filled surge arrester/inside/.initial=.15} +\ctikzset{bipoles/american gas filled surge arrester/dot x/.initial=.25} +\ctikzset{bipoles/american gas filled surge arrester/dot y/.initial=.45} +\ctikzset{bipoles/american gas filled surge arrester/size/.initial=.1} +\ctikzset{bipoles/fuse/height/.initial=.20} +\ctikzset{bipoles/fuse/width/.initial=.50} +\ctikzset{bipoles/afuse/height/.initial=.20} +\ctikzset{bipoles/afuse/width/.initial=.50} +\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=.70} +\ctikzset{bipoles/tgeneric/width/.initial=.80} +\ctikzset{bipoles/tfullgeneric/height/.initial=.70} +\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/ohmmeter/height/.initial=.60} +\ctikzset{bipoles/ohmmeter/width/.initial=.60} +\ctikzset{bipoles/voltmeter/height/.initial=.60} +\ctikzset{bipoles/voltmeter/width/.initial=.60} +\ctikzset{bipoles/buffer/height/.initial=1} +\ctikzset{bipoles/buffer/width/.initial=1} +\ctikzset{bipoles/not port/width/.initial=1} +\ctikzset{bipoles/not port/height/.initial=.8} +\ctikzset{bipoles/not port/circle width/.initial=.15} +\ctikzset{bipoles/lamp/height/.initial=.60} +\ctikzset{bipoles/lamp/width/.initial=.60} +\ctikzset{bipoles/tline/height/.initial=.3} +\ctikzset{bipoles/tline/width/.initial=.8} +\ctikzset{bipoles/squid/height/.initial=.60} +\ctikzset{bipoles/squid/width/.initial=.60} +\ctikzset{bipoles/barrier/height/.initial=.60} +\ctikzset{bipoles/barrier/width/.initial=.60} +\ctikzset{bipoles/thermocouple/height/.initial=.250} +\ctikzset{bipoles/thermocouple/height 2/.initial=.60} +\ctikzset{bipoles/thermocouple/width/.initial=.140} +\ctikzset{bipoles/pushbutton/height/.initial=.5} +\ctikzset{bipoles/pushbutton/height 2/.initial=.0} +\ctikzset{bipoles/pushbutton/width/.initial=.50} + +\ctikzset{bipoles/twoport/width/.initial=.7} +\ctikzset{bipoles/twoport/height/.initial=.7} +\ctikzset{bipoles/twoport/text/.initial=} +\ctikzset{bipoles/vco/width/.initial=.7} +\ctikzset{bipoles/bandpass/width/.initial=.7} +\ctikzset{bipoles/highpass/width/.initial=.7} +\ctikzset{bipoles/lowpass/width/.initial=.7} +\ctikzset{bipoles/adc/width/.initial=.7} +\ctikzset{bipoles/dac/width/.initial=.7} +\ctikzset{bipoles/dsp/width/.initial=.7} +\ctikzset{bipoles/fft/width/.initial=.7} +\ctikzset{bipoles/amp/width/.initial=.7} +\ctikzset{bipoles/vamp/width/.initial=.7} +\ctikzset{bipoles/piattenuator/width/.initial=.7} +\ctikzset{bipoles/vpiattenuator/width/.initial=.7} +\ctikzset{bipoles/tattenuator/width/.initial=.7} +\ctikzset{bipoles/vtattenuator/width/.initial=.7} +\ctikzset{bipoles/phaseshifter/width/.initial=.7} +\ctikzset{bipoles/vphaseshifter/width/.initial=.7} +\ctikzset{bipoles/detector/width/.initial=.7} + +\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/nigfetebulk/width/.initial=.7} +\ctikzset{tripoles/nigfetebulk/gate height/.initial=.35} +\ctikzset{tripoles/nigfetebulk/base height/.initial=.5} +\ctikzset{tripoles/nigfetebulk/height/.initial=1.1} +\ctikzset{tripoles/nigfetebulk/base width/.initial=.5} +\ctikzset{tripoles/nigfetebulk/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/pigfetebulk/width/.initial=.7} +\ctikzset{tripoles/pigfetebulk/gate height/.initial=.35} +\ctikzset{tripoles/pigfetebulk/base height/.initial=.5} +\ctikzset{tripoles/pigfetebulk/height/.initial=1.1} +\ctikzset{tripoles/pigfetebulk/base width/.initial=.5} +\ctikzset{tripoles/pigfetebulk/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} + +\ctikzset{tripoles/isfet/width/.initial=1} +\ctikzset{tripoles/isfet/gate height/.initial=.35} +\ctikzset{tripoles/isfet/base height/.initial=.5} +\ctikzset{tripoles/isfet/height/.initial=1.1} +\ctikzset{tripoles/isfet/base width/.initial=.3} +\ctikzset{tripoles/isfet/gate width/.initial=.5} +\ctikzset{tripoles/isfet/wave width/.initial=.16} +\ctikzset{tripoles/isfet/wave amp/.initial=.06} +\ctikzset{tripoles/isfet/waves y sep/.initial=.22} +\ctikzset{tripoles/isfet/waves x sep/.initial=.8} + +\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/op amp/font/.initial=} +\ctikzset{tripoles/gm amp/width/.initial=1.7} +\ctikzset{tripoles/gm amp/port width/.initial=.7} +\ctikzset{tripoles/gm amp/height/.initial=1.4} +\ctikzset{tripoles/gm amp/input height/.initial=.5} +\ctikzset{tripoles/gm amp/up pos/.initial=.45} +\ctikzset{tripoles/plain amp/width/.initial=1.7} +\ctikzset{tripoles/plain amp/port width/.initial=.7} +\ctikzset{tripoles/plain amp/height/.initial=1.4} +\ctikzset{tripoles/plain amp/input height/.initial=.5} +\ctikzset{tripoles/plain amp/up pos/.initial=.45} + +\ctikzset{tripoles/thyristor/height/.initial=1.10} +\ctikzset{tripoles/thyristor/height 2/.initial=.5} +\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{tripoles/spdt/width/.initial=.85} +\ctikzset{tripoles/spdt/height/.initial=.45} +\ctikzset{tripoles/spdt/margin/.initial=.45} + +\ctikzset{tripoles/toggleswitch/height/.initial=.8} +\ctikzset{tripoles/toggleswitch/height 2/.initial=.0} +\ctikzset{tripoles/toggleswitch/width/.initial=.80} + +\ctikzset{tripoles/mixer/width/.initial=0.7} +\ctikzset{tripoles/adder/width/.initial=0.7} +\ctikzset{tripoles/circulator/width/.initial=.7} + +\ctikzset{tripoles/wilkinson/height/.initial=1.3} +\ctikzset{tripoles/wilkinson/width/.initial=1.3} + +\ctikzset{quadpoles/transformer/width/.initial=1.5} +\ctikzset{quadpoles/transformer/width1/.initial=.4} +\ctikzset{quadpoles/transformer/height/.initial=1.5} +\ctikzset{quadpoles/transformer/height1/.initial=.8} +\ctikzset{quadpoles/transformer core/width/.initial=1.5} +\ctikzset{quadpoles/transformer core/height/.initial=1.5} +\ctikzset{quadpoles/transformer core/core height/.initial=.5} +\ctikzset{quadpoles/transformer core/core width/.initial=.05} +\ctikzset{quadpoles/gyrator/width/.initial=1.5} +\ctikzset{quadpoles/gyrator/height/.initial=1.5} +\ctikzset{quadpoles/coupler/width/.initial=1.3} +\ctikzset{quadpoles/coupler/height/.initial=1.3} + + + +\ctikzset{bipole/.is family} +\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} +% special cases +\ctikzset{bipoles/generic/voltage/distance from node/.initial=.4} +\ctikzset{bipoles/generic/voltage/bump b/.initial=2} +\ctikzset{bipoles/generic/voltage/european label distance/.initial=1.8} +%\ctikzset{bipoles/thermocouple/voltage/distance from node/.initial=.3} +\ctikzset{bipoles/thermocouple/voltage/bump b/.initial=2.2} +\ctikzset{bipoles/thermocouple/voltage/european label distance/.initial=1.5} +\ctikzset{bipoles/ageneric/voltage/distance from node/.initial=.4} +\ctikzset{bipoles/ageneric/voltage/bump b/.initial=2} +\ctikzset{bipoles/ageneric/voltage/european label distance/.initial=1.8} +\ctikzset{bipoles/fullgeneric/voltage/distance from node/.initial=.4} +\ctikzset{bipoles/fullgeneric/voltage/bump b/.initial=2} +\ctikzset{bipoles/fullgeneric/voltage/european label distance/.initial=1.8} +\ctikzset{bipoles/memristor/voltage/distance from node/.initial=.4} +\ctikzset{bipoles/memristor/voltage/bump b/.initial=2} +\ctikzset{bipoles/memristor/voltage/european label distance/.initial=1.8} +%\ctikzset{bipoles/tline/voltage/distance from node/.initial=.2} +\ctikzset{bipoles/tline/voltage/bump b/.initial=2.4} +\ctikzset{bipoles/tline/voltage/european label distance/.initial=2.1} +%\ctikzset{bipoles/varistor/voltage/distance from node/.initial=.2} +\ctikzset{bipoles/varistor/voltage/bump b/.initial=2.4} +\ctikzset{bipoles/varistor/voltage/european label distance/.initial=2} +%\ctikzset{bipoles/photoresistor/voltage/distance from node/.initial=.2} +\ctikzset{bipoles/photoresistor/voltage/bump b/.initial=2} +\ctikzset{bipoles/photoresistor/voltage/european label distance/.initial=1.8} +%\ctikzset{bipoles/thermistor/voltage/distance from node/.initial=.2} +\ctikzset{bipoles/thermistor/voltage/bump b/.initial=2.4} +\ctikzset{bipoles/thermistor/voltage/european label distance/.initial=2} +%\ctikzset{bipoles/thermistorntc/voltage/distance from node/.initial=.2} +\ctikzset{bipoles/thermistorntc/voltage/bump b/.initial=1.6} +%\ctikzset{bipoles/thermistorptc/voltage/distance from node/.initial=.2} +\ctikzset{bipoles/thermistorptc/voltage/bump b/.initial=1.6} + +\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 } } + +\newif\ifpgf@circuit@europeangfsurgearrester +\ctikzset{gas filled surge arrester/.is choice} +\ctikzset{gas filled surge arrester/european/.code= {\pgf@circuit@europeangfsurgearrestertrue } } +\ctikzset{gas filled surge arrester/american/.code= {\pgf@circuit@europeangfsurgearresterfalse } } + +\tikzset{american gas filled surge arrester/.style = { \circuitikzbasekey/gas filled surge arrester = american } } +\tikzset{european gas filled surge arrester/.style = { \circuitikzbasekey/gas filled surge arrester = 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, european gas filled surge arrester } } +\tikzset{american/.style = { american currents, american voltages, american resistors, american inductors, american ports, american gas filled surge arrester } } +\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 } + +\ctikzset{label/align/.is choice} +\ctikzset{label/align/straight/.code={\ctikzsetvalof{label/align}{straight}}} +\ctikzset{label/align/rotate/.code={\ctikzsetvalof{label/align}{rotate}}} +\ctikzset{label/align/smart/.code={\ctikzsetvalof{label/align}{smart}}} +%% dependencies + + + + + + +%%%%%%%%%% new +\pgfkeys{\circuitikzbasekey/.search also={/tikz}} + + + + +\input pgfcircutils.tex +\input pgfcircmath.tex + +\input pgfcircshapes.tex +\input pgfcircmonopoles.tex +\input pgfcircbipoles.tex +\input pgfcirctripoles.tex +\input pgfcircquadpoles.tex +\input pgfcircnpoles.tex + +\input pgfcirclabel.tex +\input pgfcircvoltage.tex +\input pgfcirccurrent.tex +\input pgfcircinputarrows.tex + + + + diff --git a/Master/texmf-dist/tex/generic/circuitikz/circuitikz1.code.tex b/Master/texmf-dist/tex/generic/circuitikz/circuitikz1.code.tex new file mode 100644 index 00000000000..3319bc18c1f --- /dev/null +++ b/Master/texmf-dist/tex/generic/circuitikz/circuitikz1.code.tex @@ -0,0 +1,548 @@ +%%%%%%%%%%%% +%% 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 +\newdimen\pgf@circ@res@temp + +% 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/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} + } + ($(\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@thermistor@path#1{\pgf@circ@bipole@path{thermistor}{#1}} +\def\pgf@circ@thermistorptc@path#1{\pgf@circ@bipole@path{thermistorptc}{#1}} +\def\pgf@circ@thermistorntc@path#1{\pgf@circ@bipole@path{thermistorntc}{#1}} +\def\pgf@circ@varistor@path#1{\pgf@circ@bipole@path{varistor}{#1}} +\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@battery1@path#1{\pgf@circ@bipole@path{battery1}{#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@esource@path#1{\pgf@circ@bipole@path{esource}{#1}} +\def\pgf@circ@vsource@path#1{\pgf@circ@bipole@path{vsource}{#1}} +\def\pgf@circ@dcvsource@path#1{\pgf@circ@bipole@path{dcvsource}{#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@dcisource@path#1{\pgf@circ@bipole@path{dcisource}{#1}} +\def\pgf@circ@isourcesin@path#1{\pgf@circ@bipole@path{isourcesin}{#1}} +\def\pgf@circ@vsourcesquare@path#1{\pgf@circ@bipole@path{vsourcesquare}{#1}} +\def\pgf@circ@vsourcetri@path#1{\pgf@circ@bipole@path{vsourcetri}{#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@spst@path#1{\pgf@circ@bipole@path{spst}{#1}} +\def\pgf@circ@ospst@path#1{\pgf@circ@bipole@path{ospst}{#1}} +\def\pgf@circ@pushbutton@path#1{\pgf@circ@bipole@path{pushbutton}{#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@ohmmeter@path#1{\pgf@circ@bipole@path{ohmmeter}{#1}} +\def\pgf@circ@voltmeter@path#1{\pgf@circ@bipole@path{voltmeter}{#1}} +\def\pgf@circ@empty@path#1{} +\def\pgf@circ@photoresistor@path#1{\pgf@circ@bipole@path{photoresistor}{#1}} +\def\pgf@circ@thyristor@path#1{\pgf@circ@bipole@path{thyristor}{#1}} +\def\pgf@circ@toggleswitch@path#1{\pgf@circ@bipole@path{toggleswitch}{#1}} +\def\pgf@circ@memristor@path#1{\pgf@circ@bipole@path{memristor}{#1}} +\def\pgf@circ@triac@path#1{\pgf@circ@bipole@path{triac}{#1}} +\def\pgf@circ@tline@path#1{\pgf@circ@bipole@path{tline}{#1}} +\def\pgf@circ@squid@path#1{\pgf@circ@bipole@path{squid}{#1}} +\def\pgf@circ@barrier@path#1{\pgf@circ@bipole@path{barrier}{#1}} +\def\pgf@circ@thermocouple@path#1{\pgf@circ@bipole@path{thermocouple}{#1}} +\def\pgf@circ@fuse@path#1{\pgf@circ@bipole@path{fuse}{#1}} +\def\pgf@circ@afuse@path#1{\pgf@circ@bipole@path{afuse}{#1}} + +\def\pgf@circ@gfsurgearrester@path#1{\ifpgf@circuit@europeangfsurgearrester\pgf@circ@europeangfsurgearrester@path{#1}\else\pgf@circ@americangfsurgearrester@path{#1}\fi} +\def\pgf@circ@europeangfsurgearrester@path#1{\pgf@circ@bipole@path{european gas filled surge arrester}{#1}} +\def\pgf@circ@americangfsurgearrester@path#1{\pgf@circ@bipole@path{american gas filled surge arrester}{#1}} + +\def\pgf@circ@twoport@path#1{\pgf@circ@bipole@path{twoport}{#1}} +\def\pgf@circ@vco@path#1{\pgf@circ@bipole@path{vco}{#1}} +\def\pgf@circ@bandpass@path#1{\pgf@circ@bipole@path{bandpass}{#1}} +\def\pgf@circ@highpass@path#1{\pgf@circ@bipole@path{highpass}{#1}} +\def\pgf@circ@lowpass@path#1{\pgf@circ@bipole@path{lowpass}{#1}} +\def\pgf@circ@adc@path#1{\pgf@circ@bipole@path{adc}{#1}} +\def\pgf@circ@dac@path#1{\pgf@circ@bipole@path{dac}{#1}} +\def\pgf@circ@dsp@path#1{\pgf@circ@bipole@path{dsp}{#1}} +\def\pgf@circ@fft@path#1{\pgf@circ@bipole@path{fft}{#1}} +\def\pgf@circ@amp@path#1{\pgf@circ@bipole@path{amp}{#1}} +\def\pgf@circ@vamp@path#1{\pgf@circ@bipole@path{vamp}{#1}} +\def\pgf@circ@piattenuator@path#1{\pgf@circ@bipole@path{piattenuator}{#1}} +\def\pgf@circ@vpiattenuator@path#1{\pgf@circ@bipole@path{vpiattenuator}{#1}} +\def\pgf@circ@tattenuator@path#1{\pgf@circ@bipole@path{tattenuator}{#1}} +\def\pgf@circ@vtattenuator@path#1{\pgf@circ@bipole@path{vtattenuator}{#1}} +\def\pgf@circ@phaseshifter@path#1{\pgf@circ@bipole@path{phaseshifter}{#1}} +\def\pgf@circ@vphaseshifter@path#1{\pgf@circ@bipole@path{vphaseshifter}{#1}} +\def\pgf@circ@detector@path#1{\pgf@circ@bipole@path{detector}{#1}} + + +%% Styles + +%% Aggiungere per thyristor e tripoli semplici + +\def\comnpatname{\ifpgf@circuit@compat *\else\fi} +\def\compattikzset#1{\tikzset{\comnpatname#1}} + +%\def\ctikzsetbipole#1#2{% +% \tikzset{#1/.style= {to path=#2, \circuitikzbasekey, l=##1}}% +%} + +\compattikzset{resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@resistor@path, l=#1}} +\compattikzset{american resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{resistor}{#1}, l=#1}} +\compattikzset{european resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{generic}{#1}, l=#1}} +\compattikzset{potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@potentiometer@path, l=#1}} +\compattikzset{varistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@varistor@path, l=#1}} +\compattikzset{photoresistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@photoresistor@path, l=#1}} +\compattikzset{thermistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistor@path, l=#1}} +\compattikzset{thermistor ptc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorptc@path, l=#1}} +\compattikzset{thermistor ntc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorntc@path, l=#1}} +\compattikzset{american potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{potentiometer}{#1}, l=#1}} +\compattikzset{european potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{genericpotentiometer}{#1}, l=#1}} +\compattikzset{variable resistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vresistor@path, l=#1}} +\compattikzset{variable american resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{vresistor}{#1}, l=#1}} +\compattikzset{variable european resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{tgeneric}{#1}, l=#1}} +\compattikzset{capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@capacitor@path, l=#1}} +\compattikzset{polar capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@polarcapacitor@path, l=#1}} +\compattikzset{variable capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcapacitor@path, l=#1}} +\compattikzset{battery/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@battery@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\compattikzset{battery1/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@battery1@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\compattikzset{inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@inductor@path, l=#1}} +\compattikzset{gf surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@gfsurgearrester@path, l=#1}} +\compattikzset{american gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americangfsurgearrester@path, l=#1}} +\compattikzset{european gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeangfsurgearrester@path, l=#1}} +\compattikzset{gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@gfsurgearrester@path, l=#1}} +\compattikzset{american inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americaninductor@path, l=#1}} +\compattikzset{cute inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteinductor@path, l=#1}} +\compattikzset{european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeaninductor@path, l=#1}} +\compattikzset{variable inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vinductor@path, l=#1}} +\compattikzset{variable european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@veuropeaninductor@path, l=#1}} +\compattikzset{variable american inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vamericaninductor@path, l=#1}} +\compattikzset{variable cute inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcuteinductor@path, l=#1}} +\compattikzset{tline/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tline@path, l=#1}} +\compattikzset{transmission line/.style = {tline = #1}} +\compattikzset{TL/.style = {tline = #1}} +\compattikzset{european voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsource@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\compattikzset{american voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\compattikzset{european current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isource@path, \circuitikzbasekey/bipole/is current=true, i=#1}} +\compattikzset{american current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}} +\compattikzset{european controlled voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsource@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\compattikzset{american controlled voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\compattikzset{european controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisource@path, \circuitikzbasekey/bipole/is current=true, i=#1}} +\compattikzset{american controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}} +\compattikzset{sinusoidal voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcesin@path, \circuitikzbasekey/bipole/is voltage=true, v=#1 }} +\compattikzset{square voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcesquare@path, \circuitikzbasekey/bipole/is voltage=true, v=#1 }} +\compattikzset{triangle voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcetri@path, \circuitikzbasekey/bipole/is voltage=true, v=#1 }} +\compattikzset{sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}} +\compattikzset{controlled sinusoidal voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsourcesin@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\compattikzset{controlled sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}} + +\compattikzset{voltage source/.style = {\comnpatname \ifpgf@circuit@europeanvoltage european \else american \fi voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\compattikzset{current source/.style = {\comnpatname \ifpgf@circuit@europeancurrent european \else american \fi current source, \circuitikzbasekey/bipole/is current=true, i=#1}} +\compattikzset{controlled voltage source/.style = {\comnpatname \ifpgf@circuit@europeanvoltage european \else american \fi controlled voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\compattikzset{controlled current source/.style = {\comnpatname \ifpgf@circuit@europeancurrent european \else american \fi controlled current source, \circuitikzbasekey/bipole/is current=true, i=#1}} + + +\compattikzset{generic/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@generic@path, l=#1}} +\compattikzset{ageneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ageneric@path, l=#1}} +\compattikzset{tgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tgeneric@path, l=#1}} +\compattikzset{fullgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullgeneric@path, l=#1}} +\compattikzset{tfullgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tfullgeneric@path, l=#1}} +\compattikzset{short/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@short@path}} +\compattikzset{open/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@open@path}} + +\compattikzset{lamp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@lamp@path}} + +\compattikzset{squid/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@squid@path}} +\compattikzset{barrier/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@barrier@path}} +\compattikzset{thermocouple/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermocouple@path}} +\compattikzset{fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fuse@path}} +\compattikzset{asymmetric fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@afuse@path}} + +\compattikzset{twoport/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@twoport@path}} +\compattikzset{vco/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vco@path}} +\compattikzset{bandpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bandpass@path}} +\compattikzset{highpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@highpass@path}} +\compattikzset{lowpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@lowpass@path}} +\compattikzset{adc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@adc@path}} +\compattikzset{dac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dac@path}} +\compattikzset{dsp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dsp@path}} +\compattikzset{fft/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fft@path}} +\compattikzset{amp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@amp@path}} +\compattikzset{vamp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vamp@path}} +\compattikzset{piattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@piattenuator@path}} +\compattikzset{vpiattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vpiattenuator@path}} +\compattikzset{tattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tattenuator@path}} +\compattikzset{vtattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vtattenuator@path}} +\compattikzset{phaseshifter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@phaseshifter@path}} +\compattikzset{vphaseshifter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vphaseshifter@path}} +\compattikzset{detector/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@detector@path}} + +\compattikzset{full diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulldiode@path}} +\compattikzset{full Schottky diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullsdiode@path}} +\compattikzset{full Zener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullzdiode@path}} +\compattikzset{full tunnel diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulltdiode@path}} +\compattikzset{full photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullpdiode@path}} +\compattikzset{full led/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulllediode@path}} +\compattikzset{full varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullvarcap@path}} + +\compattikzset{empty diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptydiode@path}} +\compattikzset{empty Schottky diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptysdiode@path}} +\compattikzset{empty Zener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyzdiode@path}} +\compattikzset{empty tunnel diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptytdiode@path}} +\compattikzset{empty photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptypdiode@path}} +\compattikzset{empty led/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptylediode@path}} +\compattikzset{empty varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyvarcap@path}} + + \compattikzset{Schottky diode/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi Schottky diode}} + \compattikzset{Zener diode/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi Zener diode}} + \compattikzset{tunnel diode/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi tunnel diode}} + \compattikzset{photodiode/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi photodiode}} + \compattikzset{led/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi led}} + \compattikzset{varcap/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi varcap}} + \compattikzset{diode/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi diode}} %%%%%%%%%%%%@@@ + + + + +\compattikzset{thyristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thyristor@path}} +\compattikzset{memristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@memristor@path}} +\compattikzset{triac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@triac@path}} + +\compattikzset{closing switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cspst@path, l=#1}} +\compattikzset{opening switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ospst@path, l=#1}} +\compattikzset{switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@spst@path, l=#1}} +\compattikzset{push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbutton@path, l=#1}} +\compattikzset{toggle switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@toggleswitch@path}} + +\compattikzset{ammeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ammeter@path}} +\compattikzset{voltmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@voltmeter@path}} +\compattikzset{ohmmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ohmmeter@path}} + +% short forms +\compattikzset{esource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@esource@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\compattikzset{dcvsource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dcvsource@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\compattikzset{dcisource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dcisource@path, l=#1}} +\compattikzset{myvsource/.style = {\comnpatname dcvsource = #1}}%For compability, not documented, can be removed in further versions +\compattikzset{myisource/.style = {\comnpatname dcisource = #1}}%For compability, not documented, can be removed in further versions +\compattikzset{vsource/.style = {\comnpatname voltage source = #1}} +\compattikzset{isource/.style = {\comnpatname current source = #1}} +\compattikzset{cisource/.style = {\comnpatname controlled current source = #1}} +\compattikzset{cvsource/.style = {\comnpatname controlled voltage source = #1}} +\compattikzset{vsourcesin/.style = {\comnpatname sinusoidal voltage source = #1}} +\compattikzset{vsourcesquare/.style = {\comnpatname square voltage source = #1}} +\compattikzset{vsourcetri/.style = {triangle voltage source = #1}} +\compattikzset{isourcesin/.style = {\comnpatname sinusoidal current source = #1}} +\compattikzset{cisourcesin/.style = {\comnpatname controlled sinusoidal current source = #1}} +\compattikzset{cvsourcesin/.style = {\comnpatname controlled sinusoidal voltage source = #1}} + +\compattikzset{controlled vsource/.style = {\comnpatname controlled voltage source = #1}} +\compattikzset{controlled isource/.style = {\comnpatname controlled current source = #1}} +\compattikzset{controlled vsourcesin/.style = {\comnpatname controlled sinusoidal voltage source = #1}} +\compattikzset{controlled isourcesin/.style = {\comnpatname controlled sinusoidal current source = #1}} + +\compattikzset{R/.style= {\comnpatname resistor = #1}} +%\ifpgf@circuit@compat\else\compattikzset{R/.style= {resistor = #1}}\fi +\compattikzset{vR/.style= {\comnpatname variable resistor = #1}} +\compattikzset{phR/.style= {\comnpatname photoresistor = #1}} +\compattikzset{thR/.style= {\comnpatname thermistor = #1}} +\compattikzset{thRp/.style= {\comnpatname thermistor ptc= #1}} +\compattikzset{thRn/.style= {\comnpatname thermistor ntc= #1}} +\compattikzset{pR/.style= {\comnpatname potentiometer = #1}} +\compattikzset{C/.style = {\comnpatname capacitor = #1}} +\compattikzset{pC/.style = {\comnpatname polar capacitor = #1}} +\compattikzset{vC/.style = {\comnpatname variable capacitor = #1}} +\compattikzset{L/.style = {\comnpatname inductor = #1}} +\compattikzset{vL/.style = {\comnpatname variable inductor = #1}} +\compattikzset{V/.style = {\comnpatname voltage source = #1}} +\compattikzset{cV/.style = {\comnpatname controlled voltage source = #1}} +\compattikzset{sV/.style = {\comnpatname sinusoidal voltage source = #1}} +\compattikzset{sqV/.style = {\comnpatname square voltage source = #1}} +\compattikzset{csV/.style = {\comnpatname controlled sinusoidal voltage source = #1}} +\def\pgf@temp#1{ + \compattikzset{V#1/.style = {\comnpatname voltage source, v#1=##1} } + \compattikzset{cV#1/.style = {\comnpatname controlled voltage source, v#1=##1} } + \compattikzset{sV#1/.style = {\comnpatname sinusoidal voltage source, v#1=##1} } + \compattikzset{csV#1/.style = {\comnpatname controlled sinusoidal voltage source, v#1=##1} } +} +\pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<} +\pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_} +\compattikzset{I/.style = {\comnpatname current source = #1}} +\compattikzset{cI/.style = {\comnpatname controlled current source = #1}} +\compattikzset{sI/.style = {\comnpatname sinusoidal current source = #1}} +\compattikzset{csI/.style = {\comnpatname controlled sinusoidal current source = #1}} +\def\pgf@temp#1{ + \compattikzset{I#1/.style = {\comnpatname current source, i#1=##1} } + \compattikzset{cI#1/.style = {\comnpatname controlled current source, i#1=##1} } + \compattikzset{sI#1/.style = {\comnpatname sinusoidal current source, i#1=##1} } + \compattikzset{csI#1/.style = {\comnpatname 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{_} +\compattikzset{Do/.style = {\comnpatname empty diode}} +\compattikzset{tDo/.style = {\comnpatname empty tunnel diode}} +\compattikzset{zDo/.style = {\comnpatname empty Zener diode}} +\compattikzset{sDo/.style = {\comnpatname empty Schottky diode}} +\compattikzset{pDo/.style = {\comnpatname empty photodiode}} +\compattikzset{leDo/.style = {\comnpatname empty led}} +\compattikzset{VCo/.style = {\comnpatname empty varcap}} +\compattikzset{D*/.style = {\comnpatname full diode}} +\compattikzset{tD*/.style = {\comnpatname full tunnel diode}} +\compattikzset{zD*/.style = {\comnpatname full Zener diode}} +\compattikzset{sD*/.style = {\comnpatname full Schottky diode}} +\compattikzset{pD*/.style = {\comnpatname full photodiode}} +\compattikzset{leD*/.style = {\comnpatname full led}} +\compattikzset{VC*/.style = {\comnpatname full varcap}} +\compattikzset{D/.style = {\comnpatname diode}} +\compattikzset{tD/.style = {\comnpatname tunnel diode}} +\compattikzset{zD/.style = {\comnpatname Zener diode}} +\compattikzset{sD/.style = {\comnpatname Schottky diode}} +\compattikzset{pD/.style = {\comnpatname photodiode}} +\compattikzset{leD/.style = {\comnpatname led}} +\compattikzset{VC/.style = {\comnpatname varcap}} + +\compattikzset{Tr/.style = {\comnpatname triac}} +\compattikzset{Mr/.style = {\comnpatname memristor}} +\compattikzset{Ty/.style = {\comnpatname thyristor}} + +\compattikzset{cspst/.style = {\comnpatname closing switch = #1}} +\compattikzset{ospst/.style = {\comnpatname opening switch = #1}} +\compattikzset{spst/.style = {switch = #1}} + +\compattikzset{afuse/.style = {\comnpatname asymmetric fuse=#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} + } + ($(\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{ + \compattikzset{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{nigfetebulk} +\pgf@circ@definetranspath{pfet} +\pgf@circ@definetranspath{pigfete} +\pgf@circ@definetranspath{pigfetd} +\pgf@circ@definetranspath{pigfetebulk} +\pgf@circ@definetranspath{njfet} +\pgf@circ@definetranspath{pjfet} +\pgf@circ@definetranspath{pigbt} +\pgf@circ@definetranspath{nigbt} diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex new file mode 100644 index 00000000000..8a1e62e29fc --- /dev/null +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex @@ -0,0 +1,2868 @@ +% Copyright 2007-2009 by Massimo Redaelli +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Public License. +% +% See the file doc/LICENSE for more details. + +%% Generic macro for defining a bipole shape +% #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 + + +\long\def\pgfcircdeclarebipole#1#2#3#4#5#6{ + \pgfdeclareshape{#3shape}{ + + \savedanchor{\northeast}{ + \pgf@y=#4\pgf@circ@Rlen + \pgf@y=.5\pgf@y + \pgf@x=#5\pgf@circ@Rlen + \pgf@x=.5\pgf@x + } + \savedanchor{\northeastborder}{ + \pgf@y=#4\pgf@circ@Rlen + \pgf@y=.5\pgf@y + \pgf@y=\ctikzvalof{bipoles/border margin}\pgf@y + \pgf@x=#5\pgf@circ@Rlen + \pgf@x=.5\pgf@x + \pgf@x=\ctikzvalof{bipoles/border margin}\pgf@x + } + \savedanchor{\southwestborder}{ + \pgf@y=-#2\pgf@circ@Rlen + \pgf@y=.5\pgf@y + \pgf@y=\ctikzvalof{bipoles/border margin}\pgf@y + \pgf@x=-#5\pgf@circ@Rlen + \pgf@x=.5\pgf@x + \pgf@x=\ctikzvalof{bipoles/border margin}\pgf@x + } + \savedanchor{\southwest}{ + \pgf@y=-#2\pgf@circ@Rlen + \pgf@y=.5\pgf@y + \pgf@x=-#5\pgf@circ@Rlen + \pgf@x=.5\pgf@x + } + \savedanchor{\centerpoint}{ + \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 + \pgf@y=.5\pgf@y + } + \anchor{center}{\pgfpointorigin} + \anchor{n}{ + \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi + \pgf@x=0cm + } + \anchor{ne}{ + \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi + } + \anchor{nw}{ + \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi + \pgf@x=-\pgf@x + } + \anchor{e}{% + \ifpgf@circuit@bipole@reversed\else\southwest\northeast\fi + \pgf@y=0cm + } + \anchor{s}{% + \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi + \pgf@x=0cm + } + \anchor{se}{% + \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi + \pgf@x=-\pgf@x + } + \anchor{sw}{% + \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi + } + \anchor{w}{ + \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi + \pgf@y=0cm + } + \anchor{north}{ + \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi + \pgf@x=0cm + } + \anchor{east}{% + \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi + \pgf@y=0cm + } + \anchor{south}{% + \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi + \pgf@x=0cm + } + \anchor{west}{ + \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi + \pgf@y=0cm + } + \anchor{right}{ + \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi + \pgf@y=0cm + } + \anchor{above}{ + \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi + \pgf@x=0cm + } + \anchor{left}{% + \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi + \pgf@y=0cm + } + \anchor{below}{% + \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi + \pgf@x=0cm + } + \anchor{a}{% + \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi + \pgf@y=0cm + } + \anchor{b} { + \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi + \pgf@y=0cm + } + \savedanchor{\textanchor}{% + \pgf@y=\ht\pgfnodeparttextbox + \pgf@x=-.5\wd\pgfnodeparttextbox + } + \anchor{text}{% + \textanchor + } + \anchorborder{% + \def\pgf@temp{false} + \ifpgf@circuit@bipole@reversed\pgf@temp + \pgf@circ@res@left=-\pgf@x + \pgf@circ@res@right=-\pgf@y + \else + \pgf@circ@res@left=\pgf@x + \pgf@circ@res@right=\pgf@y + \fi + \ifdim\pgf@circ@res@right>0cm + \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@right}}{\northeastborder} + \else + \southwestborder + \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@right}}{\pgfpoint{-\pgf@x}{-\pgf@y}} + \fi + } + + #1 + + \backgroundpath{ + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + + \northeast + \pgf@circ@res@up = \pgf@y + \pgf@circ@res@zero = 0cm + \pgf@circ@res@left = -\pgf@x + \pgf@circ@res@right = \pgf@x + \southwest + \pgf@circ@res@down = \pgf@y + + \pgfstartlinewidth=\pgflinewidth + + #6 + + \pgfsetlinewidth{\pgfstartlinewidth} + } + } +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Standard bipole shapes declarations + +%% Resistor +\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 + + \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@up}} + \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@up}} + \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@up}} + \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} +} + + + +%% 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} + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \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 + \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\myfrac\pgf@circ@res@up}} + \advance\pgf@circ@res@other by 2\pgf@circ@res@step + \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\myfrac\pgf@circ@res@down}} + \advance\pgf@circ@res@other by 2\pgf@circ@res@step + \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\myfrac\pgf@circ@res@up}} + \advance\pgf@circ@res@other by 2\pgf@circ@res@step + \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\myfrac\pgf@circ@res@down}} + \advance\pgf@circ@res@other by 2\pgf@circ@res@step + \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\myfrac\pgf@circ@res@up}} + \advance\pgf@circ@res@other by 2\pgf@circ@res@step + \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\myfrac\pgf@circ@res@down}} + \advance\pgf@circ@res@other by \pgf@circ@res@step + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgfusepath{draw} + + \pgfscope + \pgfsetarrowsend{latex'} + \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@other}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@other}{\pgf@circ@res@down}} + \pgfusepath{draw} + \endpgfscope +} + + + +%% Capacitor + +\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 + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} +} + + +%% 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}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/battery/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 6 + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}} + + \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@down}} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{.5\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{.5\pgf@circ@res@down}} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + + \pgfusepath{draw} +} + + +%% Battery 1 + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/battery1/height}}{battery1}{\ctikzvalof{bipoles/battery1/height}}{\ctikzvalof{bipoles/battery1/width}}{ + \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{0}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}} + \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{0}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}} + \pgfusepath{draw} + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@down}} + + \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@down}} + + + + + \pgfusepath{draw} +} + + + +%% cute inductor + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cuteinductor/height}}{cuteinductor}{\ctikzvalof{bipoles/cuteinductor/height}}{\ctikzvalof{bipoles/cuteinductor/width}}{ + \pgf@circ@res@step=\ctikzvalof{bipoles/cuteinductor/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by \ctikzvalof{bipoles/cuteinductor/coils} %divide by number of coils + \divide \pgf@circ@res@step by 2 %div by two for arcs + + \def\pgf@circ@coilsmall@width{\ctikzvalof{bipoles/cuteinductor/coil aspect}\pgf@circ@res@step} + + \advance \pgf@circ@res@step by \pgf@circ@coilsmall@width %adjust for overlapping lower arc + + \def\pgf@circ@coilwide@width{\pgf@circ@res@step} + + \pgf@circ@res@other = \ctikzvalof{bipoles/cuteinductor/coil height}\pgf@circ@Rlen + \pgf@circ@res@temp =\ctikzvalof{bipoles/cuteinductor/lower coil height}\pgf@circ@Rlen + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left+0.5\pgfstartlinewidth}{-0.5\pgfstartlinewidth}} + \foreach \x in {2,...,\ctikzvalof{bipoles/cuteinductor/coils}} + { + \pgfpatharc{180}{0}{\pgf@circ@coilwide@width and \pgf@circ@res@other} + \pgfpatharc{0}{-180}{\pgf@circ@coilsmall@width and \pgf@circ@res@temp} + } + \pgfpatharc{180}{0}{\pgf@circ@coilwide@width and \pgf@circ@res@other} + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfusepath{stroke} +} + + +%% american inductor + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/americaninductor/height 2}}{americaninductor}{\ctikzvalof{bipoles/americaninductor/height}}{\ctikzvalof{bipoles/americaninductor/width}}{ + \pgf@circ@res@step=\ctikzvalof{bipoles/americaninductor/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by \ctikzvalof{bipoles/americaninductor/coils} + \divide \pgf@circ@res@step by 2 + \pgf@circ@res@other = \ctikzvalof{bipoles/americaninductor/coil height}\pgf@circ@Rlen + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{-0.5\pgfstartlinewidth}} + \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other} + \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other} + \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other} + \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-0.5\pgfstartlinewidth}} + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfusepath{stroke} +} + + + + +%% Independent voltage source + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsource/height}}{vsource}{\ctikzvalof{bipoles/vsource/height}}{\ctikzvalof{bipoles/vsource/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgfusepath{draw} +} + + +%% Independent voltage source - American style + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsourceam/height}}{vsourceAM}{\ctikzvalof{bipoles/vsourceam/height}}{\ctikzvalof{bipoles/vsourceam/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} + + + \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{$+$} + \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@up]{$-$} + + \pgfusepath{draw} +} + + + +%% Independent sinusoidal voltage source + +\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}} + \pgfusepath{draw} + + \pgf@circ@res@up = .5\pgf@circ@res@up + \pgfscope + \pgftransformrotate{90} + \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}} + \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}} + \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}} + \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}} + \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}} + \pgfusepath{draw} + \endpgfscope +} + +% Triangle Voltage source – contributed by Ralf Farkas +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsourcetri/height}}{vsourcetri}{\ctikzvalof{bipoles/vsourcetri/height}}{\ctikzvalof{bipoles/vsourcetri/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} + \pgfusepath{draw} + + \pgf@circ@res@up = .5\pgf@circ@res@up + \pgfscope + \pgftransformrotate{90} + \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}} + \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@up}{0.75\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@up}{-0.75\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{0\pgf@circ@res@up}} + \pgfusepath{draw} + \endpgfscope +} + + +% contributed by Alistair Kwan +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsourcesquare/height}}{vsourcesquare}{\ctikzvalof{bipoles/vsourcesquare/height}}{\ctikzvalof{bipoles/vsourcesquare/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} + \pgfusepath{draw} + + \pgf@circ@res@up = .5\pgf@circ@res@up + \pgfscope + \pgftransformrotate{90} + \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}} + \pgfpathlineto{\pgfpoint{-1\pgf@circ@res@up}{1\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0\pgf@circ@res@up}{1\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0\pgf@circ@res@up}{-1\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{-1\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{0\pgf@circ@res@up}} + \pgfusepath{draw} + \endpgfscope +} + +% Triangle Voltage source – contributed by Ralf Farkas +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsourcetri/height}}{vsourcetri}{\ctikzvalof{bipoles/vsourcetri/height}}{\ctikzvalof{bipoles/vsourcetri/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} + \pgfusepath{draw} + + \pgf@circ@res@up = .5\pgf@circ@res@up + \pgfscope + \pgftransformrotate{90} + \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}} + \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@up}{0.75\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@up}{-0.75\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{0\pgf@circ@res@up}} + \pgfusepath{draw} + \endpgfscope +} + + +%% Empty Source +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/esource/height}}{esource}{\ctikzvalof{bipoles/esource/height}}{\ctikzvalof{bipoles/esource/width}}{ + \pgfpointorigin + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}} + \pgfusepath{draw} +} + +%% DC Current Source with open shape +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/dcisource/height}}{dcisource}{\ctikzvalof{bipoles/dcisource/height}}{\ctikzvalof{bipoles/dcisource/width}}{ + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0}}\pgfpatharc{0}{90}{0.85\pgf@circ@res@right and \pgf@circ@res@up} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0}}\pgfpatharc{0}{-90}{0.85\pgf@circ@res@right and \pgf@circ@res@up} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}\pgfpatharc{180}{270}{0.85\pgf@circ@res@right and \pgf@circ@res@up} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}\pgfpatharc{180}{90}{0.85\pgf@circ@res@right and \pgf@circ@res@up} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgfusepath{draw} + \pgfscope + \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} + \endpgfscope +} + +%% DC-Voltage source +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/dcvsource/height}}{dcvsource}{\ctikzvalof{bipoles/dcvsource/height}}{\ctikzvalof{bipoles/dcvsource/width}}{ + \pgfpointorigin + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@up}{.5\pgf@circ@res@left}} + \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@up}{.5\pgf@circ@res@right}} + \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@down}{.5\pgf@circ@res@left}} + \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@down}{.5\pgf@circ@res@right}} + \pgfusepath{draw} +} + + +%% Independent current source + +\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}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}} + \pgfusepath{draw} +} + + + + +%% Independent current source - American + +\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}} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgfusepath{draw} + \pgfscope + \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} + \endpgfscope +} + + + + +%% Independent sinusoidal current source + +\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}} + \pgfusepath{draw} + + \pgf@circ@res@up = .5\pgf@circ@res@up + \pgfscope + \pgftransformrotate{90} + \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}} + \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}} + \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}} + \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}} + \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}} + \pgfusepath{draw} + \endpgfscope + +} + + +%% Controlled voltage source + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cvsource/height}}{cvsource}{\ctikzvalof{bipoles/cvsource/height}}{\ctikzvalof{bipoles/cvsource/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgfusepath{draw} +} + + + + +%% Controlled voltage source - American + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cvsourceam/height}}{cvsourceAM}{\ctikzvalof{bipoles/cvsourceam/height}}{\ctikzvalof{bipoles/cvsourceam/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@left]{$+$} + \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@right]{$-$} + \pgfusepath{draw} +} + + +%% Controlled sinusoidal voltage source + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cvsourcesin/height}}{cvsourcesin}{\ctikzvalof{bipoles/cvsourcesin/height}}{\ctikzvalof{bipoles/cvsourcesin/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfscope + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgfusepath{draw} + \endpgfscope + + \pgf@circ@res@up = .5\pgf@circ@res@up + \pgfscope + \pgftransformrotate{90} + \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}} + \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}} + \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}} + \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}} + \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}} + \pgfusepath{draw} + \endpgfscope +} + + + +%% Controlled sinusoidal current source + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cvsourcesin/height}}{cisourcesin}{\ctikzvalof{bipoles/cvsourcesin/height}}{\ctikzvalof{bipoles/cvsourcesin/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfscope + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgfusepath{draw} + \endpgfscope + + \pgf@circ@res@up = .5\pgf@circ@res@up + \pgfscope + \pgftransformrotate{90} + \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}} + \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}} + \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}} + \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}} + \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}} + \pgfusepath{draw} + \endpgfscope +} + + + + +%% Controlled current source + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cisource/height}}{cisource}{\ctikzvalof{bipoles/cisource/height}}{\ctikzvalof{bipoles/cisource/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}} + \pgfusepath{draw} +} + + + + +%% Controlled current source - American + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cisourceam/height}}{cisourceAM}{\ctikzvalof{bipoles/cisourceam/height}}{\ctikzvalof{bipoles/cisourceam/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgfusepath{draw} + \pgfscope + \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgfnode{currarrow}{center}{}{}{\pgfusepath{draw}} + \endpgfscope +} + +%% Black generic diode + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fulldiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfscope + \pgftransformxshift{\pgf@circ@res@left} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} + \pgfusepath{draw,fill} + \endpgfscope + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfusepath{draw} +} + +%% Black Zener diode + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fullzdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfscope + \pgftransformxshift{\pgf@circ@res@left} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} + \pgfusepath{draw,fill} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.2\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfusepath{draw} + \endpgfscope +} + +%% Black Schottky diode + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fullsdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfscope + \pgftransformxshift{\pgf@circ@res@left} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} + \pgfusepath{draw,fill} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{.8\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.2\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.2\pgf@circ@res@left}{.8\pgf@circ@res@up}} + \pgfusepath{draw} + \endpgfscope + +} + +%% Black tunnel diode + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fulltdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfscope + \pgftransformxshift{\pgf@circ@res@left} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} + \pgfusepath{draw,fill} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfusepath{draw} + \endpgfscope +} + +%% Black light emitting diode + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fulllediode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfscope + \pgftransformxshift{\pgf@circ@res@left} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} + \pgfusepath{draw,fill} + \endpgfscope + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfusepath{draw} + + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfsetarrowsend{latex'} + \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}} + \pgfusepath{draw} + +} + +%% Black photodiode + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fullpdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfscope + \pgftransformxshift{\pgf@circ@res@left} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} + \pgfusepath{draw,fill} + \endpgfscope + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfusepath{draw} + + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfsetarrowsstart{latex'} + \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}} + \pgfusepath{draw} +} + +%% Black varcap + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/varcap/height}}{fullvarcap}{\ctikzvalof{bipoles/varcap/height}}{\ctikzvalof{bipoles/varcap/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfscope + \pgftransformxshift{\pgf@circ@res@left} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{0pt}} + \pgfusepath{draw,fill} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfusepath{draw} + + \endpgfscope +} + +%% Empty generic diode + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptydiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ + + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfscope + \pgftransformxshift{\pgf@circ@res@left} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} + \pgfusepath{draw} + \endpgfscope + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfusepath{draw} +} + +%% Empty Zener diode + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptyzdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfscope + \pgftransformxshift{\pgf@circ@res@left} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.2\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfusepath{draw} + \endpgfscope +} + +%% Empty Schottky diode + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptysdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfscope + \pgftransformxshift{\pgf@circ@res@left} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{.8\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.2\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.2\pgf@circ@res@left}{.8\pgf@circ@res@up}} + \pgfusepath{draw} + \endpgfscope + +} + +%% Empty tunnel diode + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptytdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfscope + \pgftransformxshift{\pgf@circ@res@left} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfusepath{draw} + \endpgfscope +} + +%% Empty light emitting diode + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptylediode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfscope + \pgftransformxshift{\pgf@circ@res@left} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} + \pgfusepath{draw} + \endpgfscope + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfusepath{draw} + + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfsetarrowsend{latex'} + \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}} + \pgfusepath{draw} +} + +%% Empty photodiode + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptypdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfscope + \pgftransformxshift{\pgf@circ@res@left} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} + \pgfusepath{draw} + \endpgfscope + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfusepath{draw} + + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfsetarrowsstart{latex'} + \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}} + \pgfusepath{draw} +} + +%% Empty varcap + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/varcap/height}}{emptyvarcap}{\ctikzvalof{bipoles/varcap/height}}{\ctikzvalof{bipoles/varcap/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfscope + \pgftransformxshift{\pgf@circ@res@left} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{0pt}} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfusepath{draw} + + \endpgfscope +} + +%% SPST + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/interr/height 2}}{spst}{\ctikzvalof{bipoles/interr/height}}{\ctikzvalof{bipoles/interr/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{.9\pgf@circ@res@left}{.9\pgf@circ@res@up}} + \pgfpatharc{65}{25}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/interr/width}\pgf@circ@Rlen} + %\pgfsetarrowsend{latex'} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{.1\pgf@circ@res@right}{-.25\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{.14\pgf@circ@res@right}{-.35\pgf@circ@res@up}} + \pgfsetarrowsend{latex'} + \pgfusepath{draw} + +} + +%% Closing SPST + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/interr/height 2}}{cspst}{\ctikzvalof{bipoles/interr/height}}{\ctikzvalof{bipoles/interr/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{.9\pgf@circ@res@left}{.9\pgf@circ@res@up}} + \pgfpatharc{65}{25}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/interr/width}\pgf@circ@Rlen} + %\pgfsetarrowsend{latex'} + \pgfusepath{draw} + +} + +%% Opening SPST + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/interr/height 2}}{ospst}{\ctikzvalof{bipoles/interr/height}}{\ctikzvalof{bipoles/interr/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{.3\pgf@circ@res@right}{.1\pgf@circ@res@down}} + \pgfpatharc{15}{50}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/interr/width}\pgf@circ@Rlen} + %\pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{.85\pgf@circ@res@left}{1.25\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{.87\pgf@circ@res@left}{1.26\pgf@circ@res@up}} + \pgfsetarrowsend{latex'} + \pgfusepath{draw} + + +} + + +%% Push Button + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/pushbutton/height 2}}{pushbutton}{\ctikzvalof{bipoles/pushbutton/height}}{\ctikzvalof{bipoles/pushbutton/width}}{ + + %\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{0}{.5\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@up}} + \pgfusepath{draw} + + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}} + \pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}} + \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}} +} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Ammeter + +\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 + \else + \def\pgf@circ@temp{below} + \ifx\tikz@res@label@pos\pgf@circ@temp + \pgf@circ@res@step=-1.2\pgf@circ@res@up + \else + \pgf@circ@res@step=1.2\pgf@circ@res@up + \fi + \fi + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgfpointorigin \pgf@circ@res@other = \pgf@x \advance \pgf@circ@res@other by -\pgf@circ@res@up + \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}} + \pgfusepath{draw} + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfscope + \pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up} + \pgfusepath{draw} + \endpgfscope + + \pgfsetlinewidth{\pgfstartlinewidth} + + \pgfsetarrowsend{latex} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}} + \pgfusepath{draw} + \pgfsetarrowsend{} + + + \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgfusepath{draw} + + \pgfnode{circle}{center}{\textbf{A}}{}{} +} + +%% Ohmmeter – contributed by Ralf Farkas + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/ohmmeter/height}}{ohmmeter}{\ctikzvalof{bipoles/ohmmeter/height}}{\ctikzvalof{bipoles/ohmmeter/width}}{ + \def\pgf@circ@temp{right} + \ifx\tikz@res@label@pos\pgf@circ@temp + \pgf@circ@res@step=-1.2\pgf@circ@res@up + \else + \def\pgf@circ@temp{below} + \ifx\tikz@res@label@pos\pgf@circ@temp + \pgf@circ@res@step=-1.2\pgf@circ@res@up + \else + \pgf@circ@res@step=1.2\pgf@circ@res@up + \fi + \fi + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgfpointorigin \pgf@circ@res@other = \pgf@x \advance \pgf@circ@res@other by -\pgf@circ@res@up + \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}} + \pgfusepath{draw} + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfscope + \pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up} + \pgfusepath{draw} + \endpgfscope + + \pgfsetlinewidth{\pgfstartlinewidth} + + \pgfsetarrowsend{latex} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}} + \pgfusepath{draw} + \pgfsetarrowsend{} + + + \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgfusepath{draw} + + \pgfnode{circle}{center}{\boldmath$\Omega$}{}{} +} + +%% Voltmeter + +\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 + \else + \def\pgf@circ@temp{below} + \ifx\tikz@res@label@pos\pgf@circ@temp + \pgf@circ@res@step=-1.2\pgf@circ@res@up + \else + \pgf@circ@res@step=1.2\pgf@circ@res@up + \fi + \fi + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgfpointorigin \pgf@circ@res@other = \pgf@x \advance \pgf@circ@res@other by -\pgf@circ@res@up + \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}} + \pgfusepath{draw} + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfscope + \pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up} + \pgfusepath{draw} + \endpgfscope + + \pgfsetlinewidth{\pgfstartlinewidth} + + \pgfsetarrowsend{latex} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}} + \pgfusepath{draw} + \pgfsetarrowsend{} + + + \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgfusepath{draw} + + \pgfnode{circle}{center}{\textbf{V}}{}{} + +} + +%% Short circuit + +\pgfcircdeclarebipole{}{0}{short}{0}{0}{ } + +%% Open circuit + +\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}}{ + + %\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} +} + + +%% fuse + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/fuse/height}}{fuse}{\ctikzvalof{bipoles/fuse/height}}{\ctikzvalof{bipoles/fuse/width}}{ + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}} + \pgfusepath{draw} + + \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} +} + + + +%% Generic bipole, filled - used as inductor by some (bleah) + +\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 + + \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,fill} +} + + +%% Generic asymmetric bipole + +\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} +} + + +%% asymmetric fuse + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/afuse/height}}{afuse}{\ctikzvalof{bipoles/afuse/height}}{\ctikzvalof{bipoles/afuse/width}}{ + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}} + \pgfusepath{draw} + + \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} + + \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{stroke,fill} +} + + + + +%% Generic empty tunable + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/tgeneric/height}}{tgeneric}{\ctikzvalof{bipoles/tgeneric/height}}{\ctikzvalof{bipoles/tgeneric/width}}{ + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{.4\pgf@circ@res@down}} + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfusepath{draw} + + \pgfscope + \pgfsetarrowsend{latex'} + \pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfusepath{draw} + \endpgfscope +} + +%% Photoresistor + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/photoresistor/height 2}}{photoresistor}{\ctikzvalof{bipoles/photoresistor/height}}{\ctikzvalof{bipoles/photoresistor/width}}{ + \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 + \pgfsetarrowsend{latex'} + \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{.3\pgf@circ@res@right}{-1.2\pgf@circ@res@down}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{.05\pgf@circ@res@right}{-1.2\pgf@circ@res@down}} + \pgfusepath{draw} + \endpgfscope +} + + + + +%% Thermistor +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/thermistor/height}}{thermistor}{\ctikzvalof{bipoles/thermistor/height}}{\ctikzvalof{bipoles/thermistor/width}}{ + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistor/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistor/main}\pgf@circ@res@up}} + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfusepath{draw} + + %\pgfscope + \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfusepath{draw} + %\endpgfscope +} + + +%% Thermistor PTC +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/thermistorptc/height 2}}{thermistorptc}{\ctikzvalof{bipoles/thermistorptc/height}}{\ctikzvalof{bipoles/thermistorptc/width}}{ + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorptc/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorptc/main}\pgf@circ@res@up}} + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{-\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}} + \pgfusepath{draw} + + \pgfsetlinewidth{\pgfstartlinewidth} + \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\tiny$\vartheta$} + \pgfsetarrowsend{latex'} + \pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{.45\pgf@circ@res@left}{.7\pgf@circ@res@down}} + \pgfusepath{draw} +} + +%% Thermistor NTC +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/thermistorntc/height 2}}{thermistorntc}{\ctikzvalof{bipoles/thermistorntc/height}}{\ctikzvalof{bipoles/thermistorntc/width}}{ + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorntc/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorntc/main}\pgf@circ@res@up}} + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{-\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}} + \pgfusepath{draw} + + \pgfsetlinewidth{\pgfstartlinewidth} + \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\tiny$\vartheta$} + \pgfsetarrowsend{latex'} + \pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@left}{.7\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{.45\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfusepath{draw} +} + +%% thermocouple +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/thermocouple/height 2}}{thermocouple}{\ctikzvalof{bipoles/thermocouple/height}}{\ctikzvalof{bipoles/thermocouple/width}}{ + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}} + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@down}} + \pgfusepath{draw} + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}} + \pgfusepath{draw} +} + +%% Varistor +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/varistor/height}}{varistor}{\ctikzvalof{bipoles/varistor/height}}{\ctikzvalof{bipoles/varistor/width}}{ + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/varistor/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/varistor/main}\pgf@circ@res@up}} + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \pgftext[top,x=.65\pgf@circ@res@left,y=1.2\pgf@circ@res@down]{{\tiny\textsf{U}}} +} + + + +%% 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}{.4\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{.4\pgf@circ@res@down}} + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfusepath{draw,fill} + + \pgfscope + \pgfsetarrowsend{latex'} + \pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{-.5\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} %divide by number of coils + \divide \pgf@circ@res@step by 2 %div by two for arcs + + \def\pgf@circ@coilsmall@width{\ctikzvalof{bipoles/vcuteinductor/coil aspect}\pgf@circ@res@step} + + \advance \pgf@circ@res@step by \pgf@circ@coilsmall@width %adjust for overlapping lower arc + + \def\pgf@circ@coilwide@width{\pgf@circ@res@step} + + \pgf@circ@res@other = \ctikzvalof{bipoles/vcuteinductor/coil height}\pgf@circ@Rlen + \pgf@circ@res@temp =\ctikzvalof{bipoles/vcuteinductor/lower coil height}\pgf@circ@Rlen + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left+0.5\pgfstartlinewidth}{-0.5\pgfstartlinewidth}} + \foreach \x in {2,...,\ctikzvalof{bipoles/vcuteinductor/coils}} + { + \pgfpatharc{180}{0}{\pgf@circ@coilwide@width and \pgf@circ@res@other} + \pgfpatharc{0}{-180}{\pgf@circ@coilsmall@width and \pgf@circ@res@temp} + } + \pgfpatharc{180}{0}{\pgf@circ@coilwide@width and \pgf@circ@res@other} + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfusepath{stroke} + +\pgfscope + \pgfsetarrowsend{latex'} + \pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{1.5\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{2.5\pgf@circ@res@up}} + \pgfusepath{draw} + \endpgfscope +} + + +%% variable american inductor + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vamericaninductor/height 2}}{vamericaninductor}{\ctikzvalof{bipoles/vamericaninductor/height}}{\ctikzvalof{bipoles/vamericaninductor/width}}{ + \pgf@circ@res@step=\ctikzvalof{bipoles/vamericaninductor/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by \ctikzvalof{bipoles/vamericaninductor/coils} + \divide \pgf@circ@res@step by 2 + \pgf@circ@res@other = \ctikzvalof{bipoles/vamericaninductor/coil height}\pgf@circ@Rlen + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{-0.5\pgfstartlinewidth}} + \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other} + \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other} + \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other} + \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfusepath{stroke} + + \pgfscope + \pgfsetarrowsend{latex'} + \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@left}{\pgf@circ@res@up}} + \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{latex'} + \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 + +\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}} + + +%% The output routine + +\def\drawpoles{ + \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/left}} \def\pgf@temp{empty} } + \ifx\pgf@temp\pgf@circ@temp + { (\tikztostart) node[ocirc] {} } + \else + \pgfextra{ \def\pgf@temp{full} } + \ifx\pgf@temp\pgf@circ@temp + { (\tikztostart) node[circ] {} } + \fi + \fi + \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/right}} \def\pgf@temp{empty} } + \ifx\pgf@temp\pgf@circ@temp + { (\tikztotarget) node[ocirc] {} } + \else + \pgfextra{ \def\pgf@temp{full} } + \ifx\pgf@temp\pgf@circ@temp + { (\tikztotarget) node[circ] {} } + \fi + \fi +} + + + + + + + + + + + + + + + + + + + + +%% Lamp + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/lamp/height}}{lamp}{\ctikzvalof{bipoles/lamp/height}}{\ctikzvalof{bipoles/lamp/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} + \pgfpathmoveto{\pgfpoint{.7071*\pgf@circ@res@left}{.7071*\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{.7071*\pgf@circ@res@right}{.7071*\pgf@circ@res@down}} + \pgfpathmoveto{\pgfpoint{.7071*\pgf@circ@res@left}{.7071*\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{.7071*\pgf@circ@res@right}{.7071*\pgf@circ@res@up}} + \pgfusepath{draw} +} + + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/tline/height} + }{tline}{\ctikzvalof{bipoles/tline/height} + }{\ctikzvalof{bipoles/tline/width} + } + { + \pgf@circ@res@step=.2\pgf@circ@res@right % half x axis + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathellipse{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{0}} + {\pgfpoint{\pgf@circ@res@step}{0}} + {\pgfpoint{0}{-\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@step}{\pgf@circ@res@up}} + \pgfpatharc{-90}{90}{-\pgf@circ@res@step and -\pgf@circ@res@up} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{\pgf@circ@res@down}} + \pgfusepath{draw} +} + + + + +%% SQUID added by Cor Molenaar 5 March 2010 + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/squid/height}}{squid}{\ctikzvalof{bipoles/squid/height}}{\ctikzvalof{bipoles/squid/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} + \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{1.35*\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.65*\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.65*\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{1.35*\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{1.35*\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.65*\pgf@circ@res@down}} + \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.65*\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{1.35*\pgf@circ@res@down}} + + \pgfusepath{draw} +} + + + +% Generic barrier added by Cor Molenaar 5 March 2010 + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/barrier/height}}{barrier}{\ctikzvalof{bipoles/barrier/height}}{\ctikzvalof{bipoles/barrier/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@step}} + \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.35*\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.35*\pgf@circ@res@down}} + \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.35*\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.35*\pgf@circ@res@up}} + + \pgfusepath{draw} +} + + +% Contributed by Danilo Piazzalunga + +\pgfdeclareshape{buffer} + { + \anchor{center}{\pgfpointorigin} + \savedanchor\northwest{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/buffer/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/buffer/width}\pgf@x + \pgf@x=.5\pgf@x + } + \anchor{south}{ + \northwest + \pgf@y=-\pgf@y + } + \savedanchor\left{% + \pgf@y=0pt + } + \anchor{in}{ + \northwest + \pgf@y=0pt + } + \anchor{out}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + + \backgroundpath{ + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + + + \northwest + \pgf@circ@res@up = \pgf@y + \pgf@circ@res@down = -\pgf@y + \pgf@circ@res@right = -\pgf@x + \pgf@circ@res@left = \pgf@x + + \pgfscope + \pgfsetlinewidth{2\pgflinewidth} + \pgftransformxshift{.7\pgf@circ@res@left} + \pgf@circ@res@step=\pgf@circ@res@right + \advance\pgf@circ@res@step by -\pgf@circ@res@left + \pgf@circ@res@step=.7\pgf@circ@res@step + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}} + \pgfusepath{draw} + \endpgfscope + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} + \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}} + + \pgfusepath{draw} + + } + } + + + + + +\pgfdeclareshape{plain amp} + { + \anchor{center}{\pgfpointorigin} + \savedanchor\northwest{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/width}\pgf@x + \pgf@x=.5\pgf@x + } + \anchor{south}{ + \northwest + \pgf@y=-\pgf@y + } + \savedanchor\left{% + \pgf@y=0pt + } + \savedanchor\inOne{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/width}\pgf@x + \pgf@x=.5\pgf@x + } + \anchor{-}{ + \inOne + } + \anchor{+}{ + \inOne + \pgf@y=-\pgf@y + } + \savedanchor\up{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/width}\pgf@x + \pgf@x=.5\pgf@x + \pgf@circ@res@up = \pgf@y + \pgf@circ@res@right = -\pgf@x + \pgf@circ@res@left = \pgf@x + \pgfpointlineattime{ + \pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/up pos}}{ + \pgfpoint{ + \pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/port width}\pgf@circ@res@left} + {\pgf@circ@res@up}} + {\pgfpoint{.7\pgf@circ@res@right}{0pt}} + } + \anchor{up}{ + \up + } + \anchor{down}{ + \up + \pgf@y=-\pgf@y + } + \anchor{out}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + + \backgroundpath{ + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + + + \northwest + \pgf@circ@res@up = \pgf@y + \pgf@circ@res@down = -\pgf@y + \pgf@circ@res@right = -\pgf@x + \pgf@circ@res@left = \pgf@x + + \pgfpathmoveto{\pgfpoint + {\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/port width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@up}} + + + \pgfpathmoveto{\pgfpoint + {\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/port width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@down}} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} + \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}} + + \pgfusepath{draw} + + + \pgfscope + \pgfsetlinewidth{2\pgflinewidth} + \pgftransformxshift{.7\pgf@circ@res@left} + \pgf@circ@res@step=\pgf@circ@res@right + \advance\pgf@circ@res@step by -\pgf@circ@res@left + \pgf@circ@res@step=.7\pgf@circ@res@step + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}} + \pgfusepath{draw} + \endpgfscope + + + + } + } + +%% Generic two port box +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/twoport/height}}{twoport}{\ctikzvalof{bipoles/twoport/height}}{\ctikzvalof{bipoles/twoport/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/twoport/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 2 + + \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 + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + % rotate inner symbol + \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} + \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135 + \pgftransformrotate{270} + \fi\fi + \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225 + \pgftransformrotate{180} + \fi\fi + \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315 + \pgftransformrotate{90} + \fi\fi + + % draw inner symbol + \pgftext[center,x=0,y=0]{\ctikzvalof{bipoles/twoport/text}} + +} + +%% voltage controled oscillator +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vco/width}}{vco}{\ctikzvalof{bipoles/twoport/width}}{\ctikzvalof{bipoles/vco/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/vco/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 2 + + \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 + + % draw circle + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathcircle{\pgfpoint{0}{0}} {\pgf@circ@res@step} + \pgfusepath{draw} + + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + % rotate inner symbol + \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} + \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135 + \pgftransformrotate{270} + \fi\fi + \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible + \pgftransformrotate{180} + \fi\fi + \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315 + \pgftransformrotate{90} + \fi\fi + + % draw inner sine waves + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{-.5\pgf@circ@res@step}{0\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfusepath{draw} + +} + +%% bandpass filter +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/bandpass/width}}{bandpass}{\ctikzvalof{bipoles/bandpass/width}}{\ctikzvalof{bipoles/bandpass/width}}{ + + \pgf@circ@res@step = \ctikzvalof{bipoles/bandpass/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 2 + + \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 + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + % rotate inner symbol + \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} + \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135 + \pgftransformrotate{270} + \fi\fi + \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible + \pgftransformrotate{180} + \fi\fi + \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315 + \pgftransformrotate{90} + \fi\fi + + % draw inner symbol + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{0.35\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.65\pgf@circ@res@step}} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.65\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{-0.35\pgf@circ@res@step}} + \pgfusepath{draw} +} + +%% highpass filter +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/highpass/width}}{highpass}{\ctikzvalof{bipoles/highpass/width}}{\ctikzvalof{bipoles/highpass/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/highpass/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 2 + + \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 + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + % rotate inner symbol + \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} + \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135 + \pgftransformrotate{270} + \fi\fi + \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible + \pgftransformrotate{180} + \fi\fi + \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315 + \pgftransformrotate{90} + \fi\fi + + % draw inner symbol + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.15\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.15\pgf@circ@res@step}} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.65\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{-0.35\pgf@circ@res@step}} + \pgfusepath{draw} +} + +%% lowpass filter +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/lowpass/width}}{lowpass}{\ctikzvalof{bipoles/lowpass/width}}{\ctikzvalof{bipoles/lowpass/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/lowpass/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 2 + + \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 + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + % rotate inner symbol + \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} + \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135 + \pgftransformrotate{270} + \fi\fi + \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible + \pgftransformrotate{180} + \fi\fi + \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315 + \pgftransformrotate{90} + \fi\fi + + % draw inner symbol + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{0.35\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.65\pgf@circ@res@step}} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.15\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.15\pgf@circ@res@step}} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfusepath{draw} +} + +%% ADC +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/adc/width}}{adc}{\ctikzvalof{bipoles/adc/width}}{\ctikzvalof{bipoles/adc/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/adc/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 2 + + \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 + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + % rotate inner symbol + \def\texti{A} + \def\textii{D} + \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} + \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135 + \def\texti{D} + \def\textii{A} + \pgftransformrotate{270} + \fi\fi + \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible + \def\texti{D} + \def\textii{A} + \pgftransformrotate{180} + \fi\fi + \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315 + \pgftransformrotate{90} + \def\texti{A} + \def\textii{D} + \fi\fi + + % draw inner symbol + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfusepath{draw} + + \pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{\textsf{\texti}} + \pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{\textsf{\textii}} +} + +%% DAC +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/dac/width}}{dac}{\ctikzvalof{bipoles/dac/width}}{\ctikzvalof{bipoles/dac/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/dac/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 2 + + \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 + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + % rotate inner symbol + \def\texti{D} + \def\textii{A} + \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} + \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135 + \def\texti{A} + \def\textii{D} + \pgftransformrotate{270} + \fi\fi + \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible + \def\texti{A} + \def\textii{D} + \pgftransformrotate{180} + \fi\fi + \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315 + \pgftransformrotate{90} + \def\texti{D} + \def\textii{A} + \fi\fi + + % draw inner symbol + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfusepath{draw} + + \pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{\textsf{\texti}} + \pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{\textsf{\textii}} +} + +%% DSP +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/dsp/width}}{dsp}{\ctikzvalof{bipoles/dsp/width}}{\ctikzvalof{bipoles/dsp/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/dsp/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 2 + + \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 + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + % rotate inner symbol + \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} + \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135 + \pgftransformrotate{270} + \fi\fi + \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225 + \pgftransformrotate{180} + \fi\fi + \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315 + \pgftransformrotate{90} + \fi\fi + + % draw inner symbol + \pgftext[center,x=0,y=0]{\textsf{DSP}} +} + +%% FFT +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/fft/width}}{fft}{\ctikzvalof{bipoles/fft/width}}{\ctikzvalof{bipoles/fft/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/fft/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 2 + + \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 + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + % rotate inner symbol + \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} + \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135 + \pgftransformrotate{270} + \fi\fi + \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225 + \pgftransformrotate{180} + \fi\fi + \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315 + \pgftransformrotate{90} + \fi\fi + + % draw inner symbol + \pgftext[center,x=0,y=0]{\textsf{FFT}} +} + +%% Amplifier +\pgfcircdeclarebipole{}{ + %\ifpgf@circuit@box + \ctikzvalof{bipoles/twoport/width} + %\else + % \ctikzvalof{bipoles/amp/width} + %\fi + }{amp}{ + %\ifpgf@circuit@box + \ctikzvalof{bipoles/twoport/width} + %\else + % \ctikzvalof{bipoles/amp/width} + % \fi + }{ + % \ifpgf@circuit@box + \ctikzvalof{bipoles/twoport/width} + % \else + % \ctikzvalof{bipoles/amp/width} + % \fi + }{ + \pgf@circ@res@step = \ctikzvalof{bipoles/amp/width}\pgf@circ@Rlen + + + % draw outer box + %\ifpgf@circuit@box + % \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}} + %\fi + % draw outer box + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + % draw input arrow + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@left}{0.75\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.63\pgf@circ@res@right}{0}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0.75\pgf@circ@res@down}} + \pgfpathclose + \pgfusepath{draw} +} + + +%% variable amplifier +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vamp/width}}{vamp}{\ctikzvalof{bipoles/vamp/width}}{\ctikzvalof{bipoles/vamp/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/vamp/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 2 + + \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 + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@left}{0.75\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.63\pgf@circ@res@right}{0}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0.75\pgf@circ@res@down}} + \pgfpathclose + \pgfusepath{draw} + + \pgfsetarrowsend{latex} + \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.5\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.7\pgf@circ@res@up}} + \pgfusepath{draw} +} + +%% pi attenuator +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/piattenuator/width}}{piattenuator}{\ctikzvalof{bipoles/piattenuator/width}}{\ctikzvalof{bipoles/piattenuator/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/piattenuator/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 2 + + \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 + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + % rotate inner symbol + \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} + \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135 + \pgftransformrotate{270} + \fi\fi + \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315 + \pgftransformrotate{90} + \fi\fi + + % draw inner symbol + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@up}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@up}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}} + \pgfusepath{draw} +} + +%% variable pi attenuator +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vpiattenuator/width}}{vpiattenuator}{\ctikzvalof{bipoles/vpiattenuator/width}}{\ctikzvalof{bipoles/vpiattenuator/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/vpiattenuator/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 2 + + \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 + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + % rotate inner symbol + \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} + \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135 + \pgftransformrotate{270} + \fi\fi + \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315 + \pgftransformrotate{90} + \fi\fi + + % draw inner symbol + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@up}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@up}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}} + \pgfusepath{draw} + + \pgfsetarrowsend{latex} + \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.5\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.8\pgf@circ@res@up}} + \pgfusepath{draw} +} + +%% T attenuator +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/tattenuator/width}}{tattenuator}{\ctikzvalof{bipoles/tattenuator/width}}{\ctikzvalof{bipoles/tattenuator/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/tattenuator/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 2 + + \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 + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + % rotate inner symbol + \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} + \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135 + \pgftransformrotate{270} + \fi\fi + \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315 + \pgftransformrotate{90} + \fi\fi + + % draw inner symbol + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{0pt}{0.4\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{0pt}{0.4\pgf@circ@res@up}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}} + \pgfusepath{draw} +} + +%% variable T attenuator +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vtattenuator/width}}{vtattenuator}{\ctikzvalof{bipoles/vtattenuator/width}}{\ctikzvalof{bipoles/vtattenuator/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/vtattenuator/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 2 + + \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 + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + % rotate inner symbol + \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} + \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135 + \pgftransformrotate{270} + \fi\fi + \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315 + \pgftransformrotate{90} + \fi\fi + + % draw inner symbol + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{0pt}{0.4\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{0pt}{0.4\pgf@circ@res@up}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}} + \pgfusepath{draw} + + \pgfsetarrowsend{latex} + \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.5\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.8\pgf@circ@res@up}} + \pgfusepath{draw} +} + +%% phase shifter +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/phaseshifter/width}}{phaseshifter}{\ctikzvalof{bipoles/phaseshifter/width}}{\ctikzvalof{bipoles/phaseshifter/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/phaseshifter/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 2 + + \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 + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + % rotate inner symbol + \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} + \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135 + \pgftransformrotate{270} + \fi\fi + \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225 + \pgftransformrotate{180} + \fi\fi + \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315 + \pgftransformrotate{90} + \fi\fi + + % inner symbol + \pgftext[center,x=0,y=0]{\Large$\varphi$} +} + +%% variable phase shifter +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/phaseshifter/width}}{vphaseshifter}{\ctikzvalof{bipoles/vphaseshifter/width}}{\ctikzvalof{bipoles/vphaseshifter/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/vphaseshifter/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 2 + + \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 + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + % rotate inner symbol + \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} + \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135 + \pgftransformrotate{270} + \fi\fi + \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225 + \pgftransformrotate{180} + \fi\fi + \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315 + \pgftransformrotate{90} + \fi\fi + + % inner symbol + \pgftext[center,x=0,y=0]{\Large$\varphi$} + + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfsetarrowsend{latex} + \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.65\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.65\pgf@circ@res@up}} + \pgfusepath{draw} +} + +%% detector +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/detector/width}}{detector}{\ctikzvalof{bipoles/detector/width}}{\ctikzvalof{bipoles/detector/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/detector/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 2 + + \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 + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + % draw inner stuff + \pgfsetlinewidth{0.8\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0}} + \pgfpathlineto{\pgfpoint{0.75\pgf@circ@res@right}{0}} + \pgfusepath{draw} + + \ifpgf@circuit@fulldiode + \pgfmathparse{2\pgf@circ@res@up / \pgf@circ@Rlen / \ctikzvalof{bipoles/generic/width}} + \pgftransformscale{\pgfmathresult} + \pgfnode{fulldiodeshape}{center}{}{pgf@fulldiode}{\pgfusepath{fill}} + \else + \pgfmathparse{2\pgf@circ@res@up / \pgf@circ@Rlen / \ctikzvalof{bipoles/resistor/width}} + \pgftransformscale{\pgfmathresult} + \pgfnode{emptydiodeshape}{center}{}{pgf@emptydiode}{\pgfusepath{fill}} + \fi + +} + + + + +%% european gas filled surge arrester + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/european gas filled surge arrester/height}}{european gas filled surge arrester}{\ctikzvalof{bipoles/european gas filled surge arrester/height}}{\ctikzvalof{bipoles/european gas filled surge arrester/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} + + \pgfscope + \pgfsetarrowsend{latex'} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/european gas filled surge arrester/inside}\pgf@circ@res@left}{0pt}} + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfusepath{draw} + + \endpgfscope +} + + + + +%% american gas filled surge arrester + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/american gas filled surge arrester/height}}{american gas filled surge arrester}{\ctikzvalof{bipoles/american gas filled surge arrester/height}}{\ctikzvalof{bipoles/american gas filled surge arrester/width}}{ + %\def\pgf@circ@temp{right} + %\ifx\tikz@res@label@pos\pgf@circ@temp + % \pgf@circ@res@step=-1.2\pgf@circ@res@up + %\else +% \def\pgf@circ@temp{below} +% \ifx\tikz@res@label@pos\pgf@circ@temp +% \pgf@circ@res@step=-1.2\pgf@circ@res@up +% \else +% \pgf@circ@res@step=1.2\pgf@circ@res@up +% \fi +% \fi + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgfpointorigin \pgf@circ@res@other = \pgf@x \advance \pgf@circ@res@other by -\pgf@circ@res@up + \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}} + \pgfusepath{draw} + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfscope + \pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up} + \pgfusepath{draw} + \endpgfscope + + \pgfsetlinewidth{\pgfstartlinewidth} + + + \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgfusepath{draw} + + \pgfnode{circle}{center}{}{}{} + + \pgfscope + \pgfsetarrowsend{latex} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/inside}\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/inside}\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgfusepath{draw} + \endpgfscope{} + + %\pgftransformshift{\pgfpoint{.25\pgf@circ@res@left}{.45\pgf@circ@res@down}} + %\pgfnode{circ}{center}{}{}{} + %\pgftransformshift{} + \pgfcircle{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/dot x}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/dot y}\pgf@circ@res@down}}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/size}\pgf@circ@res@down} + \pgfusepath{fill} +} + + + + + + +\endinput diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirccurrent.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirccurrent.tex new file mode 100644 index 00000000000..e559b5e2c5a --- /dev/null +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirccurrent.tex @@ -0,0 +1,239 @@ +% Copyright 2007-2009 by Massimo Redaelli +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Public License. +% +% See the file doc/LICENSE for more details. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Current handling + +%% Options + + +\ctikzset{i^>/.style = { + i = #1, + \circuitikzbasekey/bipole/current/direction = forward, + \circuitikzbasekey/bipole/current/x position = after, + \circuitikzbasekey/bipole/current/y position = above + } +} + +\ctikzset{i_>/.style = { + i = #1, + \circuitikzbasekey/bipole/current/direction = forward, + \circuitikzbasekey/bipole/current/x position = after, + \circuitikzbasekey/bipole/current/y position = below + } +} + +\ctikzset{i>^/.style = { + i = #1, + \circuitikzbasekey/bipole/current/direction = forward, + \circuitikzbasekey/bipole/current/x position = before, + \circuitikzbasekey/bipole/current/y position = above + } +} + +\ctikzset{i>_/.style = { + i = #1, + \circuitikzbasekey/bipole/current/direction = forward, + \circuitikzbasekey/bipole/current/x position = before, + \circuitikzbasekey/bipole/current/y position = below + } +} + +\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{ + \ifpgf@circuit@bipole@current@before + \ifpgf@circuit@bipole@current@backward + { (\ctikzvalof{bipole/name}.left) -- + node [currarrow, pos=\ctikzvalof{current/distance}, sloped, allow upside down] (Iarrow) {} + (\tikztostart) + } + \else + { (\tikztostart) -- + node [currarrow, pos=\ctikzvalof{current/distance}, sloped, allow upside down] (Iarrow) {} + (\ctikzvalof{bipole/name}.left) + } + \fi + \else + \ifpgf@circuit@bipole@current@backward + { (\tikztotarget) -- + node [currarrow, pos=\ctikzvalof{current/distance}, sloped, allow upside down] (Iarrow) {} + (\ctikzvalof{bipole/name}.right) + } + \else + { (\ctikzvalof{bipole/name}.right) -- + node [currarrow, pos=\ctikzvalof{current/distance}, sloped, allow upside down] (Iarrow) {} + (\tikztotarget) + } + \fi + \fi +} + +%% Output routine +%% #1 - node name + +\def\pgf@circ@drawcurrent{ + \pgfextra{ + \edef\pgf@circ@ffffff{\pgf@circ@direction} + \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@ffffff\pgf@nil} + + \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86 + \ifpgf@circuit@bipole@current@below + \def\pgf@circ@dir{north west} \else \def\pgf@circ@dir{south east} + \fi + \fi\fi + \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95 + \ifpgf@circuit@bipole@current@below + \def\pgf@circ@dir{west} \else \def\pgf@circ@dir{east} + \fi + \fi\fi + \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176 + \ifpgf@circuit@bipole@current@below + \def\pgf@circ@dir{south west}\else \def\pgf@circ@dir{north east} + \fi + \fi\fi + \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185 + \ifpgf@circuit@bipole@current@below + \def\pgf@circ@dir{south}\else\def\pgf@circ@dir{north} + \fi + \fi\fi + \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266 + \ifpgf@circuit@bipole@current@below + \def\pgf@circ@dir{south east}\else\def\pgf@circ@dir{north west} + \fi + \fi\fi + \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275 + \ifpgf@circuit@bipole@current@below + \def\pgf@circ@dir{east}\else \def\pgf@circ@dir{west} + \fi + \fi\fi + \ifnum\pgfcircmathresult >284 \ifnum\pgfcircmathresult <356 + \ifpgf@circuit@bipole@current@below + \def\pgf@circ@dir{north east}\else\def\pgf@circ@dir{south west} + \fi + \fi\fi + \ifnum\pgfcircmathresult <5 + \ifpgf@circuit@bipole@current@below + \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south} + \fi + \fi + \ifnum\pgfcircmathresult >355 + \ifpgf@circuit@bipole@current@below + \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south} + \fi + \fi + + \ifpgf@circuit@bipole@current@below + \def\pgf@circ@bipole@current@label@where{-90} + \else + \def\pgf@circ@bipole@current@label@where{+90} + \fi + } + + + \pgfextra{ \def\pgf@temp{short} \edef\pgf@circ@temp{\ctikzvalof{bipole/kind}} } + + \ifx\pgf@circ@temp\pgf@temp % caso di corrente (centrata) su un corto + \ifpgf@circuit@bipole@current@backward + { (\tikztotarget) -- + node [currarrow, pos=\ctikzvalof{current/distance}, sloped, allow upside down] (Iarrow) {} + (\tikztostart) } + \else + { (\tikztostart) -- + node [currarrow, pos=\ctikzvalof{current/distance}, sloped, allow upside down] (Iarrow) {} + (\tikztotarget) } + \fi + + \else % altri bipoli - e quindi tra nodo e target + + \ifpgf@circuit@bipole@iscurrent + \ifpgf@circuit@europeancurrent + \pgf@circ@drawnormalcurrent + \else + \fi + \else + \pgf@circ@drawnormalcurrent + \fi + \fi + + \ifpgf@circuit@bipole@iscurrent + node [anchor=\pgf@circ@dir] at (\ctikzvalof{bipole/name}.\pgf@circ@bipole@current@label@where) + { \pgf@circ@finallabel{current/} } + \else + (Iarrow.\pgf@circ@bipole@current@label@where) node [anchor=\pgf@circ@dir] + { \pgf@circ@finallabel{current/} } + \fi + +} + +\endinput + + + diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircinputarrows.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircinputarrows.tex new file mode 100644 index 00000000000..d710fb62d8a --- /dev/null +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircinputarrows.tex @@ -0,0 +1,23 @@ +% Copyright 2013 by Stefan Erhardt +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Public License. +% +% See the file doc/LICENSE for more details. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Show input arrows for selected parts + + +\ctikzset{>/.style = { + \circuitikzbasekey/inputarrow = true + } +} + + +\endinput + + + diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirclabel.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirclabel.tex new file mode 100644 index 00000000000..b487023ac91 --- /dev/null +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirclabel.tex @@ -0,0 +1,136 @@ +% Copyright 2007-2009 by Massimo Redaelli +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Public License. +% +% See the file doc/LICENSE for more details. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Bipole label positioning + +%% Options +\ctikzset{label/.style = { l=#1 } } +\ctikzset{l/.code = { + \pgfkeys{/tikz/circuitikz/bipole/label/name=#1} + \ctikzsetvalof{bipole/label/unit}{} + \ifpgf@circ@siunitx + \pgf@circ@handleSI{#1} + \ifpgf@circ@siunitx@res + \edef\pgf@temp{\pgf@circ@handleSI@val} + \pgfkeyslet{/tikz/circuitikz/bipole/label/name}{\pgf@temp} + \edef\pgf@temp{\pgf@circ@handleSI@unit} + \pgfkeyslet{/tikz/circuitikz/bipole/label/unit}{\pgf@temp} + \else + \fi + \else + \fi +}} + +\ctikzset{label above/.code = { + l=#1, + \circuitikzbasekey/bipole/label/position=90 } +} +\ctikzset{l^/.style = { + l=#1, + \circuitikzbasekey/bipole/label/position=90 } +} + +\ctikzset{label below/.code = { + l=#1, + \circuitikzbasekey/bipole/label/position=-90 } +} +\ctikzset{l_/.style = { + l=#1, + \circuitikzbasekey/bipole/label/position=-90 } +} + + + +\def\pgf@circ@drawlabel{ + \pgfextra{ + \edef\pgf@temp{\ctikzvalof{label/align}} + \def\pgf@circ@temp{straight} + } + \ifx\pgf@temp\pgf@circ@temp %straight + \pgf@circ@drawreglabel + \else + \pgfextra{\def\pgf@circ@temp{rotate}} + \ifx\pgf@temp\pgf@circ@temp %rotate + \pgf@circ@drawrotlabel + \else % smart + \pgf@circ@drawsmartlabel + \fi + \fi +} + +\def\pgf@circ@drawsmartlabel{ + \pgfextra{ + %\pgfmathadd{\pgf@circ@direction}{360} + \pgfmathmod{\pgf@circ@direction}{90} + \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil} + } + \ifnum \pgfcircmathresult > 20 + \ifnum \pgfcircmathresult < 70 % NON quasi retto + \pgf@circ@drawrotlabel + \else + \pgf@circ@drawreglabel + \fi + \else + \pgf@circ@drawreglabel + \fi +} + +%% Output routing +%% #1 - node name + +\def\pgf@circ@drawrotlabel{ + \pgfextra{ + % calcolo rotazione label + \def\pgf@circ@temp{\ctikzvalof{bipole/label/position}} %%% àncora label + \edef\pgfcirclabrot{\pgf@circ@direction} % primo e quarto quadrante + \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} + \ifnum \pgfcircmathresult > 90 \ifnum \pgfcircmathresult < 270 % terzo e secondo + \pgfmathsubtract{\pgf@circ@direction}{180} + \edef\pgfcirclabrot{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil} + \pgfmathadd{\pgf@circ@temp}{180} %%% + \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil} %%% + \fi\fi + + \ifnum \ctikzvalof{mirror value} = -1 + \pgfmathadd{\pgf@circ@temp}{180} + \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil} + \fi + } + coordinate (labelcoor) at ($(\ctikzvalof{bipole/name})!2!(\ctikzvalof{bipole/name}.north)$) + (labelcoor) node [rotate=\pgfcirclabrot] {\pgf@circ@finallabel{}} % c'era un transform shape +} + +\def\pgf@circ@drawreglabel{ + \pgfextra{ + \pgfmathsubtract{\pgf@circ@direction}{90} + \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil} + + \edef\pgf@circ@temp{\ctikzvalof{bipole/label/position}} %%% àncora label + \ifnum \pgf@circ@temp < 0 + \pgfmathadd{\pgf@circ@labanc}{180} + \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil} + \fi + + \ifnum \ctikzvalof{mirror value} = -1 + \pgfmathadd{\pgf@circ@labanc}{180} + \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil} + \fi + } + node [ anchor = \pgf@circ@labanc] + at (\ctikzvalof{bipole/name}.\pgf@circ@temp) {\pgf@circ@finallabel{}} +} + + +\ctikzset{text/.style = { t=#1 } } +\ctikzset{t/.code = { + \ctikzsetvalof{bipoles/twoport/text}{#1} +}} + +\endinput diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircmath.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircmath.tex new file mode 100644 index 00000000000..2cfac94739f --- /dev/null +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircmath.tex @@ -0,0 +1,51 @@ +% Copyright 2007-2009 by Massimo Redaelli +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Public License. +% +% See the file doc/LICENSE for more details. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Math routines + +\def\pgf@circ@stripdecimals#1.#2\pgf@nil{#1} + +% angle between 0 and 360 +\def\pgf@circ@slope#1#2{% + \pgf@process{#1}% + \pgf@xa=\pgf@x% + \pgf@ya=\pgf@y% + \pgf@process{#2}% + \advance\pgf@x by-\pgf@xa% + \advance\pgf@y by-\pgf@ya% + \ifdim\pgf@x<0.1pt + \ifdim\pgf@x>-0.1pt % vertical + \ifdim\pgf@y<0pt + \def\pgfmathresult{-90.0} + \else + \def\pgfmathresult{+90.0} + \fi + \else % oblique with dx < 0 + \pgfmathdivide{\pgf@y}{\pgf@x} + \pgfmathatan{\pgfmathresult} + \ifdim\pgf@x<0pt + \pgfmathsubtract{\pgfmathresult}{+180} + \fi + \fi + \else % oblique with dx > 0 + \pgfmathdivide{\pgf@y}{\pgf@x} + \pgfmathatan{\pgfmathresult} + \ifdim\pgf@x<0pt + \pgfmathsubtract{\pgfmathresult}{+180} + \fi + \fi + \pgf@x=\pgfmathresult pt + \ifdim\pgf@x<0pt + \pgfmathadd{\pgfmathresult}{+360} + \fi + } + +\endinput + diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex new file mode 100644 index 00000000000..6d5d09aeb50 --- /dev/null +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex @@ -0,0 +1,565 @@ +% Copyright 2007-2009 by Massimo Redaelli +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Public License. +% +% See the file doc/LICENSE for more details. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Monopoles + +%% Ground symbol + +\pgfdeclareshape{ground}{ + \anchor{center}{ + \pgfpointorigin + } + \behindforegroundpath{ + \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen + + \pgfscope + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}} + \pgfusepath{draw} + + \pgfstartlinewidth=\pgflinewidth + %\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}} + \pgfusepath{draw} + + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{-.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}} + \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}} + \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}} + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + \pgfusepath{draw} + + + \pgfsetlinewidth{\pgfstartlinewidth} + + \endpgfscope + } + +} + + + +\pgfdeclareshape{rground}{ + \anchor{center}{ + \pgfpointorigin + } + \behindforegroundpath{ + \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen + + \pgfscope + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}} + \pgfusepath{draw} + + \pgfstartlinewidth=\pgflinewidth + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}} + \pgfusepath{draw} + + + \pgfsetlinewidth{\pgfstartlinewidth} + + \endpgfscope + } +} + +\pgfdeclareshape{tground}{ + \anchor{center}{ + \pgfpointorigin + } + \behindforegroundpath{ + \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen + + \pgfscope + \pgfpathmoveto{\pgfpointorigin} + %\pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}} + \pgfusepath{draw} + + \pgfstartlinewidth=\pgflinewidth + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/monopoles/tground/thickness}\pgfstartlinewidth} + + \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{0pt}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}} + \pgfusepath{draw} + + + \pgfsetlinewidth{\pgfstartlinewidth} + + \endpgfscope + } +} + +\pgfdeclareshape{sground}{ + \anchor{center}{ + \pgfpointorigin + } + \behindforegroundpath{ + \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen + + \pgfscope + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}} + \pgfusepath{draw} + + \pgfstartlinewidth=\pgflinewidth + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{0}{-1.8\pgf@circ@res@step}} + \pgfpathclose + \pgfusepath{draw} + + + \pgfsetlinewidth{\pgfstartlinewidth} + + \endpgfscope + } + +} + +% noiseless ground +\pgfdeclareshape{nground}{ + \anchor{center}{ + \pgfpointorigin + } + \behindforegroundpath{ + \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen + + \pgfscope + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}} + \pgfusepath{draw} + + \pgfstartlinewidth=\pgflinewidth + %\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}} + \pgfusepath{draw} + + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{-.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}} + \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}} + \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{1.3\pgf@circ@res@step}{-1.6\pgf@circ@res@step}} + \pgfpatharc{0}{180}{1.3\pgf@circ@res@step} + \pgfusepath{draw} + + \pgfsetlinewidth{\pgfstartlinewidth} + \endpgfscope + } +} + +% protective ground +\pgfdeclareshape{pground}{ + \anchor{center}{ + \pgfpointorigin + } + \behindforegroundpath{ + \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen + + \pgfscope + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}} + \pgfusepath{draw} + + \pgfstartlinewidth=\pgflinewidth + %\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}} + \pgfpathcircle{\pgfpoint{0pt}{-\pgf@circ@res@step}} {1.2\pgf@circ@res@step} + \pgfusepath{draw} + + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{-.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}} + \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}} + \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}} + \pgfusepath{draw} + + \pgfsetlinewidth{\pgfstartlinewidth} + \endpgfscope + } +} + +% chassis ground +\pgfdeclareshape{cground}{ +\anchor{center}{ + \pgfpointorigin +} +\behindforegroundpath{ + \pgf@circ@res@step=\ctikzvalof{monopoles/chassis/width}\pgf@circ@Rlen + + \pgfscope + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{-1.5\pgf@circ@res@step}{-2\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-2\pgf@circ@res@step}} + \pgfpathmoveto{\pgfpoint{0pt}{-\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@step}{-2\pgf@circ@res@step}} + \pgfusepath{draw} + \endpgfscope + } +} + +% Contributed by Leonardo Azzinnari +\pgfdeclareshape{tlinestub}{ + \anchor{center}{\pgfpointorigin} + \behindforegroundpath{ + \pgfstartlinewidth=\pgflinewidth + + \pgf@circ@res@step=\ctikzvalof{bipoles/tline/width} \pgf@circ@Rlen + \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}} + + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0pt}} + \pgfusepath{draw} + \pgfscope + \pgfpathellipse{\pgfpoint{0.5\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0.125\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0\pgf@circ@res@step}{0.25\pgf@circ@res@step}} + \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{1.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}} + \pgfpatharc{90}{-90}{0.125\pgf@circ@res@step and 0.25\pgf@circ@res@step} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-0.25\pgf@circ@res@step}} + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfusepath{draw} + \endpgfscope + } +} + + + + +\pgfdeclareshape{antenna}{ +\anchor{center}{\pgfpointorigin} + \savedanchor{\northeast}{ + \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@Rlen + \pgf@x=5\pgf@circ@res@step%-0.5\pgflinewidth + \pgf@y=6\pgf@circ@res@step + } + \anchor{text}{ + \northeast + \pgf@x=\ctikzvalof{monopoles/antenna/label/xanchor}\pgf@x + \pgf@y=\ctikzvalof{monopoles/antenna/label/yanchor}\pgf@y + } + \behindforegroundpath{ + \pgfstartlinewidth=\pgflinewidth + \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@Rlen + + % \pgfpathmoveto{\pgfpointorigin} + % \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}} + % \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{0pt}} + % \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} + + \pgftransformxshift{ -4\pgf@circ@res@step } + + \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{0pt}} + \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} + + \pgfusepath{draw} + + \pgfscope + \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{5\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{4\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{3\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfusepath{draw} + \endpgfscope + \pgfsetlinewidth{\pgfstartlinewidth} + + } + } + + +\pgfdeclareshape{txantenna}{ + \anchor{center}{\pgfpointorigin} + \savedanchor{\northeast}{ + \pgf@circ@res@step=\ctikzvalof{monopoles/txantenna/width}\pgf@circ@Rlen + \pgf@x=5\pgf@circ@res@step%-0.5\pgflinewidth + \pgf@y=6\pgf@circ@res@step + } + \anchor{text}{ + \northeast + \pgf@x=\ctikzvalof{monopoles/txantenna/label/xanchor}\pgf@x + \pgf@y=\ctikzvalof{monopoles/txantenna/label/yanchor}\pgf@y + } + \behindforegroundpath{ + \pgfstartlinewidth=\pgflinewidth + \pgf@circ@res@step=\ctikzvalof{monopoles/txantenna/width}\pgf@circ@Rlen + + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}} + \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{0pt}} + \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} + + \pgfusepath{draw} + + \pgfscope + \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{5\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{4\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{3\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfusepath{draw} + \endpgfscope + \pgfpathmoveto{\pgfpoint{5.5\pgf@circ@res@step}{6\pgf@circ@res@step}} +% \pgfpatharc{60}{-60}{\pgf@circ@res@step and \pgf@circ@res@step} + \pgfpatharc{30}{-30}{2\pgf@circ@res@step} \pgfpathmoveto{\pgfpoint{6\pgf@circ@res@step}{6.25\pgf@circ@res@step}} + \pgfpatharc{30}{-30}{2.5\pgf@circ@res@step} + \pgfpathmoveto{\pgfpoint{6.5\pgf@circ@res@step}{6.5\pgf@circ@res@step}} + \pgfpatharc{30}{-30}{3\pgf@circ@res@step} + \pgfpathmoveto{\pgfpoint{7\pgf@circ@res@step}{6.75\pgf@circ@res@step}} + \pgfpatharc{30}{-30}{3.5\pgf@circ@res@step} + \pgfpathmoveto{\pgfpoint{7.5\pgf@circ@res@step}{7\pgf@circ@res@step}} + \pgfpatharc{30}{-30}{4\pgf@circ@res@step} + \pgfusepath{draw} + \pgfsetlinewidth{\pgfstartlinewidth} + + } + } + + +\pgfdeclareshape{rxantenna}{ + \anchor{center}{\pgfpointorigin} + \savedanchor{\northeast}{ + \pgf@circ@res@step=\ctikzvalof{monopoles/txantenna/width}\pgf@circ@Rlen + \pgf@x=5\pgf@circ@res@step%-0.5\pgflinewidth + \pgf@y=6\pgf@circ@res@step + } + \anchor{text}{ + \northeast + \pgf@x=\ctikzvalof{monopoles/rxantenna/label/xanchor}\pgf@x + \pgf@y=\ctikzvalof{monopoles/rxantenna/label/yanchor}\pgf@y + } + \behindforegroundpath{ + \pgfstartlinewidth=\pgflinewidth + \pgf@circ@res@step=\ctikzvalof{monopoles/rxantenna/width}\pgf@circ@Rlen + + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}} + \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{0pt}} + \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} + + \pgfusepath{draw} + + \pgfscope + \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{5\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{4\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{3\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfusepath{draw} + \endpgfscope + + \pgfpathmoveto{\pgfpoint{6\pgf@circ@res@step}{7\pgf@circ@res@step}} +% \pgfpatharc{60}{-60}{\pgf@circ@res@step and \pgf@circ@res@step} + \pgfpatharc{150}{210}{4\pgf@circ@res@step} \pgfpathmoveto{\pgfpoint{6.5\pgf@circ@res@step}{6.75\pgf@circ@res@step}} + \pgfpatharc{150}{210}{3.5\pgf@circ@res@step} + \pgfpathmoveto{\pgfpoint{7\pgf@circ@res@step}{6.5\pgf@circ@res@step}} + \pgfpatharc{150}{210}{3\pgf@circ@res@step} + \pgfpathmoveto{\pgfpoint{7.5\pgf@circ@res@step}{6.25\pgf@circ@res@step}} + \pgfpatharc{150}{210}{2.5\pgf@circ@res@step} + \pgfpathmoveto{\pgfpoint{8\pgf@circ@res@step}{6\pgf@circ@res@step}} + \pgfpatharc{150}{210}{2\pgf@circ@res@step} + \pgfusepath{draw} + \pgfsetlinewidth{\pgfstartlinewidth} + + } +} + +% Vcc +\pgfdeclareshape{vcc}{ +\anchor{center}{\pgfpointorigin} +\anchor{text}{ + \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen + \pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{2\pgf@circ@res@step+2\ht\pgfnodeparttextbox}} + \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{2\pgf@circ@res@step+2\ht\pgfnodeparttextbox}} + \pgf@x=0pt + \pgf@y=2\pgf@circ@res@step + \advance \pgf@y by 0.5\ht\pgfnodeparttextbox + \pgf@x=-.5\wd\pgfnodeparttextbox + } +\behindforegroundpath{ + \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen + \pgfscope + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{0pt}{1.5\pgf@circ@res@step}} + \pgfusepath{draw} + + \pgfstartlinewidth=\pgflinewidth + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{0}{1.5\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}} + \pgfusepath{draw} + + \pgfsetlinewidth{\pgfstartlinewidth} + + \endpgfscope +} + +} + +% Vee +\pgfdeclareshape{vee}{ +\anchor{center}{\pgfpointorigin} +\anchor{text}{ + \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen + \pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-2\pgf@circ@res@step-2\ht\pgfnodeparttextbox}} + \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{-2\pgf@circ@res@step-2\ht\pgfnodeparttextbox}} + \pgf@x=0pt + \pgf@y=-2\pgf@circ@res@step + \advance \pgf@y by -1.5\ht\pgfnodeparttextbox + \pgf@x=-.5\wd\pgfnodeparttextbox + } + +\behindforegroundpath{ + \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen + + \pgfscope + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{0pt}{-1.5\pgf@circ@res@step}} + \pgfusepath{draw} + + \pgfstartlinewidth=\pgflinewidth + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-.8\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{0}{-1.5\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-.8\pgf@circ@res@step}} + \pgfusepath{draw} + \pgfsetlinewidth{\pgfstartlinewidth} + + \endpgfscope +} + +} + + +% match +\pgfdeclareshape{match}{ + \anchor{center}{ + \pgfpointorigin + } + \anchor{text}{ + \pgf@x=\ctikzvalof{monopoles/match/width}\pgf@circ@Rlen + \pgf@x=1.5\pgf@x + \advance \pgf@x by -.5\wd\pgfnodeparttextbox + \pgf@y=-1.5\ht\pgfnodeparttextbox + } + \behindforegroundpath{ + \pgf@circ@res@step=\ctikzvalof{monopoles/match/width}\pgf@circ@Rlen + + \pgfscope + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0pt}} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}} + \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0.5\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0}} + \pgfusepath{fill} + + \pgfsetlinewidth{\pgfstartlinewidth} + + \endpgfscope + } + +} + +% oscillator +\pgfdeclareshape{oscillator}{ + \anchor{center}{ + \pgfpointorigin + } + \anchor{north}{ + \pgf@x=\ctikzvalof{monopoles/oscillator/width}\pgf@circ@Rlen + \pgf@x=-0.5\pgf@x + \pgf@y=\ctikzvalof{monopoles/oscillator/width}\pgf@circ@Rlen + \pgf@y=0.5\pgf@y + } + \anchor{south}{ + \pgf@x=\ctikzvalof{monopoles/oscillator/width}\pgf@circ@Rlen + \pgf@x=-0.5\pgf@x + \pgf@y=\ctikzvalof{monopoles/oscillator/width}\pgf@circ@Rlen + \pgf@y=-0.5\pgf@y + } + \anchor{east}{ + \pgfpointorigin + \pgf@x=-\ctikzvalof{monopoles/oscillator/width}\pgf@circ@Rlen + } + \anchor{west}{ + \pgfpointorigin + } + \anchor{text}{ + \pgf@x=\ctikzvalof{monopoles/oscillator/width}\pgf@circ@Rlen + \pgf@x=-2\pgf@x + \advance \pgf@x by -.5\wd\pgfnodeparttextbox + \pgf@y=-\ctikzvalof{monopoles/oscillator/width}\pgf@circ@Rlen + \advance \pgf@y by -1.5\ht\pgfnodeparttextbox + } + \behindforegroundpath{ + \pgf@circ@res@step=\ctikzvalof{monopoles/oscillator/width}\pgf@circ@Rlen + \pgf@circ@res@step=.5\pgf@circ@res@step + + \pgfscope + \pgfpathmoveto{\pgfpointorigin} + \pgfstartlinewidth=\pgflinewidth + + % draw circle + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathcircle{\pgfpoint{-\pgf@circ@res@step}{0}} {\pgf@circ@res@step} + \pgfusepath{draw} + + % draw inner sine waves + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetlinewidth{\pgfstartlinewidth} + + \pgfpathmoveto{\pgfpoint{-1.5\pgf@circ@res@step}{0\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfusepath{draw} + + \pgfsetlinewidth{\pgfstartlinewidth} + + \endpgfscope + } +} + +\endinput diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircnpoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircnpoles.tex new file mode 100644 index 00000000000..790d997a040 --- /dev/null +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircnpoles.tex @@ -0,0 +1,599 @@ +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Public License. +% +% See the file doc/LICENSE for more details. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% N-poles + +\pgfkeys{/tikz/circuitikz,lab/.code={ + + +}} + +\long\def\pgfcircdeclarenpole#1#2#3{ + \pgfdeclareshape{#1} + { + \anchor{center}{ + \northwest + \pgf@x=0pt + } + \savedanchor\northwest{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=.5\pgf@x + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/width}\pgf@x + } + \anchor{A2}{ + \northwest + \pgf@y=-\pgf@y + } + \anchor{B1}{ + \northwest + \pgf@x=-\pgf@x + } + \anchor{A1}{ + \northwest + } + \anchor{B2}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-\pgf@y + } + \anchor{north}{ + \northwest + \pgf@x=0pt + } + \anchor{south}{ + \northwest + \pgf@x=0pt + \pgf@y=-\pgf@y + } + \anchor{west}{ + \northwest + \pgf@y=0pt + } + \anchor{east}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{south west}{ + \northwest + \pgf@y=-\pgf@y + } + \anchor{north east}{ + \northwest + \pgf@x=-\pgf@x + } + \anchor{north west}{ + \northwest + } + \anchor{south east}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-\pgf@y + } + \anchor{base}{ + \northwest + \pgf@x=0pt + } + #3 + \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@Rlen=\pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + + #2 + + } + } +} + + + +\def\pgf@circ@drawtransformerbasicanchor{ + \pgfkeysvalueof{/tikz/circuitikz/quadpoles/trans/height} + \anchor{AA2}{ + \northwest + \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x + \pgf@x=.7\pgf@x + \pgf@y=-\pgf@y + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y + } + \anchor{BB1}{ + \northwest + \pgf@x=-\pgf@x + \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x + \pgf@x=.7\pgf@x + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y + } + \anchor{AA1}{ + \northwest + \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x + \pgf@x=.7\pgf@x + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y + } + \anchor{BB2}{ + \northwest + \pgf@x=-\pgf@x + \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x + \pgf@x=.7\pgf@x + \pgf@y=-\pgf@y + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y + } +} + +\def\pgf@circ@drawtransformerbasicbody{ + \def\stretto{.4} + \pgfscope + \pgfslopedattimetrue + \pgfallowupsidedownattimetrue + \pgftransformlineattime{.5}{% + \pgfpoint% + {\stretto\pgf@circ@res@left}% + {\pgf@circ@res@up}% + }{% + \pgfpoint + {\stretto\pgf@circ@res@left}% + {\pgf@circ@res@down}% + } + + \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 + \pgfallowupsidedownattimetrue + \pgftransformlineattime{.5}{% + \pgfpoint% + {\stretto\pgf@circ@res@right}% + {\pgf@circ@res@down}% + }{% + \pgfpoint + {\stretto\pgf@circ@res@right}% + {\pgf@circ@res@up}% + } + + \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}} + \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpointanchor{pgf@inductor1}{b}} + + \pgfpathmoveto{\pgfpointanchor{pgf@inductor1}{a}} + \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpointanchor{pgf@inductor2}{a}} + + \pgfpathmoveto{\pgfpointanchor{pgf@inductor2}{b}} + \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + + \pgfusepath{draw} + +} + + + + % contrib Kristofer M. Monisit + + \pgfdeclareshape{fd op amp} + { + \anchor{center}{\pgfpointorigin} + \savedanchor\northwest{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x + \pgf@x=.5\pgf@x + } + \anchor{south}{ + \northwest + \pgf@y=-\pgf@y + } + \anchor{north}{ + \northwest + } + \savedanchor\left{% + \pgf@y=0pt + } + \savedanchor\inOne{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x + \pgf@x=.5\pgf@x + } + \anchor{-}{ + \inOne + } + \anchor{+}{ + \inOne + \pgf@y=-\pgf@y + } + \savedanchor\up{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x + \pgf@x=.5\pgf@x + \pgf@circ@res@up = \pgf@y + \pgf@circ@res@right = -\pgf@x + \pgf@circ@res@left = \pgf@x + \pgfpointlineattime{ + \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/up pos}}{ + \pgfpoint{ + \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left} + {\pgf@circ@res@up}} + {\pgfpoint{.7\pgf@circ@res@right}{0pt}} + } + \anchor{up}{ + \up + } + \anchor{down}{ + \up + \pgf@y=-\pgf@y + } + \anchor{out +}{ + \northwest + \pgf@y=.5\pgf@y + \pgf@x=-.7\pgf@x + } + \anchor{out -}{ + \northwest + \pgf@y=-.5\pgf@y + \pgf@x=-.7\pgf@x + } + \anchor{west}{ + \left + } + \anchor{east}{ + \left + \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 + + % Negative input terminal + \pgfpathmoveto{\pgfpoint + {\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}} + \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}]{\scriptsize\ $-$} + + + % Positive input terminal + \pgfpathmoveto{\pgfpoint + {\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}} + \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}]{\scriptsize\ $+$} + + + % Negative output terminal + \pgfpathmoveto{\pgfpoint + {0.7\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}} + \pgftext[left, at=\pgfpoint{0.3\pgf@circ@res@left}{.3\pgf@circ@res@down}]{\scriptsize\ $-$} + + + % Positive output terminal + \pgfpathmoveto{\pgfpoint + {0.7\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}} + \pgftext[left, at=\pgfpoint{0.3\pgf@circ@res@left}{.3\pgf@circ@res@up}]{\scriptsize\ $+$} + + + % Draw them all! + \pgfusepath{draw} + + % Triangle + \pgfscope + \pgfsetlinewidth{2\pgflinewidth} + \pgftransformxshift{.7\pgf@circ@res@left} + \pgf@circ@res@step=\pgf@circ@res@right + \advance\pgf@circ@res@step by -\pgf@circ@res@left + \pgf@circ@res@step=.7\pgf@circ@res@step + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}} + \pgfusepath{draw} + \endpgfscope + } + } + + + + +\pgfcircdeclarequadpole{transformer}{ + + \pgf@circ@drawtransformerbasicbody + +}{\pgf@circ@drawtransformerbasicanchor} + +\pgfcircdeclarequadpole{transformer core}{ + + \pgf@circ@drawtransformerbasicbody + + \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} +}{\pgf@circ@drawtransformerbasicanchor} + + +\pgfcircdeclarequadpole{gyrator}{ + + \def\stretto{.4} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + + \pgfusepath{draw} + + \pgfsetlinewidth{2\pgflinewidth} + \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@left}{.7*\stretto\pgf@circ@res@down}} + \pgfpatharc{90}{270}{.7*\stretto\pgf@circ@res@down} + + \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@right}{.7*\stretto\pgf@circ@res@up}} + \pgfpatharc{-90}{90}{.7*\stretto\pgf@circ@res@down} + \pgfusepath{draw} + +}{} + +%% coupler +% defines a general outer box for couplers +% TikZ usage: +% \draw (0,0) node[coupler](coup){\SI{-3}{dB}} +% (coup.port1) to[short,-o] ++(-1,0) +% + +\long\def\pgfcircdeclarecoupler#1#2{ + \pgfdeclareshape{#1}{ + \anchor{center}{ + \northwest + \pgf@x=0pt + \pgf@y=0pt + } + \savedanchor\northwest{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/coupler/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=.5\pgf@x + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/quadpoles/coupler/width}\pgf@x + } + \anchor{north}{ + \northwest + \pgf@x=0pt + } + \anchor{south}{ + \northwest + \pgf@x=0pt + \pgf@y=-\pgf@y + } + \anchor{west}{ + \northwest + \pgf@y=0pt + } + \anchor{east}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{south west}{ + \northwest + \pgf@y=-\pgf@y + } + \anchor{north east}{ + \northwest + \pgf@x=-\pgf@x + } + \anchor{north west}{ + \northwest + } + \anchor{south east}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-\pgf@y + } + \anchor{port1}{ + \northwest + \pgf@y=-0.5\pgf@y + } + \anchor{port2}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-0.5\pgf@y + } + \anchor{port3}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=0.5\pgf@y + } + \anchor{port4}{ + \northwest + \pgf@y=0.5\pgf@y + } + \anchor{1}{ + \northwest + \pgf@y=-0.5\pgf@y + } + \anchor{2}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-0.5\pgf@y + } + \anchor{3}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=0.5\pgf@y + } + \anchor{4}{ + \northwest + \pgf@y=0.5\pgf@y + } + \anchor{text}{ + \northwest + \advance \pgf@y by 0.5\ht\pgfnodeparttextbox + \pgf@x=-.5\wd\pgfnodeparttextbox + } + \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 + + \pgfstartlinewidth=\pgflinewidth + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + % draw inner stuff + #2 + + } + } +} + +% straight coupler +\pgfcircdeclarecoupler{coupler}{ + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@up}} + \pgfsetarrows{latex-latex} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@down}} + \pgfsetarrows{latex-latex} + \pgfusepath{draw} +} + +% "bended" coupler +\pgfcircdeclarecoupler{coupler2}{ + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}} + \pgfpatharc{0}{90} {0.4\pgf@circ@res@up} + \pgfsetarrowsend{latex} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}} + \pgfpatharc{0}{-90} {0.4\pgf@circ@res@up} + \pgfsetarrowsend{latex} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}} + \pgfpatharc{180}{90} {0.4\pgf@circ@res@up} + \pgfsetarrowsend{latex} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}} + \pgfpatharc{-180}{-90} {0.4\pgf@circ@res@up} + \pgfsetarrowsend{latex} + \pgfusepath{draw} + + +} + diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex new file mode 100644 index 00000000000..bbe5ce53176 --- /dev/null +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex @@ -0,0 +1,595 @@ +% Copyright 2007-2009 by Massimo Redaelli +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Public License. +% +% See the file doc/LICENSE for more details. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Quadripoles + +\long\def\pgfcircdeclarequadpole#1#2#3{ + \pgfdeclareshape{#1} + { + \anchor{center}{ + \northwest + \pgf@x=0pt + } + \savedanchor\northwest{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=.5\pgf@x + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/width}\pgf@x + } + \anchor{A2}{ + \northwest + \pgf@y=-\pgf@y + } + \anchor{B1}{ + \northwest + \pgf@x=-\pgf@x + } + \anchor{A1}{ + \northwest + } + \anchor{B2}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-\pgf@y + } + \anchor{north}{ + \northwest + \pgf@x=0pt + } + \anchor{south}{ + \northwest + \pgf@x=0pt + \pgf@y=-\pgf@y + } + \anchor{west}{ + \northwest + \pgf@y=0pt + } + \anchor{east}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{south west}{ + \northwest + \pgf@y=-\pgf@y + } + \anchor{north east}{ + \northwest + \pgf@x=-\pgf@x + } + \anchor{north west}{ + \northwest + } + \anchor{south east}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-\pgf@y + } + \anchor{base}{ + \northwest + \pgf@x=0pt + } + #3 + \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@Rlen=\pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + + #2 + + } + } +} + + + +\def\pgf@circ@drawtransformerbasicanchor{ + \pgfkeysvalueof{/tikz/circuitikz/quadpoles/trans/height} + \anchor{AA2}{ + \northwest + \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x + \pgf@x=.7\pgf@x + \pgf@y=-\pgf@y + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y + } + \anchor{BB1}{ + \northwest + \pgf@x=-\pgf@x + \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x + \pgf@x=.7\pgf@x + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y + } + \anchor{AA1}{ + \northwest + \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x + \pgf@x=.7\pgf@x + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y + } + \anchor{BB2}{ + \northwest + \pgf@x=-\pgf@x + \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x + \pgf@x=.7\pgf@x + \pgf@y=-\pgf@y + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y + } +} + +\def\pgf@circ@drawtransformerbasicbody{ + \def\stretto{.4} + \pgfscope + \pgfslopedattimetrue + \pgfallowupsidedownattimetrue + \pgftransformlineattime{.5}{% + \pgfpoint% + {\stretto\pgf@circ@res@left}% + {\pgf@circ@res@up}% + }{% + \pgfpoint + {\stretto\pgf@circ@res@left}% + {\pgf@circ@res@down}% + } + + \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 + \pgfallowupsidedownattimetrue + \pgftransformlineattime{.5}{% + \pgfpoint% + {\stretto\pgf@circ@res@right}% + {\pgf@circ@res@down}% + }{% + \pgfpoint + {\stretto\pgf@circ@res@right}% + {\pgf@circ@res@up}% + } + + \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}} + \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpointanchor{pgf@inductor1}{b}} + + \pgfpathmoveto{\pgfpointanchor{pgf@inductor1}{a}} + \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpointanchor{pgf@inductor2}{a}} + + \pgfpathmoveto{\pgfpointanchor{pgf@inductor2}{b}} + \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + + \pgfusepath{draw} + +} + + + + % contrib Kristofer M. Monisit + + \pgfdeclareshape{fd op amp} + { + \anchor{center}{\pgfpointorigin} + \savedanchor\northwest{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x + \pgf@x=.5\pgf@x + } + \anchor{south}{ + \northwest + \pgf@y=-\pgf@y + } + \anchor{north}{ + \northwest + } + \savedanchor\left{% + \pgf@y=0pt + } + \savedanchor\inOne{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x + \pgf@x=.5\pgf@x + } + \anchor{-}{ + \inOne + } + \anchor{+}{ + \inOne + \pgf@y=-\pgf@y + } + \savedanchor\up{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x + \pgf@x=.5\pgf@x + \pgf@circ@res@up = \pgf@y + \pgf@circ@res@right = -\pgf@x + \pgf@circ@res@left = \pgf@x + \pgfpointlineattime{ + \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/up pos}}{ + \pgfpoint{ + \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left} + {\pgf@circ@res@up}} + {\pgfpoint{.7\pgf@circ@res@right}{0pt}} + } + \anchor{up}{ + \up + } + \anchor{down}{ + \up + \pgf@y=-\pgf@y + } + \anchor{out +}{ + \northwest + \pgf@y=.5\pgf@y + \pgf@x=-.7\pgf@x + } + \anchor{out -}{ + \northwest + \pgf@y=-.5\pgf@y + \pgf@x=-.7\pgf@x + } + \anchor{west}{ + \left + } + \anchor{east}{ + \left + \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 + + % Negative input terminal + \pgfpathmoveto{\pgfpoint + {\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}} + \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}]{\scriptsize\ $-$} + + + % Positive input terminal + \pgfpathmoveto{\pgfpoint + {\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}} + \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}]{\scriptsize\ $+$} + + + % Negative output terminal + \pgfpathmoveto{\pgfpoint + {0.7\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}} + \pgftext[left, at=\pgfpoint{0.3\pgf@circ@res@left}{.3\pgf@circ@res@down}]{\scriptsize\ $-$} + + + % Positive output terminal + \pgfpathmoveto{\pgfpoint + {0.7\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}} + \pgftext[left, at=\pgfpoint{0.3\pgf@circ@res@left}{.3\pgf@circ@res@up}]{\scriptsize\ $+$} + + + % Draw them all! + \pgfusepath{draw} + + % Triangle + \pgfscope + \pgfsetlinewidth{2\pgflinewidth} + \pgftransformxshift{.7\pgf@circ@res@left} + \pgf@circ@res@step=\pgf@circ@res@right + \advance\pgf@circ@res@step by -\pgf@circ@res@left + \pgf@circ@res@step=.7\pgf@circ@res@step + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}} + \pgfusepath{draw} + \endpgfscope + } + } + + + + +\pgfcircdeclarequadpole{transformer}{ + + \pgf@circ@drawtransformerbasicbody + +}{\pgf@circ@drawtransformerbasicanchor} + +\pgfcircdeclarequadpole{transformer core}{ + + \pgf@circ@drawtransformerbasicbody + + \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} +}{\pgf@circ@drawtransformerbasicanchor} + + +\pgfcircdeclarequadpole{gyrator}{ + + \def\stretto{.4} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + + \pgfusepath{draw} + + \pgfsetlinewidth{2\pgflinewidth} + \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@left}{.7*\stretto\pgf@circ@res@down}} + \pgfpatharc{90}{270}{.7*\stretto\pgf@circ@res@down} + + \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@right}{.7*\stretto\pgf@circ@res@up}} + \pgfpatharc{-90}{90}{.7*\stretto\pgf@circ@res@down} + \pgfusepath{draw} + +}{} + +%% coupler +% defines a general outer box for couplers +% TikZ usage: +% \draw (0,0) node[coupler](coup){\SI{-3}{dB}} +% (coup.port1) to[short,-o] ++(-1,0) +% + +\long\def\pgfcircdeclarecoupler#1#2{ + \pgfdeclareshape{#1}{ + \anchor{center}{ + \northwest + \pgf@x=0pt + \pgf@y=0pt + } + \savedanchor\northwest{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/coupler/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=.5\pgf@x + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/quadpoles/coupler/width}\pgf@x + } + \anchor{north}{ + \northwest + \pgf@x=0pt + } + \anchor{south}{ + \northwest + \pgf@x=0pt + \pgf@y=-\pgf@y + } + \anchor{west}{ + \northwest + \pgf@y=0pt + } + \anchor{east}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{south west}{ + \northwest + \pgf@y=-\pgf@y + } + \anchor{north east}{ + \northwest + \pgf@x=-\pgf@x + } + \anchor{north west}{ + \northwest + } + \anchor{south east}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-\pgf@y + } + \anchor{port1}{ + \northwest + \pgf@y=-0.5\pgf@y + } + \anchor{port2}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-0.5\pgf@y + } + \anchor{port3}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=0.5\pgf@y + } + \anchor{port4}{ + \northwest + \pgf@y=0.5\pgf@y + } + \anchor{1}{ + \northwest + \pgf@y=-0.5\pgf@y + } + \anchor{2}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-0.5\pgf@y + } + \anchor{3}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=0.5\pgf@y + } + \anchor{4}{ + \northwest + \pgf@y=0.5\pgf@y + } + \anchor{text}{ + \northwest + \advance \pgf@y by 0.5\ht\pgfnodeparttextbox + \pgf@x=-.5\wd\pgfnodeparttextbox + } + \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 + + \pgfstartlinewidth=\pgflinewidth + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + % draw inner stuff + #2 + + } + } +} + +% straight coupler +\pgfcircdeclarecoupler{coupler}{ + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@up}} + \pgfsetarrows{latex-latex} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@down}} + \pgfsetarrows{latex-latex} + \pgfusepath{draw} +} + +% "bended" coupler +\pgfcircdeclarecoupler{coupler2}{ + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}} + \pgfpatharc{0}{90} {0.4\pgf@circ@res@up} + \pgfsetarrowsend{latex} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}} + \pgfpatharc{0}{-90} {0.4\pgf@circ@res@up} + \pgfsetarrowsend{latex} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}} + \pgfpatharc{180}{90} {0.4\pgf@circ@res@up} + \pgfsetarrowsend{latex} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}} + \pgfpatharc{-180}{-90} {0.4\pgf@circ@res@up} + \pgfsetarrowsend{latex} + \pgfusepath{draw} + + +} + diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex new file mode 100644 index 00000000000..08d90980197 --- /dev/null +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex @@ -0,0 +1,151 @@ +% Copyright 2007-2009 by Massimo Redaelli +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Public License. +% +% See the file doc/LICENSE for more details. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Other shapes + + +%% Nothing + +\pgfdeclareshape{emptyshape}{ + \savedanchor{\northeast}{% + \pgf@x=.5\wd\pgfnodeparttextbox% + \pgf@y=.5\ht\pgfnodeparttextbox% + } + \anchor{north}{ + \northeast + \pgf@x=0cm + } + \anchor{east}{% + \northeast + \pgf@y=0cm + } + \anchor{south}{% + \northeast + \pgf@y=-\pgf@y + \pgf@x=0cm + } + \anchor{west}{ + \northeast + \pgf@y=0cm + \pgf@x=-\pgf@x + } + \anchor{text}{% + \pgfpointorigin + } + \anchor{center}{ + \pgfpointorigin + } +} + +%% Full terminal + +\pgfdeclareshape{circ}{ + \anchor{center}{ + \pgfpointorigin + } + \anchorborder{ + \pgf@circ@res@left=\pgf@x + \pgf@circ@res@up=\pgf@y + \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up} +}{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}} + } + \behindforegroundpath{ + + \pgfscope + \pgfpathcircle{\pgfpointorigin}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}} + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + \pgfusepath{draw,fill} + \endpgfscope + + } +} + +%% Empty terminal + +\pgfdeclareshape{ocirc}{ + \anchor{center}{ + \pgfpointorigin + } + \anchorborder{ + \pgf@circ@res@left=\pgf@x + \pgf@circ@res@up=\pgf@y + \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up} +}{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}} + } + + \behindforegroundpath{ + + \pgfscope + \pgfpathcircle{\pgfpointorigin}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}} + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + \pgfsetfillcolor{white} + \pgfusepath{draw,fill} + \endpgfscope + + } +} + +%% Current arrow + +\pgfdeclareshape{currarrow}{ + \anchor{center}{ + \pgfpointorigin + } + \behindforegroundpath{ + + \pgfscope + \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \divide \pgf@circ@res@step by 16 + + \pgfpathmoveto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}} + \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{-.8\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{0pt}} + \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{.8\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}} + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + \pgfusepath{draw,fill} + + \endpgfscope + } + +} + +%% Current arrow + +\pgfdeclareshape{inputarrow}{ + \savedanchor{\tip}{ + \pgfpointorigin + } + \anchor{center}{ + \tip + } + \anchor{tip}{ + \tip + } + \behindforegroundpath{ + + \pgfscope + \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \divide \pgf@circ@res@step by 16 + + \pgfpathmoveto{\pgfpoint{-1.7\pgf@circ@res@step}{0pt}} + \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{-.8\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{0pt}{0pt}} + \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{.8\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{0pt}} + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + \pgfusepath{fill} + + \endpgfscope + } + +} + +\endinput diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex new file mode 100644 index 00000000000..148a1564e49 --- /dev/null +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex @@ -0,0 +1,3639 @@ +% Copyright 2007-2009 by Massimo Redaelli +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Public License. +% +% See the file doc/LICENSE for more details. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Tripoles + + +\pgfdeclareshape{mixer} +{ + \savedanchor\northwest{ + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/mixer/width}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/mixer/width}\pgf@x + \pgf@x=.5\pgf@x + } + \anchor{center}{ + \pgfpointorigin + } + \anchor{left}{% + \northwest + \pgf@y=0pt + } + \anchor{in 1}{ + \northwest + \pgf@y=0pt + } + \anchor{in1}{ + \northwest + \pgf@y=0pt + } + \anchor{in}{ + \northwest + \pgf@y=0pt + } + \anchor{in 2}{ + \northwest + \pgf@y=-\pgf@y + \pgf@x=0pt + } + \anchor{in2}{ + \northwest + \pgf@y=-\pgf@y + \pgf@x=0pt + } + \anchor{out}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{center}{ + \pgf@y=0pt + \pgf@x=0pt + } + \anchor{east}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{west}{ + \northwest + \pgf@y=0pt + } + \anchor{south}{ + \northwest + \pgf@x=0pt + \pgf@y=-\pgf@y + } + \anchor{north}{ + \northwest + \pgf@x=0pt + } + \anchor{south west}{ + \northwest + \pgf@y=-\pgf@y + } + \anchor{north east}{ + \northwest + \pgf@x=-\pgf@x + } + \anchor{north west}{ + \northwest + } + \anchor{south east}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-\pgf@y + } + \backgroundpath{ + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + + \pgf@circ@res@step=\ctikzvalof{tripoles/mixer/width}\pgf@circ@Rlen + + \pgfscope + \pgfstartlinewidth=\pgflinewidth + + % draw outer circle + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step} + \pgfusepath{draw} + + % draw inner stuff + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathmoveto{\pgfpointpolar{135}{0.5\pgf@circ@res@step}} + \pgfpathlineto{\pgfpointpolar{-45}{0.5\pgf@circ@res@step}} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathmoveto{\pgfpointpolar{45}{0.5\pgf@circ@res@step}} + \pgfpathlineto{\pgfpointpolar{-135}{0.5\pgf@circ@res@step}} + \pgfsetlinewidth{2\pgflinewidth} + \pgfusepath{draw} + \endpgfscope + } +} + +\pgfdeclareshape{adder} +{ + \savedanchor\northwest{ + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/adder/width}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/adder/width}\pgf@x + \pgf@x=.5\pgf@x + } + \anchor{center}{ + \pgfpointorigin + } + \anchor{left}{% + \northwest + \pgf@y=0pt + } + \anchor{in 1}{ + \northwest + \pgf@y=0pt + } + \anchor{in1}{ + \northwest + \pgf@y=0pt + } + \anchor{in}{ + \northwest + \pgf@y=0pt + } + \anchor{in 2}{ + \northwest + \pgf@y=-\pgf@y + \pgf@x=0pt + } + \anchor{in2}{ + \northwest + \pgf@y=-\pgf@y + \pgf@x=0pt + } + \anchor{out}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{center}{ + \pgf@y=0pt + \pgf@x=0pt + } + \anchor{east}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{west}{ + \northwest + \pgf@y=0pt + } + \anchor{south}{ + \northwest + \pgf@x=0pt + \pgf@y=-\pgf@y + } + \anchor{north}{ + \northwest + \pgf@x=0pt + } + \anchor{south west}{ + \northwest + \pgf@y=-\pgf@y + } + \anchor{north east}{ + \northwest + \pgf@x=-\pgf@x + } + \anchor{north west}{ + \northwest + } + \anchor{south east}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-\pgf@y + } + \backgroundpath{ + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + + \pgf@circ@res@step=\ctikzvalof{tripoles/adder/width}\pgf@circ@Rlen + + \pgfscope + \pgfstartlinewidth=\pgflinewidth + + % draw outer circle + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step} + \pgfusepath{draw} + + % draw inner stuff + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathmoveto{\pgfpointpolar{0}{0.3\pgf@circ@res@step}} + \pgfpathlineto{\pgfpointpolar{180}{0.3\pgf@circ@res@step}} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathmoveto{\pgfpointpolar{90}{0.3\pgf@circ@res@step}} + \pgfpathlineto{\pgfpointpolar{270}{0.3\pgf@circ@res@step}} + \pgfsetlinewidth{2\pgflinewidth} + \pgfusepath{draw} + \endpgfscope + } +} + + + + \pgfdeclareshape{spdt} + { + \savedanchor\northwest{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/width}\pgf@x + \pgf@x=.5\pgf@x + } + \anchor{left}{% + \northwest + \pgf@y=0pt + } + \anchor{in}{ + \northwest + \pgf@y=0pt + } + \anchor{out 1}{ + \northwest + \pgf@x=-\pgf@x + } + \anchor{out 2}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-\pgf@y + } + \anchor{center}{ + \pgf@y=0pt + \pgf@x=0pt + } + \anchor{east}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{west}{ + \northwest + \pgf@y=0pt + } + \anchor{south}{ + \northwest + \pgf@x=0pt + \pgf@y=-\pgf@y + } + \anchor{north}{ + \northwest + \pgf@x=0pt + } + \anchor{south west}{ + \northwest + \pgf@y=-\pgf@y + } + \anchor{north east}{ + \northwest + \pgf@x=-\pgf@x + } + \anchor{north west}{ + \northwest + } + \anchor{south east}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-\pgf@y + } + \backgroundpath{ + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + + + \northwest + \pgf@circ@res@up = \pgf@y + \pgf@circ@res@down = -\pgf@y + \pgf@circ@res@right = -\pgf@x + \pgf@circ@res@left = \pgf@x + \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/margin}\pgf@circ@res@left + + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}} + + \pgfusepath{draw} + + \pgfscope + \pgftransformshift{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}} + \pgfnode{ocirc}{center}{}{spdt1}{\pgfusepath{stroke}} + \endpgfscope + \pgfscope + \pgftransformshift{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}} + \pgfnode{ocirc}{center}{}{}{\pgfusepath{stroke}} + \endpgfscope + \pgfscope + \pgftransformshift{\pgfpoint{\pgf@circ@res@other}{0pt}} + \pgfnode{ocirc}{center}{}{spdt2}{\pgfusepath{stroke}} + \endpgfscope + + + \pgfscope + \pgfpathmoveto{\pgfpointshapeborder{spdt2}{\pgfpointorigin}} + \pgfpathlineto{ + \pgfpointadd{\pgfpointshapeborder{spdt1}{\pgfpoint{-\pgf@circ@res@other}{-100pt}}} + {\pgfpoint{-.05\pgf@circ@res@up}{-.05\pgf@circ@res@up}} + } + \pgfsetlinewidth{2\pgflinewidth} + \pgfusepath{draw} + \endpgfscope + } + } + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% +%% Logic ports +%% + + + + + + +\long\def\pgfcircdeclarelogicport#1#2{ + \pgfdeclareshape{american #1 port} + { + \savedanchor\northwest{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \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/american #1 port/width}\pgf@x + \pgf@x=.5\pgf@x + } + \savedanchor\left{% + \pgf@y=0pt + } + \savedanchor\inOne{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/height}\pgf@y + \pgf@y=.5\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/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 + } + \anchor{out}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{center}{ + \northwest + \pgf@y=0pt + \pgf@x=-.8\pgf@x + } + \anchor{east}{ + \left + \pgf@x=-.8\pgf@x + } + \anchor{west}{ + \left + } + \anchor{south}{ + \northwest + \pgf@x=0pt + \pgf@y=-\pgf@y + } + \anchor{north}{ + \northwest + \pgf@x=0pt + } + \anchor{south west}{ + \northwest + \pgf@y=-\pgf@y + } + \anchor{north east}{ + \northwest + \pgf@x=-\pgf@x + } + \anchor{north west}{ + \northwest + } + \anchor{south east}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-\pgf@y + } + \backgroundpath{ + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + + + \northwest + \pgf@circ@res@up = \pgf@y + \pgf@circ@res@down = -\pgf@y + \pgf@circ@res@right = -\pgf@x + \pgf@circ@res@left = \pgf@x + + #2 + + } + } +} + + +\pgfcircdeclarelogicport{and}{ + \pgfpathmoveto{\pgfpoint + {\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/input height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\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/american and port/input height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint + {\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/american and port/port width}\pgf@circ@res@right} + {0pt}} + + \pgfusepath{draw} + + \pgfsetlinewidth{2\pgflinewidth} + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@left} + {\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\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/american and port/port width}\pgf@circ@res@right} + {.5\pgf@circ@res@down}} + {\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@right} + {0pt}} + \pgfpathcurveto + {\pgfpoint + {\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/american and port/port width}\pgf@circ@res@left} + {\pgf@circ@res@up}} + \pgfusepath{draw} +} + + + +\pgfcircdeclarelogicport{nand}{ + \pgfpathmoveto{\pgfpoint + {\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/input height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\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/american nand port/input height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint + {\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/american nand port/port width}\pgf@circ@res@right} + {0pt}} + + \pgfusepath{draw} + + \pgfsetlinewidth{2\pgflinewidth} + + \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}} + \pgfpathcurveto + {\pgfpoint{.0\pgf@circ@res@left}{\pgf@circ@res@down}} + {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{.5\pgf@circ@res@down}} + {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{0pt}} + \pgfpathcurveto + {\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/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}} + {\pgfpoint{.5\pgf@circ@res@step}{0pt}} + {\pgfpoint{0pt}{.5\pgf@circ@res@step}} + + \pgfusepath{draw} +} + + +\pgfcircdeclarelogicport{nor}{ + \pgfpathmoveto{\pgfpoint + {\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {(\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/american nor port/input height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint + {(\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/american nor port/port width}\pgf@circ@res@right} + {0pt}} + + \pgfusepath{draw} + + \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/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/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/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/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 + {\pgfpoint{\pgf@circ@res@other-.5\pgf@circ@res@step}{0pt}} + {\pgfpoint{.5\pgf@circ@res@step}{0pt}} + {\pgfpoint{0pt}{.5\pgf@circ@res@step}} + + \pgfusepath{draw} +} + + + + +\pgfcircdeclarelogicport{or}{ + + + \pgfpathmoveto{\pgfpoint + {\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {(\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/american or port/input height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint + {(\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/american or port/port width}\pgf@circ@res@right} + {0pt}} + + \pgfusepath{draw} + \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/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/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/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/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} +} + + +\pgfcircdeclarelogicport{xor}{ + + \pgfpathmoveto{\pgfpoint + {\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {(\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/american xor port/input height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint + {(\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/american xor port/port width}\pgf@circ@res@right} + {0pt}} + + \pgfusepath{draw} + \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/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/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/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/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/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/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/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} +} + + + +\pgfcircdeclarelogicport{xnor}{ + + \pgfpathmoveto{\pgfpoint + {\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {(\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/american xnor port/input height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint + {(\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/american xnor port/port width}\pgf@circ@res@right} + {0pt}} + + \pgfusepath{draw} + \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/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/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/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/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/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/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/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}} + + + \pgfpathellipse + {\pgfpoint{\pgf@circ@res@other-.5\pgf@circ@res@step}{0pt}} + {\pgfpoint{.5\pgf@circ@res@step}{0pt}} + {\pgfpoint{0pt}{.5\pgf@circ@res@step}} + + \pgfusepath{draw} +} + + +\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 + } + \savedanchor\left{% + \pgf@y=0pt + } + \anchor{in}{ + \northwest + \pgf@y=0pt + } + \anchor{out}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{center}{ + \pgfpointorigin + } + \anchor{east}{ + \left + \pgf@x=-.8\pgf@x + } + \anchor{west}{ + \left + } + \anchor{south}{ + \northwest + \pgf@x=0pt + \pgf@y=-\pgf@y + } + \anchor{north}{ + \northwest + \pgf@x=0pt + } + \anchor{south west}{ + \northwest + \pgf@y=-\pgf@y + } + \anchor{north east}{ + \northwest + \pgf@x=-\pgf@x + } + \anchor{north west}{ + \northwest + } + \anchor{south east}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-\pgf@y + } + \backgroundpath{ + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + + + \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 + } + \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 + } + \anchor{east}{ + \left + \pgf@x=-.8\pgf@x + } + \anchor{west}{ + \left + } + \anchor{south}{ + \northwest + \pgf@x=0pt + \pgf@y=-\pgf@y + } + \anchor{north}{ + \northwest + \pgf@x=0pt + } + \anchor{south west}{ + \northwest + \pgf@y=-\pgf@y + } + \anchor{north east}{ + \northwest + \pgf@x=-\pgf@x + } + \anchor{north west}{ + \northwest + } + \anchor{south east}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-\pgf@y + } + \backgroundpath{ + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + \northwest + \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} + + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +\long\def\pgfcircdeclaretransistor#1#2#3{ + \pgfdeclareshape{#1} + { + \anchor{center}{\pgfpointorigin} + \savedanchor\northeast{% upper right + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x=0pt + } +% \savedanchor\northeast{% +% \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} +% \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/height}\pgf@y +% \pgf@y=.5\pgf@y +% \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} +% \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/width}\pgf@x +% } + \savedanchor\left{%center left + \pgf@y=0pt + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/width}\pgf@x + } + \anchor{text}{ + \northeast + \pgfpoint + {12\pgf@circ@res@right +0.2*(\pgf@circ@res@right-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left)} + {0.6\pgf@y} + } + % + % pseudo-bipole + \anchor{left}{ % south + \northeast + \pgf@y=-\pgf@y + } + \anchor{right}{ + \northeast + } + \anchor{north}{ + \northeast + \pgf@circ@res@step=\pgf@y + \left + \pgf@y=\pgf@circ@res@step + \pgf@x=.5\pgf@x + } + \anchor{west}{ + \left + } + \anchor{east}{ + \pgf@x=0pt + \pgf@y=0pt + } + \anchor{south}{ + \northeast + \pgf@circ@res@step=\pgf@y + \left + \pgf@y=-\pgf@circ@res@step + \pgf@x=.5\pgf@x + } + \anchor{south west}{ + \northeast + \pgf@circ@res@step=\pgf@y + \left + \pgf@y=-\pgf@circ@res@step + } + \anchor{north east}{ + \northeast + } + \anchor{north west}{ + \northeast + \pgf@circ@res@step=\pgf@y + \left + \pgf@y=\pgf@circ@res@step + } + \anchor{south east}{ + \northeast + \pgf@y=-\pgf@y + } + + #2 + \backgroundpath{ + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + % + % + \northeast + \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 + % + } + } +} + + + + + + +\long\def\pgfcircdeclaremos#1#2#3{ + \pgfcircdeclaretransistor{#1}{ + \anchor{G}{ + \left + } + \anchor{gate}{ + \left + } + \anchor{B}{ + \left + \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@x + } + \anchor{base}{ + \left + \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@x + } + #2 + } + {#3} +} + + + + + + + + + +\pgfcircdeclaremos{nmos}{ + \anchor{D}{ + \northeast + } + \anchor{drain}{ + \northeast + } + \anchor{S}{ + \northeast + \pgf@y=-\pgf@y + } + \anchor{source}{ + \northeast + \pgf@y=-\pgf@y + } +}{% + \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}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@up}} + + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base height}\pgf@circ@res@down}} + + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/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/nmos/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@up}} + \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} + \pgfusepath{draw} + \endpgfscope + + \ifpgf@circuit@mos@arrows + \pgfscope + \pgfslopedattimetrue + \pgfallowupsidedownattimetrue + \pgfresetnontranslationattimefalse + \pgftransformlineattime{.6}{% + \pgfpoint% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left}% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}% + }{% + \pgfpoint + {\pgf@circ@res@right}% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}% + } + \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} + \endpgfscope + \fi + + + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/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} +} + + +\pgfcircdeclaremos{pmos}{ + \anchor{S}{ + \northeast + } + \anchor{source}{ + \northeast + } + \anchor{D}{ + \northeast + \pgf@y=-\pgf@y + } + \anchor{drain}{ + \northeast + \pgf@y=-\pgf@y + } +}{% + \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}} + \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} + + \ifpgf@circuit@mos@arrows + \pgfscope + \pgfslopedattimetrue + \pgfallowupsidedownattimetrue + \pgfresetnontranslationattimefalse + \pgftransformlineattime{.4}{% + \pgfpoint% + {\pgf@circ@res@right}% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}% + }{% + \pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left}% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}% + } + \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} + \endpgfscope + \fi + + \pgfscope + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base height}\pgf@circ@res@up}} + \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 + + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}} + + + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left} + {\pgf@circ@res@up+\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}} + \pgfusepath{draw} + + \pgfpathcircle{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left - \pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}} + {\pgf@circ@res@up+\pgf@circ@res@down}}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}} + \pgfusepath{draw,fill} + +} + + + + + + + +\pgfcircdeclaretransistor{pnp}{ + \anchor{E}{ + \northeast + } + \anchor{emitter}{ + \northeast + } + \anchor{B}{ + \left + } + \anchor{base}{ + \left + } + \anchor{C}{ + \northeast + \pgf@y=-\pgf@y + } + \anchor{collector}{ + \northeast + \pgf@y=-\pgf@y + } +}{ + \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}} + \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 + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/base height}\pgf@circ@res@up}} + \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 + + \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}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/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/pnp/gate height}\pgf@circ@res@up}% + }{% + \pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate width}\pgf@circ@res@left}% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate height 2}\pgf@circ@res@up}% + } + \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} + \endpgfscope + + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/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{npn}{ + \anchor{C}{ + \northeast + } + \anchor{collector}{ + \northeast + } + \anchor{B}{ + \left + } + \anchor{base}{ + \left + } + \anchor{E}{ + \northeast + \pgf@y=-\pgf@y + } + \anchor{emitter}{ + \northeast + \pgf@y=-\pgf@y + } +}{% + \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}} + \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 + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/base height}\pgf@circ@res@up}} + \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 + + \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}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/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/npn/gate width}\pgf@circ@res@left}% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate height 2}\pgf@circ@res@down}% + }{% + \pgfpoint{\pgf@circ@res@right}% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate height}\pgf@circ@res@down}% + } + \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} + \endpgfscope + + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/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{pigbt}{ + \anchor{E}{ + \northeast + } + \anchor{emitter}{ + \northeast + } + \anchor{B}{ + \left + } + \anchor{base}{ + \left + } + \anchor{C}{ + \northeast + \pgf@y=-\pgf@y + } + \anchor{collector}{ + \northeast + \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}{ + \northeast + } + \anchor{collector}{ + \northeast + } + \anchor{B}{ + \left + } + \anchor{base}{ + \left + } + \anchor{E}{ + \northeast + \pgf@y=-\pgf@y + } + \anchor{emitter}{ + \northeast + \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{B}{ + \left + \pgf@x=\pgf@circ@res@right + } + \anchor{base}{ + \left + \pgf@x=\pgf@circ@res@right + } + #2 + } + {#3} +} + + + +\pgfcircdeclarefet{nfet}{ + \anchor{D}{ + \northeast + } + \anchor{drain}{ + \northeast + } + \anchor{S}{ + \northeast + \pgf@y=-\pgf@y + } + \anchor{source}{ + \northeast + \pgf@y=-\pgf@y + } + \anchor{G}{ + \left + } + \anchor{gate}{ + \left + } + +}{% + \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}{ + \northeast + } + \anchor{drain}{ + \northeast + } + \anchor{S}{ + \northeast + \pgf@y=-\pgf@y + } + \anchor{source}{ + \northeast + \pgf@y=-\pgf@y + } + \anchor{G}{ + \left + } + \anchor{gate}{ + \left + } + +}{% + \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}{ + \northeast + } + \anchor{drain}{ + \northeast + } + \anchor{S}{ + \northeast + \pgf@y=-\pgf@y + } + \anchor{source}{ + \northeast + \pgf@y=-\pgf@y + } + \anchor{G}{ + \northeast + \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@y + \left + \pgf@y=-\pgf@circ@res@step + } + \anchor{gate}{ + \northeast + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\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} + + % SOLDER DOT at source-bulk connection + \pgfscope + \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{ + \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}} + \pgfnode{circ}{center}{}{}{} + \endpgfscope{} + + % 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 ENHANCEMENT TYPE with Bulk connector +\pgfcircdeclarefet{nigfetebulk}{ %nur ohne strich zwischen Bulk und Source + \anchor{D}{ + \northeast + } + \anchor{drain}{ + \northeast + } + \anchor{S}{ + \northeast + \pgf@y=-\pgf@y + } + \anchor{source}{ + \northeast + \pgf@y=-\pgf@y + } + \anchor{G}{ + \northeast + \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate height}\pgf@y + \left + \pgf@y=-\pgf@circ@res@step + } + \anchor{gate}{ + \northeast + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate height}\pgf@y + } +}{% + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + % DRAIN CONNECTION + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate height}\pgf@circ@res@up}} + % DRAIN + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate height}\pgf@circ@res@up}} + + % GATE, ENHANCEMENT TYPE (DASHED) + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/base height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/base height}\pgf@circ@res@up*0.45}} + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/base height}\pgf@circ@res@up*0.25}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/base height}\pgf@circ@res@down*0.25}} + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/base height}\pgf@circ@res@down*0.45}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/base height}\pgf@circ@res@down}} + + % BULK + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/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/nigfetebulk/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate height}\pgf@circ@res@down}} + % SOURCE CONNECTION + \pgfpathmoveto{\pgfpoint + {\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate height}\pgf@circ@res@down}} %Geändert + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + % GATE + \pgfscope + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/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/nigfetebulk/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/nigfetebulk/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate height}\pgf@circ@res@down}} + \pgfusepath{draw} +} + + + +% N-CHANNEL IGFET DEPLETION TYPE +\pgfcircdeclarefet{nigfetd}{ + \anchor{D}{ + \northeast + } + \anchor{drain}{ + \northeast + } + \anchor{S}{ + \northeast + \pgf@y=-\pgf@y + } + \anchor{source}{ + \northeast + \pgf@y=-\pgf@y + } + \anchor{G}{ + \northeast + \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/gate height}\pgf@y + \left + \pgf@y=-\pgf@circ@res@step + } + \anchor{gate}{ + \northeast + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/gate height}\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} + + + % SOLDER DOT at source-bulk connection + \pgfscope + \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{ + \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}} + \pgfnode{circ}{center}{}{}{} + \endpgfscope{} + + % 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}{ + \northeast + } + \anchor{drain}{ + \northeast + } + \anchor{S}{ + \northeast + \pgf@y=-\pgf@y + } + \anchor{source}{ + \northeast + \pgf@y=-\pgf@y + } + \anchor{G}{ + \northeast + \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate height}\pgf@y + \left + \pgf@y=-\pgf@circ@res@step + } + \anchor{gate}{ + \northeast + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate height}\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} + + + % SOLDER DOT at source-bulk connection + \pgfscope + \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{ + \pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate height}\pgf@circ@res@down}} + \pgfnode{circ}{center}{}{}{} + \endpgfscope + + % 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 ENHANCEMENT TYPE with bulk connector +\pgfcircdeclarefet{pigfetebulk}{ + \anchor{D}{ + \northeast + } + \anchor{drain}{ + \northeast + } + \anchor{S}{ + \northeast + \pgf@y=-\pgf@y + } + \anchor{source}{ + \northeast + \pgf@y=-\pgf@y + } + \anchor{G}{ + \northeast + \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/gate height}\pgf@y + \left + \pgf@y=-\pgf@circ@res@step + } + \anchor{gate}{ + \northeast + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/gate height}\pgf@y + } +}{% + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + % DRAIN CONNECTION + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/gate height}\pgf@circ@res@up}} + % DRAIN + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/gate height}\pgf@circ@res@up}} + \pgfusepath{draw} + + % GATE, DASHED, BOLD + \pgfscope + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/base height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/base height}\pgf@circ@res@up*0.45}} + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/base height}\pgf@circ@res@up*0.25}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/base height}\pgf@circ@res@down*0.25}} + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/base height}\pgf@circ@res@down*0.45}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/base height}\pgf@circ@res@down}} + \pgfsetlinewidth{2\pgflinewidth} + \pgfusepath{draw} + \endpgfscope + + % BULK + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/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/pigfetebulk/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/gate height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/gate height}\pgf@circ@res@down}} + % SOURCE CONNECTION + \pgfpathmoveto{\pgfpoint + {\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/gate height}\pgf@circ@res@down}} %Geändert + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + % GATE + \pgfscope + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/gate height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/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/pigfetebulk/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/pigfetebulk/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/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/pigfetebulk/gate height}\pgf@circ@res@down}} + \pgfusepath{draw} +} + + +% P-CHANNEL IGFET DEPLETION TYPE +\pgfcircdeclarefet{pigfetd}{ + \anchor{D}{ + \northeast + } + \anchor{drain}{ + \northeast + } + \anchor{S}{ + \northeast + \pgf@y=-\pgf@y + } + \anchor{source}{ + \northeast + \pgf@y=-\pgf@y + } + \anchor{G}{ + \northeast + \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@y + \left + \pgf@y=-\pgf@circ@res@step + } + \anchor{gate}{ + \northeast + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\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} + + + % SOLDER DOT at source-bulk connection + \pgfscope + \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{ + \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}} + \pgfnode{circ}{center}{}{}{} + \endpgfscope{} + + % 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}{ + \northeast + } + \anchor{drain}{ + \northeast + } + \anchor{S}{ + \northeast + \pgf@y=-\pgf@y + } + \anchor{source}{ + \northeast + \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}{ + \northeast + } + \anchor{source}{ + \northeast + } + \anchor{D}{ + \northeast + \pgf@y=-\pgf@y + } + \anchor{drain}{ + \northeast + \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} +} + + + + + + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + + + + + +% ISFET +\pgfcircdeclarefet{isfet}{ + \anchor{D}{ + \northeast + } + \anchor{drain}{ + \northeast + } + \anchor{S}{ + \northeast + \pgf@y=-\pgf@y + } + \anchor{source}{ + \northeast + \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/isfet/gate height}\pgf@circ@res@up}} + % DRAIN + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@up}} + \pgfusepath{draw} + + % GATE, DEPLETION TYPE + \pgfscope %% added + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base height}\pgf@circ@res@down}} + \pgfsetlinewidth{2\pgflinewidth} %% added + \pgfusepath{draw} %% added + \endpgfscope %% added + + % BULK + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/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/isfet/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/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/isfet/gate width}\pgf@circ@res@left} + % {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@up}} + %\pgfpathlineto{\pgfpoint + % {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate width}\pgf@circ@res@left} + % {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@down}} + %\pgfsetlinewidth{2\pgflinewidth} + %\pgfusepath{draw} + %\endpgfscope + + + % SOLDER DOT at source-bulk connection + \pgfscope + \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{ + \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}} + \pgfnode{circ}{center}{}{}{} + \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/isfet/base width}\pgf@circ@res@left}% + {\pgf@circ@res@up+\pgf@circ@res@down}% + } + \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} + \endpgfscope + \pgfusepath{draw} + + % Wavy lines + \pgfscope + \pgfpathmoveto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves x sep}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves y sep}\pgf@circ@res@up}} + \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}} + \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}} + \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}} + \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves x sep}\pgf@circ@res@up}{0cm}} + \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}} + \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}} + \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}} + \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves x sep}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves y sep}\pgf@circ@res@up}} + \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}} + \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}} + \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}} + \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}} + \pgfusepath{draw} + \endpgfscope + +} + + + + + + + + + + + + + + +%% 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} + +} + + + + + + + + + +\pgfcircdeclarebipole{ + \anchor{out 1}{ + \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi + \pgf@y=0cm + } + \anchor{out 2}{ + \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi + \pgf@y=.8\pgf@y + } +}{\ctikzvalof{tripoles/toggleswitch/height 2}}{toggleswitch}{\ctikzvalof{tripoles/toggleswitch/height}}{\ctikzvalof{tripoles/toggleswitch/width}}{ + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{.3\pgf@circ@res@left}{0pt}} + \pgfusepath{draw} + \pgfscope + \pgfpathmoveto{\pgfpoint{.3\pgf@circ@res@left}{0pt}} + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{.5\pgf@circ@res@up}} + \pgfusepath{draw} + \endpgfscope + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} + \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{0}} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{.8\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{.8\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{.15\pgf@circ@res@up}} + \pgfusepath{draw} + + + \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfusepath{draw} + + \pgfsetdash{{.08\pgf@circ@res@up}{.04\pgf@circ@res@up}{.7\pgf@circ@res@up}{.04\pgf@circ@res@up}{.8\pgf@circ@res@up}}{0cm} + \pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0}{.8\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@left}{.6\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0}{.4\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0}{.2\pgf@circ@res@up}} + \pgfusepath{draw} + \pgfsetdash{}{0cm} +} + + + + + + + + + + +\pgfdeclareshape{op amp} + { + \anchor{center}{\pgfpointorigin} + \savedanchor\northwest{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x + \pgf@x=.5\pgf@x + } + \anchor{south}{ + \northwest + \pgf@y=-\pgf@y + } + \anchor{north}{ + \northwest + } + \savedanchor\left{% + \pgf@y=0pt + } + \savedanchor\inOne{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x + \pgf@x=.5\pgf@x + } + \anchor{-}{ + \inOne + } + \anchor{+}{ + \inOne + \pgf@y=-\pgf@y + } + \savedanchor\up{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x + \pgf@x=.5\pgf@x + \pgf@circ@res@up = \pgf@y + \pgf@circ@res@right = -\pgf@x + \pgf@circ@res@left = \pgf@x + \pgfpointlineattime{ + \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/up pos}}{ + \pgfpoint{ + \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left} + {\pgf@circ@res@up}} + {\pgfpoint{.7\pgf@circ@res@right}{0pt}} + } + \anchor{up}{ + \up + } + \anchor{down}{ + \up + \pgf@y=-\pgf@y + } + \anchor{out}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{west}{ + \left + } + \anchor{east}{ + \left + \pgf@x=-\pgf@x + } + + \backgroundpath{ + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + + + \northwest + \pgf@circ@res@up = \pgf@y + \pgf@circ@res@down = -\pgf@y + \pgf@circ@res@right = -\pgf@x + \pgf@circ@res@left = \pgf@x + + \pgfpathmoveto{\pgfpoint + {\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}} + \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $-$} + + + \pgfpathmoveto{\pgfpoint + {\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}} + \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $+$} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} + \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}} + + \pgfusepath{draw} + + + \pgfscope + \pgfsetlinewidth{2\pgflinewidth} + \pgftransformxshift{.7\pgf@circ@res@left} + \pgf@circ@res@step=\pgf@circ@res@right + \advance\pgf@circ@res@step by -\pgf@circ@res@left + \pgf@circ@res@step=.7\pgf@circ@res@step + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}} + \pgfusepath{draw} + \endpgfscope + + + + } + } + +%%Transkonduktanzverstärker +\pgfdeclareshape{gm amp} + { + \anchor{center}{\pgfpointorigin} + \savedanchor\northwest{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/width}\pgf@x + \pgf@x=.5\pgf@x + } + \anchor{south}{ + \northwest + \pgf@y=-\pgf@y + } + \anchor{north}{ + \northwest + } + \savedanchor\left{% + \pgf@y=0pt + } + \savedanchor\inOne{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/width}\pgf@x + \pgf@x=.5\pgf@x + } + \anchor{-}{ + \inOne + } + \anchor{+}{ + \inOne + \pgf@y=-\pgf@y + } + \savedanchor\up{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/width}\pgf@x + \pgf@x=.5\pgf@x + \pgf@circ@res@up = \pgf@y + \pgf@circ@res@right = -\pgf@x + \pgf@circ@res@left = \pgf@x + \pgfpointlineattime{ + \pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/up pos}}{ + \pgfpoint{ + \pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left} + {\pgf@circ@res@up}} + {\pgfpoint{.7\pgf@circ@res@right}{0pt}} + } + \anchor{up}{ + \up + } + \anchor{down}{ + \up + \pgf@y=-\pgf@y + } + \anchor{out}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{west}{ + \left + } + \anchor{east}{ + \left + \pgf@x=-\pgf@x + } + + \backgroundpath{ + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + + \northwest + \pgf@circ@res@up = \pgf@y + \pgf@circ@res@down = -\pgf@y + \pgf@circ@res@right = -\pgf@x + \pgf@circ@res@left = \pgf@x + + \pgfpathmoveto{\pgfpoint + {\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@up}} + \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@up}]{\ $-$} + + + \pgfpathmoveto{\pgfpoint + {\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@down}} + \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@down}]{\ $+$} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} + \pgfpathlineto{\pgfpoint{.3\pgf@circ@res@right}{0pt}} % + + \pgfusepath{draw} + + \pgfscope + \pgfsetlinewidth{2\pgflinewidth} + \pgftransformxshift{.7\pgf@circ@res@left} + \pgf@circ@res@step=\pgf@circ@res@right + \advance\pgf@circ@res@step by -\pgf@circ@res@left + \pgf@circ@res@step=.7\pgf@circ@res@step + %Umrandung: + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0}} %geändert startpunkt neu am ausgangsstrich + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{15pt}}%vom Ausgang nach oben + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} %neu ecke links oben nach rechts oben + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} %bei deneigängen runter + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-15pt}}%ecke links unten nach rechts unten + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} %rechts unten zum ausgang + \pgfusepath{draw} + \endpgfscope + + + + } + } + + + +%% 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{latex'} + \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}} + \pgfusepath{draw} + \endpgfscope +} + + + + + +%% Generic tunable + +\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{latex'} + \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}} + \pgfusepath{draw} + \endpgfscope +} + + +\pgfdeclareshape{circulator} +{ + \savedanchor\northwest{ + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/circulator/width}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/circulator/width}\pgf@x + \pgf@x=.5\pgf@x + } + \anchor{center}{ + \pgfpointorigin + } + \anchor{left}{% + \northwest + \pgf@y=0pt + } + \anchor{1}{ + \northwest + \pgf@y=0pt + } + \anchor{2}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{3}{ + \northwest + \pgf@y=-\pgf@y + \pgf@x=0pt + } + \anchor{east}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{west}{ + \northwest + \pgf@y=0pt + } + \anchor{south}{ + \northwest + \pgf@x=0pt + \pgf@y=-\pgf@y + } + \anchor{north}{ + \northwest + \pgf@x=0pt + } + \anchor{south west}{ + \northwest + \pgf@y=-\pgf@y + } + \anchor{north east}{ + \northwest + \pgf@x=-\pgf@x + } + \anchor{north west}{ + \northwest + } + \anchor{south east}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-\pgf@y + } + \backgroundpath{ + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + + \pgf@circ@res@step=\ctikzvalof{tripoles/circulator/width}\pgf@circ@Rlen + + \pgfscope + \pgfstartlinewidth=\pgflinewidth + + % draw outer circle + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step} + \pgfusepath{draw} + + % inner arrow + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfsetarrowsend{latex} + \pgfpathmoveto{\pgfpoint{-0.25\pgf@circ@res@step}{0}} + \pgfpatharc{180}{-90} {0.25\pgf@circ@res@step} + \pgfpathlineto{\pgfpoint{-5pt}{-0.2\pgf@circ@res@step}} + \pgfusepath{draw} + \endpgfscope + } +} + + +% Wilkinson divider +\pgfdeclareshape{wilkinson}{ + \anchor{center}{ + \northwest + \pgf@x=0pt + \pgf@y=0pt + } + \savedanchor\northwest{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/wilkinson/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=.5\pgf@x + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/wilkinson/width}\pgf@x + } + \anchor{north}{ + \northwest + \pgf@x=0pt + } + \anchor{south}{ + \northwest + \pgf@x=0pt + \pgf@y=-\pgf@y + } + \anchor{west}{ + \northwest + \pgf@y=0pt + } + \anchor{east}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{south west}{ + \northwest + \pgf@y=-\pgf@y + } + \anchor{north east}{ + \northwest + \pgf@x=-\pgf@x + } + \anchor{north west}{ + \northwest + } + \anchor{south east}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-\pgf@y + } + \anchor{in}{ + \northwest + \pgf@y=0pt + } + \anchor{out1}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-0.5\pgf@y + } + \anchor{out2}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=0.5\pgf@y + } + \anchor{text}{ + \northwest + \advance \pgf@y by 0.5\ht\pgfnodeparttextbox + \pgf@x=-.5\wd\pgfnodeparttextbox + } + \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 + + \pgfstartlinewidth=\pgflinewidth + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + % draw inner stuff + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0pt}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}} + + \pgfusepath{draw} + + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + % draw inner resisitor - european or american style is recognised + { + \pgftransformshift{\pgfpoint{0.5\pgf@circ@res@right}{0pt}} + \pgftransformrotate{90} + + % calculate size of resistor + \ifpgf@circuit@europeanresistor + \pgfmathparse{\pgf@circ@res@up / \pgf@circ@Rlen / \ctikzvalof{bipoles/generic/width} / 2} + \pgftransformscale{\pgfmathresult} + \pgfnode{genericshape}{center}{}{pgf@generic}{\pgfusepath{fill}} + \else + \pgfmathparse{\pgf@circ@res@up / \pgf@circ@Rlen / \ctikzvalof{bipoles/resistor/width} / 2} + \pgftransformscale{\pgfmathresult} + \pgfnode{resistorshape}{center}{}{pgf@resistor}{\pgfusepath{fill}} + \fi + } + + \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.25\pgf@circ@res@up}} + + \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0.25\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@down}} + \pgfusepath{draw} + + } +} + + +\endinput diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex new file mode 100644 index 00000000000..dc7e3f703f8 --- /dev/null +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex @@ -0,0 +1,66 @@ +% Copyright 2007-2009 by Massimo Redaelli +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Public License. +% +% 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 + \def\pgf@temp{} + \StrBetween{#1}{<}{>}[\pgf@circ@handleSI@unit] + \StrLen{\pgf@circ@handleSI@unit}[\pgf@circ@handleSI@unit@len] + + \ifnum\pgf@circ@handleSI@unit@len=0 + \pgf@circ@siunitx@resfalse + \else + \IfEndWith{#1}{>}{ + \pgf@circ@siunitx@restrue + \noexpandarg + \StrBefore{#1}{<}[\pgf@circ@handleSI@val] + %\typeout{si |#1|} + }{ + \pgf@circ@siunitx@resfalse + %\typeout{no si |#1|} + } + \fi +} + +\def\pgf@circ@finallabel#1{% + \edef\pgf@temp{}% + \edef\pgf@circ@temp{\ctikzvalof{bipole/#1label/unit}}% + \ifx\pgf@temp\pgf@circ@temp% + \ctikzvalof{bipole/#1label/name}% + \else% + $\SI{\ctikzvalof{bipole/#1label/name}}{\ctikzvalof{bipole/#1label/unit}}$% + \fi% +} + +\def\pgf@circ@ifkeyempty#1{ + \pgfextra{ + \ctikzset{#1/.get=\pgf@circ@temp} + \edef\pgf@temp{} + } + \ifx\pgf@circ@temp\pgf@temp +} + + +\endinput diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex new file mode 100644 index 00000000000..97e6259df39 --- /dev/null +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex @@ -0,0 +1,285 @@ +% Copyright 2007-2009 by Massimo Redaelli +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Public License. +% +% See the file doc/LICENSE for more details. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Voltage management + + +\ctikzset{v^>/.style = { + v = #1, + \circuitikzbasekey/bipole/voltage/direction = forward, + \circuitikzbasekey/bipole/voltage/position = above + } +} + +\ctikzset{v^/.style = { + v = #1, + \circuitikzbasekey/bipole/voltage/direction = forward, + \circuitikzbasekey/bipole/voltage/position = below + } +} + +\ctikzset{v_/.style = {v = #1, \circuitikzbasekey/bipole/voltage/direction = forward} } +\ctikzset{v4 \ifnum\pgfcircmathresult <86 + \ifpgf@circuit@bipole@voltage@below + \def\pgf@circ@bipole@voltage@label@anchor{north west} + \else \def\pgf@circ@bipole@voltage@label@anchor{south east} + \fi + \fi\fi + \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95 + \ifpgf@circuit@bipole@voltage@below + \def\pgf@circ@bipole@voltage@label@anchor{west} + \else \def\pgf@circ@bipole@voltage@label@anchor{east} + \fi + \fi\fi + \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176 + \ifpgf@circuit@bipole@voltage@below + \def\pgf@circ@bipole@voltage@label@anchor{south west} + \else \def\pgf@circ@bipole@voltage@label@anchor{north east} + \fi + \fi\fi + \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185 + \ifpgf@circuit@bipole@voltage@below + \def\pgf@circ@bipole@voltage@label@anchor{south} + \else\def\pgf@circ@bipole@voltage@label@anchor{north} + \fi + \fi\fi + \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266 + \ifpgf@circuit@bipole@voltage@below + \def\pgf@circ@bipole@voltage@label@anchor{south east} + \else\def\pgf@circ@bipole@voltage@label@anchor{north west} + \fi + \fi\fi + \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275 + \ifpgf@circuit@bipole@voltage@below + \def\pgf@circ@bipole@voltage@label@anchor{east} + \else \def\pgf@circ@bipole@voltage@label@anchor{west} + \fi + \fi\fi + \ifnum\pgfcircmathresult >284 \ifnum\pgfcircmathresult <356 + \ifpgf@circuit@bipole@voltage@below + \def\pgf@circ@bipole@voltage@label@anchor{north east} + \else\def\pgf@circ@bipole@voltage@label@anchor{south west} + \fi + \fi\fi + \ifnum\pgfcircmathresult >-1 \ifnum\pgfcircmathresult <5 + \ifpgf@circuit@bipole@voltage@below + \def\pgf@circ@bipole@voltage@label@anchor{north} + \else\def\pgf@circ@bipole@voltage@label@anchor{south} + \fi + \fi\fi + \ifnum\pgfcircmathresult >355 \ifnum\pgfcircmathresult <361 + \ifpgf@circuit@bipole@voltage@below + \def\pgf@circ@bipole@voltage@label@anchor{north} + \else\def\pgf@circ@bipole@voltage@label@anchor{south} + \fi + \fi\fi + + \ifpgf@circuit@bipole@voltage@below + \def\pgf@circ@bipole@voltage@label@where{-90} + \else + \def\pgf@circ@bipole@voltage@label@where{90} + \fi + + \edef\pgf@temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/european label distance} + \pgfkeysifdefined{\pgf@temp} + { \edef\eudist{\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/european label distance}} } + { \edef\eudist{\ctikzvalof{voltage/european label distance}} } + } + + \ifpgf@circuit@bipole@isvoltage + \pgf@circ@drawvoltagegenerator + \else + \pgf@circ@drawvoltagegeneric + \fi + (\ctikzvalof{bipole/name}.\pgf@circ@bipole@voltage@label@where) + coordinate (Vlab) at ($(\ctikzvalof{bipole/name}.center) ! + \ifpgf@circuit@europeanvoltage\eudist\else\ctikzvalof{voltage/american label distance}\fi ! + (\ctikzvalof{bipole/name}.\pgf@circ@bipole@voltage@label@where)$) + node [anchor=\pgf@circ@bipole@voltage@label@anchor, inner sep=0] + at (Vlab) { \pgf@circ@finallabel{voltage/} } +} + + + + +\endinput + +% coordinate (pgfcirc@Vcont1) at ($ (\ctikzvalof{bipole/name}.center) ! +% \ctikzvalof{voltage/bump b} ! +% (\ctikzvalof{bipole/name}.-110) $) +% coordinate (pgfcirc@Vcont2) at ($ (\ctikzvalof{bipole/name}.center) ! +% \ctikzvalof{voltage/bump b} ! +% (\ctikzvalof{bipole/name}.-70) $) +% \else +% coordinate (pgfcirc@Vcont1) at ($ (\ctikzvalof{bipole/name}.center) ! +% \ctikzvalof{voltage/bump b} ! +% (\ctikzvalof{bipole/name}.110) $) +% coordinate (pgfcirc@Vcont2) at ($ (\ctikzvalof{bipole/name}.center) ! +% \ctikzvalof{voltage/bump b} ! +% (\ctikzvalof{bipole/name}.70) $) +% \fi diff --git a/Master/texmf-dist/tex/latex/circuitikz/circuitikz.code.tex b/Master/texmf-dist/tex/latex/circuitikz/circuitikz.code.tex deleted file mode 100644 index 3ed036a7cab..00000000000 --- a/Master/texmf-dist/tex/latex/circuitikz/circuitikz.code.tex +++ /dev/null @@ -1,604 +0,0 @@ - -%% 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{monopoles/chassis/width/.initial=.25} -\ctikzset{monopoles/alternative chassis/width/.initial=.25} -\ctikzset{monopoles/equipotentiality/width/.initial=.25} -\ctikzset{monopoles/tlinestub/width/.initial=.25} -\ctikzset{monopoles/antenna/width/.initial=.25} -\ctikzset{monopoles/antenna/label/xanchor/.initial=.4} -\ctikzset{monopoles/antenna/label/yanchor/.initial=.75} -\ctikzset{monopoles/txantenna/label/xanchor/.initial=.4} -\ctikzset{monopoles/txantenna/label/yanchor/.initial=.75} -\ctikzset{monopoles/txantenna/width/.initial=.25} -\ctikzset{monopoles/rxantenna/label/xanchor/.initial=.4} -\ctikzset{monopoles/rxantenna/label/yanchor/.initial=.75} -\ctikzset{monopoles/rxantenna/width/.initial=.25} - -\ctikzset{bipoles/resistor/height/.initial=.3} -\ctikzset{bipoles/resistor/width/.initial=.8} -\ctikzset{bipoles/potentiometer/height/.initial=.8} -\ctikzset{bipoles/potentiometer/height 2/.initial=.3} -\ctikzset{bipoles/potentiometer/width/.initial=.8} -\ctikzset{bipoles/photoresistor/height/.initial=.6} -\ctikzset{bipoles/photoresistor/height 2/.initial=.3} -\ctikzset{bipoles/photoresistor/width/.initial=.8} -\ctikzset{bipoles/thermistor/main/.initial=.7} -\ctikzset{bipoles/thermistor/height/.initial=.428}%.3/.7 -\ctikzset{bipoles/thermistorntc/width/.initial=.8} -\ctikzset{bipoles/thermistorntc/main/.initial=.7} -\ctikzset{bipoles/thermistorntc/height/.initial=.428}%.3/.7 -\ctikzset{bipoles/thermistorntc/height 2/.initial=.75}%.3/.7 -\ctikzset{bipoles/thermistorptc/width/.initial=.8} -\ctikzset{bipoles/thermistorptc/main/.initial=.7} -\ctikzset{bipoles/thermistorptc/height/.initial=.428}%.3/.7 -\ctikzset{bipoles/thermistorptc/height 2/.initial=.75}%.3/.7 -\ctikzset{bipoles/thermistor/width/.initial=.8} -\ctikzset{bipoles/varistor/main/.initial=.7} -\ctikzset{bipoles/varistor/height/.initial=.428}%.3/.7 -\ctikzset{bipoles/varistor/width/.initial=.8} -\ctikzset{bipoles/vresistor/height/.initial=.6} -\ctikzset{bipoles/vresistor/width/.initial=.8} -\ctikzset{bipoles/cuteinductor/height/.initial=.3} -\ctikzset{bipoles/cuteinductor/width/.initial=.8} -\ctikzset{bipoles/cuteinductor/coils/.initial=6} -\ctikzset{bipoles/americaninductor/height/.initial=.3} -\ctikzset{bipoles/americaninductor/height 2/.initial=.1} -\ctikzset{bipoles/americaninductor/width/.initial=.8} -\ctikzset{bipoles/americaninductor/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/vamericaninductor/height/.initial=.6} -\ctikzset{bipoles/vamericaninductor/height 2/.initial=.2} -\ctikzset{bipoles/vamericaninductor/width/.initial=.8} -\ctikzset{bipoles/vamericaninductor/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/vsourcesquare/height/.initial=.60} -\ctikzset{bipoles/vsourcesquare/width/.initial=.60} -\ctikzset{bipoles/cisource/height/.initial=.7} -\ctikzset{bipoles/cisource/width/.initial=.7} -\ctikzset{bipoles/cisourceam/height/.initial=.7} -\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/battery1/height/.initial=.6} -\ctikzset{bipoles/battery1/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/fuse/height/.initial=.20} -\ctikzset{bipoles/fuse/width/.initial=.50} -\ctikzset{bipoles/afuse/height/.initial=.20} -\ctikzset{bipoles/afuse/width/.initial=.50} -\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=.70} -\ctikzset{bipoles/tgeneric/width/.initial=.80} -\ctikzset{bipoles/tfullgeneric/height/.initial=.70} -\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/buffer/height/.initial=1} -\ctikzset{bipoles/buffer/width/.initial=1} -\ctikzset{bipoles/not port/width/.initial=1} -\ctikzset{bipoles/not port/height/.initial=.8} -\ctikzset{bipoles/not port/circle width/.initial=.15} -\ctikzset{bipoles/lamp/height/.initial=.60} -\ctikzset{bipoles/lamp/width/.initial=.60} -\ctikzset{bipoles/tline/height/.initial=.3} -\ctikzset{bipoles/tline/width/.initial=.8} -\ctikzset{bipoles/squid/height/.initial=.60} -\ctikzset{bipoles/squid/width/.initial=.60} -\ctikzset{bipoles/barrier/height/.initial=.60} -\ctikzset{bipoles/barrier/width/.initial=.60} -\ctikzset{bipoles/thermocouple/height/.initial=.250} -\ctikzset{bipoles/thermocouple/height 2/.initial=.60} -\ctikzset{bipoles/thermocouple/width/.initial=.140} -\ctikzset{bipoles/pushbutton/height/.initial=.5} -\ctikzset{bipoles/pushbutton/height 2/.initial=.0} -\ctikzset{bipoles/pushbutton/width/.initial=.50} - -\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} - -\ctikzset{tripoles/isfet/width/.initial=1} -\ctikzset{tripoles/isfet/gate height/.initial=.35} -\ctikzset{tripoles/isfet/base height/.initial=.5} -\ctikzset{tripoles/isfet/height/.initial=1.1} -\ctikzset{tripoles/isfet/base width/.initial=.3} -\ctikzset{tripoles/isfet/gate width/.initial=.5} -\ctikzset{tripoles/isfet/wave width/.initial=.16} -\ctikzset{tripoles/isfet/wave amp/.initial=.06} -\ctikzset{tripoles/isfet/waves y sep/.initial=.22} -\ctikzset{tripoles/isfet/waves x sep/.initial=.8} - -\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/plain amp/width/.initial=1.7} -\ctikzset{tripoles/plain amp/port width/.initial=.7} -\ctikzset{tripoles/plain amp/height/.initial=1.4} -\ctikzset{tripoles/plain amp/input height/.initial=.5} -\ctikzset{tripoles/plain amp/up pos/.initial=.45} - -\ctikzset{tripoles/thyristor/height/.initial=1.10} -\ctikzset{tripoles/thyristor/height 2/.initial=.5} -\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{tripoles/spdt/width/.initial=.85} -\ctikzset{tripoles/spdt/height/.initial=.45} -\ctikzset{tripoles/spdt/margin/.initial=.45} - -\ctikzset{tripoles/toggleswitch/height/.initial=.8} -\ctikzset{tripoles/toggleswitch/height 2/.initial=.0} -\ctikzset{tripoles/toggleswitch/width/.initial=.80} - -\ctikzset{tripoles/mixer/height/.initial=.85} -\ctikzset{tripoles/mixer/width/.initial=.85} -\ctikzset{tripoles/mixer/margin/.initial=.75} - -\ctikzset{quadpoles/transformer/width/.initial=1.5} -\ctikzset{quadpoles/transformer/width1/.initial=.4} -\ctikzset{quadpoles/transformer/height/.initial=1.5} -\ctikzset{quadpoles/transformer/height1/.initial=.8} -\ctikzset{quadpoles/transformer core/width/.initial=1.5} -\ctikzset{quadpoles/transformer core/height/.initial=1.5} -\ctikzset{quadpoles/transformer core/core height/.initial=.5} -\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/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} -% special cases -\ctikzset{bipoles/generic/voltage/distance from node/.initial=.4} -\ctikzset{bipoles/generic/voltage/bump b/.initial=2} -\ctikzset{bipoles/generic/voltage/european label distance/.initial=1.8} -%\ctikzset{bipoles/thermocouple/voltage/distance from node/.initial=.3} -\ctikzset{bipoles/thermocouple/voltage/bump b/.initial=2.2} -\ctikzset{bipoles/thermocouple/voltage/european label distance/.initial=1.5} -\ctikzset{bipoles/ageneric/voltage/distance from node/.initial=.4} -\ctikzset{bipoles/ageneric/voltage/bump b/.initial=2} -\ctikzset{bipoles/ageneric/voltage/european label distance/.initial=1.8} -\ctikzset{bipoles/fullgeneric/voltage/distance from node/.initial=.4} -\ctikzset{bipoles/fullgeneric/voltage/bump b/.initial=2} -\ctikzset{bipoles/fullgeneric/voltage/european label distance/.initial=1.8} -\ctikzset{bipoles/memristor/voltage/distance from node/.initial=.4} -\ctikzset{bipoles/memristor/voltage/bump b/.initial=2} -\ctikzset{bipoles/memristor/voltage/european label distance/.initial=1.8} -%\ctikzset{bipoles/tline/voltage/distance from node/.initial=.2} -\ctikzset{bipoles/tline/voltage/bump b/.initial=2.4} -\ctikzset{bipoles/tline/voltage/european label distance/.initial=2.1} -%\ctikzset{bipoles/varistor/voltage/distance from node/.initial=.2} -\ctikzset{bipoles/varistor/voltage/bump b/.initial=2.4} -\ctikzset{bipoles/varistor/voltage/european label distance/.initial=2} -%\ctikzset{bipoles/photoresistor/voltage/distance from node/.initial=.2} -\ctikzset{bipoles/photoresistor/voltage/bump b/.initial=2} -\ctikzset{bipoles/photoresistor/voltage/european label distance/.initial=1.8} -%\ctikzset{bipoles/thermistor/voltage/distance from node/.initial=.2} -\ctikzset{bipoles/thermistor/voltage/bump b/.initial=2.4} -\ctikzset{bipoles/thermistor/voltage/european label distance/.initial=2} -%\ctikzset{bipoles/thermistorntc/voltage/distance from node/.initial=.2} -\ctikzset{bipoles/thermistorntc/voltage/bump b/.initial=1.6} -%\ctikzset{bipoles/thermistorptc/voltage/distance from node/.initial=.2} -\ctikzset{bipoles/thermistorptc/voltage/bump b/.initial=1.6} - -\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 } - -\ctikzset{label/align/.is choice} -\ctikzset{label/align/straight/.code={\ctikzsetvalof{label/align}{straight}}} -\ctikzset{label/align/rotate/.code={\ctikzsetvalof{label/align}{rotate}}} -\ctikzset{label/align/smart/.code={\ctikzsetvalof{label/align}{smart}}} -%% dependencies - - -\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 0a66adeb372..6565fb9668e 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty +++ b/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty @@ -17,23 +17,23 @@ \NeedsTeXFormat{LaTeX2e} -\def\pgfcircversion{0.3.0} +\def\pgfcircversion{0.4} \ProvidesPackage{circuitikz}% - [2012/12/29 The CircuiTikz circuit drawing package version \pgfcircversion] + [2015/05/15 The CircuiTikz circuit drawing package version \pgfcircversion] %% Version 2.0 of pgf/TikZ is required \RequirePackage{tikz} \usetikzlibrary{calc} -\usepgflibrary{decorations.pathmorphing,arrows} +\usepgflibrary{arrows} \DeclareOption{european}{ \ctikzset{voltage=european} \ctikzset{current=european} \ctikzset{inductor=european} - \ctikzset{resistor=european} \ctikzset{logic ports=european} + \ctikzset{resistor=european} \ctikzset{logic ports=european} \ctikzset{gas filled surge arrester = european} } \DeclareOption{american}{ - \ctikzset{voltage=american} \ctikzset{current=american} \ctikzset{resistor=american} \ctikzset{inductor=american} + \ctikzset{voltage=american} \ctikzset{current=american} \ctikzset{resistor=american} \ctikzset{inductor=american} \ctikzset{gas filled surge arrester = american} \ctikzset{logic ports = american} } @@ -93,6 +93,14 @@ \ctikzset{logic ports = european} } +\DeclareOption{americangfsurgearrester}{ + \ctikzset{gas filled surge arrester = american} +} + +\DeclareOption{europeangfsurgearrester}{ + \ctikzset{gas filled surge arrester = european} +} + \DeclareOption{siunitx}{ \pgf@circ@siunitxtrue @@ -123,8 +131,6 @@ } -%%%%%%%%% Compatibility - \DeclareOption{fulldiode}{ \ctikzset{diode = full} @@ -186,6 +192,69 @@ \ctikzset{logic ports = european} } +\DeclareOption{compatibility}{ + \pgf@circuit@compattrue +} + +\DeclareOption{betterproportions}{ + \ctikzset{monopoles/ground/width/.initial=.15} + + \ctikzset{bipoles/resistor/height/.initial=.23} + \ctikzset{bipoles/resistor/width/.initial=.6} + \ctikzset{bipoles/capacitor/height/.initial=.4} + \ctikzset{bipoles/capacitor/width/.initial=.1} + \ctikzset{bipoles/potentiometer/height/.initial=.6} + \ctikzset{bipoles/potentiometer/height 2/.initial=.23} + \ctikzset{bipoles/potentiometer/width/.initial=.6} + \ctikzset{bipoles/photoresistor/height/.initial=.6} + \ctikzset{bipoles/photoresistor/height 2/.initial=.23} + \ctikzset{bipoles/photoresistor/width/.initial=.6} + \ctikzset{bipoles/thermistor/main/.initial=.7} + \ctikzset{bipoles/thermistor/height/.initial=.328}%.23/.7 + \ctikzset{bipoles/thermistor/width/.initial=.6} + \ctikzset{bipoles/thermistorntc/width/.initial=.6} + \ctikzset{bipoles/thermistorntc/main/.initial=.7} + \ctikzset{bipoles/thermistorntc/height/.initial=.328}%.23/.7 + \ctikzset{bipoles/thermistorntc/height 2/.initial=.75}%.23/.7 + \ctikzset{bipoles/thermistorptc/width/.initial=.6} + \ctikzset{bipoles/thermistorptc/main/.initial=.7} + \ctikzset{bipoles/thermistorptc/height/.initial=.328}%.23/.7 + \ctikzset{bipoles/varistor/main/.initial=.7} + \ctikzset{bipoles/varistor/height/.initial=.328}%.23/.7 + \ctikzset{bipoles/varistor/width/.initial=.6} + \ctikzset{bipoles/vresistor/height/.initial=.45} + \ctikzset{bipoles/vresistor/width/.initial=.6} + \ctikzset{bipoles/generic/height/.initial=.23} + \ctikzset{bipoles/generic/width/.initial=.6} + \ctikzset{bipoles/generic potentiometer/height/.initial=.6} + \ctikzset{bipoles/generic potentiometer/height 2/.initial=.23} + \ctikzset{bipoles/generic potentiometer/width/.initial=.6} + \ctikzset{bipoles/ageneric/height/.initial=.23} + \ctikzset{bipoles/ageneric/width/.initial=.6} + \ctikzset{bipoles/memristor/height/.initial=.23} + \ctikzset{bipoles/memristor/wave height/.initial=.375} + \ctikzset{bipoles/memristor/width/.initial=.60} + \ctikzset{bipoles/tgeneric/height/.initial=.525} + \ctikzset{bipoles/tgeneric/width/.initial=.6} + \ctikzset{bipoles/tfullgeneric/height/.initial=.525} + \ctikzset{bipoles/tfullgeneric/width/.initial=.60} + \ctikzset{bipoles/fullgeneric/height/.initial=.23} + \ctikzset{bipoles/fullgeneric/width/.initial=.6} + \ctikzset{bipoles/diode/height/.initial=.3} + \ctikzset{bipoles/diode/width/.initial=.25} + + \ctikzset{tripoles/thyristor/height/.initial=.66} + \ctikzset{tripoles/thyristor/height 2/.initial=.3} + \ctikzset{tripoles/thyristor/width/.initial=.6} + \ctikzset{tripoles/thyristor/diode height/.initial=.3} + \ctikzset{tripoles/thyristor/diode width left/.initial=.4} + \ctikzset{tripoles/thyristor/diode width right/.initial=.3} + + \ctikzset{tripoles/triac/height/.initial=.66} + \ctikzset{tripoles/triac/width/.initial=.6} + \ctikzset{tripoles/triac/diode width left/.initial=.3} + \ctikzset{tripoles/triac/diode width right/.initial=.3} +} %%%%%%%%% @@ -193,7 +262,10 @@ \input circuitikz.code.tex -\ExecuteOptions{europeancurrents,europeanvoltages,americanports,americanresistors,cuteinductors,nosiunitx,noarrowmos,smartlabels} +% Latex specific +\ctikzset{tripoles/op amp/font/.initial=\scriptsize} + +\ExecuteOptions{europeancurrents,europeanvoltages,americanports,americanresistors,cuteinductors,europeangfsurgearrester,nosiunitx,noarrowmos,smartlabels,nocompatibility} \ProcessOptions\relax @@ -205,8 +277,11 @@ \input circuitikz1.code.tex -\newenvironment{circuitikz}{ -\begin{tikzpicture}}{\end{tikzpicture}} +\newenvironment{circuitikz}{\begin{tikzpicture}}{\end{tikzpicture}} +%override (unused) circuitikz environment for compability to externalization) +\let\circuitikz\tikzpicture +\let\endcircuitikz\endtikzpicture + \endinput diff --git a/Master/texmf-dist/tex/latex/circuitikz/circuitikz1.code.tex b/Master/texmf-dist/tex/latex/circuitikz/circuitikz1.code.tex deleted file mode 100644 index 4118b2bd9de..00000000000 --- a/Master/texmf-dist/tex/latex/circuitikz/circuitikz1.code.tex +++ /dev/null @@ -1,479 +0,0 @@ -%%%%%%%%%%%% -%% 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/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} - } - ($(\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@thermistor@path#1{\pgf@circ@bipole@path{thermistor}{#1}} -\def\pgf@circ@thermistorptc@path#1{\pgf@circ@bipole@path{thermistorptc}{#1}} -\def\pgf@circ@thermistorntc@path#1{\pgf@circ@bipole@path{thermistorntc}{#1}} -\def\pgf@circ@varistor@path#1{\pgf@circ@bipole@path{varistor}{#1}} -\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@battery1@path#1{\pgf@circ@bipole@path{battery1}{#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@vsourcesquare@path#1{\pgf@circ@bipole@path{vsourcesquare}{#1}} -\def\pgf@circ@isourceam@path#1{\pgf@circ@bipole@path{isourceAM}{#1}} -\def\pgf@circ@cvsource@path#1{\pgf@circ@bipole@path{cvsource}{#1}} -\def\pgf@circ@cvsourceam@path#1{\pgf@circ@bipole@path{cvsourceAM}{#1}} -\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@pushbutton@path#1{\pgf@circ@bipole@path{pushbutton}{#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@photoresistor@path#1{\pgf@circ@bipole@path{photoresistor}{#1}} -\def\pgf@circ@thyristor@path#1{\pgf@circ@bipole@path{thyristor}{#1}} -\def\pgf@circ@toggleswitch@path#1{\pgf@circ@bipole@path{toggleswitch}{#1}} -\def\pgf@circ@memristor@path#1{\pgf@circ@bipole@path{memristor}{#1}} -\def\pgf@circ@triac@path#1{\pgf@circ@bipole@path{triac}{#1}} -\def\pgf@circ@tline@path#1{\pgf@circ@bipole@path{tline}{#1}} -\def\pgf@circ@squid@path#1{\pgf@circ@bipole@path{squid}{#1}} -\def\pgf@circ@barrier@path#1{\pgf@circ@bipole@path{barrier}{#1}} -\def\pgf@circ@thermocouple@path#1{\pgf@circ@bipole@path{thermocouple}{#1}} -\def\pgf@circ@fuse@path#1{\pgf@circ@bipole@path{fuse}{#1}} -\def\pgf@circ@afuse@path#1{\pgf@circ@bipole@path{afuse}{#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{varistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@varistor@path, l=#1}} -\tikzset{photoresistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@photoresistor@path, l=#1}} -\tikzset{thermistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistor@path, l=#1}} -\tikzset{thermistor ptc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorptc@path, l=#1}} -\tikzset{thermistor ntc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorntc@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{battery1/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@battery1@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{tline/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tline@path, l=#1}} -\tikzset{transmission line/.style = {tline = #1}} -\tikzset{TL/.style = {tline = #1}} -\tikzset{european voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsource@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} -\tikzset{american voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} -\tikzset{european current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isource@path, \circuitikzbasekey/bipole/is current=true, i=#1}} -\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{square voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcesquare@path, \circuitikzbasekey/bipole/is voltage=true, v=#1 }} -\tikzset{sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}} -\tikzset{controlled sinusoidal voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsourcesin@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} -\tikzset{controlled sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}} - -\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{squid/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@squid@path}} -\tikzset{barrier/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@barrier@path}} -\tikzset{thermocouple/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermocouple@path}} -\tikzset{fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fuse@path}} -\tikzset{asymmetric fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@afuse@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{push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbutton@path, l=#1}} -\tikzset{toggle switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@toggleswitch@path}} - -\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{vsourcesquare/.style = {square voltage source = #1}} -\tikzset{isourcesin/.style = {sinusoidal current source = #1}} -\tikzset{cisourcesin/.style = {controlled sinusoidal current source = #1}} -\tikzset{cvsourcesin/.style = {controlled sinusoidal voltage source = #1}} - -\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{phR/.style= {photoresistor = #1}} -\tikzset{thR/.style= {thermistor = #1}} -\tikzset{thRp/.style= {thermistor ptc= #1}} -\tikzset{thRn/.style= {thermistor ntc= #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{sqV/.style = {square voltage source = #1}} -\tikzset{csV/.style = {controlled sinusoidal voltage source = #1}} -\def\pgf@temp#1{ - \tikzset{V#1/.style = {voltage source, v#1=##1} } - \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}} - -\tikzset{afuse/.style = {asymmetric fuse=#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} - } - ($(\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 deleted file mode 100644 index 34c11a86c20..00000000000 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcircbipoles.sty +++ /dev/null @@ -1,1779 +0,0 @@ -% Copyright 2007-2009 by Massimo Redaelli -% -% This file may be distributed and/or modified -% -% 1. under the LaTeX Project Public License and/or -% 2. under the GNU Public License. -% -% See the file doc/LICENSE for more details. - -%% Generic macro for defining a bipole shape -% #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 - - -\long\def\pgfcircdeclarebipole#1#2#3#4#5#6{ - \pgfdeclareshape{#3shape}{ - - \savedanchor{\northeast}{ - \pgf@y=#4\pgf@circ@Rlen - \pgf@y=.5\pgf@y - \pgf@x=#5\pgf@circ@Rlen - \pgf@x=.5\pgf@x - } - \savedanchor{\northeastborder}{ - \pgf@y=#4\pgf@circ@Rlen - \pgf@y=.5\pgf@y - \pgf@y=\ctikzvalof{bipoles/border margin}\pgf@y - \pgf@x=#5\pgf@circ@Rlen - \pgf@x=.5\pgf@x - \pgf@x=\ctikzvalof{bipoles/border margin}\pgf@x - } - \savedanchor{\southwestborder}{ - \pgf@y=-#2\pgf@circ@Rlen - \pgf@y=.5\pgf@y - \pgf@y=\ctikzvalof{bipoles/border margin}\pgf@y - \pgf@x=-#5\pgf@circ@Rlen - \pgf@x=.5\pgf@x - \pgf@x=\ctikzvalof{bipoles/border margin}\pgf@x - } - \savedanchor{\southwest}{ - \pgf@y=-#2\pgf@circ@Rlen - \pgf@y=.5\pgf@y - \pgf@x=-#5\pgf@circ@Rlen - \pgf@x=.5\pgf@x - } - \savedanchor{\centerpoint}{ - \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 - \pgf@y=.5\pgf@y - } - \anchor{center}{\pgfpointorigin} - \anchor{n}{ - \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi - \pgf@x=0cm - } - \anchor{ne}{ - \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi - } - \anchor{nw}{ - \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi - \pgf@x=-\pgf@x - } - \anchor{e}{% - \ifpgf@circuit@bipole@reversed\else\southwest\northeast\fi - \pgf@y=0cm - } - \anchor{s}{% - \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi - \pgf@x=0cm - } - \anchor{se}{% - \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi - \pgf@x=-\pgf@x - } - \anchor{sw}{% - \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi - } - \anchor{w}{ - \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi - \pgf@y=0cm - } - \anchor{north}{ - \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi - \pgf@x=0cm - } - \anchor{east}{% - \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi - \pgf@y=0cm - } - \anchor{south}{% - \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi - \pgf@x=0cm - } - \anchor{west}{ - \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi - \pgf@y=0cm - } - \anchor{right}{ - \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi - \pgf@y=0cm - } - \anchor{above}{ - \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi - \pgf@x=0cm - } - \anchor{left}{% - \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi - \pgf@y=0cm - } - \anchor{below}{% - \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi - \pgf@x=0cm - } - \anchor{a}{% - \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi - \pgf@y=0cm - } - \anchor{b} { - \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi - \pgf@y=0cm - } - \savedanchor{\textanchor}{% - \pgf@y=\ht\pgfnodeparttextbox - \pgf@x=-.5\wd\pgfnodeparttextbox - } - \anchor{text}{% - \textanchor - } - \anchorborder{% - \def\pgf@temp{false} - \ifpgf@circuit@bipole@reversed\pgf@temp - \pgf@circ@res@left=-\pgf@x - \pgf@circ@res@right=-\pgf@y - \else - \pgf@circ@res@left=\pgf@x - \pgf@circ@res@right=\pgf@y - \fi - \ifdim\pgf@circ@res@right>0cm - \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@right}}{\northeastborder} - \else - \southwestborder - \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@right}}{\pgfpoint{-\pgf@x}{-\pgf@y}} - \fi - } - - #1 - - \backgroundpath{ - \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} - - \northeast - \pgf@circ@res@up = \pgf@y - \pgf@circ@res@zero = 0cm - \pgf@circ@res@left = -\pgf@x - \pgf@circ@res@right = \pgf@x - \southwest - \pgf@circ@res@down = \pgf@y - - \pgfstartlinewidth=\pgflinewidth - - #6 - - \pgfsetlinewidth{\pgfstartlinewidth} - } - } -} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% Standard bipole shapes declarations - -%% Resistor -\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 - - \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@up}} - \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@up}} - \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@up}} - \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} -} - - - -%% 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} - - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - - \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 - \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\myfrac\pgf@circ@res@up}} - \advance\pgf@circ@res@other by 2\pgf@circ@res@step - \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\myfrac\pgf@circ@res@down}} - \advance\pgf@circ@res@other by 2\pgf@circ@res@step - \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\myfrac\pgf@circ@res@up}} - \advance\pgf@circ@res@other by 2\pgf@circ@res@step - \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\myfrac\pgf@circ@res@down}} - \advance\pgf@circ@res@other by 2\pgf@circ@res@step - \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\myfrac\pgf@circ@res@up}} - \advance\pgf@circ@res@other by 2\pgf@circ@res@step - \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\myfrac\pgf@circ@res@down}} - \advance\pgf@circ@res@other by \pgf@circ@res@step - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} - \pgfusepath{draw} - - \pgfscope - \pgfsetarrowsend{latex'} - \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@other}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@other}{\pgf@circ@res@down}} - \pgfusepath{draw} - \endpgfscope -} - - - -%% Capacitor - -\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 - - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} - \pgfusepath{draw} -} - - -%% 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}}{ - \pgf@circ@res@step = \ctikzvalof{bipoles/battery/width}\pgf@circ@Rlen - \divide \pgf@circ@res@step by 6 - - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}} - - \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@down}} - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{.5\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{.5\pgf@circ@res@down}} - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} - - \pgfusepath{draw} -} - - -%% Battery 1 - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/battery1/height}}{battery1}{\ctikzvalof{bipoles/battery1/height}}{\ctikzvalof{bipoles/battery1/width}}{ - \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{0}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}} - \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{0}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}} - \pgfusepath{draw} - - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@down}} - - \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@down}} - - - - - \pgfusepath{draw} -} - - - -%% cute inductor - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cuteinductor/height}}{cuteinductor}{\ctikzvalof{bipoles/cuteinductor/height}}{\ctikzvalof{bipoles/cuteinductor/width}}{ - \pgf@circ@res@step=\ctikzvalof{bipoles/cuteinductor/width}\pgf@circ@Rlen - \divide \pgf@circ@res@step by \ctikzvalof{bipoles/cuteinductor/coils} - - \pgfdecorationsegmentamplitude=\ctikzvalof{bipoles/cuteinductor/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} -} - - - -%% american inductor - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/americaninductor/height 2}}{americaninductor}{\ctikzvalof{bipoles/americaninductor/height}}{\ctikzvalof{bipoles/americaninductor/width}}{ - \pgf@circ@res@step=\ctikzvalof{bipoles/americaninductor/width}\pgf@circ@Rlen - \divide \pgf@circ@res@step by \ctikzvalof{bipoles/americaninductor/coils} - - \pgfdecorationsegmentamplitude=\ctikzvalof{bipoles/americaninductor/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}} - \endpgfdecoration - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfusepath{stroke} -} - - - - - -%% Independent voltage source - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsource/height}}{vsource}{\ctikzvalof{bipoles/vsource/height}}{\ctikzvalof{bipoles/vsource/width}}{ - - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - - \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} - \pgfusepath{draw} -} - - -%% Independent voltage source - American style - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsourceam/height}}{vsourceAM}{\ctikzvalof{bipoles/vsourceam/height}}{\ctikzvalof{bipoles/vsourceam/width}}{ - - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - - \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} - - - \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{$+$} - \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@up]{$-$} - - \pgfusepath{draw} -} - - - -%% Independent sinusoidal voltage source - -\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}} - \pgfusepath{draw} - - \pgf@circ@res@up = .5\pgf@circ@res@up - \pgfscope - \pgftransformrotate{90} - \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}} - \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}} - \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}} - \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}} - \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}} - \pgfusepath{draw} - \endpgfscope -} - - - - -% contributed by Alistair Kwan -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsourcesquare/height}}{vsourcesquare}{\ctikzvalof{bipoles/vsourcesquare/height}}{\ctikzvalof{bipoles/vsourcesquare/width}}{ - - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} - \pgfusepath{draw} - - \pgf@circ@res@up = .5\pgf@circ@res@up - \pgfscope - \pgftransformrotate{90} - \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}} - \pgfpathlineto{\pgfpoint{-1\pgf@circ@res@up}{1\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0\pgf@circ@res@up}{1\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0\pgf@circ@res@up}{-1\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{-1\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{0\pgf@circ@res@up}} - \pgfusepath{draw} - \endpgfscope -} - - -%% Independent current source - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/isource/height}}{isource}{\ctikzvalof{bipoles/isource/height}}{\ctikzvalof{bipoles/isource/width}}{ - \pgfpointorigin - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}} - \pgfusepath{draw} -} - - - - -%% Independent current source - American - -\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}} - \pgfusepath{draw} - - \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}} - \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@zero}} - \pgfusepath{draw} - \pgfscope - \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}} - \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} - \endpgfscope -} - - - - -%% Independent sinusoidal current source - -\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}} - \pgfusepath{draw} - - \pgf@circ@res@up = .5\pgf@circ@res@up - \pgfscope - \pgftransformrotate{90} - \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}} - \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}} - \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}} - \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}} - \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}} - \pgfusepath{draw} - \endpgfscope - -} - - -%% Controlled voltage source - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cvsource/height}}{cvsource}{\ctikzvalof{bipoles/cvsource/height}}{\ctikzvalof{bipoles/cvsource/width}}{ - - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} - \pgfusepath{draw} -} - - - - -%% Controlled voltage source - American - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cvsourceam/height}}{cvsourceAM}{\ctikzvalof{bipoles/cvsourceam/height}}{\ctikzvalof{bipoles/cvsourceam/width}}{ - - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} - \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@left]{$+$} - \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@right]{$-$} - \pgfusepath{draw} -} - - -%% Controlled sinusoidal voltage source - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cvsourcesin/height}}{cvsourcesin}{\ctikzvalof{bipoles/cvsourcesin/height}}{\ctikzvalof{bipoles/cvsourcesin/width}}{ - - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - - \pgfscope - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} - \pgfusepath{draw} - \endpgfscope - - \pgf@circ@res@up = .5\pgf@circ@res@up - \pgfscope - \pgftransformrotate{90} - \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}} - \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}} - \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}} - \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}} - \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}} - \pgfusepath{draw} - \endpgfscope -} - - - -%% Controlled sinusoidal current source - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cvsourcesin/height}}{cisourcesin}{\ctikzvalof{bipoles/cvsourcesin/height}}{\ctikzvalof{bipoles/cvsourcesin/width}}{ - - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - - \pgfscope - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} - \pgfusepath{draw} - \endpgfscope - - \pgf@circ@res@up = .5\pgf@circ@res@up - \pgfscope - \pgftransformrotate{90} - \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}} - \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}} - \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}} - \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}} - \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}} - \pgfusepath{draw} - \endpgfscope -} - - - - -%% Controlled current source - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cisource/height}}{cisource}{\ctikzvalof{bipoles/cisource/height}}{\ctikzvalof{bipoles/cisource/width}}{ - - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}} - \pgfusepath{draw} -} - - - - -%% Controlled current source - American - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cisourceam/height}}{cisourceAM}{\ctikzvalof{bipoles/cisourceam/height}}{\ctikzvalof{bipoles/cisourceam/width}}{ - - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} - \pgfusepath{draw} - - \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}} - \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@zero}} - \pgfusepath{draw} - \pgfscope - \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}} - \pgfnode{currarrow}{center}{}{}{\pgfusepath{draw}} - \endpgfscope -} - -%% Black generic diode - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fulldiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ - - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - - \pgfscope - \pgftransformxshift{\pgf@circ@res@left} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfusepath{draw,fill} - \endpgfscope - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfusepath{draw} -} - -%% Black Zener diode - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fullzdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ - - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - - \pgfscope - \pgftransformxshift{\pgf@circ@res@left} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfusepath{draw,fill} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.2\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfusepath{draw} - \endpgfscope -} - -%% Black Schottky diode - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fullsdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ - - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfscope - \pgftransformxshift{\pgf@circ@res@left} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfusepath{draw,fill} - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{.8\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.2\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.2\pgf@circ@res@left}{.8\pgf@circ@res@up}} - \pgfusepath{draw} - \endpgfscope - -} - -%% Black tunnel diode - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fulltdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ - - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfscope - \pgftransformxshift{\pgf@circ@res@left} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfusepath{draw,fill} - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfusepath{draw} - \endpgfscope -} - -%% Black light emitting diode - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fulllediode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ - - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfscope - \pgftransformxshift{\pgf@circ@res@left} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfusepath{draw,fill} - \endpgfscope - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfusepath{draw} - - \pgfsetlinewidth{\pgfstartlinewidth} - \pgfsetarrowsend{latex'} - \pgfpathmoveto{\pgfpoint{.1\pgf@circ@res@up}{.6\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@up}{\pgf@circ@res@up}} - \pgfusepath{draw} - \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@up}{.4\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@up}{.8\pgf@circ@res@up}} - \pgfusepath{draw} - -} - -%% Black photodiode - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fullpdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ - - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfscope - \pgftransformxshift{\pgf@circ@res@left} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfusepath{draw,fill} - \endpgfscope - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfusepath{draw} - - \pgfsetlinewidth{\pgfstartlinewidth} - \pgfsetarrowsstart{latex'} - \pgfpathmoveto{\pgfpoint{.1\pgf@circ@res@up}{.6\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@up}{\pgf@circ@res@up}} - \pgfusepath{draw} - \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@up}{.4\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@up}{.8\pgf@circ@res@up}} - \pgfusepath{draw} -} - -%% Black varcap - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/varcap/height}}{fullvarcap}{\ctikzvalof{bipoles/varcap/height}}{\ctikzvalof{bipoles/varcap/width}}{ - - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfscope - \pgftransformxshift{\pgf@circ@res@left} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{0pt}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{0pt}} - \pgfusepath{draw,fill} - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfusepath{draw} - - \endpgfscope -} - -%% Empty generic diode - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptydiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ - - - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - - \pgfscope - \pgftransformxshift{\pgf@circ@res@left} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfusepath{draw} - \endpgfscope - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfusepath{draw} -} - -%% Empty Zener diode - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptyzdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ - - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - - \pgfscope - \pgftransformxshift{\pgf@circ@res@left} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfusepath{draw} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.2\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfusepath{draw} - \endpgfscope -} - -%% Empty Schottky diode - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptysdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ - - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfscope - \pgftransformxshift{\pgf@circ@res@left} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfusepath{draw} - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{.8\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.2\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.2\pgf@circ@res@left}{.8\pgf@circ@res@up}} - \pgfusepath{draw} - \endpgfscope - -} - -%% Empty tunnel diode - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptytdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ - - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfscope - \pgftransformxshift{\pgf@circ@res@left} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfusepath{draw} - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfusepath{draw} - \endpgfscope -} - -%% Empty light emitting diode - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptylediode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ - - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfscope - \pgftransformxshift{\pgf@circ@res@left} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfusepath{draw} - \endpgfscope - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfusepath{draw} - - \pgfscope - \pgfsetlinewidth{\pgfstartlinewidth} - \pgfsetarrowsend{latex'} - \pgfpathmoveto{\pgfpoint{.1\pgf@circ@res@up}{.6\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@up}{\pgf@circ@res@up}} - \pgfusepath{draw} - \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@up}{.4\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@up}{.8\pgf@circ@res@up}} - \pgfusepath{draw} - \endpgfscope -} - -%% Empty photodiode - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptypdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{ - - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfscope - \pgftransformxshift{\pgf@circ@res@left} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfusepath{draw} - \endpgfscope - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfusepath{draw} - - \pgfsetlinewidth{\pgfstartlinewidth} - \pgfsetarrowsstart{latex'} - \pgfpathmoveto{\pgfpoint{.1\pgf@circ@res@up}{.6\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@up}{\pgf@circ@res@up}} - \pgfusepath{draw} - \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@up}{.4\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@up}{.8\pgf@circ@res@up}} - \pgfusepath{draw} -} - -%% Empty varcap - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/varcap/height}}{emptyvarcap}{\ctikzvalof{bipoles/varcap/height}}{\ctikzvalof{bipoles/varcap/width}}{ - - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfscope - \pgftransformxshift{\pgf@circ@res@left} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{0pt}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{0pt}} - \pgfusepath{draw} - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfusepath{draw} - - \endpgfscope -} - -%% Closing SPST - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/interr/height 2}}{cspst}{\ctikzvalof{bipoles/interr/height}}{\ctikzvalof{bipoles/interr/width}}{ - - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} - \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfpathmoveto{\pgfpoint{.9\pgf@circ@res@left}{.9\pgf@circ@res@up}} - \pgfpatharc{65}{25}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/interr/width}\pgf@circ@Rlen} - %\pgfsetarrowsend{latex'} - \pgfusepath{draw} - - \pgfpathmoveto{\pgfpoint{.1\pgf@circ@res@right}{-.25\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{.14\pgf@circ@res@right}{-.35\pgf@circ@res@up}} - \pgfsetarrowsend{latex'} - \pgfusepath{draw} - -} - -%% Opening SPST - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/interr/height 2}}{ospst}{\ctikzvalof{bipoles/interr/height}}{\ctikzvalof{bipoles/interr/width}}{ - - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} - \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfpathmoveto{\pgfpoint{.3\pgf@circ@res@right}{.1\pgf@circ@res@down}} - \pgfpatharc{15}{50}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/interr/width}\pgf@circ@Rlen} - %\pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfusepath{draw} - - \pgfpathmoveto{\pgfpoint{.85\pgf@circ@res@left}{1.25\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{.87\pgf@circ@res@left}{1.26\pgf@circ@res@up}} - \pgfsetarrowsend{latex'} - \pgfusepath{draw} - - -} - - -%% Push Button - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/pushbutton/height 2}}{pushbutton}{\ctikzvalof{bipoles/pushbutton/height}}{\ctikzvalof{bipoles/pushbutton/width}}{ - - %\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@up}} - \pgfpathmoveto{\pgfpoint{0}{.5\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@up}} - \pgfusepath{draw} - - \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} - \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}} - \pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}} - \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}} -} - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% Ammeter - -\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 - \else - \def\pgf@circ@temp{below} - \ifx\tikz@res@label@pos\pgf@circ@temp - \pgf@circ@res@step=-1.2\pgf@circ@res@up - \else - \pgf@circ@res@step=1.2\pgf@circ@res@up - \fi - \fi - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} - \pgfpointorigin \pgf@circ@res@other = \pgf@x \advance \pgf@circ@res@other by -\pgf@circ@res@up - \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}} - \pgfusepath{draw} - - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - - \pgfscope - \pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up} - \pgfusepath{draw} - \endpgfscope - - \pgfsetlinewidth{\pgfstartlinewidth} - - \pgfsetarrowsend{latex} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}} - \pgfusepath{draw} - \pgfsetarrowsend{} - - - \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@zero}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} - \pgfusepath{draw} - - \pgfnode{circle}{center}{\textbf{A}}{}{} -} - -%% Voltmeter - -\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 - \else - \def\pgf@circ@temp{below} - \ifx\tikz@res@label@pos\pgf@circ@temp - \pgf@circ@res@step=-1.2\pgf@circ@res@up - \else - \pgf@circ@res@step=1.2\pgf@circ@res@up - \fi - \fi - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} - \pgfpointorigin \pgf@circ@res@other = \pgf@x \advance \pgf@circ@res@other by -\pgf@circ@res@up - \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}} - \pgfusepath{draw} - - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - - \pgfscope - \pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up} - \pgfusepath{draw} - \endpgfscope - - \pgfsetlinewidth{\pgfstartlinewidth} - - \pgfsetarrowsend{latex} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}} - \pgfusepath{draw} - \pgfsetarrowsend{} - - - \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@zero}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} - \pgfusepath{draw} - - \pgfnode{circle}{center}{\textbf{V}}{}{} - -} - -%% Short circuit - -\pgfcircdeclarebipole{}{0}{short}{0}{0}{ } - -%% Open circuit - -\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}}{ - - %\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} -} - - -%% fuse - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/fuse/height}}{fuse}{\ctikzvalof{bipoles/fuse/height}}{\ctikzvalof{bipoles/fuse/width}}{ - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}} - \pgfusepath{draw} - - \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} -} - - - -%% Generic bipole, filled - used as inductor by some (bleah) - -\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 - - \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{fill} -} - - -%% Generic asymmetric bipole - -\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} -} - - -%% asymmetric fuse - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/afuse/height}}{afuse}{\ctikzvalof{bipoles/afuse/height}}{\ctikzvalof{bipoles/afuse/width}}{ - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}} - \pgfusepath{draw} - - \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} - - \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} - \pgfusepath{stroke,fill} -} - - - - -%% Generic empty tunable - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/tgeneric/height}}{tgeneric}{\ctikzvalof{bipoles/tgeneric/height}}{\ctikzvalof{bipoles/tgeneric/width}}{ - \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{.4\pgf@circ@res@down}} - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfusepath{draw} - - \pgfscope - \pgfsetarrowsend{latex'} - \pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfusepath{draw} - \endpgfscope -} - -%% Photoresistor - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/photoresistor/height 2}}{photoresistor}{\ctikzvalof{bipoles/photoresistor/height}}{\ctikzvalof{bipoles/photoresistor/width}}{ - \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 - \pgfsetarrowsend{latex'} - \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{.3\pgf@circ@res@right}{-1.2\pgf@circ@res@down}} - \pgfusepath{draw} - \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{.05\pgf@circ@res@right}{-1.2\pgf@circ@res@down}} - \pgfusepath{draw} - \endpgfscope -} - - - - -%% Thermistor -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/thermistor/height}}{thermistor}{\ctikzvalof{bipoles/thermistor/height}}{\ctikzvalof{bipoles/thermistor/width}}{ - \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistor/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistor/main}\pgf@circ@res@up}} - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfusepath{draw} - - %\pgfscope - \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfusepath{draw} - %\endpgfscope -} - - -%% Thermistor PTC -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/thermistorptc/height 2}}{thermistorptc}{\ctikzvalof{bipoles/thermistorptc/height}}{\ctikzvalof{bipoles/thermistorptc/width}}{ - \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorptc/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorptc/main}\pgf@circ@res@up}} - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfusepath{draw} - - \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{-\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}} - \pgfusepath{draw} - - \pgfsetlinewidth{\pgfstartlinewidth} - \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\tiny$\vartheta$} - \pgfsetarrowsend{latex'} - \pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}} - \pgfusepath{draw} - \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{.45\pgf@circ@res@left}{.7\pgf@circ@res@down}} - \pgfusepath{draw} -} - -%% Thermistor NTC -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/thermistorntc/height 2}}{thermistorntc}{\ctikzvalof{bipoles/thermistorntc/height}}{\ctikzvalof{bipoles/thermistorntc/width}}{ - \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorntc/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorntc/main}\pgf@circ@res@up}} - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfusepath{draw} - - \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{-\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}} - \pgfusepath{draw} - - \pgfsetlinewidth{\pgfstartlinewidth} - \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\tiny$\vartheta$} - \pgfsetarrowsend{latex'} - \pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}} - \pgfusepath{draw} - \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@left}{.7\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{.45\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfusepath{draw} -} - -%% thermocouple -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/thermocouple/height 2}}{thermocouple}{\ctikzvalof{bipoles/thermocouple/height}}{\ctikzvalof{bipoles/thermocouple/width}}{ - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}} - \pgfusepath{draw} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}} - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@down}} - \pgfusepath{draw} - \pgfsetlinewidth{\pgfstartlinewidth} - \pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}} - \pgfusepath{draw} -} - -%% Varistor -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/varistor/height}}{varistor}{\ctikzvalof{bipoles/varistor/height}}{\ctikzvalof{bipoles/varistor/width}}{ - \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/varistor/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/varistor/main}\pgf@circ@res@up}} - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfusepath{draw} - - \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfusepath{draw} - - \pgftext[top,x=.65\pgf@circ@res@left,y=1.2\pgf@circ@res@down]{{\tiny\textsf{U}}} -} - - - -%% 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}{.4\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{.4\pgf@circ@res@down}} - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfusepath{draw,fill} - - \pgfscope - \pgfsetarrowsend{latex'} - \pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{-.5\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{latex'} - \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/vamericaninductor/height 2}}{vamericaninductor}{\ctikzvalof{bipoles/vamericaninductor/height}}{\ctikzvalof{bipoles/vamericaninductor/width}}{ - \pgf@circ@res@step=\ctikzvalof{bipoles/vamericaninductor/width}\pgf@circ@Rlen - \divide \pgf@circ@res@step by \ctikzvalof{bipoles/vamericaninductor/coils} - - \pgfdecorationsegmentamplitude=\ctikzvalof{bipoles/vamericaninductor/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{latex'} - \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{latex'} - \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 - -\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}} - - -%% The output routine - -\def\drawpoles{ - \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/left}} \def\pgf@temp{empty} } - \ifx\pgf@temp\pgf@circ@temp - { (\tikztostart) node[ocirc] {} } - \else - \pgfextra{ \def\pgf@temp{full} } - \ifx\pgf@temp\pgf@circ@temp - { (\tikztostart) node[circ] {} } - \fi - \fi - \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/right}} \def\pgf@temp{empty} } - \ifx\pgf@temp\pgf@circ@temp - { (\tikztotarget) node[ocirc] {} } - \else - \pgfextra{ \def\pgf@temp{full} } - \ifx\pgf@temp\pgf@circ@temp - { (\tikztotarget) node[circ] {} } - \fi - \fi -} - - - - - - - - - - - - - - - - - - - - -%% Lamp - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/lamp/height}}{lamp}{\ctikzvalof{bipoles/lamp/height}}{\ctikzvalof{bipoles/lamp/width}}{ - - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - - \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} - \pgfpathmoveto{\pgfpoint{.7071*\pgf@circ@res@left}{.7071*\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{.7071*\pgf@circ@res@right}{.7071*\pgf@circ@res@down}} - \pgfpathmoveto{\pgfpoint{.7071*\pgf@circ@res@left}{.7071*\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{.7071*\pgf@circ@res@right}{.7071*\pgf@circ@res@up}} - \pgfusepath{draw} -} - - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/tline/height} - }{tline}{\ctikzvalof{bipoles/tline/height} - }{\ctikzvalof{bipoles/tline/width} - } - { - \pgf@circ@res@step=.2\pgf@circ@res@right % half x axis - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfpathellipse{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{0}} - {\pgfpoint{\pgf@circ@res@step}{0}} - {\pgfpoint{0}{-\pgf@circ@res@up}} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@step}{\pgf@circ@res@up}} - \pgfpatharc{-90}{90}{-\pgf@circ@res@step and -\pgf@circ@res@up} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{\pgf@circ@res@down}} - \pgfusepath{draw} -} - - - - -%% SQUID added by Cor Molenaar 5 March 2010 - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/squid/height}}{squid}{\ctikzvalof{bipoles/squid/height}}{\ctikzvalof{bipoles/squid/width}}{ - - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - - \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} - \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{1.35*\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.65*\pgf@circ@res@up}} - \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.65*\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{1.35*\pgf@circ@res@up}} - \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{1.35*\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.65*\pgf@circ@res@down}} - \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.65*\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{1.35*\pgf@circ@res@down}} - - \pgfusepath{draw} -} - - - -% Generic barrier added by Cor Molenaar 5 March 2010 - -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/barrier/height}}{barrier}{\ctikzvalof{bipoles/barrier/height}}{\ctikzvalof{bipoles/barrier/width}}{ - - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@step}} - \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.35*\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.35*\pgf@circ@res@down}} - \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.35*\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.35*\pgf@circ@res@up}} - - \pgfusepath{draw} -} - - -% Contributed by Danilo Piazzalunga - -\pgfdeclareshape{buffer} - { - \anchor{center}{\pgfpointorigin} - \savedanchor\northwest{% - \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/buffer/height}\pgf@y - \pgf@y=.5\pgf@y - \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/buffer/width}\pgf@x - \pgf@x=.5\pgf@x - } - \anchor{south}{ - \northwest - \pgf@y=-\pgf@y - } - \savedanchor\left{% - \pgf@y=0pt - } - \anchor{in}{ - \northwest - \pgf@y=0pt - } - \anchor{out}{ - \northwest - \pgf@y=0pt - \pgf@x=-\pgf@x - } - - \backgroundpath{ - \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} - - - \northwest - \pgf@circ@res@up = \pgf@y - \pgf@circ@res@down = -\pgf@y - \pgf@circ@res@right = -\pgf@x - \pgf@circ@res@left = \pgf@x - - \pgfscope - \pgfsetlinewidth{2\pgflinewidth} - \pgftransformxshift{.7\pgf@circ@res@left} - \pgf@circ@res@step=\pgf@circ@res@right - \advance\pgf@circ@res@step by -\pgf@circ@res@left - \pgf@circ@res@step=.7\pgf@circ@res@step - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}} - \pgfusepath{draw} - \endpgfscope - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} - \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}} - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} - \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}} - - \pgfusepath{draw} - - } - } - - - - - -\pgfdeclareshape{plain amp} - { - \anchor{center}{\pgfpointorigin} - \savedanchor\northwest{% - \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/height}\pgf@y - \pgf@y=.5\pgf@y - \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/width}\pgf@x - \pgf@x=.5\pgf@x - } - \anchor{south}{ - \northwest - \pgf@y=-\pgf@y - } - \savedanchor\left{% - \pgf@y=0pt - } - \savedanchor\inOne{% - \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/height}\pgf@y - \pgf@y=.5\pgf@y - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@y - \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/width}\pgf@x - \pgf@x=.5\pgf@x - } - \anchor{-}{ - \inOne - } - \anchor{+}{ - \inOne - \pgf@y=-\pgf@y - } - \savedanchor\up{% - \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/height}\pgf@y - \pgf@y=.5\pgf@y - \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/width}\pgf@x - \pgf@x=.5\pgf@x - \pgf@circ@res@up = \pgf@y - \pgf@circ@res@right = -\pgf@x - \pgf@circ@res@left = \pgf@x - \pgfpointlineattime{ - \pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/up pos}}{ - \pgfpoint{ - \pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/port width}\pgf@circ@res@left} - {\pgf@circ@res@up}} - {\pgfpoint{.7\pgf@circ@res@right}{0pt}} - } - \anchor{up}{ - \up - } - \anchor{down}{ - \up - \pgf@y=-\pgf@y - } - \anchor{out}{ - \northwest - \pgf@y=0pt - \pgf@x=-\pgf@x - } - - \backgroundpath{ - \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} - - - \northwest - \pgf@circ@res@up = \pgf@y - \pgf@circ@res@down = -\pgf@y - \pgf@circ@res@right = -\pgf@x - \pgf@circ@res@left = \pgf@x - - \pgfpathmoveto{\pgfpoint - {\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/port width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@up}} - - - \pgfpathmoveto{\pgfpoint - {\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/port width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@down}} - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} - \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}} - - \pgfusepath{draw} - - - \pgfscope - \pgfsetlinewidth{2\pgflinewidth} - \pgftransformxshift{.7\pgf@circ@res@left} - \pgf@circ@res@step=\pgf@circ@res@right - \advance\pgf@circ@res@step by -\pgf@circ@res@left - \pgf@circ@res@step=.7\pgf@circ@res@step - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}} - \pgfusepath{draw} - \endpgfscope - - - - } - } - -\endinput diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcirccurrent.sty b/Master/texmf-dist/tex/latex/circuitikz/pgfcirccurrent.sty deleted file mode 100644 index 05926bbcbdb..00000000000 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcirccurrent.sty +++ /dev/null @@ -1,239 +0,0 @@ -% Copyright 2007-2009 by Massimo Redaelli -% -% This file may be distributed and/or modified -% -% 1. under the LaTeX Project Public License and/or -% 2. under the GNU Public License. -% -% See the file doc/LICENSE for more details. - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% Current handling - -%% Options - - -\ctikzset{i^>/.style = { - i = #1, - \circuitikzbasekey/bipole/current/direction = forward, - \circuitikzbasekey/bipole/current/x position = after, - \circuitikzbasekey/bipole/current/y position = above - } -} - -\ctikzset{i_>/.style = { - i = #1, - \circuitikzbasekey/bipole/current/direction = forward, - \circuitikzbasekey/bipole/current/x position = after, - \circuitikzbasekey/bipole/current/y position = below - } -} - -\ctikzset{i>^/.style = { - i = #1, - \circuitikzbasekey/bipole/current/direction = forward, - \circuitikzbasekey/bipole/current/x position = before, - \circuitikzbasekey/bipole/current/y position = above - } -} - -\ctikzset{i>_/.style = { - i = #1, - \circuitikzbasekey/bipole/current/direction = forward, - \circuitikzbasekey/bipole/current/x position = before, - \circuitikzbasekey/bipole/current/y position = below - } -} - -\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{ - \ifpgf@circuit@bipole@current@before - \ifpgf@circuit@bipole@current@backward - { (\ctikzvalof{bipole/name}.left) -- - node [currarrow, pos=\ctikzvalof{current/distance}, sloped, allow upside down] (Iarrow) {} - (\tikztostart) - } - \else - { (\tikztostart) -- - node [currarrow, pos=\ctikzvalof{current/distance}, sloped, allow upside down] (Iarrow) {} - (\ctikzvalof{bipole/name}.left) - } - \fi - \else - \ifpgf@circuit@bipole@current@backward - { (\tikztotarget) -- - node [currarrow, pos=\ctikzvalof{current/distance}, sloped, allow upside down] (Iarrow) {} - (\ctikzvalof{bipole/name}.right) - } - \else - { (\ctikzvalof{bipole/name}.right) -- - node [currarrow, pos=\ctikzvalof{current/distance}, sloped, allow upside down] (Iarrow) {} - (\tikztotarget) - } - \fi - \fi -} - -%% Output routine -%% #1 - node name - -\def\pgf@circ@drawcurrent{ - \pgfextra{ - \edef\pgf@circ@ffffff{\pgf@circ@direction} - \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@ffffff\pgf@nil} - - \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86 - \ifpgf@circuit@bipole@current@below - \def\pgf@circ@dir{north west} \else \def\pgf@circ@dir{south east} - \fi - \fi\fi - \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95 - \ifpgf@circuit@bipole@current@below - \def\pgf@circ@dir{west} \else \def\pgf@circ@dir{east} - \fi - \fi\fi - \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176 - \ifpgf@circuit@bipole@current@below - \def\pgf@circ@dir{south west}\else \def\pgf@circ@dir{north east} - \fi - \fi\fi - \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185 - \ifpgf@circuit@bipole@current@below - \def\pgf@circ@dir{south}\else\def\pgf@circ@dir{north} - \fi - \fi\fi - \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <256 - \ifpgf@circuit@bipole@current@below - \def\pgf@circ@dir{south east}\else\def\pgf@circ@dir{north west} - \fi - \fi\fi - \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275 - \ifpgf@circuit@bipole@current@below - \def\pgf@circ@dir{east}\else \def\pgf@circ@dir{west} - \fi - \fi\fi - \ifnum\pgfcircmathresult >284 \ifnum\pgfcircmathresult <356 - \ifpgf@circuit@bipole@current@below - \def\pgf@circ@dir{north east}\else\def\pgf@circ@dir{south west} - \fi - \fi\fi - \ifnum\pgfcircmathresult <5 - \ifpgf@circuit@bipole@current@below - \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south} - \fi - \fi - \ifnum\pgfcircmathresult >355 - \ifpgf@circuit@bipole@current@below - \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south} - \fi - \fi - - \ifpgf@circuit@bipole@current@below - \def\pgf@circ@bipole@current@label@where{-90} - \else - \def\pgf@circ@bipole@current@label@where{+90} - \fi - } - - - \pgfextra{ \def\pgf@temp{short} \edef\pgf@circ@temp{\ctikzvalof{bipole/kind}} } - - \ifx\pgf@circ@temp\pgf@temp % caso di corrente (centrata) su un corto - \ifpgf@circuit@bipole@current@backward - { (\tikztotarget) -- - node [currarrow, pos=\ctikzvalof{current/distance}, sloped, allow upside down] (Iarrow) {} - (\tikztostart) } - \else - { (\tikztostart) -- - node [currarrow, pos=\ctikzvalof{current/distance}, sloped, allow upside down] (Iarrow) {} - (\tikztotarget) } - \fi - - \else % altri bipoli - e quindi tra nodo e target - - \ifpgf@circuit@bipole@iscurrent - \ifpgf@circuit@europeancurrent - \pgf@circ@drawnormalcurrent - \else - \fi - \else - \pgf@circ@drawnormalcurrent - \fi - \fi - - \ifpgf@circuit@bipole@iscurrent - node [anchor=\pgf@circ@dir] at (\ctikzvalof{bipole/name}.\pgf@circ@bipole@current@label@where) - { \pgf@circ@finallabel{current/} } - \else - (Iarrow.\pgf@circ@bipole@current@label@where) node [anchor=\pgf@circ@dir] - { \pgf@circ@finallabel{current/} } - \fi - -} - -\endinput - - - diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcirclabel.sty b/Master/texmf-dist/tex/latex/circuitikz/pgfcirclabel.sty deleted file mode 100644 index 120fa7f8cb3..00000000000 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcirclabel.sty +++ /dev/null @@ -1,131 +0,0 @@ -% Copyright 2007-2009 by Massimo Redaelli -% -% This file may be distributed and/or modified -% -% 1. under the LaTeX Project Public License and/or -% 2. under the GNU Public License. -% -% See the file doc/LICENSE for more details. - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% Bipole label positioning - -%% Options -\ctikzset{label/.style = { l=#1 } } -\ctikzset{l/.code = { - \pgfkeys{/tikz/circuitikz/bipole/label/name=#1} - \ctikzsetvalof{bipole/label/unit}{} - \ifpgf@circ@siunitx - \pgf@circ@handleSI{#1} - \ifpgf@circ@siunitx@res - \edef\pgf@temp{\pgf@circ@handleSI@val} - \pgfkeyslet{/tikz/circuitikz/bipole/label/name}{\pgf@temp} - \edef\pgf@temp{\pgf@circ@handleSI@unit} - \pgfkeyslet{/tikz/circuitikz/bipole/label/unit}{\pgf@temp} - \else - \fi - \else - \fi -}} - -\ctikzset{label above/.code = { - l=#1, - \circuitikzbasekey/bipole/label/position=90 } -} -\ctikzset{l^/.style = { - l=#1, - \circuitikzbasekey/bipole/label/position=90 } -} - -\ctikzset{label below/.code = { - l=#1, - \circuitikzbasekey/bipole/label/position=-90 } -} -\ctikzset{l_/.style = { - l=#1, - \circuitikzbasekey/bipole/label/position=-90 } -} - - - -\def\pgf@circ@drawlabel{ - \pgfextra{ - \edef\pgf@temp{\ctikzvalof{label/align}} - \def\pgf@circ@temp{straight} - } - \ifx\pgf@temp\pgf@circ@temp %straight - \pgf@circ@drawreglabel - \else - \pgfextra{\def\pgf@circ@temp{rotate}} - \ifx\pgf@temp\pgf@circ@temp %rotate - \pgf@circ@drawrotlabel - \else % smart - \pgf@circ@drawsmartlabel - \fi - \fi -} - -\def\pgf@circ@drawsmartlabel{ - \pgfextra{ - %\pgfmathadd{\pgf@circ@direction}{360} - \pgfmathmod{\pgf@circ@direction}{90} - \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil} - } - \ifnum \pgfcircmathresult > 20 - \ifnum \pgfcircmathresult < 70 % NON quasi retto - \pgf@circ@drawrotlabel - \else - \pgf@circ@drawreglabel - \fi - \else - \pgf@circ@drawreglabel - \fi -} - -%% Output routing -%% #1 - node name - -\def\pgf@circ@drawrotlabel{ - \pgfextra{ - % calcolo rotazione label - \def\pgf@circ@temp{\ctikzvalof{bipole/label/position}} %%% àncora label - \edef\pgfcirclabrot{\pgf@circ@direction} % primo e quarto quadrante - \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} - \ifnum \pgfcircmathresult > 90 \ifnum \pgfcircmathresult < 270 % terzo e secondo - \pgfmathsubtract{\pgf@circ@direction}{180} - \edef\pgfcirclabrot{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil} - \pgfmathadd{\pgf@circ@temp}{180} %%% - \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil} %%% - \fi\fi - - \ifnum \ctikzvalof{mirror value} = -1 - \pgfmathadd{\pgf@circ@temp}{180} - \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil} - \fi - } - coordinate (labelcoor) at ($(\ctikzvalof{bipole/name})!2!(\ctikzvalof{bipole/name}.north)$) - (labelcoor) node [transform shape, rotate=\pgfcirclabrot] {\pgf@circ@finallabel{}} -} - -\def\pgf@circ@drawreglabel{ - \pgfextra{ - \pgfmathsubtract{\pgf@circ@direction}{90} - \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil} - - \edef\pgf@circ@temp{\ctikzvalof{bipole/label/position}} %%% àncora label - \ifnum \pgf@circ@temp < 0 - \pgfmathadd{\pgf@circ@labanc}{180} - \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil} - \fi - - \ifnum \ctikzvalof{mirror value} = -1 - \pgfmathadd{\pgf@circ@labanc}{180} - \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil} - \fi - } - node [ anchor = \pgf@circ@labanc] - at (\ctikzvalof{bipole/name}.\pgf@circ@temp) {\pgf@circ@finallabel{}} -} - - -\endinput diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcircmath.sty b/Master/texmf-dist/tex/latex/circuitikz/pgfcircmath.sty deleted file mode 100644 index bcde183dd9a..00000000000 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcircmath.sty +++ /dev/null @@ -1,51 +0,0 @@ -% Copyright 2007-2009 by Massimo Redaelli -% -% This file may be distributed and/or modified -% -% 1. under the LaTeX Project Public License and/or -% 2. under the GNU Public License. -% -% See the file doc/LICENSE for more details. - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% Math routines - -\def\pgf@circ@stripdecimals#1.#2\pgf@nil{#1} - -% angle between 0 and 360 -\def\pgf@circ@slope#1#2{% - \pgf@process{#1}% - \pgf@xa=\pgf@x% - \pgf@ya=\pgf@y% - \pgf@process{#2}% - \advance\pgf@x by-\pgf@xa% - \advance\pgf@y by-\pgf@ya% - \ifdim\pgf@x<0.0001pt - \ifdim\pgf@x>-0.0001pt % vertical - \ifdim\pgf@y<0pt - \def\pgfmathresult{-90.0} - \else - \def\pgfmathresult{+90.0} - \fi - \else % oblique with dx < 0 - \pgfmathdivide{\pgf@y}{\pgf@x} - \pgfmathatan{\pgfmathresult} - \ifdim\pgf@x<0pt - \pgfmathsubtract{\pgfmathresult}{+180} - \fi - \fi - \else % oblique with dx > 0 - \pgfmathdivide{\pgf@y}{\pgf@x} - \pgfmathatan{\pgfmathresult} - \ifdim\pgf@x<0pt - \pgfmathsubtract{\pgfmathresult}{+180} - \fi - \fi - \pgf@x=\pgfmathresult pt - \ifdim\pgf@x<0pt - \pgfmathadd{\pgfmathresult}{+360} - \fi - } - -\endinput - diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcircmonopoles.sty b/Master/texmf-dist/tex/latex/circuitikz/pgfcircmonopoles.sty deleted file mode 100644 index 80de0b7be64..00000000000 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcircmonopoles.sty +++ /dev/null @@ -1,374 +0,0 @@ -% Copyright 2007-2009 by Massimo Redaelli -% -% This file may be distributed and/or modified -% -% 1. under the LaTeX Project Public License and/or -% 2. under the GNU Public License. -% -% See the file doc/LICENSE for more details. - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% Monopoles - -%% Ground symbol - -\pgfdeclareshape{ground}{ - \anchor{center}{ - \pgfpointorigin - } - \behindforegroundpath{ - \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen - - \pgfscope - \pgfpathmoveto{\pgfpointorigin} - \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}} - \pgfusepath{draw} - - \pgfstartlinewidth=\pgflinewidth - %\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - - \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}} - \pgfusepath{draw} - - \pgfsetlinewidth{\pgfstartlinewidth} - \pgfpathmoveto{\pgfpoint{-.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}} - \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}} - \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}} - \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} - \pgfusepath{draw} - - - \pgfsetlinewidth{\pgfstartlinewidth} - - \endpgfscope - } - -} - - - -\pgfdeclareshape{rground}{ - \anchor{center}{ - \pgfpointorigin - } - \behindforegroundpath{ - \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen - - \pgfscope - \pgfpathmoveto{\pgfpointorigin} - \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}} - \pgfusepath{draw} - - \pgfstartlinewidth=\pgflinewidth - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - - \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}} - \pgfusepath{draw} - - - \pgfsetlinewidth{\pgfstartlinewidth} - - \endpgfscope - } - -} - -\pgfdeclareshape{sground}{ - \anchor{center}{ - \pgfpointorigin - } - \behindforegroundpath{ - \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen - - \pgfscope - \pgfpathmoveto{\pgfpointorigin} - \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}} - \pgfusepath{draw} - - \pgfstartlinewidth=\pgflinewidth - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - - \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{0}{-1.8\pgf@circ@res@step}} - \pgfpathclose - \pgfusepath{draw} - - - \pgfsetlinewidth{\pgfstartlinewidth} - - \endpgfscope - } - -} - -% noiseless ground -\pgfdeclareshape{nground}{ - \anchor{center}{ - \pgfpointorigin - } - \behindforegroundpath{ - \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen - - \pgfscope - \pgfpathmoveto{\pgfpointorigin} - \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}} - \pgfusepath{draw} - - \pgfstartlinewidth=\pgflinewidth - %\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - - \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}} - \pgfusepath{draw} - - \pgfsetlinewidth{\pgfstartlinewidth} - \pgfpathmoveto{\pgfpoint{-.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}} - \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}} - \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}} - \pgfusepath{draw} - - \pgfpathmoveto{\pgfpoint{1.3\pgf@circ@res@step}{-1.6\pgf@circ@res@step}} - \pgfpatharc{0}{180}{1.3\pgf@circ@res@step} - \pgfusepath{draw} - - \pgfsetlinewidth{\pgfstartlinewidth} - \endpgfscope - } -} - -% protective ground -\pgfdeclareshape{pground}{ - \anchor{center}{ - \pgfpointorigin - } - \behindforegroundpath{ - \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen - - \pgfscope - \pgfpathmoveto{\pgfpointorigin} - \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}} - \pgfusepath{draw} - - \pgfstartlinewidth=\pgflinewidth - %\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - - \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}} - \pgfpathcircle{\pgfpoint{0pt}{-\pgf@circ@res@step}} {1.2\pgf@circ@res@step} - \pgfusepath{draw} - - \pgfsetlinewidth{\pgfstartlinewidth} - \pgfpathmoveto{\pgfpoint{-.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}} - \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}} - \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}} - \pgfusepath{draw} - - \pgfsetlinewidth{\pgfstartlinewidth} - \endpgfscope - } -} - -% chassis ground -\pgfdeclareshape{cground}{ -\anchor{center}{ - \pgfpointorigin -} -\behindforegroundpath{ - \pgf@circ@res@step=\ctikzvalof{monopoles/chassis/width}\pgf@circ@Rlen - - \pgfscope - \pgfpathmoveto{\pgfpointorigin} - \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}} - \pgfusepath{draw} - - \pgfpathmoveto{\pgfpoint{-1.5\pgf@circ@res@step}{-2\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-2\pgf@circ@res@step}} - \pgfpathmoveto{\pgfpoint{0pt}{-\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@step}{-2\pgf@circ@res@step}} - \pgfusepath{draw} - \endpgfscope - } -} - -% Contributed by Leonardo Azzinnari -\pgfdeclareshape{tlinestub}{ - \anchor{center}{\pgfpointorigin} - \behindforegroundpath{ - \pgfstartlinewidth=\pgflinewidth - - \pgf@circ@res@step=\ctikzvalof{bipoles/tline/width} \pgf@circ@Rlen - \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}} - - \pgfpathmoveto{\pgfpointorigin} - \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0pt}} - \pgfusepath{draw} - \pgfscope - \pgfpathellipse{\pgfpoint{0.5\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0.125\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0\pgf@circ@res@step}{0.25\pgf@circ@res@step}} - \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{1.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}} - \pgfpatharc{90}{-90}{0.125\pgf@circ@res@step and 0.25\pgf@circ@res@step} - \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-0.25\pgf@circ@res@step}} - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfusepath{draw} - \endpgfscope - } -} - - - - -\pgfdeclareshape{antenna}{ -\anchor{center}{\pgfpointorigin} - \savedanchor{\northeast}{ - \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@Rlen - \pgf@x=5\pgf@circ@res@step%-0.5\pgflinewidth - \pgf@y=6\pgf@circ@res@step - } - \anchor{text}{ - \northeast - \pgf@x=\ctikzvalof{monopoles/antenna/label/xanchor}\pgf@x - \pgf@y=\ctikzvalof{monopoles/antenna/label/yanchor}\pgf@y - } - \behindforegroundpath{ - \pgfstartlinewidth=\pgflinewidth - \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@Rlen - - \pgfpathmoveto{\pgfpointorigin} - \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}} - \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{0pt}} - \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} - - \pgfusepath{draw} - - \pgfscope - \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{5\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{4\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{3\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} - \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfusepath{draw} - \endpgfscope - \pgfsetlinewidth{\pgfstartlinewidth} - - } - } - - -\pgfdeclareshape{txantenna}{ - \anchor{center}{\pgfpointorigin} - \savedanchor{\northeast}{ - \pgf@circ@res@step=\ctikzvalof{monopoles/txantenna/width}\pgf@circ@Rlen - \pgf@x=5\pgf@circ@res@step%-0.5\pgflinewidth - \pgf@y=6\pgf@circ@res@step - } - \anchor{text}{ - \northeast - \pgf@x=\ctikzvalof{monopoles/txantenna/label/xanchor}\pgf@x - \pgf@y=\ctikzvalof{monopoles/txantenna/label/yanchor}\pgf@y - } - \behindforegroundpath{ - \pgfstartlinewidth=\pgflinewidth - \pgf@circ@res@step=\ctikzvalof{monopoles/txantenna/width}\pgf@circ@Rlen - - \pgfpathmoveto{\pgfpointorigin} - \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}} - \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{0pt}} - \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} - - \pgfusepath{draw} - - \pgfscope - \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{5\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{4\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{3\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} - \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfusepath{draw} - \endpgfscope - \pgfpathmoveto{\pgfpoint{5.5\pgf@circ@res@step}{6\pgf@circ@res@step}} -% \pgfpatharc{60}{-60}{\pgf@circ@res@step and \pgf@circ@res@step} - \pgfpatharc{30}{-30}{2\pgf@circ@res@step} \pgfpathmoveto{\pgfpoint{6\pgf@circ@res@step}{6.25\pgf@circ@res@step}} - \pgfpatharc{30}{-30}{2.5\pgf@circ@res@step} - \pgfpathmoveto{\pgfpoint{6.5\pgf@circ@res@step}{6.5\pgf@circ@res@step}} - \pgfpatharc{30}{-30}{3\pgf@circ@res@step} - \pgfpathmoveto{\pgfpoint{7\pgf@circ@res@step}{6.75\pgf@circ@res@step}} - \pgfpatharc{30}{-30}{3.5\pgf@circ@res@step} - \pgfpathmoveto{\pgfpoint{7.5\pgf@circ@res@step}{7\pgf@circ@res@step}} - \pgfpatharc{30}{-30}{4\pgf@circ@res@step} - \pgfusepath{draw} - \pgfsetlinewidth{\pgfstartlinewidth} - - } - } - - -\pgfdeclareshape{rxantenna}{ - \anchor{center}{\pgfpointorigin} - \savedanchor{\northeast}{ - \pgf@circ@res@step=\ctikzvalof{monopoles/txantenna/width}\pgf@circ@Rlen - \pgf@x=5\pgf@circ@res@step%-0.5\pgflinewidth - \pgf@y=6\pgf@circ@res@step - } - \anchor{text}{ - \northeast - \pgf@x=\ctikzvalof{monopoles/rxantenna/label/xanchor}\pgf@x - \pgf@y=\ctikzvalof{monopoles/rxantenna/label/yanchor}\pgf@y - } - \behindforegroundpath{ - \pgfstartlinewidth=\pgflinewidth - \pgf@circ@res@step=\ctikzvalof{monopoles/rxantenna/width}\pgf@circ@Rlen - - \pgfpathmoveto{\pgfpointorigin} - \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}} - \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{0pt}} - \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} - - \pgfusepath{draw} - - \pgfscope - \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{5\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{4\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{3\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} - \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfusepath{draw} - \endpgfscope - - \pgfpathmoveto{\pgfpoint{6\pgf@circ@res@step}{7\pgf@circ@res@step}} -% \pgfpatharc{60}{-60}{\pgf@circ@res@step and \pgf@circ@res@step} - \pgfpatharc{150}{210}{4\pgf@circ@res@step} \pgfpathmoveto{\pgfpoint{6.5\pgf@circ@res@step}{6.75\pgf@circ@res@step}} - \pgfpatharc{150}{210}{3.5\pgf@circ@res@step} - \pgfpathmoveto{\pgfpoint{7\pgf@circ@res@step}{6.5\pgf@circ@res@step}} - \pgfpatharc{150}{210}{3\pgf@circ@res@step} - \pgfpathmoveto{\pgfpoint{7.5\pgf@circ@res@step}{6.25\pgf@circ@res@step}} - \pgfpatharc{150}{210}{2.5\pgf@circ@res@step} - \pgfpathmoveto{\pgfpoint{8\pgf@circ@res@step}{6\pgf@circ@res@step}} - \pgfpatharc{150}{210}{2\pgf@circ@res@step} - \pgfusepath{draw} - \pgfsetlinewidth{\pgfstartlinewidth} - - } -} - - -\endinput diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcircquadpoles.sty b/Master/texmf-dist/tex/latex/circuitikz/pgfcircquadpoles.sty deleted file mode 100644 index 723084851d1..00000000000 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcircquadpoles.sty +++ /dev/null @@ -1,426 +0,0 @@ -% Copyright 2007-2009 by Massimo Redaelli -% -% This file may be distributed and/or modified -% -% 1. under the LaTeX Project Public License and/or -% 2. under the GNU Public License. -% -% See the file doc/LICENSE for more details. - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% Quadripoles - -\long\def\pgfcircdeclarequadpole#1#2#3{ - \pgfdeclareshape{#1} - { - \anchor{center}{ - \northwest - \pgf@x=0pt - } - \savedanchor\northwest{% - \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/height}\pgf@y - \pgf@y=.5\pgf@y - \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@x=.5\pgf@x - \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/width}\pgf@x - } - \anchor{A2}{ - \northwest - \pgf@y=-\pgf@y - } - \anchor{B1}{ - \northwest - \pgf@x=-\pgf@x - } - \anchor{A1}{ - \northwest - } - \anchor{B2}{ - \northwest - \pgf@x=-\pgf@x - \pgf@y=-\pgf@y - } - \anchor{north}{ - \northwest - \pgf@x=0pt - } - \anchor{south}{ - \northwest - \pgf@x=0pt - \pgf@y=-\pgf@y - } - \anchor{west}{ - \northwest - \pgf@y=0pt - } - \anchor{east}{ - \northwest - \pgf@y=0pt - \pgf@x=-\pgf@x - } - \anchor{south west}{ - \northwest - \pgf@y=-\pgf@y - } - \anchor{north east}{ - \northwest - \pgf@x=-\pgf@x - } - \anchor{north west}{ - \northwest - } - \anchor{south east}{ - \northwest - \pgf@x=-\pgf@x - \pgf@y=-\pgf@y - } - \anchor{base}{ - \northwest - \pgf@x=0pt - } - #3 - \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@Rlen=\pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - - #2 - - } - } -} - - - -\def\pgf@circ@drawtransformerbasicanchor{ - \pgfkeysvalueof{/tikz/circuitikz/quadpoles/trans/height} - \anchor{AA2}{ - \northwest - \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x - \pgf@x=.7\pgf@x - \pgf@y=-\pgf@y - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y - } - \anchor{BB1}{ - \northwest - \pgf@x=-\pgf@x - \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x - \pgf@x=.7\pgf@x - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y - } - \anchor{AA1}{ - \northwest - \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x - \pgf@x=.7\pgf@x - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y - } - \anchor{BB2}{ - \northwest - \pgf@x=-\pgf@x - \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x - \pgf@x=.7\pgf@x - \pgf@y=-\pgf@y - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y - } -} - -\def\pgf@circ@drawtransformerbasicbody{ - \def\stretto{.4} - \pgfscope - \pgfslopedattimetrue - \pgfallowupsidedownattimetrue - \pgftransformlineattime{.5}{% - \pgfpoint% - {\stretto\pgf@circ@res@left}% - {\pgf@circ@res@up}% - }{% - \pgfpoint - {\stretto\pgf@circ@res@left}% - {\pgf@circ@res@down}% - } - - \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 - \pgfallowupsidedownattimetrue - \pgftransformlineattime{.5}{% - \pgfpoint% - {\stretto\pgf@circ@res@right}% - {\pgf@circ@res@down}% - }{% - \pgfpoint - {\stretto\pgf@circ@res@right}% - {\pgf@circ@res@up}% - } - - \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}} - \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpointanchor{pgf@inductor1}{b}} - - \pgfpathmoveto{\pgfpointanchor{pgf@inductor1}{a}} - \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpointanchor{pgf@inductor2}{a}} - - \pgfpathmoveto{\pgfpointanchor{pgf@inductor2}{b}} - \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} - - \pgfusepath{draw} - -} - - - - % contrib Kristofer M. Monisit - - \pgfdeclareshape{fd op amp} - { - \anchor{center}{\pgfpointorigin} - \savedanchor\northwest{% - \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y - \pgf@y=.5\pgf@y - \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x - \pgf@x=.5\pgf@x - } - \anchor{south}{ - \northwest - \pgf@y=-\pgf@y - } - \anchor{north}{ - \northwest - } - \savedanchor\left{% - \pgf@y=0pt - } - \savedanchor\inOne{% - \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y - \pgf@y=.5\pgf@y - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@y - \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x - \pgf@x=.5\pgf@x - } - \anchor{-}{ - \inOne - } - \anchor{+}{ - \inOne - \pgf@y=-\pgf@y - } - \savedanchor\up{% - \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y - \pgf@y=.5\pgf@y - \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x - \pgf@x=.5\pgf@x - \pgf@circ@res@up = \pgf@y - \pgf@circ@res@right = -\pgf@x - \pgf@circ@res@left = \pgf@x - \pgfpointlineattime{ - \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/up pos}}{ - \pgfpoint{ - \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left} - {\pgf@circ@res@up}} - {\pgfpoint{.7\pgf@circ@res@right}{0pt}} - } - \anchor{up}{ - \up - } - \anchor{down}{ - \up - \pgf@y=-\pgf@y - } - \anchor{out +}{ - \northwest - \pgf@y=.5\pgf@y - \pgf@x=-.7\pgf@x - } - \anchor{out -}{ - \northwest - \pgf@y=-.5\pgf@y - \pgf@x=-.7\pgf@x - } - \anchor{west}{ - \left - } - \anchor{east}{ - \left - \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 - - % Negative input terminal - \pgfpathmoveto{\pgfpoint - {\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}} - \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}]{\scriptsize\ $-$} - - - % Positive input terminal - \pgfpathmoveto{\pgfpoint - {\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}} - \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}]{\scriptsize\ $+$} - - - % Negative output terminal - \pgfpathmoveto{\pgfpoint - {0.7\pgf@circ@res@right} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}} - \pgftext[left, at=\pgfpoint{0.3\pgf@circ@res@left}{.3\pgf@circ@res@down}]{\scriptsize\ $-$} - - - % Positive output terminal - \pgfpathmoveto{\pgfpoint - {0.7\pgf@circ@res@right} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}} - \pgftext[left, at=\pgfpoint{0.3\pgf@circ@res@left}{.3\pgf@circ@res@up}]{\scriptsize\ $+$} - - - % Draw them all! - \pgfusepath{draw} - - % Triangle - \pgfscope - \pgfsetlinewidth{2\pgflinewidth} - \pgftransformxshift{.7\pgf@circ@res@left} - \pgf@circ@res@step=\pgf@circ@res@right - \advance\pgf@circ@res@step by -\pgf@circ@res@left - \pgf@circ@res@step=.7\pgf@circ@res@step - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}} - \pgfusepath{draw} - \endpgfscope - } - } - - - - -\pgfcircdeclarequadpole{transformer}{ - - \pgf@circ@drawtransformerbasicbody - -}{\pgf@circ@drawtransformerbasicanchor} - -\pgfcircdeclarequadpole{transformer core}{ - - \pgf@circ@drawtransformerbasicbody - - \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} -}{\pgf@circ@drawtransformerbasicanchor} - - -\pgfcircdeclarequadpole{gyrator}{ - - \def\stretto{.4} - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} - - \pgfusepath{draw} - - \pgfsetlinewidth{2\pgflinewidth} - \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@left}{.7*\stretto\pgf@circ@res@down}} - \pgfpatharc{90}{270}{.7*\stretto\pgf@circ@res@down} - - \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@right}{.7*\stretto\pgf@circ@res@up}} - \pgfpatharc{-90}{90}{.7*\stretto\pgf@circ@res@down} - \pgfusepath{draw} - -}{} - diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcircshapes.sty b/Master/texmf-dist/tex/latex/circuitikz/pgfcircshapes.sty deleted file mode 100644 index 52ee97a00c8..00000000000 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcircshapes.sty +++ /dev/null @@ -1,120 +0,0 @@ -% Copyright 2007-2009 by Massimo Redaelli -% -% This file may be distributed and/or modified -% -% 1. under the LaTeX Project Public License and/or -% 2. under the GNU Public License. -% -% See the file doc/LICENSE for more details. - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% Other shapes - - -%% Nothing - -\pgfdeclareshape{emptyshape}{ - \savedanchor{\northeast}{% - \pgf@x=.5\wd\pgfnodeparttextbox% - \pgf@y=.5\ht\pgfnodeparttextbox% - } - \anchor{north}{ - \northeast - \pgf@x=0cm - } - \anchor{east}{% - \northeast - \pgf@y=0cm - } - \anchor{south}{% - \northeast - \pgf@y=-\pgf@y - \pgf@x=0cm - } - \anchor{west}{ - \northeast - \pgf@y=0cm - \pgf@x=-\pgf@x - } - \anchor{text}{% - \pgfpointorigin - } - \anchor{center}{ - \pgfpointorigin - } -} - -%% Full terminal - -\pgfdeclareshape{circ}{ - \anchor{center}{ - \pgfpointorigin - } - \anchorborder{ - \pgf@circ@res@left=\pgf@x - \pgf@circ@res@up=\pgf@y - \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up} -}{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}} - } - \behindforegroundpath{ - - \pgfscope - \pgfpathcircle{\pgfpointorigin}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}} - \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} - \pgfusepath{draw,fill} - \endpgfscope - - } -} - -%% Empty terminal - -\pgfdeclareshape{ocirc}{ - \anchor{center}{ - \pgfpointorigin - } - \anchorborder{ - \pgf@circ@res@left=\pgf@x - \pgf@circ@res@up=\pgf@y - \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up} -}{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}} - } - - \behindforegroundpath{ - - \pgfscope - \pgfpathcircle{\pgfpointorigin}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}} - \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} - \pgfsetfillcolor{white} - \pgfusepath{draw,fill} - \endpgfscope - - } -} - -%% Current arrow - -\pgfdeclareshape{currarrow}{ - \anchor{center}{ - \pgfpointorigin - } - \behindforegroundpath{ - - \pgfscope - \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \divide \pgf@circ@res@step by 16 - - \pgfpathmoveto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}} - \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{-.8\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{0pt}} - \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{.8\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}} - \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} - \pgfusepath{draw,fill} - - \endpgfscope - } - -} - -\endinput diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcirctripoles.sty b/Master/texmf-dist/tex/latex/circuitikz/pgfcirctripoles.sty deleted file mode 100644 index f40391c3853..00000000000 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcirctripoles.sty +++ /dev/null @@ -1,2914 +0,0 @@ -% Copyright 2007-2009 by Massimo Redaelli -% -% This file may be distributed and/or modified -% -% 1. under the LaTeX Project Public License and/or -% 2. under the GNU Public License. -% -% See the file doc/LICENSE for more details. - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% Tripoles - - -%\long\def\pgfcircdeclaremixed{ - \pgfdeclareshape{mixer} - { - \savedanchor\northwest{% - \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/mixer/height}\pgf@y - \pgf@y=.5\pgf@y - \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/mixer/width}\pgf@x - \pgf@x=.5\pgf@x - } - \anchor{left}{% - \northwest - \pgf@y=0pt - } - \anchor{in 1}{ - \northwest - \pgf@y=0pt - } - \anchor{in}{ - \northwest - \pgf@y=0pt - } - \anchor{in 2}{ - \northwest - \pgf@y=-\pgf@y - \pgf@x=0pt - } - \anchor{out}{ - \northwest - \pgf@y=0pt - \pgf@x=-\pgf@x - } - \anchor{center}{ - \pgf@y=0pt - \pgf@x=0pt - } - \anchor{east}{ - \northwest - \pgf@y=0pt - \pgf@x=-\pgf@x - } - \anchor{west}{ - \northwest - \pgf@y=0pt - } - \anchor{south}{ - \northwest - \pgf@x=0pt - \pgf@y=-\pgf@y - } - \anchor{north}{ - \northwest - \pgf@x=0pt - } - \anchor{south west}{ - \northwest - \pgf@y=-\pgf@y - } - \anchor{north east}{ - \northwest - \pgf@x=-\pgf@x - } - \anchor{north west}{ - \northwest - } - \anchor{south east}{ - \northwest - \pgf@x=-\pgf@x - \pgf@y=-\pgf@y - } - \backgroundpath{ - \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} - - - \northwest - \pgf@circ@res@up = \pgf@y - \pgf@circ@res@down = -\pgf@y - \pgf@circ@res@right = -\pgf@x - \pgf@circ@res@left = \pgf@x - \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/tripoles/mixer/margin}\pgf@circ@res@up - - \pgfscope - \pgfpathellipse - {\pgfpoint{0pt}{0pt}} - {\pgfpoint{\pgf@circ@res@other}{0pt}} - {\pgfpoint{0pt}{\pgf@circ@res@other}} - \pgfpathmoveto{\pgfpointorigin} - \pgfpathmoveto{\pgfpointpolar{135}{\pgf@circ@res@other}} - \pgfpathlineto{\pgfpointpolar{-45}{\pgf@circ@res@other}} - \pgfpathmoveto{\pgfpointorigin} - \pgfpathmoveto{\pgfpointpolar{45}{\pgf@circ@res@other}} - \pgfpathlineto{\pgfpointpolar{-135}{\pgf@circ@res@other}} - \pgfsetlinewidth{2\pgflinewidth} - \pgfusepath{draw} - \endpgfscope - - \pgfpathmoveto{\pgfpoint{0pt}{-\pgf@circ@res@other}} - \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@up}} - \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{0pt}} - \pgfpathlineto{\pgfpoint{-\pgf@circ@res@up}{0pt}} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@up}{0pt}} - - \pgfusepath{draw} - - } - } -%} - - - - \pgfdeclareshape{spdt} - { - \savedanchor\northwest{% - \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/height}\pgf@y - \pgf@y=.5\pgf@y - \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/width}\pgf@x - \pgf@x=.5\pgf@x - } - \anchor{left}{% - \northwest - \pgf@y=0pt - } - \anchor{in}{ - \northwest - \pgf@y=0pt - } - \anchor{out 1}{ - \northwest - \pgf@x=-\pgf@x - } - \anchor{out 2}{ - \northwest - \pgf@x=-\pgf@x - \pgf@y=-\pgf@y - } - \anchor{center}{ - \pgf@y=0pt - \pgf@x=0pt - } - \anchor{east}{ - \northwest - \pgf@y=0pt - \pgf@x=-\pgf@x - } - \anchor{west}{ - \northwest - \pgf@y=0pt - } - \anchor{south}{ - \northwest - \pgf@x=0pt - \pgf@y=-\pgf@y - } - \anchor{north}{ - \northwest - \pgf@x=0pt - } - \anchor{south west}{ - \northwest - \pgf@y=-\pgf@y - } - \anchor{north east}{ - \northwest - \pgf@x=-\pgf@x - } - \anchor{north west}{ - \northwest - } - \anchor{south east}{ - \northwest - \pgf@x=-\pgf@x - \pgf@y=-\pgf@y - } - \backgroundpath{ - \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} - - - \northwest - \pgf@circ@res@up = \pgf@y - \pgf@circ@res@down = -\pgf@y - \pgf@circ@res@right = -\pgf@x - \pgf@circ@res@left = \pgf@x - \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/margin}\pgf@circ@res@left - - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}} - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}} - - \pgfusepath{draw} - - \pgfscope - \pgftransformshift{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}} - \pgfnode{ocirc}{center}{}{spdt1}{\pgfusepath{stroke}} - \endpgfscope - \pgfscope - \pgftransformshift{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}} - \pgfnode{ocirc}{center}{}{}{\pgfusepath{stroke}} - \endpgfscope - \pgfscope - \pgftransformshift{\pgfpoint{\pgf@circ@res@other}{0pt}} - \pgfnode{ocirc}{center}{}{spdt2}{\pgfusepath{stroke}} - \endpgfscope - - - \pgfscope - \pgfpathmoveto{\pgfpointshapeborder{spdt2}{\pgfpointorigin}} - \pgfpathlineto{ - \pgfpointadd{\pgfpointshapeborder{spdt1}{\pgfpoint{-\pgf@circ@res@other}{-100pt}}} - {\pgfpoint{-.05\pgf@circ@res@up}{-.05\pgf@circ@res@up}} - } - \pgfsetlinewidth{2\pgflinewidth} - \pgfusepath{draw} - \endpgfscope - } - } - - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% -%% Logic ports -%% - - - - - - -\long\def\pgfcircdeclarelogicport#1#2{ - \pgfdeclareshape{american #1 port} - { - \savedanchor\northwest{% - \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \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/american #1 port/width}\pgf@x - \pgf@x=.5\pgf@x - } - \savedanchor\left{% - \pgf@y=0pt - } - \savedanchor\inOne{% - \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/height}\pgf@y - \pgf@y=.5\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/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 - } - \anchor{out}{ - \northwest - \pgf@y=0pt - \pgf@x=-\pgf@x - } - \anchor{center}{ - \northwest - \pgf@y=0pt - \pgf@x=-.8\pgf@x - } - \anchor{east}{ - \left - \pgf@x=-.8\pgf@x - } - \anchor{west}{ - \left - } - \anchor{south}{ - \northwest - \pgf@x=0pt - \pgf@y=-\pgf@y - } - \anchor{north}{ - \northwest - \pgf@x=0pt - } - \anchor{south west}{ - \northwest - \pgf@y=-\pgf@y - } - \anchor{north east}{ - \northwest - \pgf@x=-\pgf@x - } - \anchor{north west}{ - \northwest - } - \anchor{south east}{ - \northwest - \pgf@x=-\pgf@x - \pgf@y=-\pgf@y - } - \backgroundpath{ - \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} - - - \northwest - \pgf@circ@res@up = \pgf@y - \pgf@circ@res@down = -\pgf@y - \pgf@circ@res@right = -\pgf@x - \pgf@circ@res@left = \pgf@x - - #2 - - } - } -} - - -\pgfcircdeclarelogicport{and}{ - \pgfpathmoveto{\pgfpoint - {\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/input height}\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint - {\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/american and port/input height}\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint - {\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/american and port/port width}\pgf@circ@res@right} - {0pt}} - - \pgfusepath{draw} - - \pgfsetlinewidth{2\pgflinewidth} - \pgfpathmoveto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@left} - {\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint - {\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/american and port/port width}\pgf@circ@res@right} - {.5\pgf@circ@res@down}} - {\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@right} - {0pt}} - \pgfpathcurveto - {\pgfpoint - {\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/american and port/port width}\pgf@circ@res@left} - {\pgf@circ@res@up}} - \pgfusepath{draw} -} - - - -\pgfcircdeclarelogicport{nand}{ - \pgfpathmoveto{\pgfpoint - {\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/input height}\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint - {\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/american nand port/input height}\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint - {\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/american nand port/port width}\pgf@circ@res@right} - {0pt}} - - \pgfusepath{draw} - - \pgfsetlinewidth{2\pgflinewidth} - - \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}} - \pgfpathcurveto - {\pgfpoint{.0\pgf@circ@res@left}{\pgf@circ@res@down}} - {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{.5\pgf@circ@res@down}} - {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{0pt}} - \pgfpathcurveto - {\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/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}} - {\pgfpoint{.5\pgf@circ@res@step}{0pt}} - {\pgfpoint{0pt}{.5\pgf@circ@res@step}} - - \pgfusepath{draw} -} - - -\pgfcircdeclarelogicport{nor}{ - \pgfpathmoveto{\pgfpoint - {\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input height}\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint - {(\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/american nor port/input height}\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint - {(\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/american nor port/port width}\pgf@circ@res@right} - {0pt}} - - \pgfusepath{draw} - - \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/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/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/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/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 - {\pgfpoint{\pgf@circ@res@other-.5\pgf@circ@res@step}{0pt}} - {\pgfpoint{.5\pgf@circ@res@step}{0pt}} - {\pgfpoint{0pt}{.5\pgf@circ@res@step}} - - \pgfusepath{draw} -} - - - - -\pgfcircdeclarelogicport{or}{ - - - \pgfpathmoveto{\pgfpoint - {\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input height}\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint - {(\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/american or port/input height}\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint - {(\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/american or port/port width}\pgf@circ@res@right} - {0pt}} - - \pgfusepath{draw} - \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/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/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/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/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} -} - - -\pgfcircdeclarelogicport{xor}{ - - \pgfpathmoveto{\pgfpoint - {\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input height}\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint - {(\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/american xor port/input height}\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint - {(\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/american xor port/port width}\pgf@circ@res@right} - {0pt}} - - \pgfusepath{draw} - \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/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/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/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/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/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/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/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} -} - - - -\pgfcircdeclarelogicport{xnor}{ - - \pgfpathmoveto{\pgfpoint - {\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input height}\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint - {(\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/american xnor port/input height}\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint - {(\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/american xnor port/port width}\pgf@circ@res@right} - {0pt}} - - \pgfusepath{draw} - \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/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/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/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/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/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/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/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}} - - - \pgfpathellipse - {\pgfpoint{\pgf@circ@res@other-.5\pgf@circ@res@step}{0pt}} - {\pgfpoint{.5\pgf@circ@res@step}{0pt}} - {\pgfpoint{0pt}{.5\pgf@circ@res@step}} - - \pgfusepath{draw} -} - - -\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 - } - \savedanchor\left{% - \pgf@y=0pt - } - \anchor{in}{ - \northwest - \pgf@y=0pt - } - \anchor{out}{ - \northwest - \pgf@y=0pt - \pgf@x=-\pgf@x - } - \anchor{center}{ - \pgfpointorigin - } - \anchor{east}{ - \left - \pgf@x=-.8\pgf@x - } - \anchor{west}{ - \left - } - \anchor{south}{ - \northwest - \pgf@x=0pt - \pgf@y=-\pgf@y - } - \anchor{north}{ - \northwest - \pgf@x=0pt - } - \anchor{south west}{ - \northwest - \pgf@y=-\pgf@y - } - \anchor{north east}{ - \northwest - \pgf@x=-\pgf@x - } - \anchor{north west}{ - \northwest - } - \anchor{south east}{ - \northwest - \pgf@x=-\pgf@x - \pgf@y=-\pgf@y - } - \backgroundpath{ - \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} - - - \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 - } - \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 - } - \anchor{east}{ - \left - \pgf@x=-.8\pgf@x - } - \anchor{west}{ - \left - } - \anchor{south}{ - \northwest - \pgf@x=0pt - \pgf@y=-\pgf@y - } - \anchor{north}{ - \northwest - \pgf@x=0pt - } - \anchor{south west}{ - \northwest - \pgf@y=-\pgf@y - } - \anchor{north east}{ - \northwest - \pgf@x=-\pgf@x - } - \anchor{north west}{ - \northwest - } - \anchor{south east}{ - \northwest - \pgf@x=-\pgf@x - \pgf@y=-\pgf@y - } - \backgroundpath{ - \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} - \northwest - \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} - - - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -\long\def\pgfcircdeclaretransistor#1#2#3{ - \pgfdeclareshape{#1} - { - \anchor{center}{\pgfpointorigin} - \savedanchor\northeast{% upper right - \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/height}\pgf@y - \pgf@y=.5\pgf@y - \pgf@x=0pt - } -% \savedanchor\northeast{% -% \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} -% \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/height}\pgf@y -% \pgf@y=.5\pgf@y -% \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} -% \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/width}\pgf@x -% } - \savedanchor\left{%center left - \pgf@y=0pt - \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/width}\pgf@x - } - \anchor{text}{ - \northeast - \pgfpoint - {12\pgf@circ@res@right +0.2*(\pgf@circ@res@right-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left)} - {0.6\pgf@y} - } - % - % pseudo-bipole - \anchor{left}{ % south - \northeast - \pgf@y=-\pgf@y - } - \anchor{right}{ - \northeast - } - \anchor{north}{ - \northeast - \pgf@circ@res@step=\pgf@y - \left - \pgf@y=\pgf@circ@res@step - \pgf@x=.5\pgf@x - } - \anchor{west}{ - \left - } - \anchor{east}{ - \pgf@x=0pt - \pgf@y=0pt - } - \anchor{south}{ - \northeast - \pgf@circ@res@step=\pgf@y - \left - \pgf@y=-\pgf@circ@res@step - \pgf@x=.5\pgf@x - } - \anchor{south west}{ - \northeast - \pgf@circ@res@step=\pgf@y - \left - \pgf@y=-\pgf@circ@res@step - } - \anchor{north east}{ - \northeast - } - \anchor{north west}{ - \northeast - \pgf@circ@res@step=\pgf@y - \left - \pgf@y=\pgf@circ@res@step - } - \anchor{south east}{ - \northeast - \pgf@y=-\pgf@y - } - - #2 - \backgroundpath{ - \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} - % - % - \northeast - \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 - % - } - } -} - - - - - - -\long\def\pgfcircdeclaremos#1#2#3{ - \pgfcircdeclaretransistor{#1}{ - \anchor{G}{ - \left - } - \anchor{gate}{ - \left - } - \anchor{B}{ - \left - \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@x - } - \anchor{base}{ - \left - \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@x - } - #2 - } - {#3} -} - - - - - - - - - -\pgfcircdeclaremos{nmos}{ - \anchor{D}{ - \northeast - } - \anchor{drain}{ - \northeast - } - \anchor{S}{ - \northeast - \pgf@y=-\pgf@y - } - \anchor{source}{ - \northeast - \pgf@y=-\pgf@y - } -}{% - \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}} - \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@up}} - - \pgfpathmoveto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base height}\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base height}\pgf@circ@res@down}} - - \pgfpathmoveto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/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/nmos/gate width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@up}} - \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} - \pgfusepath{draw} - \endpgfscope - - \ifpgf@circuit@mos@arrows - \pgfscope - \pgfslopedattimetrue - \pgfallowupsidedownattimetrue - \pgfresetnontranslationattimefalse - \pgftransformlineattime{.6}{% - \pgfpoint% - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left}% - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}% - }{% - \pgfpoint - {\pgf@circ@res@right}% - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}% - } - \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} - \endpgfscope - \fi - - - \pgfpathmoveto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/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} -} - - -\pgfcircdeclaremos{pmos}{ - \anchor{S}{ - \northeast - } - \anchor{source}{ - \northeast - } - \anchor{D}{ - \northeast - \pgf@y=-\pgf@y - } - \anchor{drain}{ - \northeast - \pgf@y=-\pgf@y - } -}{% - \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}} - \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} - - \ifpgf@circuit@mos@arrows - \pgfscope - \pgfslopedattimetrue - \pgfallowupsidedownattimetrue - \pgfresetnontranslationattimefalse - \pgftransformlineattime{.4}{% - \pgfpoint% - {\pgf@circ@res@right}% - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}% - }{% - \pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left}% - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}% - } - \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} - \endpgfscope - \fi - - \pgfscope - \pgfpathmoveto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base height}\pgf@circ@res@up}} - \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 - - \pgfpathmoveto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} - - \pgfpathmoveto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}} - - - \pgfpathmoveto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left} - {\pgf@circ@res@up+\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}} - \pgfusepath{draw} - - \pgfpathcircle{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left - \pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}} - {\pgf@circ@res@up+\pgf@circ@res@down}}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}} - \pgfusepath{draw,fill} - -} - - - - - - - -\pgfcircdeclaretransistor{pnp}{ - \anchor{E}{ - \northeast - } - \anchor{emitter}{ - \northeast - } - \anchor{B}{ - \left - } - \anchor{base}{ - \left - } - \anchor{C}{ - \northeast - \pgf@y=-\pgf@y - } - \anchor{collector}{ - \northeast - \pgf@y=-\pgf@y - } -}{ - \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}} - \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 - \pgfpathmoveto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/base height}\pgf@circ@res@up}} - \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 - - \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}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/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/pnp/gate height}\pgf@circ@res@up}% - }{% - \pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate width}\pgf@circ@res@left}% - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate height 2}\pgf@circ@res@up}% - } - \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} - \endpgfscope - - \pgfpathmoveto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/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{npn}{ - \anchor{C}{ - \northeast - } - \anchor{collector}{ - \northeast - } - \anchor{B}{ - \left - } - \anchor{base}{ - \left - } - \anchor{E}{ - \northeast - \pgf@y=-\pgf@y - } - \anchor{emitter}{ - \northeast - \pgf@y=-\pgf@y - } -}{% - \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}} - \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 - \pgfpathmoveto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/base height}\pgf@circ@res@up}} - \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 - - \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}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/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/npn/gate width}\pgf@circ@res@left}% - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate height 2}\pgf@circ@res@down}% - }{% - \pgfpoint{\pgf@circ@res@right}% - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate height}\pgf@circ@res@down}% - } - \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} - \endpgfscope - - \pgfpathmoveto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/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{pigbt}{ - \anchor{E}{ - \northeast - } - \anchor{emitter}{ - \northeast - } - \anchor{B}{ - \left - } - \anchor{base}{ - \left - } - \anchor{C}{ - \northeast - \pgf@y=-\pgf@y - } - \anchor{collector}{ - \northeast - \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}{ - \northeast - } - \anchor{collector}{ - \northeast - } - \anchor{B}{ - \left - } - \anchor{base}{ - \left - } - \anchor{E}{ - \northeast - \pgf@y=-\pgf@y - } - \anchor{emitter}{ - \northeast - \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{B}{ - \left - \pgf@x=\pgf@circ@res@right - } - \anchor{base}{ - \left - \pgf@x=\pgf@circ@res@right - } - #2 - } - {#3} -} - - - -\pgfcircdeclarefet{nfet}{ - \anchor{D}{ - \northeast - } - \anchor{drain}{ - \northeast - } - \anchor{S}{ - \northeast - \pgf@y=-\pgf@y - } - \anchor{source}{ - \northeast - \pgf@y=-\pgf@y - } - \anchor{G}{ - \left - } - \anchor{gate}{ - \left - } - -}{% - \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}{ - \northeast - } - \anchor{drain}{ - \northeast - } - \anchor{S}{ - \northeast - \pgf@y=-\pgf@y - } - \anchor{source}{ - \northeast - \pgf@y=-\pgf@y - } - \anchor{G}{ - \left - } - \anchor{gate}{ - \left - } - -}{% - \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}{ - \northeast - } - \anchor{drain}{ - \northeast - } - \anchor{S}{ - \northeast - \pgf@y=-\pgf@y - } - \anchor{source}{ - \northeast - \pgf@y=-\pgf@y - } - \anchor{G}{ - \northeast - \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@y - \left - \pgf@y=-\pgf@circ@res@step - } - \anchor{gate}{ - \northeast - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\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}{ - \northeast - } - \anchor{drain}{ - \northeast - } - \anchor{S}{ - \northeast - \pgf@y=-\pgf@y - } - \anchor{source}{ - \northeast - \pgf@y=-\pgf@y - } - \anchor{G}{ - \northeast - \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@y - \left - \pgf@y=-\pgf@circ@res@step - } - \anchor{gate}{ - \northeast - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\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}{ - \northeast - } - \anchor{drain}{ - \northeast - } - \anchor{S}{ - \northeast - \pgf@y=-\pgf@y - } - \anchor{source}{ - \northeast - \pgf@y=-\pgf@y - } - \anchor{G}{ - \northeast - \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@y - \left - \pgf@y=-\pgf@circ@res@step - } - \anchor{gate}{ - \northeast - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\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}{ - \northeast - } - \anchor{drain}{ - \northeast - } - \anchor{S}{ - \northeast - \pgf@y=-\pgf@y - } - \anchor{source}{ - \northeast - \pgf@y=-\pgf@y - } - \anchor{G}{ - \northeast - \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@y - \left - \pgf@y=-\pgf@circ@res@step - } - \anchor{gate}{ - \northeast - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\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}{ - \northeast - } - \anchor{drain}{ - \northeast - } - \anchor{S}{ - \northeast - \pgf@y=-\pgf@y - } - \anchor{source}{ - \northeast - \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}{ - \northeast - } - \anchor{source}{ - \northeast - } - \anchor{D}{ - \northeast - \pgf@y=-\pgf@y - } - \anchor{drain}{ - \northeast - \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} -} - - - - - - - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - - - - - -% ISFET -\pgfcircdeclarefet{isfet}{ - \anchor{D}{ - \northeast - } - \anchor{drain}{ - \northeast - } - \anchor{S}{ - \northeast - \pgf@y=-\pgf@y - } - \anchor{source}{ - \northeast - \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/isfet/gate height}\pgf@circ@res@up}} - % DRAIN - \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@up}} - \pgfusepath{draw} - - % GATE, DEPLETION TYPE - \pgfscope %% added - \pgfpathmoveto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base height}\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base height}\pgf@circ@res@down}} - \pgfsetlinewidth{2\pgflinewidth} %% added - \pgfusepath{draw} %% added - \endpgfscope %% added - - % BULK - \pgfpathmoveto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/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/isfet/base width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/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/isfet/gate width}\pgf@circ@res@left} - % {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@up}} - %\pgfpathlineto{\pgfpoint - % {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate width}\pgf@circ@res@left} - % {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/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/isfet/base width}\pgf@circ@res@left}% - {\pgf@circ@res@up+\pgf@circ@res@down}% - } - \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} - \endpgfscope - \pgfusepath{draw} - - % Wavy lines - \pgfscope - \pgfpathmoveto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves x sep}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves y sep}\pgf@circ@res@up}} - \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}} - \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}} - \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}} - \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}} - \pgfusepath{draw} - - \pgfpathmoveto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves x sep}\pgf@circ@res@up}{0cm}} - \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}} - \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}} - \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}} - \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}} - \pgfusepath{draw} - - \pgfpathmoveto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves x sep}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves y sep}\pgf@circ@res@up}} - \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}} - \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}} - \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}} - \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}} - \pgfusepath{draw} - \endpgfscope - -} - - - - - - - - - - - - - - -%% 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} - -} - - - - - - - - - -\pgfcircdeclarebipole{ - \anchor{out 1}{ - \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi - \pgf@y=0cm - } - \anchor{out 2}{ - \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi - \pgf@y=.8\pgf@y - } -}{\ctikzvalof{tripoles/toggleswitch/height 2}}{toggleswitch}{\ctikzvalof{tripoles/toggleswitch/height}}{\ctikzvalof{tripoles/toggleswitch/width}}{ - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} - \pgfpathlineto{\pgfpoint{.3\pgf@circ@res@left}{0pt}} - \pgfusepath{draw} - \pgfscope - \pgfpathmoveto{\pgfpoint{.3\pgf@circ@res@left}{0pt}} - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{.5\pgf@circ@res@up}} - \pgfusepath{draw} - \endpgfscope - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} - \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{0}} - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{.8\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{.8\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{.15\pgf@circ@res@up}} - \pgfusepath{draw} - - - \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfusepath{draw} - - \pgfsetdash{{.08\pgf@circ@res@up}{.04\pgf@circ@res@up}{.7\pgf@circ@res@up}{.04\pgf@circ@res@up}{.8\pgf@circ@res@up}}{0cm} - \pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0}{.8\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@left}{.6\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0}{.4\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0}{.2\pgf@circ@res@up}} - \pgfusepath{draw} - \pgfsetdash{}{0cm} -} - - - - - - - - - - -\pgfdeclareshape{op amp} - { - \anchor{center}{\pgfpointorigin} - \savedanchor\northwest{% - \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y - \pgf@y=.5\pgf@y - \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x - \pgf@x=.5\pgf@x - } - \anchor{south}{ - \northwest - \pgf@y=-\pgf@y - } - \anchor{north}{ - \northwest - } - \savedanchor\left{% - \pgf@y=0pt - } - \savedanchor\inOne{% - \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y - \pgf@y=.5\pgf@y - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@y - \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x - \pgf@x=.5\pgf@x - } - \anchor{-}{ - \inOne - } - \anchor{+}{ - \inOne - \pgf@y=-\pgf@y - } - \savedanchor\up{% - \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y - \pgf@y=.5\pgf@y - \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x - \pgf@x=.5\pgf@x - \pgf@circ@res@up = \pgf@y - \pgf@circ@res@right = -\pgf@x - \pgf@circ@res@left = \pgf@x - \pgfpointlineattime{ - \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/up pos}}{ - \pgfpoint{ - \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left} - {\pgf@circ@res@up}} - {\pgfpoint{.7\pgf@circ@res@right}{0pt}} - } - \anchor{up}{ - \up - } - \anchor{down}{ - \up - \pgf@y=-\pgf@y - } - \anchor{out}{ - \northwest - \pgf@y=0pt - \pgf@x=-\pgf@x - } - \anchor{west}{ - \left - } - \anchor{east}{ - \left - \pgf@x=-\pgf@x - } - - \backgroundpath{ - \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} - - - \northwest - \pgf@circ@res@up = \pgf@y - \pgf@circ@res@down = -\pgf@y - \pgf@circ@res@right = -\pgf@x - \pgf@circ@res@left = \pgf@x - - \pgfpathmoveto{\pgfpoint - {\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}} - \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}]{\scriptsize\ $-$} - - - \pgfpathmoveto{\pgfpoint - {\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left} - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}} - \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}]{\scriptsize\ $+$} - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} - \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}} - - \pgfusepath{draw} - - - \pgfscope - \pgfsetlinewidth{2\pgflinewidth} - \pgftransformxshift{.7\pgf@circ@res@left} - \pgf@circ@res@step=\pgf@circ@res@right - \advance\pgf@circ@res@step by -\pgf@circ@res@left - \pgf@circ@res@step=.7\pgf@circ@res@step - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}} - \pgfusepath{draw} - \endpgfscope - - - - } - } - - - - -%% 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{latex'} - \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}} - \pgfusepath{draw} - \endpgfscope -} - - - - - -%% Generic tunable - -\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{latex'} - \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 deleted file mode 100644 index 9ac9ade73d6..00000000000 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcircutils.sty +++ /dev/null @@ -1,64 +0,0 @@ -% Copyright 2007-2009 by Massimo Redaelli -% -% This file may be distributed and/or modified -% -% 1. under the LaTeX Project Public License and/or -% 2. under the GNU Public License. -% -% 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 - \def\pgf@temp{} - \StrBetween{#1}{<}{>}[\pgf@circ@handleSI@unit] - \StrLen{\pgf@circ@handleSI@unit}[\pgf@circ@handleSI@unit@len] - - \ifnum\pgf@circ@handleSI@unit@len=0 - \pgf@circ@siunitx@resfalse - \else - \IfEndWith{#1}{>}{ - \pgf@circ@siunitx@restrue - \noexpandarg - \StrBefore{#1}{<}[\pgf@circ@handleSI@val] - }{ - \pgf@circ@siunitx@resfalse - } - \fi -} - -\def\pgf@circ@finallabel#1{% - \edef\pgf@temp{}% - \edef\pgf@circ@temp{\ctikzvalof{bipole/#1label/unit}}% - \ifx\pgf@temp\pgf@circ@temp% - \ctikzvalof{bipole/#1label/name}% - \else% - $\SI{\ctikzvalof{bipole/#1label/name}}{\ctikzvalof{bipole/#1label/unit}}$% - \fi% -} - -\def\pgf@circ@ifkeyempty#1{ - \pgfextra{ - \ctikzset{#1/.get=\pgf@circ@temp} - \edef\pgf@temp{} - } - \ifx\pgf@circ@temp\pgf@temp -} - - -\endinput diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcircvoltage.sty b/Master/texmf-dist/tex/latex/circuitikz/pgfcircvoltage.sty deleted file mode 100644 index c453a5d6c3d..00000000000 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcircvoltage.sty +++ /dev/null @@ -1,285 +0,0 @@ -% Copyright 2007-2009 by Massimo Redaelli -% -% This file may be distributed and/or modified -% -% 1. under the LaTeX Project Public License and/or -% 2. under the GNU Public License. -% -% See the file doc/LICENSE for more details. - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% Voltage management - - -\ctikzset{v^>/.style = { - v = #1, - \circuitikzbasekey/bipole/voltage/direction = forward, - \circuitikzbasekey/bipole/voltage/position = above - } -} - -\ctikzset{v^/.style = { - v = #1, - \circuitikzbasekey/bipole/voltage/direction = forward, - \circuitikzbasekey/bipole/voltage/position = below - } -} - -\ctikzset{v_/.style = {v = #1, \circuitikzbasekey/bipole/voltage/direction = forward} } -\ctikzset{v4 \ifnum\pgfcircmathresult <86 - \ifpgf@circuit@bipole@voltage@below - \def\pgf@circ@bipole@voltage@label@anchor{north west} - \else \def\pgf@circ@bipole@voltage@label@anchor{south east} - \fi - \fi\fi - \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95 - \ifpgf@circuit@bipole@voltage@below - \def\pgf@circ@bipole@voltage@label@anchor{west} - \else \def\pgf@circ@bipole@voltage@label@anchor{east} - \fi - \fi\fi - \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176 - \ifpgf@circuit@bipole@voltage@below - \def\pgf@circ@bipole@voltage@label@anchor{south west} - \else \def\pgf@circ@bipole@voltage@label@anchor{north east} - \fi - \fi\fi - \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185 - \ifpgf@circuit@bipole@voltage@below - \def\pgf@circ@bipole@voltage@label@anchor{south} - \else\def\pgf@circ@bipole@voltage@label@anchor{north} - \fi - \fi\fi - \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <256 - \ifpgf@circuit@bipole@voltage@below - \def\pgf@circ@bipole@voltage@label@anchor{south east} - \else\def\pgf@circ@bipole@voltage@label@anchor{north west} - \fi - \fi\fi - \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275 - \ifpgf@circuit@bipole@voltage@below - \def\pgf@circ@bipole@voltage@label@anchor{east} - \else \def\pgf@circ@bipole@voltage@label@anchor{west} - \fi - \fi\fi - \ifnum\pgfcircmathresult >284 \ifnum\pgfcircmathresult <356 - \ifpgf@circuit@bipole@voltage@below - \def\pgf@circ@bipole@voltage@label@anchor{north east} - \else\def\pgf@circ@bipole@voltage@label@anchor{south west} - \fi - \fi\fi - \ifnum\pgfcircmathresult >-1 \ifnum\pgfcircmathresult <5 - \ifpgf@circuit@bipole@voltage@below - \def\pgf@circ@bipole@voltage@label@anchor{north} - \else\def\pgf@circ@bipole@voltage@label@anchor{south} - \fi - \fi\fi - \ifnum\pgfcircmathresult >355 \ifnum\pgfcircmathresult <361 - \ifpgf@circuit@bipole@voltage@below - \def\pgf@circ@bipole@voltage@label@anchor{north} - \else\def\pgf@circ@bipole@voltage@label@anchor{south} - \fi - \fi\fi - - \ifpgf@circuit@bipole@voltage@below - \def\pgf@circ@bipole@voltage@label@where{-90} - \else - \def\pgf@circ@bipole@voltage@label@where{90} - \fi - - \edef\pgf@temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/european label distance} - \pgfkeysifdefined{\pgf@temp} - { \edef\eudist{\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/european label distance}} } - { \edef\eudist{\ctikzvalof{voltage/european label distance}} } - } - - \ifpgf@circuit@bipole@isvoltage - \pgf@circ@drawvoltagegenerator - \else - \pgf@circ@drawvoltagegeneric - \fi - (\ctikzvalof{bipole/name}.\pgf@circ@bipole@voltage@label@where) - coordinate (Vlab) at ($(\ctikzvalof{bipole/name}.center) ! - \ifpgf@circuit@europeanvoltage\eudist\else\ctikzvalof{voltage/american label distance}\fi ! - (\ctikzvalof{bipole/name}.\pgf@circ@bipole@voltage@label@where)$) - node [anchor=\pgf@circ@bipole@voltage@label@anchor, inner sep=0] - at (Vlab) { \pgf@circ@finallabel{voltage/} } -} - - - - -\endinput - - coordinate (pgfcirc@Vcont1) at ($ (\ctikzvalof{bipole/name}.center) ! - \ctikzvalof{voltage/bump b} ! - (\ctikzvalof{bipole/name}.-110) $) - coordinate (pgfcirc@Vcont2) at ($ (\ctikzvalof{bipole/name}.center) ! - \ctikzvalof{voltage/bump b} ! - (\ctikzvalof{bipole/name}.-70) $) - \else - coordinate (pgfcirc@Vcont1) at ($ (\ctikzvalof{bipole/name}.center) ! - \ctikzvalof{voltage/bump b} ! - (\ctikzvalof{bipole/name}.110) $) - coordinate (pgfcirc@Vcont2) at ($ (\ctikzvalof{bipole/name}.center) ! - \ctikzvalof{voltage/bump b} ! - (\ctikzvalof{bipole/name}.70) $) - \fi diff --git a/Master/texmf-dist/tex/latex/circuitikz/t-circuitikz.tex b/Master/texmf-dist/tex/latex/circuitikz/t-circuitikz.tex deleted file mode 100644 index 0af74491c15..00000000000 --- a/Master/texmf-dist/tex/latex/circuitikz/t-circuitikz.tex +++ /dev/null @@ -1,102 +0,0 @@ -\def\pgfcircversion{0.2.3} -\writestatus{loading}{2009/11/18 The CircuiTikz circuit drawing package version \pgfcircversion} -\startmodule[circuitikz] - -\usemodule[tikz] -\usepgflibrary[decorations.pathmorphing] -\usetikzlibrary[calc] - -\unprotect - -\input circuitikz.code.tex - -% defaults - -\setupmodule[current=european, voltage=european, resistor=american, inductor=cute, logic=american, siunitx=true, arrowmos=false] - -\processaction[\currentmoduleparameter{voltage}] - [ european=>\ctikzset{voltage=european}, - american=>\ctikzset{voltage=american} - ] - -\processaction[\currentmoduleparameter{current}] - [ european=>\ctikzset{ current=european}, - american=>\ctikzset{ current=american} - ] - -\processaction[\currentmoduleparameter{label}] - [ - straight=>\ctikzset{label/align = straight} - align=>\ctikzset{label/align = rotate} - smart=>\ctikzset{label/align = smart} - ] - -\processaction[\currentmoduleparameter{resistor}] - [ european=>\ctikzset{ resistor=european}, - american=>\ctikzset{ resistor=american} - ] - -\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