texlive[51071] Master/texmf-dist: circuitikz (10may19)

commits+karl at tug.org commits+karl at tug.org
Fri May 10 23:15:08 CEST 2019


Revision: 51071
          http://tug.org/svn/texlive?view=revision&revision=51071
Author:   karl
Date:     2019-05-10 23:15:08 +0200 (Fri, 10 May 2019)
Log Message:
-----------
circuitikz (10may19)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/context/third/circuitikz/circuitikz-context.pdf
    trunk/Master/texmf-dist/doc/generic/circuitikz/CHANGELOG.md
    trunk/Master/texmf-dist/doc/generic/circuitikz/README.md
    trunk/Master/texmf-dist/doc/latex/circuitikz/changelog.tex
    trunk/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.pdf
    trunk/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.tex
    trunk/Master/texmf-dist/doc/latex/circuitikz/compatibility.tex
    trunk/Master/texmf-dist/tex/context/third/circuitikz/t-circuitikz.tex
    trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex
    trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex
    trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcirccurrent.tex
    trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircflow.tex
    trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcirclabel.tex
    trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex
    trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex
    trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex
    trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex
    trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex
    trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex
    trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex
    trunk/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/circuitikz/ctikzmanutils.sty
    trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircmultipoles.tex

Modified: trunk/Master/texmf-dist/doc/context/third/circuitikz/circuitikz-context.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/circuitikz/CHANGELOG.md
===================================================================
--- trunk/Master/texmf-dist/doc/generic/circuitikz/CHANGELOG.md	2019-05-10 21:14:43 UTC (rev 51070)
+++ trunk/Master/texmf-dist/doc/generic/circuitikz/CHANGELOG.md	2019-05-10 21:15:08 UTC (rev 51071)
@@ -1,6 +1,32 @@
 <!--- CircuiTikz - Changelog --->
 The major changes among the different circuitikz versions are listed here. See <https://github.com/circuitikz/circuitikz/commits> for a full list of changes.
 
+* Version 0.9.0 (2019-05-10)
+    - Added Romano Giannetti as contributor
+    - Added a CONTRIBUTING file
+    - Added options for solving the voltage direction problems. 
+	- Adjusted ground symbols to better match ISO standard, added new symbols
+    - Added new sources (cute european versions, noise sources) 
+    - Added new types of amplifiers, and option to flip inputs and outputs
+    - Added bidirectional diodes (diac) thanks to Andre Lucas Chinazzo 
+    - Added L,R,C sensors (with european, american and cute variants)
+    - Added stacked labels (thanks to the original work by Claudio Fiandrino)
+    - Make the position of voltage symbols adjustable
+    - Make the position of arrows in FETs and  BJTs adjustable
+    - Added chips (DIP, QFP) with a generic number of pins 
+    - Added special anchors for transformers (and fixed the wrong center anchor)
+    - Changed the logical port implementation to multiple inputs (thanks to John Kormylo) with border anchors.
+    - Added several symbols: bulb, new switches, new antennas, loudspeaker, microphone, coaxial connector, viscoelastic element
+    - Make most components fillable
+    - Added the oscilloscope component and several new instruments
+    - Added viscoelastic element
+    - Added a manual section on how to define new components
+    - Fixed american voltage symbols and allow to customize them
+	- Fixed placement of straightlabels in several cases
+    - Fixed a bug about straightlabels (thanks to @fotesan)
+    - Fixed labels spacing so that they are independent on scale factor
+    - Fixed the position of text labels in amplifiers
+  
 * Version 0.8.3 (2017-05-28) 
 	- Removed unwanted lines at to-paths if the starting point is a node without a explicit anchor.
 	- Fixed scaling option, now all parts are scaled by bipoles/length

Modified: trunk/Master/texmf-dist/doc/generic/circuitikz/README.md
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/circuitikz/changelog.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuitikz/changelog.tex	2019-05-10 21:14:43 UTC (rev 51070)
+++ trunk/Master/texmf-dist/doc/latex/circuitikz/changelog.tex	2019-05-10 21:15:08 UTC (rev 51071)
@@ -6,6 +6,65 @@
 \begin{itemize}
 \tightlist
 \item
+  Version 0.9.0 (2019-05-10)
+
+  \begin{itemize}
+  \tightlist
+  \item
+    Added Romano Giannetti as contributor
+  \item
+    Added a CONTRIBUTING file
+  \item
+    Added options for solving the voltage direction problems.
+  \item
+    Adjusted ground symbols to better match ISO standard, added new
+    symbols
+  \item
+    Added new sources (cute european versions, noise sources)
+  \item
+    Added new types of amplifiers, and option to flip inputs and outputs
+  \item
+    Added bidirectional diodes (diac) thanks to Andre Lucas Chinazzo
+  \item
+    Added L,R,C sensors (with european, american and cute variants)
+  \item
+    Added stacked labels (thanks to the original work by Claudio
+    Fiandrino)
+  \item
+    Make the position of voltage symbols adjustable
+  \item
+    Make the position of arrows in FETs and BJTs adjustable
+  \item
+    Added chips (DIP, QFP) with a generic number of pins
+  \item
+    Added special anchors for transformers (and fixed the wrong center
+    anchor)
+  \item
+    Changed the logical port implementation to multiple inputs (thanks
+    to John Kormylo) with border anchors.
+  \item
+    Added several symbols: bulb, new switches, new antennas,
+    loudspeaker, microphone, coaxial connector, viscoelastic element
+  \item
+    Make most components fillable
+  \item
+    Added the oscilloscope component and several new instruments
+  \item
+    Added viscoelastic element
+  \item
+    Added a manual section on how to define new components
+  \item
+    Fixed american voltage symbols and allow to customize them
+  \item
+    Fixed placement of straightlabels in several cases
+  \item
+    Fixed a bug about straightlabels (thanks to @fotesan)
+  \item
+    Fixed labels spacing so that they are independent on scale factor
+  \item
+    Fixed the position of text labels in amplifiers
+  \end{itemize}
+\item
   Version 0.8.3 (2017-05-28)
 
   \begin{itemize}

Modified: trunk/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.tex	2019-05-10 21:14:43 UTC (rev 51070)
+++ trunk/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.tex	2019-05-10 21:15:08 UTC (rev 51071)
@@ -5,17 +5,20 @@
 % !TeX spellcheck = en_US
 % !TeX encoding = utf8
 
-\documentclass[a4paper]{article}
+\documentclass[a4paper, titlepage]{article}
 \usepackage{a4wide}	%smaller borders
+\usepackage{titling}
 
-
 \def\modern{
 	\usepackage{fontspec}
 	\defaultfontfeatures{Ligatures=TeX, Numbers=OldStyle,Mapping=tex-text ,SmallCapsFeatures={LetterSpace=8, Numbers=OldStyle}}
-	%\setmainfont{Gentium Book Basic} 
+	%\setmainfont{Gentium Book Basic}
 }
 
-\usepackage[siunitx]{circuitikz}
+%do not split this line in more lines, otherwise "make git-manual" will show the wrong version
+\usepackage[siunitx, RPvoltages]{circuitikz}
+% Let this being the same as the chosen voltage direction for coherence
+\def\chosenvoltoption{RPvoltages}
 
 \usepackage{ifxetex,ifluatex}
 \ifxetex
@@ -35,7 +38,18 @@
 
 \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,breaklines=true,basicstyle=\normalsize\ttfamily,tabsize=3}
+%
+% The following trick is used to silence showexpl a bit, so that the
+% logs are readable...
+%
+\makeatletter
+\let\SX at Info=\relax % silence showexpl a bit...
+\makeatother
+%
+\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,breaklines=true,
+    basicstyle=\normalsize\ttfamily,tabsize=3}
 
 \usepackage{booktabs}
 \renewcommand{\arraystretch}{1.2}
@@ -45,7 +59,7 @@
 \hypersetup{
     bookmarks=false,         % show bookmarks bar?
     pdftitle={CircuiTikZ \pgfcircversion\ - manual},    % title
-    pdfauthor={Massimo Redaelli, Stefan Lindner, Stefan Erhardt},     % author
+    pdfauthor={Massimo Redaelli, Stefan Lindner, Stefan Erhardt, Romano Giannetti},     % author
     pdfsubject={CircuiTikZ manual},   % subject of the document
     pdfkeywords={}, % list of keywords
     colorlinks=true,       % false: boxed links; true: colored links
@@ -58,26 +72,22 @@
 \usepackage{textcomp}
 \makeindex[title=Index of the components, intoc=true]
 
-\def\circuititem#1#2#3{\item {#2} (node[\texttt{#1}]\{#3\}) \index{#1} \par \begin{center}\begin{circuitikz} \draw (0,0) node[#1] {#3}; \end{circuitikz} \end{center}
-\par}
+% Local utilities packages
+\usepackage{ctikzmanutils}
 
-\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\Letter~\fi\href{mailto:#2}{#2}}
 \newcommand{\email}[1]{\href{mailto:#1}{#1}}
-
 \long\def\comment#1{}
 
+% There are a lot of boxes in the document; let's try to give TeX
+% a bit of leverage... do not use parindent (which looks strange between examples)
+% and add stretch between paragraph, to avoid a lot of sections and subsections
+% starting at the end of the page.
+\parindent=0pt
+\parskip=4pt plus 6pt minus 2pt
+
 \begin{document}
-\setcounter{secnumdepth}{3}
-\setcounter{tocdepth}{3} 
+\setcounter{secnumdepth}{4}
+\setcounter{tocdepth}{4}
 
 \def\TikZ{Ti\emph{k}Z}
 \def\Circuitikz{Circui\TikZ}
@@ -86,9 +96,42 @@
 \lstloadlanguages{TeX}
 
 \title{\Circuitikz \\{\large version \pgfcircversion{} (\pgfcircversiondate)}}
-\author{Massimo A. Redaelli (\email{m.redaelli at gmail.com})\\Stefan Lindner (\email{stefan.lindner at fau.de})\\Stefan Erhardt (\email{stefan.erhardt at fau.de})}
+\author{Massimo A. Redaelli (\email{m.redaelli at gmail.com})\\
+    Stefan Lindner (\email{stefan.lindner at fau.de})\\
+    Stefan Erhardt (\email{stefan.erhardt at fau.de})\\
+    Romano Giannetti (\email{romano.giannetti at gmail.com})}
 \date{\today}
 
+\pretitle{\begin{center}%
+    \begin{circuitikz}
+        \draw (0,0) node[dipchip, rotate=90, num pins=40, fill=cyan!20!white](C){%
+            \rotatebox{-90}{\LARGE\Circuitikz}%
+        };
+        \draw (C.pin 20) -- ++(0,-8) node[ground](GND){};
+        \draw (C.pin 7) to[D, fill=blue] ++(0,-1) -- ++(0.5,0) to[R] ++(2,0)
+            coordinate(a1) to[short, -*]
+            node[above left, blue]{Massimo A. Redaelli}
+            node[below left,]{\email{m.redaelli at gmail.com}}
+            (a1-|GND);
+            \draw (C.pin 5) to[D, fill=red] ++(0,-3)-- ++(0.5,0) to[R] ++(2,0)
+            coordinate(a2) to[short, -*]
+            node[above left, blue]{Stefan Lindner}
+            node[below left,]{\email{stefan.lindner at fau.de}}
+            (a2-|GND);
+            \draw (C.pin 3) to[D, fill=green] ++(0,-5)-- ++(0.5,0) to[R] ++(2,0)
+            coordinate(a3) to[short, -*]
+            node[above left, blue]{Stefan Erhart}
+            node[below left,]{\email{stefan.erhardt at fau.de}}
+            (a3-|GND);
+            \draw (C.pin 1) to[D, fill=yellow] ++(0,-7)-- ++(0.5,0) to[R] ++(2,0)
+            coordinate(a4) to[short, -*]
+            node[above left, blue]{Romano Giannetti}
+            node[below left,]{\email{romano.giannetti at gmail.com}}
+            (a4-|GND);
+    \end{circuitikz}
+    \par\bigskip\vfill}
+\posttitle{\end{center}}
+
 \maketitle
 
 \tableofcontents
@@ -96,20 +139,16 @@
 \section{Introduction}
 \subsection{About}
 \Circuitikz\ was initiated by Massimo Redaelli in 2007, who was working as a research assistant at the Polytechnic University of Milan, Italy, and needed a tool for creating exercises and exams.
-After he left University in 2010 the development of \Circuitikz\ slowed down, since \LaTeX\ is mainly established in the academic world. In 2015 Stefan Lindner and Stefan Erhardt, both working as research assistants at the University of Erlangen-Nürnberg, Germany, joined the team and now maintain the project together with the initial author.
+After he left University in 2010 the development of \Circuitikz\ slowed down, since \LaTeX\ is mainly established in the academic world. In 2015 Stefan Lindner and Stefan Erhardt, both working as research assistants at the University of Erlangen-Nürnberg, Germany, joined the team and now maintain the project together with the initial author. In 2018 Romano Giannetti, full professor of Electronics at Comillas Pontifical University of Madrid, joined the team.
 
 The use of \Circuitikz\ is, of course, not limited to academic teaching. The package gets widely used by engineers for typesetting electronic circuits for articles and publications all over the world.
 
-\medskip
-
-This documentation is somewhat scant. Hopefully the authors will find the leisure to improve it some day.
-
 \subsection{Loading the package}
 
 \begin{table}[h]
 \centering
 \begin{tabular}{ll}\toprule
-	\LaTeX       					& \ConTeXt\footnotemark \\ \midrule
+	\LaTeX       	& \ConTeXt\footnotemark \\ \midrule
 	\verb!\usepackage{circuitikz}!	& \verb!\usemodule[circuitikz]!\\
 	\bottomrule
 \end{tabular}
@@ -124,11 +163,25 @@
 \tikz \draw (0,0) to[R=$R_1$] (2,0);
 \end{LTXexample}
 
+\subsection{Installing a new version of the package.}
+
+The stable version of the package should come with your \LaTeX\ distribution. Downloading the files from CTAN and installing them locally is, unfortunately, a distribution-dependent task and sometime not so trivial. If you search for \texttt{local texmf tree} and the name of your distribution on \url{https://tex.stackexchange.com/} you will find a lot of hints.
+
+Anyway, the easiest way of using whichever version of \Circuitikz\ is to point to the github page \url{https://circuitikz.github.io/circuitikz/} of the project, and download the version you want. You will download a simple (biggish) file, called \texttt{circuitikz.sty}.
+
+Now you can just put this file in your local \texttt{texmf} tree, if you have one, or simply adding it into the same directory where your main file resides, and then use
+
+\begin{verbatim}
+    \usepackage[...options...]{circuitikzgit}
+\end{verbatim}
+
+instead of \texttt{circuitikz}. This is also advantageous for ``future resilience''; the authors try hard not to break backward compatibility with new versions, but sometime things happen.
+
 \subsection{Requirements}
 \begin{itemize}
- \item \texttt{tikz}, version $\ge 3$;
- \item \texttt{xstring}, not older than 2009/03/13;
- \item \texttt{siunitx}, if using \texttt{siunitx} option.
+    \item \texttt{tikz}, version $\ge 3$;
+    \item \texttt{xstring}, not older than 2009/03/13;
+    \item \texttt{siunitx}, if using \texttt{siunitx} option.
 \end{itemize}
 
 \subsection{Incompatible packages}
@@ -137,116 +190,561 @@
 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{License}
-Copyright \copyright\ 2007--2017 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.
+Copyright \copyright\ 2007--2019 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}
 The easiest way to contact the authors is via the official Github repository: \url{https://github.com/circuitikz/circuitikz/issues}
 
 
-\section{Incompabilities between version}
+\subsection{Incompabilities between version}
 Here, we will provide a list of incompabilitys between different version of circuitikz. We will try to hold this list short, but sometimes it is easier to break with old syntax than including a lot of switches and compatibility layers.
 You can check the used version at your local installation using the macro \verb!\pgfcircversion{}!.
 \begin{itemize}
-\item Since v0.8.2: voltage and current label directions(v<= / i<=) do NOT change the orientation of the drawn source shape anymore. Use the "invert" option to rotate the shape of the source. Furthermore, from this version on, the current label(i=) at current sources can be used independent of the regular label(l=).
-\item Since v0.7?: The label behaviour at mirrored bipoles has changes, this fixes the voltage drawing, but perhaps you have to adjust your label positions.
-\item Since v0.5.1: The parts pfet,pigfete,pigfetebulk and pigfetd are now mirrored by default. Please adjust your yscale-option to correct this.
-\item Since v0.5: New voltage counting direction, here exists an option to use the old behaviour
+    \item After v0.9.0: the parameters \texttt{tripoles/american or port/aaa}, \texttt{...bbb}, \texttt{...ccc} and \texttt{...ddd} are no longer used and are silently ignored; the same stands for \texttt{nor}, \texttt{xor}, and \texttt{xnor} ports.
+    \item After v0.9.0: voltage and current directions/sign (plus and minus signs in case of \texttt{american voltages} and arrows in case of \texttt{european voltages} have been rationalized with a couple of new options (see details in section~\ref{curr-and-volt}. The default case is still the same as v0.8.3.
+    \item Since v0.8.2: voltage and current label directions(v<= / i<=) do NOT change the orientation of the drawn source shape anymore. Use the "invert" option to rotate the shape of the source. Furthermore, from this version on, the current label(i=) at current sources can be used independent of the regular label(l=).
+    \item Since v0.7?: The label behaviour at mirrored bipoles has changes, this fixes the voltage drawing, but perhaps you have to adjust your label positions.
+    \item Since v0.5.1: The parts pfet, pigfete, pigfetebulk and pigfetd are now mirrored by default. Please adjust your yscale-option to correct this.
+    \item Since v0.5: New voltage counting direction, here exists an option to use the old behaviour
 \end{itemize}
 For older projects, you can use an older version locally using the git-version and picking the correct commit from the repository (branch gh-pages).
 
-\section{Package options}
+\subsection{Package options}
+\label{sec:package-options}
 
 \noindent Circuit people are very opinionated about their symbols. In order to meet the individual gusto you can set a bunch of package options. The standard options are what the authors like, for example 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}
+    \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}
 
 Feel free to load the package with your own cultural options:
 
 \begin{center}
-\begin{tabular}{ll}\toprule
-	\LaTeX       					& \ConTeXt \\ \midrule
-	\verb!\usepackage[american]{circuitikz}!	& \verb!\usemodule[circuitikz][american]!\\
-	\bottomrule
-\end{tabular}
+    \begin{tabular}{ll}\toprule
+        \LaTeX       					& \ConTeXt \\ \midrule
+        \verb!\usepackage[american]{circuitikz}!	& \verb!\usemodule[circuitikz][american]!\\
+        \bottomrule
+    \end{tabular}
 \end{center}
 
 \begin{LTXexample}[varwidth=true,linerange={1-1,3-6}]
-\begin{circuitikz}
-	[circuitikz/voltage=american, circuitikz/resistor=american] % line not printed
-	\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}
+    \begin{circuitikz}
+        [circuitikz/voltage=american, circuitikz/resistor=american] % line not printed
+        \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}
 
 \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{straightvoltages}: uses arrows to define voltages, and and uses straight voltage arrows;
-	\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{fulldiode}: the various diodes are drawn \emph{and} filled by default, i.e. when using styles such as \texttt{diode}, \texttt{D}, \texttt{sD}, \ldots Other diode styles can always be forced with e.g. \texttt{Do}, \texttt{D-},  \ldots
-	\item \texttt{strokediode}: the various diodes are drawn \emph{and} stroke by default, i.e. when using styles such as \texttt{diode}, \texttt{D}, \texttt{sD}, \ldots Other diode styles can always be forced with e.g. \texttt{Do}, \texttt{D*},  \ldots
-	\item \texttt{emptydiode}: the various diodes are drawn \emph{but not} filled by default, i.e. when using styles such as \texttt{D}, \texttt{sD}, \ldots Other diode styles can always be forced with e.g. \texttt{Do}, \texttt{D-},  \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{fetbodydiode}: draw the body diode of a FET;
-	\item \texttt{nofetbodydiode}: do not draw the body diode of a FET;
-	\item \texttt{fetsolderdot}: draw solderdot at bulk-source junction of some transistors;
-	\item \texttt{nofetsolderdot}: do not draw solderdot at bulk-source junction of some transistors;
-	\item \texttt{emptypmoscircle}: the circle at the gate of a pmos transistor gets not filled;
-	\item \texttt{lazymos}: draws lazy nmos and pmos transistors. Chip designers with huge circuits prefer this notation;
-	\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.
-	\item \texttt{oldvoltagedirection}: Use old(erronous) way of voltage direction having a difference between european and american direction
-	\item \texttt{betterproportions}\footnote{May change in the future!}: nicer proportions of transistors in comparision to resistors;
-\end{itemize}	
+{\sloppy % for the big lists of \texttt here
+    \begin{itemize}
+        \item \texttt{europeanvoltages}: uses arrows to define voltages, and uses european-style voltage sources;
+        \item \texttt{straightvoltages}: uses arrows to define voltages, and and uses straight voltage arrows;
+        \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{fulldiode}: the various diodes are drawn \emph{and} filled by default, i.e. when using styles such as \texttt{diode}, \texttt{D}, \texttt{sD}, \ldots Other diode styles can always be forced with e.g. \texttt{Do}, \texttt{D-},  \ldots
+        \item \texttt{strokediode}: the various diodes are drawn \emph{and} stroke by default, i.e. when using styles such as \texttt{diode}, \texttt{D}, \texttt{sD}, \ldots Other diode styles can always be forced with e.g. \texttt{Do}, \texttt{D*},  \ldots
+        \item \texttt{emptydiode}: the various diodes are drawn \emph{but not} filled by default, i.e. when using styles such as \texttt{D}, \texttt{sD}, \ldots Other diode styles can always be forced with e.g. \texttt{Do}, \texttt{D-},  \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{fetbodydiode}: draw the body diode of a FET;
+        \item \texttt{nofetbodydiode}: do not draw the body diode of a FET;
+        \item \texttt{fetsolderdot}: draw solderdot at bulk-source junction of some transistors;
+        \item \texttt{nofetsolderdot}: do not draw solderdot at bulk-source junction of some transistors;
+        \item \texttt{emptypmoscircle}: the circle at the gate of a pmos transistor gets not filled;
+        \item \texttt{lazymos}: draws lazy nmos and pmos transistors. Chip designers with huge circuits prefer this notation;
+        \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.
+        \item Voltage directions: until v0.8.3, there was an error in the coherence between american and european voltages styles (see section~\ref{curr-and-volt} for the batteries. This has been fixed, but to guarantee backward compatibility and nasty surprises, the fix is available with new options:
+            \begin{itemize}
+                \item \texttt{oldvoltagedirection}: Use old way of voltage direction having a difference between european and american direction, with wrong default labelling for batteries;
+                \item \texttt{nooldvoltagedirection}: The standard from 0.5 onward, utilize the (German?) standard of voltage arrows in the  direction of electric fields (without fixing batteries);
+                \item \texttt{RPvoltages} (meaning Rising Potential voltages): the arrow is in direction of rising potential, like in \texttt{oldvoltagedirections}, but batteries and current sources are fixed to follow the passive/active standard;
+                \item \texttt{EFvoltages} (meaning Electric Field voltages): the arrow is in direction of the electric field, like in \texttt{nooldvoltagedirections}, but batteries are fixed;
+            \end{itemize}
+            If none of these option are given, the package will default to \texttt{nooldvoltagedirections}, but will give a warning. The behavior is also selectable circuit by circuit with the \texttt{voltage dir} style.
+        \item \texttt{betterproportions}\footnote{May change in the future!}: nicer proportions of transistors in comparision to resistors;
+    \end{itemize}
 
-The old options in the singular (like \texttt{american voltage}) are still available for compatibility, but are discouraged.
 
-\medskip
+    The old options in the singular (like \texttt{american voltage}) are still available for compatibility, but are discouraged.
 
-Loading the package with no options is equivalent to my own personal liking, that is to the following options:\\
- \texttt{[nofetsolderdot,nooldvoltagedirection,europeancurrents,europeanvoltages,americanports,americanresistors,cuteinductors,europeangfsurgearrester,nosiunitx,noarrowmos,smartlabels,nocompatibility]}.
- 
-\medskip
+    \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}.
- 
+    Loading the package with no options is equivalent to the following options:
+    \texttt{[nofetsolderdot, europeancurrents, europeanvoltages, americanports,
+        americanresistors, cuteinductors, europeangfsurgearrester, nosiunitx, noarrowmos,
+    smartlabels, nocompatibility]}.
+
+    \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}.
+
+} %\stop the \sloppy processing
+
+\section{Tutorials}
+
+To draw a circuit, you have to load the \texttt{circuitikz} package; this can be done with
+\begin{lstlisting}
+    \usepackage[siunitx, RPvoltages]{circuitikz}
+\end{lstlisting}
+somewhere in your document preamble. It will load automatically the needed packages if not already done before.
+
+\subsection{Getting started with \Circuitikz: a current shunt}
+
+Let's say we want to prepare a circuit to teach how a current shunt works; the idea is just draw a current generator, a couple of resistors in parallel, and the indication of currents and voltages for the discussion.
+
+A circuit in \Circuitikz is drawn into a \texttt{circuitikz} environment (which is really an alias for a \texttt{tikzpicture} one). In this first example we will use absolute coordinates.
+The electrical components can be divided in two big categories: the one that are bipoles and are placed along a path (also known as \texttt{to}-style component, for their usage) and components that are nodes and can have any number of poles, or connections.
+
+Let's start with the first type of components and build a basic mesh:
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[]
+    \draw (0,0) to[isource] (0,3) -- (2,3)
+    to[R] (2,0) -- (0,0);
+\end{circuitikz}
+\end{LTXexample}
+
+The symbol for the current source can surprise somebody; this is actually the european-style symbol, and the symbols chosen reflects the default options of loaded in the package (see section~\ref{sec:package-options}). Let's change the style for now (the author of the tutorial, Romano, is European but he has used since ever American style circuit, so\dots); and while at it, let add the other branch and some label.
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[american]
+    \draw (0,0) to[isource, l=$I_0$] (0,3) -- (2,3)
+    to[R=$R_1$] (2,0) -- (0,0);
+    \draw (2,3) -- (4,3) to[R=$R_2$]
+          (4,0) -- (2,0);
+\end{circuitikz}
+\end{LTXexample}
+
+You can use a single path or multiple path when drawing your circuit, it's just a question of style (but be aware that closing path could be non-trivial, see section~\ref{sec:line-joins}), and you can use standard \TikZ\ lines (\verb|--|, \verb+|-+ or similar) for the wires. Nonetheless, sometime using the \Circuitikz\ specific \texttt{short} component for the wires can be useful, because then we can add labels and nodes at it, like for example in the following circuit.
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[american]
+    \draw (0,0) to[isource, l=$I_0$] (0,3)
+    to[short, -*, i=$I_0$] (2,3)
+    to[R=$R_1$, i=$i_1$] (2,0) -- (0,0);
+    \draw (2,3) -- (4,3)
+    to[R=$R_2$, i=$i_2$]
+    (4,0) to[short, -*] (2,0);
+\end{circuitikz}
+\end{LTXexample}
+
+One of the problems with this circuit is that we would like to have the current in a different position, such as for example on the upper side of the resistors, so that Kirchoff's Current Law at the node is better shown to students. No problem; as you can see in section~\ref{curr-and-volt} you can use the position specifier \verb|<>^_}| after the key \texttt{i}:
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[american]
+    \draw (0,0) to[isource, l=$I_0$] (0,3)
+    to[short, -*, i=$I_0$] (2,3)
+    to[R=$R_1$, i>_=$i_1$] (2,0) -- (0,0);
+    \draw (2,3) -- (4,3)
+    to[R=$R_2$, i>_=$i_2$]
+    (4,0) to[short, -*] (2,0);
+\end{circuitikz}
+\end{LTXexample}
+
+Finally, we would like to add voltages indication for carrying out the current formulas; as the default position of the voltage signs seems a bit cramped to me, I am adding the \texttt{voltage shift} parameter to make a bit more space for it\dots
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[american, voltage shift=0.5]
+    \draw (0,0) to[isource, l=$I_0$, v=$V_0$] (0,3)
+    to[short, -*, i=$I_0$] (2,3)
+    to[R=$R_1$, i>_=$i_1$] (2,0) -- (0,0);
+    \draw (2,3) -- (4,3)
+    to[R=$R_2$, i>_=$i_2$]
+    (4,0) to[short, -*] (2,0);
+\end{circuitikz}
+\end{LTXexample}
+
+\emph{Et voilá!}. Remember that this is still \LaTeX, which means that you have done a description of your circuit, which is, in a lot of way, independent of the visualization of it. If you ever have to adapt the circuit to, say, a journal that force European style and flows instead of currents, you just change a couple of things and you have what seems a completely different diagram:
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[european, voltage shift=0.5]
+    \draw (0,0) to[isourceC, l=$I_0$, v=$V_0$] (0,3)
+    to[short, -*, f=$I_0$] (2,3)
+    to[R=$R_1$, f>_=$i_1$] (2,0) -- (0,0);
+    \draw (2,3) -- (4,3)
+    to[R=$R_2$, f>_=$i_2$]
+    (4,0) to[short, -*] (2,0);
+\end{circuitikz}
+\end{LTXexample}
+
+And finally, this is still \TikZ, so that you can freely mix other graphics element to the circuit.
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[american, voltage shift=0.5]
+    \draw (0,0) to[isource, l=$I_0$, v=$V_0$] (0,3)
+    to[short, -*, f=$I_0$] (2,3)
+    to[R=$R_1$, f>_=$i_1$] (2,0) -- (0,0);
+    \draw (2,3) -- (4,3)
+    to[R=$R_2$, f>_=$i_2$]
+    (4,0) to[short, -*] (2,0);
+    \draw[red, thick] (1.5,2.5) rectangle (4.5,3.5)
+    node[pos=0.5, above]{KCL};
+\end{circuitikz}
+\end{LTXexample}
+
+\subsection{A more complex tutorial: circuits Romano's style.}
+\begingroup % do not propagate to the rest of the manual
+
+The idea is to draw a two-stage amplifier for a lesson, or exercise, on the different qualities of BJT an MOSFET transistors.
+Notice that this is a more ``personal'' tutorial, showing a way to draw circuits that is, in the author's opinion, highly reusable and easy to do.
+The idea is using relative coordinates and named nodes as much as possible, so that changes in the circuit are easily done by changing keys numbers of position, and crucially, each block is reusable in other diagrams.
+
+First of all, let's define a handy function to show the position of nodes:
+
+\def\coord(#1){node[circle, red, draw, inner sep=1pt,pin={[red, overlay, inner sep=0.5pt, font=\tiny, pin distance=0.1cm, pin edge={red, overlay,}]45:#1}](#1){}}
+\begin{lstlisting}
+\def\coord(#1){coordinate(#1)}
+\def\coord(#1){node[circle, red, draw, inner sep=1pt,pin={[red, overlay, inner sep=0.5pt, font=\tiny, pin distance=0.1cm, pin edge={red, overlay,}]45:#1}](#1){}}
+\end{lstlisting}
+
+
+
+The idea is that you can use \verb|\coord()| instead of \verb|coordinate()| in paths, and that will draw sort of \emph{markers} showing them. For example:
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[american,]
+    \draw (0,0) node[npn](Q){};
+    \path (Q.center) \coord(center)
+    (Q.B) \coord(B) (Q.C) \coord(C)
+    (Q.E) \coord(E);
+\end{circuitikz}
+\end{LTXexample}
+
+After the circuit is drawn, simply commenting out the second definition of \verb|\coord| will hide all the markers.
+
+So let's start with the first stage transistor; given that my preferred way of drawing a MOSFET is with arrows, I'll start issuing the command \verb|\ctikzset{tripoles/mos style/arrows}|:
+
+\ctikzset{tripoles/mos style/arrows}
+\def\killdepth#1{{\raisebox{0pt}[\height][0pt]{#1}}}
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[american,]
+\ctikzset{tripoles/mos style/arrows}
+\def\killdepth#1{{\raisebox{0pt}[\height][0pt]{#1}}}
+    \draw (0,0) node[nmos](Q1){};
+    \draw (Q1.center) node[right]{\killdepth{Q1}};
+\end{circuitikz}
+\end{LTXexample}
+
+Another thing I like to modify with respect to the standard is the position of the arrows in transistors, which are normally midway the symbol. Issuing the following settings will move the arrows to the end or start  of the corresponding pin.
+
+\ctikzset{tripoles/mos style/arrows,
+tripoles/npn/arrow pos=0.8,
+tripoles/pnp/arrow pos=0.8,
+tripoles/nmos/arrow pos=0.8,
+tripoles/pmos/arrow pos=0.6, }
+\begin{lstlisting}
+\ctikzset{tripoles/mos style/arrows,
+tripoles/npn/arrow pos=0.8,
+tripoles/pnp/arrow pos=0.8,
+tripoles/nmos/arrow pos=0.8,
+tripoles/pmos/arrow pos=0.6, }
+\end{lstlisting}
+
+The tricky thing about \verb|\killdepth{}| macro is a finicky details; I do not like the standard position of labels on transistors (which is near the collector/drain) so I plot the label at the right of the \texttt{center} anchor. Without the \verb|\killdepth| macro, the labels of different transistor will be adjusted so that the center of the box is at the \texttt{center} anchor, and as an effect, labels with descenders (like Q) will have a different baseline than labels without. You can see this here (it's really subtle):
+
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[american,]
+\draw (0,0) node[nmos](Q1){} ++(2,0) node[nmos](M1){};
+\draw (Q1.center) node[right]{q1};
+\draw (M1.center) node[right]{m1};
+\draw [red] (Q1.center) ++(0,-0.7ex) -- ++(3,0);
+\draw (0,-2)node[nmos](Q1){} ++(2,0) node[nmos](M1){};
+\draw (Q1.center) node[right]{\killdepth{q1}};
+\draw (M1.center) node[right]{\killdepth{m1}};
+\draw [red] (Q1.center) ++(0,-0.7ex) -- ++(3,0);
+\end{circuitikz}
+\end{LTXexample}
+
+We will start connecting the first transistor with the power supply with a couple of resistors. Notice that I am naming the nodes \texttt{GND}, \texttt{VCC} and \texttt{VEE}, so that I can use the coordinates to have all the supply rails at the same vertical position (more on this later).
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[american,]
+    \draw (0,0) node[nmos,](Q1){};
+    \draw (Q1.center) node[right]{\killdepth{Q1}};
+    \draw (Q1.S) to[R, l2^=$R_S$ and \SI{5}{k\ohm}] ++(0,-3)
+        node[vee](VEE){$V_{EE}=\SI{-10}{V}$};
+    \draw (Q1.D) to[R, l2_=$R_D$ and \SI{10}{k\ohm}] ++(0,3)
+        node[vcc](VCC){$V_{CC}=\SI{10}{V}$};
+    \draw (Q1.S) to[short] ++(2,0) to[C=$C_1$] ++(0,-1.5) node[ground](GND){};
+    \path (GND) \coord(GND) (VCC) \coord(VCC)
+        (VEE) \coord(VEE);
+\end{circuitikz}
+\end{LTXexample}
+
+After that, let's add the input part. I will use a named node here, to refer to it to add the input source. Notice how the ground node is positioned: the coordinate \texttt{(in |- GND)} is the point with the horizontal coordinate of \texttt{(in)}  and the horizontal one of \texttt{(GND)}, lining it up with the ground of the capacitor $C_1$.
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[american, scale=0.7]
+    \draw (0,0) node[nmos,](Q1){};
+    \draw (Q1.center) node[right]
+        {\killdepth{Q1}};
+    \draw (Q1.S) to[R, l2^=$R_S$ and \SI{5}{k\ohm}] ++(0,-3)
+        node[vee](VEE){$V_{EE}=\SI{-10}{V}$};
+    \draw (Q1.D) to[R, l2_=$R_D$ and \SI{10}{k\ohm}] ++(0,3)
+        node[vcc](VCC){$V_{CC}=\SI{10}{V}$};
+    \draw (Q1.S) to[short] ++(2,0) to[C=$C_1$] ++(0,-1.5) node[ground](GND){};
+    \draw (Q1.G) to[short] ++(-1,0)
+        \coord (in) to[R, l2^=$R_G$ and \SI{1}{M\ohm}]
+        (in |- GND) node[ground]{};
+    \draw (in) to[C, l_=$C_2$,*-o] ++(-1.5,0) node[left](vi1){$v_i=v_{i1}$};
+\end{circuitikz}
+\end{LTXexample}
+
+Notice that the only absolute coordinate here is the first one, \texttt{(0,0)}; so the elements are connected with relative movements and can be moved by just changing one number (for example, changing the \verb| to[C=$C_1$] ++(0,-1.5) | will move \emph{all} the grounds down).
+
+This is the final circuit, with the nodes still marked:
+\begin{lstlisting}
+\tikzset{blockdef/.style={%
+    {Straight Barb[harpoon, reversed, right, length=0.2cm]}-{Straight Barb[harpoon, reversed, left, length=0.2cm]},
+    blue, %densely dotted,
+}}
+\def\killdepth#1{{\raisebox{0pt}[\height][0pt]{#1}}}
+\def\coord(#1){coordinate(#1)}
+\def\coord(#1){node[circle, red, draw, inner sep=1pt,pin={[red, overlay, inner sep=0.5pt, font=\tiny, pin distance=0.1cm, pin edge={red, overlay,}]45:#1}](#1){}}
+\begin{circuitikz}[american, ]
+    \draw (0,0) node[nmos,](Q1){};
+    \draw (Q1.center) node[right]{\killdepth{Q1}};
+    \draw (Q1.S) to[R, l2^=$R_S$ and \SI{5}{k\ohm}] ++(0,-3) node[vee](VEE){$V_{EE}=\SI{-10}{V}$}; %define VEE level
+    \draw (Q1.S) to[short] ++(2,0) to[C=$C_1$] ++(0,-1.5) node[ground](GND){};
+    \draw (Q1.G) to[short] ++(-1,0) \coord (in) to[R, l2^=$R_G$ and \SI{1}{M\ohm}] (in |- GND) node[ground]{};
+    \draw (in) to[C, l_=$C_2$,*-o] ++(-1.5,0) node[left](vi1){$v_i=v_{i1}$};
+    \draw (Q1.D) to[R, l2_=$R_D$ and \SI{10}{k\ohm}] ++(0,3) node[vcc](VCC){$V_{CC}=\SI{10}{V}$};
+    \draw (Q1.D) to[short, -o] ++(1,0) node[right](vo1){$v_{o1}$};
+    %
+    \path (vo1) -- ++(3,0) \coord(bjt);
+    %
+    \draw (bjt) node[npn, ](Q2){};
+    \draw (Q2.center) node[right]{\killdepth{Q2}};
+    \draw (Q2.B) to[short, -o] ++(-0.5,0) node[left](vi2){$v_{12}$};
+    \draw (Q2.E) to[R,l2^=$R_E$ and \SI{9.3}{k\ohm}] (Q2.E |- VEE) node[vee]{};
+    \draw (Q2.E) to[short, -o] ++(1,0) node[right](vo2){$v_{o2}$};
+    \draw (Q2.C) to[short] (Q2.C |- VCC) node[vcc]{};
+    %
+    \path (vo2) ++(1.5,0) \coord(load);
+    \draw (load) to[C=$C_3$] ++(1,0) \coord(tmp) to[R=$R_L$] (tmp |- GND) node[ground]{};
+    \draw [densely dashed] (vo2) -- (load);
+    %
+    \draw [densely dashed] (vo1) -- (vi2);
+    %
+    \draw [blockdef](vi1|-VEE) ++(0,-2) \coord(tmp)
+          -- node[midway, fill=white]{bloque 1} (vo1|- tmp);
+          \draw [blockdef] (vi2|-VEE) ++(0,-2) \coord(tmp)
+          -- node[midway, fill=white]{bloque 2} (vo2|- tmp);
+
+\end{circuitikz}
+\end{lstlisting}
+
+\tikzset{blockdef/.style={%
+    {Straight Barb[harpoon, reversed, right, length=0.2cm]}-{Straight Barb[harpoon, reversed, left, length=0.2cm]},
+    blue, %densely dotted,
+}}
+\def\killdepth#1{{\raisebox{0pt}[\height][0pt]{#1}}}
+\def\coord(#1){coordinate(#1)}
+\def\coord(#1){node[circle, red, draw, inner sep=1pt,pin={[red, overlay, inner sep=0.5pt, font=\tiny, pin distance=0.1cm, pin edge={red, overlay,}]45:#1}](#1){}}
+\begin{circuitikz}[american, ]
+    \draw (0,0) node[nmos,](Q1){};
+    \draw (Q1.center) node[right]{\killdepth{Q1}};
+    \draw (Q1.S) to[R, l2^=$R_S$ and \SI{5}{k\ohm}] ++(0,-3) node[vee](VEE){$V_{EE}=\SI{-10}{V}$}; %define VEE level
+    \draw (Q1.S) to[short] ++(2,0) to[C=$C_1$] ++(0,-1.5) node[ground](GND){};
+    \draw (Q1.G) to[short] ++(-1,0) \coord (in) to[R, l2^=$R_G$ and \SI{1}{M\ohm}] (in |- GND) node[ground]{};
+    \draw (in) to[C, l_=$C_2$,*-o] ++(-1.5,0) node[left](vi1){$v_i=v_{i1}$};
+    \draw (Q1.D) to[R, l2_=$R_D$ and \SI{10}{k\ohm}] ++(0,3) node[vcc](VCC){$V_{CC}=\SI{10}{V}$};
+    \draw (Q1.D) to[short, -o] ++(1,0) node[right](vo1){$v_{o1}$};
+    %
+    \path (vo1) -- ++(3,0) \coord(bjt);
+    %
+    \draw (bjt) node[npn, ](Q2){};
+    \draw (Q2.center) node[right]{\killdepth{Q2}};
+    \draw (Q2.B) to[short, -o] ++(-0.5,0) node[left](vi2){$v_{12}$};
+    \draw (Q2.E) to[R,l2^=$R_E$ and \SI{9.3}{k\ohm}] (Q2.E |- VEE) node[vee]{};
+    \draw (Q2.E) to[short, -o] ++(1,0) node[right](vo2){$v_{o2}$};
+    \draw (Q2.C) to[short] (Q2.C |- VCC) node[vcc]{};
+    %
+    \path (vo2) ++(1.5,0) \coord(load);
+    \draw (load) to[C=$C_3$] ++(1,0) \coord(tmp) to[R=$R_L$] (tmp |- GND) node[ground]{};
+    \draw [densely dashed] (vo2) -- (load);
+    %
+    \draw [densely dashed] (vo1) -- (vi2);
+    %
+    \draw [blockdef](vi1|-VEE) ++(0,-2) \coord(tmp)
+          -- node[midway, fill=white]{bloque 1} (vo1|- tmp);
+          \draw [blockdef] (vi2|-VEE) ++(0,-2) \coord(tmp)
+          -- node[midway, fill=white]{bloque 2} (vo2|- tmp);
+
+\end{circuitikz}
+
+
+\endgroup
+
+
+
 \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.
 
-\subsubsection*{Drawing normal components}
-Normal components (monopoles, multipoles) can be drawn at a specified point with this syntax, where \verb!#1! is the name of the component:
-\begin{verbatim}
-\begin{center}\begin{circuitikz} \draw 
-   (0,0) node[#1,#2] (#3) {#4}
-; \end{circuitikz} \end{center}
-\end{verbatim}
+Components in \Circuitikz{} come in two forms: a path-style form, to be used in \texttt{to} path specifications, and node-style, which will be instantiated by a \texttt{node} specification.
+
+\subsection{Path-style components}
+
+The path-style components are used as in the following way:
+\begin{lstlisting}
+    \begin{circuitikz}
+    \draw (0,0) to[#1=#2, #options] (2,0);
+    \end{circuitikz}
+\end{lstlisting}
+where \verb|#1| is the name of the component, \verb|#2| is an (optional) label, and \verb|options| are optional labels, annotations, style specifier that will be explained in the rest of the manual.
+
+Transistors and some other node-style components can also be placed using the syntax for bipoles. See section~\ref{sec:transasbip}.
+
+Most path-style components can be used as a node-style components; to access them, you add a \texttt{shape} to the main name of component (for example, \texttt{diodeshape}). Such a ``node name'' is specified in the description of each component.
+
+\subsubsection{Anchors}
+
+Normally, path-style component do not need anchors, although they have them just in case you need them. You have the basic ``geographical'' anchors (bipoles are defined horizontally and then rotate as needed):
+\begin{center}
+    \begin{circuitikz}[
+        ]
+        \draw (0,0) to[resistor, name=R] ++(2,0);
+        \path (R.center) \showcoord(center)<-90:0.3>;
+        \path (R.left) \showcoord(left)<135:0.3>;
+        \path (R.right) \showcoord(right)<45:0.3>;
+        \draw (5,0) to[resistor, name=R] ++(2,0);
+        \foreach \n/\a/\d in {north/90/0.3, north east/45/0.3, east/0/0.5,
+            south east/-45/0.3, south/-90/0.3, south west/-135/0.3,
+        west/180/0.5, north west/135/0.3}
+        \path (R.\n) \showcoord(\n)<\a:\d>;
+        \draw (10,-1) to[resistor, name=R] ++(0,2);
+        \foreach \n/\a/\d in {n/135/0.3, e/45/0.3,
+        s/-45/0.3, w/-135/0.3}
+        \path (R.\n) \showcoord(\n)<\a:\d>;
+    \end{circuitikz}
+\end{center}
+In the case of bipoles, also shortened geographical anchors exists. In the description, it will be shown when a bipole has additional anchors. To use the anchors, just give a name to the bipole element.
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+    \draw (0,0) to[potentiometer, name=P, mirror] ++(0,2);
+    \draw (P.wiper) to[L] ++(2,0);
+\end{circuitikz}
+\end{LTXexample}
+
+Alternatively, that you can use the shape form, and then use the \texttt{left} and \texttt{right} anchors to do your connections.
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+    \draw (0,0) node[potentiometershape, rotate=-90](P){};
+    \draw (P.wiper) to[L] ++(2,0);
+\end{circuitikz}
+\end{LTXexample}
+
+\subsubsection{Customization}
+\label{sec:components-size}
+
+
+Pretty much all Circui\TikZ\ relies heavily on \texttt{pgfkeys} for value handling and configuration. Indeed, at the beginning of \texttt{circuitikz.sty} and in the file \texttt{pfgcirc.define.tex}  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{Components size}
+Perhaps the most important parameter is \texttt{bipoles/length}  (default \SI{1.4}{cm}), which
+can be interpreted as the length of a resistor (including reasonable connections): all other lengths 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}
+
+\paragraph{Thickness of the lines} (globally)
+
+You can change the thickness of the components lines with the parameter \texttt{bipoles/thickness} (default 2). The number is relative to the thickness of the normal lines leading to the component.
+
+\begin{LTXexample}[varwidth=true]
+    \ctikzset{bipoles/thickness=1}
+    \tikz \draw (0,0) to[C=1<\farad>] (2,0); \par
+    \ctikzset{bipoles/thickness=4}
+    \tikz \draw (0,0) to[C=1<\farad>] (2,0);
+\end{LTXexample}
+
+\paragraph{Shape of the components} (on a per-component-class basis)
+
+The shape of the components are adjustable with a lot of parameters; in this manual we will comment the main ones, but you can look into the source files specified above to find more.
+\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}
+
+
+\subsubsection{Descriptions}
+
+The typical entry in the component list will be like this:
+
+\begin{groupdesc}
+    \circuitdescbip{resistor}{resistor, american style}{R, american resistor}
+    \circuitdescbip[potentiometer]{pR}{potentiometer, american style}{pR, american potentiometer}( wiper/0/0.3 )
+\end{groupdesc}
+
+where you have all the needed information about the bipole, with also no-standard anchors. If the component can be filled it will be specified in the description. In addition, as an example, the component shown will be filled with the option \texttt{fill=cyan!30!white}:
+
+\begin{groupdesc}
+    \circuitdescbip*{ammeter}{Ammeter}{}
+\end{groupdesc}
+
+\subsection{Node-style components}
+Node-style components (monopoles, multipoles) can be drawn at a specified point with this syntax, where \verb!#1! is the name of the component:
+\begin{lstlisting}
+\begin{circuitikz}
+    \draw (0,0) node[#1,#2] (#3) {#4};
+\end{circuitikz}
+\end{lstlisting}
 \noindent
 Explanation of the parameters:\\
 \texttt{\#1}: component name\footnote{For using bipoles as nodes, the name of the node is \texttt{\#1shape}.} (mandatory)\\
@@ -254,211 +752,430 @@
 \texttt{\#3}: name of an anchor (optional)\\
 \texttt{\#4}: text written to the text anchor of the component (optional)\\
 
+Most path-style components can be used as a node-style components; to access them, you add a \texttt{shape} to the main name of component (for example, \texttt{diodeshape}). Such a ``node name'' is specified in the description of each component.
+
 \begin{framed}
-	\noindent \textbf{Note for \TikZ\ newbies:}	Nodes must have curly brackets at the end, even when empty. An optional anchor (\texttt{\#3}) can be defined within round brackets to be addressed again later on. And please don't forget the semicolon to terminate the \texttt{\textbackslash draw} command.
+	\noindent \textbf{Notice:}	Nodes must have curly brackets at the end, even when empty. An optional anchor (\texttt{\#3}) can be defined within round brackets to be addressed again later on. And please don't forget the semicolon to terminate the \texttt{\textbackslash draw} command.
 \end{framed}
 
-\subsubsection*{Drawing bipoles/two-ports}
-Bipoles/Two-ports (plus some special components) can be drawn between two points using the following command:
+\begin{framed}
+	\noindent\textbf{Also notice:} 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.
 
-\begin{verbatim}
-\begin{center}\begin{circuitikz} \draw 
-   (0,0) to[#1,#2] (2,0)
-; \end{circuitikz} \end{center}
-\end{verbatim}
-\noindent
-Explanation of the parameters:\\
-\texttt{\#1}: component name (mandatory)\\
-\texttt{\#2}: list of comma separated options (optional)\\
-\noindent
-Transistors and some other components can also be placed 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 the environment \verb!tikzpicture!: everything will work there just fine.
+	\noindent Which is ok: just use the environment \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{tground}{Thicker 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/VDD}{}
-	\circuititem{vee}{VEE/VSS}{}
-	\circuititem{match}{match}{}
-	%\circuititem{oscillator}{LO\footnote{These last three come from Stefan Erhardt's contribution of block diagram components}}{}
-\end{itemize}
+\subsubsection{Mirroring and flipping}
 
+Mirroring and flipping of node components is obtained by using the \TikZ\ keys \texttt{xscale} and \texttt{yscale}. Notice that this parameters affect also text labels, so they need to be un-scaled by hand.
 
-\subsection{Bipoles}
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+    \draw (0,2)
+        node[rground, yscale=-1] {%
+        \scalebox{1}[-1]{ GND}}
+        to[R=$R_1$] (0,0)
+        node[sground] {};
+\end{circuitikz}
+\end{LTXexample}
 
-\subsubsection{Instruments}
-\begin{itemize}
-	\circuititembip{ammeter}{Ammeter}{}
-	\circuititembip{voltmeter}{Voltmeter}{}
-	\circuititembip{ohmmeter}{Ohmmeter}{}
-\end{itemize}	
+\subsubsection{Anchors}
 
-\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}	
+Node components anchors are variable across the various kind of components, so they will described better after each category is presented in the manual.
 
-\subsubsection{Resistors and the like}
+\subsubsection{Descriptions}
 
-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}
+The typical entry in the component list will be like this:
+\begin{groupdesc}
+    \circuitdesc{cute spdt down arrow}{Cute spdt down with arrow}{}
+    \circuitdesc{npn}{\scshape npn}{}( B/180/0.2,C/0/0.2,E/0/0.2 )
+\end{groupdesc}
 
+All the shapes defined by Circui\TikZ. These are all \texttt{pgf} nodes, so they are usable in both \texttt{pgf} and \TikZ.
+If the component can be filled it will be specified in the description. In addition, as an example, the component shown will be filled with the option \texttt{fill=cyan!30!white}:
+
+\begin{groupdesc}
+    \circuitdesc*{plain amp}{Plain amplifier}{}( out/45/0.3 )
+\end{groupdesc}
+
+\subsection{Grounds and supply voltages}
+
+For the grounds, the \texttt{center} anchor is put on the connecting point of the symbol, so that you can use them directly in a \texttt{path} specification.
+
+\begin{groupdesc}
+    \circuitdesc{ground}{Ground}{}( center/0/0.3 )
+    \circuitdesc{rground}{Reference ground}{}
+    \circuitdesc*{sground}{Signal ground}{}
+    \circuitdesc{tground}{Thicker ground}{}
+    \circuitdesc{nground}{Noiseless ground}{}
+    \circuitdesc{pground}{Protective ground}{}
+    \circuitdesc{cground}{Chassis ground\footnotemark}{}
+    \footnotetext{These last three were contributed by Luigi «Liverpool»)}
+    \circuitdesc{eground}{European style ground}{}
+    \circuitdesc{eground2}{European style ground, version 2\footnotemark}{}
+    \footnotetext{These last two were contributed by \texttt{@fotesan})}
+    \circuitdesc{vcc}{VCC/VDD}{}
+    \circuitdesc{vee}{VEE/VSS}{}
+\end{groupdesc}
+
+\subsubsection{Grounds anchors}
+
+Anchors for grounds are a bit strange, given that they have the \texttt{center} spot at the same location than \texttt{north} and all the ground will develop ``going down'':
+
+\showanchors[baseline]{ground, scale=2}{}(north/90/0.4, north east/45/0.4, east/0/0.4, south east/-45/0.4,
+    south/-90/0.4, south west/-135/0.4, west/180/0.4, north west/135/0.4)
+\showanchors[baseline]{ground, scale=2}{}(left/135/0.2, right/45/0.2, center/-180/0.2)
+
+
+
+\subsection{Instruments}
+\begin{groupdesc}
+    \circuitdescbip*{ammeter}{Ammeter}{}
+    \circuitdescbip*{voltmeter}{Voltmeter}{}
+    \circuitdescbip*{ohmmeter}{Ohmmeter}{}
+    \circuitdescbip*{rmeter}{Round meter (use \texttt{t=...} for the symbol)}{}(left/135/0.2, right/45/0.2, center/-90/0.3)
+    \circuitdescbip*{rmeterwa}{Round meter with arrow (use \texttt{t=...} for the symbol)}{}(left/135/0.2, right/45/0.2, center/-90/0.3)
+    \circuitdescbip*{smeter}{Square meter (use \texttt{t=...} for the symbol)}{}(left/135/0.2, right/45/0.2, center/-90/0.3, in 1/-135/.5, in 2/-45/.5)
+    \circuitdescbip*{qiprobe}{QUCS-style current probe}{}(left/135/0.2, right/45/0.2, center/-90/0.3)
+    \circuitdescbip*{qvprobe}{QUCS-style voltage probe}{}(left/135/0.2, right/45/0.2, center/-90/0.3)
+    \circuitdescbip*{qpprobe}{QUCS-style power probe}{}(left/135/0.2, right/45/0.2, center/-90/0.3, v+/-135/.5, v-/-45/.5)
+    \circuitdescbip*[oscope]{oscope}{Oscilloscope\footnotemark}{}(left/135/0.2, right/45/0.2,
+    in 1/-135/0.4, in 2/-45/0.4)
+    \footnotetext{Suggested by \texttt{@nobrl} on GitHub}
+    \circuitdescbip{iloop}{Current loop (symbolic)}{}(left/135/0.2, right/45/0.2, center/-90/0.3, i/30/0.4)
+    \circuitdescbip{iloop2}{Current loop (real)}{}(left/135/0.2, right/-45/0.2, center/-90/0.3, i+/135/0.4, i-/45/0.4)
+\end{groupdesc}
+
+\subsubsection{Rotation-invariant elements}
+
+The \texttt{oscope} element will not rotate the ``graph'' shown with the component:
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+    \foreach \a in {0,45,...,350} {
+        \draw (0,0) to[oscope] (\a:3);
+    }
+\end{circuitikz}
+\end{LTXexample}
+
+The \texttt{rmeter}, \texttt{rmaterwa}, and \texttt{smeter} have the same behavior.
+
+\subsubsection{Instruments as node elements}
+
+The node-style usage of the \texttt{oscope} is also interesting, using the additional \texttt{in 1} and \texttt{in 2} anchors; notice that in this case you can use the text content of the node to put labels above it.
+Moreover, you can change the size of the oscilloscope by changing \texttt{bipoles/oscope/width} and \texttt{bipoles/oscope/height} keys (which both default at 0.6).
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+    \draw (0,1)
+        to[oscope=$C_1$, fill=green!20!gray, name=O1] ++(2,0);
+    \path (O1.right)
+        node[ground, scale=0.5, below right=4pt]{};
+    \ctikzset{bipoles/oscope/width=1.0}
+    \draw (1,-1)
+        node[oscopeshape, fill=yellow!20!orange](O2){$C_2$};
+    \draw (O2.in 2) to[short, *-] ++(0,-0.5) node[ground]{};
+    \draw (O2.in 1) to[short, *-] ++(0,-0.5)
+           -- ++(-1,0) node[currarrow, xscale=-1]{};
+\end{circuitikz}
+\end{LTXexample}
+
+\subsubsection{Measuring voltage and currents, multiple ways}
+
+This is the classical (legacy) option, with the \texttt{voltmeter} and \texttt{ammeter}. The problem is that elements are intrinsically horizontal and so they looks funny if put in vertical way.
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+    \draw (0,0) -- ++(1,0) to[R] ++(2,0)
+    to [ammeter] ++(0,-2) node[ground]{};
+    \draw (1,0) to[voltmeter] ++(0,-2)
+    node[ground]{};
+\end{circuitikz}
+\end{LTXexample}
+
+So the solution is often changing the structure to keep the meters in horizontal position.
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+    \draw (0,0) -- ++(1,0) to[R] ++(2,0)
+    to [ammeter] ++(2,0) --
+    ++(0,-1) node[ground]{};
+    \draw (1,0) -- (1,1) to[voltmeter]
+    ++(2,0) node[ground]{};
+\end{circuitikz}
+\end{LTXexample}
+
+Since version 0.9.0 you have more options for the measuring instruments. You can use the generic \texttt{rmeterwa} (round meter with arrow), to which you can specify the internal symbol with the option \texttt{t=...} (and is fillable).
+
+\begin{LTXexample}[varwidth=true]
+    \begin{circuitikz}[american]
+    \draw (0,0) -- ++(1,0) to[R] ++(2,0)
+    to [rmeterwa, t=A, i=$i$] ++(0,-2) node[ground]{};
+    \draw (1,0) to[rmeterwa, t=V, v=$v$] ++(0,-2)
+    node[ground]{};
+\end{circuitikz}
+\end{LTXexample}
+
+This kind of component will maintain the symbol horizontal whatever the orientation:
+
+\begin{LTXexample}[varwidth=true]
+    \begin{circuitikz}[american]
+    \draw (0,0) -- ++(1,0) to[R] ++(2,0)
+    to [rmeterwa, t=A, i=$i$] ++(2,0) --
+    ++(0,-1) node[ground]{};
+    \draw (1,0) -- (1,1) to[rmeterwa, t=V, v^=$v$]
+    ++(2,0) node[ground]{};
+\end{circuitikz}
+\end{LTXexample}
+
+The plain \texttt{rmeter} is the same, without the measuring arrow:
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[american]
+    \draw (0,0) -- ++(1,0) to[R] ++(2,0)
+    to [rmeter, t=A, i=$i$] ++(0,-2) node[ground]{};
+    \draw (1,0) to[rmeter, t=V, v=$v$] ++(0,-2)
+    node[ground]{};
+\end{circuitikz}
+\end{LTXexample}
+
+
+If you prefer, you have the option to use square meters, to have more visual difference from generators:
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[american]
+    \draw (0,0) -- ++(1,0) to[R] ++(2,0)
+    to [smeter, t=A, i=$i$] ++(0,-2) node[ground]{};
+    \draw (1,0) to[smeter, t=V, v=$v$] ++(0,-2)
+    node[ground]{};
+\end{circuitikz}
+\end{LTXexample}
+
+Another possibility is to use the QUCS\footnote{QUCS is an open source circuit simulator: \url{http://qucs.sourceforge.net/}}-styled probes, which have the nice property of explictly showing the type of connection (in series or parallel) of the meter:
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[american]
+    \draw (0,0) -- ++(1,0) to[R] ++(2,0)
+    to [qiprobe, l=$i$] ++(0,-2) node[ground]{};
+    \draw (1,0) to[qvprobe, l=$v$] ++(0,-2)
+    node[ground]{};
+\end{circuitikz}
+\end{LTXexample}
+
+If you want to explicitly show a power measurement, you can use the power probe \texttt{qpprobe} and using the additional anchors \texttt{v+} and \texttt{v-} :
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[american]
+    \draw (0,0) to[short,-*]  ++(1,0) coordinate(b)
+    to[R] ++(2,0) to [qpprobe, l=$i$, a=$v$, name=P]
+    ++(0,-2.5) node[ground](GND){};
+    \draw (P.v-) -| ++(-0.5,-1) coordinate(a)
+    to [short, -*] (a-|GND);
+    \draw (P.v+) -| (b);
+\end{circuitikz}
+\end{LTXexample}
+
+The final possibility is to use oscilloscopes, like for example:
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[american]
+    \draw (0,0) -- ++(1,0) to[R] ++(3,0)
+    to [iloop, mirror, name=I] ++(0,-2)
+    node[ground] (GND){};
+    \draw (1,0) to[oscope, v=$v$] ++(0,-2)
+    node[ground]{};
+    \draw (I.i) -- ++(-0.5,0) node[oscopeshape, anchor=right, name=O]{};
+    \draw (O.south) -- (O.south |- GND) node[ground]{};
+\end{circuitikz}
+\end{LTXexample}
+
+Or, if you want  a more physical structure for the measurement setup:
+
+
+\begin{LTXexample}[varwidth=true, pos=b]
+\begin{circuitikz}[american]
+    \draw (0,0) -- ++(1,0) to[R] ++(3,0) to [iloop2, name=I] ++(0,-2)
+    node[ground] (GND){};
+    \ctikzset{bipoles/oscope/width=1.6}\ctikzset{bipoles/oscope/height=1.2}
+    \node [oscopeshape, fill=green!10](O) at (6,2){};
+    \node [bnc, xscale=-1, anchor=zero](bnc1) at (O.in 1){};
+    \node [bnc, , anchor=zero, rotate=-90](bnc2) at (O.in 2){};
+    \draw [-latexslim] (bnc1.hot) -| (1,0);
+    \draw (bnc2.hot) |- (I.i+);
+    \draw (I.i-) node[ground, scale=0.5]{};
+\end{circuitikz}
+\end{LTXexample}
+
+\subsection{Resistive bipoles}
+
+\begin{groupdesc}
+    \circuitdescbip{short}{Short circuit}{}
+    \circuitdescbip{open}{Open circuit}{}
+    \circuitdescbip*{generic}{Generic (symmetric) bipole}{}
+    \circuitdescbip*{tgeneric}{Tunable generic bipole}{}
+    \circuitdescbip*{ageneric}{Generic asymmetric bipole}{}
+    \circuitdescbip{fullgeneric}{Generic asymmetric bipole (full)}{}
+    \circuitdescbip{tfullgeneric}{Tunable generic  bipole (full)}{}
+    \circuitdescbip*{memristor}{Memristor}{Mr}
+\end{groupdesc}
+
+If \texttt{americanresistors} option is active (or the style \texttt{[american resistors]} is used; this is the default for the package), the resistors are displayed as follows:
+\begin{groupdesc}
+    \ctikzset{resistor=american}
+    \circuitdescbip[resistor]{R}{Resistor}{american resistor}
+    \circuitdescbip[vresistor]{vR}{Variable resistor}{variable american resistor}
+    \circuitdescbip[potentiometer]{pR}{Potentiometer}{american potentiometer}( wiper/0/0.3 )
+    \circuitdescbip[resistivesens]{sR}{Resisitive sensor}{american resisitive sensor}( label/0/0.3 )
+\end{groupdesc}
+
 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}
+\begin{groupdesc}
+    \ctikzset{resistor=european}
+    \circuitdescbip*[generic]{R}{Resistor}{european resistor}
+    \circuitdescbip*[tgeneric]{vR}{Variable resistor}{variable european resistor}
+    \circuitdescbip*[genericpotentiometer]{pR}{Potentiometer}{european potentiometer}( wiper/0/0.3 )
+    \circuitdescbip*[thermistor]{sR}{Resistive sensor}{european resistive sensor}( label/0/0.3 )
+    \ctikzset{resistor=american} % reset default
+\end{groupdesc}
 
 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}
+\begin{groupdesc}
+    \circuitdescbip*{varistor}{Varistor}{}
+    \circuitdescbip*[photoresistor]{phR}{Photoresistor}{photoresistor}
+    \circuitdescbip{thermocouple}{Thermocouple}{}
+    \circuitdescbip*[thermistor]{thR}{Thermistor}{thermistor}
+    \circuitdescbip*[thermistorptc]{thRp}{PTC thermistor}{thermistor ptc}
+    \circuitdescbip*[thermistorntc]{thRn}{NTC thermistor}{thermistor ntc}
+    \circuitdescbip*{fuse}{Fuse}{}
+    \circuitdescbip*{afuse}{Asymmetric fuse}{asymmetric fuse}
+\end{groupdesc}
 
-\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 ZZener diode}{Empty ZZener diode}{zzDo}
-	\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 ZZener diode}{Full ZZener diode}{zzD*}
-	\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*}
-	\circuititembip{stroke diode}{Stroke diode}{D-}
-	\circuititembip{stroke Schottky diode}{Stroke Schottky diode}{sD-}
-	\circuititembip{stroke Zener diode}{Stroke Zener diode}{zD-}
-	\circuititembip{stroke ZZener diode}{Stroke ZZener diode}{zzD-}
-	\circuititembip{stroke tunnel diode}{Stroke tunnel diode}{tD-}
-	\circuititembip{stroke photodiode}{Stroke photodiode}{pD-}
-	\circuititembip{stroke led}{Stroke led}{leD-}
-	\circuititembip{stroke varcap}{Stroke varcap}{VC-}
-	\end{itemize}
+\subsubsection{Generic sensors anchors}
+Generic sensors have an extra label to help positioning the type of dependence, if needed:
 
-\subsubsection{Other tripole-like diodes}\label{sec:othertrip} The following tripoles are entered with the usual command of the form 
-\begin{itemize}
-	\circuititembip{triac}{Standard triac (shape depends on package option)}{Tr}
-	\circuititembip{empty triac}{Empty triac}{Tro}
-	\circuititembip{full triac}{Full triac}{Tr*}
-	\circuititembip{thyristor}{Standard thyristor (shape depends on package option)}{Ty}
-	\circuititembip{empty thyristor}{Empty thyristor}{Tyo}
-	\circuititembip{full thyristor}{Full thyristor}{Ty*}
-	\circuititembip{stroke thyristor}{Stroke thyristor}{Ty-}
-\end{itemize}
-See chapter \ref{bipole-naming} for information how access the third connector
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+   \draw (0,2) to[sR, l=$R$, name=mySR] ++(3,0);
+   \node [font=\tiny, right] at(mySR.label) {-t\si{\degree}};
+   \draw (0,0) to[sL, l=$L$, name=mySL] ++(3,0);
+   \node [draw, circle, inner sep=2pt] at(mySL.label) {};
+\end{circuitikz}
+\end{LTXexample}
 
-\begin{framed}
-The package options \texttt{fulldiode}, \texttt{strokediode}, and \texttt{emptydiode} (and the styles \texttt{[full diodes]}, \texttt{[stroke diodes]}, and \texttt{[empty diodes]}) define which shape will be used by abbreviated commands such that \texttt{D}, \texttt{sD}, \texttt{zD}, \texttt{zzD}, \texttt{tD}, \texttt{pD}, \texttt{leD}, \texttt{VC}, \texttt{Ty},\texttt{Tr}(no stroke symbol available!).
-\end{framed}
+The anchor is positioned just on the corner of the segmented line crossing the component.
 
+\subsection{Diodes and such}
+\begin{groupdesc}
+    \circuitdescbip*[emptydiode] {empty diode}{Empty diode}{Do}
+    \circuitdescbip*[emptysdiode]{empty Schottky diode}{Empty Schottky diode}{sDo}
+    \circuitdescbip*[emptyzdiode]{empty Zener diode}{Empty Zener diode}{zDo}
+    \circuitdescbip*[emptyzzdiode]{empty ZZener diode}{Empty ZZener diode}{zzDo}
+    \circuitdescbip*[emptytdiode]{empty tunnel diode}{Empty tunnel diode}{tDo}
+    \circuitdescbip*[emptypdiode]{empty photodiode}{Empty photodiode}{pDo}
+    \circuitdescbip*[emptylediode]{empty led}{Empty led}{leDo}
+    \circuitdescbip*[emptyvarcap]{empty varcap}{Empty varcap}{VCo}
+    \circuitdescbip*[emptybidirectionaldiode]{empty bidirectionaldiode}{Empty bidirectionaldiode}{biDo}
+    \circuitdescbip[fulldiode] {full diode}{Full diode}{D*}
+    \circuitdescbip[fullsdiode]{full Schottky diode}{Full Schottky diode}{sD*}
+    \circuitdescbip[fullzdiode]{full Zener diode}{Full Zener diode}{zD*}
+    \circuitdescbip[fullzzdiode]{full ZZener diode}{Full ZZener diode}{zzD*}
+    \circuitdescbip[fulltdiode]{full tunnel diode}{Full tunnel diode}{tD*}
+    \circuitdescbip[fullpdiode]{full photodiode}{Full photodiode}{pD*}
+    \circuitdescbip[fulllediode]{full led}{Full led}{leD*}
+    \circuitdescbip[fullvarcap]{full varcap}{Full varcap}{VC*}
+    \circuitdescbip[fullbidirectionaldiode]{full bidirectionaldiode}{Full bidirectionaldiode}{biD*}
+\end{groupdesc}
 
-\begin{itemize}
-	\circuititembip{squid}{Squid}{}
-	\circuititembip{barrier}{Barrier}{}
-\end{itemize}
+These shapes have no exact node-style counterpart, because the stroke line is built upon the empty variants:
 
-\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{groupdesc}
+    \circuitdescbip*[emptydiode] {stroke diode}{Stroke diode}{D-}
+    \circuitdescbip*[emptysdiode]{stroke Schottky diode}{Stroke Schottky diode}{sD-}
+    \circuitdescbip*[emptyzdiode]{stroke Zener diode}{Stroke Zener diode}{zD-}
+    \circuitdescbip*[emptyzzdiode]{stroke ZZener diode}{Stroke ZZener diode}{zzD-}
+    \circuitdescbip*[emptytdiode]{stroke tunnel diode}{Stroke tunnel diode}{tD-}
+    \circuitdescbip*[emptypdiode]{stroke photodiode}{Stroke photodiode}{pD-}
+    \circuitdescbip*[emptylediode]{stroke led}{Stroke led}{leD-}
+    \circuitdescbip*[emptyvarcap]{stroke varcap}{Stroke varcap}{VC-}
+\end{groupdesc}
 
+\subsection{Tripole-like diodes}\label{sec:othertrip} The following tripoles are entered with the usual command, of the form
+\begin{groupdesc}
+    \circuitdescbip*[emptytriac]{triac}{Standard triac (shape depends on package option)}{Tr}( G/0/0.3 )
+    \circuitdescbip*[emptytriac]{empty triac}{Empty triac}{Tro}( gate/0/0.3 )
+    \circuitdescbip[fulltriac]{full triac}{Full triac}{Tr*}
+    \circuitdescbip*[emptythyristor]{thyristor}{Standard thyristor (shape depends on package option)}{Ty}
+    \circuitdescbip*[emptythyristor]{empty thyristor}{Empty thyristor}{Tyo}
+    \circuitdescbip[fullthyristor]{full thyristor}{Full thyristor}{Ty*}
+    \circuitdescbip*[emptythyristor]{stroke thyristor}{Stroke thyristor}{Ty-}
+\end{groupdesc}
+
+\subsubsection{Triacs anchors}
+
+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:
+\label{bipole-naming}
+\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}
+
+
 \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.
+The package options \texttt{fulldiode}, \texttt{strokediode}, and \texttt{emptydiode} (and the styles \texttt{[full diodes]}, \texttt{[stroke diodes]}, and \texttt{[empty diodes]}) define which shape will be used by abbreviated commands such that \texttt{D}, \texttt{sD}, \texttt{zD}, \texttt{zzD}, \texttt{tD}, \texttt{pD}, \texttt{leD}, \texttt{VC}, \texttt{Ty},\texttt{Tr} (no stroke symbol available!).
 \end{framed}
 
-\subsubsection{Basic dynamical bipoles}
-\begin{itemize}
-	\circuititembip{capacitor}{Capacitor}{C}
-	\circuititembip{polar capacitor}{Polar capacitor}{pC}
-	\circuititembip{ecapacitor}{Electrolytic capacitor}{eC,elko}
-	\circuititembip{variable capacitor}{Variable capacitor}{vC}
-	\circuititembip{piezoelectric}{Piezoelectric Element}{PZ}
-\end{itemize}	
 
+\subsection{Basic dynamical bipoles}
+\begin{groupdesc}
+    \circuitdescbip{capacitor}{Capacitor}{C}
+    \circuitdescbip[polarcapacitor]{polar capacitor}{Polar capacitor}{pC}
+    \circuitdescbip*{ecapacitor}{Electrolytic capacitor}{eC,elko}
+    \circuitdescbip[vcapacitor]{variable capacitor}{Variable capacitor}{vC}
+    \circuitdescbip[capacitivesens]{capacitive sensor}{Capacitive sensor}{sC}( label/0/0.3 )
+    \circuitdescbip*{piezoelectric}{Piezoelectric Element}{PZ}
+\end{groupdesc}
+
 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}
+\begin{groupdesc}
+    \ctikzset{inductor=cute}
+    \circuitdescbip[cuteinductor]{L}{Inductor}{cute inductor}
+    \circuitdescbip[cutechoke]{cute choke}{Choke}{}
+    \circuitdescbip[vcuteinductor]{vL}{Variable inductor}{variable cute inductor}
+    \circuitdescbip[scuteinductor]{sL}{Inductive sensor}{cute inductive sensor}( label/0/0.3 )
+\end{groupdesc}
 
 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}
+\begin{groupdesc}
+    \ctikzset{inductor=american}
+    \circuitdescbip[americaninductor]{L}{Inductor}{american inductor}
+    \circuitdescbip[vamericaninductor]{vL}{Variable inductor}{variable american inductor}
+    \circuitdescbip[samericaninductor]{sL}{Inductive sensor}{american inductive sensor}( label/0/0.3 )
+\end{groupdesc}
 
 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}
+\begin{groupdesc}
+    \ctikzset{inductor=european}
+    \circuitdescbip[fullgeneric]{L}{Inductor}{european inductor}
+    \circuitdescbip[tfullgeneric]{vL}{Variable inductor}{variable european inductor}
+    \circuitdescbip[sfullgeneric]{sL}{Inductive sensor}{european inductive sensor}( label/0/0.3 )
+    \ctikzset{inductor=cute} % back to default
+\end{groupdesc}
 
-There is also a transmission line: 
-\begin{itemize}
-\circuititembip{TL}{Transmission line}{transmission line, tline}
-\end{itemize}
 
-\subsubsection{Stationary sources}
-\begin{itemize}
-	\circuititembip{battery}{Battery}{}
-	\circuititembip{battery1}{Single battery cell}{}
-	\circuititembip{battery2}{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}
+\subsection{Stationary sources}
+\begin{groupdesc}
+    \circuitdescbip{battery}{Battery}{}
+    \circuitdescbip{battery1}{Single battery cell}{}
+    \circuitdescbip{battery2}{Single battery cell}{}
+    \circuitdescbip*[vsource]{european voltage source}{Voltage source (european style)}{}
+    \circuitdescbip*[vsourceC]{cute european voltage source}{Voltage source (cute european style)}{vsourceC, ceV}
+    \circuitdescbip*[vsourceAM]{american voltage source}{Voltage source (american style)}{}
+    \circuitdescbip*[isource]{european current source}{Current source (european style)}{}
+    \circuitdescbip*[isourceC]{cute european current source}{Current source (cute european style)}{isourceC, ceI}
+    \circuitdescbip*[isourceAM]{american current source}{Current source (american style)}{}
+\end{groupdesc}
 
 \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}.
@@ -467,121 +1184,347 @@
 \end{framed}
 
 
-\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}
+\subsection{Sinusoidal sources} Here because I was asked for them. But how do you distinguish one from the other?!
+\begin{groupdesc}
+    \circuitdescbip*[vsourcesin]{sinusoidal voltage source}{Sinusoidal voltage source}{vsourcesin, sV}
+    \circuitdescbip*[isourcesin]{sinusoidal current source}{Sinusoidal current source}{isourcesin, sI}
+\end{groupdesc}
 
-\subsubsection{Special sources}
-\begin{itemize}
-	\circuititembip{square voltage source}{Square voltage source}{vsourcesquare, sqV}
-	\circuititembip{vsourcetri}{Triangle voltage source}{tV}
-	\circuititembip{esource}{Empty voltage source}{}
-	\circuititembip{pvsource}{Photovoltaic-voltage source}{}
-	\circuititembip{ioosource}{Double Zero style current source}{}
-	\circuititembip{voosource}{Double Zero style voltage source}{}
-\end{itemize}
+\subsection{Controlled sources}
+\begin{groupdesc}
+    \circuitdescbip*[cvsource]{european controlled voltage source}{Controlled voltage source (european style)}{}
+    \circuitdescbip*[cvsourceC]{cute european controlled voltage source}{Voltage source (cute european style)}{cvsourceC, cceV}
+    \circuitdescbip*[cvsourceAM]{american controlled voltage source}{Controlled voltage source (american style)}{}
+    \circuitdescbip*[cisource]{european controlled current source}{Controlled current source (european style)}{}
+    \circuitdescbip*[cisourceC]{cute european controlled current source}{Current source (cute european style)}{cisourceC, cceI}
+    \circuitdescbip*[cisourceAM]{american controlled current source}{Controlled current source (american style)}{}
+\end{groupdesc}
 
-\subsubsection{DC sources}
-\begin{itemize}
-	\circuititembip{dcvsource}{DC voltage source}{}
-	\circuititembip{dcisource}{DC current source}{}
-\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}.
 
-\subsubsection{Mechanical Analogy}
-\begin{itemize}
-	\circuititembip{damper}{Mechanical Damping}{}
-	\circuititembip{spring}{Mechanical Stiffness}{}
-	\circuititembip{mass}{Mechanical Mass}{}	
-\end{itemize}
+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}
 
-\subsubsection{Switch}
-\begin{itemize}
-	\circuititembip{switch}{Switch}{spst}
-	\circuititembip{closing switch}{Closing switch}{cspst}
-	\circuititembip{opening switch}{Opening switch}{ospst}
-	\circuititembip{normal open switch}{Normally open switch}{nos}
-	\circuititembip{normal closed switch}{Normally closed switch}{ncs}
-	\circuititembip{push button}{Push button}{}
-\end{itemize}	
+\begin{groupdesc}
+    \circuitdescbip*[cvsourcesin]{controlled sinusoidal voltage source}{Controlled sinusoidal voltage source}{controlled vsourcesin, cvsourcesin, csV}
+    \circuitdescbip*[cisourcesin]{controlled sinusoidal current source}{Controlled sinusoidal current source}{controlled isourcesin, cisourcesin, csI}
+\end{groupdesc}
 
-\subsubsection{Block diagram 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{bandstop}{bandstop}{}
-	\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{Noise sources}
 
+In this case, the ``direction''  of the source has no sense. Noise sources are filled in gray by default, but if you choose the dashed style, they become fillable.
 
-\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{groupdesc}
+    \circuitdescbip[vsourceN]{noise voltage source}{Sinusoidal voltage source}{vsourceN, nV}
+    \circuitdescbip[isourceN]{noise current source}{Sinusoidal current source}{isourceN, nI}
+\end{groupdesc}
 
+You can change the fill color with the key \texttt{circuitikz/bipoles/noise sources/fillcolor}:
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+    \draw(0,0) to [nV, l=$e_n$] ++(2,0);
+    \draw(0,-2) to [nI, l=$i_n$] ++(2,0);
+    \begin{scope}[circuitikz/bipoles/noise sources/fillcolor=red!50]
+        \draw(3,0) to [nV, l=$e_n$] ++(2,0);
+        \draw(3,-2) to [nI, l=$i_n$] ++(2,0);
+    \end{scope}
+\end{circuitikz}
+\end{LTXexample}
+
+If you prefer a patterned noise generator (similar to the one you draw by hand) you can use the fake color \texttt{dashed}:
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+    \draw(0,0) to [nV, l=$e_n$] ++(2,0);
+    \draw(0,-2) to [nI, l=$i_n$] ++(2,0);
+    \begin{scope}[circuitikz/bipoles/noise sources/fillcolor=dashed]
+        \draw(3,0) to [nV, l=$e_n$] ++(2,0);
+        \draw(3,-2) to [nI, l=$i_n$] ++(2,0);
+    \end{scope}
+\end{circuitikz}
+\end{LTXexample}
+
+Notice that if you choose the dashed style, the noise sources are fillable:
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+    \ctikzset{bipoles/noise sources/fillcolor=dashed}
+    \draw(0,0) to [nV, l=$e_n$] ++(2,0);
+    \draw(0,-2) to [nI, l=$i_n$] ++(2,0);
+    \begin{scope}
+        \draw(3,0) to [nV, l=$e_n$, fill=yellow!50!red] ++(2,0);
+        \draw(3,-2) to [nI, l=$i_n$, fill=blue!50!white] ++(2,0);
+    \end{scope}
+\end{circuitikz}
+\end{LTXexample}
+
+\subsection{Special sources}
+\begin{groupdesc}
+    \circuitdescbip*[vsourcesquare]{square voltage source}{Square voltage source}{vsourcesquare, sqV}
+    \circuitdescbip*{vsourcetri}{Triangle voltage source}{tV}
+    \circuitdescbip*{esource}{Empty voltage source}{}
+    \circuitdescbip*{pvsource}{Photovoltaic-voltage source}{}
+    \circuitdescbip*[oosource]{ioosource}{Double Zero style current source}{}
+    \circuitdescbip*[oosource]{voosource}{Double Zero style voltage source}{}
+\end{groupdesc}
+
+\subsection{DC sources}
+\begin{groupdesc}
+    \circuitdescbip*{dcvsource}{DC voltage source}{}
+    \circuitdescbip*{dcisource}{DC current source}{}
+\end{groupdesc}
+
+\subsection{Mechanical Analogy}
+\begin{groupdesc}
+    \circuitdescbip*{damper}{Mechanical Damping}{}
+    \circuitdescbip{spring}{Mechanical Stiffness}{}
+    \circuitdescbip*{viscoe}{Mechanical viscoelastic element\footnotemark}{}(left/135/0.2, right/45/0.2, center/-90/0.3)
+    \footnotetext{Suggested by @Alex in \url{https://tex.stackexchange.com/q/484268/38080}}
+    \circuitdescbip*{mass}{Mechanical Mass}{}
+\end{groupdesc}
+
+\subsection{Other bipoles}
+
+Here you'll find bipoles that are not easily grouped in the categories above.
+
+\begin{groupdesc}
+    \circuitdescbip{squid}{Squid}{}
+    \circuitdescbip{barrier}{Barrier}{}
+\end{groupdesc}
+
+\begin{groupdesc}
+    \circuitdescbip*{european gas filled surge arrester}{European gas filled surge arrester}{}
+    \circuitdescbip*{american gas filled surge arrester}{American gas filled surge arrester}{}
+\end{groupdesc}
+
 \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}.
+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.
 
-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}.
+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}
 
-\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{groupdesc}
+    \circuitdescbip*{lamp}{Lamp}{}
+    \circuitdescbip*{bulb}{Bulb}{}
+    \circuitdescbip*{loudspeaker}{loudspeaker}{}( north/90/0.4, north east/45/0.4, east/0/0.4, south east/-45/0.4,
+    south/-90/0.4, south west/-135/0.4, west/180/0.4, north west/135/0.4,
+    left/135/0.2, right/45/0.2, center/-135/0.2
+    )
+   \circuitdescbip*{mic}{mic}{}( north/90/0.4, north east/45/0.4, east/0/0.4, south east/-45/0.4,
+    south/-90/0.4, south west/-135/0.4, west/180/0.4, north west/135/0.4,
+    left/135/0.2, right/45/0.2, center/-135/0.2
+    )
+\end{groupdesc}
 
-\begin{itemize}
-	\circuititem{nmos}{\scshape nmos}{}
-	\circuititem{pmos}{\scshape pmos}{}
-	\circuititem{npn}{\scshape npn}{}
-	\circuititem{pnp}{\scshape pnp}{}
-	\circuititem{npn,photo}{\scshape npn}{}
-	\circuititem{pnp,photo}{\scshape pnp}{}
-	\circuititem{nigbt}{\scshape nigbt}{}
-	\circuititem{pigbt}{\scshape pigbt}{}
-	\circuititem{Lnigbt}{\scshape Lnigbt}{}
-	\circuititem{Lpigbt}{\scshape Lpigbt}{}
-\end{itemize}
+You can use microphones and loudspeakers with \texttt{waves} (see section~\ref{sec:support}) too:
 
-For all transistors a bodydiode(or freewheeling diode) can automatically be drawn. Just use the global option bodydiode, or for single transistors, the tikz-option bodydiode:
 \begin{LTXexample}[varwidth=true]
+    \begin{circuitikz}
+        \draw (0,0) to[mic, name=M] ++(0,2)
+        to[amp, t=$A$] ++(2,0)
+        to[loudspeaker, name=L] ++(0,-2)
+        to[short, -*] (0,0) node[ground]{};
+        \node [waves, scale=0.7, left=5pt]
+            at(M.north) {};
+        \node [waves, scale=0.7, right]
+            at(L.north) {};
+    \end{circuitikz}
+\end{LTXexample}
+
+
+\subsection{Block diagram components}
+\noindent Contributed by Stefan Erhardt.
+
+\begin{groupdesc}
+    \circuitdesc*{mixer}{\scshape mixer}{}( 1/180/0.1,2/-90/0.1,3/0/0.1,4/90/0.1 )
+    \circuitdesc*{adder}{\scshape adder}{}( west/180/0.1,south/-90/0.1,east/0/0.1,north/90/0.1 )
+    \circuitdesc*{oscillator}{\scshape oscillator}{}
+    \circuitdesc*{circulator}{\scshape circulator}{}
+    \circuitdesc*{wilkinson}{\scshape wilkinson divider}{}( in/180/0.1, out2/45/0.1, out1/-45/0.1 )
+\end{groupdesc}
+
+\begin{groupdesc}
+    \circuitdescbip*{twoport}{generic two port\footnotemark}{}
+    \footnotetext{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); }
+    \circuitdescbip*{vco}{vco}{}
+    \circuitdescbip*{bandpass}{bandpass}{}
+    \circuitdescbip*{bandstop}{bandstop}{}
+    \circuitdescbip*{highpass}{highpass}{}
+    \circuitdescbip*{lowpass}{lowpass}{}
+    \circuitdescbip*{adc}{A/D converter}{}
+    \circuitdescbip*{dac}{D/A converter}{}
+    \circuitdescbip*{dsp}{DSP}{}
+    \circuitdescbip*{fft}{FFT}{}
+    \circuitdescbip*{amp}{amplifier}{}
+    \circuitdescbip*{vamp}{VGA}{}
+    \circuitdescbip*{piattenuator}{$\pi$ attenuator}{}
+    \circuitdescbip*{vpiattenuator}{var. $\pi$ attenuator}{}
+    \circuitdescbip*{tattenuator}{T attenuator}{}
+    \circuitdescbip*{vtattenuator}{var.\ T attenuator}{}
+    \circuitdescbip*{phaseshifter}{phase shifter}{}
+    \circuitdescbip*{vphaseshifter}{var.\ phase shifter}{}
+    \circuitdescbip*{detector}{detector}{}
+\end{groupdesc}
+
+\begin{groupdesc}
+    \circuitdesc{coupler}{Coupler}{}
+    \circuitdesc{coupler2}{Coupler, 2}{}
+\end{groupdesc}
+
+\subsubsection{Blocks anchors}
+
+The ports of the mixer and adder can be addressed with numbers or \texttt{west}/\texttt{south}/\texttt{east}/\texttt{north}:
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz} \draw
+  (0,0) node[mixer] (mix) {}
+  (mix.1) node[left] {1}
+  (mix.2) node[below] {2}
+  (mix.3) node[right] {3}
+  (mix.4) node[above] {4}
+;\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}
+
+The couplers have:
+
+\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}
+
+
+\subsubsection{Blocks customization}
+
+With the option \texttt{>} you can draw an arrow to the input of the block diagram symbols.
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz} \draw
+  (0,0) to[short,o-] ++(0.3,0)
+  to[lowpass,>] ++(2,0)
+  to[adc,>] ++(2,0)
+  to[short,-o] ++(0.3,0);
+\end{circuitikz}
+\end{LTXexample}
+
+
+\paragraph{Multi ports}
+Since inputs and outputs can vary, input arrows can be placed as nodes. Note that you have to rotate the arrow on your own:
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz} \draw
+  (0,0) node[mixer] (m) {}
+  (m.1) to[short,-o] ++(-1,0)
+  (m.2) to[short,-o] ++(0,-1)
+  (m.3) to[short,-o] ++(1,0)
+  (m.1) node[inputarrow] {}
+  (m.2) node[inputarrow,rotate=90] {};
+\end{circuitikz}
+\end{LTXexample}
+
+
+\paragraph{Labels and custom two-port boxes}
+Some two-ports have the option to place a normal label (\texttt{l=}) and a inner label (\texttt{t=}).
+\begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
-   \draw (0,0) node[npn,bodydiode](npn){}++(2,0)node[pnp,bodydiode](npn){};
-   \draw (0,-2) node[nigbt,bodydiode](npn){}++(2,0)node[pigbt,bodydiode](npn){};
-   \draw (0,-4) node[nfet,bodydiode](npn){}++(2,0)node[pfet,bodydiode](npn){};
+  \ctikzset{bipoles/amp/width=0.9}
+  \draw (0,0) to[amp,t=LNA,l_=$F{=}0.9\,$dB,o-o] ++(3,0);
 \end{circuitikz}
-\end{LTXexample}	
+\end{LTXexample}
 
 
+\paragraph{Box option}
+Some devices have the possibility to add a box around them. The inner symbol scales down to fit inside the box.
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz} \draw
+  (0,0) node[mixer,box,anchor=east] (m) {}
+    to[amp,box,>,-o] ++(2.5,0)
+  (m.west) node[inputarrow] {} to[short,-o] ++(-0.8,0)
+  (m.south) node[inputarrow,rotate=90] {} --
+    ++(0,-0.7) node[oscillator,box,anchor=north] {};
+\end{circuitikz}
+\end{LTXexample}
 
 
+\paragraph{Dash optional parts}
+To show that a device is optional, you can dash it. The inner symbol will be kept with solid lines.
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+  \draw (0,0) to[amp,l=\SI{10}{dB}] ++(2.5,0);
+  \draw[dashed] (2.5,0) to[lowpass,l=opt.] ++(2.5,0);
+\end{circuitikz}
+\end{LTXexample}
 
+
+
+\subsection{Transistors}
+
+\begin{groupdesc}
+    \circuitdesc{nmos}{\scshape nmos}{}( G/180/0.2,D/0/0.2,S/0/0.2 )
+    \circuitdesc{pmos}{\scshape pmos}{}
+    \circuitdesc{hemt}{\scshape hemt}{}
+    \circuitdesc{npn}{\scshape npn}{}( B/180/0.2,C/0/0.2,E/0/0.2 )
+    \circuitdesc{pnp}{\scshape pnp}{}
+    \circuitdesc{npn,photo}{\scshape npn}{}( nobase/0/0.4 )
+    \circuitdesc{pnp,photo}{\scshape pnp}{}
+    \circuitdesc{nigbt}{\scshape nigbt}{}
+    \circuitdesc{pigbt}{\scshape pigbt}{}
+    \circuitdesc{Lnigbt}{\scshape Lnigbt}{}
+    \circuitdesc{Lpigbt}{\scshape Lpigbt}{}
+\end{groupdesc}
+
+For all transistors a body diode (or freewheeling diode) can automatically be drawn. Just use the global option bodydiode, or for single transistors, the tikz-option bodydiode:
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+   \draw (0,0) node[npn,bodydiode](npn){}++(2,0)node[pnp,bodydiode](npn){};
+   \draw (0,-2) node[nigbt,bodydiode](npn){}++(2,0)node[pigbt,bodydiode](npn){};
+   \draw (0,-4) node[nfet,bodydiode](npn){}++(2,0)node[pfet,bodydiode](npn){};
+\end{circuitikz}
+\end{LTXexample}
+
 The Base/Gate connection of all transistors can be disable by using the options \textit{nogate} or \textit{nobase}, respectively. The Base/Gate anchors are floating, but there an additional anchor "nogate"/"nobase", which can be used to point to the unconnected base:
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
@@ -591,55 +1534,179 @@
    \draw (npn.B) node[circ]{} node[left]{B};
    \draw[dashed,red,-latex] (1,0.5)--(npn.nobase);
 \end{circuitikz}
-\end{LTXexample}	
+\end{LTXexample}
 
-
-
 If the option \texttt{arrowmos} is used (or after the command \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}
+\begin{groupdesc}
+	\circuitdesc{nmos}{\scshape nmos}{}
+	\circuitdesc{pmos}{\scshape pmos}{}
+\end{groupdesc}
 \ctikzset{tripoles/mos style/no arrows}
+To draw the PMOS circle non-solid, use the option \texttt{emptycircle} or the command
+\\\verb!\ctikzset{tripoles/pmos style/emptycircle}!.
 
-To draw the PMOS circle non-solid, use the option \texttt{emptycircle} or the command \verb!\ctikzset{tripoles/pmos style/emptycircle}!.
-\begin{itemize}
-	\circuititem{pmos,emptycircle}{\scshape pmos}{}
-\end{itemize}
+\begin{groupdesc}
+    \circuitdesc{pmos,emptycircle}{\scshape pmos}{}
+\end{groupdesc}
 
-\textsc{nfet}s and \textsc{pfet}s have been incorporated based on code provided by Clemens Helfmeier and Theodor 
+If you prefer different position of the arrows in transistors and FETs, you can adjust them like this (it works for the other BJT-based transistors, too):
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+    \ctikzset{tripoles/mos style/arrows,
+    tripoles/npn/arrow pos=0.8,
+    tripoles/pnp/arrow pos=0.8,
+    tripoles/nmos/arrow pos=0.8,
+    tripoles/pmos/arrow pos=0.6, }
+   \draw (0,0) node[npn, ](npn){};
+   \draw (2,0) node[pnp, ](npn){};
+   \draw (0,-2) node[nmos, ](npn){};
+   \draw (2,-2) node[pmos, ](npn){};
+\end{circuitikz}
+\end{LTXexample}
+
+\textsc{nfet}s and \textsc{pfet}s have been incorporated based on code provided by Clemens Helfmeier and Theodor
 Borsche. Use the package options \texttt{fetsolderdot}/\texttt{nofetsolderdot} to enable/disable solderdot at some fet-transistors. Additionally, the solderdot option can be enabled/disabled for single transistors with the option "solderdot" and "nosolderdot", respectively.
 
 
-\begin{itemize}
-	\circuititem{nfet}{\scshape nfet}{}
-	\circuititem{nigfete}{\scshape nigfete}{}
-	\circuititem{nigfete,solderdot}{\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}
+\begin{groupdesc}
+    \circuitdesc{nfet}{\scshape nfet}{}
+    \circuitdesc{nigfete}{\scshape nigfete}{}
+    \circuitdesc{nigfete,solderdot}{\scshape nigfete}{}
+    \circuitdesc{nigfetebulk}{\scshape nigfetebulk}{}
+    \circuitdesc{nigfetd}{\scshape nigfetd}{}
+    \circuitdesc{pfet}{\scshape pfet}{}
+    \circuitdesc{pigfete}{\scshape pigfete}{}
+    \circuitdesc{pigfetebulk}{\scshape pigfetebulk}{}
+    \circuitdesc{pigfetd}{\scshape pigfetd}{}
+\end{groupdesc}
 
-\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{njfet} and \textsc{pjfet} have been incorporated based on code provided by Danilo Piazzalunga:
+\begin{groupdesc}
+    \circuitdesc{njfet}{\scshape njfet}{}
+    \circuitdesc{pjfet}{\scshape pjfet}{}
+\end{groupdesc}
 
 \textsc{isfet}
-\begin{itemize}
-	\circuititem{isfet}{\scshape isfet}{}
-\end{itemize}
+\begin{groupdesc}
+    \circuitdesc{isfet}{\scshape isfet}{}
+\end{groupdesc}
 
-\subsubsection{Electronic Tubes}
-\begin{itemize}
-	\circuititem{magnetron}{Magnetron}{}
-\end{itemize}
+\subsubsection{Transistors anchors}
+
+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.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.G) node[anchor=east] {G}
+  (pigfete.D) node[anchor=north] {D}
+  (pigfete.S) node[anchor=south] {S}
+  (pigfete.bulk) node[anchor=west] {Bulk}
+;\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}
+
+Notice that the text labels of transistors are somewhat buggy. It is better to se explicit anchors to set transistor's names.
+
+Similarly, transistors like other components can be reflected vertically:
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz} \draw
+  (0,0) node[pigfete, yscale=-1] (pigfete)  {}
+  (pigfete.bulk) node[anchor=west] {Bulk}
+  (pigfete.G) node[anchor=east] {G}
+  (pigfete.D) node[anchor=south] {D}
+  (pigfete.S) node[anchor=north] {S}
+;\end{circuitikz}
+\end{LTXexample}
+
+\subsubsection{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}).
+
+
+\subsection{Electronic Tubes}
+\begin{groupdesc}
+    \circuitdesc*{magnetron}{Magnetron}{}( anode/-90/0.2, cathode1/135/0.2,
+    cathode2/45/0.2, left/180/0.2, right/0/0.2, top/90/0.4 )
+\end{groupdesc}
+\begin{LTXexample}[varwidth=true]
 	\begin{circuitikz}
 	\draw (0,-2)node[rground](gnd){} to[voltage source,v<={HV}]++(0,3)--++(1,0)to[V,n=DC]++(2,0);
 	\draw (2,-1) node[magnetron,scale=1](magn){};
@@ -646,37 +1713,64 @@
 	\draw (DC.left)++(-0.2,0)to [short,*-] ++(0,-1) to [short] (magn.cathode1);
 	\draw (DC.right)++(0.2,0)to [short,*-] ++(0,-1) to [short] (magn.cathode2);
 	\draw (magn.anode) to [short] (magn.anode|-gnd) node[rground]{};
-	\draw (magn.cathode1)node[above]{$1$}; 
+	\draw (magn.cathode1)node[above]{$1$};
 	\draw (magn.cathode2)node[above]{$2$};
 	\draw[->](magn.east) --++(1,0)node[right]{$RF_{out}$};
 	\end{circuitikz}
-\end{LTXexample}	
+\end{LTXexample}
 
-\subsubsection{Block diagram}
-These come from Stefan Erhardt's contribution of block diagram components. Add a box around them with the option \texttt{box}.
-\begin{itemize}
-	\circuititem{mixer}{\scshape mixer}{}
-	\circuititem{adder}{\scshape adder}{}
-	\circuititem{oscillator}{\scshape oscillator}{}
-	\circuititem{circulator}{\scshape circulator}{}
-	\circuititem{wilkinson}{\scshape wilkinson divider}{}
-	%\circuititem{coupler}{\scshape coupler}{}
-	%\circuititem{coupler2}{\scshape coupler2}{}
-\end{itemize}
+\subsection{RF components}
 
+For the RF components, similarly to the grounds and supply rails, the \texttt{center} anchor is put on the connecting point of the symbol, so that you can use them directly in a \texttt{path} specification.
 
-		
-\subsubsection{Switch}
-\begin{itemize}
-	\circuititem{spdt}{\scshape spdt}{}
-	\circuititembip{toggle switch}{Toggle switch}{}
-\end{itemize}
+Notes that in the transmission and receiving antennas, the ``waves'' are outside the geographical anchors.
 
-\subsubsection{Electro-Mechanical Devices}
-\begin{itemize}
-	\circuititem{elmech}{\scshape Motor}{M}
-	\circuititem{elmech}{\scshape Generator}{G}
-\end{itemize}
+\begin{groupdesc}
+    \circuitdesc*{bareantenna}{Bare Antenna}{A}( top/90/0.1, bottom/180/0.3, left/180/0.3, right/45/0.3, center/0/0.3 )
+    \circuitdesc*{bareTXantenna}{Bare TX Antenna}{Tx}( top/90/0.1, center/180/0.3, waves/90/0.3 )
+    \circuitdesc*{bareRXantenna}{Bare RX Antenna}{Rx}( top/90/0.1, center/0/0.3, waves/90/0.3 )
+    \circuitdescbip*{mstline}{Microstrip transmission line\footnotemark}{}(left/135/0.2, right/45/0.2, center/-90/0.3)
+    \circuitdesc*{mslstub}{Microstrip stub}{text}(left/135/0.2, right/45/0.2, center/-45/0.3)
+    \circuitdesc*{msport}{Microstrip port}{T}(left/135/0.2, right/45/0.2, center/-45/0.3)
+    \circuitdesc*{msrstub}{Microstrip radial stub}{}(left/135/0.2, right/45/0.2, center/-45/0.3)
+    \footnotetext{This four components were suggested by \texttt{@tcpluess} on GitHub}
+    \circuitdesc{antenna}{Antenna}{}( center/0/0.3 )
+    \circuitdesc{rxantenna}{Receiving antenna}{}
+    \circuitdesc{txantenna}{Transmitting antenna}{}
+    \circuitdesc*{tlinestub}{Transmission line stub}{}
+    \circuitdescbip*[tline]{TL}{Transmission line}{transmission line, tline}
+    \circuitdesc{match}{match}{}
+\end{groupdesc}
+
+
+\subsubsection{Microstrip customization}
+
+The microstrip linear components' (\texttt{mstline}, \texttt{mslstub}, \texttt{msport}) heights depend on the parameters \texttt{bipoles/mstline/height} (for the three of them, default 0.3). The widths are specified in \texttt{bipoles/mstline/width} for the first two and by \texttt{monopoles/msport/width} for the port (defaults: 1.2, 0.5).
+
+For the length parameter of the transmission line there is a shortcut in the form of the direct parameter \texttt{mstlinelen}.
+
+\begin{LTXexample}[varwidth=true, pos=t]
+\begin{circuitikz}
+    \draw (0,0) node[msport, right, xscale=-1]{}
+    to[mstline, -o]  ++(3,0) coordinate(there)
+    to[mstline, mstlinelen=2, l=longer, o-*]  ++(4,0)
+        coordinate(here) -- ++(0.5,0) node[mslstub, fill=yellow]{stub}
+        (here) -- ++(0,0.5) node[mslstub, rotate=90, mstlinelen=0.5]{short};
+        \draw (there) to[short, o-]  ++(0, 0.5) node[msrstub]{};
+        \draw (here) -- ++(0, -0.5) node[msrstub, yscale=-1]{};
+\end{circuitikz}
+\end{LTXexample}
+
+
+\subsection{Electro-Mechanical Devices}
+
+The internal part of the motor and generator are, by default, filled white (to avoid compatibility problems with older versions of the package).
+
+\begin{groupdesc}
+    \circuitdesc*{elmech}{Motor}{M}( bottom/-90/0.2,
+    left/180/0.2, right/0/0.2, top/90/0.4 )
+	\circuitdesc*{elmech}{Generator}{G}
+\end{groupdesc}
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
 \draw (2,0) node[elmech](motor){M};
@@ -691,7 +1785,7 @@
 \draw[thick,->>](motor.center)--++(1.5,0)node[midway,above]{$\omega$};
 \end{circuitikz}
 \end{LTXexample}
-The symbols can also be used along a path, using the transistor-path-syntax(T in front of the shape name, see section \ref{sec:transasbip}). Don´t forget to use parameter $n$ to name the node and get acces to the anchors:
+The symbols can also be used along a path, using the transistor-path-syntax(T in front of the shape name, see section \ref{sec:transasbip}). Don´t forget to use parameter $n$ to name the node and get access to the anchors:
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
 \draw (0,0) to [Telmech=M,n=motor] ++(0,-3) to [Telmech=M] ++(3,0) to [Telmech=G,n=generator] ++(0,3) to [R] (0,0);
@@ -704,55 +1798,563 @@
 \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}
+\begin{groupdesc}
+    \ctikzset{inductor=cute}
+    \circuitdesc{transformer}{Transformer (cute inductor)}{}( A1/180/0.1,
+    A2/180/0.1, B1/0/0.1, B2/0/0.1,
+    inner dot A1/-135/0.2, inner dot A2/135/0.2, inner dot B1/-45/0.1,
+    inner dot B2/45/0.1 )
+    \ctikzset{inductor=american}
+    \circuitdesc{transformer}{Transformer (american inductor)}{}( %
+    outer dot A1/180/0.2, outer dot A2/180/0.2,
+    outer dot B1/0/0.2, outer dot B2/0/0.2 )
+    \ctikzset{inductor=european}
+    \circuitdesc{transformer}{Transformer (european inductor)}{}
+    \circuitdesc{gyrator}{Gyrator}{}
+\end{groupdesc}
 
 
 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{groupdesc}
+    \ctikzset{inductor=cute}
+    \circuitdesc{transformer core}{Transformer  core (cute inductor)}{}
+    \ctikzset{inductor=american}
+    \circuitdesc{transformer core}{Transformer core (american inductor)}{}
+    \ctikzset{inductor=european}
+    \circuitdesc{transformer core}{Transformer core (european inductor)}{}
+    \ctikzset{inductor=cute} % reset default
+\end{groupdesc}
 
-\begin{itemize}
-	\circuititem{gyrator}{Gyrator}{}
-	\circuititem{coupler}{Coupler}{}
-	\circuititem{coupler2}{Coupler, 2}{}
-\end{itemize}
 
 
+\subsubsection{Double dipoles anchors}
+
+All the 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, and anchors for setting dots or signs to specify polarity.
+The set of anchors, to which the standard ``geographical'' \texttt{north}, \texttt{north east}, etc. is here:
+
+\begin{quote}
+\begin{circuitikz}[cute inductors,
+    ]
+    \def\coordx(#1)[#2:#3]#4{node[circle, #4, draw, inner sep=1pt,pin={[#4, overlay, inner sep=0.5pt, font=\scriptsize, pin distance=#2cm, pin edge={#4, overlay,}]#3:#1}](#1){}}
+    \foreach \comp/\pos/\case in {%
+                            transformer/0/0%
+                            ,transformer core/4/1%
+                            ,gyrator/8/2%
+                            }{
+        \draw (\pos, 0) node[\comp](T){};
+        \ifcase\case
+            \foreach \a/\d/\t in {inner dot A1/0.2/75, inner dot A2/0.2/-75, inner dot B1/0.1/-45, inner dot B2/0.1/45}
+            \path (T.\a) \coordx(\a)[\d:\t]{red};
+        \or
+            \foreach \a/\d/\t in {outer dot A1/0.2/75, outer dot A2/0.2/-75, outer dot B1/0.2/-45, outer dot B2/0.2/45}
+            \path (T.\a) \coordx(\a)[\d:\t]{blue};
+        \or
+            \foreach \a/\t in {A1/120, A2/-120, B1/120, B2/-120, base/-90}
+            \path (T.\a) \coordx(\a)[0.2:\t]{green!50!black};
+        \fi
+    }
+\end{circuitikz}
+\end{quote}
+
+Also, the standard ``geographical'' \texttt{north}, \texttt{north east}, etc. are defined.
+A couple of examples follow:
+
+\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}
+  (T.inner dot A1) node[circ]{}
+  (T.inner dot B2) node[circ]{}
+;\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{Amplifiers}
+
+\begin{groupdesc}
+    \circuitdesc*{op amp}{Operational amplifier}{}( +/180/0.2, -/180/0.2, out/0/0.2, up/90/0.2, down/-90/0.2 )
+    \circuitdesc*{en amp}{Operational amplifier compliant to DIN/EN 60617 standard}{}
+    \circuitdesc*{fd op amp}{Fully differential operational amplifier\footnotemark}{}( out +/0/0.2, out -/0/0.2 )
+    \footnotetext{Contributed by Kristofer M. Monisit.}
+    \circuitdesc*{gm amp}{transconductance amplifier}{}
+    \circuitdesc*{inst amp}{plain instrumentation amplifier}{}( up/90/0.2, down/-90/0.2, refv up/45/0.2, refv down/-45/0.2 )
+    \circuitdesc*{fd inst amp}{Fully differential instrumentation amplifier}{}
+    \circuitdesc*{inst amp ra}{instrumentation amplifier with amplification resistance terminals}{}( ra+/180/0.1, ra-/180/0.1 )
+    \circuitdesc*{plain amp}{Plain amplifier}{}
+    \circuitdesc*{buffer}{Buffer}{}
+\end{groupdesc}
+
+\subsubsection{Amplifiers anchors}
+
+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$}
+  (opamp.up) --++(0,0.5) node[vcc]{5\,\textnormal{V}}
+  (opamp.down) --++(0,-0.5) node[vee]{-5\,\textnormal{V}}
+;\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 instrumentation amplifier inst amp defines also references (normally you use the "down", unless you are flipping the component):
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz} \draw
+  (0,0) node[inst amp] (opamp) {}
+  (opamp.+) node[left] {$v_+$}
+  (opamp.-) node[left] {$v_-$}
+  (opamp.out) node[right] {out}
+  (opamp.up) node[vcc]{}
+  (opamp.down) node[vee] {}
+  (opamp.refv down) node[ground]{}
+  (opamp.refv up) to[short, -o] ++(0,0.3)
+;\end{circuitikz}
+\end{LTXexample}
+
+The fully diffential instrumentation amplifier inst amp defines two outputs:
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz} \draw
+  (0,0) node[fd inst amp] (opamp) {}
+  (opamp.+) node[left] {$v_+$}
+  (opamp.-) node[left] {$v_-$}
+  (opamp.out +) node[right] {out +}
+  (opamp.out -) node[right] {out -}
+  (opamp.up) node[vcc]{}
+  (opamp.down) node[vee] {}
+  (opamp.refv down) node[ground]{}
+  (opamp.refv up) to[short, -o] ++(0,0.3)
+;\end{circuitikz}
+\end{LTXexample}
+
+The instrumentation amplifier with resistance terminals (\texttt{inst amp ra}) defines also terminals to add an amplification resistor:
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz} \draw
+  (0,0) node[inst amp ra] (opamp) {}
+  (opamp.+) node[left] {$v_+$}
+  (opamp.-) node[left] {$v_-$}
+  (opamp.out) node[right] {out}
+  (opamp.up) node[vcc]{}
+  (opamp.down) node[vee] {}
+  (opamp.refv down) node[ground]{}
+  (opamp.refv up) to[short, -o] ++(0,0.3)
+  (opamp.ra-) to[R] (opamp.ra+)
+;\end{circuitikz}
+\end{LTXexample}
+
+\subsubsection{Amplifiers customization}
+
+All these amplifier have the possibility to flip input and output (if needed) polarity. You can change polarity of the input with the
+\texttt{noinv input down} (default) or \texttt{noinv input up} key; and the output with \texttt{noinv output up} (default) or \texttt{noinv output down} key:
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz} \draw
+  (0,0) node[fd inst amp,
+     noinv input up,
+     noinv output down] (opamp) {}
+  (opamp.+) node[left] {$v_+$}
+  (opamp.-) node[left] {$v_-$}
+  (opamp.out +) node[right] {out +}
+  (opamp.out -) node[right] {out -}
+  (opamp.up) node[vcc]{}
+  (opamp.down) node[vee] {}
+  (opamp.refv down) node[ground]{}
+  (opamp.refv up) to[short, -o] ++(0,0.3)
+;\end{circuitikz}
+\end{LTXexample}
+
+When you use the \texttt{noinv input/output ...} keys the anchors (\texttt{+}, \texttt{-}, \texttt{out +}, \texttt{out -}) will change with the effective position of the terminals. You have also the anchors \texttt{in up}, \texttt{in down}, \texttt{out up}, \texttt{out down} that will not change with the positive or negative sign.
+
+\paragraph{European-style amplifier customization}
+
+Thanks to the suggestions from David Rouvel (\email{david.rouvel at iphc.cnrs.fr}) there are several possible customization for the European-style amplifiers.
+
+Since 0.9.0, the default appearance of the symbol has changed to be more in line with the standard; notice that to have a bigger triangle by default we should require more packages, and I fear {Con\TeX t} compatibility; but see later on how to change it. Notice that the font used for the symbol is defined in \texttt{tripoles/en amp/font2} and that the font used for the \texttt{+} and \texttt{-} symbols is  \texttt{tripoles/en amp/font}.
+
+You can change the distances of the inputs, using \texttt{tripoles/en amp/input height} (default 0.3):
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+    \ctikzset{tripoles/en amp/input height=0.45}
+    \draw (0,0)node[en amp](E){}
+        (E.out) node[right] {$v_{\mathrm{out}}$}
+        (E.-) node[left] {$v_{\mathrm{in}-}$}
+        (E.+) node[left] {$v_{\mathrm{in}+}$};
+\end{circuitikz}
+\end{LTXexample}
+
+and of course the key \texttt{noinv input up} is fully functional:
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+    \ctikzset{tripoles/en amp/input height=0.45}
+    \draw (0,0)node[en amp, noinv input up](E){}
+        (E.out) node[right] {$v_{\mathrm{out}}$}
+        (E.-) node[left] {$v_{\mathrm{in}-}$}
+        (E.+) node[left] {$v_{\mathrm{in}+}$};
+\end{circuitikz}
+\end{LTXexample}
+
+To flip the amplifier in the horizontal direction, you can use \texttt{xscale=-1} as usual:
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+    \ctikzset{tripoles/en amp/input height=0.45}
+    \draw (0,0)node[en amp, xscale=-1, noinv input up](E){}
+        (E.out) node[left] {$v_{\mathrm{out}}$}
+        (E.-) node[right] {$v_{\mathrm{in}-}$}
+        (E.+) node[right] {$v_{\mathrm{in}+}$};
+\end{circuitikz}
+\end{LTXexample}
+
+Notice that the label is fully mirrored, so check below for the generic way of changing this.
+
+You can use the new key \texttt{en amp text A} to change the infinity symbol with an A:
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+    \draw (0,0)node[en amp, en amp text A](E){}
+        (E.out) node[right] {$v_{\mathrm{out}}$}
+        (E.-) node[left] {$v_{\mathrm{in}-}$}
+        (E.+) node[left] {$v_{\mathrm{in}+}$} ;
+\end{circuitikz}
+\end{LTXexample}
+
+And if you want, you can completely change the text using the key \texttt{en amp text={}}, which by default is \verb|$\mathstrut{\triangleright}\,{\infty}$|:
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+    \draw (0,0)node[en amp, en amp text={%
+            ${\triangleright}$ \small 200}](E){}
+        (E.out) node[right] {$v_{\mathrm{out}}$}
+        (E.-) node[left] {$v_{\mathrm{in}-}$}
+        (E.+) node[left] {$v_{\mathrm{in}+}$} ;
+\end{circuitikz}
+\end{LTXexample}
+
+Notice two things here: the first, that \verb|\triangleright| is enclosed in braces to remove the default spacing it has as a binary operator, and that \texttt{en amp text A} is simply a shortcut for
+
+\begin{lstlisting}
+    en amp text={$\mathstrut{\triangleright}\,\mathrm{A}$}
+\end{lstlisting}
+
+
+To combine flipping with a generic label you just do:
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+    \draw (0,0)node[en amp, xscale=-1, en amp text A](E){}
+        (E.out) node[left] {$v_{\mathrm{out}}$}
+        (E.-) node[right] {$v_{\mathrm{in}-}$}
+        (E.+) node[right] {$v_{\mathrm{in}+}$} ;
+\end{circuitikz}
+\end{LTXexample}
+
+But notice that the ``A'' is also flipped by the \texttt{xscale} parameter. So the solution in this case is to use \texttt{scalebox}, like this:
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+    \draw (0,0)node[en amp, xscale=-1, en amp text={%
+    ${\triangleright}$ \scalebox{-1}[1]{\small 200}}](E){}
+        (E.out) node[left] {$v_{\mathrm{out}}$}
+        (E.-) node[right] {$v_{\mathrm{in}-}$}
+        (E.+) node[right] {$v_{\mathrm{in}+}$} ;
+\end{circuitikz}
+\end{LTXexample}
+
+
+\subsection{Support shapes and bipoles}\label{sec:support}
+
+Path style:
+\begin{groupdesc}
+\circuitdescbip{crossing}{Jumper style non-contact crossing}{xing}
+\end{groupdesc}
+
+\noindent Node style:
+
+\begin{groupdesc}
+    \circuitdesc{currarrow}{Arrows (current and voltage)}{}
+    \circuitdesc{inputarrow}{Arrow to draw at its tip, useful for block diagrams.}{}
+    \circuitdesc{circ}{Connected terminal}{}
+    \circuitdesc{ocirc}{Unconnected terminal}{}
+    \circuitdesc{diamondpole}{Diamond-style terminal}{}
+    \circuitdesc{jump crossing}{Jumper-style crossing node}{}
+    \circuitdesc{plain crossing}{Plain style crossing node}{}
+    \circuitdesc{waves}{Waves}{}( north/90/0.4, north east/45/0.4, east/-45/0.4, south east/-45/0.4,
+    south/-90/0.4, south west/-135/0.4, west/180/0.4, north west/135/0.4,
+    left/135/0.2, top/45/0.2, right/45/0.2, bottom/-45/0.2 )
+    \circuitdesc*{bnc}{BNC connector}{}(left/135/0.6, right/45/0.6, center/-90/0.6, hot/0/0.6, zero/-135/0.6)
+\end{groupdesc}
+
+Moreover, you have the arrow tip \texttt{latexslim} which is an arrow similar to the old (in deprecated \texttt{arrows} library) \texttt{latex'} element:
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[american,]
+    \draw [latexslim-latexslim] (0,0) -- (1,0);
+\end{circuitikz}
+\end{LTXexample}
+
+
+
+\subsubsection{Terminal shapes}
+Since version 0.9.0, \texttt{circ}, \texttt{ocirc} , and \texttt{diamondpole} have all the standard geographical anchors, so you can do things like these:
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[american,]
+    \draw (0,-1) node[draw](R){R};
+    \draw (R.east) node[ocirc, right]{};
+\end{circuitikz}
+\end{LTXexample}
+
+The BNC connector is defined so that you can easily connect it as input or output (but remember that you need to flip the text if you flip the component):
+
+\begin{LTXexample}[varwidth, ]
+\begin{circuitikz}
+    \draw (0,0)
+    node[bnc](B1){$v_i$} to[R=\SI{50}{\ohm}] ++(3,0)
+    node[bnc, xscale=-1](B2){\scalebox{-1}[1]{$v_o$}};
+    \node [ground] at (B1.shield) {};
+    \node [eground] at (B2.shield){};
+\end{circuitikz}
+\end{LTXexample}
+
+It also has a \texttt{zero} anchor if you need to rotate it about its real center.
+
+\begin{LTXexample}[varwidth, ]
+\begin{circuitikz}
+    \draw[thin, red] (0,0) -- ++(1,0) (0,-1) -- ++(1,0);
+    \path (0,0) node[bnc]{} ++(1,0) node[bnc, rotate=-90]{};
+    \path (0,-1) node[bnc, anchor=zero]{} ++(1,0) node[bnc, anchor=zero, rotate=-90]{};
+\end{circuitikz}
+\end{LTXexample}
+
+\subsubsection{Crossings}
+
+All circuit-drawing standards agree that to show a crossing without electric contact, a simple crossing of the wires suffices; the electrical contact must be explicitly marked with a filled dot.
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[]
+\draw(1,-1) to[short] (1,1)
+    (0,0) to[short] (2,0);
+\draw(4,-1) to[short] (4,1)
+    (3,0) to[short] (5,0)
+    (4,0) node[circ]{};
+\end{circuitikz}
+\end{LTXexample}
+
+However, sometime it is advisable to mark the non-contact situation more explicitly. To this end, you can use a path-style component called \texttt{crossing}:
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[]
+\draw(1,-1) to[short] (1,1) (0,0) to[crossing] (2,0);
+\draw(4,-1) to[short] (4,1) (3,0) to[short] (5,0)
+    (4,0) node[circ]{};
+\end{circuitikz}
+\end{LTXexample}
+
+That should suffice most of the time; the only problem is that the crossing jumper will be put in the center of the subpath where the \texttt{to[crossing]} is issued, so sometime a bit of trial and error is needed to position it.
+
+For a more powerful (and elegant) way you can use the crossing nodes:
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[]
+    \node at (1,1)[jump crossing](X){};
+    \draw (X.west) -- ++(-1,0);
+    \draw (X.east) to[R] ++(2,0);
+    \draw (X.north) node[vcc]{};
+    \draw (X.south) to[C] ++(0,-1.5);
+\end{circuitikz}
+\end{LTXexample}
+
+Notice that the \texttt{plain crossing} and the \texttt{jump crossing} have a small gap in the straight wire, to enhance the effect of crossing (as a kind of shadow).
+
+The size of the crossing elements can be changed with the key \texttt{bipoles/crossing/size} (default 0.2).
+
+
+\subsubsection{Arrows size}
+
+You can use the parameter  \texttt{current arrow scale} to change the size of the arrows in various components and indicators; the normal value is 16, higher numbers give smaller arrows and so on.  You need to use  \texttt{circuitikz/current arrow scale} if you use it into a node.
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+    \draw (0,0) to[R, i=f] ++(2,0) node[npn, anchor=B]{};
+    \draw (0,-2) to[R, f=f, current arrow scale=8] ++(2,0)
+            node[pnp, anchor=B, circuitikz/current arrow scale=8]{};
+    \draw (0,-4) to[R, f=f, current arrow scale=24] ++(2,0)
+            node[nigbt, anchor=B]{};
+\end{circuitikz}
+\end{LTXexample}
+
+\subsection{Switches and buttons}
+
+Switches and button come in to-style (the simple ones and the pushbuttons), and as nodes.
+
+\subsubsection{Traditional switches}
+These are all of the to-style type:
+
+\begin{groupdesc}
+    \circuitdescbip[cspst]{switch}{Switch}{spst}
+    \circuitdescbip[cspst]{closing switch}{Closing switch}{cspst}
+    \circuitdescbip[ospst]{opening switch}{Opening switch}{ospst}
+    \circuitdescbip[nos]{normal open switch}{Normally open switch}{nos}
+    \circuitdescbip[ncs]{normal closed switch}{Normally closed switch}{ncs}
+    \circuitdescbip[pushbutton]{push button}{Normally open push button}{normally open push button, nopb}
+    \circuitdescbip[ncpushbutton]{normally closed push button}{Normally closed push button}{ncpb}
+    \circuitdescbip[toggleswitch]{toggle switch}{Toggle switch}{}
+\end{groupdesc}
+
+while this is a node-style component:
+
+\begin{groupdesc}
+	\circuitdesc{spdt}{spdt}{}( in/180/0.2, out 1/0/0.2, out 2/0/0.2 )
+\end{groupdesc}
+
+\subsubsection{Cute switches}
+These switches have been introduced after version 0.9.0, and they come in also in to-style and in node-style, but they are size-matched so that they can be used together in a seamless way.
+
+The path element (to-style) are:
+\begin{groupdesc}
+    \circuitdescbip[cuteclosedswitch]{cute closed switch}{Cute closed switch}{ccsw}(mid/90/0.2, in/-135/0.2, out/-45/0.2)
+    \circuitdescbip[cuteopenswitch]{cute open switch}{Cute open switch}{cosw}
+    \circuitdescbip[cuteclosingswitch]{cute closing switch}{Cute closing switch}{ccgsw}
+    \circuitdescbip[cuteopeningswitch]{cute opening switch}{Cute opening switch}{cogsw}
+\end{groupdesc}
+while the node-style components are the single-pole, double-throw (\texttt{spdt}) ones:
+\begin{groupdesc}
+    \circuitdesc{cute spdt up}{Cute spdt up}{}( in/180/0.2, out 1/0/0.2, out 2/0/0.2 , mid/0/0.4)
+    \circuitdesc{cute spdt mid}{Cute spdt mid}{}
+    \circuitdesc{cute spdt down}{Cute spdt down}{}(mid/0/0.4)
+    \circuitdesc{cute spdt up arrow}{Cute spdt up with arrow}{}
+    \circuitdesc{cute spdt mid arrow}{Cute spdt mid with arrow}{}
+    \circuitdesc{cute spdt down arrow}{Cute spdt down with arrow}{}
+\end{groupdesc}
+
+\subsubsection{Switches anchors}
+
+The nodes-style switches have the following anchors:
+
+\bigskip
+\begin{circuitikz}
+    \def\coorda(#1)<#2>{node[circle, red, draw, inner sep=1pt,pin={[red, overlay, inner sep=0.5pt, font=\small, pin distance=0.1cm, pin edge={red, overlay,}]#2:#1}](#1){}}
+    \path (0,-1) -- (3,1); %bbox
+    \draw (0, 0) node[cute spdt up arrow](CS){};
+    \draw (2, 0) node[cute spdt up arrow](CS){};
+    \foreach \a/\b in {center/0, in/-135, out 1/45, out 2/-45, mid/135}
+    \path (CS.\a) \coorda(\a)<\b>;
+\end{circuitikz}
+
+
+\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}
+
+The \texttt{mid} anchor in the cute switches (both path- and node-style) can be used to combine switches to get more complex configurations:
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+    \draw (0,1.4) node[cute spdt up](S1){};
+    \draw (0,0)   node[cute spdt up](S2){};
+    \draw (0,-1)  node[cuteclosedswitchshape, yscale=-1](S3){};
+    \draw [densely dashed] (S1.mid)--(S2.mid)--(S3.mid);
+\end{circuitikz}
+\end{LTXexample}
+
+\subsubsection{Cute switches customization}
+
+You can use the key \texttt{bipoles/cuteswitch/thickness} to decide the thickness of the switch lever. The units are the diameter of the \texttt{ocirc} connector, and the default is \texttt{1}.
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+    \ctikzset{bipoles/cuteswitch/thickness=0.5}
+    \draw (0,1.4) node[cute spdt up](S1){};
+    \draw (0,0)   node[cute spdt up](S2){};
+    \draw (0,-1)  node[cuteclosedswitchshape, yscale=-1](S3){};
+    \draw [densely dashed] (S1.mid)--(S2.mid)--(S3.mid);
+\end{circuitikz}
+\end{LTXexample}
+
 \subsection{Logic gates}
+
+Logic gates, with two or more input, are supported. Albeit in principle these components are multipoles, the are considered tripoles here, for historical reasons (when they just had two inputs).
+
 \subsubsection{American 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{groupdesc}
+    \circuitdesc*{american and port}{American \textsc{and} port}{}( in 1/180/0.2, in 2/180/0.2, out/0/0.2 )
+    \circuitdesc*{american or port}{American \textsc{or} port}{}( bin 1/135/0.2, bin 2/-135/0.2, bout/-45/0.2 )
+    \circuitdesc*{american not port}{American \textsc{not} port}{}
+    \circuitdesc*{american nand port}{American \textsc{nand} port}{}
+    \circuitdesc*{american nor port}{American \textsc{nor} port}{}
+    \circuitdesc*{american xor port}{American \textsc{xor} port}{}
+    \circuitdesc*{american xnor port}{American \textsc{xnor} port}{}
+\end{groupdesc}
 \subsubsection{European Logic gates}
-\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{groupdesc}
+    \circuitdesc*{european and port}{European \textsc{and} port}{}( in 1/180/0.2, in 2/180/0.2, out/0/0.2 )
+    \circuitdesc*{european or port}{European \textsc{or} port}{}
+    \circuitdesc*{european not port}{European \textsc{not} port}{}
+    \circuitdesc*{european nand port}{European \textsc{nand} port}{}
+    \circuitdesc*{european nor port}{European \textsc{nor} port}{}
+    \circuitdesc*{european xor port}{European \textsc{xor} port}{}
+    \circuitdesc*{european xnor port}{European \textsc{xnor} port}{}
+\end{groupdesc}
 
 \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.
@@ -760,46 +2362,311 @@
 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}
 
-\begin{itemize}
-	\circuititem{schmitt}{Non-Inverting \textsc{Schmitttrigger}}{}
-	\circuititem{invschmitt}{Inverting \textsc{Schmitttrigger}}{}
-\end{itemize}
-\subsection{Amplifiers}
+\subsubsection{Special components}
 
-\begin{itemize}
-	\circuititem{op amp}{Operational amplifier}{}
-	\circuititem{en amp}{Operational amplifier compliant to DIN/EN 60617 standard}{}
-	\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}
+There is no ``european''  version of these symbols.
 
-\subsection{Support shapes}
+\begin{groupdesc}
+    \circuitdesc*{schmitt}{Non-Inverting \textsc{Schmitttrigger}}{}
+    \circuitdesc*{invschmitt}{Inverting \textsc{Schmitttrigger}}{}
+\end{groupdesc}
 
-\begin{itemize}
-	\circuititem{currarrow}{Arrows (current and voltage)}{}
-	\circuititem{inputarrow}{Arrow to draw at its tip, useful for block diagrams.}{}
-	\circuititem{circ}{Connected terminal}{}
-	\circuititem{ocirc}{Unconnected terminal}{}
-	\circuititem{diamondpole}{Diamond-style terminal}{}
-\end{itemize}
+\subsubsection{Logic port customization}
 
+As for most components, you can change the width and height of the ports; the thickness is given by the parameter \texttt{tripoles/thickness} (default 2):
 
+\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=.4}
+\ctikzset{tripoles/thickness=4}
+\tikz \draw (0,0) node[nand port] {};
+\end{LTXexample}
 
-\section{Usage}
+This is especially useful if you have ports with more than two inputs, which are instantiated
+with the parameter \texttt{number inputs} :
 
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
+\draw (0,3) node[american and port] (A)  {P1};
+\begin{scope}
+    \ctikzset{tripoles/american or port/height=1.6}
+    \draw (A.out) -- ++(0.5,0)
+    node[american or port,
+    number inputs=5,
+    anchor=in 1] (B)  {P2};
+\end{scope}
+\draw (0,1.5) node[american or port] (C)  {P3};
+\draw (C.out) |- (B.in 2);
+\end{circuitikz}
+\end{LTXexample}
+
+You can tweak the appearance of american ``or'' family (\texttt{or}, \texttt{nor}, \texttt{xor}  and \texttt{xnor}) ports, too, with the parameters \texttt{inner} (how much the base circle go ``into'' the shape, default 0.3) and \texttt{angle} (the angle at which the base starts, default 70).
+
+\begin{LTXexample}[varwidth=true]
+\tikz \draw (0,0) node[xnor port] {};
+\ctikzset{tripoles/american xnor port/inner=.7}
+\ctikzset{tripoles/american xnor port/angle=40}
+\tikz \draw (0,0) node[xnor port] {};
+\end{LTXexample}
+
+\subsubsection{Logic port anchors}
+
+These are the anchors for logic ports:
+
+\bigskip
+\begin{circuitikz} [american]
+\def\coorda(#1)<#2>{node[circle, red, draw, inner sep=1pt,pin={[red, overlay, inner sep=0.5pt, font=\small, pin distance=0.1cm, pin edge={red, overlay,}]#2:#1}](#1){}}
+\path(-2,1) -- (11,-1);
+
+\draw (0,0) node[and port, number inputs=3](A){IC1} ;
+  \foreach \a/\d in {left/45, right/45, out/-45, in 1/135, in 2/135, in 3/135}
+    \path (A.\a) \coorda(\a)<\d>;
+
+\draw (4.5,0) node[and port, number inputs=3](A){IC1};
+  \foreach \a/\d in {north/90, north west/135, west/180, south west/-135,
+  south/-90, south east/45, east/45, north east/45}
+    \path (A.\a) \coorda(\a)<\d>;
+
+\draw (9,0) node[european and port, ](A){} ;
+  \foreach \a/\d in {left/45, right/45, center/-90}
+    \path (A.\a) \coorda(\a)<\d>;
+\end{circuitikz}
+\bigskip
+
+You have also ``border pin anchors'':
+
+\bigskip
+\begin{circuitikz} [american]
+\def\coorda(#1)<#2>{node[circle, red, draw, inner sep=1pt,pin={[red, overlay, inner sep=0.5pt, font=\small, pin distance=0.1cm, pin edge={red, overlay,}]#2:#1}](#1){}}
+\path(-2,1) -- (11,-1);
+
+\draw (0,0) node[american and port, number inputs=3](A){IC1} ;
+  \foreach \a/\d in {bin 1/-135, bin 2/-135, bin 3/-135, bout/-45}
+    \path (A.\a) \coorda(\a)<\d>;
+
+\draw (4.5,0) node[american or port, number inputs=3](A){IC1};
+  \foreach \a/\d in {bin 1/-135, bin 2/-135, bin 3/-135, bout/-45}
+    \path (A.\a) \coorda(\a)<\d>;
+
+\draw (9,0) node[european and port, ](A){} ;
+  \foreach \a/\d in {bin 1/-135, bin 2/-135, bout/-45}
+    \path (A.\a) \coorda(\a)<\d>;
+\end{circuitikz}
+\bigskip
+
+These anchors are especially useful if you want to negate inputs:
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+\draw (0,3) node[american and port] (A)  {P1};
+\node at (A.bin 1) [ocirc, left]{} ;
+\begin{scope}
+    \ctikzset{tripoles/american or port/height=1.6}
+    \draw (A.out) -- ++(0.5,0) node[american or port,
+    number inputs=5, anchor=in 1] (B)  {P2};
+    \node at (B.bin 3) [ocirc, left]{} ;
+\end{scope}
+\draw (0,1.5) node[american or port] (C)  {P3};
+\node at (C.bin 2) [ocirc, left]{} ;
+\draw (C.out) |- (B.in 2);
+\end{circuitikz}
+\end{LTXexample}
+As you can see, the \texttt{center} anchor is (for historic reasons) not in the center at all. You can fix this with the command \verb|\ctikzset{logic ports origin=center}|:
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+\ctikzset{logic ports origin=center}
+\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};
+\draw[<-] (myand.center) -- ++(1,-1)
+   node{center};
+\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}
+
+
+
+\subsection{Chips}
+%%% This chapter is in the new format --- description and components.
+%%% The idea is to try to reorganize the manual before the next release.
+%%% See issue #24
+
+\texttt{CircuiTikZ} supports two types of variable-pin chips: DIP (Dual-in-Line Package) and QFP (Quad-Flat Package).
+\begin{groupdesc}
+    \circuitdesc*{dipchip}{Dual-in-Line Package chip}{}
+    \circuitdesc*{qfpchip}{Quad-Flat Package chip}{}
+\end{groupdesc}
+
+\subsubsection{DIP and QFP chips customization}
+
+You can customize the DIP chip with the keys \texttt{multipoles/dipchip/width} (default 1.2) and  \texttt{multipoles/dipchip/pin spacing} (default 0.4) that are expressed in fraction of basic lengths (see section~\ref{sec:components-size}).
+The height of the chip will be equal to half the numbers of pins multiplied by the spacing, plus one spacing for the borders.
+For the QFP chips, you can only chose the pin spacing with \texttt{multipoles/qfpchip/pin spacing} key.
+
+The pins of the chip can be ``hidden'' (that is, just a spot in the border, optionally marked with a number) or ``stick out'' with a thin lead by setting \texttt{multipoles/external pins width} greater than 0 (default value is 0.2, so you'll have leads as shown above).
+Moreover, you can transform the thin lead into a pad by setting the key \texttt{multipoles/external pad fraction} to something different form 0 (default is 0); the value expresses the fraction of the pin spacing space that the pad will use on both sides of the pin.
+
+The number of pins is settable with the key \texttt{num pins}.
+\textbf{Please notice} that the number of pins \textbf{must} be \emph{even} for \texttt{dipchip}s and \emph{multiple of 4} for \texttt{qfpchip}s, otherwise havoc will ensue.
+
+You can, if you want, avoid printing the numbers of the pin with \texttt{hide numbers} (default \texttt{show numbers}) if you prefer positioning them yourself (see the next section for the anchors you can use).
+The font used for the pins is adjustable with the key \texttt{multipoles/font} (default \verb|\tiny|)
+For special use you can suppress the orientation mark with the key \texttt{no topmark} (default \texttt{topmark}).
+
+The line thickness of the main shape is controlled by \texttt{multipoles/thickness} (default 2) and the one of the external pins/pads with \texttt{multipoles/external pins thickness} (default 1).
+
+\begin{LTXexample}[varwidth=true]
+    \begin{circuitikz}
+        \ctikzset{multipoles/thickness=4}
+        \ctikzset{multipoles/external pins thickness=2}
+        \draw (0,0) node[dipchip,
+          num pins=12,
+          hide numbers,
+          external pins width=0.3,
+          external pad fraction=4 ](C){IC1};
+        \draw (C.pin 1) -- ++(-0.5,0) to[R]
+          ++(0,-3) node[ground]{};
+          \node [right, font=\tiny]
+          at (C.bpin 1) {RST};
+    \end{circuitikz}
+\end{LTXexample}
+
+\begin{LTXexample}[varwidth=true]
+    \begin{circuitikz}
+        \draw (0,0) node[dipchip,
+          num pins=8,
+          external pins width=0.0](C){IC1};
+        \draw (C.pin 1) -- ++(-0.5,0) to[R]
+          ++(0,-1.5) node[ground]{};
+    \end{circuitikz}
+\end{LTXexample}
+
+\begin{LTXexample}[varwidth=true]
+    \begin{circuitikz}
+        \ctikzset{multipoles/font={\color{red}\tiny}}
+        \draw (0,0) node[qfpchip,
+          num pins=16,
+          external pad fraction=6](C){IC1};
+        \draw (C.pin 1) -- ++(-0.5,0) to[R]
+          ++(0,-2) node[ground]{};
+    \end{circuitikz}
+\end{LTXexample}
+
+\subsubsection{Chips anchors}
+
+Chips have anchors on pins and global anchors for the main shape.
+The pin anchors to be used to connect wires to the chip are called \texttt{pin 1}, \texttt{pin 2} , \dots, with just one space between \texttt{pin} and the number.
+Border pin anchors (\texttt{bpin 1}\dots) are always on the box border, and can be used to add numbers or whatever markings are needed.
+Obviously, in case of \texttt{multipoles/external pins width} equal to zero, border and normal pin anchors will coincide.
+
+Additionally, you have geometrical anchors on the chip ``box'', see the following figure. The nodes are available with the full name (like \texttt{north}) and with the short abbreviations \texttt{n}, \texttt{nw}, \texttt{w}\dots. The \texttt{dot} anchor is useful to add a personalized marker if you use the \texttt{no topmark} key.
+
+\begin{quote}
+    \bigskip
+    \def\coord(#1){node[circle, red, draw,  inner sep=1pt,pin={[red, overlay, inner sep=0.5pt, font=\scriptsize, pin distance=0.2cm, fill=white, fill opacity=0.5, text opacity=1, pin edge={red, overlay,}]75:#1}](#1){}}
+    \def\coordd(#1){node[circle, red, draw,  inner sep=1pt,pin={[red, overlay, inner sep=0.5pt, font=\scriptsize, pin distance=0.2cm, fill=white, fill opacity=0.5,  text opacity=1,pin edge={red, overlay,}]-45:#1}](#1){}}
+    \begin{circuitikz}[american, ]
+        \ctikzset{multipoles/dipchip/pin spacing=0.7}
+        \draw (0,0) node[dipchip,
+            external pins width=0.4,
+            external pad fraction=4](C){IC1};
+        \foreach \p in {1,...,8}
+            \path (C.pin \p) \coord(pin \p)
+            (C.bpin \p) \coordd(bpin \p);
+        % second chip
+        \draw (C.pin 7) to[R] ++(3,0)
+              node[dipchip,anchor=pin 2](D){IC2};
+        \foreach \p in {center, nw, ne, se, sw, north, south, west, east}
+            \path (D.\p) \coord(\p);
+        \path (D.text) \coordd(text);
+        % third chip
+        \draw (D.pin 7)  ++(2,0)
+              node[dipchip,anchor=pin 2, no topmark](E){};
+        \foreach \p in {center, n, w, e, s, dot}
+            \path (E.\p) \coord(\p);
+    \end{circuitikz}
+\end{quote}
+
+\subsubsection{Chips rotation}
+
+You can rotate chips, and normally the pin numbers are kept straight (option \texttt{straight numbers}, which is the default), but you can rotate them if you like with \texttt{rotated numbers}.
+Notice that the main label has to be (counter-) rotated manually in this case.
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+    \draw (0,0) node[dipchip,
+        rotate=90]{%
+        \rotatebox{-90}{IC2}};
+    \draw (3,0) node[qfpchip,
+        rotated numbers,
+        rotate=45]{IC3};
+\end{circuitikz}
+\end{LTXexample}
+
+\subsubsection{Chip special usage}
+
+You can use chips to have special, personalized blocks.
+Look at the following example, which is easily put into a macro.
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+    \ctikzset{multipoles/thickness=3}
+    \ctikzset{multipoles/dipchip/width=2}
+    \draw (0,0) node[dipchip,
+        num pins=10, hide numbers, no topmark,
+        external pins width=0](C){Block};
+    \node [right, font=\tiny] at (C.bpin 1) {RST};
+    \node [right, font=\tiny] at (C.bpin 2) {IN1};
+    \node [right, font=\tiny] at (C.bpin 4) {/IN2};
+    \node [left, font=\tiny]  at (C.bpin 8) {OUT};
+    \draw (C.bpin 2) -- ++(-0.5,0) coordinate(extpin);
+    \node [ocirc, anchor=0](notin2) at (C.bpin 4) {};
+    \draw (notin2.180) -- (C.bpin 4 -| extpin);
+    \draw (C.bpin 8) to[short,-o] ++(0.5,0);
+    \draw (C.bpin 5) ++(0,0.1) -- ++(0.1,-0.1)
+        node[right, font=\tiny]{CLK} -- ++(-0.1,-0.1);
+    \draw (C.n) -- ++(0,1) node[vcc]{};
+    \draw (C.s) -- ++(0,-1) node[ground]{};
+\end{circuitikz}\end{LTXexample}
+
+\section{Labels and similar annotations}
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
    \draw (0,0) to[R, l=$R_1$] (2,0);
 \end{circuitikz}
-\end{LTXexample}	
+\end{LTXexample}
 
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
    \draw (0,0) to[R=$R_1$] (2,0);
 \end{circuitikz}
-\end{LTXexample}	
+\end{LTXexample}
 
 
 \begin{LTXexample}[varwidth=true]
@@ -806,19 +2673,19 @@
 \begin{circuitikz}
    \draw (0,0) to[R, i=$i_1$] (2,0);
 \end{circuitikz}
-\end{LTXexample}	
+\end{LTXexample}
 
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
    \draw (0,0) to[R, v=$v_1$] (2,0);
 \end{circuitikz}
-\end{LTXexample}	
+\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}	
+\end{LTXexample}
 
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
@@ -830,11 +2697,12 @@
 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) 
+  (0,0) to[resistor=1<\kilo\ohm>] (2,0)
 ;\end{circuitikz}
 \end{LTXexample}
 
 \subsection{Labels and Annotations}
+\label{sec:labels-and-annotations}
 Since Version 0.7, beside the original label (l) option, there is a new option to place a second label, called annotation (a) at each bipole. Up to now this is a beta-test and there can be problems. For example, up to now this option is not compatible with the concurrent use of voltage labels.
 
 The position of (a) and (l) labels can be adjusted with \_ and \^, respectively.
@@ -843,14 +2711,30 @@
 \begin{circuitikz}
    \draw (0,0) to[R, l=$R_1$,a=1<\kilo\ohm>] (2,0);
 \end{circuitikz}
-\end{LTXexample}	
+\end{LTXexample}
 
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
    \draw (0,0) to[R, l_=$R_1$,a^=1<\kilo\ohm>] (2,0);
 \end{circuitikz}
-\end{LTXexample}	
+\end{LTXexample}
 
+\textbf{Caveat:} notice that the way in which \texttt{circuitikz} processes the options, there will be problems if the label (or annotation, or voltage, or current) contains one of the characters $=$ (equal) or $,$ (comma), giving unexpected errors and wrong output.
+These two characters must be protected to the option parser using an \verb|\mbox| command, or redefining the characters with a \TeX\ \verb|\def|:
+
+\begin{LTXexample}[varwidth=true]
+    \def\eq{=}
+    \begin{circuitikz}
+        % the following will fail:
+        % \draw (0,0) to[R, l={$R=3}] (3,0);
+        \draw (0,0) to[R, l=\mbox{$R=3$}] (3,0);
+        \draw (0,0) to[R, l=$R\eq3$] (0,3);
+        \draw (3,3) to[R, l=\mbox{$R,3$}] (3,0);
+        % this works, but it has wrong spacing
+        \draw (0,3) to[R, l=$R{=}3$] (3,3);
+    \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}
@@ -860,7 +2744,7 @@
   \draw (0,0) to[R=\i, *-o] (\i:2.5);
 }
 \end{circuitikz}
-\end{LTXexample}	
+\end{LTXexample}
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
 \ctikzset{label/align = rotate}
@@ -869,7 +2753,7 @@
   \draw (0,0) to[R=\i, *-o] (\i:2.5);
 }
 \end{circuitikz}
-\end{LTXexample}	
+\end{LTXexample}
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
 \ctikzset{label/align = smart}
@@ -878,84 +2762,184 @@
   \draw (0,0) to[R=\i, *-o] (\i:2.5);
 }
 \end{circuitikz}
-\end{LTXexample}	
+\end{LTXexample}
 
-\subsection{Currents}\label{currents}
-The counting direction of currents and voltages have changed with version 0.5, for compability reasons there is a option to use the olddirections(see options). For the new scheme, the following rules apply:
+You also can use stacked (two lines) labels.  The example should be self-explanatory: the two lines are specified as \texttt{l2=}\emph{line1}\texttt{ and }\emph{line2}. You can use the keys \texttt{l2 halign} to control horizontal position (\texttt{l}eft, \texttt{c}enter, \texttt{r}ight) and \texttt{l2 valign} to control the vertical one (\texttt{b}ottom, \texttt{c}center, \texttt{t}op).
+
+
+\begin{LTXexample}[varwidth=true]
+    \begin{circuitikz}[ american, ]
+        %
+        % default is l2 halign=l, l2 valign=c
+        %
+        \draw (0,0) to[R, l2_=$R_{CC}$ and \SI{4.7}{k\ohm},            , l2 valign=t] (2,0);
+        \draw (0,0) to[R, l2_=$R_{CC}$ and \SI{4.7}{k\ohm},            ,            ] (0,2);
+        \draw (0,0) to[R, l2_=$R_{CC}$ and \SI{4.7}{k\ohm}, l2 halign=c, l2 valign=b] (-2,0);
+        \draw (0,0) to[R, l2_=$R_{CC}$ and \SI{4.7}{k\ohm}, l2 halign=r, l2 valign=c] (0, -2);
+    \end{circuitikz}
+\end{LTXexample}
+
+\begin{LTXexample}[varwidth=true]
+    \begin{circuitikz}[ american, ]
+        \draw (0,0) to[R, l2^=$R_{CC}$ and \SI{4.7}{k\ohm}, l2 halign=c, l2 valign=b] (2,0);
+        \draw (0,0) to[R, l2^=$R_{CC}$ and \SI{4.7}{k\ohm}, l2 halign=c,            ] (0,2);
+        \draw (0,0) to[R, l2^=$R_{CC}$ and \SI{4.7}{k\ohm},            , l2 valign=t] (-2,0);
+        \draw (0,0) to[R, l2^=$R_{CC}$ and \SI{4.7}{k\ohm}, l2 halign=c, l2 valign=t](0, -3);
+    \end{circuitikz}
+\end{LTXexample}
+
+\subsection{Currents and voltages}\label{curr-and-volt}
+
+The default direction/sign for currents and voltages in the components is, unfortunately, not standard, and can change across country and sometime across different authors.
+This unfortunate situation created a bit of confusion in \texttt{circuitikz} across the versions, with several incompatible changes starting from version 0.5.
+From version 0.9.0 onward, the maintainers agreed a new policy for the directions of bipoles' voltages and currents, depending on 4 different possible options:
 \begin{itemize}
-\item \textbf{Normal bipoles:} currents and voltages are counted positiv in drawing direction.
-\item \textbf{Current Sources:} current is counted positiv in drawing direction, voltage in opposite direction
-\item \textbf{Voltage Sources:} voltage is counted positiv in drawing direction, current in opposite direction
+    \item \texttt{oldvoltagedirection}, or the key style \texttt{voltage dir=old}: Use old way of voltage direction having a difference between european and american direction, with wrong default labelling for batteries (it was the default before version 0.5);
+    \item \texttt{nooldvoltagedirection}, or the key style \texttt{voltage dir=noold}: The standard from version 0.5 onward, utilize the (German?) standard of voltage arrows in the  direction of electric fields (without fixing batteries);
+    \item \texttt{RPvoltages} (meaning Rising Potential voltages), or the key style \texttt{voltage dir=RP}: the arrow is in direction of rising potential, like in \texttt{oldvoltagedirections}, but batteries and current sources are fixed so that they follow the passive/active standard: the default direction of \texttt{v} and \texttt{i} are chosen so that, when both values are positive:
+        \begin{itemize}
+            \item in passive component, the element is \emph{dissipating power};
+            \item in active components (generators), the element is \emph{generating power}.
+        \end{itemize}
+    \item \texttt{EFvoltages} (meaning Electric Field voltages), or the key style \texttt{voltage dir=EF}: the arrow is in direction of the electric field, like in \texttt{nooldvoltagedirections}, but batteries are fixed;
 \end{itemize}
-With this convention, the power at loads is positive and negative at sources.
 
+The standard direction of currents, flows and voltages are changed by these options; notice that the default drops in case of passive and active elements is normally different. Take care that in the case of \texttt{noold} and \texttt{EFvoltages} also the currents can switch directions. It is much easier to understand the several behaviors by looking at the following examples, that have been generated by the code:
+
+\begin{lstlisting}
+\foreach\element in {R, C, D, battery2, V, I, sV, cV, cI}{%
+    \noindent\ttfamily
+    \begin{tabular}{p{2cm}}
+        \element \\ american \\[15pt]
+        \element \\ european \\
+    \end{tabular}
+    \foreach\mode in {old, noold, RP, EF} {
+        \begin{tabular}{@{}l@{}}
+            \multicolumn{1}{c}{voltage dir} \\
+            \multicolumn{1}{c}{dir=\mode} \\[4pt]
+            \begin{tikzpicture}[
+                american, voltage dir=\mode,
+                ]
+                \draw (0,0) to[\element,  *-o, v=$v_1$, i=$i_1$, ] (2.5,0);
+            \end{tikzpicture}\\
+            \begin{tikzpicture}[
+                european, voltage dir=\mode,
+                ]
+                \draw (0,0) to[\element,  *-o, v=$v_1$, i=$i_1$, ] (2.5,0);
+            \end{tikzpicture}
+        \end{tabular}
+        \medskip
+    }
+    \par
+}
+\end{lstlisting}
+
+
+\foreach\element in {R, C, D, battery2, V, I,  sV, cV, cI}{%
+    \noindent\ttfamily
+    \begin{tabular}{p{2cm}}
+        \element \\ american \\[15pt]
+        \element \\ european \\
+    \end{tabular}
+    \foreach\mode in {old, noold, RP, EF} {
+        \begin{tabular}{@{}l@{}}
+            \multicolumn{1}{c}{voltage dir} \\
+            \multicolumn{1}{c}{dir=\mode} \\[4pt]
+            \begin{tikzpicture}[
+                american, voltage dir=\mode,
+                ]
+                \draw (0,0) to[\element,  *-o, v=$v_1$, i=$i_1$, ] (2.5,0);
+            \end{tikzpicture}\\
+            \begin{tikzpicture}[
+                european, voltage dir=\mode,
+                ]
+                \draw (0,0) to[\element,  *-o, v=$v_1$, i=$i_1$, ] (2.5,0);
+            \end{tikzpicture}
+        \end{tabular}
+        \medskip
+    }
+    \par
+}
+
+Obviously, you normally use just one between current and flows, but anyway you can
+change direction of the voltages,
+currents and flows using the complete keys \verb|i_>|, \verb|i^<|, \verb|i>_|, \verb|i>^|,
+as shown in the following examples.
+
+This manual has been typeset with the option \texttt{\chosenvoltoption}.
+
+\subsection{Currents}
+
+Inline (along the wire) currents are selected with \verb|i_>|, \verb|i^<|, \verb|i>_|, \verb|i>^|, and various simplification; the default position and direction is obtained with the key \verb|i=...|.
+
+
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
    \draw (0,0) to[R, i^>=$i_1$] (2,0);
 \end{circuitikz}
-\end{LTXexample}	
+\end{LTXexample}
 
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
    \draw (0,0) to[R, i_>=$i_1$] (2,0);
 \end{circuitikz}
-\end{LTXexample}	
+\end{LTXexample}
 
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
    \draw (0,0) to[R, i^<=$i_1$] (2,0);
 \end{circuitikz}
-\end{LTXexample}	
+\end{LTXexample}
 
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
    \draw (0,0) to[R, i_<=$i_1$] (2,0);
 \end{circuitikz}
-\end{LTXexample}	
+\end{LTXexample}
 
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
    \draw (0,0) to[R, i>^=$i_1$] (2,0);
 \end{circuitikz}
-\end{LTXexample}	
+\end{LTXexample}
 
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
    \draw (0,0) to[R, i>_=$i_1$] (2,0);
 \end{circuitikz}
-\end{LTXexample}	
+\end{LTXexample}
 
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
    \draw (0,0) to[R, i<^=$i_1$] (2,0);
 \end{circuitikz}
-\end{LTXexample}	
+\end{LTXexample}
 
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
    \draw (0,0) to[R, i<_=$i_1$] (2,0);
 \end{circuitikz}
-\end{LTXexample}	
+\end{LTXexample}
 
-Also
+Also:
 
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
    \draw (0,0) to[R, i<=$i_1$] (2,0);
 \end{circuitikz}
-\end{LTXexample}	
+\end{LTXexample}
 
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
    \draw (0,0) to[R, i>=$i_1$] (2,0);
 \end{circuitikz}
-\end{LTXexample}	
+\end{LTXexample}
 
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
    \draw (0,0) to[R, i^=$i_1$] (2,0);
 \end{circuitikz}
-\end{LTXexample}	
+\end{LTXexample}
 
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
@@ -967,26 +2951,26 @@
 \begin{circuitikz}
    \draw (0,0) to[V=10V, i_=$i_1$] (2,0);
 \end{circuitikz}
-\end{LTXexample}	
-	
+\end{LTXexample}
+
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
    \draw (0,0) to[V<=10V, i_=$i_1$] (2,0);
 \end{circuitikz}
-\end{LTXexample}		
+\end{LTXexample}
 
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}[american]
    \draw (0,0) to[V=10V, i_=$i_1$] (2,0);
 \end{circuitikz}
-\end{LTXexample}	
-	
+\end{LTXexample}
+
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}[american]
    \draw (0,0) to[V=10V,invert, i_=$i_1$] (2,0);
 \end{circuitikz}
 \end{LTXexample}
-	
+
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}[american]
    \draw (0,0) to[dcisource=1A, i_=$i_1$] (2,0);
@@ -997,12 +2981,12 @@
 \begin{circuitikz}[american]
    \draw (0,0) to[dcisource=1A,invert, i_=$i_1$] (2,0);
 \end{circuitikz}
-\end{LTXexample}			
+\end{LTXexample}
 
 \subsection{Flows}\label{flows}
 As an alternative for the current arrows, you can also use the following flows. They can also be used to indicate thermal or power flows. The syntax is pretty the same as for currents.
 
-\textit{This is a new beta feature since version 0.8.3, therefore, please provide bugreports or hints to optimize this feature regarding placement and appearance! This means, that the appearance may change in the future!}
+\textit{This is a new beta feature since version 0.8.3; therefore, please provide bug reports or hints to optimize this feature regarding placement and appearance! This means that the appearance may change in the future!}
 
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
@@ -1047,7 +3031,7 @@
 \end{LTXexample}
 
 \subsection{Voltages}
-See introduction note at Currents (chapter \ref{currents}, page \pageref{currents})!
+See introduction note at Currents (chapter \ref{curr-and-volt}, page \pageref{curr-and-volt})!
 
 \subsubsection{European style} The default, with arrows. Use option \texttt{europeanvoltage} or style \verb![european voltages]!.
 
@@ -1079,20 +3063,20 @@
 \begin{circuitikz}
    \draw (0,0) to[V=10V, i_=$i_1$] (2,0);
 \end{circuitikz}
-\end{LTXexample}	
-	
+\end{LTXexample}
+
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
    \draw (0,0) to[V<=10V, i_=$i_1$] (2,0);
 \end{circuitikz}
-\end{LTXexample}		
+\end{LTXexample}
 
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
    \draw (0,0) to[I=1A, v_=$u_1$] (2,0);
 \end{circuitikz}
-\end{LTXexample}	
-	
+\end{LTXexample}
+
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
    \draw (0,0) to[I<=1A, v_=$u_1$] (2,0);
@@ -1104,14 +3088,25 @@
    \draw (0,0) to[I=$~$,l=1A, v_=$u_1$] (2,0);
 \end{circuitikz}
 \end{LTXexample}
+
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
    \draw (0,0) to[I,l=1A, v_=$u_1$] (2,0);
 \end{circuitikz}
-\end{LTXexample}	
+\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}
+   \draw (0,0) to[battery,l_=1V, v=$u_1$, i=$i_1$] (2,0);
+\end{circuitikz}
+\end{LTXexample}
 
+
+
+
+\subsubsection{American style}
+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);
@@ -1140,8 +3135,8 @@
 \begin{circuitikz}[american]
    \draw (0,0) to[I=1A, v_=$u_1$] (2,0);
 \end{circuitikz}
-\end{LTXexample}	
-	
+\end{LTXexample}
+
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}[american]
    \draw (0,0) to[I<=1A, v_=$i_1$] (2,0);
@@ -1148,7 +3143,104 @@
 \end{circuitikz}
 \end{LTXexample}
 
+\subsubsection{Voltage position} It is possible to move away the arrows and the plus or minus signs with the key \texttt{voltages shift} (default value is \texttt{0}, which gives the standard position):
 
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[]
+   \draw (0,0) to[R, v=$v_1$, i=$i_1$] (2,0);
+   \draw (0,-1) to[R, v=$v_1$, i=$i_1$,
+      voltage shift=0.5] (2,-1);
+   \draw (0,-2) to[R, v=$v_1$, i=$i_1$,
+      voltage shift=1.0, ] (2,-2);
+\end{circuitikz}
+\end{LTXexample}
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[american voltages, voltage shift=0.5]
+   \draw (0,0) to[R, v=$v_1$, i=$i_1$] (2,0);
+\end{circuitikz}
+\end{LTXexample}
+
+Notes that \texttt{american voltage} also affects batteries.
+
+\begin{LTXexample}[varwidth=true]
+    \begin{circuitikz}[voltage shift=0.5]
+   \draw (0,0) to[battery,l_=1V, v=$u_1$, i=$i_1$] (2,0);
+\end{circuitikz}
+\end{LTXexample}
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[american voltages, voltage shift=0.5]
+   \draw (0,0) to[battery,l_=1V, v=$u_1$, i=$i_1$] (2,0);
+\end{circuitikz}
+\end{LTXexample}
+
+\subsubsection{American voltages customization}
+
+Since 0.9.0, you can change the font\footnote{There where a bug before, noticed by the user \texttt{dzereb} on \href{https://tex.stackexchange.com/questions/487683/odd-minus-style-when-drawing-american-voltage}{tex.stackexchange.com} which made the symbols using different fonts in a basically random way. In the same page, user \texttt{campa} found the problem. Thanks!} used by the \texttt{american voltages} style, by setting to something different from nothing the key \texttt{voltage/american font} (default: nothing, using the current font) style:
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[american]
+    \begin{scope}
+        \ctikzset{voltage/american font=\tiny\boldmath}
+        \draw (0,0) to[R,v=$V_S$] ++(2,0);
+    \end{scope}
+    \draw (0,-2) to[R,v=$V_S$] ++(2,0);
+\end{circuitikz}
+\end{LTXexample}
+
+Also, if you want to change the symbols (sometime just the $+$ sign is drawn, for example, or for highlighting something),
+using the keys \texttt{voltage/american plus} and \texttt{voltage/american minus} (default \verb|$+$| and \verb|$-$|).
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[american]
+    \ctikzset{voltage/american font=\scriptsize\boldmath}
+    \ctikzset{voltage/american plus=\textcolor{red}{$\oplus$}}
+    \ctikzset{voltage/american minus=\textcolor{blue}{$\ominus$}}
+    \draw (0,0) to[R,v_>=$V_S$] ++(2,0);
+    \draw (0,-2) to[R,v_<=$V_S$] ++(2,0);
+\end{circuitikz}
+\end{LTXexample}
+
+This could be especially useful if you define a style, to use like this:
+
+\begin{LTXexample}[varwidth=true]
+\tikzset{red plus/.style={
+    circuitikz/voltage/american plus=\textcolor{red}{$+$},
+}}
+\begin{circuitikz}[american]
+    \draw (0,0) to[R,v_>=$V_S$, red plus] ++(2,0);
+    \draw (0,-2) to[R,v_<=$V_S$] ++(2,0);
+\end{circuitikz}
+\end{LTXexample}
+\subsubsection{Global properties of voltages and currents}
+
+\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}
+
+
+
+
 \subsection{Nodes}
 
 \begin{LTXexample}[varwidth=true]
@@ -1278,7 +3370,7 @@
 \end{circuitikz}
 \end{LTXexample}
 
-The following results from using the option \texttt{americancurrent} or using the style \verb![american currents]!.
+The following results from using the option \texttt{americancurrent} or using the style \texttt{[american currents]}.
 
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}[american currents]
@@ -1346,7 +3438,7 @@
 \end{circuitikz}
 \end{LTXexample}
 
-The following results from using the option \texttt{americanvoltage} or the style \verb![american voltages]!.
+The following results from using the option \texttt{americanvoltage} or the style \texttt{[american voltages]}.
 
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}[american voltages]
@@ -1388,37 +3480,37 @@
 \begin{circuitikz}
    \draw (0,0) to[R, l=1<\kilo\ohm>] (2,0);
 \end{circuitikz}
-\end{LTXexample}	
+\end{LTXexample}
 
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
    \draw (0,0) to[R, l=$\SI{1}{\kilo\ohm}$] (2,0);
 \end{circuitikz}
-\end{LTXexample}	
+\end{LTXexample}
 
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
    \draw (0,0) to[R, i=1<\milli\ampere>] (2,0);
 \end{circuitikz}
-\end{LTXexample}	
+\end{LTXexample}
 
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
    \draw (0,0) to[R, i=$\SI{1}{\milli\ampere}$] (2,0);
 \end{circuitikz}
-\end{LTXexample}	
+\end{LTXexample}
 
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
    \draw (0,0) to[R, v=1<\volt>] (2,0);
 \end{circuitikz}
-\end{LTXexample}	
+\end{LTXexample}
 
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
    \draw (0,0) to[R, v=$\SI{1}{\volt}$] (2,0);
 \end{circuitikz}
-\end{LTXexample}	
+\end{LTXexample}
 
 
 
@@ -1429,7 +3521,7 @@
 \begin{circuitikz}
    \draw (0,0) to[pD] (2,0);
 \end{circuitikz}
-\end{LTXexample}	
+\end{LTXexample}
 
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
@@ -1440,20 +3532,20 @@
 \begin{circuitikz}
    \draw (0,0) to[pD, invert] (2,0);
 \end{circuitikz}
-\end{LTXexample}	
+\end{LTXexample}
 
-Placing labels, currents and voltages works also, please note, that mirroring and inverting does not incfluence the positioning of labels and voltages. Labels are by default above/right of the bipole and voltages below/left, respectively.
+Placing labels, currents and voltages works also, please note, that mirroring and inverting does not influence the positioning of labels and voltages. Labels are by default above/right of the bipole and voltages below/left, respectively.
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
    \draw (0,0) to[ospst=T, i=$i_1$, v=$v$] (2,0);
 \end{circuitikz}
-\end{LTXexample}	
+\end{LTXexample}
 
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
    \draw (0,0) to[ospst=T, mirror, i=$i_1$, v=$v$] (2,0);
 \end{circuitikz}
-\end{LTXexample}	
+\end{LTXexample}
 
 \begin{LTXexample}[varwidth=true]
 \begin{circuitikz}
@@ -1464,7 +3556,7 @@
 \begin{circuitikz}
    \draw (0,0) to[ospst=T,mirror,invert, i=$i_1$, v=$v$] (2,0);
 \end{circuitikz}
-\end{LTXexample}	
+\end{LTXexample}
 
 
 \subsection{Putting them together}
@@ -1483,7 +3575,9 @@
 \end{LTXexample}
 
 \subsection{Line joins between Path Components}
-Line joins should be calculated correctly, if the were on the same path and if the path is not closed. For example, the following path is not closed correctly(\textit{--cycle} does not work here!):
+\label{sec:line-joins}
+
+Line joins should be calculated correctly, if the are on the same path and if the path is not closed. For example, the following path is not closed correctly (\textit{--cycle} does not work here!):
 \begin{LTXexample}[varwidth=true]
 	\begin{tikzpicture}[line width=3pt,european]
 	\draw (0,0) to[R]++(2,0)to[R]++(0,2)
@@ -1491,7 +3585,7 @@
 	\draw[red,line width=1pt] circle(2mm);
 	\end{tikzpicture}
 \end{LTXexample}
-To correct the line ending, there are support shapes to fill the missing rectangle. They can be used like the support shapes(*,o,d) using a dot (.) on one or both ends of a component(have a look at the last resistor in this example:
+To correct the line ending, there are support shapes to fill the missing rectangle. They can be used like the support shapes (*,o,d) using a dot (.) on one or both ends of a component (have a look at the last resistor in this example:
 \begin{LTXexample}[varwidth=true]
 	\begin{tikzpicture}[line width=3pt,european]
 	\draw (0,0) to[R]++(2,0)to[R]++(0,2)
@@ -1501,33 +3595,27 @@
 \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}
+\section{Colors}
 
-\subsection{Anchors}
+\subsection{Shape colors}
 
-In order to allow connections with other components, all components define anchors. 
+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]!.
 
-\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}:
-
+Compare for instance
 \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}
+\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 
+\begin{circuitikz} \draw[color=red]
   (0,2) node[and port] (myand1)  {}
   (0,0) node[and port] (myand2)  {}
   (2,1) node[xnor port] (myxnor)  {}
@@ -1536,536 +3624,345 @@
 ;\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)
+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}
 
-\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}):
-
+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) node[nmos] (mos)  {}
-  (mos.gate) node[anchor=east] {G}
-  (mos.drain) node[anchor=south] {D}
-  (mos.source) node[anchor=north] {S}
+\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) node[pigfete] (pigfete)  {}
-  (pigfete.G) node[anchor=east] {G}
-  (pigfete.D) node[anchor=north] {D}
-  (pigfete.S) node[anchor=south] {S}
-  (pigfete.bulk) node[anchor=west] {Bulk}
+\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}
 
-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}):
-
+The only way out is to specify different paths:
 \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}
+\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}
 
-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}):
+And yes: this is a bug and \emph{not} a feature\ldots
 
-\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}
+\subsection{Fill colors}
 
+Since version 0.9.0, you can also fill most shapes with a color (the manual specifies which ones are fillable or not). The syntax is quite intuitive:
+
 \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}
+\begin{circuitikz} \draw
+    (0,2) node[and port, fill=yellow] (myand1)  {}
+    (0,0) node[and port, fill=cyan] (myand2)  {}
+    (2,1) node[xnor port,fill=red!30!white] (myxnor)  {}
+  (myand1.out) -| (myxnor.in 1)
+  (myand2.out) -| (myxnor.in 2)
 ;\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}):
+You can combine shape colors with fill colors, too, but you should use the \texttt{draw} color option style for this:
 
 \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] {}
+\begin{circuitikz} \draw[color=red]
+    (0,2) node[and port, fill=yellow] (myand1)  {1}
+    (0,0) node[and port, fill=cyan] (myand2)  {2}
+    (2,1) node[xnor port,fill=red!30!white] (myxnor)  {3}
+  (myand1.out) -| (myxnor.in 1)
+  (myand2.out) -| (myxnor.in 2)
 ;\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.bulk) node[anchor=west] {Bulk}
-  (pigfete.G) node[anchor=east] {G}
-  (pigfete.D) node[anchor=south] {D}
-  (pigfete.S) node[anchor=north] {S}
-;\end{circuitikz}
-\end{LTXexample}
+This is because, as you can see from the following example in port \texttt{2}, you can't specify both a fill and a color in the node (yes, it's a bug too, but it's quite complex to solve given the current circuit\TikZ{} architecture).  a workaround is shown in port \texttt{3}:
 
-\begin{LTXexample}[varwidth=true]
-   \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:
-\label{bipole-naming}
 \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) 
+\begin{circuitikz} \draw
+  (0,2) node[and port, color=black] (myand1)  {1}
+  (0,0) node[and port, color=blue, fill=cyan] (myand2)  {2}
+  (2,1) {[color=blue] node[xnor port, fill=cyan] (myxnor)  {3}}
+  (myand1.out) -| (myxnor.in 1)
+  (myand2.out) -| (myxnor.in 2)
 ;\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}
+Notice also that the connection point are always filled, although the color \emph{tries} to follow the color of the filling of the component:
 
-The ports of the mixer and adder can be addressed with numbers or \texttt{west}/\texttt{south}/\texttt{east}/\texttt{north}:
-\begin{LTXexample}[varwidth=true]
-\begin{circuitikz} \draw 
-  (0,0) node[mixer] (mix) {}
-  (mix.1) node[left] {1}
-  (mix.2) node[below] {2}
-  (mix.3) node[right] {3}
-  (mix.4) node[above] {4}
-;\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}}
-  ;
+\begin{LTXexample}[varwidth=true, pos=t]
+\begin{circuitikz}
+    \fill[cyan] (0,3.0) rectangle (7,7);
+    \draw [fill=yellow, ] (4,4) to [D,o-o] ++(0,2) to[D*, fill=yellow] ++(2,0)
+    to[D*] ++(0,-2)  to[D, fill=red, o-o] ++(-2,0);
+    \draw (1,4) node[ocirc]{} -- ++(1,0) node[ocirc]{};
+    \draw (1,4.5) to[short, o-o] ++(1,0) to[short, -o] ++(1,0);
+    \draw[fill=yellow] (1,5) to[short, o-o] ++(1,0) to[short, -o] ++(1,0);
+    \draw (1,5.5) to[short, fill=red, o-o] ++(1,0) to[short, -o] ++(1,0);
 \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:
+\section{FAQ}
 
-\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.up) --++(0,0.5) node[vcc]{5\,\textnormal{V}}
-  (opamp.down) --++(0,-0.5) node[vee]{-5\,\textnormal{V}}
-;\end{circuitikz}
-\end{LTXexample}
+\noindent Q: When using \verb!\tikzexternalize! I get the following error:
+\begin{verbatim}
+ ! Emergency stop.
+\end{verbatim}
 
-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}
+\noindent A: The \TikZ\ manual states:
+\begin{quotation}
+Furthermore, the library assumes that all \LaTeX\ pictures are ended
+    with \\\verb!\end{tikzpicture}!.
+\end{quotation}
 
-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}
+Just substitute every occurrence of the environment \verb!circuitikz! with \verb!tikzpicture!. They are actually pretty much the same.
 
-\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:
+\bigskip
 
-\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}
+\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 
-  (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}
+\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}
 
-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}
+\bigskip
 
+\noindent Q: I cannot write \verb!to[R = $R_1=12V$]! nor \verb!to[ospst = open, 3s]!: I get errors.
 
-\subsection{Input arrows}
-\subsubsection*{Two ports}
-With the option \texttt{>} you can draw an arrow to the input of the block diagram symbols.
-\begin{LTXexample}[varwidth=true]
-\begin{circuitikz} \draw
-  (0,0) to[short,o-] ++(0.3,0)
-  to[lowpass,>] ++(2,0)
-  to[adc,>] ++(2,0)
-  to[short,-o] ++(0.3,0);
-\end{circuitikz}
-\end{LTXexample}
+\noindent A: It is a limitation of the parser.
 
+Use \verb|\def{\eq}{=}|  \verb!to[R = $R_1\eq 12V$]! and  \verb!to[ospst = open{,} 3s]! instead; see caveat in section~\ref{sec:labels-and-annotations}.
 
-\subsubsection*{Multi ports}
-Since inputs and outputs can vary, input arrows can be placed as nodes. Note that you have to rotate the arrow on your own:
-\begin{LTXexample}[varwidth=true]
-\begin{circuitikz} \draw
-  (0,0) node[mixer] (m) {}
-  (m.1) to[short,-o] ++(-1,0)
-  (m.2) to[short,-o] ++(0,-1)
-  (m.3) to[short,-o] ++(1,0)
-  (m.1) node[inputarrow] {}
-  (m.2) node[inputarrow,rotate=90] {};
-\end{circuitikz}
-\end{LTXexample}
 
+\section{Defining new components}
 
-\subsection{Labels and custom twoport boxes}
-Some twoports have the option to place a normal label (\texttt{l=}) and a inner label (\texttt{t=}).
-\begin{LTXexample}[varwidth=true]
+\begin{quote}
+    Per me si va ne la città dolente,\\
+    per me si va ne l'etterno dolore,\\
+    per me si va tra la perduta gente.\\
+    \dots\\
+    Lasciate ogne speranza, voi ch'intrate.%
+    \footnote{\url{https://classicsincontext.wordpress.com/2010/02/28/canto-iii-per-me-si-va-ne-la-citta-dolente/}}
+\end{quote}
+
+
+\textbf{Big fat warning}: this material is reserved to \TeX-hackers; do not delve into this if you have no familiarity with (at least) a bit of core \TeX{} programming and to the basic \TikZ{} layer. You have been warned.
+
+
+\subsection{Suggested setup}
+
+The suggested way to start working on a new component is to use the utilities of the \Circuitikz{} manual for checking and testing your device. Basically, find (or download) the source code of the last version of \Circuitikz{} and find the file \texttt{ctikzmanutils.sty}; copy it in your directory and prepare a file like this:
+
+\begin{lstlisting}
+\documentclass[a4paper, titlepage]{article}
+\usepackage{a4wide}	%smaller borders
+\usepackage[utf8]{inputenc}
+\usepackage[T1]{fontenc}
+\parindent=0pt
+\parskip=4pt plus 6pt minus 2pt
+\usepackage[siunitx, RPvoltages]{circuitikz}
+\usepackage{ctikzmanutils}
+\makeatletter
+%%  Test things here
+% defines
+
+% components
+
+% paths
+\makeatother
+
+\begin{document}
+
+\circuitdescbip*{damper}{Mechanical damping\footnotemark}{}(left/135/0.2, right/45/0.2, center/-90/0.3)
+
+\geolrcoord{dampershape, fill=yellow}
+
+\begin{LTXexample}[varwidth]
 \begin{circuitikz}
-  \ctikzset{bipoles/amp/width=0.9}
-  \draw (0,0) to[amp,t=LNA,l_=$F{=}0.9\,$dB,o-o] ++(3,0);
+    \draw (0,0) to[R] ++(2,0)
+    to[damper] ++(2,0);
 \end{circuitikz}
 \end{LTXexample}
+\end{document}
+\end{lstlisting}
 
+This will compile in something like this (in this case, we are using a couple of existing components to check everything is ok):
 
-\subsection{Box option}
-Some devices have the possibility to add a box around them. The inner symbol scales down to fit inside the box.
-\begin{LTXexample}[varwidth=true]
-\begin{circuitikz} \draw
-  (0,0) node[mixer,box,anchor=east] (m) {}
-    to[amp,box,>,-o] ++(2.5,0)
-  (m.west) node[inputarrow] {} to[short,-o] ++(-0.8,0)
-  (m.south) node[inputarrow,rotate=90] {} --
-    ++(0,-0.7) node[oscillator,box,anchor=north] {};
-\end{circuitikz}
-\end{LTXexample}
+\circuitdescbip*{damper}{Mechanical damping\footnotemark}{}(left/135/0.2, right/45/0.2, center/-90/0.3)
 
+\geolrcoord{dampershape, fill=yellow}
 
-\subsection{Dash optional parts}
-To show that a device is optional, you can dash it. The inner symbol will be kept with solid lines.
-\begin{LTXexample}[varwidth=true]
+\begin{LTXexample}[varwidth]
 \begin{circuitikz}
-  \draw (0,0) to[amp,l=\SI{10}{dB}] ++(2.5,0);
-  \draw[dashed] (2.5,0) to[lowpass,l=opt.] ++(2.5,0);
+    \draw (0,0) to[R] ++(2,0)
+    to[damper] ++(2,0);
 \end{circuitikz}
 \end{LTXexample}
 
-\subsection{Transistor paths}\label{sec:transasbip}
+The command \verb|circuitdescbip*| is used to show the component description (you can check the definition and the usage looking at \texttt{ctikzmanutils.sty} file, and the \verb|\geolrcoord| is used to show the main anchors (geographical plus \texttt{left} and \texttt{right}) of the component.
 
-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}
+From now on, you can add the new commands for the component between the \verb|\makeatletter| and \verb|\makeatother| commands and, modifying the example, check the results.
 
-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}
+\subsection{Path-style component}
 
-The \texttt{name} property is available also for bipoles, although this is useful mostly for triac, potentiometer and thyristor (see~\ref{sec:othertrip}).
+Let's define for example a path style component, like the one suggested by the user \texttt{@alex} on \href{https://tex.stackexchange.com/questions/484268/combined-spring-damper-in-circuitikz}{tex.stackexchange.com}. The component will be a mix of the \texttt{damper} and the \texttt{spring} components already present.
 
-\section{Customization}
+The first step is to check if we can use the definition already existing for similar elements (for coherence of size) or if we need to define new ones; for this you have to check the file \texttt{pgfcirc.defines.tex}: we find
 
-\subsection{Parameters}
+\begin{lstlisting}
+    \ctikzset{bipoles/spring/height/.initial=.5}
+    \ctikzset{bipoles/spring/width/.initial=.5}
+    \ctikzset{bipoles/damper/height/.initial=.35}
+    \ctikzset{bipoles/damper/length/.initial=.3}
+    \ctikzset{bipoles/damper/width/.initial=.4}
+\end{lstlisting}
 
-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.
+We will use them; at this stage you can decide to add other parameters if you need them. (Notice, however, than although flexibility is good, these parameters should be described in the manual, otherwise they're as good as a fixed number in the code).
 
-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}
+To define the new component we will look into \texttt{pgfcircbipoles.tex} and we will copy, for example, the definition of the damper into our code, just changing the name:
 
-\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}
+\begin{lstlisting}
+%% mechanical resistor - damper
+\pgfcircdeclarebipole
+{}                                   % extra anchors
+{\ctikzvalof{bipoles/damper/height}} % depth (under the path line)
+{viscoe}                             % name
+{\ctikzvalof{bipoles/damper/height}} % height (above the path line)
+{\ctikzvalof{bipoles/damper/width}}  % width
+{ % draw the bipole
+    \pgfpathrectanglecorners{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf at circ@res at right}{\pgf at circ@res at down}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgf at circ@maybefill
 
-\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}
+    % line into the damper
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf at circ@res at right}
+        {\pgf at circ@res at zero}}
+    \pgfusepath{stroke}
 
+    % damper box
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
 
-\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}
+    \pgfsetrectcap
+    \pgfsetmiterjoin
+    \pgfusepath{stroke}
 
-\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}
+    % damper vertical element
+    \pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf at circ@res at right}
+        {.8\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf at circ@res at right}
+        {.8\pgf at circ@res at up}}
+    \pgfsetbuttcap
+    \pgfusepath{stroke}
+}
+\end{lstlisting}
 
-\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:
+This command will define a shape that is named \texttt{viscoeshape}, with all the correct geographical anchors based on the depth, height and width defined in the parameters of \verb|\pgfcircdeclarebipole|. This is not sufficient for using the element in a \texttt{to[]} path command; you need to ``activate'' it with (this commands are normally in \texttt{pgfcircpath.tex}):
 
-\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}
+\begin{lstlisting}
+\def\pgf at circ@viscoe at path#1{\pgf at circ@bipole at path{viscoe}{#1}}
+\compattikzset{viscoe/.style = {\circuitikzbasekey,
+        /tikz/to path=\pgf at circ@dviscoe at path, l=#1}}
+\end{lstlisting}
 
-\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}
+And now you can show it with:
 
-\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{lstlisting}
+\circuitdescbip*{viscoe}{Mechanical viscoelastic element\footnotemark}{}(left/135/0.2, right/45/0.2, center/-90/0.3)
 
-\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}
+\geolrcoord{viscoeshape, fill=yellow}
 
-\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}
+\begin{LTXexample}[varwidth]
+\begin{circuitikz}
+    \draw (0,0) to[spring] ++(2,0)
+    to[viscoe] ++(2,0);
+\end{circuitikz}
 \end{LTXexample}
+\end{lstlisting}
 
-\subsection{Colors}
+Obviously, at first you you just have a component that is the same as the one you copied with another name. It is now just a matter of modifying it so that it has the desired shape; in the example above you can already see the new symbol after the changes.
 
-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]!.
+When doing the drawing, the \verb|\pgfcircdeclarebipole| will setup the lengths \verb|\pgf at circ@res at right|
+and \verb|\pgf at circ@res at up| as the $x$-$y$ coordinates of the upper right corner, and
+\verb|\pgf at circ@res at left|  and \verb|\pgf at circ@res at down| as the $x$-$y$ coordinates of the lower left corner of your shape. The \texttt{center} coordinate is usually at $(0pt, 0pt)$.
 
-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}
+Looking at the implementation of the \texttt{spring} element, a possible implementation is changing the lines between  lines~12 and~16 with:
 
-and
+\begin{lstlisting}
+    % spring into the damper
+    \pgfscope
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+        \pgfsetcornersarced{\pgfpoint{.25\pgf at circ@res at up}{.25\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{.75\pgf at circ@res at left}{.75\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{.5\pgf at circ@res at left}{-.75\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{.25\pgf at circ@res at left}{.75\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{0pt}{-.75\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf at circ@res at right}{.75\pgf at circ@res at up}}
+        \pgfusepath{stroke}
+    \endpgfscope
+\end{lstlisting}
 
-\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}
+which leads to:
 
-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}
+\circuitdescbip*{viscoe}{Mechanical viscoelastic element\footnotemark}{}(left/135/0.2, right/45/0.2, center/-90/0.3)
 
-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}
+\geolrcoord{viscoeshape, fill=yellow}
 
-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}
+\begin{LTXexample}[varwidth]
+\begin{circuitikz}
+    \draw (0,0) to[spring] ++(2,0)
+    to[viscoe] ++(2,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
+As a final note, notice that the \texttt{viscoe} element is already added to the standard package.
 
-\section{FAQ}
+\subsection{Node-style component}
 
-\noindent Q: When using \verb!\tikzexternalize! I get the following error:
-\begin{verbatim}
- ! Emergency stop.
-\end{verbatim}
+Adding a node-style component is much more straightforward. Just define it by following examples in, for example, \texttt{pgfcirctripoles.tex} or the other files; be careful that you should define all the geographical anchors of the shape if you want that the \TikZ{} positioning options (like \texttt{left}, \texttt{above}, etc.) behave correctly with your component.
 
-\noindent A: The \TikZ\ manual states:
-\begin{quotation}
-Furthermore, the library assumes that all \LaTeX\ pictures are ended
-    with \verb!\end{tikzpicture}!.
-\end{quotation}
+\subsubsection{Finishing your work}
 
-Just substitute every occurrence of the environment \verb!circuitikz! with \verb!tikzpicture!. They are actually pretty much the same.
+Once you have a satisfactory element, you should
+\begin{itemize}
+    \item Clean up your code;
+    \item write a piece of documentation explaining its use with example;
+    \item Propose the element for inclusion in the GitHub page of the project (you will have to license this as explained in that page, of course).
+\end{itemize}
 
-\bigskip
+The best way of contributing is forking the project, adding your component in the correct files, modify the manual and creating a pull request for the developers to merge. Anyway, if this is a problem, just open an issue and someone (when they have time\dots) will answer.
 
-\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
+\section{Examples}
 
-\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)
@@ -2072,9 +3969,9 @@
         to[R, l=2.2<\kilo\ohm>] (4,3) -- (4,2)
         to[L, l=12<\milli\henry>, i=$i_1$,v=b] (4,0) -- (0,0)
   (4,2) { to[D*, *-*, color=red] (2,0) }
-  (0,2) to[R, l=1<\kilo\ohm>, *-] (2,2) 
+  (0,2) to[R, l=1<\kilo\ohm>, *-] (2,2)
         to[cV, i=1,v=$\SI{.3}{\kilo\ohm} i_1$] (4,2)
-  (2,0) to[I, i=1<\milli\ampere>, -*] (2,2) 
+  (2,0) to[I, i=1<\milli\ampere>, -*] (2,2)
 ;\end{circuitikz}
 \end{LTXexample}
 
@@ -2088,7 +3985,7 @@
   (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}
@@ -2102,10 +3999,10 @@
         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}  
+  (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) {}
@@ -2117,16 +4014,16 @@
 
 \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}$}
+    (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)
@@ -2142,44 +4039,44 @@
     \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} 
+          (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) 
+    \draw [dotted] (-1,1) -- (-1,0) (1,-1) -- (1,0)
           (-1,1) -- (0,1) (1,-1) -- (0,-1);
-   \end{scope}  
+   \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}
+    \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}
 
 
@@ -2194,7 +4091,7 @@
 \usetikzlibrary{circuits.ee.IEC}
 \usetikzlibrary{positioning}
 
-\usepackage[compatibility]{circuitikz}
+\usepackage[compatibility]{circuitikzgit}
 \ctikzset{bipoles/length=.9cm}
 
 \begin{document}
@@ -2211,7 +4108,7 @@
 % % changelog.tex will be updated by makefile from CHANGELOG.md
 \section{Changelog}
 \IfFileExists{changelog.tex}
-{\input{changelog.tex}}
+{\sloppy\input{changelog.tex}}
 {The file changelog.tex was not found, run 'make changelog' at toplevel to generate it with pandoc from CHANGELOG.md}
 
 \printindex

Modified: trunk/Master/texmf-dist/doc/latex/circuitikz/compatibility.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuitikz/compatibility.tex	2019-05-10 21:14:43 UTC (rev 51070)
+++ trunk/Master/texmf-dist/doc/latex/circuitikz/compatibility.tex	2019-05-10 21:15:08 UTC (rev 51071)
@@ -4,7 +4,7 @@
 \usetikzlibrary{circuits.ee.IEC}
 \usetikzlibrary{positioning}
 
-\usepackage[compatibility]{circuitikz}
+\usepackage[compatibility, RPvoltages]{circuitikz}
 \ctikzset{bipoles/length=.9cm}
 
 \begin{document}

Added: trunk/Master/texmf-dist/doc/latex/circuitikz/ctikzmanutils.sty
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuitikz/ctikzmanutils.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/circuitikz/ctikzmanutils.sty	2019-05-10 21:15:08 UTC (rev 51071)
@@ -0,0 +1,123 @@
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{ctikzmanutils}[2019/04/14 utilities for formatting circuitikz manual]
+\RequirePackage{ifthen}
+\RequirePackage{xparse}
+\RequirePackage{showexpl}
+%
+% The following trick is used to silence showexpl a bit, so that the
+% logs are readable...
+%
+\makeatletter
+\let\SX at Info=\relax % silence showexpl a bit...
+\makeatother
+%
+\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,breaklines=true,
+    basicstyle=\normalsize\ttfamily,tabsize=3}
+
+%
+% draw the shape without affecting anything
+\newcommand{\drawphantomshape}[1] {%
+    {\tikz [overlay, color=blue] \path (0,0) node[#1]{};}
+}
+%% New circuit description macros
+\newcommand{\twopartbox}[2]{%
+    \leavevmode\null\par\noindent\fbox{\parbox[c]{0.3\linewidth}{#1} \parbox[c]{0.6\linewidth}{\raggedright #2}\par\noindent}%
+}
+% filling color for filled-enabled component
+\colorlet{fillcol}{cyan!30!white}
+% description of a node component:
+% optional star for fillable
+% optional: scale of the component in the entry
+% mandatory  shape name, description, node text:
+% optional between (): anchor specification list
+\NewDocumentCommand{\circuitdesc}{s O{1} m m m d()}
+{
+    \twopartbox{%
+        \begin{circuitikz}[]
+            \IfBooleanTF{#1}{%
+                \draw (0,0) node[#3,scale=#2, fill=fillcol](N){#5};
+                }{
+                \draw (0,0) node[#3,scale=#2](N){#5};
+            }
+            \IfValueT{#6}{%
+                \foreach \n/\a/\d in {#6} \path(N.\n) \showcoord(\n)<\a:\d>;
+            }
+        \end{circuitikz}%
+        }{\sloppy%
+        {#4, type: node\IfBooleanT{#1}{, fillable}%
+    } (\texttt{node[#3]\{#5\}}) \index{#3} }
+}
+% description of a path-style component:
+% optional: main name, if different from above
+% mandatory component name, description, comma separated alias
+% optional between (): anchor specification list
+\NewDocumentCommand{\circuitdescbip}{s o m m m d()}
+{
+\index{#3} \tikz\foreach \i in {#5} {\index{\i|see{#3}} };
+    \twopartbox{%
+        \begin{circuitikz}
+        \IfBooleanTF{#1}{%
+            \draw (0,0) to[#3, name=B, fill=fillcol] (2,0);
+            }{
+            \draw (0,0) to[#3, name=B] (2,0);
+        }
+        \IfValueT{#6}{%
+                \foreach \n/\a/\d in {#6} \path(B.\n) \showcoord(\n)<\a:\d>;
+            }
+        \end{circuitikz}%
+        }{\sloppy%
+        \texttt{\textbf{#3}}: #4, \texttt{type: path-style\IfBooleanT{#1}{, fillable}%
+            \IfValueTF{#2}{%
+                , nodename: #2shape.%\drawphantomshape{#2shape}%
+            }{
+                , nodename: #3shape.%\drawphantomshape{#3shape}%
+            }
+        }%
+        \ifthenelse{\equal{#5}{}}{}{%
+        Aliases: \texttt{#5}.}%
+    }
+}
+
+
+%new environment for grouping descriptions
+\newenvironment{groupdesc}{\medskip\begingroup}{\endgroup\par\medskip\par\noindent}
+
+% command to show anchors: (name)<angle>
+% usage in path: \path (anchor) \coord(anchor)<60>
+\makeatletter % we use the internal circuitikz base length
+\def\showcoord(#1)<#2:#3>{%
+    node[circle, red, draw, inner sep=1pt,pin={%
+        [red, inner sep=0.5pt, font=\small,
+        pin distance=#3\pgf at circ@Rlen, pin edge={red, }%
+    ]#2:#1}](#1){}}
+\makeatother
+% show anchors of a node component:
+% optional: options of the circuitikz environment
+% mandatory  node spec, node text
+% optional between (): anchor specification list
+\NewDocumentCommand{\showanchors}{O{} m m d()}
+{
+        \begin{circuitikz}[#1]
+                \draw (0,0) node[#2](N){#3};
+            \IfValueT{#4}{%
+                \foreach \n/\a/\d in {#4} \path(N.\n) \showcoord(\n)<\a:\d>;
+            }
+        \end{circuitikz}%
+}
+
+
+\def\geolrcoord#1{\showanchors{#1}{text}(north/90/0.4, north east/45/0.4, east/0/0.4,
+    south east/-45/0.4,
+    south/-90/0.4, south west/-135/0.4, west/180/0.4, north west/135/0.4,
+    left/160/0.4, right/30/0.4, center/-120/0.3
+    )
+}
+
+\def\geocoord#1{\showanchors{#1}{text}(north/90/0.4, north east/45/0.4, east/0/0.4,
+    south east/-45/0.4,
+    south/-90/0.4, south west/-135/0.4, west/180/0.4, north west/135/0.4,
+    center/-120/0.3
+    )
+}


Property changes on: trunk/Master/texmf-dist/doc/latex/circuitikz/ctikzmanutils.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/context/third/circuitikz/t-circuitikz.tex
===================================================================
--- trunk/Master/texmf-dist/tex/context/third/circuitikz/t-circuitikz.tex	2019-05-10 21:14:43 UTC (rev 51070)
+++ trunk/Master/texmf-dist/tex/context/third/circuitikz/t-circuitikz.tex	2019-05-10 21:15:08 UTC (rev 51071)
@@ -1,5 +1,5 @@
-\def\pgfcircversion{0.8.3}
-\def\pgfcircversiondate{2017/05/28}
+\def\pgfcircversion{0.9.0}
+\def\pgfcircversiondate{2019/05/10}
 \writestatus{loading}{\pgfcircversiondate{} The CircuiTikz circuit drawing package version \pgfcircversion}
 
 \usemodule[tikz]
@@ -6,7 +6,7 @@
 
 \startmodule[circuitikz]
 \usetikzlibrary[calc]
-\usetikzlibrary[arrows]
+\usetikzlibrary[arrows.meta, bending]
 
 \unprotect
 

Modified: trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex	2019-05-10 21:14:43 UTC (rev 51070)
+++ trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex	2019-05-10 21:15:08 UTC (rev 51071)
@@ -15,6 +15,68 @@
 \newdimen\pgf at circ@res at temp
 % inital thickness
 \newdimen \pgfstartlinewidth
+
+% arrow tips, ported over old arrows library (deprecated)
+% see https://tex.stackexchange.com/questions/234084/latex-arrow-tip-with-arrows-meta-library
+% this was the original definition of latex' tips, renamed to avoid clashes
+%
+\pgfarrowsdeclare{latexslim}{latexslim}
+{
+  \pgfutil at tempdima=0.28pt%
+  \advance\pgfutil at tempdima by.3\pgflinewidth%
+  \pgfarrowsleftextend{+-4\pgfutil at tempdima}
+  \pgfarrowsrightextend{+6\pgfutil at tempdima}
+}
+{
+  \pgfutil at tempdima=0.28pt%
+  \advance\pgfutil at tempdima by.3\pgflinewidth%
+  \pgfpathmoveto{\pgfqpoint{6\pgfutil at tempdima}{0\pgfutil at tempdima}}
+  \pgfpathcurveto
+  {\pgfqpoint{3.5\pgfutil at tempdima}{.5\pgfutil at tempdima}}
+  {\pgfqpoint{-1\pgfutil at tempdima}{1.5\pgfutil at tempdima}}
+  {\pgfqpoint{-4\pgfutil at tempdima}{3.75\pgfutil at tempdima}}
+  \pgfpathcurveto
+  {\pgfqpoint{-1.5\pgfutil at tempdima}{1\pgfutil at tempdima}}
+  {\pgfqpoint{-1.5\pgfutil at tempdima}{-1\pgfutil at tempdima}}
+  {\pgfqpoint{-4\pgfutil at tempdima}{-3.75\pgfutil at tempdima}}
+  \pgfpathcurveto
+  {\pgfqpoint{-1\pgfutil at tempdima}{-1.5\pgfutil at tempdima}}
+  {\pgfqpoint{3.5\pgfutil at tempdima}{-.5\pgfutil at tempdima}}
+  {\pgfqpoint{6\pgfutil at tempdima}{0\pgfutil at tempdima}}
+  \pgfpathclose
+  \pgfusepathqfill
+}
+
+\pgfarrowsdeclarereversed{latexslim reversed}{latexslim reversed}{latexslim}{latexslim}
+
+%% Macro to fill or draw
+
+\def\pgf at circ@draworfill{%
+    \ifx\tikz at fillcolor\pgfutil at empty
+        \pgfusepath{draw}
+    \else
+        \pgfsetfillcolor{\tikz at fillcolor}
+        \pgfusepath{draw, fill}
+    \fi
+}
+
+\def\pgf at circ@draworfillandclip{%
+    \ifx\tikz at fillcolor\pgfutil at empty
+        \pgfusepath{draw, clip}
+    \else
+        \pgfsetfillcolor{\tikz at fillcolor}
+        \pgfusepath{draw, clip, fill}
+    \fi
+}
+
+\def\pgf at circ@maybefill{%
+    \ifx\tikz at fillcolor\pgfutil at empty
+        \pgfusepath{discard}
+    \else
+        \pgfsetfillcolor{\tikz at fillcolor}
+        \pgfusepath{fill}
+    \fi
+}
 %% Keys
 
 \long\def\pgf at circ@comment#1{}
@@ -30,8 +92,18 @@
 
 \newif\ifpgf at circ@siunitx
 \newif\ifpgf at circuit@compat
-\newif\ifpgf at circ@oldvoltagedirection
+\newif\ifpgf at circ@oldvoltagedirection % default false
+\newif\ifpgf at circ@explicitvdir
+\newif\ifpgf at circ@fixbatteries
 
+\ctikzset{voltage dir/.is choice}
+\ctikzset{voltage dir/old/.code={\pgf at circ@oldvoltagedirectiontrue\pgf at circ@fixbatteriesfalse}}
+\ctikzset{voltage dir/noold/.code={\pgf at circ@oldvoltagedirectionfalse\pgf at circ@fixbatteriesfalse}}
+\ctikzset{voltage dir/RP/.code={\pgf at circ@oldvoltagedirectiontrue\pgf at circ@fixbatteriestrue}}
+\ctikzset{voltage dir/EF/.code={\pgf at circ@oldvoltagedirectionfalse\pgf at circ@fixbatteriestrue}}
+\tikzset{voltage dir/.style={circuitikz/voltage dir=#1}}
+
+
 % Option ">" for twoports
 \newif\ifpgf at circuit@inputarrow
 \ctikzset{>/.add code={}{\pgf at circuit@inputarrowtrue}}
@@ -54,18 +126,25 @@
 % Option "t=*" for nodes
 \pgfkeys{/tikz/t/.add code={}{\ctikzset{text=#1}}}
 
+\ctikzset{current arrow scale/.initial=16}
 
-
 \ctikzset{bipoles/.is family}
 \ctikzset{bipoles/border margin/.initial=1.1}
-\ctikzset{bipoles/thickness/.initial=2} 
+\ctikzset{bipoles/thickness/.initial=2}
+\ctikzset{tripoles/thickness/.initial=2}
+\ctikzset{quadpoles/thickness/.initial=2}
 \ctikzset{nodes width/.initial=.04}
-\newdimen\pgf at circ@Rlen 
+
+% Base len for all circuitikz
+\newdimen\pgf at circ@Rlen
 \ctikzset{bipoles/length/.code={\pgf at circ@Rlen = #1}}
 \pgf at circ@Rlen = 1.4cm
 
 \ctikzset{monopoles/.is family}
 \ctikzset{monopoles/ground/width/.initial=.25}
+\ctikzset{monopoles/ground/connectionthickness/.initial=1}
+\ctikzset{monopoles/ground/thickness/.initial=2}
+\ctikzset{monopoles/rground/thickness/.initial=2}
 \ctikzset{monopoles/tground/thickness/.initial=3}
 \ctikzset{monopoles/vcc/width/.initial=.2}
 \ctikzset{monopoles/match/width/.initial=.4}
@@ -72,17 +151,36 @@
 \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/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/label/xanchor/.initial=.4}
+\ctikzset{monopoles/rxantenna/label/yanchor/.initial=.75}
 \ctikzset{monopoles/rxantenna/width/.initial=.25}
+\ctikzset{monopoles/bareantenna/width/.initial=.25}
+\ctikzset{monopoles/bareantenna/label/xanchor/.initial=1}
+\ctikzset{monopoles/bareantenna/label/yanchor/.initial=0.5}
+\ctikzset{monopoles/waves/width/.initial=0.5}
+% microstrips
+\ctikzset{bipoles/mstline/height/.initial=0.3}
+\ctikzset{bipoles/mstline/width/.initial=1.2}
+\pgfkeys{/tikz/mstlinelen/.add code={}{\ctikzset{bipoles/mstline/width=#1}}}
+\ctikzset{monopoles/msport/width/.initial=.5}
+\ctikzset{monopoles/msrstub/height/.initial=1.0}
+\ctikzset{monopoles/msrstub/width/.initial=0.6}
 
+% microphone and loudspeaker
+\ctikzset{bipoles/loudspeaker/height/.initial=.8}
+\ctikzset{bipoles/loudspeaker/depth/.initial=.3}
+\ctikzset{bipoles/loudspeaker/width/.initial=.8}
+\ctikzset{bipoles/mic/height/.initial=1.2}
+\ctikzset{bipoles/mic/depth/.initial=.0}
+\ctikzset{bipoles/mic/width/.initial=.8}
+
 \ctikzset{bipoles/resistor/height/.initial=.3}
 \ctikzset{bipoles/resistor/width/.initial=.8}
 \ctikzset{bipoles/potentiometer/height/.initial=.8}
@@ -108,10 +206,22 @@
 \ctikzset{bipoles/vresistor/height/.initial=.6}
 \ctikzset{bipoles/vresistor/width/.initial=.8}
 \ctikzset{bipoles/cuteinductor/height/.initial=.3}
-\ctikzset{bipoles/cuteinductor/lower coil height/.initial=.15}	
+\ctikzset{bipoles/cuteinductor/lower coil height/.initial=.15}
 \ctikzset{bipoles/cuteinductor/width/.initial=.6}
 \ctikzset{bipoles/cuteinductor/coils/.initial=5}
 \ctikzset{bipoles/cuteinductor/coil aspect/.initial=.5}%percentage of inductor width, which is covered by lower coil
+%% Cute choke settings
+\ctikzset{bipoles/cutechoke/height/.initial=.3}
+\ctikzset{bipoles/cutechoke/lower coil height/.initial=.15}
+\ctikzset{bipoles/cutechoke/width/.initial=.6}
+\ctikzset{bipoles/cutechoke/coils/.initial=5}
+\ctikzset{bipoles/cutechoke/coil aspect/.initial=.5}%percentage of choke width, which is covered by lower coil
+\ctikzset{bipoles/cutechoke/cstep/.initial=.3}
+\ctikzset{bipoles/cutechoke/cdist/.initial=1.3}
+\ctikzset{bipoles/cutechoke/cthick/.initial=1}
+\newif\ifpgf at circuit@bipole at twolines
+\pgf at circuit@bipole at twolinesfalse
+%
 \ctikzset{bipoles/americaninductor/height/.initial=.3}
 \ctikzset{bipoles/americaninductor/height 2/.initial=.1}
 \ctikzset{bipoles/americaninductor/width/.initial=.8}
@@ -118,7 +228,7 @@
 \ctikzset{bipoles/americaninductor/coils/.initial=4}
 \ctikzset{bipoles/americaninductor/coil height/.initial=.15}
 \ctikzset{bipoles/vcuteinductor/height/.initial=.6}
-\ctikzset{bipoles/vcuteinductor/lower coil height/.initial=.3}	
+\ctikzset{bipoles/vcuteinductor/lower coil height/.initial=.3}
 \ctikzset{bipoles/vcuteinductor/width/.initial=.6}
 \ctikzset{bipoles/vcuteinductor/coils/.initial=5}
 \ctikzset{bipoles/vcuteinductor/coil aspect/.initial=.5}%percentage of inductor width, which is covered by lower coil
@@ -190,6 +300,10 @@
 \ctikzset{bipoles/battery2/width/.initial=.3}
 \ctikzset{bipoles/diode/height/.initial=.50}
 \ctikzset{bipoles/diode/width/.initial=.40}
+\ctikzset{bipoles/bidirectionaldiode/height/.initial=1.1}
+\ctikzset{bipoles/bidirectionaldiode/width/.initial=1}
+\ctikzset{bipoles/bidirectionaldiode/diode width left/.initial=.3}
+\ctikzset{bipoles/bidirectionaldiode/diode width right/.initial=.3}
 \ctikzset{bipoles/varcap/height/.initial=.50}
 \ctikzset{bipoles/varcap/width/.initial=.45}
 \ctikzset{bipoles/spst/height/.initial=.35}
@@ -197,8 +311,10 @@
 \ctikzset{bipoles/spst/depth/.initial=.2}
 \ctikzset{bipoles/nos/height/.initial=.3}
 \ctikzset{bipoles/nos/width/.initial=.35}
+\ctikzset{bipoles/nos/depth/.initial=.2}
 \ctikzset{bipoles/ncs/height/.initial=.35}
 \ctikzset{bipoles/ncs/width/.initial=.35}
+\ctikzset{bipoles/ncs/depth/.initial=.2}
 \ctikzset{bipoles/generic/height/.initial=.30}
 \ctikzset{bipoles/generic/width/.initial=.80}
 \ctikzset{bipoles/european gas filled surge arrester/height/.initial=.30}
@@ -242,6 +358,15 @@
 \ctikzset{bipoles/ohmmeter/width/.initial=.60}
 \ctikzset{bipoles/voltmeter/height/.initial=.60}
 \ctikzset{bipoles/voltmeter/width/.initial=.60}
+\ctikzset{bipoles/smeter/height/.initial=.60}
+\ctikzset{bipoles/smeter/width/.initial=.60}
+\ctikzset{bipoles/qmeter/depth/.initial=.40}
+\ctikzset{bipoles/qmeter/height/.initial=.80}
+\ctikzset{bipoles/qmeter/width/.initial=.60}
+\ctikzset{bipoles/iloop/width/.initial=.40}
+\ctikzset{bipoles/iloop/height/.initial=.60}
+\ctikzset{bipoles/oscope/height/.initial=.60}
+\ctikzset{bipoles/oscope/width/.initial=.60}
 \ctikzset{bipoles/buffer/height/.initial=1}
 \ctikzset{bipoles/buffer/width/.initial=1}
 \ctikzset{bipoles/not port/width/.initial=1}
@@ -249,6 +374,8 @@
 \ctikzset{bipoles/not port/circle width/.initial=.15}
 \ctikzset{bipoles/lamp/height/.initial=.60}
 \ctikzset{bipoles/lamp/width/.initial=.60}
+\ctikzset{bipoles/bulb/height/.initial=.8}
+\ctikzset{bipoles/bulb/width/.initial=.8}
 \ctikzset{bipoles/tline/height/.initial=.3}
 \ctikzset{bipoles/tline/width/.initial=.8}
 \ctikzset{bipoles/squid/height/.initial=.60}
@@ -259,7 +386,7 @@
 \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/height 2/.initial=.2}
 \ctikzset{bipoles/pushbutton/width/.initial=.50}
 
 \ctikzset{bipoles/twoport/width/.initial=.7}
@@ -283,7 +410,12 @@
 \ctikzset{bipoles/phaseshifter/width/.initial=.7}
 \ctikzset{bipoles/vphaseshifter/width/.initial=.7}
 \ctikzset{bipoles/detector/width/.initial=.7}
+% resistive sensor american style
+\ctikzset{bipoles/resistivesens/height/.initial=.6}
+\ctikzset{bipoles/resistivesens/width/.initial=.8}
 
+% crossing wires
+\ctikzset{bipoles/crossing/size/.initial=.2}
 
 \newif\ifpgf at circuit@trans at depletiontype
 \pgf at circuit@trans at depletiontypefalse
@@ -293,7 +425,7 @@
 \ctikzset{tripoles/mos style/no arrows/.code={\pgf at circuit@mos at arrowsfalse}}
 \ctikzset{tripoles/mos style/arrows/.code={\pgf at circuit@mos at arrowstrue}}
 
-% Option solderdot for fet 
+% Option solderdot for fet
 \newif\ifpgf at circuit@fet at solderdot
 \pgfkeys{/tikz/solderdot/.add code={}{\pgf at circuit@fet at solderdottrue}}
 \ctikzset{solderdot/.add code={}{\pgf at circuit@fet at solderdottrue}}
@@ -300,7 +432,7 @@
 \pgfkeys{/tikz/nosolderdot/.add code={}{\pgf at circuit@fet at solderdotfalse}}
 \ctikzset{nosolderdot/.add code={}{\pgf at circuit@fet at solderdotfalse}}
 
-% Option bodydiode for fet 
+% Option bodydiode for fet
 \newif\ifpgf at circuit@fet at bodydiode
 \pgfkeys{/tikz/bodydiode/.add code={}{\pgf at circuit@fet at bodydiodetrue}}
 \ctikzset{bodydiode/.add code={}{\pgf at circuit@fet at bodydiodetrue}}
@@ -350,6 +482,7 @@
 \ctikzset{tripoles/nmos/height/.initial=1.1}
 \ctikzset{tripoles/nmos/base width/.initial=.5}
 \ctikzset{tripoles/nmos/gate width/.initial=.62}
+\ctikzset{tripoles/nmos/arrow pos/.initial=.6}
 \ctikzset{tripoles/nmos/bodydiode scale/.initial=.3}
 \ctikzset{tripoles/nmos/bodydiode distance/.initial=.3}
 \ctikzset{tripoles/nmos/bodydiode conn/.initial=.6}
@@ -362,11 +495,24 @@
 \ctikzset{tripoles/pmos/height/.initial=1.1}
 \ctikzset{tripoles/pmos/base width/.initial=.5}
 \ctikzset{tripoles/pmos/gate width/.initial=.62}
+\ctikzset{tripoles/pmos/arrow pos/.initial=.4}
 \ctikzset{tripoles/pmos/bodydiode scale/.initial=.3}
 \ctikzset{tripoles/pmos/bodydiode distance/.initial=.3}
 \ctikzset{tripoles/pmos/bodydiode conn/.initial=.6}
 \ctikzset{tripoles/pmos/curr direction/.initial=-1}
 
+\ctikzset{tripoles/hemt/width/.initial=.7}
+\ctikzset{tripoles/hemt/gate height/.initial=.35}
+\ctikzset{tripoles/hemt/base height/.initial=.5}
+\ctikzset{tripoles/hemt/conn height/.initial=0}
+\ctikzset{tripoles/hemt/height/.initial=1.1}
+\ctikzset{tripoles/hemt/base width/.initial=.5}
+\ctikzset{tripoles/hemt/gate width/.initial=.62}
+\ctikzset{tripoles/hemt/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/hemt/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/hemt/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/hemt/curr direction/.initial=1}
+
 \ctikzset{tripoles/nfet/width/.initial=.7}
 \ctikzset{tripoles/nfet/gate height/.initial=.35}
 \ctikzset{tripoles/nfet/base height/.initial=.5}
@@ -470,6 +616,7 @@
 \ctikzset{tripoles/npn/conn height/.initial=0}
 \ctikzset{tripoles/npn/height/.initial=1.1}
 \ctikzset{tripoles/npn/base width/.initial=.5}
+\ctikzset{tripoles/npn/arrow pos/.initial=.5}
 \ctikzset{tripoles/npn/bodydiode scale/.initial=.3}
 \ctikzset{tripoles/npn/bodydiode distance/.initial=.3}
 \ctikzset{tripoles/npn/bodydiode conn/.initial=.6}
@@ -482,6 +629,7 @@
 \ctikzset{tripoles/pnp/conn height/.initial=0}
 \ctikzset{tripoles/pnp/height/.initial=1.1}
 \ctikzset{tripoles/pnp/base width/.initial=.5}
+\ctikzset{tripoles/pnp/arrow pos/.initial=.5}
 \ctikzset{tripoles/pnp/bodydiode scale/.initial=.3}
 \ctikzset{tripoles/pnp/bodydiode distance/.initial=.3}
 \ctikzset{tripoles/pnp/bodydiode conn/.initial=.6}
@@ -579,10 +727,60 @@
 
 \newif\ifpgf at circuit@europeanlogicport
 \ctikzset{logic ports/.is choice}
-\ctikzset{logic ports/european/.code= {\pgf at circuit@europeanlogicporttrue } }
-\ctikzset{logic ports/american/.code= {\pgf at circuit@europeanlogicportfalse } } 
+\ctikzset{logic ports/european/.code= {\pgf at circuit@europeanlogicporttrue
+    \tikzset{and port/.style={shape=european and port}}
+    \tikzset{or port/.style={shape=european or port}}
+    \tikzset{xor port/.style={shape=european xor port}}
+    \tikzset{not port/.style={shape=european not port}}
+    \tikzset{nand port/.style={shape=european nand port}}
+    \tikzset{nor port/.style={shape=european nor port}}
+    \tikzset{xnor port/.style={shape=european xnor port}}
+    } }
+\ctikzset{logic ports/american/.code= {\pgf at circuit@europeanlogicportfalse
+    \tikzset{and port/.style={shape=american and port}}
+    \tikzset{or port/.style={shape=american or port}}
+    \tikzset{xor port/.style={shape=american xor port}}
+    \tikzset{not port/.style={shape=american not port}}
+    \tikzset{nand port/.style={shape=american nand port}}
+    \tikzset{nor port/.style={shape=american nor port}}
+    \tikzset{xnor port/.style={shape=american xnor port}}
+    } }
 
+\ctikzset{logic ports origin/.is choice}
+\ctikzset{logic ports origin/legacy/.code= {
+    \ctikzset{tripoles/american and port/origin/.initial=0.8}
+    \ctikzset{tripoles/american nand port/origin/.initial=0.8}
+    \ctikzset{tripoles/american nor port/origin/.initial=0.8}
+    \ctikzset{tripoles/american or port/origin/.initial=0.8}
+    \ctikzset{tripoles/american xor port/origin/.initial=0.8}
+    \ctikzset{tripoles/american xnor port/origin/.initial=0.8}
+    \ctikzset{tripoles/european and port/origin/.initial=0.8}
+    \ctikzset{tripoles/european nand port/origin/.initial=0.8}
+    \ctikzset{tripoles/european or port/origin/.initial=0.8}
+    \ctikzset{tripoles/european nor port/origin/.initial=0.8}
+    \ctikzset{tripoles/european xor port/origin/.initial=0.8}
+    \ctikzset{tripoles/european xnor port/origin/.initial=0.8}
+    \ctikzset{tripoles/european not port/origin/.initial=0.8}
+    }
+}
+\ctikzset{logic ports origin/center/.code= {
+    \ctikzset{tripoles/american and port/origin/.initial=0}
+    \ctikzset{tripoles/american nand port/origin/.initial=0}
+    \ctikzset{tripoles/american nor port/origin/.initial=0}
+    \ctikzset{tripoles/american or port/origin/.initial=0}
+    \ctikzset{tripoles/american xor port/origin/.initial=0}
+    \ctikzset{tripoles/american xnor port/origin/.initial=0}
+    \ctikzset{tripoles/european and port/origin/.initial=0}
+    \ctikzset{tripoles/european nand port/origin/.initial=0}
+    \ctikzset{tripoles/european or port/origin/.initial=0}
+    \ctikzset{tripoles/european nor port/origin/.initial=0}
+    \ctikzset{tripoles/european xor port/origin/.initial=0}
+    \ctikzset{tripoles/european xnor port/origin/.initial=0}
+    \ctikzset{tripoles/european not port/origin/.initial=0}
+    }
+}
 
+
 \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}
@@ -598,8 +796,8 @@
 \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/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}
@@ -608,8 +806,8 @@
 \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/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}
@@ -616,22 +814,36 @@
 \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 xor port/distance/.initial=.1}
 \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/distance/.initial=.1}
 \ctikzset{tripoles/american xnor port/circle width/.initial=.15}
+\ctikzset{tripoles/american and port/origin/.initial=0.8}
+\ctikzset{tripoles/american and port/inputs/.initial=2}
+% variable number of inputs
+\ctikzset{tripoles/american nand port/origin/.initial=0.8}
+\ctikzset{tripoles/american nand port/inputs/.initial=2}
+\ctikzset{tripoles/american nor port/origin/.initial=0.8}
+\ctikzset{tripoles/american nor port/inputs/.initial=2}
+\ctikzset{tripoles/american nor port/angle/.initial=70}
+\ctikzset{tripoles/american nor port/inner/.initial=0.3}
+\ctikzset{tripoles/american or port/origin/.initial=0.8}
+\ctikzset{tripoles/american or port/inputs/.initial=2}
+\ctikzset{tripoles/american or port/angle/.initial=70}
+\ctikzset{tripoles/american or port/inner/.initial=0.3}
+\ctikzset{tripoles/american xor port/origin/.initial=0.8}
+\ctikzset{tripoles/american xor port/inputs/.initial=2}
+\ctikzset{tripoles/american xor port/angle/.initial=70}
+\ctikzset{tripoles/american xor port/inner/.initial=0.3}
+\ctikzset{tripoles/american xnor port/origin/.initial=0.8}
+\ctikzset{tripoles/american xnor port/inputs/.initial=2}
+\ctikzset{tripoles/american xnor port/angle/.initial=70}
+\ctikzset{tripoles/american xnor port/inner/.initial=0.3}
+
 \ctikzset{tripoles/european and port/width/.initial=1.4}
 \ctikzset{tripoles/european and port/height/.initial=.65}
 \ctikzset{tripoles/european and port/reserved/.initial=.6}
@@ -668,24 +880,102 @@
 \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}
+% variable number of inputs
+\ctikzset{tripoles/european and port/origin/.initial=0.8}
+\ctikzset{tripoles/european and port/inputs/.initial=2}
+\ctikzset{tripoles/european nand port/origin/.initial=0.8}
+\ctikzset{tripoles/european nand port/inputs/.initial=2}
+\ctikzset{tripoles/european or port/origin/.initial=0.8}
+\ctikzset{tripoles/european or port/inputs/.initial=2}
+\ctikzset{tripoles/european nor port/origin/.initial=0.8}
+\ctikzset{tripoles/european nor port/inputs/.initial=2}
+\ctikzset{tripoles/european xor port/origin/.initial=0.8}
+\ctikzset{tripoles/european xor port/inputs/.initial=2}
+\ctikzset{tripoles/european xnor port/origin/.initial=0.8}
+\ctikzset{tripoles/european xnor port/inputs/.initial=2}
+\ctikzset{tripoles/european not port/origin/.initial=0.8}
+\ctikzset{tripoles/european not port/inputs/.initial=1}%
+%%% parameters that are not used anymore after multi-input
+%%% gates --- left for compatibility of source code.
+\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/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}
+% switches for logic gates
+%
+\pgfkeys{/tikz/number inputs/.initial=0}
+\pgfkeys{/tikz/number inputs/.default=0}
+%
+% switches for op amps
+% changing input polarity
+%
+\newif\ifpgf at circuit@oa at iplusup\pgf at circuit@oa at iplusupfalse
+\pgfkeys{/tikz/noinv input up/.add code={}{\pgf at circuit@oa at iplusuptrue}}
+\ctikzset{noinv input up/.add code={}{\pgf at circuit@oa at iplusuptrue}}
+\pgfkeys{/tikz/input noinv down/.add code={}{\pgf at circuit@oa at iplusupfalse}}
+\ctikzset{input noinv down/.add code={}{\pgf at circuit@oa at iplusupfalse}}
+%
+% changing output polarity (for fully diff objects)
+%
+\newif\ifpgf at circuit@oa at oplusup\pgf at circuit@oa at oplusuptrue
+\pgfkeys{/tikz/noinv output up/.add code={}{\pgf at circuit@oa at oplusuptrue}}
+\ctikzset{noinv output up/.add code={}{\pgf at circuit@oa at oplusuptrue}}
+\pgfkeys{/tikz/noinv output down/.add code={}{\pgf at circuit@oa at oplusupfalse}}
+\ctikzset{noinv output down/.add code={}{\pgf at circuit@oa at oplusupfalse}}
+%
 \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= \fontsize{10}{0}\selectfont\boldmath}%absolut font size needed!
+\ctikzset{tripoles/op amp/font/.initial= \fontsize{10}{12}\selectfont\boldmath}%absolute font size needed!
 \ctikzset{tripoles/en amp/width/.initial=1.7}
 \ctikzset{tripoles/en amp/port width/.initial=.7}
 \ctikzset{tripoles/en amp/height/.initial=1.6}
 \ctikzset{tripoles/en amp/input height/.initial=.3}
 \ctikzset{tripoles/en amp/up pos/.initial=.45}
-\ctikzset{tripoles/en amp/font/.initial= \fontsize{10}{0}\selectfont\boldmath}%absolut font size needed!
-\ctikzset{tripoles/en amp/font2/.initial= \fontsize{14}{0}\selectfont\boldmath}%absolut font size needed!
+\ctikzset{tripoles/en amp/font/.initial= \fontsize{10}{12}\selectfont}%absolute font size needed!
+\ctikzset{tripoles/en amp/font2/.initial= \fontsize{12}{14}\selectfont}%absolute font size needed!
+\ctikzset{tripoles/en amp/text/.initial={$\mathstrut{\triangleright}\,{\infty}$}}
+\tikzset{
+    en amp text/.code = {
+        \ctikzsetvalof{tripoles/en amp/text}{#1}
+    },
+    en amp text A/.code = {
+        \ctikzsetvalof{tripoles/en amp/text}{$\mathstrut{\triangleright}\,\mathrm{A}$}
+    },
+}
 \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/inst amp/width/.initial=1.7} % instrumentation amplifier, simple
+\ctikzset{tripoles/inst amp/port width/.initial=.7}
+\ctikzset{tripoles/inst amp/height/.initial=1.4}
+\ctikzset{tripoles/inst amp/input height/.initial=.5}
+\ctikzset{tripoles/inst amp/up pos/.initial=.4}
+\ctikzset{tripoles/inst amp/refv pos/.initial=.7}
+\ctikzset{tripoles/inst amp/font/.initial= \fontsize{10}{0}\selectfont\boldmath}%absolute font size needed!
+\ctikzset{tripoles/fd inst amp/width/.initial=1.7} % instrumentation amplifier, diff output
+\ctikzset{tripoles/fd inst amp/port width/.initial=.7}
+\ctikzset{tripoles/fd inst amp/height/.initial=1.4}
+\ctikzset{tripoles/fd inst amp/input height/.initial=.5}
+\ctikzset{tripoles/fd inst amp/up pos/.initial=.4}
+\ctikzset{tripoles/fd inst amp/refv pos/.initial=.7}
+\ctikzset{tripoles/fd inst amp/font/.initial= \fontsize{10}{0}\selectfont\boldmath}%absolute font size needed!
+\ctikzset{tripoles/inst amp ra/width/.initial=2.4} % instrumentation amplifier with ra gain resistance added
+\ctikzset{tripoles/inst amp ra/port width/.initial=.7}
+\ctikzset{tripoles/inst amp ra/height/.initial=2.9}
+\ctikzset{tripoles/inst amp ra/input height/.initial=.7}
+\ctikzset{tripoles/inst amp ra/up pos/.initial=.4}
+\ctikzset{tripoles/inst amp ra/refv pos/.initial=.7}
+\ctikzset{tripoles/inst amp ra/ra pos/.initial=.6}
+\ctikzset{tripoles/inst amp ra/font/.initial= \fontsize{10}{0}\selectfont\boldmath}%absolute font size needed!
 \ctikzset{tripoles/plain amp/width/.initial=1.7}
 \ctikzset{tripoles/plain amp/port width/.initial=.7}
 \ctikzset{tripoles/plain amp/height/.initial=1.4}
@@ -704,6 +994,12 @@
 \ctikzset{tripoles/triac/diode width left/.initial=.3}
 \ctikzset{tripoles/triac/diode width right/.initial=.3}
 
+%% Cute switches
+\ctikzset{bipoles/cuteswitch/height/.initial=.6}
+\ctikzset{bipoles/cuteswitch/height 2/.initial=.2}
+\ctikzset{bipoles/cuteswitch/width/.initial=.50}
+\ctikzset{bipoles/cuteswitch/thickness/.initial=1}
+
 \ctikzset{tripoles/spdt/width/.initial=.85}
 \ctikzset{tripoles/spdt/height/.initial=.45}
 \ctikzset{tripoles/spdt/margin/.initial=.45}
@@ -740,7 +1036,46 @@
 
 \ctikzset{/tikz/circuitikz/tripoles/magnetron/width/.initial=1}
 
+%
+% multipoles
+%
+\ctikzset{multipoles/thickness/.initial=2}
+\ctikzset{multipoles/font/.initial=\tiny}
+% DIP (dual in line package) chips
+\ctikzset{multipoles/dipchip/width/.initial=1.2}
+\ctikzset{multipoles/dipchip/num pins/.initial=8}
+\ctikzset{multipoles/dipchip/pin spacing/.initial=0.4}
+\pgfkeys{/tikz/num pins/.add code={}{\ctikzset{multipoles/dipchip/num pins=#1}}}
+% QFP (quad flat package) chips
+\ctikzset{multipoles/qfpchip/num pins/.initial=8}
+\ctikzset{multipoles/qfpchip/pin spacing/.initial=0.4}
+\pgfkeys{/tikz/num pins/.add code={}{\ctikzset{multipoles/qfpchip/num pins=#1}}}
+% chip numbers
+\newif\ifpgf at circuit@chip at shownumbers\pgf at circuit@chip at shownumberstrue
+\pgfkeys{/tikz/show numbers/.add code={}{\pgf at circuit@chip at shownumberstrue}}
+\ctikzset{show numbers/.add code={}{\pgf at circuit@chip at shownumberstrue}}
+\pgfkeys{/tikz/hide numbers/.add code={}{\pgf at circuit@chip at shownumbersfalse}}
+\ctikzset{hide numbers/.add code={}{\pgf at circuit@chip at shownumbersfalse}}
+\newif\ifpgf at circuit@chip at straightnumbers\pgf at circuit@chip at straightnumberstrue
+\pgfkeys{/tikz/straight numbers/.add code={}{\pgf at circuit@chip at straightnumberstrue}}
+\ctikzset{straight numbers/.add code={}{\pgf at circuit@chip at straightnumberstrue}}
+\pgfkeys{/tikz/rotated numbers/.add code={}{\pgf at circuit@chip at straightnumbersfalse}}
+\ctikzset{rotated numbers/.add code={}{\pgf at circuit@chip at straightnumbersfalse}}
+% external chip pins
+\ctikzset{multipoles/external pins thickness/.initial=1}
+\ctikzset{multipoles/external pins width/.initial=0.2}
+\ctikzset{multipoles/external pad fraction/.initial=0}
+\pgfkeys{/tikz/external pins width/.add code={}{\ctikzset{multipoles/external pins width=#1}}}
+\pgfkeys{/tikz/external pad fraction/.add code={}{\ctikzset{multipoles/external pad fraction=#1}}}
+% topmarks
+\newif\ifpgf at circuit@chip at topmark\pgf at circuit@chip at topmarktrue
+\pgfkeys{/tikz/topmark/.add code={}{\pgf at circuit@chip at topmarktrue}}
+\ctikzset{topmark/.add code={}{\pgf at circuit@chip at topmarktrue}}
+\pgfkeys{/tikz/no topmark/.add code={}{\pgf at circuit@chip at topmarkfalse}}
+\ctikzset{no topmark/.add code={}{\pgf at circuit@chip at topmarkfalse}}
 
+
+
 % %Mechanical section
 \ctikzset{/tikz/circuitikz/tripoles/elmech/height/.initial=.8}
 \ctikzset{/tikz/circuitikz/tripoles/elmech/width/.initial=.6}
@@ -837,9 +1172,6 @@
 \ctikzset{bipole/nodes/right/diamond/.code={\ctikzsetvalof{bipole/nodes/right}{diamond}}}
 \ctikzset{bipole/nodes/right/rectjoinfill/.code={\ctikzsetvalof{bipole/nodes/right}{rectjoinfill}}}
 
-
-
-
 \newif\ifpgf at circuit@europeanresistor
 \ctikzset{resistor/.is choice}
 \ctikzset{resistor/american/.code = \pgf at circuit@europeanresistorfalse }
@@ -868,7 +1200,6 @@
 \ctikzset{color/.initial=black}
 \pgfkeys{/tikz/color/.add code={}{\ctikzset{color={#1}}}}
 
-
 \newif\ifpgf at circ@siunitx
 \newif\ifpgf at circ@siunitx at res
 
@@ -886,8 +1217,16 @@
 \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/shift/.initial=0.0} % shift form the cable of voltage symbols
+\ctikzset{voltage shift/.style={voltage/shift=#1}}
+\tikzset{voltage shift/.style={\circuitikzbasekey/voltage/shift=#1}}
 \ctikzset{voltage/european label distance/.initial=1.4}
 \ctikzset{voltage/american label distance/.initial=1.1}
+% shaping the +/- sign, see pgfcircvoltage.tex
+\ctikzset{voltage/american font/.initial={}}
+\ctikzset{voltage/american plus/.initial={$+$}}
+\ctikzset{voltage/american minus/.initial={$-$}}
+
 % special cases
 \ctikzset{bipoles/generic/voltage/distance from node/.initial=.4}
 \ctikzset{bipoles/generic/voltage/bump b/.initial=2}
@@ -948,7 +1287,7 @@
 \tikzset{american/.style = { american currents, american voltages, american resistors, american inductors, american ports, american gas filled surge arrester set} }
 \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)
+% I should try to make the tree clearer (this voltage conflicts with the options above)
 
 \newif\ifpgf at circuit@europeanvoltage
 \ctikzset{voltage/.is choice}
@@ -960,6 +1299,9 @@
 \ctikzset{current/american/.code = \pgf at circuit@europeancurrentfalse }
 \ctikzset{current/european/.code = \pgf at circuit@europeancurrenttrue }
 
+% noise sources
+\ctikzset{bipoles/noise sources/fillcolor/.initial=gray!50}
+
 \ctikzset{label/align/.is choice}
 \ctikzset{label/align/straight/.code={\ctikzsetvalof{label/align}{straight}}}
 \ctikzset{label/align/rotate/.code={\ctikzsetvalof{label/align}{rotate}}}

Modified: trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex	2019-05-10 21:14:43 UTC (rev 51070)
+++ trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex	2019-05-10 21:15:08 UTC (rev 51071)
@@ -5,7 +5,7 @@
 % 1. under the LaTeX Project Public License and/or
 % 2. under the GNU Public License.
 %
-% See the file doc/LICENSE for more details.
+% See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
 
 %% Generic macro for defining a bipole shape
 % #1 - additional anchors
@@ -17,158 +17,172 @@
 
 
 \long\def\pgfcircdeclarebipole#1#2#3#4#5#6{
-	\pgfdeclareshape{#3shape}{
-	
-	\savedanchor{\northeast}{
-		\pgf at y=#4\pgf at circ@Rlen
-		\pgf at y=.5\pgf at y
-		\pgf at x=#5\pgf at circ@Rlen
-		\pgf at x=.5\pgf at x
-	}
-	\savedanchor{\northeastborder}{
-		\pgf at y=#4\pgf at circ@Rlen
-		\pgf at y=.5\pgf at y
-		\pgf at y=\ctikzvalof{bipoles/border margin}\pgf at y
-		\pgf at x=#5\pgf at circ@Rlen
-		\pgf at x=.5\pgf at x
-		\pgf at x=\ctikzvalof{bipoles/border margin}\pgf at x
-	}
-	\savedanchor{\southwestborder}{
-		\pgf at y=-#2\pgf at circ@Rlen
-		\pgf at y=.5\pgf at y
-		\pgf at y=\ctikzvalof{bipoles/border margin}\pgf at y
-		\pgf at x=-#5\pgf at circ@Rlen
-		\pgf at x=.5\pgf at x
-		\pgf at x=\ctikzvalof{bipoles/border margin}\pgf at x
-	}
-	\savedanchor{\southwest}{
-		\pgf at y=-#2\pgf at circ@Rlen
-		\pgf at y=.5\pgf at y
-		\pgf at x=-#5\pgf at circ@Rlen
-		\pgf at x=.5\pgf at x
-	}
-	\savedanchor{\centerpoint}{
-		\pgf at circ@res at down=-#2\pgf at circ@Rlen
-		\pgf at circ@res at up=#4\pgf at circ@Rlen
-		\pgfpointorigin
-		\pgf at y=\pgf at circ@res at up
-		\advance\pgf at y by\pgf at circ@res at down
-		\pgf at y=.5\pgf at y
-	}
-	\anchor{center}{\pgfpointorigin}
-	\anchor{n}{
-		\northeast
-		\pgf at x=0cm
-	}
-	\anchor{ne}{
-		\northeast
-	}
-	\anchor{nw}{
-		\northeast
-		\pgf at x=-\pgf at x
-	}
-	\anchor{e}{%
-		\northeast
-		\pgf at y=0cm
-   }
-	\anchor{s}{%
-		\southwest
-		\pgf at x=0cm
-   }
-	\anchor{se}{%
-		\southwest
-		\pgf at x=-\pgf at x
-   }
-	\anchor{sw}{%
-		\southwest
-   }
-	\anchor{w}{
-		\southwest
-		\pgf at y=0cm
-	}
-	\anchor{north}{
-		\northeast
-		\pgf at x=0cm
-	}
-	\anchor{east}{%
-		\northeast
-		\pgf at y=0cm
-   }
-	\anchor{south}{%
-		\southwest
-		\pgf at x=0cm
-   }
-	\anchor{west}{
-		\southwest
-		\pgf at y=0cm
-	}
-	\anchor{right}{
-		\northeast
-		\pgf at y=0cm
-	}
-	\anchor{above}{
-		\northeast
-		\pgf at x=0cm
-	}
-	\anchor{left}{%
-		\southwest
-		\pgf at y=0cm
-   }
-	\anchor{below}{%
-		\southwest
-		\pgf at x=0cm                    
-   }
-	\anchor{a}{%
-		\northeast
-		\pgf at y=0cm
-   }
-	\anchor{b} {
-		\southwest
-		\pgf at y=0cm
-	}
-	\savedanchor{\textanchor}{%
-		\pgf at y=\ht\pgfnodeparttextbox
-		\pgf at x=-.5\wd\pgfnodeparttextbox
-   }
-	\anchor{text}{%
-		\textanchor
-   }
-	\anchorborder{%
-		\ifpgf at circuit@bipole at inverted
-			\pgf at circ@res at left=-\pgf at x
-			\pgf at circ@res at right=-\pgf at y
-		\else
-			\pgf at circ@res at left=\pgf at x
-			\pgf at circ@res at right=\pgf at y
-		\fi
-		\ifdim\pgf at circ@res at right>0cm
-			\pgfpointborderrectangle{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at right}}{\northeastborder}
-		\else
-	  		\southwestborder	
-	  	\pgfpointborderrectangle{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at right}}{\pgfpoint{-\pgf at x}{-\pgf at y}}
-		\fi
-	}
-	
-	#1
-	
-	\backgroundpath{	
-		\pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
-		
-		\northeast
-		\pgf at circ@res at up = \pgf at y 
-		\pgf at circ@res at zero = 0cm
-		\pgf at circ@res at left = -\pgf at x
-		\pgf at circ@res at right = \pgf at x
-		\southwest
-		\pgf at circ@res at down = \pgf at y
+    \pgfdeclareshape{#3shape}{
 
- 		\pgfstartlinewidth=\pgflinewidth
-		\pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
-		#6
-			
-		\pgfsetlinewidth{\pgfstartlinewidth}
-	}
-	}
+        \savedanchor{\northeast}{
+            \pgf at y=#4\pgf at circ@Rlen
+            \pgf at y=.5\pgf at y
+            \pgf at x=#5\pgf at circ@Rlen
+            \pgf at x=.5\pgf at x
+        }
+        \savedanchor{\northeastborder}{
+            \pgf at y=#4\pgf at circ@Rlen
+            \pgf at y=.5\pgf at y
+            \pgf at y=\ctikzvalof{bipoles/border margin}\pgf at y
+            \pgf at x=#5\pgf at circ@Rlen
+            \pgf at x=.5\pgf at x
+            \pgf at x=\ctikzvalof{bipoles/border margin}\pgf at x
+        }
+        \savedanchor{\southwestborder}{
+            \pgf at y=-#2\pgf at circ@Rlen
+            \pgf at y=.5\pgf at y
+            \pgf at y=\ctikzvalof{bipoles/border margin}\pgf at y
+            \pgf at x=-#5\pgf at circ@Rlen
+            \pgf at x=.5\pgf at x
+            \pgf at x=\ctikzvalof{bipoles/border margin}\pgf at x
+        }
+        \savedanchor{\southwest}{
+            \pgf at y=-#2\pgf at circ@Rlen
+            \pgf at y=.5\pgf at y
+            \pgf at x=-#5\pgf at circ@Rlen
+            \pgf at x=.5\pgf at x
+        }
+        \savedanchor{\centerpoint}{
+            \pgf at circ@res at down=-#2\pgf at circ@Rlen
+            \pgf at circ@res at up=#4\pgf at circ@Rlen
+            \pgfpointorigin
+            \pgf at y=\pgf at circ@res at up
+            \advance\pgf at y by\pgf at circ@res at down
+            \pgf at y=.5\pgf at y
+        }
+        \anchor{center}{\pgfpointorigin}
+        \anchor{n}{
+            \northeast
+            \pgf at x=0cm
+        }
+        \anchor{north east}{
+            \northeast
+        }
+        \anchor{north west}{
+            \northeast
+            \pgf at x=-\pgf at x
+        }
+        \anchor{ne}{
+            \northeast
+        }
+        \anchor{nw}{
+            \northeast
+            \pgf at x=-\pgf at x
+        }
+        \anchor{e}{
+            \northeast
+            \pgf at y=0cm
+        }
+        \anchor{s}{
+            \southwest
+            \pgf at x=0cm
+        }
+        \anchor{south east}{
+            \southwest
+            \pgf at x=-\pgf at x
+        }
+        \anchor{south west}{
+            \southwest
+        }
+        \anchor{se}{
+            \southwest
+            \pgf at x=-\pgf at x
+        }
+        \anchor{sw}{
+            \southwest
+        }
+        \anchor{w}{
+            \southwest
+            \pgf at y=0cm
+        }
+        \anchor{north}{
+            \northeast
+            \pgf at x=0cm
+        }
+        \anchor{east}{
+            \northeast
+            \pgf at y=0cm
+        }
+        \anchor{south}{
+            \southwest
+            \pgf at x=0cm
+        }
+        \anchor{west}{
+            \southwest
+            \pgf at y=0cm
+        }
+        \anchor{right}{
+            \northeast
+            \pgf at y=0cm
+        }
+        \anchor{above}{
+            \northeast
+            \pgf at x=0cm
+        }
+        \anchor{left}{
+            \southwest
+            \pgf at y=0cm
+        }
+        \anchor{below}{
+            \southwest
+            \pgf at x=0cm
+        }
+        \anchor{a}{
+            \northeast
+            \pgf at y=0cm
+        }
+        \anchor{b}{
+            \southwest
+            \pgf at y=0cm
+        }
+        \savedanchor{\textanchor}{%
+            \pgf at y=\ht\pgfnodeparttextbox
+            \pgf at x=-.5\wd\pgfnodeparttextbox
+        }
+        \anchor{text}{
+            \textanchor
+        }
+        \anchorborder{%
+            \ifpgf at circuit@bipole at inverted
+                \pgf at circ@res at left=-\pgf at x
+                \pgf at circ@res at right=-\pgf at y
+            \else
+                \pgf at circ@res at left=\pgf at x
+                \pgf at circ@res at right=\pgf at y
+            \fi
+            \ifdim\pgf at circ@res at right>0cm
+                \pgfpointborderrectangle{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at right}}{\northeastborder}
+            \else
+                \southwestborder
+                \pgfpointborderrectangle{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at right}}{\pgfpoint{-\pgf at x}{-\pgf at y}}
+            \fi
+        }
+
+        #1
+
+        \backgroundpath{
+            \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+            \northeast
+            \pgf at circ@res at up = \pgf at y
+            \pgf at circ@res at zero = 0cm
+            \pgf at circ@res at left = -\pgf at x
+            \pgf at circ@res at right = \pgf at x
+            \southwest
+            \pgf at circ@res at down = \pgf at y
+
+            \pgfstartlinewidth=\pgflinewidth
+            \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
+            #6
+
+            \pgfsetlinewidth{\pgfstartlinewidth}
+        }
+    }
 }
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -175,66 +189,79 @@
 %% Standard bipole shapes declarations
 
 %% Resistor
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/resistor/height}}{resistor}{\ctikzvalof{bipoles/resistor/height}}{\ctikzvalof{bipoles/resistor/width}}{
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-	\pgftransformationadjustments
-	\pgfmathsetlength{\pgf at circ@res at step}{\ctikzvalof{bipoles/resistor/width}\pgf at circ@Rlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
-	\divide \pgf at circ@res at step by 12
-	
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf at circ@res at zero}}
-	\pgf at circ@res at other = \pgf at circ@res at left
-	\advance\pgf at circ@res at other by \pgf at circ@res at step 
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at up}}
-	\advance\pgf at circ@res at other by 2\pgf at circ@res at step 
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at down}}
-	\advance\pgf at circ@res at other by 2\pgf at circ@res at step
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at up}}
-	\advance\pgf at circ@res at other by 2\pgf at circ@res at step
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at down}}
-	\advance\pgf at circ@res at other by 2\pgf at circ@res at step
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at up}}
-	\advance\pgf at circ@res at other by 2\pgf at circ@res at step
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at down}}
-	\advance\pgf at circ@res at other by \pgf at circ@res at step
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at zero}}
-	\pgfsetbeveljoin
-	\pgfusepath{draw}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/resistor/height}}
+{resistor}
+{\ctikzvalof{bipoles/resistor/height}}
+{\ctikzvalof{bipoles/resistor/width}}
+{
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgftransformationadjustments
+    \pgfmathsetlength{\pgf at circ@res at step}{\ctikzvalof{bipoles/resistor/width}\pgf at circ@Rlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
+    \divide \pgf at circ@res at step by 12
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf at circ@res at zero}}
+    \pgf at circ@res at other = \pgf at circ@res at left
+    \advance\pgf at circ@res at other by \pgf at circ@res at step
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at up}}
+    \advance\pgf at circ@res at other by 2\pgf at circ@res at step
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at down}}
+    \advance\pgf at circ@res at other by 2\pgf at circ@res at step
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at up}}
+    \advance\pgf at circ@res at other by 2\pgf at circ@res at step
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at down}}
+    \advance\pgf at circ@res at other by 2\pgf at circ@res at step
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at up}}
+    \advance\pgf at circ@res at other by 2\pgf at circ@res at step
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at down}}
+    \advance\pgf at circ@res at other by \pgf at circ@res at step
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at zero}}
+    \pgfsetbeveljoin
+    \pgfusepath{draw}
 }
 
 
 
 %% Variable resistor
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vresistor/height}}{vresistor}{\ctikzvalof{bipoles/vresistor/height}}{\ctikzvalof{bipoles/vresistor/width}}{		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-	\pgftransformationadjustments
-	\pgfmathsetlength{\pgf at circ@res at step}{\ctikzvalof{bipoles/resistor/width}\pgf at circ@Rlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
-	\divide \pgf at circ@res at step by 12
-	
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf at circ@res at zero}}
-	
-	\pgf at circ@res at other = \pgf at circ@res at left
-	\advance\pgf at circ@res at other by \pgf at circ@res at step 
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{.5\pgf at circ@res at up}}
-	\advance\pgf at circ@res at other by 2\pgf at circ@res at step 
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{.5\pgf at circ@res at down}}
-	\advance\pgf at circ@res at other by 2\pgf at circ@res at step
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{.5\pgf at circ@res at up}}
-	\advance\pgf at circ@res at other by 2\pgf at circ@res at step
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{.5\pgf at circ@res at down}}
-	\advance\pgf at circ@res at other by 2\pgf at circ@res at step
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{.5\pgf at circ@res at up}}
-	\advance\pgf at circ@res at other by 2\pgf at circ@res at step
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{.5\pgf at circ@res at down}}
-	\advance\pgf at circ@res at other by \pgf at circ@res at step
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at zero}}
-	\pgfsetbeveljoin
-	\pgfusepath{draw}
-	
-	\pgfscope
-		\pgfsetarrowsend{latex'}
-		\pgfpathmoveto{\pgfpoint{.4\pgf at circ@res at other}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{-.4\pgf at circ@res at other}{\pgf at circ@res at down}}
-		\pgfusepath{draw}
-	\endpgfscope
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/vresistor/height}}
+{vresistor}
+{\ctikzvalof{bipoles/vresistor/height}}
+{\ctikzvalof{bipoles/vresistor/width}}
+{
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgftransformationadjustments
+    \pgfmathsetlength{\pgf at circ@res at step}{\ctikzvalof{bipoles/resistor/width}\pgf at circ@Rlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
+    \divide \pgf at circ@res at step by 12
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf at circ@res at zero}}
+
+    \pgf at circ@res at other = \pgf at circ@res at left
+    \advance\pgf at circ@res at other by \pgf at circ@res at step
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{.5\pgf at circ@res at up}}
+    \advance\pgf at circ@res at other by 2\pgf at circ@res at step
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{.5\pgf at circ@res at down}}
+    \advance\pgf at circ@res at other by 2\pgf at circ@res at step
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{.5\pgf at circ@res at up}}
+    \advance\pgf at circ@res at other by 2\pgf at circ@res at step
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{.5\pgf at circ@res at down}}
+    \advance\pgf at circ@res at other by 2\pgf at circ@res at step
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{.5\pgf at circ@res at up}}
+    \advance\pgf at circ@res at other by 2\pgf at circ@res at step
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{.5\pgf at circ@res at down}}
+    \advance\pgf at circ@res at other by \pgf at circ@res at step
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at zero}}
+    \pgfsetbeveljoin
+    \pgfusepath{draw}
+
+    \pgfscope
+        \pgfsetarrowsend{latexslim}
+        \pgfpathmoveto{\pgfpoint{.4\pgf at circ@res at other}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{-.4\pgf at circ@res at other}{\pgf at circ@res at down}}
+        \pgfusepath{draw}
+    \endpgfscope
 }
 
 
@@ -241,511 +268,823 @@
 
 %% Capacitor
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/capacitor/height}}{capacitor}{\ctikzvalof{bipoles/capacitor/height}}{\ctikzvalof{bipoles/capacitor/width}}{
-		\pgf at circ@res at step = \ctikzvalof{bipoles/capacitor/width}\pgf at circ@Rlen
-		\divide \pgf at circ@res at step by 5
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/capacitor/height}}
+{capacitor}
+{\ctikzvalof{bipoles/capacitor/height}}
+{\ctikzvalof{bipoles/capacitor/width}}
+{
+    \pgf at circ@res at step = \ctikzvalof{bipoles/capacitor/width}\pgf at circ@Rlen
+    \divide \pgf at circ@res at step by 5
 
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
 
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \pgfusepath{draw}
+
 }
 
+%% Capacitive sensor
+\pgfcircdeclarebipole
+{\anchor{label}{%
+        \southwest
+        \pgf at x=2.6\pgf at x
+        \pgf at y=1.4\pgf at y
+    }%
+}
+{\ctikzvalof{bipoles/capacitor/height}}
+{capacitivesens}
+{\ctikzvalof{bipoles/capacitor/height}}
+{\ctikzvalof{bipoles/capacitor/width}}
+{
+    \pgf at circ@res at step = \ctikzvalof{bipoles/capacitor/width}\pgf at circ@Rlen
+    \divide \pgf at circ@res at step by 5
 
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \pgfusepath{draw}
+    \pgfscope
+        \pgfpathmoveto{\pgfpoint{2.6\pgf at circ@res at right}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{-2.6\pgf at circ@res at right}{1.4\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{-4.4\pgf at circ@res at right}{1.4\pgf at circ@res at down}}
+        \pgfusepath{draw}
+    \endpgfscope
+}
+
 %% Polar Capacitor
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/pcapacitor/height}}{polarcapacitor}{\ctikzvalof{bipoles/pcapacitor/height}}{\ctikzvalof{bipoles/pcapacitor/width}}{
-		\pgf at circ@res at step = \ctikzvalof{bipoles/pcapacitor/width}\pgf at circ@Rlen
-		\divide \pgf at circ@res at step by 5
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/pcapacitor/height}}
+{polarcapacitor}
+{\ctikzvalof{bipoles/pcapacitor/height}}
+{\ctikzvalof{bipoles/pcapacitor/width}}
+{
+    \pgf at circ@res at step = \ctikzvalof{bipoles/pcapacitor/width}\pgf at circ@Rlen
+    \divide \pgf at circ@res at step by 5
 
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-				
-		\pgfscope
-			\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left+ \ctikzvalof{bipoles/pcapacitor/bend width}\pgf at circ@res at left}{\pgf at circ@res at up}}
-			\pgftransformrotate{-90}
-			\pgfpathsine{\pgfpoint{\pgf at circ@res at up}{-\ctikzvalof{bipoles/pcapacitor/bend width}\pgf at circ@res at left}}
-			\pgfpathcosine{\pgfpoint{\pgf at circ@res at up}{\ctikzvalof{bipoles/pcapacitor/bend width}\pgf at circ@res at left}}
-			\pgfusepath{draw}
-		\endpgfscope
-		
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfusepath{draw}
-		
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+    \pgfscope
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left+ \ctikzvalof{bipoles/pcapacitor/bend width}\pgf at circ@res at left}{\pgf at circ@res at up}}
+        \pgftransformrotate{-90}
+        \pgfpathsine{\pgfpoint{\pgf at circ@res at up}{-\ctikzvalof{bipoles/pcapacitor/bend width}\pgf at circ@res at left}}
+        \pgfpathcosine{\pgfpoint{\pgf at circ@res at up}{\ctikzvalof{bipoles/pcapacitor/bend width}\pgf at circ@res at left}}
+        \pgfusepath{draw}
+    \endpgfscope
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \pgfusepath{draw}
+
 }
 
 %% Electrolytic Capacitor
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/ecapacitor/height}}{ecapacitor}{\ctikzvalof{bipoles/ecapacitor/height}}{\ctikzvalof{bipoles/ecapacitor/width}}{
-		\pgf at circ@res at step = \ctikzvalof{bipoles/ecapacitor/width}\pgf at circ@Rlen
-		\divide \pgf at circ@res at step by 5
-		\pgfsetrectcap
-		% % % Draw plus pole
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{.4\pgf at circ@res at left}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{.4\pgf at circ@res at left}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
-		\pgfsetfillcolor{white} 
-		\pgfusepath{draw,fill}
-		% % Draw minus pole
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{.4\pgf at circ@res at right}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{.4\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
-				 \pgfsetfillcolor{black} 
-				\pgfusepath{draw,fill}
-		\pgfsetfillcolor{black} 
-		% % plus pole annotation
-		\pgftext[right,at=\pgfpoint{1.2\pgf at circ@res at left}{.6\pgf at circ@res at up}]
-		{\pgfkeysvalueof{/tikz/circuitikz/bipoles/ecapacitor/font} $+$}	
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/ecapacitor/height}}
+{ecapacitor}
+{\ctikzvalof{bipoles/ecapacitor/height}}
+{\ctikzvalof{bipoles/ecapacitor/width}}
+{
+    \pgf at circ@res at step = \ctikzvalof{bipoles/ecapacitor/width}\pgf at circ@Rlen
+    \divide \pgf at circ@res at step by 5
+    \pgfsetrectcap
+    % % % Draw plus pole
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at left}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at left}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+    \pgf at circ@draworfill
+    % % Draw minus pole
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfsetfillcolor{black}
+    \pgfusepath{draw,fill}
+    \pgfsetfillcolor{black}
+    % % plus pole annotation
+    \pgftext[right,at=\pgfpoint{1.2\pgf at circ@res at left}{.6\pgf at circ@res at up}]
+    {\pgfkeysvalueof{/tikz/circuitikz/bipoles/ecapacitor/font} $+$}
 }
 
 %% Battery
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/battery/height}}{battery}{\ctikzvalof{bipoles/battery/height}}{\ctikzvalof{bipoles/battery/width}}{
-		\pgf at circ@res at step = \ctikzvalof{bipoles/battery/width}\pgf at circ@Rlen
-		\divide \pgf at circ@res at step by 6
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/battery/height}}
+{battery}
+{\ctikzvalof{bipoles/battery/height}}
+{\ctikzvalof{bipoles/battery/width}}
+{
+    \pgf at circ@res at step = \ctikzvalof{bipoles/battery/width}\pgf at circ@Rlen
+    \divide \pgf at circ@res at step by 6
 
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
 
-		\pgfpathmoveto{\pgfpoint{-\pgf at circ@res at step}{.5\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{-\pgf at circ@res at step}{.5\pgf at circ@res at down}}
+    \ifpgf at circ@fixbatteries
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{.5\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{.5\pgf at circ@res at down}}
 
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at down}}
+        \pgfpathmoveto{\pgfpoint{-\pgf at circ@res at step}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{-\pgf at circ@res at step}{\pgf at circ@res at down}}
 
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{.5\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{.5\pgf at circ@res at down}}
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{.5\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{.5\pgf at circ@res at down}}
 
-		\pgfusepath{draw}
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \else
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+
+        \pgfpathmoveto{\pgfpoint{-\pgf at circ@res at step}{.5\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{-\pgf at circ@res at step}{.5\pgf at circ@res at down}}
+
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at down}}
+
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{.5\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{.5\pgf at circ@res at down}}
+    \fi
+    \pgfusepath{draw}
 }
 
 
 %% Battery 1 % poles with equl thickness
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/battery1/height}}{battery1}{\ctikzvalof{bipoles/battery1/height}}{\ctikzvalof{bipoles/battery1/width}}{
-		\pgfpathmoveto{\pgfpoint{.33\pgf at circ@res at right}{0}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0}}
-		\pgfpathmoveto{\pgfpoint{.33\pgf at circ@res at left}{0}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{0}}
-		\pgfusepath{draw}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/battery1/height}}
+{battery1}
+{\ctikzvalof{bipoles/battery1/height}}
+{\ctikzvalof{bipoles/battery1/width}}
+{
+    \pgfpathmoveto{\pgfpoint{.33\pgf at circ@res at right}{0}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0}}
+    \pgfpathmoveto{\pgfpoint{.33\pgf at circ@res at left}{0}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{0}}
+    \pgfusepath{draw}
 
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-		\pgfpathmoveto{\pgfpoint{.33\pgf at circ@res at right}{.5\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{.33\pgf at circ@res at right}{.5\pgf at circ@res at down}}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \ifpgf at circ@fixbatteries
+        \pgfpathmoveto{\pgfpoint{.33\pgf at circ@res at right}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{.33\pgf at circ@res at right}{\pgf at circ@res at down}}
 
-		\pgfpathmoveto{\pgfpoint{.33\pgf at circ@res at left}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{.33\pgf at circ@res at left}{\pgf at circ@res at down}}
-		\pgfusepath{draw}
+        \pgfpathmoveto{\pgfpoint{.33\pgf at circ@res at left}{.5\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{.33\pgf at circ@res at left}{.5\pgf at circ@res at down}}
+    \else
+        \pgfpathmoveto{\pgfpoint{.33\pgf at circ@res at right}{.5\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{.33\pgf at circ@res at right}{.5\pgf at circ@res at down}}
+
+        \pgfpathmoveto{\pgfpoint{.33\pgf at circ@res at left}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{.33\pgf at circ@res at left}{\pgf at circ@res at down}}
+    \fi
+    \pgfusepath{draw}
 }
 
 %% Battery 2 % negative pole thicker
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/battery2/height}}{battery2}{\ctikzvalof{bipoles/battery2/height}}{\ctikzvalof{bipoles/battery2/width}}{
-		\pgfpathmoveto{\pgfpoint{.33\pgf at circ@res at right}{0}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0}}
-		\pgfpathmoveto{\pgfpoint{.33\pgf at circ@res at left}{0}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{0}}
-		\pgfusepath{draw}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/battery2/height}}
+{battery2}
+{\ctikzvalof{bipoles/battery2/height}}
+{\ctikzvalof{bipoles/battery2/width}}
+{
+    \pgfpathmoveto{\pgfpoint{.33\pgf at circ@res at right}{0}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0}}
+    \pgfpathmoveto{\pgfpoint{.33\pgf at circ@res at left}{0}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{0}}
+    \pgfusepath{draw}
 
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-		\pgfpathmoveto{\pgfpoint{.33\pgf at circ@res at left}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{.33\pgf at circ@res at left}{\pgf at circ@res at down}}
-		\pgfusepath{draw}
-		\pgfsetlinewidth{3\pgflinewidth}
-		\pgfpathmoveto{\pgfpoint{.33\pgf at circ@res at right}{.5\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{.33\pgf at circ@res at right}{.5\pgf at circ@res at down}}
-		\pgfusepath{draw}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \ifpgf at circ@fixbatteries
+        \pgfpathmoveto{\pgfpoint{.33\pgf at circ@res at right}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{.33\pgf at circ@res at right}{\pgf at circ@res at down}}
+        \pgfusepath{draw}
+        \pgfsetlinewidth{3\pgflinewidth}
+        \pgfpathmoveto{\pgfpoint{.33\pgf at circ@res at left}{.5\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{.33\pgf at circ@res at left}{.5\pgf at circ@res at down}}
+    \else
+        \pgfpathmoveto{\pgfpoint{.33\pgf at circ@res at left}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{.33\pgf at circ@res at left}{\pgf at circ@res at down}}
+        \pgfusepath{draw}
+        \pgfsetlinewidth{3\pgflinewidth}
+        \pgfpathmoveto{\pgfpoint{.33\pgf at circ@res at right}{.5\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{.33\pgf at circ@res at right}{.5\pgf at circ@res at down}}
+    \fi
+    \pgfusepath{draw}
 }
 
 
 %% cute inductor
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cuteinductor/lower coil height}}{cuteinductor}{\ctikzvalof{bipoles/cuteinductor/height}}{\ctikzvalof{bipoles/cuteinductor/width}}{
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-	\pgftransformationadjustments
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/cuteinductor/lower coil height}}
+{cuteinductor}
+{\ctikzvalof{bipoles/cuteinductor/height}}
+{\ctikzvalof{bipoles/cuteinductor/width}}
+{
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgftransformationadjustments
 
-	\pgfmathsetlength{\pgf at circ@res at other}%width of small coil
-	{0.5*\ctikzvalof{bipoles/cuteinductor/coil aspect}*\ctikzvalof{bipoles/cuteinductor/width}*\pgf at circ@Rlen/(\ctikzvalof{bipoles/cuteinductor/coils}-1)}
+    \pgfmathsetlength{\pgf at circ@res at other}%width of small coil
+    {0.5*\ctikzvalof{bipoles/cuteinductor/coil aspect}*\ctikzvalof{bipoles/cuteinductor/width}*\pgf at circ@Rlen/(\ctikzvalof{bipoles/cuteinductor/coils}-1)}
 
 
-	\pgfmathsetlength{\pgf at circ@res at step}
-		{(\ctikzvalof{bipoles/cuteinductor/width}*\pgf at circ@Rlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/cuteinductor/coils}-1)*2*\pgf at circ@res at other)/\ctikzvalof{bipoles/cuteinductor/coils}/2}
+    \pgfmathsetlength{\pgf at circ@res at step}
+    {(\ctikzvalof{bipoles/cuteinductor/width}*\pgf at circ@Rlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/cuteinductor/coils}-1)*2*\pgf at circ@res at other)/\ctikzvalof{bipoles/cuteinductor/coils}/2}
 
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
-	\foreach \x in {2,...,\ctikzvalof{bipoles/cuteinductor/coils}}
-	{
-		\pgfpatharc{180}{0}{\pgf at circ@res at step and \pgf at circ@res at up}
-		\pgfpatharc{0}{-180}{\pgf at circ@res at other and -\pgf at circ@res at down}
-	}
-	\pgfpatharc{180}{0}{\pgf at circ@res at step and \pgf at circ@res at up}
-	\pgfsetbuttcap
-	\pgfsetbeveljoin
-	\pgfusepath{stroke}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+    \foreach \x in {2,...,\ctikzvalof{bipoles/cuteinductor/coils}}
+    {
+        \pgfpatharc{180}{0}{\pgf at circ@res at step and \pgf at circ@res at up}
+        \pgfpatharc{0}{-180}{\pgf at circ@res at other and -\pgf at circ@res at down}
+    }
+    \pgfpatharc{180}{0}{\pgf at circ@res at step and \pgf at circ@res at up}
+    \pgfsetbuttcap
+    \pgfsetbeveljoin
+    \pgfusepath{stroke}
 }
 
+%% cute inductive sensor
+
+\pgfcircdeclarebipole
+{%
+{% anchor for labelling the type of dependency
+    \anchor{label}{%
+        \southwest
+        \pgf at x=0.8\pgf at x
+        \pgf at y=2.6\pgf at y
+    }%
+}}
+{\ctikzvalof{bipoles/cuteinductor/lower coil height}}
+{scuteinductor}
+{\ctikzvalof{bipoles/cuteinductor/height}}
+{\ctikzvalof{bipoles/cuteinductor/width}}
+{
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgftransformationadjustments
+
+    \pgfmathsetlength{\pgf at circ@res at other}%width of small coil
+    {0.5*\ctikzvalof{bipoles/cuteinductor/coil aspect}*\ctikzvalof{bipoles/cuteinductor/width}*\pgf at circ@Rlen/(\ctikzvalof{bipoles/cuteinductor/coils}-1)}
+
+
+    \pgfmathsetlength{\pgf at circ@res at step}
+    {(\ctikzvalof{bipoles/cuteinductor/width}*\pgf at circ@Rlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/cuteinductor/coils}-1)*2*\pgf at circ@res at other)/\ctikzvalof{bipoles/cuteinductor/coils}/2}
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+    \foreach \x in {2,...,\ctikzvalof{bipoles/cuteinductor/coils}}
+    {
+        \pgfpatharc{180}{0}{\pgf at circ@res at step and \pgf at circ@res at up}
+        \pgfpatharc{0}{-180}{\pgf at circ@res at other and -\pgf at circ@res at down}
+    }
+    \pgfpatharc{180}{0}{\pgf at circ@res at step and \pgf at circ@res at up}
+    \pgfsetbuttcap
+    \pgfsetbeveljoin
+    \pgfusepath{stroke}
+    \pgfscope
+        \pgfpathmoveto{\pgfpoint{.8\pgf at circ@res at right}{2\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{-.8\pgf at circ@res at right}{2.6\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{-1.6\pgf at circ@res at right}{2.6\pgf at circ@res at down}}
+        \pgfusepath{draw}
+    \endpgfscope
+}
+
+%% cute choke
+
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/cutechoke/lower coil height}}
+{cutechoke}
+{\ctikzvalof{bipoles/cutechoke/height}}
+{\ctikzvalof{bipoles/cutechoke/width}}
+{
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgftransformationadjustments
+
+    \pgfmathsetlength{\pgf at circ@res at other}%width of small coil
+    {0.5*\ctikzvalof{bipoles/cutechoke/coil aspect}*\ctikzvalof{bipoles/cutechoke/width}*\pgf at circ@Rlen/(\ctikzvalof{bipoles/cutechoke/coils}-1)}
+
+
+    \pgfmathsetlength{\pgf at circ@res at step}
+    {(\ctikzvalof{bipoles/cutechoke/width}*\pgf at circ@Rlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/cutechoke/coils}-1)*2*\pgf at circ@res at other)/\ctikzvalof{bipoles/cutechoke/coils}/2}
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+    \foreach \x in {2,...,\ctikzvalof{bipoles/cutechoke/coils}}
+    {
+        \pgfpatharc{180}{0}{\pgf at circ@res at step and \pgf at circ@res at up}
+        \pgfpatharc{0}{-180}{\pgf at circ@res at other and -\pgf at circ@res at down}
+    }
+    \pgfpatharc{180}{0}{\pgf at circ@res at step and \pgf at circ@res at up}
+    \pgfsetbuttcap
+    \pgfsetbeveljoin
+    \pgfusepath{stroke}
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth+\ctikzvalof{bipoles/cutechoke/cdist}\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth+\ctikzvalof{bipoles/cutechoke/cdist}\pgf at circ@res at up}}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}*\ctikzvalof{bipoles/cutechoke/cthick}\pgfstartlinewidth}
+    \pgfusepath{stroke}
+
+    \ifpgf at circuit@bipole at twolines
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth+\ctikzvalof{bipoles/cutechoke/cdist}\pgf at circ@res at up+\ctikzvalof{bipoles/cutechoke/cstep}\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth+\ctikzvalof{bipoles/cutechoke/cdist}\pgf at circ@res at up+\ctikzvalof{bipoles/cutechoke/cstep}\pgf at circ@res at up}}
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}*\ctikzvalof{bipoles/cutechoke/cthick}\pgfstartlinewidth}
+        \pgfusepath{stroke}
+    \fi
+}
+
 %% variable cute inductor
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vcuteinductor/lower coil height}}{vcuteinductor}{\ctikzvalof{bipoles/vcuteinductor/height}}{\ctikzvalof{bipoles/vcuteinductor/width}}{
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-	\pgftransformationadjustments	
-	
-	\pgfmathsetlength{\pgf at circ@res at other}%width of small coil
-	{0.5*\ctikzvalof{bipoles/vcuteinductor/coil aspect}*\ctikzvalof{bipoles/vcuteinductor/width}*\pgf at circ@Rlen/(\ctikzvalof{bipoles/vcuteinductor/coils}-1)}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/vcuteinductor/lower coil height}}
+{vcuteinductor}
+{\ctikzvalof{bipoles/vcuteinductor/height}}
+{\ctikzvalof{bipoles/vcuteinductor/width}}
+{
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgftransformationadjustments
 
+    \pgfmathsetlength{\pgf at circ@res at other}%width of small coil
+    {0.5*\ctikzvalof{bipoles/vcuteinductor/coil aspect}*\ctikzvalof{bipoles/vcuteinductor/width}*\pgf at circ@Rlen/(\ctikzvalof{bipoles/vcuteinductor/coils}-1)}
 
-	\pgfmathsetlength{\pgf at circ@res at step}
-		{(\ctikzvalof{bipoles/vcuteinductor/width}*\pgf at circ@Rlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/vcuteinductor/coils}-1)*2*\pgf at circ@res at other)/\ctikzvalof{bipoles/vcuteinductor/coils}/2}
 
-	\pgfscope
-		\pgfsetarrowsend{latex'}
-		\pgfpathmoveto{\pgfpoint{.4\pgf at circ@res at left}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{.4\pgf at circ@res at right}{\pgf at circ@res at up}}
-		\pgfusepath{draw}
-	\endpgfscope
+    \pgfmathsetlength{\pgf at circ@res at step}
+    {(\ctikzvalof{bipoles/vcuteinductor/width}*\pgf at circ@Rlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/vcuteinductor/coils}-1)*2*\pgf at circ@res at other)/\ctikzvalof{bipoles/vcuteinductor/coils}/2}
 
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
-	\foreach \x in {2,...,\ctikzvalof{bipoles/vcuteinductor/coils}}
-	{
-		\pgfpatharc{180}{0}{\pgf at circ@res at step and .5\pgf at circ@res at up}
-		\pgfpatharc{0}{-180}{\pgf at circ@res at other and -.5\pgf at circ@res at down}
-	}
-	\pgfpatharc{180}{0}{\pgf at circ@res at step and .5\pgf at circ@res at up}
-	\pgfsetbuttcap
-	\pgfsetbeveljoin
-	\pgfusepath{stroke}
+    \pgfscope
+        \pgfsetarrowsend{latexslim}
+        \pgfpathmoveto{\pgfpoint{.4\pgf at circ@res at left}{\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at right}{\pgf at circ@res at up}}
+        \pgfusepath{draw}
+    \endpgfscope
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+    \foreach \x in {2,...,\ctikzvalof{bipoles/vcuteinductor/coils}}
+    {
+        \pgfpatharc{180}{0}{\pgf at circ@res at step and .5\pgf at circ@res at up}
+        \pgfpatharc{0}{-180}{\pgf at circ@res at other and -.5\pgf at circ@res at down}
+    }
+    \pgfpatharc{180}{0}{\pgf at circ@res at step and .5\pgf at circ@res at up}
+    \pgfsetbuttcap
+    \pgfsetbeveljoin
+    \pgfusepath{stroke}
 }
-
 %% american inductor
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/americaninductor/height 2}}{americaninductor}{\ctikzvalof{bipoles/americaninductor/height}}{\ctikzvalof{bipoles/americaninductor/width}}{
-	\pgf at circ@res at step=\ctikzvalof{bipoles/americaninductor/width}\pgf at circ@Rlen
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}	
-	\pgftransformationadjustments
-	\advance \pgf at circ@res at step by \pgfhorizontaltransformationadjustment\pgflinewidth
-	\divide \pgf at circ@res at step by \ctikzvalof{bipoles/americaninductor/coils}
-	\divide \pgf at circ@res at step by 2
-	\pgf at circ@res at other = \ctikzvalof{bipoles/americaninductor/coil height}\pgf at circ@Rlen
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/americaninductor/height 2}}
+{americaninductor}
+{\ctikzvalof{bipoles/americaninductor/height}}
+{\ctikzvalof{bipoles/americaninductor/width}}
+{
+    \pgf at circ@res at step=\ctikzvalof{bipoles/americaninductor/width}\pgf at circ@Rlen
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgftransformationadjustments
+    \advance \pgf at circ@res at step by \pgfhorizontaltransformationadjustment\pgflinewidth
+    \divide \pgf at circ@res at step by \ctikzvalof{bipoles/americaninductor/coils}
+    \divide \pgf at circ@res at step by 2
+    \pgf at circ@res at other = \ctikzvalof{bipoles/americaninductor/coil height}\pgf at circ@Rlen
 
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
-	\foreach \x in {1,...,\ctikzvalof{bipoles/americaninductor/coils}}
-	{
-	\pgfpatharc{180}{0}{\pgf at circ@res at step and  \pgf at circ@res at other}
-	}
-	\pgfsetbuttcap
-	\pgfsetbeveljoin
-	\pgfusepath{stroke}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+    \foreach \x in {1,...,\ctikzvalof{bipoles/americaninductor/coils}}
+    {
+        \pgfpatharc{180}{0}{\pgf at circ@res at step and  \pgf at circ@res at other}
+    }
+    \pgfsetbuttcap
+    \pgfsetbeveljoin
+    \pgfusepath{stroke}
 }
 
+
+%% american inductive sensor
+
+\pgfcircdeclarebipole
+{%
+{% anchor for labelling the type of dependency
+    \anchor{label}{%
+        \southwest
+        \pgf at x=0.8\pgf at x
+        \pgf at y=2.6\pgf at y
+    }%
+}}
+{\ctikzvalof{bipoles/americaninductor/height 2}}
+{samericaninductor}
+{\ctikzvalof{bipoles/americaninductor/height}}
+{\ctikzvalof{bipoles/americaninductor/width}}
+{
+    \pgf at circ@res at step=\ctikzvalof{bipoles/americaninductor/width}\pgf at circ@Rlen
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgftransformationadjustments
+    \advance \pgf at circ@res at step by \pgfhorizontaltransformationadjustment\pgflinewidth
+    \divide \pgf at circ@res at step by \ctikzvalof{bipoles/americaninductor/coils}
+    \divide \pgf at circ@res at step by 2
+    \pgf at circ@res at other = \ctikzvalof{bipoles/americaninductor/coil height}\pgf at circ@Rlen
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+    \foreach \x in {1,...,\ctikzvalof{bipoles/americaninductor/coils}}
+    {
+        \pgfpatharc{180}{0}{\pgf at circ@res at step and  \pgf at circ@res at other}
+    }
+    \pgfsetbuttcap
+    \pgfsetbeveljoin
+    \pgfusepath{stroke}
+    \pgfscope
+        \pgfpathmoveto{\pgfpoint{.8\pgf at circ@res at right}{2\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{-.8\pgf at circ@res at right}{2.6\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{-1.6\pgf at circ@res at right}{2.6\pgf at circ@res at down}}
+        \pgfusepath{draw}
+    \endpgfscope
+}
+
 %% variable american inductor
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vamericaninductor/height 2}}{vamericaninductor}{\ctikzvalof{bipoles/vamericaninductor/height}}{\ctikzvalof{bipoles/vamericaninductor/width}}{
-	\pgf at circ@res at step=\ctikzvalof{bipoles/vamericaninductor/width}\pgf at circ@Rlen
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-	\pgftransformationadjustments
-	\advance \pgf at circ@res at step by \pgfhorizontaltransformationadjustment\pgflinewidth
-	\divide \pgf at circ@res at step by \ctikzvalof{bipoles/vamericaninductor/coils}
-	\divide \pgf at circ@res at step by 2
-	\pgf at circ@res at other = \ctikzvalof{bipoles/vamericaninductor/coil height}\pgf at circ@Rlen
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/vamericaninductor/height 2}}
+{vamericaninductor}
+{\ctikzvalof{bipoles/vamericaninductor/height}}
+{\ctikzvalof{bipoles/vamericaninductor/width}}
+{
+    \pgf at circ@res at step=\ctikzvalof{bipoles/vamericaninductor/width}\pgf at circ@Rlen
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgftransformationadjustments
+    \advance \pgf at circ@res at step by \pgfhorizontaltransformationadjustment\pgflinewidth
+    \divide \pgf at circ@res at step by \ctikzvalof{bipoles/vamericaninductor/coils}
+    \divide \pgf at circ@res at step by 2
+    \pgf at circ@res at other = \ctikzvalof{bipoles/vamericaninductor/coil height}\pgf at circ@Rlen
 
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
-	\foreach \x in {1,...,\ctikzvalof{bipoles/vamericaninductor/coils}}
-	{
-	\pgfpatharc{180}{0}{\pgf at circ@res at step and  \pgf at circ@res at other}
-	}
-	\pgfsetbuttcap
-	\pgfsetbeveljoin
-	\pgfusepath{stroke}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+    \foreach \x in {1,...,\ctikzvalof{bipoles/vamericaninductor/coils}}
+    {
+        \pgfpatharc{180}{0}{\pgf at circ@res at step and  \pgf at circ@res at other}
+    }
+    \pgfsetbuttcap
+    \pgfsetbeveljoin
+    \pgfusepath{stroke}
 
-	\pgfscope
-		\pgfsetarrowsend{latex'}
-		\pgfpathmoveto{\pgfpoint{.4\pgf at circ@res at left}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{-.4\pgf at circ@res at left}{\pgf at circ@res at up}}
-		\pgfusepath{draw}
-	\endpgfscope
+    \pgfscope
+        \pgfsetarrowsend{latexslim}
+        \pgfpathmoveto{\pgfpoint{.4\pgf at circ@res at left}{\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{-.4\pgf at circ@res at left}{\pgf at circ@res at up}}
+        \pgfusepath{draw}
+    \endpgfscope
 }
 
 
 %% Independent voltage source
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsource/height}}{vsource}{\ctikzvalof{bipoles/vsource/height}}{\ctikzvalof{bipoles/vsource/width}}{
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/vsource/height}}
+{vsource}
+{\ctikzvalof{bipoles/vsource/height}}
+{\ctikzvalof{bipoles/vsource/width}}
+{
 
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
 
-	\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
-	\pgfusepath{draw}
+    \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+    \pgf at circ@draworfill
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
+    \pgfusepath{draw}
 }
 
 
 %% Independent voltage source - American style
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsourceam/height}}{vsourceAM}{\ctikzvalof{bipoles/vsourceam/height}}{\ctikzvalof{bipoles/vsourceam/width}}{
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/vsourceam/height}}
+{vsourceAM}
+{\ctikzvalof{bipoles/vsourceam/height}}
+{\ctikzvalof{bipoles/vsourceam/width}}
+{
 
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-	\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
-	\pgfusepath{draw}
-	\ifpgf at circ@oldvoltagedirection
-		\pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf at circ@res at down]{$+$}
-		\pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf at circ@res at up]{$-$}
-	\else
-		\pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf at circ@res at down]{$-$}
-		\pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf at circ@res at up]{$+$}
-	\fi
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+    \pgf at circ@draworfill
+    \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+    \ifpgf at circ@oldvoltagedirection
+        \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf at circ@res at down]{$+$}
+        \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf at circ@res at up]{$-$}
+    \else
+        \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf at circ@res at down]{$-$}
+        \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf at circ@res at up]{$+$}
+    \fi
 }
 
 
 
 %% 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 at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
-	\pgfusepath{draw}		
-		
-		\pgf at circ@res at up = .5\pgf at circ@res at up
-		\pgfscope
-			\pgftransformrotate{90}
-			\pgfpathmoveto{\pgfpoint{-\pgf at circ@res at up}{0cm}}
-			\pgfpathsine{\pgfpoint{.5\pgf at circ@res at up}{.5\pgf at circ@res at up}}
-			\pgfpathcosine{\pgfpoint{.5\pgf at circ@res at up}{-.5\pgf at circ@res at up}}
-			\pgfpathsine{\pgfpoint{.5\pgf at circ@res at up}{-.5\pgf at circ@res at up}}
-			\pgfpathcosine{\pgfpoint{.5\pgf at circ@res at up}{.5\pgf at circ@res at up}}
-			\pgfusepath{draw}
-		\endpgfscope
-}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/vsourcesin/height}}
+{vsourcesin}
+{\ctikzvalof{bipoles/vsourcesin/height}}
+{\ctikzvalof{bipoles/vsourcesin/width}}
+{
 
-% 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 at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+    \pgf at circ@draworfill
 
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-	\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
-	\pgfusepath{draw}		
-		
-		\pgf at circ@res at up = .5\pgf at circ@res at up
-		\pgfscope
-			\pgftransformrotate{90}
-			\pgfpathmoveto{\pgfpoint{-1\pgf at circ@res at up}{0cm}}
-			\pgfpathlineto{\pgfpoint{-0.5\pgf at circ@res at up}{0.75\pgf at circ@res at up}}
-			\pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at up}{-0.75\pgf at circ@res at up}}
-			\pgfpathlineto{\pgfpoint{1\pgf at circ@res at up}{0\pgf at circ@res at up}}
-			\pgfusepath{draw}
-		\endpgfscope
+    \pgf at circ@res at up = .5\pgf at circ@res at up
+    \pgfscope
+        \pgftransformrotate{90}
+        \pgfpathmoveto{\pgfpoint{-\pgf at circ@res at up}{0cm}}
+        \pgfpathsine{\pgfpoint{.5\pgf at circ@res at up}{.5\pgf at circ@res at up}}
+        \pgfpathcosine{\pgfpoint{.5\pgf at circ@res at up}{-.5\pgf at circ@res at up}}
+        \pgfpathsine{\pgfpoint{.5\pgf at circ@res at up}{-.5\pgf at circ@res at up}}
+        \pgfpathcosine{\pgfpoint{.5\pgf at circ@res at up}{.5\pgf at circ@res at up}}
+        \pgfusepath{draw}
+    \endpgfscope
 }
 
-
 % Square Voltage source -  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 at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
-	\pgfusepath{draw}
-	\pgf at circ@res at up = .5\pgf at circ@res at up
-	\pgfscope
-		\pgftransformrotate{90}
-		\pgfpathmoveto{\pgfpoint{-1\pgf at circ@res at up}{0cm}}
-		\pgfpathlineto{\pgfpoint{-1\pgf at circ@res at up}{1\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{0\pgf at circ@res at up}{1\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{0\pgf at circ@res at up}{-1\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{1\pgf at circ@res at up}{-1\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{1\pgf at circ@res at up}{0\pgf at circ@res at up}}
-		\pgfusepath{draw}
-	\endpgfscope
+\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 at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+    \pgf at circ@draworfill
+    \pgf at circ@res at up = .5\pgf at circ@res at up
+    \pgfscope
+        \pgftransformrotate{90}
+        \pgfpathmoveto{\pgfpoint{-1\pgf at circ@res at up}{0cm}}
+        \pgfpathlineto{\pgfpoint{-1\pgf at circ@res at up}{1\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{0\pgf at circ@res at up}{1\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{0\pgf at circ@res at up}{-1\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{1\pgf at circ@res at up}{-1\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{1\pgf at circ@res at up}{0\pgf at circ@res at 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}}{
+\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 at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
-	\pgfusepath{draw}		
-		
-		\pgf at circ@res at up = .5\pgf at circ@res at up
-		\pgfscope
-			\pgftransformrotate{90}
-			\pgfpathmoveto{\pgfpoint{-1\pgf at circ@res at up}{0cm}}
-			\pgfpathlineto{\pgfpoint{-0.5\pgf at circ@res at up}{0.75\pgf at circ@res at up}}
-			\pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at up}{-0.75\pgf at circ@res at up}}
-			\pgfpathlineto{\pgfpoint{1\pgf at circ@res at up}{0\pgf at circ@res at up}}
-			\pgfusepath{draw}
-		\endpgfscope
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+    \pgf at circ@draworfill
+
+    \pgf at circ@res at up = .5\pgf at circ@res at up
+    \pgfscope
+        \pgftransformrotate{90}
+        \pgfpathmoveto{\pgfpoint{-1\pgf at circ@res at up}{0cm}}
+        \pgfpathlineto{\pgfpoint{-0.5\pgf at circ@res at up}{0.75\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at up}{-0.75\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{1\pgf at circ@res at up}{0\pgf at circ@res at 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 at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at up}}
-	\pgfusepath{draw}
-}
-
 %% PV Source
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/pvsource/height}}{pvsource}{\ctikzvalof{bipoles/pvsource/height}}{\ctikzvalof{bipoles/pvsource/width}}{
-	\pgfpointorigin
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-	\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at up}}
-	\pgfusepath{draw}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/pvsource/height}}
+{pvsource}
+{\ctikzvalof{bipoles/pvsource/height}}
+{\ctikzvalof{bipoles/pvsource/width}}
+{
+    \pgfpointorigin
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at up}}
+    \pgf at circ@draworfill
 
-	\pgfpathmoveto{\pgfpoint{.15\pgf at circ@res at right}{0}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0}}
-	\pgfpathmoveto{\pgfpoint{.15\pgf at circ@res at left}{0}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{0}}
-	\pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{.15\pgf at circ@res at right}{0}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0}}
+    \pgfpathmoveto{\pgfpoint{.15\pgf at circ@res at left}{0}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{0}}
+    \pgfusepath{draw}
 
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-	\pgfpathmoveto{\pgfpoint{.15\pgf at circ@res at left}{.4\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint{.15\pgf at circ@res at left}{.4\pgf at circ@res at down}}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{.15\pgf at circ@res at left}{.4\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{.15\pgf at circ@res at left}{.4\pgf at circ@res at down}}
 
-	\pgfpathmoveto{\pgfpoint{.15\pgf at circ@res at right}{.6\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint{.15\pgf at circ@res at right}{.6\pgf at circ@res at down}}
-	\pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{.15\pgf at circ@res at right}{.6\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{.15\pgf at circ@res at right}{.6\pgf at circ@res at down}}
+    \pgfusepath{draw}
 
-	%Arrow Part
-	\pgfscope
-	\pgfsetarrowsend{latex}
-	\pgfpathmoveto{\pgfpointadd{\pgfpoint{.3\pgf at circ@res at left}{0}}{\pgfpointpolar{-45}{2.2\pgf at circ@res at up}}}
-	\pgfpathlineto{\pgfpointadd{\pgfpoint{.3\pgf at circ@res at left}{0}}{\pgfpointpolar{-45}{1.3\pgf at circ@res at up}}}
-	\pgfusepath{draw}
-	\pgfpathmoveto{\pgfpointadd{\pgfpoint{0}{0.3\pgf at circ@res at up}}{\pgfpointpolar{-45}{2.2\pgf at circ@res at up}}}
-	\pgfpathlineto{\pgfpointadd{\pgfpoint{0}{0.3\pgf at circ@res at up}}{\pgfpointpolar{-45}{1.3\pgf at circ@res at up}}}
-	\pgfusepath{draw}
-	\endpgfscope
+    %Arrow Part
+    \pgfscope
+        \pgfsetarrowsend{latex}
+        \pgfpathmoveto{\pgfpointadd{\pgfpoint{.3\pgf at circ@res at left}{0}}{\pgfpointpolar{-45}{2.2\pgf at circ@res at up}}}
+        \pgfpathlineto{\pgfpointadd{\pgfpoint{.3\pgf at circ@res at left}{0}}{\pgfpointpolar{-45}{1.3\pgf at circ@res at up}}}
+        \pgfusepath{draw}
+        \pgfpathmoveto{\pgfpointadd{\pgfpoint{0}{0.3\pgf at circ@res at up}}{\pgfpointpolar{-45}{2.2\pgf at circ@res at up}}}
+        \pgfpathlineto{\pgfpointadd{\pgfpoint{0}{0.3\pgf at circ@res at up}}{\pgfpointpolar{-45}{1.3\pgf at circ@res at 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 at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at up}}
-	\pgfusepath{draw}
+\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 at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+    \pgf at circ@draworfill
 }
 
 %% 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 at circ@res at right}{0}}\pgfpatharc{0}{90}{0.85\pgf at circ@res at right and \pgf at circ@res at up}
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0}}\pgfpatharc{0}{-90}{0.85\pgf at circ@res at right and \pgf at circ@res at up}
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0}}\pgfpatharc{180}{270}{0.85\pgf at circ@res at right and \pgf at circ@res at up}
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0}}\pgfpatharc{180}{90}{0.85\pgf at circ@res at right and \pgf at circ@res at up}	
-	\pgfusepath{draw}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/dcisource/height}}
+{dcisource}
+{\ctikzvalof{bipoles/dcisource/height}}
+{\ctikzvalof{bipoles/dcisource/width}}
+{
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpointorigin}
+    \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+    \pgf at circ@maybefill
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0}}\pgfpatharc{0}{90}{0.85\pgf at circ@res at right and \pgf at circ@res at up}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0}}\pgfpatharc{0}{-90}{0.85\pgf at circ@res at right and \pgf at circ@res at up}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0}}\pgfpatharc{180}{270}{0.85\pgf at circ@res at right and \pgf at circ@res at up}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0}}\pgfpatharc{180}{90}{0.85\pgf at circ@res at right and \pgf at circ@res at up}
+    \pgfusepath{draw}
 
-	\pgfpathmoveto{\pgfpoint{.7\pgf at circ@res at left}{\pgf at circ@res at zero}}
-	\pgfpathlineto{\pgfpoint{.6\pgf at circ@res at right}{\pgf at circ@res at zero}}
-	\pgfusepath{draw}
-	\pgfscope
-
-	\pgftransformshift{\pgfpoint{.5\pgf at circ@res at right}{\pgf at circ@res at zero}}
-	\pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
-	\endpgfscope
+    \pgfpathmoveto{\pgfpoint{.7\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at right}{\pgf at circ@res at zero}}
+    \pgfusepath{draw}
+    \pgfscope
+        \pgftransformshift{\pgfpoint{.5\pgf at circ@res at right}{\pgf at circ@res at 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 at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at up}}
-	\pgfusepath{draw}
-	\pgfpathmoveto{\pgfpoint{.2\pgf at circ@res at up}{.5\pgf at circ@res at left}}
-	\pgfpathlineto{\pgfpoint{.2\pgf at circ@res at up}{.5\pgf at circ@res at right}}
-	\pgfpathmoveto{\pgfpoint{.2\pgf at circ@res at down}{.5\pgf at circ@res at left}}
-	\pgfpathlineto{\pgfpoint{.2\pgf at circ@res at down}{.5\pgf at circ@res at right}}
-	\pgfusepath{draw}	
+\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 at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+    \pgf at circ@draworfill
+    \pgfpathmoveto{\pgfpoint{.2\pgf at circ@res at up}{.5\pgf at circ@res at left}}
+    \pgfpathlineto{\pgfpoint{.2\pgf at circ@res at up}{.5\pgf at circ@res at right}}
+    \pgfpathmoveto{\pgfpoint{.2\pgf at circ@res at down}{.5\pgf at circ@res at left}}
+    \pgfpathlineto{\pgfpoint{.2\pgf at circ@res at down}{.5\pgf at circ@res at 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 at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at down}}
-	\pgfusepath{draw}
+\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 at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at down}}
+    \pgf at circ@draworfill
 }
 
 %% Independent double oo source
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/oosource/height}}{oosource}{\ctikzvalof{bipoles/oosource/height}}{\ctikzvalof{bipoles/oosource/width}}{
-	\pgfpointorigin
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-	\pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf at circ@res at left}{0}}
-		{\ctikzvalof{bipoles/oosource/circlesize}\pgf at circ@res at left}
-	\pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf at circ@res at right}{0}}
-		{\ctikzvalof{bipoles/oosource/circlesize}\pgf at circ@res at right}	
-	\pgfusepath{draw}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/oosource/height}}
+{oosource}
+{\ctikzvalof{bipoles/oosource/height}}
+{\ctikzvalof{bipoles/oosource/width}}
+{
+    \pgfpointorigin
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf at circ@res at left}{0}}
+        {\ctikzvalof{bipoles/oosource/circlesize}\pgf at circ@res at left}
+    \pgf at circ@maybefill
+    \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf at circ@res at right}{0}}
+        {\ctikzvalof{bipoles/oosource/circlesize}\pgf at circ@res at right}
+    \pgf at circ@draworfill
+    \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf at circ@res at left}{0}}
+        {\ctikzvalof{bipoles/oosource/circlesize}\pgf at circ@res at left}
+    \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 at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
-	\pgfusepath{draw}
+\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 at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+    \pgf at circ@draworfill
 
-	\pgfpathmoveto{\pgfpoint{.7\pgf at circ@res at left}{\pgf at circ@res at zero}}
-	\pgfpathlineto{\pgfpoint{.7\pgf at circ@res at right}{\pgf at circ@res at zero}}
-	\pgfusepath{draw}
-	\pgfscope
-		\pgftransformshift{\pgfpoint{.5\pgf at circ@res at right}{\pgf at circ@res at zero}}
-		\pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
-	\endpgfscope
+    \pgfpathmoveto{\pgfpoint{.7\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgfpathlineto{\pgfpoint{.7\pgf at circ@res at right}{\pgf at circ@res at zero}}
+    \pgfusepath{draw}
+    \pgfscope
+        \pgftransformshift{\pgfpoint{.5\pgf at circ@res at right}{\pgf at circ@res at 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 at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
-	\pgfusepath{draw}
-	
-		\pgf at circ@res at up = .5\pgf at circ@res at up
-		\pgfscope
-			\pgftransformrotate{90}
-			\pgfpathmoveto{\pgfpoint{-\pgf at circ@res at up}{0cm}}
-			\pgfpathsine{\pgfpoint{.5\pgf at circ@res at up}{.5\pgf at circ@res at up}}
-			\pgfpathcosine{\pgfpoint{.5\pgf at circ@res at up}{-.5\pgf at circ@res at up}}
-			\pgfpathsine{\pgfpoint{.5\pgf at circ@res at up}{-.5\pgf at circ@res at up}}
-			\pgfpathcosine{\pgfpoint{.5\pgf at circ@res at up}{.5\pgf at circ@res at up}}
-			\pgfusepath{draw}
-		\endpgfscope
+\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 at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+    \pgf at circ@draworfill
 
+    \pgf at circ@res at up = .5\pgf at circ@res at up
+    \pgfscope
+        \pgftransformrotate{90}
+        \pgfpathmoveto{\pgfpoint{-\pgf at circ@res at up}{0cm}}
+        \pgfpathsine{\pgfpoint{.5\pgf at circ@res at up}{.5\pgf at circ@res at up}}
+        \pgfpathcosine{\pgfpoint{.5\pgf at circ@res at up}{-.5\pgf at circ@res at up}}
+        \pgfpathsine{\pgfpoint{.5\pgf at circ@res at up}{-.5\pgf at circ@res at up}}
+        \pgfpathcosine{\pgfpoint{.5\pgf at circ@res at up}{.5\pgf at circ@res at up}}
+        \pgfusepath{draw}
+    \endpgfscope
+
 }
 
 
 %% Controlled voltage source
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cvsource/height}}{cvsource}{\ctikzvalof{bipoles/cvsource/height}}{\ctikzvalof{bipoles/cvsource/width}}{
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/cvsource/height}}
+{cvsource}
+{\ctikzvalof{bipoles/cvsource/height}}
+{\ctikzvalof{bipoles/cvsource/width}}
+{
 
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
 
-			\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at up}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at down}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
-			\pgfusepath{draw}		
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at down}}
+    \pgfpathclose
+    \pgf at circ@draworfill
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
+    \pgfusepath{draw}
 }
 
 
@@ -752,49 +1091,62 @@
 
 
 %% 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 at circ@res at left}{\pgf at circ@res at zero}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
-	\pgfusepath{draw}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/cvsourceam/height}}
+{cvsourceAM}
+{\ctikzvalof{bipoles/cvsourceam/height}}
+{\ctikzvalof{bipoles/cvsourceam/width}}
+{
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at down}}
+    \pgfpathclose
+    \pgf at circ@draworfill
 
-	\ifpgf at circ@oldvoltagedirection
-		\pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf at circ@res at left]{$+$}
-		\pgftext[top,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf at circ@res at right]{$-$}
-	\else
-		\pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf at circ@res at left]{$-$}
-		\pgftext[top,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf at circ@res at right]{$+$}
-	\fi
+    \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+    \ifpgf at circ@oldvoltagedirection
+        \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf at circ@res at left]{$+$}
+        \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf at circ@res at right]{$-$}
+    \else
+        \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf at circ@res at left]{$-$}
+        \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf at circ@res at right]{$+$}
+    \fi
 }
 
 
 %% Controlled sinusoidal voltage source
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cvsourcesin/height}}{cvsourcesin}{\ctikzvalof{bipoles/cvsourcesin/height}}{\ctikzvalof{bipoles/cvsourcesin/width}}{
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/cvsourcesin/height}}
+{cvsourcesin}
+{\ctikzvalof{bipoles/cvsourcesin/height}}
+{\ctikzvalof{bipoles/cvsourcesin/width}}
+{
 
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
 
-		\pgfscope
-			\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at up}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at down}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
-			\pgfusepath{draw}		
-		\endpgfscope	
+    \pgfscope
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at down}}
+        \pgfpathclose
+        \pgf at circ@draworfill
+    \endpgfscope
 
-		\pgf at circ@res at up = .5\pgf at circ@res at up
-		\pgfscope
-			\pgftransformrotate{90}
-			\pgfpathmoveto{\pgfpoint{-\pgf at circ@res at up}{0cm}}
-			\pgfpathsine{\pgfpoint{.5\pgf at circ@res at up}{.5\pgf at circ@res at up}}
-			\pgfpathcosine{\pgfpoint{.5\pgf at circ@res at up}{-.5\pgf at circ@res at up}}
-			\pgfpathsine{\pgfpoint{.5\pgf at circ@res at up}{-.5\pgf at circ@res at up}}
-			\pgfpathcosine{\pgfpoint{.5\pgf at circ@res at up}{.5\pgf at circ@res at up}}
-			\pgfusepath{draw}
-		\endpgfscope
+    \pgf at circ@res at up = .5\pgf at circ@res at up
+    \pgfscope
+        \pgftransformrotate{90}
+        \pgfpathmoveto{\pgfpoint{-\pgf at circ@res at up}{0cm}}
+        \pgfpathsine{\pgfpoint{.5\pgf at circ@res at up}{.5\pgf at circ@res at up}}
+        \pgfpathcosine{\pgfpoint{.5\pgf at circ@res at up}{-.5\pgf at circ@res at up}}
+        \pgfpathsine{\pgfpoint{.5\pgf at circ@res at up}{-.5\pgf at circ@res at up}}
+        \pgfpathcosine{\pgfpoint{.5\pgf at circ@res at up}{.5\pgf at circ@res at up}}
+        \pgfusepath{draw}
+    \endpgfscope
 }
 
 
@@ -801,116 +1153,339 @@
 
 %% Controlled sinusoidal current source
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cvsourcesin/height}}{cisourcesin}{\ctikzvalof{bipoles/cvsourcesin/height}}{\ctikzvalof{bipoles/cvsourcesin/width}}{
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/cvsourcesin/height}}
+{cisourcesin}
+{\ctikzvalof{bipoles/cvsourcesin/height}}
+{\ctikzvalof{bipoles/cvsourcesin/width}}
+{
 
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
 
-		\pgfscope
-			\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at up}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at down}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
-			\pgfusepath{draw}		
-		\endpgfscope	
+    \pgfscope
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at down}}
+        \pgfpathclose
+        \pgf at circ@draworfill
+    \endpgfscope
 
-		\pgf at circ@res at up = .5\pgf at circ@res at up
-		\pgfscope
-			\pgftransformrotate{90}
-			\pgfpathmoveto{\pgfpoint{-\pgf at circ@res at up}{0cm}}
-			\pgfpathsine{\pgfpoint{.5\pgf at circ@res at up}{.5\pgf at circ@res at up}}
-			\pgfpathcosine{\pgfpoint{.5\pgf at circ@res at up}{-.5\pgf at circ@res at up}}
-			\pgfpathsine{\pgfpoint{.5\pgf at circ@res at up}{-.5\pgf at circ@res at up}}
-			\pgfpathcosine{\pgfpoint{.5\pgf at circ@res at up}{.5\pgf at circ@res at up}}
-			\pgfusepath{draw}
-		\endpgfscope
+    \pgf at circ@res at up = .5\pgf at circ@res at up
+    \pgfscope
+        \pgftransformrotate{90}
+        \pgfpathmoveto{\pgfpoint{-\pgf at circ@res at up}{0cm}}
+        \pgfpathsine{\pgfpoint{.5\pgf at circ@res at up}{.5\pgf at circ@res at up}}
+        \pgfpathcosine{\pgfpoint{.5\pgf at circ@res at up}{-.5\pgf at circ@res at up}}
+        \pgfpathsine{\pgfpoint{.5\pgf at circ@res at up}{-.5\pgf at circ@res at up}}
+        \pgfpathcosine{\pgfpoint{.5\pgf at circ@res at up}{.5\pgf at circ@res at 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}
 
-%% Controlled current source
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at down}}
+    \pgfpathclose
+    \pgf at circ@draworfill
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cisource/height}}{cisource}{\ctikzvalof{bipoles/cisource/height}}{\ctikzvalof{bipoles/cisource/width}}{
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at down}}
+    \pgfusepath{draw}
+}
 
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-	
-			\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at up}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at down}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
-			\pgfpathmoveto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at up}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at 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 at circ@res at left}{\pgf at circ@res at zero}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at down}}
+    \pgfpathclose
+    \pgf at circ@draworfill
+    \pgfpathmoveto{\pgfpoint{.7\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgfpathlineto{\pgfpoint{.7\pgf at circ@res at right}{\pgf at circ@res at zero}}
+    \pgfusepath{draw}
+    \pgfscope
+        \pgftransformshift{\pgfpoint{.5\pgf at circ@res at right}{\pgf at circ@res at zero}}
+        \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+    \endpgfscope
 }
 
+%% Cute Independent voltage source
 
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/vsource/height}}
+{vsourceC}
+{\ctikzvalof{bipoles/vsource/height}}
+{\ctikzvalof{bipoles/vsource/width}}
+{
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+    \pgf at circ@draworfill
+    \pgfmathsetmacro{\@@thicker}{3*\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}}
+    \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at right}{\pgf at circ@res at zero}}
+    \pgfsetroundcap\pgfusepath{draw}
+}
+%% Cute Independent current source
 
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/isource/height}}
+{isourceC}
+{\ctikzvalof{bipoles/isource/height}}
+{\ctikzvalof{bipoles/isource/width}}
+{
+    \pgfpointorigin
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+    \pgf at circ@draworfill
+    \pgfmathsetmacro{\@@thicker}{3*\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}}
+    \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{.6\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{.6\pgf at circ@res at down}}
+    \pgfsetroundcap\pgfusepath{draw}
+}
+%% Cute Controlled voltage source
 
-%% Controlled current source - American
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/cvsource/height}}
+{cvsourceC}
+{\ctikzvalof{bipoles/cvsource/height}}
+{\ctikzvalof{bipoles/cvsource/width}}
+{
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgf at circ@draworfill
+    \pgfmathsetmacro{\@@thicker}{3*\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}}
+    \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at right}{\pgf at circ@res at zero}}
+    \pgfsetroundcap\pgfusepath{draw}
+}
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cisourceam/height}}{cisourceAM}{\ctikzvalof{bipoles/cisourceam/height}}{\ctikzvalof{bipoles/cisourceam/width}}{
+%% Cute Controlled current source
 
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-	
-			\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at up}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at down}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
-			\pgfusepath{draw}		
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/cisource/height}}
+{cisourceC}
+{\ctikzvalof{bipoles/cisource/height}}
+{\ctikzvalof{bipoles/cisource/width}}
+{
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgf at circ@draworfill
+    \pgfmathsetmacro{\@@thicker}{3*\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}}
+    \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at zero}{.6\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{.6\pgf at circ@res at down}}
+    \pgfsetroundcap\pgfusepath{draw}
+}
 
-	\pgfpathmoveto{\pgfpoint{.7\pgf at circ@res at left}{\pgf at circ@res at zero}}
-	\pgfpathlineto{\pgfpoint{.7\pgf at circ@res at right}{\pgf at circ@res at zero}}
-	\pgfusepath{draw}
-	\pgfscope
-		\pgftransformshift{\pgfpoint{.5\pgf at circ@res at right}{\pgf at circ@res at zero}}
-		\pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
-	\endpgfscope
+%%  Noise voltage source
+
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/vsource/height}}
+{vsourceN}
+{\ctikzvalof{bipoles/vsource/height}}
+{\ctikzvalof{bipoles/vsource/width}}
+{
+    \pgfscope
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+        \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+        %
+        \pgf at circ@res at step=0.125\pgf at circ@Rlen\relax
+        \edef\pgf at noise@temp{dashed}
+        \edef\pgf at noise@fill{\pgfkeysvalueof{/tikz/circuitikz/bipoles/noise sources/fillcolor}}
+        \ifx\pgf at noise@temp\pgf at noise@fill
+            % fillable in this case
+            \pgf at circ@draworfillandclip
+            \pgfmathsetmacro{\thinner}{.5*\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}}
+            \pgfsetlinewidth{\thinner\pgfstartlinewidth}
+            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+            \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+            \advance\pgf at circ@res at up by \pgf at circ@res at step\advance\pgf at circ@res at down by \pgf at circ@res at step
+            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+            \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+            \advance\pgf at circ@res at up by \pgf at circ@res at step\advance\pgf at circ@res at down by \pgf at circ@res at step
+            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+            \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+            \advance\pgf at circ@res at up by \pgf at circ@res at step\advance\pgf at circ@res at down by \pgf at circ@res at step
+            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+            \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+            %
+            \advance\pgf at circ@res at up by -4\pgf at circ@res at step \advance\pgf at circ@res at down by -4\pgf at circ@res at step
+            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+            \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+            \advance\pgf at circ@res at up by -\pgf at circ@res at step\advance\pgf at circ@res at down by -\pgf at circ@res at step
+            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+            \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+            \advance\pgf at circ@res at up by -\pgf at circ@res at step\advance\pgf at circ@res at down by -\pgf at circ@res at step
+            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+            \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+            \pgfusepath{draw}
+        \else
+            \pgfsetfillcolor{\pgf at noise@fill}
+            \pgfusepath{draw,fill}
+        \fi
+    \endpgfscope
+    \pgfmathsetmacro{\@@thicker}{3*\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}}
+    \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at right}{\pgf at circ@res at zero}}
+    \pgfsetroundcap\pgfusepath{draw}
 }
+%% Noise current source
 
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/isource/height}}
+{isourceN}
+{\ctikzvalof{bipoles/isource/height}}
+{\ctikzvalof{bipoles/isource/width}}
+{
+    \pgfpointorigin
+    \pgfscope
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+        \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+        %
+        \pgf at circ@res at step=0.125\pgf at circ@Rlen\relax
+        \edef\pgf at noise@temp{dashed}
+        \edef\pgf at noise@fill{\pgfkeysvalueof{/tikz/circuitikz/bipoles/noise sources/fillcolor}}
+        \ifx\pgf at noise@temp\pgf at noise@fill
+            % fillable in this case
+            \pgf at circ@draworfillandclip
+            \pgfmathsetmacro{\thinner}{.5*\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}}
+            \pgfsetlinewidth{\thinner\pgfstartlinewidth}
+            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+            \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+            \advance\pgf at circ@res at up by \pgf at circ@res at step\advance\pgf at circ@res at down by \pgf at circ@res at step
+            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+            \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+            \advance\pgf at circ@res at up by \pgf at circ@res at step\advance\pgf at circ@res at down by \pgf at circ@res at step
+            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+            \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+            \advance\pgf at circ@res at up by \pgf at circ@res at step\advance\pgf at circ@res at down by \pgf at circ@res at step
+            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+            \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+            %
+            \advance\pgf at circ@res at up by -4\pgf at circ@res at step \advance\pgf at circ@res at down by -4\pgf at circ@res at step
+            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+            \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+            \advance\pgf at circ@res at up by -\pgf at circ@res at step\advance\pgf at circ@res at down by -\pgf at circ@res at step
+            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+            \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+            \advance\pgf at circ@res at up by -\pgf at circ@res at step\advance\pgf at circ@res at down by -\pgf at circ@res at step
+            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+            \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+            \pgfusepath{draw}
+        \else
+            \pgfsetfillcolor{\pgf at noise@fill}
+            \pgfusepath{draw,fill}
+        \fi
+    \endpgfscope
+    \pgfmathsetmacro{\@@thicker}{3*\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}}
+    \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{.6\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{.6\pgf at circ@res at down}}
+    \pgfsetroundcap\pgfusepath{draw}
+}
 %% Black generic diode
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fulldiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{fulldiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
 
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
 
-	\pgfscope
-		\pgftransformxshift{\pgf at circ@res at left}
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
-		\pgfusepath{draw,fill}
-	\endpgfscope
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
-		\pgfusepath{draw}
+    \pgfscope
+        \pgftransformxshift{\pgf at circ@res at left}
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
+        \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
+        \pgfusepath{draw,fill}
+    \endpgfscope
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfusepath{draw}
 }
 
 %% Black Zener diode
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fullzdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{fullzdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
 
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
 
-	\pgfscope
-		\pgftransformxshift{\pgf at circ@res at left}
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
-		\pgfusepath{draw,fill}
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-.6\pgf at circ@res at left}{\pgf at circ@res at up}}
-		\pgfusepath{draw}
-	\endpgfscope
+    \pgfscope
+        \pgftransformxshift{\pgf at circ@res at left}
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
+        \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
+        \pgfusepath{draw,fill}
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-.6\pgf at circ@res at left}{\pgf at circ@res at up}}
+        \pgfusepath{draw}
+    \endpgfscope
 }
 
 %% Black alternative zigzag Zener diode
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fullzzdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{fullzzdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
 
     \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
 
@@ -931,175 +1506,227 @@
 
 %% 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 at circ@res at left}
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
-		\pgfusepath{draw,fill}
-		
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-.6\pgf at circ@res at left}{.6\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-.6\pgf at circ@res at left}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-1.4\pgf at circ@res at left}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-1.4\pgf at circ@res at left}{.6\pgf at circ@res at up}}
-		\pgfusepath{draw}
-	\endpgfscope
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{fullsdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
 
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfscope
+        \pgftransformxshift{\pgf at circ@res at left}
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
+        \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
+        \pgfusepath{draw,fill}
+
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-.6\pgf at circ@res at left}{.6\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-.6\pgf at circ@res at left}{\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-1.4\pgf at circ@res at left}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-1.4\pgf at circ@res at left}{.6\pgf at circ@res at 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 at circ@res at left}
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
-		\pgfusepath{draw,fill}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{fulltdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
 
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-.6\pgf at circ@res at left}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-.6\pgf at circ@res at left}{\pgf at circ@res at up}}
-		\pgfusepath{draw}
-	\endpgfscope
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfscope
+        \pgftransformxshift{\pgf at circ@res at left}
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
+        \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
+        \pgfusepath{draw,fill}
+
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-.6\pgf at circ@res at left}{\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-.6\pgf at circ@res at left}{\pgf at circ@res at 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 at circ@res at left}
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
-		\pgfusepath{draw,fill}
-	\endpgfscope
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
-		\pgfusepath{draw}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{fulllediode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
 
-			\pgfsetlinewidth{\pgfstartlinewidth}
-			\pgfsetarrowsend{latex'}
-			\pgfpathmoveto{\pgfpoint{-0.4\pgf at circ@res at right}{\pgf at circ@res at up}}
-			\pgfpathlineto{\pgfpoint{0.6\pgf at circ@res at right}{2\pgf at circ@res at up}}
-			\pgfusepath{draw}
-			\pgfpathmoveto{\pgfpoint{0.2\pgf at circ@res at right}{0.8\pgf at circ@res at up}}
-			\pgfpathlineto{\pgfpoint{1.2\pgf at circ@res at right}{1.8\pgf at circ@res at up}}
-			\pgfusepath{draw}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfscope
+        \pgftransformxshift{\pgf at circ@res at left}
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
+        \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
+        \pgfusepath{draw,fill}
+    \endpgfscope
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfusepath{draw}
 
+    \pgfsetlinewidth{\pgfstartlinewidth}
+    \pgfsetarrowsend{latexslim}
+    \pgfpathmoveto{\pgfpoint{-0.4\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{0.6\pgf at circ@res at right}{2\pgf at circ@res at up}}
+    \pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{0.2\pgf at circ@res at right}{0.8\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{1.2\pgf at circ@res at right}{1.8\pgf at circ@res at up}}
+    \pgfusepath{draw}
+
 }
 
 %% Black photodiode
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fullpdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{fullpdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
 
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-	\pgfscope
-		\pgftransformxshift{\pgf at circ@res at left}
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
-		\pgfusepath{draw,fill}
-	\endpgfscope
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
-		\pgfusepath{draw}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfscope
+        \pgftransformxshift{\pgf at circ@res at left}
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
+        \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
+        \pgfusepath{draw,fill}
+    \endpgfscope
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfusepath{draw}
 
-			\pgfsetlinewidth{\pgfstartlinewidth}
-			\pgfsetarrowsstart{latex'}
-			\pgfpathmoveto{\pgfpoint{-0.4\pgf at circ@res at right}{\pgf at circ@res at up}}
-			\pgfpathlineto{\pgfpoint{0.6\pgf at circ@res at right}{2\pgf at circ@res at up}}
-			\pgfusepath{draw}
-			\pgfpathmoveto{\pgfpoint{0.2\pgf at circ@res at right}{0.8\pgf at circ@res at up}}
-			\pgfpathlineto{\pgfpoint{1.2\pgf at circ@res at right}{1.8\pgf at circ@res at up}}
-			\pgfusepath{draw}
+    \pgfsetlinewidth{\pgfstartlinewidth}
+    \pgfsetarrowsstart{latexslim}
+    \pgfpathmoveto{\pgfpoint{-0.4\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{0.6\pgf at circ@res at right}{2\pgf at circ@res at up}}
+    \pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{0.2\pgf at circ@res at right}{0.8\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{1.2\pgf at circ@res at right}{1.8\pgf at circ@res at up}}
+    \pgfusepath{draw}
 }
 
 %% Black varcap
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/varcap/height}}{fullvarcap}{\ctikzvalof{bipoles/varcap/height}}{\ctikzvalof{bipoles/varcap/width}}{
-	\pgf at circ@res at temp=\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
-	\pgfsetlinewidth{\pgf at circ@res at temp}
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-2\pgf at circ@res at temp}{0pt}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-2\pgf at circ@res at temp}{0pt}}
-	\pgfusepath{draw,fill}
-	%
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-2\pgf at circ@res at temp}{\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-2\pgf at circ@res at temp}{\pgf at circ@res at up}}
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
-	\pgfusepath{draw}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/varcap/height}}
+{fullvarcap}
+{\ctikzvalof{bipoles/varcap/height}}
+{\ctikzvalof{bipoles/varcap/width}}
+{
+    \pgf at circ@res at temp=\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+    \pgfsetlinewidth{\pgf at circ@res at temp}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-2\pgf at circ@res at temp}{0pt}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-2\pgf at circ@res at temp}{0pt}}
+    \pgfusepath{draw,fill}
+    %
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-2\pgf at circ@res at temp}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-2\pgf at circ@res at temp}{\pgf at circ@res at up}}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfusepath{draw}
 }
 
-%% Empty generic diode
+%% Code for the diode triangle
+\def\pgf at circ@basicdiodeshape{
+    % \pgfscope
+        \pgftransformxshift{\pgf at circ@res at left}
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
+        \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
+        \pgfpathclose
+        \pgf at circ@draworfill
+        \pgfscope
+            % to allow filling, we need to draw explicitily the stroke here.
+            \pgfsetlinewidth{\pgfstartlinewidth}
+            \ifpgf at circuit@bipole at strokedsymbol
+                \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
+                \pgfpathlineto{\pgfpoint{0pt}{0pt}}
+                \pgfusepath{draw}
+            \fi
+        \endpgfscope
+    % \endpgfscope
+}
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptydiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
 
+%% Empty generic diode
 
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-
-	\pgfscope
-		\pgftransformxshift{\pgf at circ@res at left}
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
-		\pgfusepath{draw}
-	\endpgfscope
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
-		\pgfusepath{draw}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{emptydiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfscope
+        \pgf at circ@basicdiodeshape
+    \endpgfscope
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfusepath{draw}
 }
 
 %% Empty Zener diode
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptyzdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{emptyzdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
 
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
 
-	\pgfscope
-		\pgftransformxshift{\pgf at circ@res at left}
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
-		\pgfusepath{draw}
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-0.6\pgf at circ@res at left}{\pgf at circ@res at up}}
-		\pgfusepath{draw}
-	\endpgfscope
+    \pgfscope
+        \pgf at circ@basicdiodeshape
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-0.6\pgf at circ@res at left}{\pgf at circ@res at up}}
+        \pgfusepath{draw}
+    \endpgfscope
 }
 
 %% Empty alternative zigzag Zener diode
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptyzzdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{emptyzzdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
 
     \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
 
     \pgfscope
-        \pgftransformxshift{\pgf at circ@res at left}
-        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
-        \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
-        \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
-        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
-        \pgfusepath{draw}
+        \pgf at circ@basicdiodeshape
         \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-1.8\pgf at circ@res at left}{\pgf at circ@res at down-0.5\pgf at circ@res at up}}
         \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{\pgf at circ@res at down}}
         \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{\pgf at circ@res at up}}
@@ -1109,337 +1736,688 @@
 }
 %% 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 at circ@res at left}
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
-		\pgfusepath{draw}
-		
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-.6\pgf at circ@res at left}{.6\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-.6\pgf at circ@res at left}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-1.4\pgf at circ@res at left}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-1.4\pgf at circ@res at left}{.6\pgf at circ@res at up}}
-		\pgfusepath{draw}
-	\endpgfscope
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{emptysdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
 
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfscope
+        \pgf at circ@basicdiodeshape
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-.6\pgf at circ@res at left}{.6\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-.6\pgf at circ@res at left}{\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-1.4\pgf at circ@res at left}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-1.4\pgf at circ@res at left}{.6\pgf at circ@res at 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 at circ@res at left}
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
-		\pgfusepath{draw}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{emptytdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
 
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-.6\pgf at circ@res at left}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-.6\pgf at circ@res at left}{\pgf at circ@res at up}}
-		\pgfusepath{draw}
-	\endpgfscope
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfscope
+        \pgf at circ@basicdiodeshape
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-.6\pgf at circ@res at left}{\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-.6\pgf at circ@res at left}{\pgf at circ@res at 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 at circ@res at left}
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
-		\pgfusepath{draw}
-	\endpgfscope
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
-		\pgfusepath{draw}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{emptylediode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
 
-			\pgfsetlinewidth{\pgfstartlinewidth}
-			\pgfsetarrowsend{latex'}
-			\pgfpathmoveto{\pgfpoint{-0.4\pgf at circ@res at right}{\pgf at circ@res at up}}
-			\pgfpathlineto{\pgfpoint{0.6\pgf at circ@res at right}{2\pgf at circ@res at up}}
-			\pgfusepath{draw}
-			\pgfpathmoveto{\pgfpoint{0.2\pgf at circ@res at right}{0.8\pgf at circ@res at up}}
-			\pgfpathlineto{\pgfpoint{1.2\pgf at circ@res at right}{1.8\pgf at circ@res at up}}
-			\pgfusepath{draw}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfscope
+        \pgf at circ@basicdiodeshape
+    \endpgfscope
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfusepath{draw}
+
+    \pgfsetlinewidth{\pgfstartlinewidth}
+    \pgfsetarrowsend{latexslim}
+    \pgfpathmoveto{\pgfpoint{-0.4\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{0.6\pgf at circ@res at right}{2\pgf at circ@res at up}}
+    \pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{0.2\pgf at circ@res at right}{0.8\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{1.2\pgf at circ@res at right}{1.8\pgf at circ@res at up}}
+    \pgfusepath{draw}
 }
 
 %% Empty photodiode
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptypdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{emptypdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
 
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-	\pgfscope
-		\pgftransformxshift{\pgf at circ@res at left}
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at left}{0pt}}
-		\pgfusepath{draw}
-	\endpgfscope
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
-		\pgfusepath{draw}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfscope
+        \pgf at circ@basicdiodeshape
+    \endpgfscope
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfusepath{draw}
 
-			\pgfsetlinewidth{\pgfstartlinewidth}
-			\pgfsetarrowsstart{latex'}
-			\pgfpathmoveto{\pgfpoint{-0.4\pgf at circ@res at right}{\pgf at circ@res at up}}
-			\pgfpathlineto{\pgfpoint{0.6\pgf at circ@res at right}{2\pgf at circ@res at up}}
-			\pgfusepath{draw}
-			\pgfpathmoveto{\pgfpoint{0.2\pgf at circ@res at right}{0.8\pgf at circ@res at up}}
-			\pgfpathlineto{\pgfpoint{1.2\pgf at circ@res at right}{1.8\pgf at circ@res at up}}
-			\pgfusepath{draw}
+    \pgfsetlinewidth{\pgfstartlinewidth}
+    \pgfsetarrowsstart{latexslim}
+    \pgfpathmoveto{\pgfpoint{-0.4\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{0.6\pgf at circ@res at right}{2\pgf at circ@res at up}}
+    \pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{0.2\pgf at circ@res at right}{0.8\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{1.2\pgf at circ@res at right}{1.8\pgf at circ@res at up}}
+    \pgfusepath{draw}
 }
 
 %% Empty varcap
 
-\pgfcircdeclarebipole{
-	\anchor{strokepathstart}{
-			\northeast
-				\pgf at y=0cm
-				\advance\pgf at x by -\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth
-				\advance\pgf at x by -\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth
-	}
-	\anchor{strokepathend}{
-		\northeast
-		\pgf at y=0cm
-	}	
-	}{\ctikzvalof{bipoles/varcap/height}}{emptyvarcap}{\ctikzvalof{bipoles/varcap/height}}{\ctikzvalof{bipoles/varcap/width}}{
-	\pgf at circ@res at temp=\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
-	\pgfsetlinewidth{\pgf at circ@res at temp}
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-2\pgf at circ@res at temp}{0pt}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-2\pgf at circ@res at temp}{0pt}}
-	\pgfusepath{draw}
-	%
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-2\pgf at circ@res at temp}{\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at right-2\pgf at circ@res at temp}{\pgf at circ@res at up}}
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
-	\pgfusepath{draw}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/varcap/height}}
+{emptyvarcap}
+{\ctikzvalof{bipoles/varcap/height}}
+{\ctikzvalof{bipoles/varcap/width}}
+{
+    \pgf at circ@res at temp=\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+    \pgfsetlinewidth{\pgf at circ@res at temp}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-2\pgf at circ@res at temp}{0pt}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+    % \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-2\pgf at circ@res at temp}{0pt}}
+    \pgfpathclose
+    \pgf at circ@draworfill
+    \pgfscope
+        % to allow filling, we need to draw explicitily the stroke here.
+        \pgfsetlinewidth{\pgfstartlinewidth}
+        \ifpgf at circuit@bipole at strokedsymbol
+            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-2\pgf at circ@res at temp}{0pt}}
+            \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+            \pgfusepath{draw}
+        \fi
+    \endpgfscope
+    %
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-2\pgf at circ@res at temp}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-2\pgf at circ@res at temp}{\pgf at circ@res at up}}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfusepath{draw}
 }
 
-%% (Closing) SPST
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/spst/depth}}{cspst}{\ctikzvalof{bipoles/spst/height}}{\ctikzvalof{bipoles/spst/width}}{
+%% Empty bidirectionaldiode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/bidirectionaldiode/height}}{emptybidirectionaldiode}{\ctikzvalof{bipoles/bidirectionaldiode/height}}{\ctikzvalof{bipoles/bidirectionaldiode/width}}
+{
+
 	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
-	\pgfpathlineto{\pgfpoint{.6\pgf at circ@res at right}{\pgf at circ@res at up}}
+
+        \pgf at circ@res at other = \ctikzvalof{bipoles/bidirectionaldiode/diode width left}\pgf at circ@res at left
+        \pgf at circ@res at step = \ctikzvalof{bipoles/bidirectionaldiode/diode width right}\pgf at circ@res at right
+
+	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{0pt}}
+	\pgfpathlineto{\pgfpoint{0.95\pgf at circ@res at step}{0.707*(\pgf at circ@res at other-\pgf at circ@res at step)}} % sqrt(1/2)
+	\pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{1.414*(\pgf at circ@res at other-\pgf at circ@res at step)}}
+	\pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{-1.414*(\pgf at circ@res at other-\pgf at circ@res at step)}}
+
+	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
+	\pgfpathlineto{\pgfpoint{0.95\pgf at circ@res at other}{-0.707*(\pgf at circ@res at other-\pgf at circ@res at step)}} % sqrt(1/2)
+	\pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{-1.414*(\pgf at circ@res at other-\pgf at circ@res at step)}}
+	\pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{1.414*(\pgf at circ@res at other-\pgf at circ@res at step)}}
+
+        \pgf at circ@draworfill
+	% \pgfusepath{draw}
+
+	\pgfsetlinewidth{\pgfstartlinewidth}
+
+	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{0pt}}
+	\pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+
+	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
+	\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+
 	\pgfusepath{draw}
-	
-	\pgfsetarrowsstart{latex'}
-	\pgfpathmoveto{\pgfpoint{.2\pgf at circ@res at right}{\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint{.2\pgf at circ@res at right}{0\pgf at circ@res at down}}
-	\pgfpatharcto{1.2\pgf at circ@res at right}{1.2\pgf at circ@res at right}{0}{0}{1}{\pgfpoint{.9\pgf at circ@res at left}{.9\pgf at circ@res at up}}
-	\pgfsetbeveljoin
-	\pgfusepath{draw}
+
 }
 
+
+%% Full bidirectionaldiode
+
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/bidirectionaldiode/height}}
+{fullbidirectionaldiode}
+{\ctikzvalof{bipoles/bidirectionaldiode/height}}
+{\ctikzvalof{bipoles/bidirectionaldiode/width}}
+{
+
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+    \pgf at circ@res at other = \ctikzvalof{bipoles/bidirectionaldiode/diode width left}\pgf at circ@res at left
+    \pgf at circ@res at step = \ctikzvalof{bipoles/bidirectionaldiode/diode width right}\pgf at circ@res at right
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{0pt}}
+    \pgfpathlineto{\pgfpoint{0.95\pgf at circ@res at step}{0.707*(\pgf at circ@res at other-\pgf at circ@res at step)}} % sqrt(1/2)
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{1.414*(\pgf at circ@res at other-\pgf at circ@res at step)}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{-1.414*(\pgf at circ@res at other-\pgf at circ@res at step)}}
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
+    \pgfpathlineto{\pgfpoint{0.95\pgf at circ@res at other}{-0.707*(\pgf at circ@res at other-\pgf at circ@res at step)}} % sqrt(1/2)
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{-1.414*(\pgf at circ@res at other-\pgf at circ@res at step)}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{1.414*(\pgf at circ@res at other-\pgf at circ@res at step)}}
+
+    \pgfusepath{draw, fill}
+
+    \pgfsetlinewidth{\pgfstartlinewidth}
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{0pt}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+
+    \pgfusepath{draw}
+
+}
+
+%% (Closing) SPST
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/spst/depth}}
+{cspst}
+{\ctikzvalof{bipoles/spst/height}}
+{\ctikzvalof{bipoles/spst/width}}
+{
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+    \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfusepath{draw}
+
+    \pgfscope
+        \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+        \pgfpathmoveto{\pgfpointpolar{90}{1.2\pgf at circ@res at right}}
+        \pgfpatharc{90}{-20}{1.2\pgf at circ@res at right}
+        \pgfsetarrowsend{latexslim}
+        \pgfsetbeveljoin
+        \pgfusepath{draw}
+    \endpgfscope
+}
+
 %% Opening SPST
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/spst/depth}}{ospst}{\ctikzvalof{bipoles/spst/height}}{\ctikzvalof{bipoles/spst/width}}{
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/spst/depth}}
+{ospst}
+{\ctikzvalof{bipoles/spst/height}}
+{\ctikzvalof{bipoles/spst/width}}
+{
 
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
-	\pgfpathlineto{\pgfpoint{.6\pgf at circ@res at right}{\pgf at circ@res at up}}
-	\pgfusepath{draw}
-	
-	\pgfpathmoveto{\pgfpoint{.2\pgf at circ@res at right}{0.5\pgf at circ@res at down}}
-	\pgfpatharcto{1.1\pgf at circ@res at right}{1.1\pgf at circ@res at right}{0}{0}{1}{\pgfpoint{.7\pgf at circ@res at left}{.9\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint{1.2\pgf at circ@res at left}{1\pgf at circ@res at up}}
-	\pgfsetarrowsend{latex'}
-	\pgfsetbeveljoin
-	\pgfusepath{draw}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+    \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfusepath{draw}
+
+    \pgfscope
+        \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+        \pgfpathmoveto{\pgfpointpolar{-10}{1.2\pgf at circ@res at right}}
+        \pgfpatharc{-10}{90}{1.2\pgf at circ@res at right}
+        \pgfsetarrowsend{latexslim}
+        \pgfsetbeveljoin
+        \pgfusepath{draw}
+    \endpgfscope
 }
 
 %% Normal open Switch
-\pgfcircdeclarebipole{}{0}{nos}{\ctikzvalof{bipoles/nos/height}}{\ctikzvalof{bipoles/nos/width}}{
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/nos/depth}}
+{nos}
+{\ctikzvalof{bipoles/nos/height}}
+{\ctikzvalof{bipoles/nos/width}}
+{
 
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
-	\pgfpathlineto{\pgfpoint{.9\pgf at circ@res at right}{\pgf at circ@res at up}}
-		\pgfsetbuttcap
-	\pgfusepath{draw}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+    \pgfpathlineto{\pgfpoint{.9\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfsetbuttcap
+    \pgfusepath{draw}
 }
 
 %% Normal closed Switch
-\pgfcircdeclarebipole{}{0}{ncs}{\ctikzvalof{bipoles/ncs/height}}{\ctikzvalof{bipoles/ncs/width}}{
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
-	\pgfpathlineto{\pgfpoint{.9\pgf at circ@res at right}{\pgf at circ@res at up}}
-	\pgfusepath{draw}
-	\pgfsetlinewidth{\pgfstartlinewidth}
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
-	\pgfpathlineto{\pgfpoint{.2\pgf at circ@res at right}{0pt}}
-	\pgfpathlineto{\pgfpoint{.2\pgf at circ@res at right}{\pgf at circ@res at up}}
-	\pgfusepath{draw}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/ncs/depth}}
+{ncs}
+{\ctikzvalof{bipoles/ncs/height}}
+{\ctikzvalof{bipoles/ncs/width}}
+{
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+    \pgfpathlineto{\pgfpoint{.9\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfusepath{draw}
+    \pgfsetlinewidth{\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+    \pgfpathlineto{\pgfpoint{.2\pgf at circ@res at right}{0pt}}
+    \pgfpathlineto{\pgfpoint{.2\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \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 at circ@res at left}{.5\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{.5\pgf at circ@res at up}}
-	\pgfpathmoveto{\pgfpoint{0}{.5\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint{0}{\pgf at circ@res at up}}
-	\pgfusepath{draw}
-	
-	\pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
-	\pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
-	\pgftransformshift{\pgfpoint{2\pgf at circ@res at right}{0pt}}
-	\pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
+\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 at circ@res at left}{.5\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{.5\pgf at circ@res at up}}
+    \pgfpathmoveto{\pgfpoint{0}{.5\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{0}{\pgf at circ@res at up}}
+    \pgfusepath{draw}
+
+    \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+    \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
+    \pgftransformshift{\pgfpoint{2\pgf at circ@res at right}{0pt}}
+    \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
 }
 
+%% Normally closed Push Button
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/pushbutton/height 2}}
+{ncpushbutton}
+{\ctikzvalof{bipoles/pushbutton/height}}
+{\ctikzvalof{bipoles/pushbutton/width}}
+{
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
+    \pgf at circ@res at temp=\pgfkeysvalueof{/tikz/circuitikz/nodes width}\pgf at circ@Rlen
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{-\pgf at circ@res at temp}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{-\pgf at circ@res at temp}}
+    \pgfpathmoveto{\pgfpoint{0}{-\pgf at circ@res at temp}}
+    \pgfpathlineto{\pgfpoint{0}{\pgf at circ@res at up}}
+    \pgfusepath{draw}
+    %
+    \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+    \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
+    \pgftransformshift{\pgfpoint{2\pgf at circ@res at right}{0pt}}
+    \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
+}
+% cute switch "to" shapes help function
+% #1 -> name
+% #2 -> barposition
+% #3 -> arrowcode
+\long\def\pgfcircdeclarecutesw#1#2#3{
+    \pgfcircdeclarebipole
+    {
+        \savedanchor\midlever{
+            % these values are calculated when we create the definition of the shape.
+            \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/cuteswitch/height}\pgf at circ@Rlen
+            \pgf at circ@res at temp=\pgfkeysvalueof{/tikz/circuitikz/nodes width}\pgf at circ@Rlen
+            \pgf at circ@res at temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf at circ@res at temp
+            \pgf at circ@res at down = -.5\pgf at y
+            \pgf at circ@res at up = .5\pgf at y
+            \pgfextracty{\pgf at circ@res at other}{#2}
+            \pgf at x=0pt
+            \pgf at y=.5\pgf at circ@res at other
+        }
+        % mid of the lever, to stack switches
+        \anchor{mid}{\midlever}
+        \anchor{out}{\northeast \pgf at y=0cm}
+        \anchor{in}{\southwest\pgf at y=0cm}
+    }
+    {\ctikzvalof{bipoles/cuteswitch/height 2}}
+    {#1}
+    {\ctikzvalof{bipoles/cuteswitch/height}}
+    {\ctikzvalof{bipoles/cuteswitch/width}}{
+        \pgfscope
+        % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
+        \pgf at circ@res at temp=\pgfkeysvalueof{/tikz/circuitikz/nodes width}\pgf at circ@Rlen
+        \pgf at circ@res at temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf at circ@res at temp
+        \pgfsetlinewidth{2\pgf at circ@res at temp}
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+        \pgfpathlineto{#2}
+        \pgfsetroundcap\pgfusepath{draw}
+        \endpgfscope
+        \pgfscope % arrow
+        #3
+        \endpgfscope
+        \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+        \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
+        \pgftransformshift{\pgfpoint{2\pgf at circ@res at right}{0pt}}
+        \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
+    }
+}
+
+%% closed cute switch
+\pgfcircdeclarecutesw{cuteclosedswitch}
+    {\pgfpoint{\pgf at circ@res at right}{1.5\pgf at circ@res at temp}}
+    {}
+
+%% open cute switch
+\pgfcircdeclarecutesw{cuteopenswitch}
+    {\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+    {}
+
+%% closing cute switch
+\pgfcircdeclarecutesw{cuteclosingswitch}
+    {\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+    {
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}} % in node
+    \pgfpathmoveto{\pgfpointpolar{70}{1.2\pgf at circ@res at right}}
+    \pgfpatharc{70}{-10}{1.2\pgf at circ@res at right}
+    \pgfsetarrowsend{latexslim}
+    \pgfusepath{draw}
+    }
+
+%% opening cute switch
+\pgfcircdeclarecutesw{cuteopeningswitch}
+    {\pgfpoint{\pgf at circ@res at right}{1.5\pgf at circ@res at temp}}
+    {
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}} % in node
+    \pgfpathmoveto{\pgfpointpolar{-10}{1.2\pgf at circ@res at right}}
+    \pgfpatharc{-10}{60}{1.2\pgf at circ@res at right}
+    \pgfsetarrowsend{latexslim}
+    \pgfusepath{draw}
+    }
+
+
 % % METERINGSHAPE
-\long\def\drawmeteringcircle{
-	\def\pgf at circ@temp{right}
-	\ifx\tikz at res@label at pos\pgf at circ@temp
-		\pgf at circ@res at step=-1.2\pgf at circ@res at up
-	\else
-		\def\pgf at circ@temp{below}
-		\ifx\tikz at res@label at pos\pgf at circ@temp
-			\pgf at circ@res at step=-1.2\pgf at circ@res at up
-		\else
-			\pgf at circ@res at step=1.2\pgf at circ@res at up
-		\fi
-	\fi
-	%draw connections to circle
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}		
-	\pgfpathlineto{\pgfpoint{.9\pgf at circ@res at left}{\pgf at circ@res at zero}}
-	\pgfpathmoveto{\pgfpoint{.9\pgf at circ@res at right}{\pgf at circ@res at zero}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
-	\pgfusepath{draw}
-	%draw circle
-	\pgfscope
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-		\pgfpathcircle{\pgfpointorigin}{.9\pgf at circ@res at up}
-		\pgfusepath{draw}
-	\endpgfscope
-	%draw arrow
-	\pgfscope
-		\pgfsetarrowsend{latex}
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{-\pgf at circ@res at left}{\pgf at circ@res at up}}
-		\pgfusepath{draw}
-	\endpgfscope
-}
+    \long\def\drawmeteringcircle{
+        \def\pgf at circ@temp{right}
+        \ifx\tikz at res@label at pos\pgf at circ@temp
+            \pgf at circ@res at step=-1.2\pgf at circ@res at up
+        \else
+            \def\pgf at circ@temp{below}
+            \ifx\tikz at res@label at pos\pgf at circ@temp
+                \pgf at circ@res at step=-1.2\pgf at circ@res at up
+            \else
+                \pgf at circ@res at step=1.2\pgf at circ@res at up
+            \fi
+        \fi
+        %draw connections to circle
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+        \pgfpathlineto{\pgfpoint{.9\pgf at circ@res at left}{\pgf at circ@res at zero}}
+        \pgfpathmoveto{\pgfpoint{.9\pgf at circ@res at right}{\pgf at circ@res at zero}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
+        \pgfusepath{draw}
+        %draw circle
+        \pgfscope
+            \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+            \pgfpathcircle{\pgfpointorigin}{.9\pgf at circ@res at up}
+            \pgf at circ@draworfill
+        \endpgfscope
+        %draw arrow
+        \pgfscope
+            \pgfsetarrowsend{latex}
+            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+            \pgfpathlineto{\pgfpoint{-\pgf at circ@res at left}{\pgf at circ@res at up}}
+            \pgfusepath{draw}
+        \endpgfscope
+    }
 %AMPEREMETER
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/ammeter/height}}{ammeter}{\ctikzvalof{bipoles/ammeter/height}}{\ctikzvalof{bipoles/ammeter/width}}{
-	\drawmeteringcircle
-	\pgfnode{circle}{center}{\textbf{A}}{}{}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/ammeter/height}}
+{ammeter}
+{\ctikzvalof{bipoles/ammeter/height}}
+{\ctikzvalof{bipoles/ammeter/width}}
+{
+    \drawmeteringcircle
+    \pgfnode{circle}{center}{\textbf{A}}{}{}
 }
 %OHMMETER
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/ohmmeter/height}}{ohmmeter}{\ctikzvalof{bipoles/ohmmeter/height}}{\ctikzvalof{bipoles/ohmmeter/width}}{
-	\drawmeteringcircle
-	\pgfnode{circle}{center}{\boldmath$\Omega$}{}{}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/ohmmeter/height}}
+{ohmmeter}
+{\ctikzvalof{bipoles/ohmmeter/height}}
+{\ctikzvalof{bipoles/ohmmeter/width}}
+{
+    \drawmeteringcircle
+    \pgfnode{circle}{center}{\boldmath$\Omega$}{}{}
 }
 %VOLTMETER
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/voltmeter/height}}{voltmeter}{\ctikzvalof{bipoles/voltmeter/height}}{\ctikzvalof{bipoles/voltmeter/width}}{
-	\drawmeteringcircle
-	\pgfnode{circle}{center}{\textbf{V}}{}{}
-		
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/voltmeter/height}}
+{voltmeter}
+{\ctikzvalof{bipoles/voltmeter/height}}
+{\ctikzvalof{bipoles/voltmeter/width}}
+{
+    \drawmeteringcircle
+    \pgfnode{circle}{center}{\textbf{V}}{}{}
+
 }
 
+% oscilloscope, suggested by @nobrl https://github.com/circuitikz/circuitikz/issues/176
+\pgfcircdeclarebipole
+{
+    \anchor{in 1}{\southwest\pgf at y=0.75\pgf at y\pgf at x=0.4\pgf at x}
+    \anchor{in 2}{\southwest\pgf at y=0.75\pgf at y\pgf at x=-0.4\pgf at x}
+    % put the node text above and centered
+    \anchor{text}{\pgfextracty{\pgf at circ@res at up}{\northeast}
+        \pgfpoint{-.5\wd\pgfnodeparttextbox}{
+            \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf at circ@res at up\relax
+        }
+    }
+}
+{\ctikzvalof{bipoles/oscope/height}}
+{oscope}
+{\ctikzvalof{bipoles/oscope/height}}
+{\ctikzvalof{bipoles/oscope/width}}
+{
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfextracty{\pgf at circ@res at up}{\northeast}
+    \pgfextractx{\pgf at circ@res at right}{\northeast}
+    \pgfextractx{\pgf at circ@res at left}{\southwest}
+    \pgfextracty{\pgf at circ@res at down}{\southwest}
+    \pgfmathsetlength{\pgf at circ@res at step}{0.25*\pgf at circ@res at up}
+    \pgfscope
+        \pgfsetcornersarced{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at step}}
+        \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+        % this would create a round (analog?) scope...
+        % \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+        \pgf at circ@draworfill
+    \endpgfscope
+    % get the rotation
+    \pgfgettransformentries\a\b\temp\temp\temp\temp
+    \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
+    % and unrotate the scope
+    \pgfscope
+        \pgftransformrotate{\rot}
+        % grid
+        \pgfscope
+            \pgfsetlinewidth{0.5\pgfstartlinewidth}
+            \pgfpathmoveto{\pgfpoint{0.75\pgf at circ@res at left}{0.25\pgf at circ@res at down}}
+            \pgfpathgrid[stepx=\pgf at circ@res at step, stepy=\pgf at circ@res at step]%
+            {\pgfpoint{0.75\pgf at circ@res at left}{0.5\pgf at circ@res at down}}
+            {\pgfpoint{0.75\pgf at circ@res at right}{0.5\pgf at circ@res at up}}
+            \pgfsetstrokeopacity{0.5}
+            \pgfusepath{draw}
+        \endpgfscope
+        % function displayed, thanks to
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+        \pgfpathmoveto{\pgfpoint{0.75\pgf at circ@res at left}{0.25\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{0.05\pgf at circ@res at left}{0.25\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{0.05\pgf at circ@res at left}{0.25\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{0.65\pgf at circ@res at right}{0.25\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{0.65\pgf at circ@res at right}{0.25\pgf at circ@res at down}}
+        \pgfusepath{draw}
+    \endpgfscope
+}
 %% Short circuit
 
-\pgfcircdeclarebipole{}{0}{short}{0}{0}{ }
+%%% NOTICE that the short is really NOT drawn; we trust the fact that its
+%%% natural length is zero.
+\pgfcircdeclarebipole
+{}
+{0}
+{short}
+{0}
+{0}
+{ }
 
 %% Open circuit
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/open/height}}{open}{\ctikzvalof{bipoles/open/height}}{\ctikzvalof{bipoles/open/width}}{
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/open/height}}
+{open}
+{\ctikzvalof{bipoles/open/height}}
+{\ctikzvalof{bipoles/open/width}}
+{ }
 
-}
-
 %% Generic bipole - used as resistor by some (bleah)
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/generic/height}}{generic}{\ctikzvalof{bipoles/generic/height}}{\ctikzvalof{bipoles/generic/width}}{
-
-		%\pgf at circ@res at step = \ctikzvalof{bipoles/resistor/width}\pgf at circ@Rlen
-		%\divide \pgf at circ@res at step by 14
-
-		\pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-					
-		\pgfusepath{draw} 
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/generic/height}}
+{generic}
+{\ctikzvalof{bipoles/generic/height}}
+{\ctikzvalof{bipoles/generic/width}}
+{
+    \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgf at circ@draworfill
 }
 
 
 %% fuse
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/fuse/height}}{fuse}{\ctikzvalof{bipoles/fuse/height}}{\ctikzvalof{bipoles/fuse/width}}{
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/fuse/height}}
+{fuse}
+{\ctikzvalof{bipoles/fuse/height}}
+{\ctikzvalof{bipoles/fuse/width}}
+{
 
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0}}
-		\pgfusepath{draw}
-		
-		\pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-					
-		\pgfusepath{draw} 
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0}}
+    \pgfusepath{draw}
+
+    \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+    \pgf at circ@draworfill
 }
 
 
 
-%% Generic bipole, filled - used as inductor by some (bleah)
+%% Generic bipole, filled - used as inductor by some
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/fullgeneric/height}}{fullgeneric}{\ctikzvalof{bipoles/fullgeneric/height}}{\ctikzvalof{bipoles/fullgeneric/width}}{
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/fullgeneric/height}}
+{fullgeneric}
+{\ctikzvalof{bipoles/fullgeneric/height}}
+{\ctikzvalof{bipoles/fullgeneric/width}}
+{
+    \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
 
-		%\pgf at circ@res at step = \ctikzvalof{bipoles/resistor/width}\pgf at circ@Rlen
-		%\divide \pgf at circ@res at step by 14
+    \pgfusepath{draw,fill}
+}
 
-		\pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-					
-		\pgfusepath{draw,fill} 
+%% Generic sensor, filled - used as inductive sensor by some
+
+\pgfcircdeclarebipole
+{{% anchor for labelling the type of dependency
+    \anchor{label}{%
+        \southwest
+        \pgf at x=0.4\pgf at x
+        \pgf at y=2\pgf at y
+    }%
+}}
+{\ctikzvalof{bipoles/fullgeneric/height}}
+{sfullgeneric}
+{\ctikzvalof{bipoles/fullgeneric/height}}
+{\ctikzvalof{bipoles/fullgeneric/width}}
+{
+
+    \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfusepath{draw,fill}
+    %\pgfscope
+    \pgfpathmoveto{\pgfpoint{-\pgf at circ@res at left}{-2\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at left}{2\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{2\pgf at circ@res at down}}
+    \pgfusepath{draw}
+    %\endpgfscope
 }
 
 
-%% Generic asymmetric bipole 
+%% Generic asymmetric bipole
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/ageneric/height}}{ageneric}{\ctikzvalof{bipoles/ageneric/height}}{\ctikzvalof{bipoles/ageneric/width}}{
-		%\pgf at circ@res at step = \ctikzvalof{bipoles/resistor/width}\pgf at circ@Rlen
-		%\divide \pgf at circ@res at step by 14
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/ageneric/height}}
+{ageneric}
+{\ctikzvalof{bipoles/ageneric/height}}
+{\ctikzvalof{bipoles/ageneric/width}}
+{
+    \pgfscope
+        \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+        \pgf at circ@draworfill
+    \endpgfscope
 
-		\pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-					
-		\pgfusepath{draw} 
-
-			\pgfpathrectanglecorners{\pgfpoint{.7\pgf at circ@res at right}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-			\pgfusepath{stroke,fill}		
+    \pgfpathrectanglecorners{\pgfpoint{.7\pgf at circ@res at right}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \pgfusepath{stroke,fill}
 }
 
 
 %% asymmetric fuse
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/afuse/height}}{afuse}{\ctikzvalof{bipoles/afuse/height}}{\ctikzvalof{bipoles/afuse/width}}{
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/afuse/height}}
+{afuse}
+{\ctikzvalof{bipoles/afuse/height}}
+{\ctikzvalof{bipoles/afuse/width}}
+{
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0}}
+    \pgfusepath{draw}
 
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0}}
-		\pgfusepath{draw}
-		
-		\pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-					
-		\pgfusepath{draw}
-		
-		\pgfpathrectanglecorners{\pgfpoint{.7\pgf at circ@res at right}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-			\pgfusepath{stroke,fill}		 
+    \pgfscope
+        \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+        \pgf at circ@draworfill
+    \endpgfscope
+
+    \pgfpathrectanglecorners{\pgfpoint{.7\pgf at circ@res at right}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \pgfusepath{stroke,fill}
 }
 
 
@@ -1447,28 +2425,36 @@
 
 %% Memristor
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/memristor/height}}{memristor}{\ctikzvalof{bipoles/memristor/height}}{\ctikzvalof{bipoles/memristor/width}}{
-		\pgf at circ@res at step = \ctikzvalof{bipoles/resistor/width}\pgf at circ@Rlen
-		\divide \pgf at circ@res at step by 14
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/memristor/height}}
+{memristor}
+{\ctikzvalof{bipoles/memristor/height}}
+{\ctikzvalof{bipoles/memristor/width}}
+{
+    \pgf at circ@res at step = \ctikzvalof{bipoles/resistor/width}\pgf at circ@Rlen
+    \divide \pgf at circ@res at step by 14
 
-		\pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-		
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
-		\pgfpathlineto{\pgfpoint{.72*\pgf at circ@res at left}{0pt}}
-		\pgfpathlineto{\pgfpoint{.72*\pgf at circ@res at left}{\ctikzvalof{bipoles/memristor/wave height}\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{.35*\pgf at circ@res at left}{\ctikzvalof{bipoles/memristor/wave height}\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{.35*\pgf at circ@res at left}{-\ctikzvalof{bipoles/memristor/wave height}\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{-.05*\pgf at circ@res at left}{-\ctikzvalof{bipoles/memristor/wave height}\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{-.05*\pgf at circ@res at left}{\ctikzvalof{bipoles/memristor/wave height}\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{.42*\pgf at circ@res at right}{\ctikzvalof{bipoles/memristor/wave height}\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{.42*\pgf at circ@res at right}{0pt}}
-		\pgfpathlineto{\pgfpoint{.8*\pgf at circ@res at right}{0pt}}
-					
-		\pgfusepath{draw} 
+    \pgfscope
+        \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+        \pgf at circ@draworfill
+    \endpgfscope
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+    \pgfpathlineto{\pgfpoint{.72*\pgf at circ@res at left}{0pt}}
+    \pgfpathlineto{\pgfpoint{.72*\pgf at circ@res at left}{\ctikzvalof{bipoles/memristor/wave height}\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{.35*\pgf at circ@res at left}{\ctikzvalof{bipoles/memristor/wave height}\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{.35*\pgf at circ@res at left}{-\ctikzvalof{bipoles/memristor/wave height}\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{-.05*\pgf at circ@res at left}{-\ctikzvalof{bipoles/memristor/wave height}\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{-.05*\pgf at circ@res at left}{\ctikzvalof{bipoles/memristor/wave height}\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{.42*\pgf at circ@res at right}{\ctikzvalof{bipoles/memristor/wave height}\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{.42*\pgf at circ@res at right}{0pt}}
+    \pgfpathlineto{\pgfpoint{.8*\pgf at circ@res at right}{0pt}}
 
-			\pgfpathrectanglecorners{\pgfpoint{.7\pgf at circ@res at right}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-			\pgfusepath{stroke,fill}		
+    \pgfusepath{draw}
+
+    \pgfpathrectanglecorners{\pgfpoint{.7\pgf at circ@res at right}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \pgfusepath{stroke,fill}
 }
 
 
@@ -1476,35 +2462,48 @@
 
 %% Generic empty tunable
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/tgeneric/height}}{tgeneric}{\ctikzvalof{bipoles/tgeneric/height}}{\ctikzvalof{bipoles/tgeneric/width}}{
-		\pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{.4\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{.4\pgf at circ@res at down}}
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-		\pgfusepath{draw}
-		
-		\pgfscope
-		\pgfsetarrowsend{latex'}
-		\pgfpathmoveto{\pgfpoint{.5\pgf at circ@res at left}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{-.5\pgf at circ@res at left}{\pgf at circ@res at down}}
-		\pgfusepath{draw}
-		\endpgfscope
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/tgeneric/height}}
+{tgeneric}
+{\ctikzvalof{bipoles/tgeneric/height}}
+{\ctikzvalof{bipoles/tgeneric/width}}
+{
+    \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{.4\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{.4\pgf at circ@res at down}}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgf at circ@draworfill
+    \pgfscope
+        \pgfsetarrowsend{latexslim}
+        \pgfpathmoveto{\pgfpoint{.5\pgf at circ@res at left}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{-.5\pgf at circ@res at left}{\pgf at circ@res at down}}
+        \pgfusepath{draw}
+    \endpgfscope
 }
 
 %% Photoresistor
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/photoresistor/height 2}}{photoresistor}{\ctikzvalof{bipoles/photoresistor/height}}{\ctikzvalof{bipoles/photoresistor/width}}{
-		\pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}{\pgfpoint{\pgf at circ@res at right}{-\pgf at circ@res at down}}
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-		\pgfusepath{draw}
-		
-		\pgfscope
-		\pgfsetarrowsend{latex'}
-		\pgfpathmoveto{\pgfpoint{.7\pgf at circ@res at right}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{.3\pgf at circ@res at right}{-1.2\pgf at circ@res at down}}
-		\pgfusepath{draw}
-		\pgfpathmoveto{\pgfpoint{.45\pgf at circ@res at right}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{.05\pgf at circ@res at right}{-1.2\pgf at circ@res at down}}
-		\pgfusepath{draw}
-		\endpgfscope
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/photoresistor/height 2}}
+{photoresistor}
+{\ctikzvalof{bipoles/photoresistor/height}}
+{\ctikzvalof{bipoles/photoresistor/width}}
+{
+    \pgfscope
+        \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}{\pgfpoint{\pgf at circ@res at right}{-\pgf at circ@res at down}}
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+        \pgf at circ@draworfill
+    \endpgfscope
+
+    \pgfscope
+        \pgfsetarrowsend{latexslim}
+        \pgfpathmoveto{\pgfpoint{.7\pgf at circ@res at right}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{.3\pgf at circ@res at right}{-1.2\pgf at circ@res at down}}
+        \pgfusepath{draw}
+        \pgfpathmoveto{\pgfpoint{.45\pgf at circ@res at right}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{.05\pgf at circ@res at right}{-1.2\pgf at circ@res at down}}
+        \pgfusepath{draw}
+    \endpgfscope
 }
 
 
@@ -1511,93 +2510,136 @@
 
 
 %% Thermistor
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/thermistor/height}}{thermistor}{\ctikzvalof{bipoles/thermistor/height}}{\ctikzvalof{bipoles/thermistor/width}}{
-		\pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistor/main}\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistor/main}\pgf at circ@res at up}}
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-		\pgfusepath{draw}
-		
-		%\pgfscope
-		\pgfpathmoveto{\pgfpoint{-\pgf at circ@res at left}{-\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{.4\pgf at circ@res at left}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
-		\pgfusepath{draw}
-		%\endpgfscope
+\pgfcircdeclarebipole
+{{% anchor for labelling the type of dependency
+    \anchor{label}{%
+        \southwest
+        \pgf at x=0.4\pgf at x
+        \pgf at y=1.2\pgf at y
+    }%
+}}
+{\ctikzvalof{bipoles/thermistor/height}}
+{thermistor}
+{\ctikzvalof{bipoles/thermistor/height}}
+{\ctikzvalof{bipoles/thermistor/width}}
+{
+    \pgfscope
+    \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistor/main}\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistor/main}\pgf at circ@res at up}}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgf at circ@draworfill
+    \endpgfscope
+
+    %\pgfscope
+    \pgfpathmoveto{\pgfpoint{-\pgf at circ@res at left}{-\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at left}{1.2\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{1.2\pgf at circ@res at down}}
+    \pgfusepath{draw}
+    %\endpgfscope
 }
 
 
 %% Thermistor PTC
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/thermistorptc/height 2}}{thermistorptc}{\ctikzvalof{bipoles/thermistorptc/height}}{\ctikzvalof{bipoles/thermistorptc/width}}{
-		\pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorptc/main}\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorptc/main}\pgf at circ@res at up}}
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-		\pgfusepath{draw}
-		
-		\pgfpathmoveto{\pgfpoint{-\pgf at circ@res at left}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{.4\pgf at circ@res at left}{-\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{-\pgf at circ@res at up}}
-		\pgfusepath{draw}
-		
-		\pgfsetlinewidth{\pgfstartlinewidth}
-		\pgftext[top,x=.85\pgf at circ@res at left,y=.75\pgf at circ@res at down]{\tiny$\vartheta$}
-		\pgfsetarrowsend{latex'}
-		\pgfpathmoveto{\pgfpoint{.62\pgf at circ@res at left}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{.62\pgf at circ@res at left}{.7\pgf at circ@res at down}}
-		\pgfusepath{draw}
-		\pgfpathmoveto{\pgfpoint{.45\pgf at circ@res at left}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{.45\pgf at circ@res at left}{.7\pgf at circ@res at down}}
-		\pgfusepath{draw}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/thermistorptc/height 2}}
+{thermistorptc}
+{\ctikzvalof{bipoles/thermistorptc/height}}
+{\ctikzvalof{bipoles/thermistorptc/width}}
+{
+    \pgfscope
+        \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorptc/main}\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorptc/main}\pgf at circ@res at up}}
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+        \pgf at circ@draworfill
+    \endpgfscope
+    \pgfpathmoveto{\pgfpoint{-\pgf at circ@res at left}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at left}{-\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{-\pgf at circ@res at up}}
+    \pgfusepath{draw}
+
+    \pgfsetlinewidth{\pgfstartlinewidth}
+    \pgftext[top,x=.85\pgf at circ@res at left,y=.75\pgf at circ@res at down]{\tiny$\vartheta$}
+    \pgfsetarrowsend{latexslim}
+    \pgfpathmoveto{\pgfpoint{.62\pgf at circ@res at left}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{.62\pgf at circ@res at left}{.7\pgf at circ@res at down}}
+    \pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{.45\pgf at circ@res at left}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{.45\pgf at circ@res at left}{.7\pgf at circ@res at down}}
+    \pgfusepath{draw}
 }
 
 %% Thermistor NTC
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/thermistorntc/height 2}}{thermistorntc}{\ctikzvalof{bipoles/thermistorntc/height}}{\ctikzvalof{bipoles/thermistorntc/width}}{
-		\pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorntc/main}\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorntc/main}\pgf at circ@res at up}}
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-		\pgfusepath{draw}
-		
-		\pgfpathmoveto{\pgfpoint{-\pgf at circ@res at left}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{.4\pgf at circ@res at left}{-\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{-\pgf at circ@res at up}}
-		\pgfusepath{draw}
-		
-		\pgfsetlinewidth{\pgfstartlinewidth}
-		\pgftext[top,x=.85\pgf at circ@res at left,y=.75\pgf at circ@res at down]{\tiny$\vartheta$}
-		\pgfsetarrowsend{latex'}
-		\pgfpathmoveto{\pgfpoint{.62\pgf at circ@res at left}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{.62\pgf at circ@res at left}{.7\pgf at circ@res at down}}
-		\pgfusepath{draw}
-		\pgfpathmoveto{\pgfpoint{.45\pgf at circ@res at left}{.7\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{.45\pgf at circ@res at left}{\pgf at circ@res at down}}
-		\pgfusepath{draw}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/thermistorntc/height 2}}
+{thermistorntc}
+{\ctikzvalof{bipoles/thermistorntc/height}}
+{\ctikzvalof{bipoles/thermistorntc/width}}
+{
+    \pgfscope
+        \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorntc/main}\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorntc/main}\pgf at circ@res at up}}
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+        \pgf at circ@draworfill
+    \endpgfscope
+
+    \pgfpathmoveto{\pgfpoint{-\pgf at circ@res at left}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at left}{-\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{-\pgf at circ@res at up}}
+    \pgfusepath{draw}
+
+    \pgfsetlinewidth{\pgfstartlinewidth}
+    \pgftext[top,x=.85\pgf at circ@res at left,y=.75\pgf at circ@res at down]{\tiny$\vartheta$}
+    \pgfsetarrowsend{latexslim}
+    \pgfpathmoveto{\pgfpoint{.62\pgf at circ@res at left}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{.62\pgf at circ@res at left}{.7\pgf at circ@res at down}}
+    \pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{.45\pgf at circ@res at left}{.7\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{.45\pgf at circ@res at left}{\pgf at circ@res at down}}
+    \pgfusepath{draw}
 }
 
 %% thermocouple
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/thermocouple/height 2}}{thermocouple}{\ctikzvalof{bipoles/thermocouple/height}}{\ctikzvalof{bipoles/thermocouple/width}}{
-		
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{.5\pgf at circ@res at down}}
-		\pgfusepath{draw}
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{.5\pgf at circ@res at down}}
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-		\pgfpathlineto{\pgfpoint{0}{\pgf at circ@res at down}}
-		\pgfusepath{draw}
-		\pgfsetlinewidth{\pgfstartlinewidth}
-		\pgfpathmoveto{\pgfpoint{0}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{.5\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0}}
-		\pgfusepath{draw}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/thermocouple/height 2}}
+{thermocouple}
+{\ctikzvalof{bipoles/thermocouple/height}}
+{\ctikzvalof{bipoles/thermocouple/width}}
+{
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{.5\pgf at circ@res at down}}
+    \pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{.5\pgf at circ@res at down}}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfpathlineto{\pgfpoint{0}{\pgf at circ@res at down}}
+    \pgfusepath{draw}
+    \pgfsetlinewidth{\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{0}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{.5\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0}}
+    \pgfusepath{draw}
 }
 
 %% Varistor
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/varistor/height}}{varistor}{\ctikzvalof{bipoles/varistor/height}}{\ctikzvalof{bipoles/varistor/width}}{
-		\pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/varistor/main}\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/varistor/main}\pgf at circ@res at up}}
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-		\pgfusepath{draw}
-		
-		\pgfpathmoveto{\pgfpoint{-\pgf at circ@res at left}{-\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{.4\pgf at circ@res at left}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
-		\pgfusepath{draw}
-		
-		\pgftext[top,x=.65\pgf at circ@res at left,y=1.2\pgf at circ@res at down]{{\tiny\textsf{U}}}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/varistor/height}}
+{varistor}
+{\ctikzvalof{bipoles/varistor/height}}
+{\ctikzvalof{bipoles/varistor/width}}
+{
+    \pgfscope
+        \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/varistor/main}\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/varistor/main}\pgf at circ@res at up}}
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+        \pgf at circ@draworfill
+    \endpgfscope
+
+    \pgfpathmoveto{\pgfpoint{-\pgf at circ@res at left}{-\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at left}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+    \pgfusepath{draw}
+
+    \pgftext[top,x=.65\pgf at circ@res at left,y=1.2\pgf at circ@res at down]{{\tiny\textsf{U}}}
 }
 
 
@@ -1604,20 +2646,26 @@
 
 %% Generic full tunable
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/tfullgeneric/height}}{tfullgeneric}{\ctikzvalof{bipoles/tfullgeneric/height}}{\ctikzvalof{bipoles/tfullgeneric/width}}{
-		\pgf at circ@res at step = \ctikzvalof{bipoles/resistor/width}\pgf at circ@Rlen
-		\divide \pgf at circ@res at step by 14
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/tfullgeneric/height}}
+{tfullgeneric}
+{\ctikzvalof{bipoles/tfullgeneric/height}}
+{\ctikzvalof{bipoles/tfullgeneric/width}}
+{
+    \pgf at circ@res at step = \ctikzvalof{bipoles/resistor/width}\pgf at circ@Rlen
+    \divide \pgf at circ@res at step by 14
 
-		\pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{.4\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{.4\pgf at circ@res at down}}
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-		\pgfusepath{draw,fill}
-		
-		\pgfscope
-		\pgfsetarrowsend{latex'}
-		\pgfpathmoveto{\pgfpoint{.5\pgf at circ@res at left}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{-.5\pgf at circ@res at left}{\pgf at circ@res at down}}
-		\pgfusepath{draw}
-		\endpgfscope
+    \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{.4\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{.4\pgf at circ@res at down}}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfusepath{draw,fill}
+
+    \pgfscope
+        \pgfsetarrowsend{latexslim}
+        \pgfpathmoveto{\pgfpoint{.5\pgf at circ@res at left}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{-.5\pgf at circ@res at left}{\pgf at circ@res at down}}
+        \pgfusepath{draw}
+    \endpgfscope
 }
 
 
@@ -1628,54 +2676,67 @@
 
 %% Variable Capacitor
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vcapacitor/height}}{vcapacitor}{\ctikzvalof{bipoles/vcapacitor/height}}{\ctikzvalof{bipoles/vcapacitor/width}}{
-		%\pgf at circ@res at step = \ctikzvalof{bipoles/vcapacitor/width}\pgf at circ@Rlen
-		\pgf at circ@res at step = \ctikzvalof{bipoles/vcapacitor/capacitor width} \pgf at circ@res at right
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/vcapacitor/height}}
+{vcapacitor}
+{\ctikzvalof{bipoles/vcapacitor/height}}
+{\ctikzvalof{bipoles/vcapacitor/width}}
+{
+    %\pgf at circ@res at step = \ctikzvalof{bipoles/vcapacitor/width}\pgf at circ@Rlen
+    \pgf at circ@res at step = \ctikzvalof{bipoles/vcapacitor/capacitor width} \pgf at circ@res at right
 
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-		\pgfpathmoveto{\pgfpoint{-\pgf at circ@res at step}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{-\pgf at circ@res at step}{\pgf at circ@res at down}}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{-\pgf at circ@res at step}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{-\pgf at circ@res at step}{\pgf at circ@res at down}}
 
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at down}}
-		\pgfusepath{draw}
-		
-		\pgfscope
-		\pgfsetarrowsend{latex'}
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfusepath{draw}
-		\endpgfscope
-		
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
-		\pgfpathlineto{\pgfpoint{-\pgf at circ@res at step}{0pt}}
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{0pt}}
-		\pgfsetlinewidth{\pgfstartlinewidth}
-		\pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at down}}
+    \pgfusepath{draw}
+
+    \pgfscope
+        \pgfsetarrowsend{latexslim}
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+        \pgfusepath{draw}
+    \endpgfscope
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+    \pgfpathlineto{\pgfpoint{-\pgf at circ@res at step}{0pt}}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{0pt}}
+    \pgfsetlinewidth{\pgfstartlinewidth}
+    \pgfusepath{draw}
 }
 
 
 %% Piezoelectric Element
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/piezoelectric/height}}{piezoelectric}{\ctikzvalof{bipoles/piezoelectric/height}}{\ctikzvalof{bipoles/piezoelectric/width}}{
-		\pgf at circ@res at step = \ctikzvalof{bipoles/piezoelectric/width}\pgf at circ@Rlen
-		\divide \pgf at circ@res at step by 5
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/piezoelectric/height}}
+{piezoelectric}
+{\ctikzvalof{bipoles/piezoelectric/height}}
+{\ctikzvalof{bipoles/piezoelectric/width}}
+{
+    \pgf at circ@res at step = \ctikzvalof{bipoles/piezoelectric/width}\pgf at circ@Rlen
+    \divide \pgf at circ@res at step by 5
 
-		%% Outer markings
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+    %% Outer markings
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
 
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \pgfusepath{draw}
 
-		%% Inner Box
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-		\pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left+4}{\pgf at circ@res at up-1}}{\pgfpoint{\pgf at circ@res at right-4}{\pgf at circ@res at down+1}}
-		\pgfusepath{draw}
-
+    %% Inner Box
+    \pgfscope
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+        \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left+4}{\pgf at circ@res at up-1}}{\pgfpoint{\pgf at circ@res at right-4}{\pgf at circ@res at down+1}}
+        \pgf at circ@draworfill
+    \endpgfscope
 }
 
 
@@ -1721,41 +2782,41 @@
 
 \def\drawpoles{
 	\pgfextra{ \edef\pgf at circ@temp{\ctikzvalof{bipole/nodes/left}} \def\pgf at temp{diamond}  }
-	\ifx\pgf at temp\pgf at circ@temp 
-		 (\tikztostart) node[diamondpole] {} 
-	\else 
+	\ifx\pgf at temp\pgf at circ@temp
+		 (\tikztostart) node[diamondpole] {}
+	\else
 		\pgfextra{ \def\pgf at temp{empty}  }
-		\ifx\pgf at temp\pgf at circ@temp 
-			 (\tikztostart) node[ocirc] {} 
-		\else 
+		\ifx\pgf at temp\pgf at circ@temp
+			 (\tikztostart) node[ocirc] {}
+		\else
 			\pgfextra{  \def\pgf at temp{full}  }
-			\ifx\pgf at temp\pgf at circ@temp 
-				(\tikztostart) node[circ] {} 
-			\else 
+			\ifx\pgf at temp\pgf at circ@temp
+				(\tikztostart) node[circ] {}
+			\else
 				\pgfextra{ \def\pgf at temp{rectjoinfill} }
-				\ifx\pgf at temp\pgf at circ@temp 
-				 (\tikztostart) node[rectjoinfill] {} 
-				\else 
+				\ifx\pgf at temp\pgf at circ@temp
+				 (\tikztostart) node[rectjoinfill] {}
+				\else
 				\fi
 			\fi
 		\fi
 	\fi
 	\pgfextra{ \edef\pgf at circ@temp{\ctikzvalof{bipole/nodes/right}} \def\pgf at temp{diamond}  }
-	\ifx\pgf at temp\pgf at circ@temp 
-		 (\tikztotarget) node[diamondpole] {} 
-	\else 
+	\ifx\pgf at temp\pgf at circ@temp
+		 (\tikztotarget) node[diamondpole] {}
+	\else
 		\pgfextra{ \def\pgf at temp{empty}  }
-		\ifx\pgf at temp\pgf at circ@temp 
-			 (\tikztotarget) node[ocirc] {} 
-		\else 
+		\ifx\pgf at temp\pgf at circ@temp
+			 (\tikztotarget) node[ocirc] {}
+		\else
 			\pgfextra{  \def\pgf at temp{full}  }
-			\ifx\pgf at temp\pgf at circ@temp 
-				(\tikztotarget) node[circ] {} 
-			\else 
+			\ifx\pgf at temp\pgf at circ@temp
+				(\tikztotarget) node[circ] {}
+			\else
 				\pgfextra{ \def\pgf at temp{rectjoinfill} }
-				\ifx\pgf at temp\pgf at circ@temp 
-				 (\tikztotarget) node[rectjoinfill] {} 
-				\else 
+				\ifx\pgf at temp\pgf at circ@temp
+				 (\tikztotarget) node[rectjoinfill] {}
+				\else
 				\fi
 			\fi
 		\fi
@@ -1766,56 +2827,108 @@
 
 %% Lamp
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/lamp/height}}{lamp}{\ctikzvalof{bipoles/lamp/height}}{\ctikzvalof{bipoles/lamp/width}}{
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/lamp/height}}
+{lamp}
+{\ctikzvalof{bipoles/lamp/height}}
+{\ctikzvalof{bipoles/lamp/width}}
+{
 
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
 
-	\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
-	\pgfpathmoveto{\pgfpoint{.7071*\pgf at circ@res at left}{.7071*\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint{.7071*\pgf at circ@res at right}{.7071*\pgf at circ@res at down}}
-	\pgfpathmoveto{\pgfpoint{.7071*\pgf at circ@res at left}{.7071*\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint{.7071*\pgf at circ@res at right}{.7071*\pgf at circ@res at up}}
-	\pgfusepath{draw}
+    \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+    \pgf at circ@draworfill
+    \pgfpathmoveto{\pgfpoint{.7071*\pgf at circ@res at left}{.7071*\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{.7071*\pgf at circ@res at right}{.7071*\pgf at circ@res at down}}
+    \pgfpathmoveto{\pgfpoint{.7071*\pgf at circ@res at left}{.7071*\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{.7071*\pgf at circ@res at right}{.7071*\pgf at circ@res at up}}
+    \pgfusepath{draw}
 }
 
-
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/tline/height}
-                        }{tline}{\ctikzvalof{bipoles/tline/height}
-                                 }{\ctikzvalof{bipoles/tline/width}
-                                   }    
-          {
-          \pgf at circ@res at step=.2\pgf at circ@res at right % half x axis
-          \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-          \pgfpathellipse{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at step}{0}}
-                         {\pgfpoint{\pgf at circ@res at step}{0}}
-                         {\pgfpoint{0}{-\pgf at circ@res at up}}
-          \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at step}{\pgf at circ@res at up}}
-          \pgfpathlineto{\pgfpoint{\pgf at circ@res at left+\pgf at circ@res at step}{\pgf at circ@res at up}}
-          \pgfpatharc{-90}{90}{-\pgf at circ@res at step and -\pgf at circ@res at up}
-          \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at step}{\pgf at circ@res at down}}
-          \pgfusepath{draw}
+%% bulb
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/bulb/height}}
+{bulb}
+{\ctikzvalof{bipoles/bulb/height}}
+{\ctikzvalof{bipoles/bulb/width}}
+{%
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{0.8\pgf at circ@res at up}}{\pgfpoint{0.8\pgf at circ@res at left}{0}}
+    \pgf at circ@draworfill
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgfpathlineto{\pgfpoint{0.4\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgfpatharc{0}{-180}{0.4*\pgf at circ@res at left}
+    \pgfsetbeveljoin
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
+    \pgfusepath{draw}
 }
 
 
+% transmission line
 
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/tline/height}}
+{tline}
+{\ctikzvalof{bipoles/tline/height}}
+{\ctikzvalof{bipoles/tline/width}}
+{
+    \pgf at circ@res at step=.2\pgf at circ@res at right % half x axis
+    \begin{pgftransparencygroup}
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at step}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at left+\pgf at circ@res at step}{\pgf at circ@res at up}}
+        \pgfpatharc{-90}{90}{-\pgf at circ@res at step and -\pgf at circ@res at up}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at step}{\pgf at circ@res at down}}
+        \pgf at circ@draworfill
+        \pgfpathellipse{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at step}{0pt}}
+        {\pgfpoint{\pgf at circ@res at step}{0pt}}{\pgfpoint{0pt}{-\pgf at circ@res at up}}
+        \pgf at circ@draworfill
+    \end{pgftransparencygroup}
+    \pgfsetlinewidth{\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right-\pgf at circ@res at step}{0pt}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+    \pgfusepath{stroke}
+}
 
+% microstrip transmission line
+
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/mstline/height}}
+{mstline}
+{\ctikzvalof{bipoles/mstline/height}}
+{\ctikzvalof{bipoles/mstline/width}}
+{
+    \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgfstartlinewidth}
+    \pgf at circ@draworfill
+}
 %% SQUID added by Cor Molenaar 5 March 2010
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/squid/height}}{squid}{\ctikzvalof{bipoles/squid/height}}{\ctikzvalof{bipoles/squid/width}}{
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/squid/height}}
+{squid}
+{\ctikzvalof{bipoles/squid/height}}
+{\ctikzvalof{bipoles/squid/width}}
+{
 
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
 
-	\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
-	\pgfpathmoveto{\pgfpoint{0.35*\pgf at circ@res at left}{1.35*\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint{0.35*\pgf at circ@res at right}{0.65*\pgf at circ@res at up}}
-	\pgfpathmoveto{\pgfpoint{0.35*\pgf at circ@res at left}{0.65*\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint{0.35*\pgf at circ@res at right}{1.35*\pgf at circ@res at up}}
-	\pgfpathmoveto{\pgfpoint{0.35*\pgf at circ@res at left}{1.35*\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint{0.35*\pgf at circ@res at right}{0.65*\pgf at circ@res at down}}
-	\pgfpathmoveto{\pgfpoint{0.35*\pgf at circ@res at left}{0.65*\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint{0.35*\pgf at circ@res at right}{1.35*\pgf at circ@res at down}}
+    \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+    \pgfpathmoveto{\pgfpoint{0.35*\pgf at circ@res at left}{1.35*\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{0.35*\pgf at circ@res at right}{0.65*\pgf at circ@res at up}}
+    \pgfpathmoveto{\pgfpoint{0.35*\pgf at circ@res at left}{0.65*\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{0.35*\pgf at circ@res at right}{1.35*\pgf at circ@res at up}}
+    \pgfpathmoveto{\pgfpoint{0.35*\pgf at circ@res at left}{1.35*\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{0.35*\pgf at circ@res at right}{0.65*\pgf at circ@res at down}}
+    \pgfpathmoveto{\pgfpoint{0.35*\pgf at circ@res at left}{0.65*\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{0.35*\pgf at circ@res at right}{1.35*\pgf at circ@res at down}}
 
-	\pgfusepath{draw}
+    \pgfusepath{draw}
 }
 
 
@@ -1822,1238 +2935,1348 @@
 
 % Generic barrier added by Cor Molenaar 5 March 2010
 
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/barrier/height}}{barrier}{\ctikzvalof{bipoles/barrier/height}}{\ctikzvalof{bipoles/barrier/width}}{
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/barrier/height}}
+{barrier}
+{\ctikzvalof{bipoles/barrier/height}}
+{\ctikzvalof{bipoles/barrier/width}}
+{
 
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
 
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at step}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at step}}
-	\pgfpathmoveto{\pgfpoint{0.35*\pgf at circ@res at left}{0.35*\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint{0.35*\pgf at circ@res at right}{0.35*\pgf at circ@res at down}}
-	\pgfpathmoveto{\pgfpoint{0.35*\pgf at circ@res at left}{0.35*\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint{0.35*\pgf at circ@res at right}{0.35*\pgf at circ@res at up}}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at step}}
+    \pgfpathmoveto{\pgfpoint{0.35*\pgf at circ@res at left}{0.35*\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{0.35*\pgf at circ@res at right}{0.35*\pgf at circ@res at down}}
+    \pgfpathmoveto{\pgfpoint{0.35*\pgf at circ@res at left}{0.35*\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{0.35*\pgf at circ@res at right}{0.35*\pgf at circ@res at up}}
 
-	\pgfusepath{draw}
+    \pgfusepath{draw}
 }
 
 
 % Contributed by Danilo Piazzalunga
- 
+
 \pgfdeclareshape{buffer}
-	{
-	  \anchor{center}{\pgfpointorigin}
-	  \savedanchor\northwest{%
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/buffer/height}\pgf at circ@Rlen
-		\pgf at y=.5\pgf at y
-		\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/buffer/width}\pgf at circ@Rlen
-		\pgf at x=.5\pgf at x
-	  }
-	  \anchor{south}{
-		\northwest
-		\pgf at y=-\pgf at y
-	  }
-	  \savedanchor\left{%
-	  	\pgf at y=0pt
-	  }
-	  \anchor{in}{
-		\northwest
-		\pgf at y=0pt
-	  }
-	  \anchor{out}{
-		\northwest
-		\pgf at y=0pt
-		\pgf at x=-\pgf at x
-	  }
-	  
-	  \backgroundpath{			
-			\pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}	
-			
-			
-			\northwest
-			\pgf at circ@res at up = \pgf at y 
-			\pgf at circ@res at down = -\pgf at y
-			\pgf at circ@res at right = -\pgf at x
-			\pgf at circ@res at left = \pgf at x
-			
-	\pgfscope
-		\pgfsetlinewidth{2\pgflinewidth}
-		\pgftransformxshift{.7\pgf at circ@res at left}
-		\pgf at circ@res at step=\pgf at circ@res at right
-		\advance\pgf at circ@res at step by -\pgf at circ@res at left
-		\pgf at circ@res at step=.7\pgf at circ@res at step
-		
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{0pt}}
-		\pgfusepath{draw}
-	\endpgfscope
-		
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
-		\pgfpathlineto{\pgfpoint{.7\pgf at circ@res at left}{0pt}}
-		
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
-		\pgfpathlineto{\pgfpoint{.7\pgf at circ@res at right}{0pt}}
-	
-		\pgfusepath{draw}
-	  
-	  }
-	}
+{
+    \anchor{center}{\pgfpointorigin}
+    \savedanchor\northwest{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/buffer/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/buffer/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+    }
+    \anchor{east}{ \northwest \pgf at y=0pt \pgf at x=-\pgf at x  }
+    \anchor{west}{ \northwest \pgf at y=0pt }
+    \anchor{south}{ \northwest \pgf at x=0pt \pgf at y=-\pgf at y }
+    \anchor{north}{ \northwest \pgf at x=0pt }
+    \anchor{south west}{ \northwest \pgf at y=-\pgf at y }
+    \anchor{north east}{ \northwest \pgf at x=-\pgf at x }
+    \anchor{north west}{ \northwest }
+    \anchor{south east}{ \northwest \pgf at x=-\pgf at x \pgf at y=-\pgf at y }
+    \savedanchor\left{%
+        \pgf at y=0pt
+    }
+    \anchor{in}{
+        \northwest
+        \pgf at y=0pt
+    }
+    \anchor{out}{
+        \northwest
+        \pgf at y=0pt
+        \pgf at x=-\pgf at x
+    }
 
+    \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
 
+    \backgroundpath{
+        \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
 
 
+        \northwest
+        \pgf at circ@res at up = \pgf at y
+        \pgf at circ@res at down = -\pgf at y
+        \pgf at circ@res at right = -\pgf at x
+        \pgf at circ@res at left = \pgf at x
+        \pgfscope
+            \pgfsetlinewidth{2\pgflinewidth}
+            \pgftransformxshift{.7\pgf at circ@res at left}
+            \pgf at circ@res at step=\pgf at circ@res at right
+            \advance\pgf at circ@res at step by -\pgf at circ@res at left
+            \pgf at circ@res at step=.7\pgf at circ@res at step
 
+            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
+            \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
+            \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
+            \pgfpathclose
+            \pgf at circ@draworfill
+        \endpgfscope
+
+
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+        \pgfpathlineto{\pgfpoint{.7\pgf at circ@res at left}{0pt}}
+
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+        \pgfpathlineto{\pgfpoint{.7\pgf at circ@res at right}{0pt}}
+
+        \pgfusepath{draw}
+
+    }
+}
+
+
+
+
+
 \pgfdeclareshape{plain amp}
-	{
-	  \anchor{center}{\pgfpointorigin}
-	  \savedanchor\northwest{%
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/height}\pgf at circ@Rlen
-		\pgf at y=.5\pgf at y
-		\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/width}\pgf at circ@Rlen
-		\pgf at x=.5\pgf at x
-	  }
-	  \anchor{south}{
-		\northwest
-		\pgf at y=-\pgf at y
-	  }
-	  \savedanchor\left{%
-	  	\pgf at y=0pt
-	  }
-	  \savedanchor\inOne{%
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/height}\pgf at circ@Rlen
-		\pgf at y=.5\pgf at y
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf at y
-		\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/width}\pgf at circ@Rlen
-		\pgf at x=.5\pgf at x
-	  }	  
-	  \anchor{-}{
-		\inOne
-	  }
-	  \anchor{+}{
-		\inOne
-		\pgf at y=-\pgf at y
-	  }
-	  \savedanchor\up{%
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/height}\pgf at circ@Rlen
-		\pgf at y=.5\pgf at y
-		\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/width}\pgf at circ@Rlen
-		\pgf at x=.5\pgf at x
-			\pgf at circ@res at up = \pgf at y 
-			\pgf at circ@res at right = -\pgf at x
-			\pgf at circ@res at left = \pgf at x
-	    \pgfpointlineattime{
-			\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/up pos}}{
-			\pgfpoint{
-				\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/port width}\pgf at circ@res at left}
-				{\pgf at circ@res at up}}
-			{\pgfpoint{.7\pgf at circ@res at right}{0pt}}
-	  }
-	  \anchor{up}{
-		\up
-	  }
-	  \anchor{down}{
-		\up
-		\pgf at y=-\pgf at y
-	  }
-	  \anchor{out}{
-		\northwest
-		\pgf at y=0pt
-		\pgf at x=-\pgf at x
-	  }
-	  
-	  \backgroundpath{			
-			\pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}	
-			
-			
-			\northwest
-			\pgf at circ@res at up = \pgf at y 
-			\pgf at circ@res at down = -\pgf at y
-			\pgf at circ@res at right = -\pgf at x
-			\pgf at circ@res at left = \pgf at x
-			
-	\pgfpathmoveto{\pgfpoint
-		{\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/port width}\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf at circ@res at up}}
-	
+{
+    \anchor{center}{\pgfpointorigin}
+    \savedanchor\northwest{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+    }
+    \anchor{east}{ \northwest \pgf at y=0pt \pgf at x=-\pgf at x  }
+    \anchor{west}{ \northwest \pgf at y=0pt }
+    \anchor{south}{ \northwest \pgf at x=0pt \pgf at y=-\pgf at y }
+    \anchor{north}{ \northwest \pgf at x=0pt }
+    \anchor{south west}{ \northwest \pgf at y=-\pgf at y }
+    \anchor{north east}{ \northwest \pgf at x=-\pgf at x }
+    \anchor{north west}{ \northwest }
+    \anchor{south east}{ \northwest \pgf at x=-\pgf at x \pgf at y=-\pgf at y }
+    \savedanchor\left{%
+        \pgf at y=0pt
+    }
+    \savedanchor\inOne{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+    }
+    \anchor{-}{
+        \inOne
+    }
+    \anchor{+}{
+        \inOne
+        \pgf at y=-\pgf at y
+    }
+    \savedanchor\up{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+        \pgf at circ@res at up = \pgf at y
+        \pgf at circ@res at right = -\pgf at x
+        \pgf at circ@res at left = \pgf at x
+        \pgfpointlineattime{
+            \pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/up pos}}{
+            \pgfpoint{
+            \pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/port width}\pgf at circ@res at left}
+        {\pgf at circ@res at up}}
+        {\pgfpoint{.7\pgf at circ@res at right}{0pt}}
+    }
+    \anchor{up}{
+        \up
+    }
+    \anchor{down}{
+        \up
+        \pgf at y=-\pgf at y
+    }
+    \anchor{out}{
+        \northwest
+        \pgf at y=0pt
+        \pgf at x=-\pgf at x
+    }
 
-	\pgfpathmoveto{\pgfpoint
-		{\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/port width}\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf at circ@res at down}}
-		
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
-	\pgfpathlineto{\pgfpoint{.7\pgf at circ@res at right}{0pt}}
-	
-	\pgfusepath{draw}
+    \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
 
-						
-	\pgfscope
-		\pgfsetlinewidth{2\pgflinewidth}
-		\pgftransformxshift{.7\pgf at circ@res at left}
-		\pgf at circ@res at step=\pgf at circ@res at right
-		\advance\pgf at circ@res at step by -\pgf at circ@res at left
-		\pgf at circ@res at step=.7\pgf at circ@res at step
-		
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{0pt}}
-		\pgfusepath{draw}
-	\endpgfscope
-		
-		
-	  
-	  }
-	}
-	
+    \backgroundpath{
+        \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+        \northwest
+        \pgf at circ@res at up = \pgf at y
+        \pgf at circ@res at down = -\pgf at y
+        \pgf at circ@res at right = -\pgf at x
+        \pgf at circ@res at left = \pgf at x
+
+        \pgfscope
+            \pgfsetlinewidth{2\pgflinewidth}
+            \pgftransformxshift{.7\pgf at circ@res at left}
+            \pgf at circ@res at step=\pgf at circ@res at right
+            \advance\pgf at circ@res at step by -\pgf at circ@res at left
+            \pgf at circ@res at step=.7\pgf at circ@res at step
+
+            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
+            \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
+            \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
+            \pgfpathclose
+            \pgf at circ@draworfill
+        \endpgfscope
+        \pgfpathmoveto{\pgfpoint
+            {\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/port width}\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf at circ@res at up}}
+
+
+        \pgfpathmoveto{\pgfpoint
+            {\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/port width}\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf at circ@res at down}}
+
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+        \pgfpathlineto{\pgfpoint{.7\pgf at circ@res at right}{0pt}}
+
+        \pgfusepath{draw}
+
+
+
+
+
+    }
+}
+
+
+%% Draw the two-port fillable box
+\def\pgf at circ@twoportbox{
+    \pgfscope
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+        \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+        \pgf at circ@draworfill
+    \endpgfscope
+}
+
 %% Generic two port box
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/twoport/height}}{twoport}{\ctikzvalof{bipoles/twoport/height}}{\ctikzvalof{bipoles/twoport/width}}{
-		\pgf at circ@res at step = \ctikzvalof{bipoles/twoport/width}\pgf at circ@Rlen
-		\divide \pgf at circ@res at step by 2
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/twoport/height}}
+{twoport}
+{\ctikzvalof{bipoles/twoport/height}}
+{\ctikzvalof{bipoles/twoport/width}}
+{
+    \pgf at circ@res at step = \ctikzvalof{bipoles/twoport/width}\pgf at circ@Rlen
+    \divide \pgf at circ@res at step by 2
 
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
-		\pgf at circ@res at other = \pgf at circ@res at left
-		\advance\pgf at circ@res at other by \pgf at circ@res at step 
-		\ifpgf at circuit@dashed
-			\pgfsetdash{{0.1cm}{0.1cm}}{0cm} 
-		\fi	
-		% draw outer box
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-		\pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfusepath{draw}
-		
-		\ifpgf at circuit@inputarrow
-			{
-				\advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
-				\pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
-				\pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
-			}
-		\fi
-		
-		% rotate inner symbol
-		\def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at 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}}
-		
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgf at circ@res at other = \pgf at circ@res at left
+    \advance\pgf at circ@res at other by \pgf at circ@res at step
+    \ifpgf at circuit@dashed
+        \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+    \fi
+    % draw outer box
+    \pgf at circ@twoportbox
+    \ifpgf at circuit@inputarrow
+        {
+            \advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+            \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+            \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+        }
+    \fi
+
+    % rotate inner symbol
+    \def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at 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 at circ@res at step = \ctikzvalof{bipoles/vco/width}\pgf at circ@Rlen
-		\divide \pgf at circ@res at step by 2
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/vco/width}}
+{vco}
+{\ctikzvalof{bipoles/twoport/width}}
+{\ctikzvalof{bipoles/vco/width}}
+{
+    \pgf at circ@res at step = \ctikzvalof{bipoles/vco/width}\pgf at circ@Rlen
+    \divide \pgf at circ@res at step by 2
 
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
-		\pgf at circ@res at other = \pgf at circ@res at left
-		\advance\pgf at circ@res at other by \pgf at circ@res at step 
-		
-		\ifpgf at circuit@dashed
-			\pgfsetdash{{0.1cm}{0.1cm}}{0cm} 
-		\fi	
-		% draw circle
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-		\pgfpathcircle{\pgfpoint{0}{0}} {\pgf at circ@res at step}
-		\pgfusepath{draw}
-		
-		\ifpgf at circuit@inputarrow
-			{
-				\advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
-				\pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
-				\pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
-			}
-		\fi
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgf at circ@res at other = \pgf at circ@res at left
+    \advance\pgf at circ@res at other by \pgf at circ@res at step
 
-		% rotate inner symbol
-		\def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at 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 at circ@res at step}{0\pgf at circ@res at step}}
-		\pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
-		\pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
-		\pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
-		\pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
-		\pgfusepath{draw}
-		
+    \ifpgf at circuit@dashed
+        \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+    \fi
+    % draw circle
+    \pgfscope
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+        \pgfpathcircle{\pgfpoint{0}{0}} {\pgf at circ@res at step}
+        \pgf at circ@draworfill
+    \endpgfscope
+    \ifpgf at circuit@inputarrow
+        {
+            \advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+            \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+            \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+        }
+    \fi
+
+    % rotate inner symbol
+    \def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at 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 at circ@res at step}{0\pgf at circ@res at step}}
+    \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+    \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
+    \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
+    \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+    \pgfusepath{draw}
+
 }
 
 %% bandpass filter
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/bandpass/width}}{bandpass}{\ctikzvalof{bipoles/bandpass/width}}{\ctikzvalof{bipoles/bandpass/width}}{
-		
-		\pgf at circ@res at step = \ctikzvalof{bipoles/bandpass/width}\pgf at circ@Rlen
-		\divide \pgf at circ@res at step by 2
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/bandpass/width}}
+{bandpass}
+{\ctikzvalof{bipoles/bandpass/width}}
+{\ctikzvalof{bipoles/bandpass/width}}
+{
 
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
-		\pgf at circ@res at other = \pgf at circ@res at left
-		\advance\pgf at circ@res at other by \pgf at circ@res at step
-		
-		\ifpgf at circuit@dashed
-			\pgfsetdash{{0.1cm}{0.1cm}}{0cm} 
-		\fi	
-		
-		% draw outer box
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-		\pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfusepath{draw}
-		
-		\ifpgf at circuit@inputarrow
-			{
-				\advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
-				\pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
-				\pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
-			}
-		\fi
-		
-		% rotate inner symbol
-		\def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at 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
-		\pgfsetarrows{-} %never draw arrows
-		\pgfsetlinewidth{\pgfstartlinewidth}
-		\pgfpathmoveto{\pgfpoint{-0.5\pgf at circ@res at step}{0.5\pgf at circ@res at step}}
-		\pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
-		\pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
-		\pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
-		\pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
-		\pgfusepath{draw}
-		\pgfpathmoveto{\pgfpoint{-0.15\pgf at circ@res at step}{0.35\pgf at circ@res at step}}
-		\pgfpathlineto{\pgfpoint{0.15\pgf at circ@res at step}{0.65\pgf at circ@res at step}}
-		\pgfusepath{draw}
+    \pgf at circ@res at step = \ctikzvalof{bipoles/bandpass/width}\pgf at circ@Rlen
+    \divide \pgf at circ@res at step by 2
 
-		\pgfpathmoveto{\pgfpoint{-0.5\pgf at circ@res at step}{0}}
-		\pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
-		\pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
-		\pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
-		\pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
-		\pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgf at circ@res at other = \pgf at circ@res at left
+    \advance\pgf at circ@res at other by \pgf at circ@res at step
 
-		\pgfpathmoveto{\pgfpoint{-0.5\pgf at circ@res at step}{-0.5\pgf at circ@res at step}}
-		\pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
-		\pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
-		\pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
-		\pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
-		\pgfusepath{draw}
-		\pgfpathmoveto{\pgfpoint{-0.15\pgf at circ@res at step}{-0.65\pgf at circ@res at step}}
-		\pgfpathlineto{\pgfpoint{0.15\pgf at circ@res at step}{-0.35\pgf at circ@res at step}}
-		\pgfusepath{draw}
+    \ifpgf at circuit@dashed
+        \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+    \fi
+
+    % draw outer box
+    \pgf at circ@twoportbox
+
+    \ifpgf at circuit@inputarrow
+        {
+            \advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+            \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+            \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+        }
+    \fi
+
+    % rotate inner symbol
+    \def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at 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
+    \pgfsetarrows{-} %never draw arrows
+    \pgfsetlinewidth{\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{-0.5\pgf at circ@res at step}{0.5\pgf at circ@res at step}}
+    \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+    \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
+    \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
+    \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+    \pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{-0.15\pgf at circ@res at step}{0.35\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{0.15\pgf at circ@res at step}{0.65\pgf at circ@res at step}}
+    \pgfusepath{draw}
+
+    \pgfpathmoveto{\pgfpoint{-0.5\pgf at circ@res at step}{0}}
+    \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+    \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
+    \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
+    \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+    \pgfusepath{draw}
+
+    \pgfpathmoveto{\pgfpoint{-0.5\pgf at circ@res at step}{-0.5\pgf at circ@res at step}}
+    \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+    \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
+    \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
+    \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+    \pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{-0.15\pgf at circ@res at step}{-0.65\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{0.15\pgf at circ@res at step}{-0.35\pgf at circ@res at step}}
+    \pgfusepath{draw}
 }
 
 %% bandstop filter
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/bandstop/width}}{bandstop}{\ctikzvalof{bipoles/bandstop/width}}{\ctikzvalof{bipoles/bandstop/width}}{
-	\pgf at circ@res at step = \ctikzvalof{bipoles/bandstop/width}\pgf at circ@Rlen
-	\divide \pgf at circ@res at step by 2
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/bandstop/width}}
+{bandstop}
+{\ctikzvalof{bipoles/bandstop/width}}
+{\ctikzvalof{bipoles/bandstop/width}}
+{
+    \pgf at circ@res at step = \ctikzvalof{bipoles/bandstop/width}\pgf at circ@Rlen
+    \divide \pgf at circ@res at step by 2
 
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
-	\pgf at circ@res at other = \pgf at circ@res at left
-	\advance\pgf at circ@res at other by \pgf at circ@res at step
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgf at circ@res at other = \pgf at circ@res at left
+    \advance\pgf at circ@res at other by \pgf at circ@res at step
 
-	\ifpgf at circuit@dashed
-	\pgfsetdash{{0.1cm}{0.1cm}}{0cm}
-	\fi
+    \ifpgf at circuit@dashed
+        \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+    \fi
 
-	% draw outer box
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-	\pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-	\pgfusepath{draw}
+    % draw outer box
+    \pgf at circ@twoportbox
 
-	\ifpgf at circuit@inputarrow
-	{
-		\advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
-		\pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
-		\pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
-	}
-	\fi
+    \ifpgf at circuit@inputarrow
+        {
+            \advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+            \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+            \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+        }
+    \fi
 
-	% rotate inner symbol
-	\def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at 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
+    % rotate inner symbol
+    \def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at 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
-	\pgfsetarrows{-}%never draw arrows
-	\pgfsetlinewidth{\pgfstartlinewidth}
-	\pgfpathmoveto{\pgfpoint{-0.5\pgf at circ@res at step}{0.5\pgf at circ@res at step}}
-	\pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
-	\pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
-	\pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
-	\pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
-	\pgfusepath{draw}
+    % draw inner symbol
+    \pgfsetdash{}{0pt}% always draw solid line for inner symbol
+    \pgfsetarrows{-}%never draw arrows
+    \pgfsetlinewidth{\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{-0.5\pgf at circ@res at step}{0.5\pgf at circ@res at step}}
+    \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+    \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
+    \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
+    \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+    \pgfusepath{draw}
 
-	\pgfpathmoveto{\pgfpoint{-0.5\pgf at circ@res at step}{0}}
-	\pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
-	\pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
-	\pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
-	\pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
-	\pgfusepath{draw}
-	\pgfpathmoveto{\pgfpoint{-0.15\pgf at circ@res at step}{-0.15\pgf at circ@res at step}}
-	\pgfpathlineto{\pgfpoint{0.15\pgf at circ@res at step}{0.15\pgf at circ@res at step}}
-	\pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{-0.5\pgf at circ@res at step}{0}}
+    \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+    \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
+    \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
+    \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+    \pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{-0.15\pgf at circ@res at step}{-0.15\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{0.15\pgf at circ@res at step}{0.15\pgf at circ@res at step}}
+    \pgfusepath{draw}
 
-	\pgfpathmoveto{\pgfpoint{-0.5\pgf at circ@res at step}{-0.5\pgf at circ@res at step}}
-	\pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
-	\pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
-	\pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
-	\pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
-	\pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{-0.5\pgf at circ@res at step}{-0.5\pgf at circ@res at step}}
+    \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+    \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
+    \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
+    \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+    \pgfusepath{draw}
 }
 
 %% highpass filter
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/highpass/width}}{highpass}{\ctikzvalof{bipoles/highpass/width}}{\ctikzvalof{bipoles/highpass/width}}{
-		\pgf at circ@res at step = \ctikzvalof{bipoles/highpass/width}\pgf at circ@Rlen
-		\divide \pgf at circ@res at step by 2
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/highpass/width}}
+{highpass}
+{\ctikzvalof{bipoles/highpass/width}}
+{\ctikzvalof{bipoles/highpass/width}}
+{
+    \pgf at circ@res at step = \ctikzvalof{bipoles/highpass/width}\pgf at circ@Rlen
+    \divide \pgf at circ@res at step by 2
 
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
-		\pgf at circ@res at other = \pgf at circ@res at left
-		\advance\pgf at circ@res at other by \pgf at circ@res at step 
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgf at circ@res at other = \pgf at circ@res at left
+    \advance\pgf at circ@res at other by \pgf at circ@res at step
 
-		\ifpgf at circuit@dashed
-			\pgfsetdash{{0.1cm}{0.1cm}}{0cm} 
-		\fi	
-		
-		% draw outer box
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-		\pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfusepath{draw}
-		
-		\ifpgf at circuit@inputarrow
-			{
-				\advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
-				\pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
-				\pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
-			}
-		\fi
-		
-		% rotate inner symbol
-		\def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at 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
+    \ifpgf at circuit@dashed
+        \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+    \fi
 
-		% draw inner symbol
-		\pgfsetdash{}{0pt}	% always draw solid line for inner symbol
-		\pgfsetarrows{-} %never draw arrows
-		\pgfsetlinewidth{\pgfstartlinewidth}
-		\pgfpathmoveto{\pgfpoint{-0.5\pgf at circ@res at step}{0.5\pgf at circ@res at step}}
-		\pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
-		\pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
-		\pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
-		\pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
-		\pgfusepath{draw}
+    % draw outer box
+    \pgf at circ@twoportbox
 
-		\pgfpathmoveto{\pgfpoint{-0.5\pgf at circ@res at step}{0}}
-		\pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
-		\pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
-		\pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
-		\pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
-		\pgfusepath{draw}
-		\pgfpathmoveto{\pgfpoint{-0.15\pgf at circ@res at step}{-0.15\pgf at circ@res at step}}
-		\pgfpathlineto{\pgfpoint{0.15\pgf at circ@res at step}{0.15\pgf at circ@res at step}}
-		\pgfusepath{draw}
+    \ifpgf at circuit@inputarrow
+        {
+            \advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+            \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+            \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+        }
+    \fi
 
-		\pgfpathmoveto{\pgfpoint{-0.5\pgf at circ@res at step}{-0.5\pgf at circ@res at step}}
-		\pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
-		\pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
-		\pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
-		\pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
-		\pgfusepath{draw}
-		\pgfpathmoveto{\pgfpoint{-0.15\pgf at circ@res at step}{-0.65\pgf at circ@res at step}}
-		\pgfpathlineto{\pgfpoint{0.15\pgf at circ@res at step}{-0.35\pgf at circ@res at step}}
-		\pgfusepath{draw}
+    % rotate inner symbol
+    \def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at 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
+    \pgfsetarrows{-} %never draw arrows
+    \pgfsetlinewidth{\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{-0.5\pgf at circ@res at step}{0.5\pgf at circ@res at step}}
+    \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+    \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
+    \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
+    \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+    \pgfusepath{draw}
+
+    \pgfpathmoveto{\pgfpoint{-0.5\pgf at circ@res at step}{0}}
+    \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+    \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
+    \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
+    \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+    \pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{-0.15\pgf at circ@res at step}{-0.15\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{0.15\pgf at circ@res at step}{0.15\pgf at circ@res at step}}
+    \pgfusepath{draw}
+
+    \pgfpathmoveto{\pgfpoint{-0.5\pgf at circ@res at step}{-0.5\pgf at circ@res at step}}
+    \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+    \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
+    \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
+    \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+    \pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{-0.15\pgf at circ@res at step}{-0.65\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{0.15\pgf at circ@res at step}{-0.35\pgf at circ@res at step}}
+    \pgfusepath{draw}
 }
 
 %% lowpass filter
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/lowpass/width}}{lowpass}{\ctikzvalof{bipoles/lowpass/width}}{\ctikzvalof{bipoles/lowpass/width}}{
-		\pgf at circ@res at step = \ctikzvalof{bipoles/lowpass/width}\pgf at circ@Rlen
-		\divide \pgf at circ@res at step by 2
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/lowpass/width}}
+{lowpass}
+{\ctikzvalof{bipoles/lowpass/width}}
+{\ctikzvalof{bipoles/lowpass/width}}
+{
+    \pgf at circ@res at step = \ctikzvalof{bipoles/lowpass/width}\pgf at circ@Rlen
+    \divide \pgf at circ@res at step by 2
 
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
-		\pgf at circ@res at other = \pgf at circ@res at left
-		\advance\pgf at circ@res at other by \pgf at circ@res at step 
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgf at circ@res at other = \pgf at circ@res at left
+    \advance\pgf at circ@res at other by \pgf at circ@res at step
 
-		\ifpgf at circuit@dashed
-			\pgfsetdash{{0.1cm}{0.1cm}}{0cm} 
-		\fi	
-		
-		% draw outer box
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-		\pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfusepath{draw}
-		
-		\ifpgf at circuit@inputarrow
-			{
-				\advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
-				\pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
-				\pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
-			}
-		\fi
-		
-		% rotate inner symbol
-		\def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at 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
+    \ifpgf at circuit@dashed
+        \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+    \fi
 
-		% draw inner symbol
-		\pgfsetdash{}{0pt}	% always draw solid line for inner symbol
-		\pgfsetarrows{-} %never draw arrows
-		\pgfsetlinewidth{\pgfstartlinewidth}
-		\pgfpathmoveto{\pgfpoint{-0.5\pgf at circ@res at step}{0.5\pgf at circ@res at step}}
-		\pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
-		\pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
-		\pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
-		\pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
-		\pgfusepath{draw}
-		\pgfpathmoveto{\pgfpoint{-0.15\pgf at circ@res at step}{0.35\pgf at circ@res at step}}
-		\pgfpathlineto{\pgfpoint{0.15\pgf at circ@res at step}{0.65\pgf at circ@res at step}}
-		\pgfusepath{draw}
+    % draw outer box
+    \pgf at circ@twoportbox
 
-		\pgfpathmoveto{\pgfpoint{-0.5\pgf at circ@res at step}{0}}
-		\pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
-		\pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
-		\pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
-		\pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
-		\pgfusepath{draw}
-		\pgfpathmoveto{\pgfpoint{-0.15\pgf at circ@res at step}{-0.15\pgf at circ@res at step}}
-		\pgfpathlineto{\pgfpoint{0.15\pgf at circ@res at step}{0.15\pgf at circ@res at step}}
-		\pgfusepath{draw}
+    \ifpgf at circuit@inputarrow
+        {
+            \advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+            \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+            \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+        }
+    \fi
 
-		\pgfpathmoveto{\pgfpoint{-0.5\pgf at circ@res at step}{-0.5\pgf at circ@res at step}}
-		\pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
-		\pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
-		\pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
-		\pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
-		\pgfusepath{draw}
+    % rotate inner symbol
+    \def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at 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
+    \pgfsetarrows{-} %never draw arrows
+    \pgfsetlinewidth{\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{-0.5\pgf at circ@res at step}{0.5\pgf at circ@res at step}}
+    \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+    \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
+    \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
+    \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+    \pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{-0.15\pgf at circ@res at step}{0.35\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{0.15\pgf at circ@res at step}{0.65\pgf at circ@res at step}}
+    \pgfusepath{draw}
+
+    \pgfpathmoveto{\pgfpoint{-0.5\pgf at circ@res at step}{0}}
+    \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+    \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
+    \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
+    \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+    \pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{-0.15\pgf at circ@res at step}{-0.15\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{0.15\pgf at circ@res at step}{0.15\pgf at circ@res at step}}
+    \pgfusepath{draw}
+
+    \pgfpathmoveto{\pgfpoint{-0.5\pgf at circ@res at step}{-0.5\pgf at circ@res at step}}
+    \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+    \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
+    \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{-.25\pgf at circ@res at step}}
+    \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+    \pgfusepath{draw}
 }
 
 %% ADC
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/adc/width}}{adc}{\ctikzvalof{bipoles/adc/width}}{\ctikzvalof{bipoles/adc/width}}{
-		\pgf at circ@res at step = \ctikzvalof{bipoles/adc/width}\pgf at circ@Rlen
-		\divide \pgf at circ@res at step by 2
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/adc/width}}
+{adc}
+{\ctikzvalof{bipoles/adc/width}}
+{\ctikzvalof{bipoles/adc/width}}
+{
+    \pgf at circ@res at step = \ctikzvalof{bipoles/adc/width}\pgf at circ@Rlen
+    \divide \pgf at circ@res at step by 2
 
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
-		\pgf at circ@res at other = \pgf at circ@res at left
-		\advance\pgf at circ@res at other by \pgf at circ@res at step 
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgf at circ@res at other = \pgf at circ@res at left
+    \advance\pgf at circ@res at other by \pgf at circ@res at step
 
-		\ifpgf at circuit@dashed
-			\pgfsetdash{{0.1cm}{0.1cm}}{0cm} 
-		\fi	
-		
-		% draw outer box
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-		\pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfusepath{draw}
-		
-		\ifpgf at circuit@inputarrow
-			{
-				\advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
-				\pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
-				\pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
-			}
-		\fi
-		
-		% rotate inner symbol
-		\def\texti{A}
-		\def\textii{D}
-		\def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at 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
+    \ifpgf at circuit@dashed
+        \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+    \fi
 
-		% draw inner symbol
-		\pgfsetdash{}{0pt}	% always draw solid line for inner symbol
-		\pgfsetarrows{-} %never draw arrows				
-		\pgfsetlinewidth{\pgfstartlinewidth}
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
-		\pgfusepath{draw}
-		
-		\pgftext[center,x=0.45\pgf at circ@res at left,y=0.45\pgf at circ@res at up]{\textsf{\texti}}
-		\pgftext[center,x=0.45\pgf at circ@res at right,y=0.45\pgf at circ@res at down]{\textsf{\textii}}
+    % draw outer box
+    \pgf at circ@twoportbox
+
+    \ifpgf at circuit@inputarrow
+        {
+            \advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+            \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+            \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+        }
+    \fi
+
+    % rotate inner symbol
+    \def\texti{A}
+    \def\textii{D}
+    \def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at 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
+    \pgfsetdash{}{0pt}	% always draw solid line for inner symbol
+    \pgfsetarrows{-} %never draw arrows
+    \pgfsetlinewidth{\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfusepath{draw}
+
+    \pgftext[center,x=0.45\pgf at circ@res at left,y=0.45\pgf at circ@res at up]{\textsf{\texti}}
+    \pgftext[center,x=0.45\pgf at circ@res at right,y=0.45\pgf at circ@res at down]{\textsf{\textii}}
 }
 
 %% DAC
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/dac/width}}{dac}{\ctikzvalof{bipoles/dac/width}}{\ctikzvalof{bipoles/dac/width}}{
-		\pgf at circ@res at step = \ctikzvalof{bipoles/dac/width}\pgf at circ@Rlen
-		\divide \pgf at circ@res at step by 2
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/dac/width}}
+{dac}
+{\ctikzvalof{bipoles/dac/width}}
+{\ctikzvalof{bipoles/dac/width}}
+{
+    \pgf at circ@res at step = \ctikzvalof{bipoles/dac/width}\pgf at circ@Rlen
+    \divide \pgf at circ@res at step by 2
 
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
-		\pgf at circ@res at other = \pgf at circ@res at left
-		\advance\pgf at circ@res at other by \pgf at circ@res at step 
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgf at circ@res at other = \pgf at circ@res at left
+    \advance\pgf at circ@res at other by \pgf at circ@res at step
 
-		\ifpgf at circuit@dashed
-			\pgfsetdash{{0.1cm}{0.1cm}}{0cm} 
-		\fi	
-		
-		% draw outer box
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-		\pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfusepath{draw}
-		
-		\ifpgf at circuit@inputarrow
-			{
-				\advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
-				\pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
-				\pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
-			}
-		\fi
-		
-		% rotate inner symbol
-		\def\texti{D}
-		\def\textii{A}
-		\def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at 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
+    \ifpgf at circuit@dashed
+        \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+    \fi
 
-		% draw inner symbol
-		\pgfsetdash{}{0pt}	% always draw solid line for inner symbol
-		\pgfsetarrows{-} %never draw arrows				
-		\pgfsetlinewidth{\pgfstartlinewidth}
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
-		\pgfusepath{draw}
-		
-		\pgftext[center,x=0.45\pgf at circ@res at left,y=0.45\pgf at circ@res at up]{\textsf{\texti}}
-		\pgftext[center,x=0.45\pgf at circ@res at right,y=0.45\pgf at circ@res at down]{\textsf{\textii}}
+    % draw outer box
+    \pgf at circ@twoportbox
+
+    \ifpgf at circuit@inputarrow
+        {
+            \advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+            \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+            \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+        }
+    \fi
+
+    % rotate inner symbol
+    \def\texti{D}
+    \def\textii{A}
+    \def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at 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
+    \pgfsetdash{}{0pt}	% always draw solid line for inner symbol
+    \pgfsetarrows{-} %never draw arrows
+    \pgfsetlinewidth{\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfusepath{draw}
+
+    \pgftext[center,x=0.45\pgf at circ@res at left,y=0.45\pgf at circ@res at up]{\textsf{\texti}}
+    \pgftext[center,x=0.45\pgf at circ@res at right,y=0.45\pgf at circ@res at down]{\textsf{\textii}}
 }
 
 %% DSP
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/dsp/width}}{dsp}{\ctikzvalof{bipoles/dsp/width}}{\ctikzvalof{bipoles/dsp/width}}{
-		\pgf at circ@res at step = \ctikzvalof{bipoles/dsp/width}\pgf at circ@Rlen
-		\divide \pgf at circ@res at step by 2
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/dsp/width}}
+{dsp}
+{\ctikzvalof{bipoles/dsp/width}}
+{\ctikzvalof{bipoles/dsp/width}}
+{
+    \pgf at circ@res at step = \ctikzvalof{bipoles/dsp/width}\pgf at circ@Rlen
+    \divide \pgf at circ@res at step by 2
 
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
-		\pgf at circ@res at other = \pgf at circ@res at left
-		\advance\pgf at circ@res at other by \pgf at circ@res at step
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgf at circ@res at other = \pgf at circ@res at left
+    \advance\pgf at circ@res at other by \pgf at circ@res at step
 
-		\ifpgf at circuit@dashed
-			\pgfsetdash{{0.1cm}{0.1cm}}{0cm} 
-		\fi	
-		
-		% draw outer box
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-		\pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfusepath{draw}
-		
-		\ifpgf at circuit@inputarrow
-			{
-				\advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
-				\pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
-				\pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
-			}
-		\fi
-		
-		% rotate inner symbol
-		\def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at 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
+    \ifpgf at circuit@dashed
+        \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+    \fi
 
-		% draw inner symbol
-		\pgftext[center,x=0,y=0]{\textsf{DSP}}
+    % draw outer box
+    \pgf at circ@twoportbox
+
+    \ifpgf at circuit@inputarrow
+        {
+            \advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+            \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+            \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+        }
+    \fi
+
+    % rotate inner symbol
+    \def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at 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 at circ@res at step = \ctikzvalof{bipoles/fft/width}\pgf at circ@Rlen
-		\divide \pgf at circ@res at step by 2
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/fft/width}}
+{fft}
+{\ctikzvalof{bipoles/fft/width}}
+{\ctikzvalof{bipoles/fft/width}}
+{
+    \pgf at circ@res at step = \ctikzvalof{bipoles/fft/width}\pgf at circ@Rlen
+    \divide \pgf at circ@res at step by 2
 
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
-		\pgf at circ@res at other = \pgf at circ@res at left
-		\advance\pgf at circ@res at other by \pgf at circ@res at step
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgf at circ@res at other = \pgf at circ@res at left
+    \advance\pgf at circ@res at other by \pgf at circ@res at step
 
-		\ifpgf at circuit@dashed
-			\pgfsetdash{{0.1cm}{0.1cm}}{0cm} 
-		\fi	
-		
-		% draw outer box
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-		\pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfusepath{draw}
-		
-		\ifpgf at circuit@inputarrow
-			{
-				\advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
-				\pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
-				\pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
-			}
-		\fi
-		
-		% rotate inner symbol
-		\def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at 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
+    \ifpgf at circuit@dashed
+        \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+    \fi
 
-		% draw inner symbol
-		\pgftext[center,x=0,y=0]{\textsf{FFT}}
+    % draw outer box
+    \pgf at circ@twoportbox
+
+    \ifpgf at circuit@inputarrow
+        {
+            \advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+            \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+            \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+        }
+    \fi
+
+    % rotate inner symbol
+    \def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at 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 at circuit@boxed
-			\ctikzvalof{bipoles/twoport/width}
-		\else
-			\ctikzvalof{bipoles/amp/width}
-		\fi
-	}{amp}{
-		\ifpgf at circuit@boxed
-			\ctikzvalof{bipoles/twoport/width}
-		\else
-			\ctikzvalof{bipoles/amp/width}
-		\fi
-	}{
-		\ifpgf at circuit@boxed
-			\ctikzvalof{bipoles/twoport/width}
-		\else
-			\ctikzvalof{bipoles/amp/width}
-		\fi
-	}{
-		\pgf at circ@res at step = \ctikzvalof{bipoles/amp/width}\pgf at circ@Rlen
+\pgfcircdeclarebipole
+{}
+{
+    \ifpgf at circuit@boxed
+        \ctikzvalof{bipoles/twoport/width}
+    \else
+        \ctikzvalof{bipoles/amp/width}
+    \fi
+}
+{amp}
+{
+    \ifpgf at circuit@boxed
+        \ctikzvalof{bipoles/twoport/width}
+    \else
+        \ctikzvalof{bipoles/amp/width}
+    \fi
+}
+{
+    \ifpgf at circuit@boxed
+        \ctikzvalof{bipoles/twoport/width}
+    \else
+        \ctikzvalof{bipoles/amp/width}
+    \fi
+}
+{
+    \pgf at circ@res at step = \ctikzvalof{bipoles/amp/width}\pgf at circ@Rlen
 
-		\ifpgf at circuit@dashed
-			\pgfsetdash{{0.1cm}{0.1cm}}{0cm} 
-		\fi		
+    \ifpgf at circuit@dashed
+        \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+    \fi
 
-		% draw outer box
-		\ifpgf at circuit@boxed
-			\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}	
-			\pgfnode{box}{center}{}{pgf at box}{\pgfusepath{draw}}
-		\fi
-		
-		% draw input arrow
-		\ifpgf at circuit@inputarrow
-			{
-				\advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
-				\pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
-				\pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
-			}
-		\fi
+    % draw outer box
+    \ifpgf at circuit@boxed
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+        \pgfnode{box}{center}{}{pgf at box}{\pgfusepath{draw}}
+    \pgf at circ@draworfill
+    \fi
 
-		\ifpgf at circuit@boxed
-			\pgfsetlinewidth{\pgfstartlinewidth}
-			\pgfsetdash{}{0pt}	% draw solid line for inner symbol if no box is drawn
-			\pgf at circ@res at step=.7\pgf at circ@res at step % scale amp symbol when inside a box
-		\else
-			\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}	
-		\fi
-		
-		\pgfsetarrows{-} %never draw arrows
-		\pgfsetlinewidth{\pgfstartlinewidth}
+    % draw input arrow
+    \ifpgf at circuit@inputarrow
+        {
+            \advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+            \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+            \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+        }
+    \fi
 
-		\pgfpathmoveto{\pgfpoint{-0.5\pgf at circ@res at step}{0.55\pgf at circ@res at step}}
-		\pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at step}{0}}
-		\pgfpathlineto{\pgfpoint{-0.5\pgf at circ@res at step}{-0.55\pgf at circ@res at step}}
+    \ifpgf at circuit@boxed
+        \pgfsetlinewidth{\pgfstartlinewidth}
+        \pgfsetdash{}{0pt}	% draw solid line for inner symbol if no box is drawn
+        \pgf at circ@res at step=.7\pgf at circ@res at step % scale amp symbol when inside a box
+    \else
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \fi
 
-		\pgfpathclose
-		\pgfusepath{draw}
-		
-		% draw inner text
-		\pgftext[center,x=-0.12\pgf at circ@res at step,y=0]{\ctikzvalof{bipoles/twoport/text}}
+    \pgfsetarrows{-} %never draw arrows
+    \pgfsetlinewidth{\pgfstartlinewidth}
+
+    \pgfpathmoveto{\pgfpoint{-0.5\pgf at circ@res at step}{0.55\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at step}{0}}
+    \pgfpathlineto{\pgfpoint{-0.5\pgf at circ@res at step}{-0.55\pgf at circ@res at step}}
+
+    \pgfpathclose
+    \pgf at circ@draworfill
+
+    % draw inner text
+    \pgftext[center,x=-0.12\pgf at circ@res at step,y=0]{\ctikzvalof{bipoles/twoport/text}}
 }
 
 
 %% variable amplifier
-\pgfcircdeclarebipole{}{
-		\ifpgf at circuit@boxed
-			\ctikzvalof{bipoles/twoport/width}
-		\else
-			\ctikzvalof{bipoles/amp/width}
-		\fi
-	}{vamp}{
-		\ifpgf at circuit@boxed
-			\ctikzvalof{bipoles/twoport/width}
-		\else
-			\ctikzvalof{bipoles/amp/width}
-		\fi
-	}{
-		\ifpgf at circuit@boxed
-			\ctikzvalof{bipoles/twoport/width}
-		\else
-			\ctikzvalof{bipoles/amp/width}
-		\fi
-	}{
-		\pgf at circ@res at step = \ctikzvalof{bipoles/amp/width}\pgf at circ@Rlen
+\pgfcircdeclarebipole
+{}
+{
+    \ifpgf at circuit@boxed
+        \ctikzvalof{bipoles/twoport/width}
+    \else
+        \ctikzvalof{bipoles/amp/width}
+    \fi
+}
+{vamp}
+{
+    \ifpgf at circuit@boxed
+        \ctikzvalof{bipoles/twoport/width}
+    \else
+        \ctikzvalof{bipoles/amp/width}
+    \fi
+}
+{
+    \ifpgf at circuit@boxed
+        \ctikzvalof{bipoles/twoport/width}
+    \else
+        \ctikzvalof{bipoles/amp/width}
+    \fi
+}
+{
+    \pgf at circ@res at step = \ctikzvalof{bipoles/amp/width}\pgf at circ@Rlen
 
-		\ifpgf at circuit@dashed
-			\pgfsetdash{{0.1cm}{0.1cm}}{0cm} 
-		\fi	
-		
-		% draw outer box
-		\ifpgf at circuit@boxed
-			\pgfnode{box}{center}{}{pgf at box}{\pgfusepath{draw}}
-		\fi
+    \ifpgf at circuit@dashed
+        \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+    \fi
 
-		% draw input arrow
-		\ifpgf at circuit@inputarrow
-			{
-				\advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
-				\pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
-				\pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
-			}
-		\fi
+    % draw outer box
+    \ifpgf at circuit@boxed
+        \pgfnode{box}{center}{}{pgf at box}{\pgfusepath{draw}}
+    \fi
 
-		\ifpgf at circuit@boxed
-			\pgfsetlinewidth{\pgfstartlinewidth}
-			\pgfsetdash{}{0pt}	% draw solid line for inner symbol if no box is drawn
-			\pgf at circ@res at step=.7\pgf at circ@res at step % scale amp symbol when inside a box
-		\else
-			\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}	
-		\fi
-		
+    % draw input arrow
+    \ifpgf at circuit@inputarrow
+        {
+            \advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+            \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+            \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+        }
+    \fi
 
-		\pgfsetdash{}{0pt}	% always draw solid line for inner symbol
-		\pgfsetarrows{-} %never draw arrows
-		\pgfsetlinewidth{\pgfstartlinewidth}
+    \ifpgf at circuit@boxed
+        \pgfsetlinewidth{\pgfstartlinewidth}
+        \pgfsetdash{}{0pt}	% draw solid line for inner symbol if no box is drawn
+        \pgf at circ@res at step=.7\pgf at circ@res at step % scale amp symbol when inside a box
+    \else
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \fi
 
-		\pgfpathmoveto{\pgfpoint{-0.5\pgf at circ@res at step}{0.55\pgf at circ@res at step}}
-		\pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at step}{0}}
-		\pgfpathlineto{\pgfpoint{-0.5\pgf at circ@res at step}{-0.55\pgf at circ@res at step}}
 
-		\pgfpathclose
-		\pgfusepath{draw}
-		
-		% draw inner text
-		\pgftext[center,x=-0.12\pgf at circ@res at step,y=0]{\ctikzvalof{bipoles/twoport/text}}
-		
-		% draw arrow
-		\pgfsetlinewidth{\pgfstartlinewidth}
-		\pgfsetarrowsend{latex}
-		\pgfpathmoveto{\pgfpoint{-0.8\pgf at circ@res at step}{-0.5\pgf at circ@res at step}}
-		\pgfpathlineto{\pgfpoint{0.6\pgf at circ@res at step}{0.6\pgf at circ@res at step}}
-		\pgfusepath{draw}
+    \pgfsetdash{}{0pt}	% always draw solid line for inner symbol
+    \pgfsetarrows{-} %never draw arrows
+    \pgfsetlinewidth{\pgfstartlinewidth}
+
+    \pgfpathmoveto{\pgfpoint{-0.5\pgf at circ@res at step}{0.55\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at step}{0}}
+    \pgfpathlineto{\pgfpoint{-0.5\pgf at circ@res at step}{-0.55\pgf at circ@res at step}}
+
+    \pgfpathclose
+    \pgf at circ@draworfill
+
+    % draw inner text
+    \pgftext[center,x=-0.12\pgf at circ@res at step,y=0]{\ctikzvalof{bipoles/twoport/text}}
+
+    % draw arrow
+    \pgfsetlinewidth{\pgfstartlinewidth}
+    \pgfsetarrowsend{latex}
+    \pgfpathmoveto{\pgfpoint{-0.8\pgf at circ@res at step}{-0.5\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{0.6\pgf at circ@res at step}{0.6\pgf at circ@res at step}}
+    \pgfusepath{draw}
 }
 
 %% pi attenuator
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/piattenuator/width}}{piattenuator}{\ctikzvalof{bipoles/piattenuator/width}}{\ctikzvalof{bipoles/piattenuator/width}}{
-		\pgf at circ@res at step = \ctikzvalof{bipoles/piattenuator/width}\pgf at circ@Rlen
-		\divide \pgf at circ@res at step by 2
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/piattenuator/width}}
+{piattenuator}
+{\ctikzvalof{bipoles/piattenuator/width}}
+{\ctikzvalof{bipoles/piattenuator/width}}
+{
+    \pgf at circ@res at step = \ctikzvalof{bipoles/piattenuator/width}\pgf at circ@Rlen
+    \divide \pgf at circ@res at step by 2
 
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
-		\pgf at circ@res at other = \pgf at circ@res at left
-		\advance\pgf at circ@res at other by \pgf at circ@res at step 
-		
-		\ifpgf at circuit@dashed
-			\pgfsetdash{{0.1cm}{0.1cm}}{0cm} 
-		\fi	
-		
-		% draw outer box
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-		\pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfusepath{draw}
-		
-		\ifpgf at circuit@inputarrow
-			{
-				\advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
-				\pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
-				\pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
-			}
-		\fi
-		
-		% rotate inner symbol
-		\def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at nil}
-		\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
-			\pgftransformrotate{270}
-		\fi\fi
-		\ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
-			\pgftransformrotate{90}
-		\fi\fi
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgf at circ@res at other = \pgf at circ@res at left
+    \advance\pgf at circ@res at other by \pgf at circ@res at step
 
-		% draw inner symbol
-		\pgfsetdash{}{0pt}	% always draw solid line for inner symbol
-		\pgfsetarrows{-} %never draw arrows
-		\pgfsetlinewidth{\pgfstartlinewidth}
-		\pgfpathmoveto{\pgfpoint{0.4\pgf at circ@res at left}{0.4\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{0.4\pgf at circ@res at left}{0.4\pgf at circ@res at up}}
-		\pgfusepath{draw}
-		\pgfpathmoveto{\pgfpoint{0.4\pgf at circ@res at right}{0.4\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{0.4\pgf at circ@res at right}{0.4\pgf at circ@res at up}}
-		\pgfusepath{draw}
-		\pgfpathmoveto{\pgfpoint{0.6\pgf at circ@res at left}{0.4\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{0.6\pgf at circ@res at right}{0.4\pgf at circ@res at up}}
-		\pgfusepath{draw}
+    \ifpgf at circuit@dashed
+        \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+    \fi
+
+    % draw outer box
+    \pgf at circ@twoportbox
+
+    \ifpgf at circuit@inputarrow
+        {
+            \advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+            \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+            \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+        }
+    \fi
+
+    % rotate inner symbol
+    \def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at 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
+    \pgfsetarrows{-} %never draw arrows
+    \pgfsetlinewidth{\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{0.4\pgf at circ@res at left}{0.4\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{0.4\pgf at circ@res at left}{0.4\pgf at circ@res at up}}
+    \pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{0.4\pgf at circ@res at right}{0.4\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{0.4\pgf at circ@res at right}{0.4\pgf at circ@res at up}}
+    \pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{0.6\pgf at circ@res at left}{0.4\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{0.6\pgf at circ@res at right}{0.4\pgf at circ@res at up}}
+    \pgfusepath{draw}
 }
 
 %% variable pi attenuator
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vpiattenuator/width}}{vpiattenuator}{\ctikzvalof{bipoles/vpiattenuator/width}}{\ctikzvalof{bipoles/vpiattenuator/width}}{
-		\pgf at circ@res at step = \ctikzvalof{bipoles/vpiattenuator/width}\pgf at circ@Rlen
-		\divide \pgf at circ@res at step by 2
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/vpiattenuator/width}}
+{vpiattenuator}
+{\ctikzvalof{bipoles/vpiattenuator/width}}
+{\ctikzvalof{bipoles/vpiattenuator/width}}
+{
+    \pgf at circ@res at step = \ctikzvalof{bipoles/vpiattenuator/width}\pgf at circ@Rlen
+    \divide \pgf at circ@res at step by 2
 
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
-		\pgf at circ@res at other = \pgf at circ@res at left
-		\advance\pgf at circ@res at other by \pgf at circ@res at step 
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgf at circ@res at other = \pgf at circ@res at left
+    \advance\pgf at circ@res at other by \pgf at circ@res at step
 
-		\ifpgf at circuit@dashed
-			\pgfsetdash{{0.1cm}{0.1cm}}{0cm} 
-		\fi	
-		
-		% draw outer box
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-		\pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfusepath{draw}
-		
-		\ifpgf at circuit@inputarrow
-			{
-				\advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
-				\pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
-				\pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
-			}
-		\fi
-		
-		% rotate inner symbol
-		\def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at nil}
-		\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
-			\pgftransformrotate{270}
-		\fi\fi
-		\ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
-			\pgftransformrotate{90}
-		\fi\fi
+    \ifpgf at circuit@dashed
+        \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+    \fi
 
-		% draw inner symbol
-		\pgfsetdash{}{0pt}	% always draw solid line for inner symbol
-		\pgfsetarrows{-} %never draw arrows
-		\pgfsetlinewidth{\pgfstartlinewidth}
-		\pgfpathmoveto{\pgfpoint{0.4\pgf at circ@res at left}{0.4\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{0.4\pgf at circ@res at left}{0.4\pgf at circ@res at up}}
-		\pgfusepath{draw}
-		\pgfpathmoveto{\pgfpoint{0.4\pgf at circ@res at right}{0.4\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{0.4\pgf at circ@res at right}{0.4\pgf at circ@res at up}}
-		\pgfusepath{draw}
-		\pgfpathmoveto{\pgfpoint{0.6\pgf at circ@res at left}{0.4\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{0.6\pgf at circ@res at right}{0.4\pgf at circ@res at up}}
-		\pgfusepath{draw}
+    % draw outer box
+    \pgf at circ@twoportbox
 
-		\pgfsetarrowsend{latex}
-		\pgfpathmoveto{\pgfpoint{0.7\pgf at circ@res at left}{0.5\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{0.7\pgf at circ@res at right}{0.8\pgf at circ@res at up}}
-		\pgfusepath{draw}
+    \ifpgf at circuit@inputarrow
+        {
+            \advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+            \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+            \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+        }
+    \fi
+
+    % rotate inner symbol
+    \def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at 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
+    \pgfsetarrows{-} %never draw arrows
+    \pgfsetlinewidth{\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{0.4\pgf at circ@res at left}{0.4\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{0.4\pgf at circ@res at left}{0.4\pgf at circ@res at up}}
+    \pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{0.4\pgf at circ@res at right}{0.4\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{0.4\pgf at circ@res at right}{0.4\pgf at circ@res at up}}
+    \pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{0.6\pgf at circ@res at left}{0.4\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{0.6\pgf at circ@res at right}{0.4\pgf at circ@res at up}}
+    \pgfusepath{draw}
+
+    \pgfsetarrowsend{latex}
+    \pgfpathmoveto{\pgfpoint{0.7\pgf at circ@res at left}{0.5\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{0.7\pgf at circ@res at right}{0.8\pgf at circ@res at up}}
+    \pgfusepath{draw}
 }
 
 %% T attenuator
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/tattenuator/width}}{tattenuator}{\ctikzvalof{bipoles/tattenuator/width}}{\ctikzvalof{bipoles/tattenuator/width}}{
-		\pgf at circ@res at step = \ctikzvalof{bipoles/tattenuator/width}\pgf at circ@Rlen
-		\divide \pgf at circ@res at step by 2
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/tattenuator/width}}
+{tattenuator}
+{\ctikzvalof{bipoles/tattenuator/width}}
+{\ctikzvalof{bipoles/tattenuator/width}}
+{
+    \pgf at circ@res at step = \ctikzvalof{bipoles/tattenuator/width}\pgf at circ@Rlen
+    \divide \pgf at circ@res at step by 2
 
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
-		\pgf at circ@res at other = \pgf at circ@res at left
-		\advance\pgf at circ@res at other by \pgf at circ@res at step 
-		
-		\ifpgf at circuit@dashed
-			\pgfsetdash{{0.1cm}{0.1cm}}{0cm} 
-		\fi	
-		
-		% draw outer box
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-		\pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfusepath{draw}
-		
-		\ifpgf at circuit@inputarrow
-			{
-				\advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
-				\pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
-				\pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
-			}
-		\fi
-		
-		% rotate inner symbol
-		\def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at nil}
-		\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
-			\pgftransformrotate{270}
-		\fi\fi
-		\ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
-			\pgftransformrotate{90}
-		\fi\fi
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgf at circ@res at other = \pgf at circ@res at left
+    \advance\pgf at circ@res at other by \pgf at circ@res at step
 
-		% draw inner symbol
-		\pgfsetdash{}{0pt}	% always draw solid line for inner symbol
-		\pgfsetarrows{-} %never draw arrows
-		\pgfsetlinewidth{\pgfstartlinewidth}
-		\pgfpathmoveto{\pgfpoint{0pt}{0.4\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{0pt}{0.4\pgf at circ@res at up}}
-		\pgfusepath{draw}
-		\pgfpathmoveto{\pgfpoint{0.6\pgf at circ@res at left}{0.4\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{0.6\pgf at circ@res at right}{0.4\pgf at circ@res at up}}
-		\pgfusepath{draw}
+    \ifpgf at circuit@dashed
+        \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+    \fi
+
+    % draw outer box
+    \pgf at circ@twoportbox
+
+    \ifpgf at circuit@inputarrow
+        {
+            \advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+            \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+            \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+        }
+    \fi
+
+    % rotate inner symbol
+    \def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at 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
+    \pgfsetarrows{-} %never draw arrows
+    \pgfsetlinewidth{\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{0pt}{0.4\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{0pt}{0.4\pgf at circ@res at up}}
+    \pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{0.6\pgf at circ@res at left}{0.4\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{0.6\pgf at circ@res at right}{0.4\pgf at circ@res at up}}
+    \pgfusepath{draw}
 }
 
 %% variable T attenuator
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vtattenuator/width}}{vtattenuator}{\ctikzvalof{bipoles/vtattenuator/width}}{\ctikzvalof{bipoles/vtattenuator/width}}{
-		\pgf at circ@res at step = \ctikzvalof{bipoles/vtattenuator/width}\pgf at circ@Rlen
-		\divide \pgf at circ@res at step by 2
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/vtattenuator/width}}
+{vtattenuator}
+{\ctikzvalof{bipoles/vtattenuator/width}}
+{\ctikzvalof{bipoles/vtattenuator/width}}
+{
+    \pgf at circ@res at step = \ctikzvalof{bipoles/vtattenuator/width}\pgf at circ@Rlen
+    \divide \pgf at circ@res at step by 2
 
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
-		\pgf at circ@res at other = \pgf at circ@res at left
-		\advance\pgf at circ@res at other by \pgf at circ@res at step 
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgf at circ@res at other = \pgf at circ@res at left
+    \advance\pgf at circ@res at other by \pgf at circ@res at step
 
-		\ifpgf at circuit@dashed
-			\pgfsetdash{{0.1cm}{0.1cm}}{0cm} 
-		\fi	
-		
-		% draw outer box
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-		\pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfusepath{draw}
-		
-		\ifpgf at circuit@inputarrow
-			{
-				\advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
-				\pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
-				\pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
-			}
-		\fi
-		
-		% rotate inner symbol
-		\def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at nil}
-		\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
-			\pgftransformrotate{270}
-		\fi\fi
-		\ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
-			\pgftransformrotate{90}
-		\fi\fi
+    \ifpgf at circuit@dashed
+        \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+    \fi
 
-		% draw inner symbol
-		\pgfsetdash{}{0pt}	% always draw solid line for inner symbol
-		\pgfsetarrows{-} %never draw arrows
-		\pgfsetlinewidth{\pgfstartlinewidth}
-		\pgfpathmoveto{\pgfpoint{0pt}{0.4\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{0pt}{0.4\pgf at circ@res at up}}
-		\pgfusepath{draw}
-		\pgfpathmoveto{\pgfpoint{0.6\pgf at circ@res at left}{0.4\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{0.6\pgf at circ@res at right}{0.4\pgf at circ@res at up}}
-		\pgfusepath{draw}
-		
-		\pgfsetarrowsend{latex}
-		\pgfpathmoveto{\pgfpoint{0.7\pgf at circ@res at left}{0.5\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{0.7\pgf at circ@res at right}{0.8\pgf at circ@res at up}}
-		\pgfusepath{draw}
+    % draw outer box
+    \pgf at circ@twoportbox
+
+    \ifpgf at circuit@inputarrow
+        {
+            \advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+            \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+            \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+        }
+    \fi
+
+    % rotate inner symbol
+    \def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at 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
+    \pgfsetarrows{-} %never draw arrows
+    \pgfsetlinewidth{\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{0pt}{0.4\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{0pt}{0.4\pgf at circ@res at up}}
+    \pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{0.6\pgf at circ@res at left}{0.4\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{0.6\pgf at circ@res at right}{0.4\pgf at circ@res at up}}
+    \pgfusepath{draw}
+
+    \pgfsetarrowsend{latex}
+    \pgfpathmoveto{\pgfpoint{0.7\pgf at circ@res at left}{0.5\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{0.7\pgf at circ@res at right}{0.8\pgf at circ@res at up}}
+    \pgfusepath{draw}
 }
 
 %% phase shifter
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/phaseshifter/width}}{phaseshifter}{\ctikzvalof{bipoles/phaseshifter/width}}{\ctikzvalof{bipoles/phaseshifter/width}}{
-		\pgf at circ@res at step = \ctikzvalof{bipoles/phaseshifter/width}\pgf at circ@Rlen
-		\divide \pgf at circ@res at step by 2
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/phaseshifter/width}}
+{phaseshifter}
+{\ctikzvalof{bipoles/phaseshifter/width}}
+{\ctikzvalof{bipoles/phaseshifter/width}}
+{
+    \pgf at circ@res at step = \ctikzvalof{bipoles/phaseshifter/width}\pgf at circ@Rlen
+    \divide \pgf at circ@res at step by 2
 
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
-		\pgf at circ@res at other = \pgf at circ@res at left
-		\advance\pgf at circ@res at other by \pgf at circ@res at step 
-		
-		\ifpgf at circuit@dashed
-			\pgfsetdash{{0.1cm}{0.1cm}}{0cm} 
-		\fi	
-		
-		% draw outer box
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-		\pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfusepath{draw}
-		
-		\ifpgf at circuit@inputarrow
-			{
-				\advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
-				\pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
-				\pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
-			}
-		\fi
-		
-		% rotate inner symbol
-		\def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at 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$}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgf at circ@res at other = \pgf at circ@res at left
+    \advance\pgf at circ@res at other by \pgf at circ@res at step
+
+    \ifpgf at circuit@dashed
+        \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+    \fi
+
+    % draw outer box
+    \pgf at circ@twoportbox
+
+    \ifpgf at circuit@inputarrow
+        {
+            \advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+            \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+            \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+        }
+    \fi
+
+    % rotate inner symbol
+    \def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at 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 at circ@res at step = \ctikzvalof{bipoles/vphaseshifter/width}\pgf at circ@Rlen
-		\divide \pgf at circ@res at step by 2
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/phaseshifter/width}}
+{vphaseshifter}
+{\ctikzvalof{bipoles/vphaseshifter/width}}
+{\ctikzvalof{bipoles/vphaseshifter/width}}
+{
+    \pgf at circ@res at step = \ctikzvalof{bipoles/vphaseshifter/width}\pgf at circ@Rlen
+    \divide \pgf at circ@res at step by 2
 
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
-		\pgf at circ@res at other = \pgf at circ@res at left
-		\advance\pgf at circ@res at other by \pgf at circ@res at step 
-		
-		\ifpgf at circuit@dashed
-			\pgfsetdash{{0.1cm}{0.1cm}}{0cm} 
-		\fi	
-		
-		% draw outer box
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-		\pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfusepath{draw}
-		
-		\ifpgf at circuit@inputarrow
-			{
-				\advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
-				\pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
-				\pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
-			}
-		\fi
-		
-		% rotate inner symbol
-		\def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at 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 at circ@res at left}{0.65\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{0.7\pgf at circ@res at right}{0.65\pgf at circ@res at up}}
-		\pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgf at circ@res at other = \pgf at circ@res at left
+    \advance\pgf at circ@res at other by \pgf at circ@res at step
+
+    \ifpgf at circuit@dashed
+        \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+    \fi
+
+    % draw outer box
+    \pgf at circ@twoportbox
+
+    \ifpgf at circuit@inputarrow
+        {
+            \advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+            \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+            \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+        }
+    \fi
+
+    % rotate inner symbol
+    \def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at 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 at circ@res at left}{0.65\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{0.7\pgf at circ@res at right}{0.65\pgf at circ@res at up}}
+    \pgfusepath{draw}
 }
 
 %% detector
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/detector/width}}{detector}{\ctikzvalof{bipoles/detector/width}}{\ctikzvalof{bipoles/detector/width}}{
-		\pgf at circ@res at step = \ctikzvalof{bipoles/detector/width}\pgf at circ@Rlen
-		\divide \pgf at circ@res at step by 2
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/detector/width}}
+{detector}
+{\ctikzvalof{bipoles/detector/width}}
+{\ctikzvalof{bipoles/detector/width}}
+{
+    \pgf at circ@res at step = \ctikzvalof{bipoles/detector/width}\pgf at circ@Rlen
+    \divide \pgf at circ@res at step by 2
 
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
-		\pgf at circ@res at other = \pgf at circ@res at left
-		\advance\pgf at circ@res at other by \pgf at circ@res at step 
-		
-		\ifpgf at circuit@dashed
-			\pgfsetdash{{0.1cm}{0.1cm}}{0cm} 
-		\fi	
-		
-		% draw outer box
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-		\pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfusepath{draw}
-		
-		\ifpgf at circuit@inputarrow
-			{
-				\advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
-				\pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
-				\pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
-			}
-		\fi
-		
-		% draw inner stuff
-		\pgfsetdash{}{0pt}	% always draw solid line for inner symbol
-		\pgfsetarrows{-} %never draw arrows
-		\pgfsetlinewidth{0.8\pgfstartlinewidth}
-		\pgfpathmoveto{\pgfpoint{0.75\pgf at circ@res at left}{0}}
-		\pgfpathlineto{\pgfpoint{0.75\pgf at circ@res at right}{0}}
-		\pgfusepath{draw}
-		
-		\ifpgf at circuit@fulldiode
-			\pgfmathparse{2\pgf at circ@res at up / \pgf at circ@Rlen / \ctikzvalof{bipoles/generic/width}}
-			\pgftransformscale{\pgfmathresult}
-			\pgfnode{fulldiodeshape}{center}{}{pgf at fulldiode}{\pgfusepath{fill}}
-		\else
-			\pgfmathparse{2\pgf at circ@res at up / \pgf at circ@Rlen / \ctikzvalof{bipoles/resistor/width}}
-			\pgftransformscale{\pgfmathresult}
-			\pgfnode{emptydiodeshape}{center}{}{pgf at emptydiode}{\pgfusepath{fill}}
-		\fi
-		
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgf at circ@res at other = \pgf at circ@res at left
+    \advance\pgf at circ@res at other by \pgf at circ@res at step
+
+    \ifpgf at circuit@dashed
+        \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+    \fi
+
+    % draw outer box
+    \pgf at circ@twoportbox
+
+    \ifpgf at circuit@inputarrow
+        {
+            \advance \pgf at circ@res at left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+            \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+            \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+        }
+    \fi
+
+    % draw inner stuff
+    \pgfsetdash{}{0pt}	% always draw solid line for inner symbol
+    \pgfsetarrows{-} %never draw arrows
+    \pgfsetlinewidth{0.8\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{0.75\pgf at circ@res at left}{0}}
+    \pgfpathlineto{\pgfpoint{0.75\pgf at circ@res at right}{0}}
+    \pgfusepath{draw}
+
+    \ifpgf at circuit@fulldiode
+        \pgfmathparse{2\pgf at circ@res at up / \pgf at circ@Rlen / \ctikzvalof{bipoles/generic/width}}
+        \pgftransformscale{\pgfmathresult}
+        \pgfnode{fulldiodeshape}{center}{}{pgf at fulldiode}{\pgfusepath{fill}}
+    \else
+        \pgfmathparse{2\pgf at circ@res at up / \pgf at circ@Rlen / \ctikzvalof{bipoles/resistor/width}}
+        \pgftransformscale{\pgfmathresult}
+        \pgfnode{emptydiodeshape}{center}{}{pgf at emptydiode}{\pgfusepath{fill}}
+    \fi
+
 }
 
 
@@ -3061,24 +4284,30 @@
 
 %% 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}}{
+\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 at circ@res at step = \ctikzvalof{bipoles/resistor/width}\pgf at circ@Rlen
-		%\divide \pgf at circ@res at step by 14
+    %\pgf at circ@res at step = \ctikzvalof{bipoles/resistor/width}\pgf at circ@Rlen
+    %\divide \pgf at circ@res at step by 14
 
-		\pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-					
-		\pgfusepath{draw} 
-		
-		\pgfscope
-		\pgfsetarrowsend{latex'}
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
-		\pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/european gas filled surge arrester/inside}\pgf at circ@res at left}{0pt}}
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}	
-				\pgfusepath{draw} 
-	
-		\endpgfscope
+    \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+    \pgf at circ@draworfill
+
+    \pgfscope
+        \pgfsetarrowsend{latexslim}
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+        \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/european gas filled surge arrester/inside}\pgf at circ@res at left}{0pt}}
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+        \pgfusepath{draw}
+
+    \endpgfscope
 }
 
 
@@ -3086,57 +4315,42 @@
 
 %% 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 at circ@temp{right}
-	%\ifx\tikz at res@label at pos\pgf at circ@temp
-	%	\pgf at circ@res at step=-1.2\pgf at circ@res at up
-	%\else
-%		\def\pgf at circ@temp{below}
-%		\ifx\tikz at res@label at pos\pgf at circ@temp
-%			\pgf at circ@res at step=-1.2\pgf at circ@res at up
-%		\else
-%			\pgf at circ@res at step=1.2\pgf at circ@res at up
-%		\fi
-%	\fi
+\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}}{
 
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}		
-	\pgfpointorigin	\pgf at circ@res at other =  \pgf at x  \advance \pgf at circ@res at other by -\pgf at circ@res at up
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at zero}}
-	\pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgfpointorigin	\pgf at circ@res at other =  \pgf at x  \advance \pgf at circ@res at other by -\pgf at circ@res at up
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at zero}}
+    \pgfusepath{draw}
 
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfscope
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+        \pgfpathcircle{\pgfpointorigin}{.9\pgf at circ@res at up}
+        \pgf at circ@draworfill
+    \endpgfscope
 
-		\pgfscope
-			\pgfpathcircle{\pgfpointorigin}{.9\pgf at circ@res at up}
-			\pgfusepath{draw}		
-		\endpgfscope	
+    \pgfpathmoveto{\pgfpoint{-\pgf at circ@res at other}{\pgf at circ@res at zero}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
+    \pgfusepath{draw}
 
-	\pgfsetlinewidth{\pgfstartlinewidth}
+    \pgfscope
+        \pgfsetarrowsend{latex}
 
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
+        \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/inside}\pgf at circ@res at right}{\pgf at circ@res at zero}}
+        \pgfusepath{draw}
 
-	\pgfpathmoveto{\pgfpoint{-\pgf at circ@res at other}{\pgf at circ@res at zero}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
-	\pgfusepath{draw}
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+        \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/inside}\pgf at circ@res at left}{\pgf at circ@res at zero}}
+        \pgfusepath{draw}
+    \endpgfscope{}
 
-	\pgfnode{circle}{center}{}{}{}
-	
-	\pgfscope
-		\pgfsetarrowsend{latex}
-		
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
-		\pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/inside}\pgf at circ@res at right}{\pgf at circ@res at zero}}
-		\pgfusepath{draw}	
-		
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
-		\pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/inside}\pgf at circ@res at left}{\pgf at circ@res at zero}}
-		\pgfusepath{draw}	
-	\endpgfscope{}
-	
-	%\pgftransformshift{\pgfpoint{.25\pgf at circ@res at left}{.45\pgf at circ@res at down}}
-	%\pgfnode{circ}{center}{}{}{}
-	%\pgftransformshift{}
-	\pgfcircle{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/dot x}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/dot y}\pgf at circ@res at down}}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/size}\pgf at circ@res at down}
-	\pgfusepath{fill}
+    \pgfcircle{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/dot x}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/dot y}\pgf at circ@res at down}}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/size}\pgf at circ@res at down}
+    \pgfusepath{fill}
 }
 
 % % MECHANICAL SYMBOLS
@@ -3149,13 +4363,13 @@
 
 	\pgfmathsetlength{\pgf at circ@res at step}
 	{(\ctikzvalof{bipoles/spring/width}*\pgf at circ@Rlen+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth)/16}
-	
+
 	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf at circ@res at zero}}
 	\pgfsetcornersarced{\pgfpoint{.5\pgf at circ@res at up}{.5\pgf at circ@res at up}}
 	\pgf at circ@res at other = \pgf at circ@res at left
 	\advance\pgf at circ@res at other by \pgf at circ@res at step
 	\pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at up}}
-	\advance\pgf at circ@res at other by 2\pgf at circ@res at step 
+	\advance\pgf at circ@res at other by 2\pgf at circ@res at step
 	\pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at down}}
 	\advance\pgf at circ@res at other by 2\pgf at circ@res at step
 	\pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at up}}
@@ -3177,44 +4391,581 @@
 }
 
 %% mechanical inductance - mass
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/mass/box height}}{mass}{\ctikzvalof{bipoles/mass/height}}{\ctikzvalof{bipoles/mass/width}}{
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-	\pgftransformationadjustments
-	\pgfpathrectangle{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
-		{\pgfpoint{-2\pgf at circ@res at down}{-2\pgf at circ@res at down}}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/mass/box height}}
+{mass}
+{\ctikzvalof{bipoles/mass/height}}
+{\ctikzvalof{bipoles/mass/width}}
+{
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgftransformationadjustments
+    \pgfpathrectangle{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+        {\pgfpoint{-2\pgf at circ@res at down}{-2\pgf at circ@res at down}}
+    \pgf at circ@draworfill
 
-\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
-\pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
-	\pgfsetrectcap
-	\pgfsetmiterjoin
-	\pgfusepath{stroke}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+    \pgfsetrectcap
+    \pgfsetmiterjoin
+    \pgfusepath{stroke}
 }
 
 %% mechanical resistor - damper
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/damper/height}}{damper}{\ctikzvalof{bipoles/damper/height}}{\ctikzvalof{bipoles/damper/width}}{
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
-	\pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf at circ@res at right}
-					{\pgf at circ@res at zero}}
-	\pgfusepath{stroke}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/damper/height}}
+{damper}
+{\ctikzvalof{bipoles/damper/height}}
+{\ctikzvalof{bipoles/damper/width}}
+{
+    \pgfpathrectanglecorners{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf at circ@res at right}{\pgf at circ@res at down}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgf at circ@maybefill
 
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+    % line into the damper
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+    \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf at circ@res at right}
+        {\pgf at circ@res at zero}}
+    \pgfusepath{stroke}
 
-	\pgfsetrectcap
-	\pgfsetmiterjoin
-	\pgfusepath{stroke}
-	
-	\pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf at circ@res at right}
-						{.8\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf at circ@res at right}
-						{.8\pgf at circ@res at up}}
-	\pgfsetbuttcap
-	\pgfusepath{stroke}
-	
+    % damper box
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+
+    \pgfsetrectcap
+    \pgfsetmiterjoin
+    \pgfusepath{stroke}
+
+    % damper vertical element
+    \pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf at circ@res at right}
+        {.8\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf at circ@res at right}
+        {.8\pgf at circ@res at up}}
+    \pgfsetbuttcap
+    \pgfusepath{stroke}
+
 }
+%% mechanical viscoelastic element, suggested by @alex
+%% in https://tex.stackexchange.com/questions/484268/combined-spring-damper-in-circuitikz
+\pgfcircdeclarebipole
+{}                                   % extra anchors
+{\ctikzvalof{bipoles/damper/height}} % depth (under the path line)
+{viscoe}                             % name
+{\ctikzvalof{bipoles/damper/height}} % height (above the path line)
+{\ctikzvalof{bipoles/damper/width}}  % width
+{ % draw the bipole
+    \pgfpathrectanglecorners{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf at circ@res at right}{\pgf at circ@res at down}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgf at circ@maybefill
 
+    % spring into the damper
+    \pgfscope
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+        \pgfsetcornersarced{\pgfpoint{.25\pgf at circ@res at up}{.25\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{.75\pgf at circ@res at left}{.75\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{.5\pgf at circ@res at left}{-.75\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{.25\pgf at circ@res at left}{.75\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{0pt}{-.75\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf at circ@res at right}{.75\pgf at circ@res at up}}
+        \pgfusepath{stroke}
+    \endpgfscope
+    % damper box
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
 
+    \pgfsetrectcap
+    \pgfsetmiterjoin
+    \pgfusepath{stroke}
+
+    % damper vertical element
+    \pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf at circ@res at right}
+        {.8\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf at circ@res at right}
+        {.8\pgf at circ@res at up}}
+    \pgfsetbuttcap
+    \pgfusepath{stroke}
+
+}
+
+
+\pgfcircdeclarebipole
+{% anchor for labelling the type of dependency
+    \anchor{label}{%
+        \southwest
+        \pgf at x=0.4\pgf at x
+    }%
+}
+{\ctikzvalof{bipoles/resistivesens/height}}
+{resistivesens}
+{\ctikzvalof{bipoles/resistivesens/height}}
+{\ctikzvalof{bipoles/resistivesens/width}}
+{%
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgftransformationadjustments
+    \pgfmathsetlength{\pgf at circ@res at step}{\ctikzvalof{bipoles/resistor/width}\pgf at circ@Rlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
+    \divide \pgf at circ@res at step by 12
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf at circ@res at zero}}
+
+    \pgf at circ@res at other = \pgf at circ@res at left
+    \advance\pgf at circ@res at other by \pgf at circ@res at step
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{.5\pgf at circ@res at up}}
+    \advance\pgf at circ@res at other by 2\pgf at circ@res at step
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{.5\pgf at circ@res at down}}
+    \advance\pgf at circ@res at other by 2\pgf at circ@res at step
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{.5\pgf at circ@res at up}}
+    \advance\pgf at circ@res at other by 2\pgf at circ@res at step
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{.5\pgf at circ@res at down}}
+    \advance\pgf at circ@res at other by 2\pgf at circ@res at step
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{.5\pgf at circ@res at up}}
+    \advance\pgf at circ@res at other by 2\pgf at circ@res at step
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{.5\pgf at circ@res at down}}
+    \advance\pgf at circ@res at other by \pgf at circ@res at step
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at zero}}
+    \pgfsetbeveljoin
+    \pgfusepath{draw}
+
+    \pgfscope
+        \pgfpathmoveto{\pgfpoint{.4\pgf at circ@res at other}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{-.4\pgf at circ@res at other}{\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{-.9\pgf at circ@res at other}{\pgf at circ@res at down}}
+        \pgfusepath{draw}
+    \endpgfscope
+}
+
+%% crossing bipole (but see also nodes)
+\pgfcircdeclarebipole
+    {}
+    {\ctikzvalof{bipoles/crossing/size}}
+    {crossing}
+    {\ctikzvalof{bipoles/crossing/size}}
+    {\ctikzvalof{bipoles/crossing/size}}{
+        \pgfscope
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+        \pgfpathlineto{\pgfpoint{0.4\pgf at circ@res at left}{\pgf at circ@res at zero}}
+        \pgfpatharc{0}{-180}{0.4*\pgf at circ@res at left}
+        \pgfsetbeveljoin
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
+        \pgfusepath{draw}
+        \endpgfscope
+    }
+
+%% loudspeaker and microphone
+
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/loudspeaker/depth}}
+{loudspeaker}
+{\ctikzvalof{bipoles/loudspeaker/height}}
+{\ctikzvalof{bipoles/loudspeaker/width}}{
+
+    \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{.4\pgf at circ@res at up}}
+    {\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \pgfpathmoveto{\pgfpoint{0.5\pgf at circ@res at left}{.4\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{0.8\pgf at circ@res at left}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{0.8\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at right}{.4\pgf at circ@res at up}}
+    \pgfpathclose
+    \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgfstartlinewidth}
+    \pgf at circ@draworfill
+}
+
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/mic/depth}}
+{mic}
+{\ctikzvalof{bipoles/mic/height}}
+{\ctikzvalof{bipoles/mic/width}}{
+
+    \pgfscope
+    \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgfstartlinewidth}
+    \pgfpathcircle{\pgfpoint{0pt}{.6\pgf at circ@res at up}}{.4\pgf at circ@res at up}
+    \pgf at circ@draworfill
+    \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at left}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfusepath{draw}
+    \endpgfscope
+    \pgfscope
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+    \pgfpathlineto{\pgfpoint{-.2\pgf at circ@res at up}{0pt}}
+    % 0.25358 is 0.6-0.4*cos(30)
+    \pgfpathlineto{\pgfpoint{-.2\pgf at circ@res at up}{.25358\pgf at circ@res at up}}
+    \pgfpathmoveto{\pgfpoint{.2\pgf at circ@res at up}{.25358\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{.2\pgf at circ@res at up}{0pt}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+    \pgfusepath{draw}
+
+    \pgfusepath{draw}
+    \endpgfscope
+}
+
+% generic round meter with always horizontal text, no arrow
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/esource/height}}
+{rmeter}
+{\ctikzvalof{bipoles/esource/height}}
+{\ctikzvalof{bipoles/esource/width}}
+{
+    \pgfpointorigin
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+    \pgf at circ@draworfill
+    % draw the text label
+    % get the rotation
+    \pgfgettransformentries\a\b\temp\temp\temp\temp
+    \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
+    % and unrotate the scope
+    \pgfscope
+        \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+        \pgftransformrotate{\rot}
+        \pgftext[center,x=0,y=0]{\ctikzvalof{bipoles/twoport/text}}
+    \endpgfscope
+}
+
+% generic round meter with always horizontal text, with arrow
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/esource/height}}
+{rmeterwa}
+{\ctikzvalof{bipoles/esource/height}}
+{\ctikzvalof{bipoles/esource/width}}
+{
+    \pgfpointorigin
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+    \pgf at circ@draworfill
+    % draw the text label
+    % get the rotation
+    \pgfgettransformentries\a\b\temp\temp\temp\temp
+    \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
+    % and unrotate the scope
+    \pgfscope
+        \pgftransformrotate{\rot}
+        \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+        \pgfsetlinewidth{\pgfstartlinewidth}
+        % arrow: create  a center hole to have better visual
+        \pgfscope
+            % clipping path: first a rectangle bigger then the shape
+            % to avoid problems with the line thickness
+            \pgfpathrectanglecorners{\pgfpoint{2\pgf at circ@res at left}{2\pgf at circ@res at down}}
+            {\pgfpoint{2\pgf at circ@res at right}{2\pgf at circ@res at up}}
+            % next open a circle into it
+            \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{.6\pgf at circ@res at up}}{\pgfpoint{.6\pgf at circ@res at left}{0}}
+            % do the difference and clip before drawing
+            \pgfseteorule
+            \pgfusepath{clip}
+            \pgfsetarrowsend{latexslim}
+            % the arrow is better if it has a bit of breath and it's not 45º
+            \pgfpathmoveto{\pgfpoint{.8\pgf at circ@res at left}{1.2\pgf at circ@res at down}}
+            \pgfpathlineto{\pgfpoint{.8\pgf at circ@res at right}{1.2\pgf at circ@res at up}}
+            \pgfusepath{draw}
+        \endpgfscope
+        \pgftext[center]{\ctikzvalof{bipoles/twoport/text}}
+    \endpgfscope
+}
+
+% generic square meter with always horizontal text
+\pgfcircdeclarebipole
+{
+    \anchor{in 1}{\southwest\pgf at y=0.75\pgf at y\pgf at x=0.4\pgf at x}
+    \anchor{in 2}{\southwest\pgf at y=0.75\pgf at y\pgf at x=-0.4\pgf at x}
+    % put the node text above and centered
+    \anchor{text}{\pgfextracty{\pgf at circ@res at up}{\northeast}
+        \pgfpoint{-.5\wd\pgfnodeparttextbox}{
+            \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf at circ@res at up\relax
+        }
+    }
+}
+{\ctikzvalof{bipoles/smeter/height}}
+{smeter}
+{\ctikzvalof{bipoles/smeter/height}}
+{\ctikzvalof{bipoles/smeter/width}}
+{
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfextracty{\pgf at circ@res at up}{\northeast}
+    \pgfextractx{\pgf at circ@res at right}{\northeast}
+    \pgfextractx{\pgf at circ@res at left}{\southwest}
+    \pgfextracty{\pgf at circ@res at down}{\southwest}
+    \pgfmathsetlength{\pgf at circ@res at step}{0.25*\pgf at circ@res at up}
+    \pgfscope
+        \pgfsetcornersarced{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at step}}
+        \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+        \pgf at circ@draworfill
+    \endpgfscope
+    % get the rotation
+    \pgfgettransformentries\a\b\temp\temp\temp\temp
+    \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
+    % and unrotate the scope
+    \pgfscope
+        \pgftransformrotate{\rot}
+        % the metering window
+        \pgfscope
+            \def\@starta{105}\def\@stopa{75}
+            \pgfsetlinewidth{\pgfstartlinewidth}
+            \pgftransformshift{\pgfpoint{0pt}{-1.8\pgf at circ@res at up}}
+            \pgfpathmoveto{\pgfpointpolar{\@starta}{2\pgf at circ@res at up}}
+            \pgfpatharc{\@starta}{\@stopa}{2\pgf at circ@res at up}
+            \pgfpathlineto{\pgfpointpolar{\@stopa}{2.5\pgf at circ@res at up}}
+            \pgfpatharc{\@stopa}{\@starta}{2.5\pgf at circ@res at up}
+            \pgfclosepath
+            \pgfpathmoveto{\pgfpointpolar{80}{2\pgf at circ@res at up}}
+            \pgfpathlineto{\pgfpointpolar{80}{2.4\pgf at circ@res at up}}
+            \pgfusepath{draw}
+        \endpgfscope
+        \pgftext[center, y=0.5\pgf at circ@res at down]{\ctikzvalof{bipoles/twoport/text}}
+    \endpgfscope
+}
+
+% probles qucs style:
+% #1 : name
+% #2 : extra code
+\long\def\pgfcirc at qucsprobe#1#2{
+    \pgfcircdeclarebipole
+    {
+        \anchor{v+}{\southwest\pgf at x=0.6\pgf at x}
+        \anchor{v-}{\southwest\pgf at x=-0.6\pgf at x}
+        % put the node text above and centered
+        \anchor{text}{\pgfextracty{\pgf at circ@res at up}{\northeast}
+            \pgfpoint{-.5\wd\pgfnodeparttextbox}{
+                \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf at circ@res at up\relax
+            }
+        }
+    }
+    {\ctikzvalof{bipoles/qmeter/depth}}
+    {#1}
+    {\ctikzvalof{bipoles/qmeter/height}}
+    {\ctikzvalof{bipoles/qmeter/width}}
+    {
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+        \pgfextracty{\pgf at circ@res at up}{\northeast}
+        \pgfextractx{\pgf at circ@res at right}{\northeast}
+        \pgfextractx{\pgf at circ@res at left}{\southwest}
+        \pgfextracty{\pgf at circ@res at down}{\southwest}
+        \pgfmathsetlength{\pgf at circ@res at step}{0.25*\pgf at circ@res at up}
+        \pgfscope
+            \pgfscope
+                \pgfsetcornersarced{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at step}}
+                \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+            \pgf at circ@draworfill
+            \endpgfscope
+            \def\@starta{103}\def\@stopa{77}
+            \pgfsetlinewidth{\pgfstartlinewidth}
+            \pgfscope
+                \pgftransformshift{\pgfpoint{0pt}{-1.7\pgf at circ@res at up}}
+                \pgfpathmoveto{\pgfpointpolar{\@starta}{2.1\pgf at circ@res at up}}
+                \pgfpatharc{\@starta}{\@stopa}{2.1\pgf at circ@res at up}
+                \pgfpathlineto{\pgfpointpolar{\@stopa}{2.5\pgf at circ@res at up}}
+                \pgfpatharc{\@stopa}{\@starta}{2.5\pgf at circ@res at up}
+                \pgfclosepath
+                \pgfpathmoveto{\pgfpointpolar{83}{2.1\pgf at circ@res at up}}
+                \pgfpathlineto{\pgfpointpolar{83}{2.4\pgf at circ@res at up}}
+                \pgfusepath{draw}
+                \pgf at circ@draworfill
+            \endpgfscope
+            #2
+        \endpgfscope
+    }
+}
+
+\pgfcirc at qucsprobe{qiprobe}{
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+    \pgfusepath{draw}
+    \pgfnode{currarrow}{center}{}{}{}
+}
+
+\pgfcirc at qucsprobe{qvprobe}{
+    \pgfmathsetlength{\pgf at circ@res at other}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf at circ@Rlen}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+    \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at left}{0pt}}
+    \pgfpathcircle{\pgfpoint{.6\pgf at circ@res at left+\pgf at circ@res at other}{0pt}}{\pgf at circ@res at other}
+    \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at right}{0pt}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+    \pgfpathcircle{\pgfpoint{.6\pgf at circ@res at right-\pgf at circ@res at other}{0pt}}{\pgf at circ@res at other}
+    \pgfusepath{draw}
+    \pgfscope
+        % "+" and "-", drawn so that they scale correctly
+        \pgfsetlinewidth{2\pgfstartlinewidth}
+        \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at left+\pgf at circ@res at other}{-1.5\pgf at circ@res at other}}
+        \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at left+\pgf at circ@res at other}{-3.5\pgf at circ@res at other}}
+        \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at left+0\pgf at circ@res at other}{-2.5\pgf at circ@res at other}}
+        \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at left+2\pgf at circ@res at other}{-2.5\pgf at circ@res at other}}
+        \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at right+0\pgf at circ@res at other}{-2.5\pgf at circ@res at other}}
+        \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at right-2\pgf at circ@res at other}{-2.5\pgf at circ@res at other}}
+        \pgfusepath{draw}
+    \endpgfscope
+}
+
+\pgfcirc at qucsprobe{qpprobe}{
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+    \pgfusepath{draw}
+    \pgfnode{currarrow}{center}{}{}{}
+    \pgfmathsetlength{\pgf at circ@res at other}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf at circ@Rlen}
+    \pgfpathcircle{\pgfpoint{.6\pgf at circ@res at left}{-3\pgf at circ@res at other}}{\pgf at circ@res at other}
+    \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at left}{-4\pgf at circ@res at other}}
+    \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at left}{\pgf at circ@res at down}}
+    \pgfpathcircle{\pgfpoint{.6\pgf at circ@res at right}{-3\pgf at circ@res at other}}{\pgf at circ@res at other}
+    \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at right}{-4\pgf at circ@res at other}}
+    \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \pgfusepath{draw}
+    \pgfscope
+        % "+" and "-", drawn so that they scale correctly
+        \pgfsetlinewidth{2\pgfstartlinewidth}
+        \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at left+3\pgf at circ@res at other}{-2\pgf at circ@res at other}}
+        \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at left+3\pgf at circ@res at other}{-4\pgf at circ@res at other}}
+        \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at left+2\pgf at circ@res at other}{-3\pgf at circ@res at other}}
+        \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at left+4\pgf at circ@res at other}{-3\pgf at circ@res at other}}
+        \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at right-4\pgf at circ@res at other}{-3\pgf at circ@res at other}}
+        \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at right-2\pgf at circ@res at other}{-3\pgf at circ@res at other}}
+        \pgfusepath{draw}
+    \endpgfscope
+}
+
+
+% current loop for oscope and similar: stylized
+
+\pgfcircdeclarebipole
+{
+    \anchor{i}{\northeast\pgf at x=0pt\relax}
+    \anchor{text}{
+        \pgfextracty{\pgf at circ@res at up}{\northeast}
+        \pgfextractx{\pgf at circ@res at left}{\northeast}
+        \pgfpoint{-.5\wd\pgfnodeparttextbox+\pgf at circ@res at left}{
+            \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf at circ@res at up\relax
+        }
+    }
+}
+{\ctikzvalof{bipoles/iloop/height}}
+{iloop}
+{\ctikzvalof{bipoles/iloop/height}}
+{\ctikzvalof{bipoles/iloop/width}}
+{
+    \pgfextracty{\pgf at circ@res at up}{\northeast}
+    \pgfextractx{\pgf at circ@res at right}{\northeast}
+    \pgf at circ@res at down=-\pgf at circ@res at up
+    \pgf at circ@res at left=-\pgf at circ@res at right
+    \pgfscope
+        \pgfstartlinewidth=\pgflinewidth
+        \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+        % external ellipse
+        \pgfscope
+            \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgflinewidth}
+            % clipping path: first a rectangle bigger then the shape
+            % to avoid problems with the line thickness
+            \pgfpathrectanglecorners{\pgfpoint{2\pgf at circ@res at left}{2\pgf at circ@res at down}}
+            {\pgfpoint{2\pgf at circ@res at right}{2\pgf at circ@res at up}}
+            % next the opening to the left
+            \pgfpathrectanglecorners{\pgfpoint{2\pgf at circ@res at left}{.1\pgf at circ@res at down}}
+            {\pgfpoint{0pt}{.1\pgf at circ@res at up}}
+            % do the difference and clip before drawing
+            \pgfseteorule
+            \pgfusepath{clip}
+            \pgfpathellipse{\pgfpointorigin}{
+                \pgfpoint{0pt}{0.8\pgf at circ@res at up}}{
+            \pgfpoint{0.4\pgf at circ@res at right}{0pt}}
+            \pgfusepath{draw}
+        \endpgfscope
+        % internal wire
+        \pgfsetlinewidth{\pgfstartlinewidth}
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+        \pgfpathlineto{\pgfpoint{0.3\pgf at circ@res at right}{0pt}}
+        \pgfpathmoveto{\pgfpoint{0.5\pgf at circ@res at right}{0pt}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+        % and the contact line up
+        \pgfpathmoveto{\pgfpoint{0pt}{0.8\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
+        \pgfusepath{draw}
+    \endpgfscope
+}
+
+
+% current loop for oscope and similar: real (double connection)
+
+\pgfcircdeclarebipole
+{
+    \anchor{i+}{
+        \pgfextracty{\pgf at circ@res at up}{\northeast}
+        \pgfextractx{\pgf at circ@res at right}{\northeast}
+        \pgf at circ@res at step=0.4\pgf at circ@res at right
+        \pgf at circ@res at other=0.8\pgf at circ@res at up
+        \pgfpointpolar{105}{\pgf at circ@res at step and \pgf at circ@res at other}
+        \pgf at y=\pgf at circ@res at up
+    }
+    \anchor{i-}{
+        \pgfextracty{\pgf at circ@res at up}{\northeast}
+        \pgfextractx{\pgf at circ@res at right}{\northeast}
+        \pgf at circ@res at step=0.4\pgf at circ@res at right
+        \pgf at circ@res at other=0.8\pgf at circ@res at up
+        \pgfpointpolar{75}{\pgf at circ@res at step and \pgf at circ@res at other}
+        \pgf at y=\pgf at circ@res at up
+    }
+    \anchor{text}{
+        \pgfextracty{\pgf at circ@res at up}{\northeast}
+        \pgfextractx{\pgf at circ@res at left}{\northeast}
+        \pgfpoint{-.5\wd\pgfnodeparttextbox+\pgf at circ@res at left}{
+            \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf at circ@res at up\relax
+        }
+    }
+}
+{\ctikzvalof{bipoles/iloop/height}}
+{iloop2}
+{\ctikzvalof{bipoles/iloop/height}}
+{\ctikzvalof{bipoles/iloop/width}}
+{
+    \pgfextracty{\pgf at circ@res at up}{\northeast}
+    \pgfextractx{\pgf at circ@res at right}{\northeast}
+    \pgf at circ@res at down=-\pgf at circ@res at up
+    \pgf at circ@res at left=-\pgf at circ@res at right
+    % must be the same than internal i+ and i- anchors definition
+    \pgf at circ@res at step=0.4\pgf at circ@res at right
+    \pgf at circ@res at other=0.8\pgf at circ@res at up
+    \def\@plus{\pgfpointpolar{105}{\pgf at circ@res at step and \pgf at circ@res at other}}
+    \def\@minus{\pgfpointpolar{75}{\pgf at circ@res at step and \pgf at circ@res at other}}
+    \pgfscope
+        \pgfstartlinewidth=\pgflinewidth
+        \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+        % external ellipse
+        \pgfscope
+            \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgflinewidth}
+            % clipping path: first a rectangle bigger then the shape
+            % to avoid problems with the line thickness
+            \pgfpathrectanglecorners{\pgfpoint{2\pgf at circ@res at left}{2\pgf at circ@res at down}}
+            {\pgfpoint{2\pgf at circ@res at right}{2\pgf at circ@res at up}}
+            % next the opening to the left
+            \pgfpathrectanglecorners{\pgfpoint{2\pgf at circ@res at left}{.1\pgf at circ@res at down}}
+            {\pgfpoint{0pt}{.1\pgf at circ@res at up}}
+            % do the difference and clip before drawing
+            \pgfseteorule
+            \pgfusepath{clip}
+            \pgfpathmoveto{\@plus}
+            \pgfpatharc{105}{435}{\pgf at circ@res at step and \pgf at circ@res at other}
+            \pgfusepath{draw}
+        \endpgfscope
+        % internal wire
+        \pgfsetlinewidth{\pgfstartlinewidth}
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+        \pgfpathlineto{\pgfpoint{0.3\pgf at circ@res at right}{0pt}}
+        \pgfpathmoveto{\pgfpoint{0.5\pgf at circ@res at right}{0pt}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+        % and the contact line up
+        % I use ...left and ---right as temporal lengths here to avoid defining more
+        \pgfextractx{\pgf at circ@res at left}{\@plus}
+        \pgfextractx{\pgf at circ@res at right}{\@minus}
+        \pgfpathmoveto{\@plus}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+        \pgfpathmoveto{\@minus}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+        \pgfusepath{draw}
+    \endpgfscope
+}
+
+% end of pgfcircbipoles.tex

Modified: trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcirccurrent.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcirccurrent.tex	2019-05-10 21:14:43 UTC (rev 51070)
+++ trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcirccurrent.tex	2019-05-10 21:15:08 UTC (rev 51071)
@@ -5,7 +5,7 @@
 % 1. under the LaTeX Project Public License and/or
 % 2. under the GNU Public License.
 %
-% See the file doc/LICENSE for more details.
+% See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %% Current handling
@@ -12,188 +12,187 @@
 
 %% Options
 \ctikzset{i^>/.style = {
-		i = #1,
-		\circuitikzbasekey/bipole/current/direction = forward,
-		\circuitikzbasekey/bipole/current/x position = after,
-		\circuitikzbasekey/bipole/current/y position = above
-	}
+        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
-	}
+        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
-	}
+        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
-	}
+        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 = backward,
-		\circuitikzbasekey/bipole/current/x position = after,
-		\circuitikzbasekey/bipole/current/y position = above
-	}
+        i = #1,
+        \circuitikzbasekey/bipole/current/direction = backward,
+        \circuitikzbasekey/bipole/current/x position = after,
+        \circuitikzbasekey/bipole/current/y position = above
+    }
 }
 
 \ctikzset{i_</.style = {
-		i = #1,
-		\circuitikzbasekey/bipole/current/direction = backward,
-		\circuitikzbasekey/bipole/current/x position = after,
-		\circuitikzbasekey/bipole/current/y position = below
-	}
+        i = #1,
+        \circuitikzbasekey/bipole/current/direction = backward,
+        \circuitikzbasekey/bipole/current/x position = after,
+        \circuitikzbasekey/bipole/current/y position = below
+    }
 }
 
 \ctikzset{i<^/.style = {
-		i = #1,
-		\circuitikzbasekey/bipole/current/direction = backward,
-		\circuitikzbasekey/bipole/current/x position = before,
-		\circuitikzbasekey/bipole/current/y position = above
-	}
+        i = #1,
+        \circuitikzbasekey/bipole/current/direction = backward,
+        \circuitikzbasekey/bipole/current/x position = before,
+        \circuitikzbasekey/bipole/current/y position = above
+    }
 }
 
 \ctikzset{i<_/.style = {
-		i = #1,
-		\circuitikzbasekey/bipole/current/direction = backward,
-		\circuitikzbasekey/bipole/current/x position = before,
-		\circuitikzbasekey/bipole/current/y position = below
-	}
+        i = #1,
+        \circuitikzbasekey/bipole/current/direction = backward,
+        \circuitikzbasekey/bipole/current/x position = before,
+        \circuitikzbasekey/bipole/current/y position = below
+    }
 }
 
 \ctikzset{i/.code = {
-	\pgfkeys{\circuitikzbasekey/bipole/current/direction = forward,
-					\circuitikzbasekey/bipole/current/x position = after,
-					\circuitikzbasekey/bipole/current/y position = above }
-	\pgfkeys{/tikz/circuitikz/bipole/current/label/name=#1}
-	\ctikzsetvalof{bipole/current/label/unit}{}
-	\ifpgf at circ@siunitx 
-		\pgf at circ@handleSI{#1}
-		\ifpgf at circ@siunitx at res 
-			\edef\pgf at temp{\pgf at circ@handleSI at val}
-			\pgfkeyslet{/tikz/circuitikz/bipole/current/label/name}{\pgf at temp}
-			\edef\pgf at temp{\pgf at circ@handleSI at unit}
-			\pgfkeyslet{/tikz/circuitikz/bipole/current/label/unit}{\pgf at temp}
-		\else
-		\fi
-	\else
-	\fi
-%reverse current direction for voltage sources
-	\ifpgf at circ@oldvoltagedirection\else
-		\ifpgf at circuit@bipole at isvoltage
-		\ifpgf at circuit@bipole at voltage@backward
-			\pgfkeys{\circuitikzbasekey/bipole/current/direction = forward,
-					\circuitikzbasekey/bipole/current/x position = after,
-					\circuitikzbasekey/bipole/current/y position = below }
-		\else
-			\pgfkeys{\circuitikzbasekey/bipole/current/direction = backward,
-					\circuitikzbasekey/bipole/current/x position = before,
-					\circuitikzbasekey/bipole/current/y position = above }
-	\fi\fi\fi
+        \pgfkeys{\circuitikzbasekey/bipole/current/direction = forward,
+            \circuitikzbasekey/bipole/current/x position = after,
+        \circuitikzbasekey/bipole/current/y position = above }
+        \pgfkeys{/tikz/circuitikz/bipole/current/label/name=#1}
+        \ctikzsetvalof{bipole/current/label/unit}{}
+        \ifpgf at circ@siunitx
+            \pgf at circ@handleSI{#1}
+            \ifpgf at circ@siunitx at res
+                \edef\pgf at temp{\pgf at circ@handleSI at val}
+                \pgfkeyslet{/tikz/circuitikz/bipole/current/label/name}{\pgf at temp}
+                \edef\pgf at temp{\pgf at circ@handleSI at unit}
+                \pgfkeyslet{/tikz/circuitikz/bipole/current/label/unit}{\pgf at temp}
+            \else
+        \fi
+        \else
+    \fi
+    %reverse current direction for voltage sources
+    \ifpgf at circ@oldvoltagedirection\else
+        \ifpgf at circuit@bipole at isvoltage
+            \ifpgf at circuit@bipole at voltage@backward
+                \pgfkeys{\circuitikzbasekey/bipole/current/direction = forward,
+                    \circuitikzbasekey/bipole/current/x position = after,
+                \circuitikzbasekey/bipole/current/y position = below }
+            \else
+                \pgfkeys{\circuitikzbasekey/bipole/current/direction = backward,
+                    \circuitikzbasekey/bipole/current/x position = before,
+                \circuitikzbasekey/bipole/current/y position = above }
+            \fi\fi\fi
+    }
 }
-}
 
-
 \ifpgf at circ@oldvoltagedirection
-	\ctikzset{i</.style = { i = #1, \circuitikzbasekey/bipole/current/direction = backward } }
+    \ctikzset{i</.style = { i = #1, \circuitikzbasekey/bipole/current/direction = backward } }
 \else
-	\ctikzset{i</.style = { i = #1, \circuitikzbasekey/bipole/current/direction = backward, \circuitikzbasekey/bipole/current/x position = before } }
+    \ctikzset{i</.style = { i = #1, \circuitikzbasekey/bipole/current/direction = backward, \circuitikzbasekey/bipole/current/x position = before } }
 \fi
 \ctikzset{i_/.style = { i = #1, \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 } }
 
-%% Output routine 
+%% Output routine
 \def\pgf at circ@drawcurrent{
-	\pgfextra{
-		\edef\pgf at circ@ffffff{\pgf at circ@direction}
-		\def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@ffffff\pgf at nil}
+    \pgfextra{
+        \edef\pgf at circ@ffffff{\pgf at circ@direction}
+        \def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@ffffff\pgf at nil}
 
-		\ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
-			\ifpgf at circuit@bipole at current@below
-				\def\pgf at circ@dir{north west} \else \def\pgf at circ@dir{south east}
-			\fi
-		\fi\fi
-		\ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
-			\ifpgf at circuit@bipole at current@below
-				\def\pgf at circ@dir{west} \else \def\pgf at circ@dir{east} 
-			\fi
-		\fi\fi
-		\ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
-			\ifpgf at circuit@bipole at current@below
-				 \def\pgf at circ@dir{south west}\else \def\pgf at circ@dir{north east}
-			\fi
-		\fi\fi
-		\ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
-			\ifpgf at circuit@bipole at current@below
-				  \def\pgf at circ@dir{south}\else\def\pgf at circ@dir{north}
-			\fi
-		\fi\fi
-		\ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
-			\ifpgf at circuit@bipole at current@below
-				 \def\pgf at circ@dir{south east}\else\def\pgf at circ@dir{north west}
-			\fi
-		\fi\fi
-		\ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
-			\ifpgf at circuit@bipole at current@below
-				 \def\pgf at circ@dir{east}\else \def\pgf at circ@dir{west}
-			\fi
-		\fi\fi
-		\ifnum\pgfcircmathresult >274 \ifnum\pgfcircmathresult <356
-			\ifpgf at circuit@bipole at current@below
-				  \def\pgf at circ@dir{north east}\else\def\pgf at circ@dir{south west}
-			\fi
-		\fi\fi
-		\ifnum\pgfcircmathresult <5
-			\ifpgf at circuit@bipole at current@below
-				 \def\pgf at circ@dir{north}\else\def\pgf at circ@dir{south} 
-			\fi
-		\fi
-		\ifnum\pgfcircmathresult >355
-			\ifpgf at circuit@bipole at current@below
-				 \def\pgf at circ@dir{north}\else\def\pgf at circ@dir{south} 
-			\fi
-		\fi
-		
-		\ifpgf at circuit@bipole at current@below
-			\def\pgf at circ@bipole at current@label at where{-90}
-		\else
-			\def\pgf at circ@bipole at current@label at where{+90}
-		\fi
-	}
-	
-	\pgfextra{\def\pgf at temp{short}\edef\pgf at circ@temp{\ctikzvalof{bipole/kind}}}
-		\ifx\pgf at circ@temp\pgf at temp%draw current at a short at middle of the line
-				(\tikztostart)--(\tikztotarget)
-		\else% normal bipole or source
-			\ifpgf at circuit@bipole at current@before
-				 (\tikztostart)--(anchorstartnode)
-			\else
-				(anchorendnode)--(\tikztotarget)
-			\fi
-		\fi
-		\ifpgf at circuit@bipole at current@backward
-			\pgfextra{
-				\pgfmathsubtract{\pgf at circ@ffffff}{180}
-				\edef\pgf at circ@ffffff{\expandafter\pgf at circ@stripdecimals\pgfmathresult\pgf at nil}
-				}
-		\fi
-	coordinate[currarrow,pos=\ctikzvalof{current/distance},rotate=\pgf at circ@ffffff](Iarrow)
-	(Iarrow.\pgf at circ@bipole at current@label at where) node[anchor=\pgf at circ@dir]{\pgf at circ@finallabels{current/label}}
+        \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
+        \ifpgf at circuit@bipole at current@below
+            \def\pgf at circ@dir{north west} \else \def\pgf at circ@dir{south east}
+        \fi
+        \fi\fi
+        \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
+        \ifpgf at circuit@bipole at current@below
+            \def\pgf at circ@dir{west} \else \def\pgf at circ@dir{east}
+        \fi
+        \fi\fi
+        \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
+        \ifpgf at circuit@bipole at current@below
+            \def\pgf at circ@dir{south west}\else \def\pgf at circ@dir{north east}
+        \fi
+        \fi\fi
+        \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
+        \ifpgf at circuit@bipole at current@below
+            \def\pgf at circ@dir{south}\else\def\pgf at circ@dir{north}
+        \fi
+        \fi\fi
+        \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
+        \ifpgf at circuit@bipole at current@below
+            \def\pgf at circ@dir{south east}\else\def\pgf at circ@dir{north west}
+        \fi
+        \fi\fi
+        \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
+        \ifpgf at circuit@bipole at current@below
+            \def\pgf at circ@dir{east}\else \def\pgf at circ@dir{west}
+        \fi
+        \fi\fi
+        \ifnum\pgfcircmathresult >274 \ifnum\pgfcircmathresult <356
+        \ifpgf at circuit@bipole at current@below
+            \def\pgf at circ@dir{north east}\else\def\pgf at circ@dir{south west}
+        \fi
+        \fi\fi
+        \ifnum\pgfcircmathresult <5
+        \ifpgf at circuit@bipole at current@below
+            \def\pgf at circ@dir{north}\else\def\pgf at circ@dir{south}
+        \fi
+        \fi
+        \ifnum\pgfcircmathresult >355
+        \ifpgf at circuit@bipole at current@below
+            \def\pgf at circ@dir{north}\else\def\pgf at circ@dir{south}
+        \fi
+    \fi
+
+    \ifpgf at circuit@bipole at current@below
+        \def\pgf at circ@bipole at current@label at where{-90}
+    \else
+        \def\pgf at circ@bipole at current@label at where{+90}
+    \fi
+    }
+
+    \pgfextra{\def\pgf at temp{short}\edef\pgf at circ@temp{\ctikzvalof{bipole/kind}}}
+    \ifx\pgf at circ@temp\pgf at temp%draw current at a short at middle of the line
+        (\tikztostart)--(\tikztotarget)
+    \else% normal bipole or source
+        \ifpgf at circuit@bipole at current@before
+            (\tikztostart)--(anchorstartnode)
+        \else
+            (anchorendnode)--(\tikztotarget)
+        \fi
+    \fi
+    \ifpgf at circuit@bipole at current@backward
+        \pgfextra{
+            \pgfmathsubtract{\pgf at circ@ffffff}{180}
+            \edef\pgf at circ@ffffff{\expandafter\pgf at circ@stripdecimals\pgfmathresult\pgf at nil}
+        }
+    \fi
+    coordinate[currarrow,pos=\ctikzvalof{current/distance},rotate=\pgf at circ@ffffff](Iarrow)
+    (Iarrow.\pgf at circ@bipole at current@label at where) node[anchor=\pgf at circ@dir]{\pgf at circ@finallabels{current/label}}
 }
 
-\endinput
\ No newline at end of file
+\endinput

Modified: trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircflow.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircflow.tex	2019-05-10 21:14:43 UTC (rev 51070)
+++ trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircflow.tex	2019-05-10 21:15:08 UTC (rev 51071)
@@ -5,7 +5,7 @@
 % 1. under the LaTeX Project Public License and/or
 % 2. under the GNU Public License.
 %
-% See the file doc/LICENSE for more details.
+% See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %% flow handling
@@ -12,67 +12,67 @@
 
 %% Options
 \ctikzset{f^>/.style = {
-		f = #1,
-		\circuitikzbasekey/bipole/flow/direction = forward,
-		\circuitikzbasekey/bipole/flow/x position = after,
-		\circuitikzbasekey/bipole/curflowrent/y position = above
-	}
+        f = #1,
+        \circuitikzbasekey/bipole/flow/direction = forward,
+        \circuitikzbasekey/bipole/flow/x position = after,
+        \circuitikzbasekey/bipole/curflowrent/y position = above
+    }
 }
 
 \ctikzset{f_>/.style = {
-		f = #1,
-		\circuitikzbasekey/bipole/flow/direction = forward,
-		\circuitikzbasekey/bipole/flow/x position = after,
-		\circuitikzbasekey/bipole/flow/y position = below
-	}
+        f = #1,
+        \circuitikzbasekey/bipole/flow/direction = forward,
+        \circuitikzbasekey/bipole/flow/x position = after,
+        \circuitikzbasekey/bipole/flow/y position = below
+    }
 }
 
 \ctikzset{f>^/.style = {
-		f = #1,
-		\circuitikzbasekey/bipole/flow/direction = forward,
-		\circuitikzbasekey/bipole/flow/x position = before,
-		\circuitikzbasekey/bipole/flow/y position = above
-	}
+        f = #1,
+        \circuitikzbasekey/bipole/flow/direction = forward,
+        \circuitikzbasekey/bipole/flow/x position = before,
+        \circuitikzbasekey/bipole/flow/y position = above
+    }
 }
 
 \ctikzset{f>_/.style = {
-		f = #1,
-		\circuitikzbasekey/bipole/flow/direction = forward,
-		\circuitikzbasekey/bipole/flow/x position = before,
-		\circuitikzbasekey/bipole/flow/y position = below
-	}
+        f = #1,
+        \circuitikzbasekey/bipole/flow/direction = forward,
+        \circuitikzbasekey/bipole/flow/x position = before,
+        \circuitikzbasekey/bipole/flow/y position = below
+    }
 }
 
 \ctikzset{f^</.style = {
-		f = #1,
-		\circuitikzbasekey/bipole/flow/direction = backward,
-		\circuitikzbasekey/bipole/flow/x position = after,
-		\circuitikzbasekey/bipole/flow/y position = above
-	}
+        f = #1,
+        \circuitikzbasekey/bipole/flow/direction = backward,
+        \circuitikzbasekey/bipole/flow/x position = after,
+        \circuitikzbasekey/bipole/flow/y position = above
+    }
 }
 
 \ctikzset{f_</.style = {
-		f = #1,
-		\circuitikzbasekey/bipole/flow/direction = backward,
-		\circuitikzbasekey/bipole/flow/x position = after,
-		\circuitikzbasekey/bipole/flow/y position = below
-	}
+        f = #1,
+        \circuitikzbasekey/bipole/flow/direction = backward,
+        \circuitikzbasekey/bipole/flow/x position = after,
+        \circuitikzbasekey/bipole/flow/y position = below
+    }
 }
 
 \ctikzset{f<^/.style = {
-		f = #1,
-		\circuitikzbasekey/bipole/flow/direction = backward,
-		\circuitikzbasekey/bipole/flow/x position = before,
-		\circuitikzbasekey/bipole/flow/y position = above
-	}
+        f = #1,
+        \circuitikzbasekey/bipole/flow/direction = backward,
+        \circuitikzbasekey/bipole/flow/x position = before,
+        \circuitikzbasekey/bipole/flow/y position = above
+    }
 }
 
 \ctikzset{f<_/.style = {
-		f = #1,
-		\circuitikzbasekey/bipole/flow/direction = backward,
-		\circuitikzbasekey/bipole/flow/x position = before,
-		\circuitikzbasekey/bipole/flow/y position = below
-	}
+        f = #1,
+        \circuitikzbasekey/bipole/flow/direction = backward,
+        \circuitikzbasekey/bipole/flow/x position = before,
+        \circuitikzbasekey/bipole/flow/y position = below
+    }
 }
 
 \ctikzset{f</.style = { f = #1, \circuitikzbasekey/bipole/flow/direction = backward} }
@@ -81,113 +81,113 @@
 \ctikzset{f^/.style = { f = #1, \circuitikzbasekey/bipole/flow/y position = above } }
 
 \ctikzset{f/.code = {
-	\pgfkeys{\circuitikzbasekey/bipole/flow/direction = forward,
-					\circuitikzbasekey/bipole/flow/x position = after,
-					\circuitikzbasekey/bipole/flow/y position = above }
-	\pgfkeys{/tikz/circuitikz/bipole/flow/label/name=#1}
-	\ctikzsetvalof{bipole/flow/label/unit}{}
-	\ifpgf at circ@siunitx 
-		\pgf at circ@handleSI{#1}
-		\ifpgf at circ@siunitx at res 
-			\edef\pgf at temp{\pgf at circ@handleSI at val}
-			\pgfkeyslet{/tikz/circuitikz/bipole/flow/label/name}{\pgf at temp}
-			\edef\pgf at temp{\pgf at circ@handleSI at unit}
-			\pgfkeyslet{/tikz/circuitikz/bipole/flow/label/unit}{\pgf at temp}
-		\else
-		\fi
-	\else
-	\fi
+        \pgfkeys{\circuitikzbasekey/bipole/flow/direction = forward,
+            \circuitikzbasekey/bipole/flow/x position = after,
+        \circuitikzbasekey/bipole/flow/y position = above }
+        \pgfkeys{/tikz/circuitikz/bipole/flow/label/name=#1}
+        \ctikzsetvalof{bipole/flow/label/unit}{}
+        \ifpgf at circ@siunitx
+            \pgf at circ@handleSI{#1}
+            \ifpgf at circ@siunitx at res
+                \edef\pgf at temp{\pgf at circ@handleSI at val}
+                \pgfkeyslet{/tikz/circuitikz/bipole/flow/label/name}{\pgf at temp}
+                \edef\pgf at temp{\pgf at circ@handleSI at unit}
+                \pgfkeyslet{/tikz/circuitikz/bipole/flow/label/unit}{\pgf at temp}
+            \else
+        \fi
+        \else
+    \fi
 }
 }
 
-%% Output routine 
+%% Output routine
 \def\pgf at circ@drawflow{
-	\pgfextra{
-		\edef\pgf at circ@ffffff{\pgf at circ@direction}
-		\def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@ffffff\pgf at nil}
+    \pgfextra{
+        \edef\pgf at circ@ffffff{\pgf at circ@direction}
+        \def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@ffffff\pgf at nil}
 
-		\ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
-			\ifpgf at circuit@bipole at flow@below
-				\def\pgf at circ@dir{north west} \else \def\pgf at circ@dir{south east}
-			\fi
-		\fi\fi
-		\ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
-			\ifpgf at circuit@bipole at flow@below
-				\def\pgf at circ@dir{west} \else \def\pgf at circ@dir{east} 
-			\fi
-		\fi\fi
-		\ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
-			\ifpgf at circuit@bipole at flow@below
-				 \def\pgf at circ@dir{south west}\else \def\pgf at circ@dir{north east}
-			\fi
-		\fi\fi
-		\ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
-			\ifpgf at circuit@bipole at flow@below
-				  \def\pgf at circ@dir{south}\else\def\pgf at circ@dir{north}
-			\fi
-		\fi\fi
-		\ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
-			\ifpgf at circuit@bipole at flow@below
-				 \def\pgf at circ@dir{south east}\else\def\pgf at circ@dir{north west}
-			\fi
-		\fi\fi
-		\ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
-			\ifpgf at circuit@bipole at flow@below
-				 \def\pgf at circ@dir{east}\else \def\pgf at circ@dir{west}
-			\fi
-		\fi\fi
-		\ifnum\pgfcircmathresult >274 \ifnum\pgfcircmathresult <356
-			\ifpgf at circuit@bipole at flow@below
-				  \def\pgf at circ@dir{north east}\else\def\pgf at circ@dir{south west}
-			\fi
-		\fi\fi
-		\ifnum\pgfcircmathresult <5
-			\ifpgf at circuit@bipole at flow@below
-				 \def\pgf at circ@dir{north}\else\def\pgf at circ@dir{south} 
-			\fi
-		\fi
-		\ifnum\pgfcircmathresult >355
-			\ifpgf at circuit@bipole at flow@below
-				 \def\pgf at circ@dir{north}\else\def\pgf at circ@dir{south} 
-			\fi
-		\fi
-		
-		\ifpgf at circuit@bipole at flow@below
-			\def\pgf at circ@bipole at flow@label at where{-90}
-		\else
-			\def\pgf at circ@bipole at flow@label at where{+90}
-		\fi
-	}
-	
-	\pgfextra{\def\pgf at temp{short}\edef\pgf at circ@temp{\ctikzvalof{bipole/kind}}}
-		\ifx\pgf at circ@temp\pgf at temp%draw flow at a short at middle of the line
-				(\tikztostart)--(\tikztotarget)
-		\else% normal bipole or source
-			\ifpgf at circuit@bipole at flow@before
-				 (\tikztostart)--(anchorstartnode)
-			\else
-				(anchorendnode)--(\tikztotarget)
-			\fi
-		\fi
-	\pgfextra{
-		\ifpgf at circuit@bipole at flow@backward
-			\ifpgf at circuit@bipole at flow@below
-				\def\flow at offset{\ctikzvalof{flow/offset}\pgf at circ@Rlen}
-			\else
-				\def\flow at offset{-\ctikzvalof{flow/offset}\pgf at circ@Rlen}
-			\fi
-			\pgfmathsubtract{\pgf at circ@ffffff}{180}
-			\edef\pgf at circ@ffffff{\expandafter\pgf at circ@stripdecimals\pgfmathresult\pgf at nil}	
-		\else
-			\ifpgf at circuit@bipole at flow@below
-				\def\flow at offset{-\ctikzvalof{flow/offset}\pgf at circ@Rlen}
-			\else
-				\def\flow at offset{\ctikzvalof{flow/offset}\pgf at circ@Rlen}
-			\fi
-		\fi
-	}
-	coordinate[flowarrow,pos=\ctikzvalof{flow/distance},rotate=\pgf at circ@ffffff,yshift=\flow at offset](Farrowpos)
-	(Farrowpos.\pgf at circ@bipole at flow@label at where) node[anchor=\pgf at circ@dir]{ \pgf at circ@finallabels{flow/label}}
+        \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
+                \ifpgf at circuit@bipole at flow@below
+                        \def\pgf at circ@dir{north west} \else \def\pgf at circ@dir{south east}
+                \fi
+        \fi\fi
+        \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
+                \ifpgf at circuit@bipole at flow@below
+                        \def\pgf at circ@dir{west} \else \def\pgf at circ@dir{east}
+                \fi
+        \fi\fi
+        \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
+                \ifpgf at circuit@bipole at flow@below
+                         \def\pgf at circ@dir{south west}\else \def\pgf at circ@dir{north east}
+                \fi
+        \fi\fi
+        \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
+                \ifpgf at circuit@bipole at flow@below
+                          \def\pgf at circ@dir{south}\else\def\pgf at circ@dir{north}
+                \fi
+        \fi\fi
+        \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
+                \ifpgf at circuit@bipole at flow@below
+                         \def\pgf at circ@dir{south east}\else\def\pgf at circ@dir{north west}
+                \fi
+        \fi\fi
+        \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
+                \ifpgf at circuit@bipole at flow@below
+                         \def\pgf at circ@dir{east}\else \def\pgf at circ@dir{west}
+                \fi
+        \fi\fi
+        \ifnum\pgfcircmathresult >274 \ifnum\pgfcircmathresult <356
+                \ifpgf at circuit@bipole at flow@below
+                          \def\pgf at circ@dir{north east}\else\def\pgf at circ@dir{south west}
+                \fi
+        \fi\fi
+        \ifnum\pgfcircmathresult <5
+                \ifpgf at circuit@bipole at flow@below
+                         \def\pgf at circ@dir{north}\else\def\pgf at circ@dir{south}
+                \fi
+        \fi
+        \ifnum\pgfcircmathresult >355
+                \ifpgf at circuit@bipole at flow@below
+                         \def\pgf at circ@dir{north}\else\def\pgf at circ@dir{south}
+                \fi
+        \fi
+
+        \ifpgf at circuit@bipole at flow@below
+                \def\pgf at circ@bipole at flow@label at where{-90}
+        \else
+                \def\pgf at circ@bipole at flow@label at where{+90}
+        \fi
+    }
+
+    \pgfextra{\def\pgf at temp{short}\edef\pgf at circ@temp{\ctikzvalof{bipole/kind}}}
+    \ifx\pgf at circ@temp\pgf at temp%draw flow at a short at middle of the line
+        (\tikztostart)--(\tikztotarget)
+    \else% normal bipole or source
+        \ifpgf at circuit@bipole at flow@before
+            (\tikztostart)--(anchorstartnode)
+        \else
+            (anchorendnode)--(\tikztotarget)
+        \fi
+    \fi
+    \pgfextra{
+        \ifpgf at circuit@bipole at flow@backward
+            \ifpgf at circuit@bipole at flow@below
+                \def\flow at offset{\ctikzvalof{flow/offset}\pgf at circ@Rlen}
+            \else
+                \def\flow at offset{-\ctikzvalof{flow/offset}\pgf at circ@Rlen}
+            \fi
+            \pgfmathsubtract{\pgf at circ@ffffff}{180}
+            \edef\pgf at circ@ffffff{\expandafter\pgf at circ@stripdecimals\pgfmathresult\pgf at nil}
+            \else
+            \ifpgf at circuit@bipole at flow@below
+                \def\flow at offset{-\ctikzvalof{flow/offset}\pgf at circ@Rlen}
+            \else
+                \def\flow at offset{\ctikzvalof{flow/offset}\pgf at circ@Rlen}
+            \fi
+        \fi
+    }
+    coordinate[flowarrow,pos=\ctikzvalof{flow/distance},rotate=\pgf at circ@ffffff,yshift=\flow at offset](Farrowpos)
+    (Farrowpos.\pgf at circ@bipole at flow@label at where) node[anchor=\pgf at circ@dir]{ \pgf at circ@finallabels{flow/label}}
 }
 
 \endinput

Modified: trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcirclabel.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcirclabel.tex	2019-05-10 21:14:43 UTC (rev 51070)
+++ trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcirclabel.tex	2019-05-10 21:15:08 UTC (rev 51071)
@@ -5,7 +5,7 @@
 % 1. under the LaTeX Project Public License and/or
 % 2. under the GNU Public License.
 %
-% See the file doc/LICENSE for more details.
+% See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %% Bipole label positioning
@@ -12,217 +12,323 @@
 
 %% Options
 \ctikzset{label/.style = { l=#1 } }
-\ctikzset{l/.code = { 
-	\pgfkeys{/tikz/circuitikz/bipole/label/name=#1}
-	\ctikzsetvalof{bipole/label/unit}{}
-	\ifpgf at circ@siunitx 
-		\pgf at circ@handleSI{#1}
-		\ifpgf at circ@siunitx at res 
-			\edef\pgf at temp{\pgf at circ@handleSI at val}
-			\pgfkeyslet{/tikz/circuitikz/bipole/label/name}{\pgf at temp}
-			\edef\pgf at temp{\pgf at circ@handleSI at unit}
-			\pgfkeyslet{/tikz/circuitikz/bipole/label/unit}{\pgf at temp}
-		\else
-		\fi
-	\else
-	\fi
+\ctikzset{l/.code = {
+        \pgfkeys{/tikz/circuitikz/bipole/label/name=#1}
+        \ctikzsetvalof{bipole/label/unit}{}
+        \ifpgf at circ@siunitx
+            \pgf at circ@handleSI{#1}
+            \ifpgf at circ@siunitx at res
+                \edef\pgf at temp{\pgf at circ@handleSI at val}
+                \pgfkeyslet{/tikz/circuitikz/bipole/label/name}{\pgf at temp}
+                \edef\pgf at temp{\pgf at circ@handleSI at unit}
+                \pgfkeyslet{/tikz/circuitikz/bipole/label/unit}{\pgf at temp}
+            \else
+        \fi
+        \else
+    \fi
 }}
 
-\ctikzset{label above/.code = { 
-		l=#1, 
-		\circuitikzbasekey/bipole/label/position=90 }
+\ctikzset{label above/.code = {
+        l=#1,
+    \circuitikzbasekey/bipole/label/position=90 }
 }
 
-\ctikzset{l^/.style = { 
-		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{label below/.code = {
+        l=#1,
+    \circuitikzbasekey/bipole/label/position=-90 }
 }
 
-\ctikzset{l_/.style = { 
-		l=#1,
-		\circuitikzbasekey/bipole/label/position=-90 } 
+\ctikzset{l_/.style = {
+        l=#1,
+    \circuitikzbasekey/bipole/label/position=-90 }
 }
 
 \ctikzset{annotation/.style = { a=#1 } }
 \ctikzset{a/.code = {
-		\pgfkeys{/tikz/circuitikz/bipole/annotation/name=#1}
-		\ctikzsetvalof{bipole/annotation/unit}{}
-		\ifpgf at circ@siunitx
-		\pgf at circ@handleSI{#1}
-		\ifpgf at circ@siunitx at res
-		\edef\pgf at temp{\pgf at circ@handleSI at val}
-		\pgfkeyslet{/tikz/circuitikz/bipole/annotation/name}{\pgf at temp}
-		\edef\pgf at temp{\pgf at circ@handleSI at unit}
-		\pgfkeyslet{/tikz/circuitikz/bipole/annotation/unit}{\pgf at temp}
-		\else
-		\fi
-		\else
-		\fi
-	}}
+    \pgfkeys{/tikz/circuitikz/bipole/annotation/name=#1}
+    \ctikzsetvalof{bipole/annotation/unit}{}
+    \ifpgf at circ@siunitx
+        \pgf at circ@handleSI{#1}
+        \ifpgf at circ@siunitx at res
+            \edef\pgf at temp{\pgf at circ@handleSI at val}
+            \pgfkeyslet{/tikz/circuitikz/bipole/annotation/name}{\pgf at temp}
+            \edef\pgf at temp{\pgf at circ@handleSI at unit}
+            \pgfkeyslet{/tikz/circuitikz/bipole/annotation/unit}{\pgf at temp}
+        \else
+        \fi
+    \else
+    \fi
+}}
 
-\ctikzset{annotation above/.code = { 
-	a=#1, 
-	\circuitikzbasekey/bipole/annotation/position=90 }
+\ctikzset{annotation above/.code = {
+        a=#1,
+    \circuitikzbasekey/bipole/annotation/position=90 }
 }
 
-\ctikzset{a^/.style = { 
-	a=#1,
-	\circuitikzbasekey/bipole/annotation/position=90 } 
+\ctikzset{a^/.style = {
+        a=#1,
+    \circuitikzbasekey/bipole/annotation/position=90 }
 }
 
-\ctikzset{annotation below/.code = { 
-	a=#1,
-	\circuitikzbasekey/bipole/annotation/position=-90 } 
+\ctikzset{annotation below/.code = {
+        a=#1,
+    \circuitikzbasekey/bipole/annotation/position=-90 }
 }
-\ctikzset{a_/.style = { 
-	a=#1,
-	\circuitikzbasekey/bipole/annotation/position=-90 } 
+\ctikzset{a_/.style = {
+        a=#1,
+    \circuitikzbasekey/bipole/annotation/position=-90 }
 }
 
+% This is to adjust spacing for the labels so that they are not cramped on components
+\def\pgf at circ@ls{.75ex} % labelspace to have just one point to change
 
+\def\pgf at circ@drawlabels#1{
+    \pgfextra{
+        % This function will be called with argument #1 equal
+        % to "label" or "annotation" form pgfcircpath.tex.
+        % pgf at circ@direction is the direction of the path,
+        % its value is set in pgfcircpath.tex
+        \pgfmathsubtract{\pgf at circ@direction}{90}
+        \pgfmathround{\pgfmathresult} % avoid precision loss errors
+        \edef\pgf at circ@labanc{\expandafter\pgf at circ@stripdecimals\pgfmathresult\pgf at nil}
 
-\def\pgf at circ@drawlabels#1{
-	\pgfextra{
-		\pgfmathsubtract{\pgf at circ@direction}{90}
-		\edef\pgf at circ@labanc{\expandafter\pgf at circ@stripdecimals\pgfmathresult\pgf at nil}
-		
-		\edef\pgf at circ@temp{\ctikzvalof{bipole/#1/position}} 
-		\ifnum \pgf at circ@temp < 0
-			\pgfmathadd{\pgf at circ@labanc}{180}
-			\edef\pgf at circ@labanc{\expandafter\pgf at circ@stripdecimals\pgfmathresult\pgf at nil}
-		\fi
-		\ifpgf at circuit@bipole at inverted
-			\pgfmathadd{\pgf at circ@temp}{180} %If shape is inverted, use opposite anchor
-			\edef\pgf at circ@temp{\expandafter\pgf at circ@stripdecimals\pgfmathresult\pgf at nil}
-		\fi
-		
-		\ifnum \ctikzvalof{mirror value} = -1
-			\pgfmathadd{\pgf at circ@temp}{180} %If shape is mirrored, use opposite anchor
-			\edef\pgf at circ@temp{\expandafter\pgf at circ@stripdecimals\pgfmathresult\pgf at nil}
-		\fi
-	}
-		%Firstly, place a coodinate directly at the edge of the shape
-		(\ctikzvalof{bipole/name}.\pgf at circ@temp) coordinate (labelcoor)
-		%now decide, which labels should be drawn
-		\pgfextra{
-			\edef\pgf at temp{\ctikzvalof{label/align}}
-			\def\pgf at circ@temp{straight}
-		}
-		\ifx\pgf at temp\pgf at circ@temp %straight
-			\pgf at circ@drawreglabels{#1}
-		\else
-			\pgfextra{\def\pgf at circ@temp{rotate}}
-			\ifx\pgf at temp\pgf at circ@temp %rotate
-				\pgf at circ@drawrotlabels{#1}
-			\else% smart
-				\pgf at circ@drawsmartlabels{#1}
-			\fi
-		\fi
+        \edef\pgf at circ@temp{\ctikzvalof{bipole/#1/position}}
+        \ifnum \pgf at circ@temp < 0
+                \pgfmathadd{\pgf at circ@labanc}{180}
+                \edef\pgf at circ@labanc{\expandafter\pgf at circ@stripdecimals\pgfmathresult\pgf at nil}
+        \fi
+        \ifpgf at circuit@bipole at inverted
+                \pgfmathadd{\pgf at circ@temp}{180} %If shape is inverted, use opposite anchor
+                \edef\pgf at circ@temp{\expandafter\pgf at circ@stripdecimals\pgfmathresult\pgf at nil}
+        \fi
+
+        \ifnum \ctikzvalof{mirror value} = -1
+                \pgfmathadd{\pgf at circ@temp}{180} %If shape is mirrored, use opposite anchor
+                \edef\pgf at circ@temp{\expandafter\pgf at circ@stripdecimals\pgfmathresult\pgf at nil}
+        \fi
+    }
+    %Firstly, place a coordinate directly at the edge of the shape
+    (\ctikzvalof{bipole/name}.\pgf at circ@temp) coordinate (labelcoor)
+    %now decide, which labels should be drawn
+    \pgfextra{
+            \edef\pgf at temp{\ctikzvalof{label/align}}
+            \def\pgf at circ@temp{straight}
+    }
+    \ifx\pgf at temp\pgf at circ@temp %straight
+            \pgf at circ@drawreglabels{#1}
+    \else
+            \pgfextra{\def\pgf at circ@temp{rotate}}
+            \ifx\pgf at temp\pgf at circ@temp %rotate
+                    \pgf at circ@drawrotlabels{#1}
+            \else% smart
+                    \pgf at circ@drawsmartlabels{#1}
+            \fi
+    \fi
 }
 
 
 \def\pgf at circ@drawsmartlabels#1{
-	\pgfextra{
-		\pgfmathmod{\pgf at circ@direction}{90}
-		\edef\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgfmathresult\pgf at nil}
-	}
-	\ifnum \pgfcircmathresult > 20	
-		\ifnum \pgfcircmathresult < 70
-			\pgf at circ@drawrotlabels{#1}
-		\else
-			\pgf at circ@drawreglabels{#1}
-		\fi
-	\else
-		\pgf at circ@drawreglabels{#1}
-	\fi
-}
+    \pgfextra{
+        \pgfmathmod{\pgf at circ@direction}{90}
+        \edef\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgfmathresult\pgf at nil}
+    }
+    \ifnum \pgfcircmathresult > 20
+    \ifnum \pgfcircmathresult < 70
+        \pgf at circ@drawrotlabels{#1}
+    \else
+        \pgf at circ@drawreglabels{#1}
+    \fi
+    \else
+        \pgf at circ@drawreglabels{#1}
+    \fi
+    }
 
 
 \def\pgf at circ@drawrotlabels#1{
-	\pgfextra{
-		\ifnum \ctikzvalof{bipole/#1/position}>0
-		%we need some more space for placement below, due to mid-anchor
-			\def\pgf at circ@labposdistance{1.5ex}
-			\else
-			\def\pgf at circ@labposdistance{2ex}
-		\fi
-		%Calculate rotation of the label from direction and strip decimals
-		\edef\pgfcirclabrot{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at nil}
-		% rotate the label at second or third quadrant:
-		\ifnum \pgfcirclabrot > 90 \ifnum \pgfcirclabrot < 270
-			\pgfmathsubtract{\pgf at circ@direction}{180}
-			\edef\pgfcirclabrot{\expandafter\pgf at circ@stripdecimals\pgfmathresult\pgf at nil}
-			%invert the space relationships due to rotatet strings
-			\ifnum \ctikzvalof{bipole/#1/position}>0
-				\def\pgf at circ@labposdistance{2ex}
-			\else
-				\def\pgf at circ@labposdistance{1.5ex}
-			\fi
-		\fi\fi
-		\pgfmathparse{\ctikzvalof{bipole/#1/position}>0?\pgf at circ@direction+90:\pgf at circ@direction-90}
-		\edef\pgf at circ@labposangle{\expandafter\pgf at circ@stripdecimals\pgfmathresult\pgf at nil}
-	}				
-	(labelcoor)++(\pgf at circ@labposangle:\pgf at circ@labposdistance) coordinate(labelcoor)
-	node[anchor=mid,rotate=\pgfcirclabrot](\ctikzvalof{bipole/name}#1){\pgf at circ@finallabels{#1}}
+    \pgfextra{
+        % scale the distances in function of zoom, so that they are not
+        % dependent on it but on font size. Thanks to @marmot
+        % https://tex.stackexchange.com/a/476018/38080
+        % the coeffcient is adjusted so that the distance is more or less
+        % the same for rotated labels and straight ones (although it will
+        % depend on the font, so it's not exact).
+        \pgfgettransformentries{\tmp}{\tmp}{\tmp}{\myscale}{\tmp}{\tmp}
+        \pgfmathsetlength\pgf at circ@res at temp{1.5*\pgf at circ@ls/\myscale}
+        \ifnum \ctikzvalof{bipole/#1/position}>0
+        %we need some more space for placement below, due to mid-anchor
+            \else % we do not have <= in \ifnum...
+                \pgf at circ@res at temp=1.5\pgf at circ@res at temp
+        \fi
+        %Calculate rotation of the label from direction and strip decimals
+        \edef\pgfcirclabrot{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at nil}
+        % rotate the label at second or third quadrant:
+        \ifnum \pgfcirclabrot > 90 \ifnum \pgfcirclabrot < 270
+                \pgfmathsubtract{\pgf at circ@direction}{180}
+                \edef\pgfcirclabrot{\expandafter\pgf at circ@stripdecimals\pgfmathresult\pgf at nil}
+                %invert the space relationships due to rotated strings
+                \ifnum \ctikzvalof{bipole/#1/position}>0
+                        \pgf at circ@res at temp=1.5\pgf at circ@res at temp
+                \fi
+        \fi\fi
+        \pgfmathparse{\ctikzvalof{bipole/#1/position}>0?\pgf at circ@direction+90:\pgf at circ@direction-90}
+        \edef\pgf at circ@labposangle{\expandafter\pgf at circ@stripdecimals\pgfmathresult\pgf at nil}
+    }
+    % reset cm is not working correctly here
+    (labelcoor)++(\pgf at circ@labposangle:\the\pgf at circ@res at temp) coordinate(labelcoor)
+    node[anchor=mid, rotate=\pgfcirclabrot](\ctikzvalof{bipole/name}#1){\pgf at circ@finallabels{#1}}
 }
 
 \def\pgf at circ@drawreglabels#1{
-
-	%Now calculate all shape positions
-	%Use mid-anchor at x-axis and base-anchor at y-axis, respectively.
-	%All points between will be addressed by angled-anchors:
-	\pgfextra{
-		\pgfmathadd{\pgf at circ@labanc}{90}
-		\edef\pgf at circ@temp{\expandafter\pgf at circ@stripdecimals\pgfmathresult\pgf at nil}
-		\pgfmathparse{mod(\pgf at circ@temp,180)>135?mod(\pgf at circ@temp,180)-180:mod(\pgf at circ@temp,180)}
-		\edef\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgfmathresult\pgf at nil}
-	}
-	%Values between -5 and 5 are at pos /neg x-axis, values around 90 are at both y-axis
-	\ifnum \pgfcircmathresult > 84 \ifnum \pgfcircmathresult< 96
-		\pgfextra{\edef\pgf at circ@labpos{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at nil}}
-		\ifnum \pgf at circ@labpos > 180
-			\ifnum \ctikzvalof{bipole/#1/position} > 0
-				\pgfextra{\def\pgf at circ@labanc{mid west}}
-			\else
-				\pgfextra{\def\pgf at circ@labanc{mid east}}
-			\fi
-		\else
-			\ifnum \ctikzvalof{bipole/#1/position} > 0
-				\pgfextra{\def\pgf at circ@labanc{mid east}}
-			\else
-				\pgfextra{\def\pgf at circ@labanc{mid west}}
-			\fi
-		\fi
-	\fi\fi
-	\ifnum \pgfcircmathresult <6
-		\ifnum \ctikzvalof{bipole/#1/position} < 0
-			%we need some more space for placement below, due to mid-anchor
-			(labelcoor)++(-\pgf at circ@labanc:2ex) coordinate(labelcoor)
-		\else
-			(labelcoor)++(-\pgf at circ@labanc:1.5ex) coordinate(labelcoor)
-		\fi
-		\pgfextra{\def\pgf at circ@labanc{mid}}
-	\fi
-	 (labelcoor) node[anchor=\pgf at circ@labanc](\ctikzvalof{bipole/name}#1){\pgf at circ@finallabels{#1}}
+    %Now calculate all shape positions
+    %Use mid-anchor at x-axis and base-anchor at y-axis, respectively.
+    %All points between will be addressed by angled-anchors:
+    \pgfextra{
+        % scale ex-distance to make it independent on scale
+        % thanks @marmot see https://tex.stackexchange.com/a/476018/38080
+        \pgfgettransformentries{\tmp}{\tmp}{\tmp}{\myscale}{\tmp}{\tmp}
+        \pgfmathsetlength\pgf at circ@res at temp{\pgf at circ@ls/\myscale}
+        \pgfmathadd{\pgf at circ@labanc}{90}
+        \pgfmathround{\pgfmathresult}
+        \def\pgf at circ@labanctext{\pgf at circ@labanc}
+        \edef\pgf at circ@temp{\expandafter\pgf at circ@stripdecimals\pgfmathresult\pgf at nil}
+        \pgfmathparse{mod(\pgf at circ@temp,180)>135?mod(\pgf at circ@temp,180)-180:mod(\pgf at circ@temp,180)}
+        \edef\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgfmathresult\pgf at nil}
+    }
+    %Values around 90 are at both y-axis
+    \ifnum \pgfcircmathresult > 84 \ifnum \pgfcircmathresult< 96
+        \pgfextra{\edef\pgf at circ@labpos{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at nil}}
+        \ifnum \pgf at circ@labpos > 180
+            \ifnum \ctikzvalof{bipole/#1/position} > 0
+                    \pgfextra{\def\pgf at circ@labanctext{mid west}}
+            \else
+                    \pgfextra{\def\pgf at circ@labanctext{mid east}}
+            \fi
+        \else
+            \ifnum \ctikzvalof{bipole/#1/position} > 0
+                    \pgfextra{\def\pgf at circ@labanctext{mid east}}
+            \else
+                    \pgfextra{\def\pgf at circ@labanctext{mid west}}
+            \fi
+        \fi
+    \fi\fi
+    %Values between -5 and 5 are at pos /neg x-axis
+    \pgfextra{\def\uffa{}\newdimen\realshift\realshift=\dimexpr1pt\relax}
+        \ifnum \pgfcircmathresult <6 \ifnum \pgfcircmathresult > -6
+            \ifnum \ctikzvalof{bipole/#1/position} < 0
+                \ifnum \pgf at circ@labanc > 90
+                    % using base coordinate instead of south to naturally align
+                    % symbols with descendants; but this invalidate the effect of
+                    % the inner sep, so recover it by shifting the anchor
+                    % reset cm is not working sometime, use @marmot solution
+                    % see https://tex.stackexchange.com/a/476018/38080
+                    (labelcoor) ++(-\pgf at circ@labanc:\pgf at circ@res at temp) coordinate(labelcoor)
+                    \pgfextra{\def\pgf at circ@labanctext{base}}%base
+                \else
+                    \pgfextra{\def\pgf at circ@labanctext{north}}%north
+                \fi
+             \else
+                \ifnum \pgf at circ@labanc < 90
+                    % shift, as above
+                    (labelcoor) ++(-\pgf at circ@labanc:\pgf at circ@res at temp) coordinate(labelcoor)
+                    \pgfextra{\def\pgf at circ@labanctext{base}}%base
+                \else
+                    \ifnum \pgf at circ@labanc > 180
+                        % this shouldn't  happen, but somehow it does (270 degree anchors)
+                        % shift, as above
+                        (labelcoor) ++(-\pgf at circ@labanc:\pgf at circ@res at temp) coordinate(labelcoor)
+                         \pgfextra{\def\pgf at circ@labanctext{base}}%base
+                    \else
+                      \pgfextra{\def\pgf at circ@labanctext{north}}%north
+                   \fi
+                \fi
+            \fi
+        \fi\fi
+    (labelcoor) node[anchor=\pgf at circ@labanctext,
+        inner sep=0.5\pgf at circ@res at temp, outer sep=0pt,
+        ](\ctikzvalof{bipole/name}#1){\strut\pgf at circ@finallabels{#1}%
+    }
 }
 
 \def\pgf at circ@finallabels#1{%
-	\edef\pgf at temp{}%
-	\edef\pgf at circ@temp{\ctikzvalof{bipole/#1/unit}}%
-	\ifx\pgf at temp\pgf at circ@temp%
-	\ctikzvalof{bipole/#1/name}%
-	\else%
-	$\SI{\ctikzvalof{bipole/#1/name}}{\ctikzvalof{bipole/#1/unit}}$%
-	\fi%
+    \edef\pgf at temp{}%
+    \edef\pgf at circ@temp{\ctikzvalof{bipole/#1/unit}}%
+    \ifx\pgf at temp\pgf at circ@temp%
+        \ctikzvalof{bipole/#1/name}%
+    \else%
+        $\SI{\ctikzvalof{bipole/#1/name}}{\ctikzvalof{bipole/#1/unit}}$%
+    \fi%
 }
 
 \ctikzset{text/.style = { t=#1 } }
-\ctikzset{t/.code = { 
-	\ctikzsetvalof{bipoles/twoport/text}{#1}
+\ctikzset{t/.code = {
+        \ctikzsetvalof{bipoles/twoport/text}{#1}
 }}
-\endinput
\ No newline at end of file
+
+%%%% Stacked labels
+%
+% stacked labels by Romano Giannetti romano at rgtti.com
+% heavily based on Claudo Fiandrinos's https://tex.stackexchange.com/a/65792/38080
+% \expandafter trick inspired by Matthew Leingang's https://tex.stackexchange.com/a/12272/38080
+%
+% labels are in a tabular, globally aligned:
+%        vertically with key l2 valign (default c)
+%        c: center t: top b: bottom
+%        horizontally with key l2 align (default l)
+%        l: left c: centered r: right
+% you can switch sides using l2_=... and l2^=...
+% syntax is l2_ = line1 and line2 (same for l2^)
+%
+\ctikzset{%
+    l2 valign/.store in=\ltwo at valign, l2 valign=c,
+    l2 halign/.store in=\ltwo at halign, l2 halign=l,
+}
+\ctikzset{l2base/.code n args={2}{
+  \pgfkeys{/tikz/circuitikz/bipole/label/name=%
+        \bgroup
+        \setlength{\tabcolsep}{2pt}%
+        \def\ltwo at tabu{\tabular[\ltwo at valign]}%
+        \expandafter\ltwo at tabu\expandafter{\ltwo at halign}%
+        #1\\ #2%
+        \endtabular
+        \egroup
+    }%
+    \ctikzsetvalof{bipole/label/unit}{}
+    \ifpgf at circ@siunitx
+        \pgf at circ@handleSI{#2}
+        \ifpgf at circ@siunitx at res
+            \edef\pgf at temp{\pgf at circ@handleSI at val}
+            \pgfkeyslet{/tikz/circuitikz/bipole/label/name}{\pgf at temp}
+            \edef\pgf at temp{\pgf at circ@handleSI at unit}
+            \pgfkeyslet{/tikz/circuitikz/bipole/label/unit}{\pgf at temp}
+        \else
+        \fi
+    \else
+    \fi
+}}
+\ctikzset{l2/.style args={#1 and #2}{
+        l2base={#1}{#2},
+    \circuitikzbasekey/bipole/label/position=90 }
+}
+\ctikzset{l2 above/.style args={#1 and #2}{
+        l2base={#1}{#2},
+    \circuitikzbasekey/bipole/label/position=90 }
+}
+\ctikzset{l2^/.style args={#1 and #2}{
+        l2base={#1}{#2},
+    \circuitikzbasekey/bipole/label/position=90 }
+}
+\ctikzset{l2 below/.style args={#1 and #2}{
+        l2base={#1}{#2},
+    \circuitikzbasekey/bipole/label/position=-90 }
+}
+\ctikzset{l2_/.style args={#1 and #2}{
+        l2base={#1}{#2},
+    \circuitikzbasekey/bipole/label/position=-90 }
+}
+
+\endinput

Modified: trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex	2019-05-10 21:14:43 UTC (rev 51070)
+++ trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex	2019-05-10 21:15:08 UTC (rev 51071)
@@ -5,336 +5,692 @@
 % 1. under the LaTeX Project Public License and/or
 % 2. under the GNU Public License.
 %
-% See the file doc/LICENSE for more details.
+% See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %% Monopoles
 
 %% Ground symbol
+% #1 -> name
+% #2 -> width
+% #3 -> depth
+% #4 -> code
+\long\def\pgf at circ@declareground#1#2#3#4{
+    \pgfdeclareshape{#1}{
+        \savedanchor{\southeast}{
+            \pgf at x=\ctikzvalof{monopoles/ground/width}\pgf at circ@Rlen
+            \pgf at x=#2\pgf at x
+            \pgf at y=\ctikzvalof{monopoles/ground/width}\pgf at circ@Rlen
+            \pgf at y=-#3\pgf at y
+        }
+        \anchor{north}{\pgfpointorigin}
+        \anchor{north east}{\southeast\pgf at y=0pt\relax}
+        \anchor{east}{\southeast\pgf at y=.5\pgf at y}
+        \anchor{south east}{\southeast}
+        \anchor{south}{\southeast\pgf at x=0pt\relax}
+        \anchor{south west}{\southeast\pgf at x=-\pgf at x}
+        \anchor{west}{\southeast\pgf at y=.5\pgf at y\pgf at x=-\pgf at x}
+        \anchor{north west}{\southeast\pgf at y=0pt\pgf at x=-\pgf at x}
+        \anchor{left}{\pgfpointorigin}
+        \anchor{right}{\pgfpointorigin}
+        \anchor{center}{\pgfpointorigin}
+        \behindforegroundpath{
+            \pgf at circ@res at step=\ctikzvalof{monopoles/ground/width}\pgf at circ@Rlen
+            \pgfscope
+                \pgfstartlinewidth=\pgflinewidth
+                #4
+            \endpgfscope
+        }
+    }
+}
 
-\pgfdeclareshape{ground}{
-	\anchor{center}{
-		\pgfpointorigin
-	}
-	\behindforegroundpath{		
-		\pgf at circ@res at step=\ctikzvalof{monopoles/ground/width}\pgf at circ@Rlen
-		
-		\pgfscope		
-			\pgfpathmoveto{\pgfpointorigin}
-			\pgfpathlineto{\pgfpoint{0pt}{-\pgf at circ@res at step}}
-			\pgfusepath{draw}
 
-			\pgfstartlinewidth=\pgflinewidth
-			%\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-
-			\pgfpathmoveto{\pgfpoint{-\pgf at circ@res at step}{-\pgf at circ@res at step}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{-\pgf at circ@res at step}}
-			\pgfusepath{draw}
-						
-			\pgfsetlinewidth{\pgfstartlinewidth}
-			\pgfpathmoveto{\pgfpoint{-.8\pgf at circ@res at step}{-1.2\pgf at circ@res at step}}
-			\pgfpathlineto{\pgfpoint{.8\pgf at circ@res at step}{-1.2\pgf at circ@res at step}}
-			\pgfpathmoveto{\pgfpoint{-.6\pgf at circ@res at step}{-1.4\pgf at circ@res at step}}
-			\pgfpathlineto{\pgfpoint{.6\pgf at circ@res at step}{-1.4\pgf at circ@res at step}}
-			\pgfpathmoveto{\pgfpoint{-.4\pgf at circ@res at step}{-1.6\pgf at circ@res at step}}
-			\pgfpathlineto{\pgfpoint{.4\pgf at circ@res at step}{-1.6\pgf at circ@res at step}}
-			\pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
-			\pgfusepath{draw}
-		
-			
-			\pgfsetlinewidth{\pgfstartlinewidth}
-	
-		\endpgfscope
-	}
-
+\pgf at circ@declareground{ground}{0.6}{1.6}{
+    \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpointorigin}
+    \pgfpathlineto{\pgfpoint{0pt}{-1.2\pgf at circ@res at step}}
+    \pgfusepath{draw}
+    \pgfsetlinewidth{\ctikzvalof{monopoles/ground/thickness}\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{-.6\pgf at circ@res at step}{-1.2\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at step}{-1.2\pgf at circ@res at step}}
+    \pgfpathmoveto{\pgfpoint{-.4\pgf at circ@res at step}{-1.4\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at step}{-1.4\pgf at circ@res at step}}
+    \pgfpathmoveto{\pgfpoint{-.25\pgf at circ@res at step}{-1.6\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{.25\pgf at circ@res at step}{-1.6\pgf at circ@res at step}}
+    \pgfusepath{draw}
 }
 
 
 
-\pgfdeclareshape{rground}{
-	\anchor{center}{
-		\pgfpointorigin
-	}
-	\behindforegroundpath{		
-		\pgf at circ@res at step=\ctikzvalof{monopoles/ground/width}\pgf at circ@Rlen
-		
-		\pgfscope		
-			\pgfpathmoveto{\pgfpointorigin}
-			\pgfpathlineto{\pgfpoint{0pt}{-\pgf at circ@res at step}}
-			\pgfusepath{draw}
+\pgf at circ@declareground{rground}{0.6}{1}{
+    \pgfpathmoveto{\pgfpointorigin}
+    \pgfpathlineto{\pgfpoint{0pt}{-\pgf at circ@res at step}}
+    \pgfusepath{draw}
 
-			\pgfstartlinewidth=\pgflinewidth
-			\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfstartlinewidth=\pgflinewidth
+    \pgfsetlinewidth{\ctikzvalof{monopoles/rground/thickness}\pgfstartlinewidth}
 
-			\pgfpathmoveto{\pgfpoint{-\pgf at circ@res at step}{-\pgf at circ@res at step}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{-\pgf at circ@res at step}}
-			\pgfusepath{draw}
-						
-						
-			\pgfsetlinewidth{\pgfstartlinewidth}
-	
-		\endpgfscope
-	}
+    \pgfpathmoveto{\pgfpoint{-.6\pgf at circ@res at step}{-\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at step}{-\pgf at circ@res at step}}
+    \pgfsetroundcap\pgfusepath{draw}
 }
 
-\pgfdeclareshape{tground}{
-	\anchor{center}{
-		\pgfpointorigin
-	}
-	\behindforegroundpath{		
-		\pgf at circ@res at step=\ctikzvalof{monopoles/ground/width}\pgf at circ@Rlen
-		
-		\pgfscope		
-			\pgfpathmoveto{\pgfpointorigin}
-			%\pgfpathlineto{\pgfpoint{0pt}{-\pgf at circ@res at step}}
-			\pgfusepath{draw}
+\pgf at circ@declareground{tground}{0.6}{0}{
+    \pgfpathmoveto{\pgfpointorigin}
+    \pgfusepath{draw}
 
-			\pgfstartlinewidth=\pgflinewidth
-			\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/monopoles/tground/thickness}\pgfstartlinewidth}
+    \pgfstartlinewidth=\pgflinewidth
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/monopoles/tground/thickness}\pgfstartlinewidth}
 
-			\pgfpathmoveto{\pgfpoint{-\pgf at circ@res at step}{0pt}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{0pt}}
-			\pgfusepath{draw}
-						
-						
-			\pgfsetlinewidth{\pgfstartlinewidth}
-	
-		\endpgfscope
-	}
+    \pgfpathmoveto{\pgfpoint{-.6\pgf at circ@res at step}{0pt}}
+    \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at step}{0pt}}
+    \pgfusepath{draw}
 }
 
-\pgfdeclareshape{sground}{
-	\anchor{center}{
-		\pgfpointorigin
-	}
-	\behindforegroundpath{		
-		\pgf at circ@res at step=\ctikzvalof{monopoles/ground/width}\pgf at circ@Rlen
-		
-		\pgfscope		
-			\pgfpathmoveto{\pgfpointorigin}
-			\pgfpathlineto{\pgfpoint{0pt}{-\pgf at circ@res at step}}
-			\pgfusepath{draw}
+\pgf at circ@declareground{sground}{0.6}{1.8}{
+    \pgfpathmoveto{\pgfpointorigin}
+    \pgfpathlineto{\pgfpoint{0pt}{-\pgf at circ@res at step}}
+    \pgfusepath{draw}
 
-			\pgfstartlinewidth=\pgflinewidth
-			\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfstartlinewidth=\pgflinewidth
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
 
-			\pgfpathmoveto{\pgfpoint{-\pgf at circ@res at step}{-\pgf at circ@res at step}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{-\pgf at circ@res at step}}
-			\pgfpathlineto{\pgfpoint{0}{-1.8\pgf at circ@res at step}}
-			\pgfpathclose
-			\pgfusepath{draw}
-						
-						
-			\pgfsetlinewidth{\pgfstartlinewidth}
-	
-		\endpgfscope
-	}
-
+    \pgfpathmoveto{\pgfpoint{-.6\pgf at circ@res at step}{-\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at step}{-\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{0}{-1.8\pgf at circ@res at step}}
+    \pgfpathclose
+    \pgf at circ@draworfill
 }
 
 % noiseless ground
-\pgfdeclareshape{nground}{
-	\anchor{center}{
-		\pgfpointorigin
-	}
-	\behindforegroundpath{		
-		\pgf at circ@res at step=\ctikzvalof{monopoles/ground/width}\pgf at circ@Rlen
-		
-		\pgfscope		
-			\pgfpathmoveto{\pgfpointorigin}
-			\pgfpathlineto{\pgfpoint{0pt}{-\pgf at circ@res at step}}
-			\pgfusepath{draw}
+\pgf at circ@declareground{nground}{0.9}{1.6}{
+    \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpointorigin}
+    \pgfpathlineto{\pgfpoint{0pt}{-1.2\pgf at circ@res at step}}
+    \pgfusepath{draw}
+    \pgfsetlinewidth{\ctikzvalof{monopoles/ground/thickness}\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{-.6\pgf at circ@res at step}{-1.2\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at step}{-1.2\pgf at circ@res at step}}
+    \pgfpathmoveto{\pgfpoint{-.4\pgf at circ@res at step}{-1.4\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at step}{-1.4\pgf at circ@res at step}}
+    \pgfpathmoveto{\pgfpoint{-.25\pgf at circ@res at step}{-1.6\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{.25\pgf at circ@res at step}{-1.6\pgf at circ@res at step}}
+    \pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{0.9\pgf at circ@res at step}{-1.6\pgf at circ@res at step}}
+    \pgfpatharc{0}{180}{0.9\pgf at circ@res at step}
+    \pgfusepath{draw}
+}
 
-			\pgfstartlinewidth=\pgflinewidth
-			%\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+% protective ground
+\pgf at circ@declareground{pground}{0.9}{1.8}{
+    \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpointorigin}
+    \pgfpathlineto{\pgfpoint{0pt}{-1\pgf at circ@res at step}}
+    \pgfusepath{draw}
+    \pgfsetlinewidth{\ctikzvalof{monopoles/ground/thickness}\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{-.6\pgf at circ@res at step}{-1\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at step}{-1\pgf at circ@res at step}}
+    \pgfpathmoveto{\pgfpoint{-.4\pgf at circ@res at step}{-1.2\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at step}{-1.2\pgf at circ@res at step}}
+    \pgfpathmoveto{\pgfpoint{-.25\pgf at circ@res at step}{-1.4\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{.25\pgf at circ@res at step}{-1.4\pgf at circ@res at step}}
+    \pgfusepath{draw}
+    \pgfpathcircle{\pgfpoint{0pt}{-0.9\pgf at circ@res at step}}{0.9\pgf at circ@res at step}
+    \pgfusepath{draw}
+}
 
-			\pgfpathmoveto{\pgfpoint{-\pgf at circ@res at step}{-\pgf at circ@res at step}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{-\pgf at circ@res at step}}
-			\pgfusepath{draw}
-						
-			\pgfsetlinewidth{\pgfstartlinewidth}
-			\pgfpathmoveto{\pgfpoint{-.8\pgf at circ@res at step}{-1.2\pgf at circ@res at step}}
-			\pgfpathlineto{\pgfpoint{.8\pgf at circ@res at step}{-1.2\pgf at circ@res at step}}
-			\pgfpathmoveto{\pgfpoint{-.6\pgf at circ@res at step}{-1.4\pgf at circ@res at step}}
-			\pgfpathlineto{\pgfpoint{.6\pgf at circ@res at step}{-1.4\pgf at circ@res at step}}
-			\pgfpathmoveto{\pgfpoint{-.4\pgf at circ@res at step}{-1.6\pgf at circ@res at step}}
-			\pgfpathlineto{\pgfpoint{.4\pgf at circ@res at step}{-1.6\pgf at circ@res at step}}
-			\pgfusepath{draw}
-			
-			\pgfpathmoveto{\pgfpoint{1.3\pgf at circ@res at step}{-1.6\pgf at circ@res at step}}
-			\pgfpatharc{0}{180}{1.3\pgf at circ@res at step}
-			\pgfusepath{draw}
-					
-			\pgfsetlinewidth{\pgfstartlinewidth}
-		\endpgfscope
-	}
+% chassis ground
+\pgf at circ@declareground{cground}{1}{2}{
+    \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpointorigin}
+    \pgfpathlineto{\pgfpoint{0pt}{-1.5\pgf at circ@res at step}}
+    \pgfusepath{draw}
+    \pgfsetlinewidth{\ctikzvalof{monopoles/ground/thickness}\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{-1.00\pgf at circ@res at step}{-2.10\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{-0.75\pgf at circ@res at step}{-1.50\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{ 0.75\pgf at circ@res at step}{-1.50\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{ 0.50\pgf at circ@res at step}{-2.10\pgf at circ@res at step}}
+    \pgfpathmoveto{\pgfpoint{ 0.00\pgf at circ@res at step}{-1.50\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{-0.25\pgf at circ@res at step}{-2.10\pgf at circ@res at step}}
+    \pgfusepath{draw}
 }
 
-% protective ground
-\pgfdeclareshape{pground}{
-	\anchor{center}{
-		\pgfpointorigin
-	}
-	\behindforegroundpath{		
-		\pgf at circ@res at step=\ctikzvalof{monopoles/ground/width}\pgf at circ@Rlen
-		
-		\pgfscope		
-			\pgfpathmoveto{\pgfpointorigin}
-			\pgfpathlineto{\pgfpoint{0pt}{-\pgf at circ@res at step}}
-			\pgfusepath{draw}
+% Contributed by @fotesan https://github.com/fotesan
 
-			\pgfstartlinewidth=\pgflinewidth
-			%\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+\pgf at circ@declareground{eground}{1.1}{1.7}{
+    \pgfpathmoveto{\pgfpointorigin}
+    \pgfpathlineto{\pgfpoint{0pt}{-\pgf at circ@res at step}}
+    \pgfusepath{draw}
 
-			\pgfpathmoveto{\pgfpoint{-\pgf at circ@res at step}{-\pgf at circ@res at step}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{-\pgf at circ@res at step}}
-			\pgfpathcircle{\pgfpoint{0pt}{-\pgf at circ@res at step}} {1.2\pgf at circ@res at step}
-			\pgfusepath{draw}
-						
-			\pgfsetlinewidth{\pgfstartlinewidth}
-			\pgfpathmoveto{\pgfpoint{-.8\pgf at circ@res at step}{-1.2\pgf at circ@res at step}}
-			\pgfpathlineto{\pgfpoint{.8\pgf at circ@res at step}{-1.2\pgf at circ@res at step}}
-			\pgfpathmoveto{\pgfpoint{-.6\pgf at circ@res at step}{-1.4\pgf at circ@res at step}}
-			\pgfpathlineto{\pgfpoint{.6\pgf at circ@res at step}{-1.4\pgf at circ@res at step}}
-			\pgfpathmoveto{\pgfpoint{-.4\pgf at circ@res at step}{-1.6\pgf at circ@res at step}}
-			\pgfpathlineto{\pgfpoint{.4\pgf at circ@res at step}{-1.6\pgf at circ@res at step}}
-			\pgfusepath{draw}
-					
-			\pgfsetlinewidth{\pgfstartlinewidth}
-		\endpgfscope
-	}
+    \pgfstartlinewidth=\pgflinewidth
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/monopoles/tground/thickness}\pgfstartlinewidth}
+
+    \pgfpathmoveto{\pgfpoint{-1\pgf at circ@res at step}{-\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{1\pgf at circ@res at step}{-\pgf at circ@res at step}}
+    \pgfusepath{draw}
+
+    \pgfsetlinewidth{\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{-1.1\pgf at circ@res at step}{-1.7\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{-.6\pgf at circ@res at step}{-1\pgf at circ@res at step}}
+    \pgfpathmoveto{\pgfpoint{-.6\pgf at circ@res at step}{-1.7\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{-.1\pgf at circ@res at step}{-1\pgf at circ@res at step}}
+    \pgfpathmoveto{\pgfpoint{-.1\pgf at circ@res at step}{-1.7\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at step}{-1\pgf at circ@res at step}}
+    \pgfpathmoveto{\pgfpoint{.4\pgf at circ@res at step}{-1.7\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{.9\pgf at circ@res at step}{-1\pgf at circ@res at step}}
+    \pgfusepath{draw}
 }
 
-% chassis ground 
-\pgfdeclareshape{cground}{ 
-\anchor{center}{ 
-    \pgfpointorigin 
-} 
-\behindforegroundpath{       
-    \pgf at circ@res at step=\ctikzvalof{monopoles/chassis/width}\pgf at circ@Rlen 
- 
-    \pgfscope        
-        \pgfpathmoveto{\pgfpointorigin} 
-        \pgfpathlineto{\pgfpoint{0pt}{-\pgf at circ@res at step}} 
-        \pgfusepath{draw}
+\pgf at circ@declareground{eground2}{1.1}{1.7}{
+    \pgfpathmoveto{\pgfpointorigin}
+    \pgfpathlineto{\pgfpoint{0pt}{-\pgf at circ@res at step}}
+    \pgfusepath{draw}
 
-        \pgfpathmoveto{\pgfpoint{-1.5\pgf at circ@res at step}{-2\pgf at circ@res at step}}
-        \pgfpathlineto{\pgfpoint{-\pgf at circ@res at step}{-\pgf at circ@res at step}}
-        \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{-\pgf at circ@res at step}}
-        \pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at step}{-2\pgf at circ@res at step}}
-        \pgfpathmoveto{\pgfpoint{0pt}{-\pgf at circ@res at step}}
-        \pgfpathlineto{\pgfpoint{-0.5\pgf at circ@res at step}{-2\pgf at circ@res at step}}
-        \pgfusepath{draw}                        
-    \endpgfscope 
-    } 
+    \pgfstartlinewidth=\pgflinewidth
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/monopoles/tground/thickness}\pgfstartlinewidth}
+
+    \pgfpathmoveto{\pgfpoint{-1\pgf at circ@res at step}{-\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{1\pgf at circ@res at step}{-\pgf at circ@res at step}}
+    \pgfusepath{draw}
+
+    \pgfsetlinewidth{\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{-1.1\pgf at circ@res at step}{-1.7\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{-.4\pgf at circ@res at step}{-1\pgf at circ@res at step}}
+    \pgfpathmoveto{\pgfpoint{-.45\pgf at circ@res at step}{-1.7\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{.25\pgf at circ@res at step}{-1\pgf at circ@res at step}}
+    \pgfpathmoveto{\pgfpoint{.2\pgf at circ@res at step}{-1.7\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{.9\pgf at circ@res at step}{-1\pgf at circ@res at step}}
+    \pgfusepath{draw}
 }
 
 % Contributed by Leonardo Azzinnari
 \pgfdeclareshape{tlinestub}{
-	\anchor{center}{\pgfpointorigin}
-	\behindforegroundpath{
-		\pgfstartlinewidth=\pgflinewidth
-		
-		\pgf at circ@res at step=\ctikzvalof{bipoles/tline/width} \pgf at circ@Rlen
-        \pgfpathmoveto{\pgfpoint{0.5\pgf at circ@res at step}{0.25\pgf at circ@res at step}}
-        
-            \pgfpathmoveto{\pgfpointorigin}
-            \pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at step}{0pt}}
-            \pgfusepath{draw}
-         \pgfscope
+    \savedanchor{\northeast}{%
+        \pgf at circ@res at step = \ctikzvalof{bipoles/tline/width} \pgf at circ@Rlen
+        \pgf at x=1.625\pgf at circ@res at step
+        \pgf at circ@res at step = \ctikzvalof{bipoles/tline/width} \pgf at circ@Rlen
+        \pgf at y=.25\pgf at circ@res at step%
+    }
+    % the center is on the left side of the shape for facility of usage
+    \anchor{north}{\northeast\pgf at x=0.5\pgf at x\relax}
+    \anchor{east}{\northeast\pgf at y=0cm\relax}
+    \anchor{south}{\northeast\pgf at y=-\pgf at y \pgf at x=0.5\pgf at x\relax}
+    \anchor{west}{\pgfpointorigin}
+    \anchor{north east}{\northeast}
+    \anchor{north west}{\northeast\pgf at x=0cm\relax}
+    \anchor{south east}{\northeast\pgf at y=-\pgf at y}
+    \anchor{south west}{\northeast\pgf at x=0cm\pgf at y=-\pgf at y}
+    \anchor{center}{\pgfpointorigin}
+    \behindforegroundpath{
+        \pgfstartlinewidth=\pgflinewidth
+
+        \pgf at circ@res at step=\ctikzvalof{bipoles/tline/width} \pgf at circ@Rlen
+
+        \pgfscope\begin{pgftransparencygroup}
             \pgfpathellipse{\pgfpoint{0.5\pgf at circ@res at step}{0\pgf at circ@res at step}}{\pgfpoint{0.125\pgf at circ@res at step}{0\pgf at circ@res at step}}{\pgfpoint{0\pgf at circ@res at step}{0.25\pgf at circ@res at step}}
-			\pgfpathmoveto{\pgfpoint{0.5\pgf at circ@res at step}{0.25\pgf at circ@res at step}}
+            \pgf at circ@maybefill
+            \pgfpathmoveto{\pgfpoint{0.5\pgf at circ@res at step}{0.25\pgf at circ@res at step}}
             \pgfpathlineto{\pgfpoint{1.5\pgf at circ@res at step}{0.25\pgf at circ@res at step}}
             \pgfpatharc{90}{-90}{0.125\pgf at circ@res at step and 0.25\pgf at circ@res at step}
             \pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at step}{-0.25\pgf at circ@res at step}}
             \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+            \pgf at circ@draworfill
+            \pgfpathellipse{\pgfpoint{0.5\pgf at circ@res at step}{0\pgf at circ@res at step}}{\pgfpoint{0.125\pgf at circ@res at step}{0\pgf at circ@res at step}}{\pgfpoint{0\pgf at circ@res at step}{0.25\pgf at circ@res at step}}
             \pgfusepath{draw}
-         \endpgfscope
-      }
+        \end{pgftransparencygroup} \endpgfscope
+        \pgfpathmoveto{\pgfpointorigin}
+        \pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at step}{0pt}}
+        \pgfusepath{draw}
+    }
 }
-                            
 
+%% New antennas without tails
 
+% main body
+\def\pgf at circ@antennabody{%
+    \pgfstartlinewidth=\pgflinewidth
+    \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+    \pgf at circ@res at step=\ctikzvalof{monopoles/bareantenna/width}\pgf at circ@Rlen
+    \pgfscope
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+        \pgfpathmoveto{\pgfpointorigin}
+        \pgfpathlineto{\pgfpoint{-\pgf at circ@res at step}{2\pgf at circ@res at step}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{2\pgf at circ@res at step}}
+        \pgfsetbeveljoin
+        \pgfpathclose
+        \pgf at circ@draworfill
+    \endpgfscope
+    \pgfsetlinewidth{\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpointorigin}
+    \pgfpathlineto{\pgfpoint{0pt}{2\pgf at circ@res at step}}
+    \pgfusepath{draw}
+}
 
+% Waves for the antennas.
+\def\pgf at circ@antennawaves{%
+    \pgfscope
+    % define a triangle for clipping the waves
+    \pgfpathmoveto{\pgfpoint{0pt}{\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{4.2\pgf at circ@res at step}{3\pgf at circ@res at step}}
+    \pgfpathlineto{\pgfpoint{4.2\pgf at circ@res at step}{-1\pgf at circ@res at step}}
+    \pgfpathclose
+    \pgfusepath{clip}
+    % ...and build the waves as clipped circles
+    \c at pgf@counta=8\pgf at circ@res at other=0.5\pgf at circ@res at step
+    \pgfmathloop%
+    \ifnum\c at pgf@counta>2
+        \pgfpathcircle{\pgfpoint{0pt}{\pgf at circ@res at step}}{\the\c at pgf@counta*\pgf at circ@res at other}
+        \advance\c at pgf@counta-1\relax%
+        \repeatpgfmathloop
+        \pgfusepath{draw}
+    \endpgfscope
+}
+
+
+% additional shape with the waves
+\pgfdeclareshape{waves}{
+    \anchor{center}{\pgfpointorigin}
+    \savedanchor{\northeast}{
+        \pgf at circ@res at step=\ctikzvalof{monopoles/waves/width}\pgf at circ@Rlen
+        \pgf at x=\pgf at circ@res at step
+        \pgf at y=\pgf at circ@res at step
+    }
+    \anchor{text}{
+        \northeast
+        \pgf at y=\dimexpr\pgf at y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
+    }
+    \anchor{top}{\northeast\pgf at x=0pt}
+    \anchor{right}{\northeast\pgf at y=0pt}
+    \anchor{left}{\northeast\pgf at x=-\pgf at x\pgf at y=0pt}
+    \anchor{bottom}{\northeast\pgf at y=-\pgf at y\pgf at x=0pt}
+    \anchor{north}{\northeast\pgf at x=0pt}
+    \anchor{north east}{\northeast}
+    \anchor{east}{\northeast\pgf at y=0pt}
+    \anchor{south east}{\northeast\pgf at y=-\pgf at y}
+    \anchor{south}{\northeast\pgf at y=-\pgf at y\pgf at x=0pt}
+    \anchor{south west}{\northeast\pgf at y=-\pgf at y\pgf at x=-\pgf at x}
+    \anchor{west}{\northeast\pgf at x=-\pgf at x\pgf at y=0pt}
+    \anchor{north west}{\northeast\pgf at x=-\pgf at x}
+    \behindforegroundpath{
+        \pgf at circ@res at step=\ctikzvalof{monopoles/waves/width}\pgf at circ@Rlen
+        \pgf at circ@res at step=0.5\pgf at circ@res at step
+        \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+        \pgfscope
+        % define a triangle for clipping the waves
+        \pgfpathmoveto{\pgfpoint{-2\pgf at circ@res at step}{0pt}}
+        \pgfpathlineto{\pgfpoint{2.1\pgf at circ@res at step}{2\pgf at circ@res at step}}
+        \pgfpathlineto{\pgfpoint{2.1\pgf at circ@res at step}{-2\pgf at circ@res at step}}
+        \pgfpathclose
+        \pgfusepath{clip}
+        % ...and build the waves as clipped circles
+        \c at pgf@counta=8\pgf at circ@res at other=0.5\pgf at circ@res at step
+        \pgfmathloop%
+        \ifnum\c at pgf@counta>1
+            \pgfpathcircle{\pgfpoint{-2\pgf at circ@res at step}{0pt}}{\the\c at pgf@counta*\pgf at circ@res at other}
+            \advance\c at pgf@counta-1\relax%
+            \repeatpgfmathloop
+            \pgfusepath{draw}
+        \endpgfscope
+    }
+}
+
+% the three types of antennas: simple, TX, RX. Notice that you can flip them...
+
+\pgfdeclareshape{bareantenna}{
+    \anchor{center}{\pgfpointorigin}
+    \savedanchor{\northeast}{
+        \pgf at circ@res at step=\ctikzvalof{monopoles/bareantenna/width}\pgf at circ@Rlen
+        \pgf at x=\pgf at circ@res at step
+        \pgf at y=2\pgf at circ@res at step
+    }
+    \anchor{text}{
+        \northeast
+        \pgf at x=\ctikzvalof{monopoles/bareantenna/label/xanchor}\pgf at x
+        \pgf at y=\ctikzvalof{monopoles/bareantenna/label/yanchor}\pgf at y
+        \pgf at y=\dimexpr\pgf at y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
+    }
+    \anchor{top}{\northeast\pgf at x=0pt}
+    \anchor{right}{\northeast\pgf at y=0.5\pgf at y}
+    \anchor{left}{\northeast\pgf at x=-\pgf at x\pgf at y=0.5\pgf at y}
+    \anchor{bottom}{\pgfpointorigin}
+    \anchor{north}{\northeast\pgf at x=0pt}
+    \anchor{east}{\northeast\pgf at y=0.5\pgf at y}
+    \anchor{west}{\northeast\pgf at x=-\pgf at x\pgf at y=0.5\pgf at y}
+    \anchor{south}{\pgfpointorigin}
+    \anchor{north east}{\northeast}
+    \anchor{north west}{\northeast\pgf at x=-\pgf at x}
+    \anchor{south east}{\northeast\pgf at y=0pt\relax}
+    \anchor{south west}{\northeast\pgf at y=0pt\pgf at x=-\pgf at x}
+    \behindforegroundpath{
+        \pgf at circ@antennabody
+    }
+}
+
+\pgfdeclareshape{bareTXantenna}{
+    \anchor{center}{\pgfpointorigin}
+    \savedanchor{\northeast}{
+        \pgf at circ@res at step=\ctikzvalof{monopoles/bareantenna/width}\pgf at circ@Rlen
+        \pgf at x=\pgf at circ@res at step
+        \pgf at y=2\pgf at circ@res at step
+    }
+    \anchor{text}{
+        \northeast
+        \pgf at x=\ctikzvalof{monopoles/bareantenna/label/xanchor}\pgf at x
+        \pgf at y=\ctikzvalof{monopoles/bareantenna/label/yanchor}\pgf at y
+        \pgf at x=\dimexpr-\pgf at x-\wd\pgfnodeparttextbox\relax
+        \pgf at y=\dimexpr\pgf at y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
+    }
+    \anchor{waves}{
+        \northeast
+        \pgf at circ@res at step=\ctikzvalof{monopoles/bareantenna/width}\pgf at circ@Rlen
+        \pgf at x=4.2\pgf at circ@res at step
+        \pgf at y=\pgf at circ@res at step
+    }
+    \anchor{top}{\northeast\pgf at x=0pt}
+    \anchor{right}{\northeast\pgf at y=0.5\pgf at y}
+    \anchor{left}{\northeast\pgf at x=-\pgf at x\pgf at y=0.5\pgf at y}
+    \anchor{bottom}{\pgfpointorigin}
+    \anchor{north}{\northeast\pgf at x=0pt}
+    \anchor{east}{\northeast\pgf at y=0.5\pgf at y}
+    \anchor{west}{\northeast\pgf at x=-\pgf at x\pgf at y=0.5\pgf at y}
+    \anchor{south}{\pgfpointorigin}
+    \anchor{north east}{\northeast}
+    \anchor{north west}{\northeast\pgf at x=-\pgf at x}
+    \anchor{south east}{\northeast\pgf at y=0pt\relax}
+    \anchor{south west}{\northeast\pgf at y=0pt\pgf at x=-\pgf at x}
+    \behindforegroundpath{
+        \pgf at circ@antennabody
+        \pgf at circ@antennawaves
+    }
+}
+
+\pgfdeclareshape{bareRXantenna}{
+    \anchor{center}{\pgfpointorigin}
+    \savedanchor{\northeast}{
+        \pgf at circ@res at step=\ctikzvalof{monopoles/bareantenna/width}\pgf at circ@Rlen
+        \pgf at x=\pgf at circ@res at step
+        \pgf at y=2\pgf at circ@res at step
+    }
+    \anchor{text}{
+        \northeast
+        \pgf at x=\ctikzvalof{monopoles/bareantenna/label/xanchor}\pgf at x
+        \pgf at y=\ctikzvalof{monopoles/bareantenna/label/yanchor}\pgf at y
+        \pgf at y=\dimexpr\pgf at y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
+    }
+    \anchor{waves}{
+        \northeast
+        \pgf at circ@res at step=\ctikzvalof{monopoles/bareantenna/width}\pgf at circ@Rlen
+        \pgf at x=-4.2\pgf at circ@res at step
+        \pgf at y=\pgf at circ@res at step
+    }
+    \anchor{top}{\northeast\pgf at x=0pt}
+    \anchor{right}{\northeast\pgf at y=0.5\pgf at y}
+    \anchor{left}{\northeast\pgf at x=-\pgf at x\pgf at y=0.5\pgf at y}
+    \anchor{bottom}{\pgfpointorigin}
+    \anchor{north}{\northeast\pgf at x=0pt}
+    \anchor{east}{\northeast\pgf at y=0.5\pgf at y}
+    \anchor{west}{\northeast\pgf at x=-\pgf at x\pgf at y=0.5\pgf at y}
+    \anchor{south}{\pgfpointorigin}
+    \anchor{north east}{\northeast}
+    \anchor{north west}{\northeast\pgf at x=-\pgf at x}
+    \anchor{south east}{\northeast\pgf at y=0pt\relax}
+    \anchor{south west}{\northeast\pgf at y=0pt\pgf at x=-\pgf at x}
+    \behindforegroundpath{
+        \pgf at circ@antennabody
+        \pgftransformxshift{-5.2\pgf at circ@res at step}
+        \pgf at circ@antennawaves
+    }
+}
+
+% Microstrip monopoles
+
+\pgfdeclareshape{mslstub}{
+    \savedanchor{\southeast}{
+        \pgf at x=\ctikzvalof{bipoles/mstline/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+        \pgf at y=\ctikzvalof{bipoles/mstline/height}\pgf at circ@Rlen
+        \pgf at y=-.5\pgf at y
+    }
+    \savedanchor{\northwest}{
+        \pgf at x=\ctikzvalof{bipoles/mstline/width}\pgf at circ@Rlen
+        \pgf at x=-.5\pgf at x
+        \pgf at y=\ctikzvalof{bipoles/mstline/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+    }
+    \anchor{north}{\northwest\pgf at x=0pt\relax}
+    \anchor{north east}{\northwest\pgf at x=-\pgf at x}
+    \anchor{east}{\southeast\pgf at y=0pt\relax}
+    \anchor{south east}{\southeast}
+    \anchor{south}{\southeast\pgf at x=0pt\relax}
+    \anchor{south west}{\southeast\pgf at x=-\pgf at x}
+    \anchor{west}{\northwest\pgf at y=0pt\relax}
+    \anchor{north west}{\northwest}
+    %
+    \anchor{center}{\northwest\pgf at y=0pt\relax}
+    \anchor{left}{\northwest\pgf at y=0pt\relax}
+    \anchor{right}{\southeast\pgf at y=0pt\relax}
+    % put the node text above and centered
+    \anchor{text}{\pgfextracty{\pgf at circ@res at up}{\northwest}
+        \pgfpoint{-.5\wd\pgfnodeparttextbox}{
+            \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf at circ@res at up\relax
+        }
+    }
+    \behindbackgroundpath{
+        \pgfextracty{\pgf at circ@res at up}{\northwest}
+        \pgfextractx{\pgf at circ@res at right}{\southeast}
+        \pgfextractx{\pgf at circ@res at left}{\northwest}
+        \pgfextracty{\pgf at circ@res at down}{\southeast}
+        \pgfmathsetlength{\pgf at circ@res at step}{0.25*\pgf at circ@res at up}
+        \pgfstartlinewidth=\pgflinewidth
+        \pgfscope
+            \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgfstartlinewidth}
+            \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+            \pgf at circ@draworfill
+        \endpgfscope
+    }
+}
+
+\pgfdeclareshape{msrstub}{
+    \savedanchor{\southeast}{
+        \pgf at x=\ctikzvalof{monopoles/msrstub/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+        \pgf at y=0pt\relax
+    }
+    \savedanchor{\northwest}{
+        \pgf at x=\ctikzvalof{monopoles/msrstub/width}\pgf at circ@Rlen
+        \pgf at x=-.5\pgf at x
+        \pgf at y=\ctikzvalof{monopoles/msrstub/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+    }
+    \anchor{north}{\northwest\pgf at x=0pt\relax}
+    \anchor{north east}{\northwest\pgf at x=-\pgf at x}
+    \anchor{east}{\southeast\pgf at y=0pt\relax}
+    \anchor{south east}{\southeast}
+    \anchor{south}{\southeast\pgf at x=0pt\relax}
+    \anchor{south west}{\southeast\pgf at x=-\pgf at x}
+    \anchor{west}{\northwest\pgf at y=0pt\relax}
+    \anchor{north west}{\northwest}
+    %
+    \anchor{center}{\pgfpointorigin}
+    \anchor{left}{\pgfpointorigin}
+    \anchor{right}{\pgfpointorigin}
+    % put the node text above and centered
+    \anchor{text}{\pgfextracty{\pgf at circ@res at up}{\northwest}
+        \pgfpoint{-.5\wd\pgfnodeparttextbox}{
+            \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf at circ@res at up\relax
+        }
+    }
+    \behindbackgroundpath{
+        \pgfextracty{\pgf at circ@res at up}{\northwest}
+        \pgfextractx{\pgf at circ@res at right}{\southeast}
+        \pgfextractx{\pgf at circ@res at left}{\northwest}
+        \pgfextracty{\pgf at circ@res at down}{\southeast}
+        \pgfmathsetlength{\pgf at circ@res at step}{0.25*\pgf at circ@res at up}
+        \pgfstartlinewidth=\pgflinewidth
+        \pgfscope
+            \pgfpathmoveto{\pgfpointorigin}
+            \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at step}}
+            \pgfusepath{draw}
+            \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgfstartlinewidth}
+            \pgfpathmoveto{\pgfpointpolar{135}{\pgf at circ@res at step}}
+            \pgfpatharc{135}{45}{\pgf at circ@res at step}
+            \pgfpathlineto{\pgfpointpolar{45}{\pgf at circ@res at up}}
+            \pgfpatharc{45}{135}{\pgf at circ@res at up}
+            \pgfclosepath
+            % \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+            \pgf at circ@draworfill
+        \endpgfscope
+    }
+}
+
+\pgfdeclareshape{msport}{
+    \savedanchor{\southeast}{
+        \pgf at x=\ctikzvalof{monopoles/msport/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+        \pgf at y=\ctikzvalof{bipoles/mstline/height}\pgf at circ@Rlen
+        \pgf at y=-.5\pgf at y
+    }
+    \savedanchor{\northwest}{
+        \pgf at x=\ctikzvalof{monopoles/msport/width}\pgf at circ@Rlen
+        \pgf at x=-.5\pgf at x
+        \pgf at y=\ctikzvalof{bipoles/mstline/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+    }
+    \anchor{north}{\northwest\pgf at x=0pt\relax}
+    \anchor{north east}{\northwest\pgf at x=-\pgf at x}
+    \anchor{east}{\southeast\pgf at y=0pt\relax}
+    \anchor{south east}{\southeast}
+    \anchor{south}{\southeast\pgf at x=0pt\relax}
+    \anchor{south west}{\southeast\pgf at x=-\pgf at x}
+    \anchor{west}{\northwest\pgf at y=0pt\relax}
+    \anchor{north west}{\northwest}
+    %
+    \anchor{center}{\northwest\pgf at y=0pt\relax}
+    \anchor{left}{\northwest\pgf at y=0pt\relax}
+    \anchor{right}{\southeast\pgf at y=0pt\relax}
+    % put the node text above and centered
+    \anchor{text}{\pgfextracty{\pgf at circ@res at up}{\northwest}
+        \pgfpoint{-.5\wd\pgfnodeparttextbox}{
+            \dimexpr-.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
+        }
+    }
+    \behindbackgroundpath{
+        \pgfextracty{\pgf at circ@res at up}{\northwest}
+        \pgfextractx{\pgf at circ@res at right}{\southeast}
+        \pgfextractx{\pgf at circ@res at left}{\northwest}
+        \pgfextracty{\pgf at circ@res at down}{\southeast}
+        \pgfmathsetlength{\pgf at circ@res at step}{0.5*\pgf at circ@res at up}
+        \pgfstartlinewidth=\pgflinewidth
+        \pgfscope
+            \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgfstartlinewidth}
+            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+            \pgfpathlineto{\pgfpoint{\pgf at circ@res at left+\pgf at circ@res at step}{\pgf at circ@res at up}}
+            \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+            \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+            \pgfpathlineto{\pgfpoint{\pgf at circ@res at left+\pgf at circ@res at step}{\pgf at circ@res at down}}
+            \pgfpathclose
+            \pgf at circ@draworfill
+        \endpgfscope
+    }
+}
+% Legacy antennas (with tails)
+
+\def\pgf at circ@shift at antenna@xy#1#2{%
+    \pgf at circ@res at step=\ctikzvalof{monopoles/antenna/width}\pgf at circ@Rlen
+    \pgf at y=\dimexpr\pgf at y+#2\pgf at circ@res at step
+    \pgf at x=\dimexpr\pgf at x+#1\pgf at circ@res at step
+\relax}
+
 \pgfdeclareshape{antenna}{
-\anchor{center}{\pgfpointorigin}
-	\savedanchor{\northeast}{
-		\pgf at circ@res at step=\ctikzvalof{monopoles/antenna/width}\pgf at circ@Rlen
-		\pgf at x=5\pgf at circ@res at step%-0.5\pgflinewidth
-		\pgf at y=6\pgf at circ@res at step
-	}
-	\anchor{text}{
-		\northeast
-		\pgf at x=\ctikzvalof{monopoles/antenna/label/xanchor}\pgf at x
-		\pgf at y=\ctikzvalof{monopoles/antenna/label/yanchor}\pgf at y
-	}
-   \behindforegroundpath{
-     \pgfstartlinewidth=\pgflinewidth
-     \pgf at circ@res at step=\ctikzvalof{monopoles/antenna/width}\pgf at circ@Rlen
-                           
-        % \pgfpathmoveto{\pgfpointorigin}
-        % \pgfpathlineto{\pgfpoint{4\pgf at circ@res at step}{0pt}}
-        % \pgfpathmoveto{\pgfpoint{4\pgf at circ@res at step-0.5\pgflinewidth}{0pt}}
-        %     \pgfpathlineto{\pgfpoint{4\pgf at circ@res at step-0.5\pgflinewidth}{6\pgf at circ@res at step}}
-        
+    \anchor{center}{\pgfpointorigin}
+    \savedanchor{\northeast}{
+        \pgf at circ@res at step=\ctikzvalof{monopoles/antenna/width}\pgf at circ@Rlen
+        \pgf at x=\pgf at circ@res at step%-0.5\pgflinewidth
+        \pgf at y=4\pgf at circ@res at step
+    }
+    \anchor{north}{\northeast\pgf at x=0cm\pgf at circ@shift at antenna@xy{0}{2}}
+    \anchor{east}{\northeast\pgf at y=0cm\pgf at circ@shift at antenna@xy{0}{3}\relax}
+    \anchor{south}{\northeast\pgf at y=-\pgf at y \pgf at x=0cm\pgf at circ@shift at antenna@xy{0}{4}\relax}
+    \anchor{west}{\northeast\pgf at y=0cm\pgf at x=-\pgf at x\pgf at circ@shift at antenna@xy{0}{3}}
+    \anchor{north east}{\northeast\pgf at circ@shift at antenna@xy{0}{2}}
+    \anchor{north west}{\northeast\pgf at x=-\pgf at x\pgf at circ@shift at antenna@xy{0}{2}}
+    \anchor{south east}{\northeast\pgf at y=-\pgf at y\pgf at circ@shift at antenna@xy{0}{4}}
+    \anchor{south west}{\northeast\pgf at y=-\pgf at y\pgf at x=-\pgf at x\pgf at circ@shift at antenna@xy{0}{4}}
+    \anchor{text}{
+        \northeast
+        \pgf at x=\ctikzvalof{monopoles/antenna/label/xanchor}\pgf at x
+        \pgf at y=\ctikzvalof{monopoles/antenna/label/yanchor}\pgf at y
+    }
+    \behindforegroundpath{
+        \pgfstartlinewidth=\pgflinewidth
+        \pgf at circ@res at step=\ctikzvalof{monopoles/antenna/width}\pgf at circ@Rlen
+
         \pgftransformxshift{ -4\pgf at circ@res at step }
 
         \pgfpathmoveto{\pgfpoint{4\pgf at circ@res at step-0.5\pgflinewidth}{0pt}}
         \pgfpathlineto{\pgfpoint{4\pgf at circ@res at step-0.5\pgflinewidth}{6\pgf at circ@res at step}}
-             
-         \pgfusepath{draw}
-             
-          \pgfscope   
-          \pgfpathmoveto{\pgfpoint{4\pgf at circ@res at step-0.5\pgflinewidth}{6\pgf at circ@res at step}}
-             \pgfpathlineto{\pgfpoint{5\pgf at circ@res at step-0.5\pgflinewidth}{6\pgf at circ@res at step}}
-             \pgfpathlineto{\pgfpoint{4\pgf at circ@res at step-0.5\pgflinewidth}{4\pgf at circ@res at step}}
-             \pgfpathlineto{\pgfpoint{3\pgf at circ@res at step-0.5\pgflinewidth}{6\pgf at circ@res at step}}
-             \pgfpathlineto{\pgfpoint{4\pgf at circ@res at step-0.5\pgflinewidth}{6\pgf at circ@res at step}}
-             \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
-             \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-             \pgfusepath{draw}
-           \endpgfscope
-                           \pgfsetlinewidth{\pgfstartlinewidth}
-                        
-                           }
-     }
 
+        \pgfusepath{draw}
 
+        \pgfscope
+            \pgfpathmoveto{\pgfpoint{4\pgf at circ@res at step-0.5\pgflinewidth}{6\pgf at circ@res at step}}
+            \pgfpathlineto{\pgfpoint{5\pgf at circ@res at step-0.5\pgflinewidth}{6\pgf at circ@res at step}}
+            \pgfpathlineto{\pgfpoint{4\pgf at circ@res at step-0.5\pgflinewidth}{4\pgf at circ@res at step}}
+            \pgfpathlineto{\pgfpoint{3\pgf at circ@res at step-0.5\pgflinewidth}{6\pgf at circ@res at step}}
+            \pgfpathlineto{\pgfpoint{4\pgf at circ@res at step-0.5\pgflinewidth}{6\pgf at circ@res at 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 at circ@res at step=\ctikzvalof{monopoles/txantenna/width}\pgf at circ@Rlen
-		\pgf at x=5\pgf at circ@res at step%-0.5\pgflinewidth
-		\pgf at y=6\pgf at circ@res at step
-	}
-	\anchor{text}{
-		\northeast
-		\pgf at x=\ctikzvalof{monopoles/txantenna/label/xanchor}\pgf at x
-		\pgf at y=\ctikzvalof{monopoles/txantenna/label/yanchor}\pgf at y
-	}
-       \behindforegroundpath{
-       \pgfstartlinewidth=\pgflinewidth
-       \pgf at circ@res at step=\ctikzvalof{monopoles/txantenna/width}\pgf at circ@Rlen
-        
-         \pgfpathmoveto{\pgfpointorigin}
-         \pgfpathlineto{\pgfpoint{4\pgf at circ@res at step}{0pt}}
-         \pgfpathmoveto{\pgfpoint{4\pgf at circ@res at step-0.5\pgflinewidth}{0pt}}
-             \pgfpathlineto{\pgfpoint{4\pgf at circ@res at step-0.5\pgflinewidth}{6\pgf at circ@res at step}}
-             
-         \pgfusepath{draw}
-             
-          \pgfscope   
-          \pgfpathmoveto{\pgfpoint{4\pgf at circ@res at step-0.5\pgflinewidth}{6\pgf at circ@res at step}}
-             \pgfpathlineto{\pgfpoint{5\pgf at circ@res at step-0.5\pgflinewidth}{6\pgf at circ@res at step}}
-             \pgfpathlineto{\pgfpoint{4\pgf at circ@res at step-0.5\pgflinewidth}{4\pgf at circ@res at step}}
-             \pgfpathlineto{\pgfpoint{3\pgf at circ@res at step-0.5\pgflinewidth}{6\pgf at circ@res at step}}
-             \pgfpathlineto{\pgfpoint{4\pgf at circ@res at step-0.5\pgflinewidth}{6\pgf at circ@res at step}}
-             \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
-             \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-             \pgfusepath{draw}
-           \endpgfscope
-          \pgfpathmoveto{\pgfpoint{5.5\pgf at circ@res at step}{6\pgf at circ@res at step}}
-%        \pgfpatharc{60}{-60}{\pgf at circ@res at step and \pgf at circ@res at step}
+    \anchor{center}{\pgfpointorigin}
+    \savedanchor{\northeast}{
+        \pgf at circ@res at step=\ctikzvalof{monopoles/antenna/width}\pgf at circ@Rlen
+        \pgf at x=\pgf at circ@res at step%-0.5\pgflinewidth
+        \pgf at y=4\pgf at circ@res at step
+    }
+    \anchor{north}{\northeast\pgf at x=0cm\pgf at circ@shift at antenna@xy{2}{2}}
+    \anchor{east}{\northeast\pgf at y=0cm\pgf at circ@shift at antenna@xy{4}{3}\relax}
+    \anchor{south}{\northeast\pgf at y=-\pgf at y \pgf at x=0cm\pgf at circ@shift at antenna@xy{2}{4}\relax}
+    \anchor{west}{\northeast\pgf at y=0cm\pgf at x=-\pgf at x\pgf at circ@shift at antenna@xy{1}{3}}
+    \anchor{north east}{\northeast\pgf at circ@shift at antenna@xy{4}{2}}
+    \anchor{north west}{\northeast\pgf at x=-\pgf at x\pgf at circ@shift at antenna@xy{1}{2}}
+    \anchor{south east}{\northeast\pgf at y=-\pgf at y\pgf at circ@shift at antenna@xy{4}{4}}
+    \anchor{south west}{\northeast\pgf at y=-\pgf at y\pgf at x=-\pgf at x\pgf at circ@shift at antenna@xy{1}{4}}
+    \anchor{text}{
+        \northeast
+        \pgf at x=\ctikzvalof{monopoles/txantenna/label/xanchor}\pgf at x
+        \pgf at y=\ctikzvalof{monopoles/txantenna/label/yanchor}\pgf at y
+    }
+    \behindforegroundpath{
+        \pgfstartlinewidth=\pgflinewidth
+        \pgf at circ@res at step=\ctikzvalof{monopoles/txantenna/width}\pgf at circ@Rlen
+
+        \pgfpathmoveto{\pgfpointorigin}
+        \pgfpathlineto{\pgfpoint{4\pgf at circ@res at step}{0pt}}
+        \pgfpathmoveto{\pgfpoint{4\pgf at circ@res at step-0.5\pgflinewidth}{0pt}}
+        \pgfpathlineto{\pgfpoint{4\pgf at circ@res at step-0.5\pgflinewidth}{6\pgf at circ@res at step}}
+
+        \pgfusepath{draw}
+
+        \pgfscope
+            \pgfpathmoveto{\pgfpoint{4\pgf at circ@res at step-0.5\pgflinewidth}{6\pgf at circ@res at step}}
+            \pgfpathlineto{\pgfpoint{5\pgf at circ@res at step-0.5\pgflinewidth}{6\pgf at circ@res at step}}
+            \pgfpathlineto{\pgfpoint{4\pgf at circ@res at step-0.5\pgflinewidth}{4\pgf at circ@res at step}}
+            \pgfpathlineto{\pgfpoint{3\pgf at circ@res at step-0.5\pgflinewidth}{6\pgf at circ@res at step}}
+            \pgfpathlineto{\pgfpoint{4\pgf at circ@res at step-0.5\pgflinewidth}{6\pgf at circ@res at step}}
+            \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+            \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+            \pgfusepath{draw}
+        \endpgfscope
+        \pgfpathmoveto{\pgfpoint{5.5\pgf at circ@res at step}{6\pgf at circ@res at step}}
+        %        \pgfpatharc{60}{-60}{\pgf at circ@res at step and \pgf at circ@res at step}
         \pgfpatharc{30}{-30}{2\pgf at circ@res at step}         \pgfpathmoveto{\pgfpoint{6\pgf at circ@res at step}{6.25\pgf at circ@res at step}}
         \pgfpatharc{30}{-30}{2.5\pgf at circ@res at step}
         \pgfpathmoveto{\pgfpoint{6.5\pgf at circ@res at step}{6.5\pgf at circ@res at step}}
@@ -345,161 +701,208 @@
         \pgfpatharc{30}{-30}{4\pgf at circ@res at step}
         \pgfusepath{draw}
         \pgfsetlinewidth{\pgfstartlinewidth}
-        
-        }
-     }
 
+    }
+}
 
+
 \pgfdeclareshape{rxantenna}{
-	\anchor{center}{\pgfpointorigin}
-	\savedanchor{\northeast}{
-		\pgf at circ@res at step=\ctikzvalof{monopoles/txantenna/width}\pgf at circ@Rlen
-		\pgf at x=5\pgf at circ@res at step%-0.5\pgflinewidth
-		\pgf at y=6\pgf at circ@res at step
-	}
-	\anchor{text}{
-		\northeast
-		\pgf at x=\ctikzvalof{monopoles/rxantenna/label/xanchor}\pgf at x
-		\pgf at y=\ctikzvalof{monopoles/rxantenna/label/yanchor}\pgf at y
-	}
+    \anchor{center}{\pgfpointorigin}
+    \savedanchor{\northeast}{
+        \pgf at circ@res at step=\ctikzvalof{monopoles/antenna/width}\pgf at circ@Rlen
+        \pgf at x=\pgf at circ@res at step%-0.5\pgflinewidth
+        \pgf at y=4\pgf at circ@res at step
+    }
+    \anchor{north}{\northeast\pgf at x=0cm\pgf at circ@shift at antenna@xy{2}{2}}
+    \anchor{east}{\northeast\pgf at y=0cm\pgf at circ@shift at antenna@xy{4}{3}\relax}
+    \anchor{south}{\northeast\pgf at y=-\pgf at y \pgf at x=0cm\pgf at circ@shift at antenna@xy{2}{4}\relax}
+    \anchor{west}{\northeast\pgf at y=0cm\pgf at x=-\pgf at x\pgf at circ@shift at antenna@xy{1}{3}}
+    \anchor{north east}{\northeast\pgf at circ@shift at antenna@xy{4}{2}}
+    \anchor{north west}{\northeast\pgf at x=-\pgf at x\pgf at circ@shift at antenna@xy{1}{2}}
+    \anchor{south east}{\northeast\pgf at y=-\pgf at y\pgf at circ@shift at antenna@xy{4}{4}}
+    \anchor{south west}{\northeast\pgf at y=-\pgf at y\pgf at x=-\pgf at x\pgf at circ@shift at antenna@xy{1}{4}}
+    \anchor{text}{
+        \northeast
+        \pgf at x=\ctikzvalof{monopoles/rxantenna/label/xanchor}\pgf at x
+        \pgf at y=\ctikzvalof{monopoles/rxantenna/label/yanchor}\pgf at y
+    }
     \behindforegroundpath{
         \pgfstartlinewidth=\pgflinewidth
         \pgf at circ@res at step=\ctikzvalof{monopoles/rxantenna/width}\pgf at circ@Rlen
-             
-         \pgfpathmoveto{\pgfpointorigin}
-         \pgfpathlineto{\pgfpoint{4\pgf at circ@res at step}{0pt}}
-         \pgfpathmoveto{\pgfpoint{4\pgf at circ@res at step-0.5\pgflinewidth}{0pt}}
-             \pgfpathlineto{\pgfpoint{4\pgf at circ@res at step-0.5\pgflinewidth}{6\pgf at circ@res at step}}
-             
-         \pgfusepath{draw}
-             
-          \pgfscope   
-          \pgfpathmoveto{\pgfpoint{4\pgf at circ@res at step-0.5\pgflinewidth}{6\pgf at circ@res at step}}
-             \pgfpathlineto{\pgfpoint{5\pgf at circ@res at step-0.5\pgflinewidth}{6\pgf at circ@res at step}}
-             \pgfpathlineto{\pgfpoint{4\pgf at circ@res at step-0.5\pgflinewidth}{4\pgf at circ@res at step}}
-             \pgfpathlineto{\pgfpoint{3\pgf at circ@res at step-0.5\pgflinewidth}{6\pgf at circ@res at step}}
-             \pgfpathlineto{\pgfpoint{4\pgf at circ@res at step-0.5\pgflinewidth}{6\pgf at circ@res at step}}
-             \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
-             \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-             \pgfusepath{draw}
-           \endpgfscope
-           
-           \pgfpathmoveto{\pgfpoint{6\pgf at circ@res at step}{7\pgf at circ@res at step}}
-%             \pgfpatharc{60}{-60}{\pgf at circ@res at step and \pgf at circ@res at step}
-             \pgfpatharc{150}{210}{4\pgf at circ@res at step}              \pgfpathmoveto{\pgfpoint{6.5\pgf at circ@res at step}{6.75\pgf at circ@res at step}}
-             \pgfpatharc{150}{210}{3.5\pgf at circ@res at step}
-             \pgfpathmoveto{\pgfpoint{7\pgf at circ@res at step}{6.5\pgf at circ@res at step}}
-             \pgfpatharc{150}{210}{3\pgf at circ@res at step}
-             \pgfpathmoveto{\pgfpoint{7.5\pgf at circ@res at step}{6.25\pgf at circ@res at step}}
-             \pgfpatharc{150}{210}{2.5\pgf at circ@res at step}
-             \pgfpathmoveto{\pgfpoint{8\pgf at circ@res at step}{6\pgf at circ@res at step}}
-             \pgfpatharc{150}{210}{2\pgf at circ@res at step}
-             \pgfusepath{draw}
-             \pgfsetlinewidth{\pgfstartlinewidth}
-             
-             }
+
+        \pgfpathmoveto{\pgfpointorigin}
+        \pgfpathlineto{\pgfpoint{4\pgf at circ@res at step}{0pt}}
+        \pgfpathmoveto{\pgfpoint{4\pgf at circ@res at step-0.5\pgflinewidth}{0pt}}
+        \pgfpathlineto{\pgfpoint{4\pgf at circ@res at step-0.5\pgflinewidth}{6\pgf at circ@res at step}}
+
+        \pgfusepath{draw}
+
+        \pgfscope
+            \pgfpathmoveto{\pgfpoint{4\pgf at circ@res at step-0.5\pgflinewidth}{6\pgf at circ@res at step}}
+            \pgfpathlineto{\pgfpoint{5\pgf at circ@res at step-0.5\pgflinewidth}{6\pgf at circ@res at step}}
+            \pgfpathlineto{\pgfpoint{4\pgf at circ@res at step-0.5\pgflinewidth}{4\pgf at circ@res at step}}
+            \pgfpathlineto{\pgfpoint{3\pgf at circ@res at step-0.5\pgflinewidth}{6\pgf at circ@res at step}}
+            \pgfpathlineto{\pgfpoint{4\pgf at circ@res at step-0.5\pgflinewidth}{6\pgf at circ@res at step}}
+            \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+            \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+            \pgfusepath{draw}
+        \endpgfscope
+
+        \pgfpathmoveto{\pgfpoint{6\pgf at circ@res at step}{7\pgf at circ@res at step}}
+        %             \pgfpatharc{60}{-60}{\pgf at circ@res at step and \pgf at circ@res at step}
+        \pgfpatharc{150}{210}{4\pgf at circ@res at step}              \pgfpathmoveto{\pgfpoint{6.5\pgf at circ@res at step}{6.75\pgf at circ@res at step}}
+        \pgfpatharc{150}{210}{3.5\pgf at circ@res at step}
+        \pgfpathmoveto{\pgfpoint{7\pgf at circ@res at step}{6.5\pgf at circ@res at step}}
+        \pgfpatharc{150}{210}{3\pgf at circ@res at step}
+        \pgfpathmoveto{\pgfpoint{7.5\pgf at circ@res at step}{6.25\pgf at circ@res at step}}
+        \pgfpatharc{150}{210}{2.5\pgf at circ@res at step}
+        \pgfpathmoveto{\pgfpoint{8\pgf at circ@res at step}{6\pgf at circ@res at step}}
+        \pgfpatharc{150}{210}{2\pgf at circ@res at step}
+        \pgfusepath{draw}
+        \pgfsetlinewidth{\pgfstartlinewidth}
+
+    }
 }
 
 % Vcc
 \pgfdeclareshape{vcc}{
-\anchor{center}{\pgfpointorigin}
-\anchor{text}{
-	\pgf at circ@res at step=\ctikzvalof{monopoles/vcc/width}\pgf at circ@Rlen
-	\pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{2\pgf at circ@res at step+2\ht\pgfnodeparttextbox}}                          
-	\pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{2\pgf at circ@res at step+2\ht\pgfnodeparttextbox}}                
-	\pgf at x=0pt
-	\pgf at y=2\pgf at circ@res at step
-	\advance \pgf at y by 0.5\ht\pgfnodeparttextbox
-	\pgf at x=-.5\wd\pgfnodeparttextbox
-	}
-\behindforegroundpath{                             
-	\pgf at circ@res at step=\ctikzvalof{monopoles/vcc/width}\pgf at circ@Rlen           
-	\pgfscope           
-		\pgfpathmoveto{\pgfpointorigin}
-		\pgfpathlineto{\pgfpoint{0pt}{1.5\pgf at circ@res at step}}
-		\pgfusepath{draw}
+    \savedanchor{\northeast}{%
+        \pgf at circ@res at step=\ctikzvalof{monopoles/vcc/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at circ@res at step
+        \pgf at y=3\pgf at x%
+    }
+    \anchor{north}{\northeast\pgf at x=0cm\relax}
+    \anchor{east}{\northeast\pgf at y=0.5\pgf at y\relax}
+    \anchor{south}{\pgfpointorigin}
+    \anchor{west}{\northeast\pgf at y=0.5\pgf at y\pgf at x=-\pgf at x}
+    \anchor{north east}{\northeast}
+    \anchor{north west}{\northeast\pgf at x=-\pgf at x}
+    \anchor{south east}{\northeast\pgf at y=0pt\relax}
+    \anchor{south west}{\northeast\pgf at y=0pt\pgf at x=-\pgf at x}
+    \anchor{center}{\pgfpointorigin}
+    \anchor{text}{
+        \pgf at circ@res at step=\ctikzvalof{monopoles/vcc/width}\pgf at circ@Rlen
+        \pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{2\pgf at circ@res at step+2\ht\pgfnodeparttextbox}}
+        \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{2\pgf at circ@res at step+2\ht\pgfnodeparttextbox}}
+        \pgf at x=0pt
+        \pgf at y=2\pgf at circ@res at step
+        \advance \pgf at y by 0.5\ht\pgfnodeparttextbox
+        \pgf at x=-.5\wd\pgfnodeparttextbox
+    }
+    \behindforegroundpath{
+        \pgf at circ@res at step=\ctikzvalof{monopoles/vcc/width}\pgf at circ@Rlen
+        \pgfscope
+            \pgfpathmoveto{\pgfpointorigin}
+            \pgfpathlineto{\pgfpoint{0pt}{1.5\pgf at circ@res at step}}
+            \pgfusepath{draw}
 
-		\pgfstartlinewidth=\pgflinewidth
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+            \pgfstartlinewidth=\pgflinewidth
+            \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
 
-		\pgfpathmoveto{\pgfpoint{-0.5\pgf at circ@res at step}{.8\pgf at circ@res at step}}
-		\pgfpathlineto{\pgfpoint{0}{1.5\pgf at circ@res at step}}
-		\pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at step}{.8\pgf at circ@res at step}}
-		\pgfusepath{draw}
-																						
-		\pgfsetlinewidth{\pgfstartlinewidth}
+            \pgfpathmoveto{\pgfpoint{-0.5\pgf at circ@res at step}{.8\pgf at circ@res at step}}
+            \pgfpathlineto{\pgfpoint{0}{1.5\pgf at circ@res at step}}
+            \pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at step}{.8\pgf at circ@res at step}}
+            \pgfusepath{draw}
 
-	\endpgfscope
-}
+            \pgfsetlinewidth{\pgfstartlinewidth}
 
+        \endpgfscope
+    }
+
 }
 
 % Vee
 \pgfdeclareshape{vee}{
-\anchor{center}{\pgfpointorigin}
-\anchor{text}{
-	\pgf at circ@res at step=\ctikzvalof{monopoles/vcc/width}\pgf at circ@Rlen
-	\pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-2\pgf at circ@res at step-2\ht\pgfnodeparttextbox}}                        
-	\pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{-2\pgf at circ@res at step-2\ht\pgfnodeparttextbox}}        
-	\pgf at x=0pt
-	\pgf at y=-2\pgf at circ@res at step
-	\advance \pgf at y by -1.5\ht\pgfnodeparttextbox
-	\pgf at x=-.5\wd\pgfnodeparttextbox
-	}
+    \savedanchor{\northeast}{%
+        \pgf at circ@res at step=\ctikzvalof{monopoles/vcc/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at circ@res at step
+        \pgf at y=-3\pgf at x%
+    }
+    \anchor{south}{\northeast\pgf at x=0cm\relax}
+    \anchor{east}{\northeast\pgf at y=0.5\pgf at y\relax}
+    \anchor{north}{\pgfpointorigin}
+    \anchor{west}{\northeast\pgf at y=0.5\pgf at y\pgf at x=-\pgf at x}
+    \anchor{south east}{\northeast}
+    \anchor{south west}{\northeast\pgf at x=-\pgf at x}
+    \anchor{north east}{\northeast\pgf at y=0pt\relax}
+    \anchor{north west}{\northeast\pgf at y=0pt\pgf at x=-\pgf at x}
+    \anchor{center}{\pgfpointorigin}
+    \anchor{text}{
+        \pgf at circ@res at step=\ctikzvalof{monopoles/vcc/width}\pgf at circ@Rlen
+        \pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-2\pgf at circ@res at step-2\ht\pgfnodeparttextbox}}
+        \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{-2\pgf at circ@res at step-2\ht\pgfnodeparttextbox}}
+        \pgf at x=0pt
+        \pgf at y=-2\pgf at circ@res at step
+        \advance \pgf at y by -1.5\ht\pgfnodeparttextbox
+        \pgf at x=-.5\wd\pgfnodeparttextbox
+    }
 
-\behindforegroundpath{                             
-	\pgf at circ@res at step=\ctikzvalof{monopoles/vcc/width}\pgf at circ@Rlen
-	
-	\pgfscope                           
-		\pgfpathmoveto{\pgfpointorigin}
-		\pgfpathlineto{\pgfpoint{0pt}{-1.5\pgf at circ@res at step}}
-		\pgfusepath{draw}
+    \behindforegroundpath{
+        \pgf at circ@res at step=\ctikzvalof{monopoles/vcc/width}\pgf at circ@Rlen
 
-		\pgfstartlinewidth=\pgflinewidth
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+        \pgfscope
+            \pgfpathmoveto{\pgfpointorigin}
+            \pgfpathlineto{\pgfpoint{0pt}{-1.5\pgf at circ@res at step}}
+            \pgfusepath{draw}
 
-		\pgfpathmoveto{\pgfpoint{-0.5\pgf at circ@res at step}{-.8\pgf at circ@res at step}}
-		\pgfpathlineto{\pgfpoint{0}{-1.5\pgf at circ@res at step}}
-		\pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at step}{-.8\pgf at circ@res at step}}
-		\pgfusepath{draw}
-		\pgfsetlinewidth{\pgfstartlinewidth}
+            \pgfstartlinewidth=\pgflinewidth
+            \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
 
-	\endpgfscope
-}
+            \pgfpathmoveto{\pgfpoint{-0.5\pgf at circ@res at step}{-.8\pgf at circ@res at step}}
+            \pgfpathlineto{\pgfpoint{0}{-1.5\pgf at circ@res at step}}
+            \pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at step}{-.8\pgf at circ@res at step}}
+            \pgfusepath{draw}
+            \pgfsetlinewidth{\pgfstartlinewidth}
 
+        \endpgfscope
+    }
+
 }
 
 
 % match
 \pgfdeclareshape{match}{
-	\anchor{center}{
-		\pgfpointorigin
-	}
-	\anchor{text}{
-		\pgf at x=\ctikzvalof{monopoles/match/width}\pgf at circ@Rlen
-		\pgf at x=1.5\pgf at x
-		\advance \pgf at x by -.5\wd\pgfnodeparttextbox
-		\pgf at y=-1.5\ht\pgfnodeparttextbox
-	}
-	\behindforegroundpath{		
-		\pgf at circ@res at step=\ctikzvalof{monopoles/match/width}\pgf at circ@Rlen
-		
-		\pgfscope		
-			\pgfpathmoveto{\pgfpointorigin}
-			\pgfpathlineto{\pgfpoint{2\pgf at circ@res at step}{0pt}}
-			\pgfusepath{draw}
+    \savedanchor{\northeast}{%
+        \pgf at circ@res at step = \ctikzvalof{monopoles/match/width} \pgf at circ@Rlen
+        \pgf at x=2\pgf at circ@res at step
+        \pgf at circ@res at step = \ctikzvalof{monopoles/match/width} \pgf at circ@Rlen
+        \pgf at y=.5\pgf at circ@res at step%
+    }
+    % the center is on the left side of the shape for facility of usage
+    \anchor{north}{\northeast\pgf at x=0.5\pgf at x\relax}
+    \anchor{east}{\northeast\pgf at y=0cm\relax}
+    \anchor{south}{\northeast\pgf at y=0pt\pgf at x=0.5\pgf at x\relax}
+    \anchor{west}{\pgfpointorigin}
+    \anchor{north east}{\northeast}
+    \anchor{north west}{\northeast\pgf at x=0cm\relax}
+    \anchor{south east}{\northeast\pgf at y=0pt\relax}
+    \anchor{south west}{\pgfpointorigin}
+    \anchor{center}{
+        \pgfpointorigin
+    }
+    \anchor{text}{
+        \pgf at x=\ctikzvalof{monopoles/match/width}\pgf at circ@Rlen
+        \pgf at x=1.5\pgf at x
+        \advance \pgf at x by -.5\wd\pgfnodeparttextbox
+        \pgf at y=-1.5\ht\pgfnodeparttextbox
+    }
+    \behindforegroundpath{
+        \pgf at circ@res at step=\ctikzvalof{monopoles/match/width}\pgf at circ@Rlen
 
-			\pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
-			\pgfpathlineto{\pgfpoint{2\pgf at circ@res at step}{0.5\pgf at circ@res at step}}
-			\pgfpathlineto{\pgfpoint{2\pgf at circ@res at step}{0}}
-			\pgfusepath{fill}
-									
-			\pgfsetlinewidth{\pgfstartlinewidth}
-	
-		\endpgfscope
-	}
+        \pgfscope
+            \pgfpathmoveto{\pgfpointorigin}
+            \pgfpathlineto{\pgfpoint{2\pgf at circ@res at step}{0pt}}
+            \pgfusepath{draw}
 
+            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
+            \pgfpathlineto{\pgfpoint{2\pgf at circ@res at step}{0.5\pgf at circ@res at step}}
+            \pgfpathlineto{\pgfpoint{2\pgf at circ@res at step}{0}}
+            \pgfusepath{fill}
+
+            \pgfsetlinewidth{\pgfstartlinewidth}
+
+        \endpgfscope
+    }
 }
 
-
 \endinput

Added: trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircmultipoles.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircmultipoles.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircmultipoles.tex	2019-05-10 21:15:08 UTC (rev 51071)
@@ -0,0 +1,559 @@
+% Copyright 2007-2009 by Massimo Redaelli
+% Copyright 2019 by Romano Giannetti
+%
+% 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 files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Multipoles
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% counters for pin accounting...
+\newcount\pgf at circ@count at c
+\newcount\pgf at circ@count at b
+\def\pgf at circ@dip at pin@shift{0.5}
+\def\pgf at circ@qfp at pin@shift{0.25}
+
+% derived from https://tex.stackexchange.com/a/146753/38080
+% original author Mark Wibrow
+% Thanks also to John Kormylo https://tex.stackexchange.com/a/372996/38080
+% a lot of thanks to @marmot  for the un-rotation hint
+% https://tex.stackexchange.com/a/473571/38080
+
+% DIP (dual in line package) chips
+
+\pgfdeclareshape{dipchip}{
+    \savedanchor\centerpoint{%
+        \pgf at x=-.5\wd\pgfnodeparttextbox%
+        \pgf at y=-.5\ht\pgfnodeparttextbox%
+        \advance\pgf at y by+.5\dp\pgfnodeparttextbox%
+    }%
+    \savedanchor\origin{\pgfpoint{0pt}{0pt}}
+    \anchor{center}{\origin}
+    \anchor{text}{\centerpoint}% to adjust text
+    \saveddimen\height{%
+        \pgfmathsetlength\pgf at x{((\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/num pins})
+        *\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/pin spacing})*\pgf at circ@Rlen/2}%
+    }%
+    \saveddimen{\chipspacing}{\pgfmathsetlength\pgf at x{\pgf at circ@Rlen*\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/pin spacing}}}
+    \saveddimen{\width}{\pgfmathsetlength\pgf at x{\pgf at circ@Rlen*\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/width}}}
+    \saveddimen{\extshift}{\pgfmathsetlength\pgf at x{\pgf at circ@Rlen*\pgfkeysvalueof{/tikz/circuitikz/multipoles/external pins width}}}
+    % standard anchors
+    \savedanchor\northwest{%
+        \pgfmathsetlength\pgf at y{0.5*((\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/num pins})
+        *\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/pin spacing})*\pgf at circ@Rlen/2}%
+        \pgfmathsetlength\pgf at x{-0.5*\pgf at circ@Rlen*\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/width}}
+    }
+    \anchor{dot}{\northwest
+        \pgfmathsetlength\pgf at x{\pgf at x + 0.3*\chipspacing}
+        \pgfmathsetlength\pgf at y{\pgf at y - 0.3*\chipspacing}
+    }
+    \anchor{nw}{\northwest}
+    \anchor{ne}{\northwest\pgf at x=-\pgf at x}
+    \anchor{se}{\northwest\pgf at x=-\pgf at x\pgf at y=-\pgf at y}
+    \anchor{sw}{\northwest\pgf at y=-\pgf at y}
+    \anchor{north west}{\northwest}
+    \anchor{north east}{\northwest\pgf at x=-\pgf at x}
+    \anchor{south east}{\northwest\pgf at x=-\pgf at x \pgf at y=-\pgf at y}
+    \anchor{south west}{\northwest\pgf at y=-\pgf at y}
+    \anchor{n}{\northwest\pgf at x=0pt }
+    \anchor{e}{\northwest\pgf at x=-\pgf at x\pgf at y=0pt }
+    \anchor{s}{\northwest\pgf at x=0pt\pgf at y=-\pgf at y}
+    \anchor{w}{\northwest\pgf at y=0pt }
+    \anchor{north}{\northwest\pgf at x=0pt }
+    \anchor{east}{\northwest\pgf at x=-\pgf at x\pgf at y=0pt }
+    \anchor{south}{\northwest\pgf at x=0pt\pgf at y=-\pgf at y}
+    \anchor{west}{\northwest\pgf at y=0pt }
+    % start drawing
+    \backgroundpath{%
+        \northwest
+        \pgf at circ@res at up = \pgf at y
+        \pgf at circ@res at down = -\pgf at y
+        \pgf at circ@res at right = -\pgf at x
+        \pgf at circ@res at left = \pgf at x
+        \pgf at circ@res at step = \pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/pin spacing}\pgf at circ@Rlen
+        \pgf at circ@res at other = \pgfkeysvalueof{/tikz/circuitikz/multipoles/external pins width}\pgf at circ@Rlen
+        \pgfscope% (for the line width)
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/multipoles/thickness}\pgflinewidth}
+        \pgfpathrectanglecorners{\pgfpoint{-\width/2}{-\height/2}}{\pgfpoint{\width/2}{\height/2}}%
+        \pgf at circ@draworfill
+        %% upside mark
+        \ifpgf at circuit@chip at topmark
+            \pgfpathmoveto{\pgfpoint{0.2*\pgf at circ@res at left}{\pgf at circ@res at up}}
+            \pgfpatharc{0}{180}{0.2*\pgf at circ@res at left}
+        \fi
+        \pgfusepath{stroke}%
+        \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+        % Adding the pin number
+        \ifpgf at circuit@chip at shownumbers
+            \c at pgf@counta=\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/num pins}%
+            \divide\c at pgf@counta by 2 \pgf at circ@count at b=\c at pgf@counta
+            % thanks to @marmot: https://tex.stackexchange.com/a/473571/38080
+            \ifpgf at circuit@chip at straightnumbers
+                \pgfgettransformentries\a\b\temp\temp\temp\temp
+                \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
+                \pgfmathtruncatemacro{\quadrant}{mod(4+int(360+(\rot+45)/90),4)}
+            \else
+                \pgfmathsetmacro{\rot}{0}
+                \pgfmathsetmacro{\quadrant}{0}
+            \fi
+            \def\pgf at circ@strut{\vrule width 0pt height 1em depth 0.4em\relax}
+            \def\mytext{\pgfkeysvalueof{/tikz/circuitikz/multipoles/font}\space\pgf at circ@strut\the\pgf at circ@count at c\space}
+            \pgfmathloop%
+            \ifnum\c at pgf@counta>0
+                \ifcase\quadrant % rotation 0
+                    % left
+                    \pgf at circ@count at c=\c at pgf@counta
+                    \pgftext[left,
+                        at=\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up+(\pgf at circ@dip at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step},
+                        rotate=\rot]{\mytext}
+                    % right
+                    \pgf at circ@count at c=\numexpr2*\pgf at circ@count at b-\c at pgf@counta+1\relax
+                    \pgftext[right,
+                        at=\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up+(\pgf at circ@dip at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step},
+                        rotate=\rot]{\mytext}
+                \or % rotation -90
+                    % left
+                    \pgf at circ@count at c=\c at pgf@counta
+                    \pgftext[top,
+                        at=\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up+(\pgf at circ@dip at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step},
+                        rotate=\rot]{\mytext}
+                    % right
+                    \pgf at circ@count at c=\numexpr2*\pgf at circ@count at b-\c at pgf@counta+1\relax
+                    \pgftext[bottom,
+                        at=\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up+(\pgf at circ@dip at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step},
+                        rotate=\rot]{\mytext}
+                \or %rotation 180
+                    % left
+                    \pgf at circ@count at c=\c at pgf@counta
+                    \pgftext[right,
+                        at=\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up+(\pgf at circ@dip at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step},
+                        rotate=\rot]{\mytext}
+                    % right
+                    \pgf at circ@count at c=\numexpr2*\pgf at circ@count at b-\c at pgf@counta+1\relax
+                    \pgftext[left,
+                        at=\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up+(\pgf at circ@dip at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step},
+                        rotate=\rot]{\mytext}
+                \or % rotation +90
+                    % left
+                    \pgf at circ@count at c=\c at pgf@counta
+                    \pgftext[bottom,
+                        at=\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up+(\pgf at circ@dip at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step},
+                        rotate=\rot]{\mytext}
+                    % right
+                    \pgf at circ@count at c=\numexpr2*\pgf at circ@count at b-\c at pgf@counta+1\relax
+                    \pgftext[top,
+                        at=\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up+(\pgf at circ@dip at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step},
+                        rotate=\rot]{\mytext}
+                \fi
+                \advance\c at pgf@counta-1\relax%
+                \repeatpgfmathloop
+            \fi
+            \endpgfscope
+            \ifdim\pgf at circ@res at other>0pt
+            \pgfscope
+                \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/multipoles/external pins thickness}\pgflinewidth}
+                \c at pgf@counta=\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/num pins}%
+                \divide\c at pgf@counta by 2 \pgf at circ@count at b=\c at pgf@counta
+                \pgfmathloop%
+                \ifnum\c at pgf@counta>0
+                    \edef\padfrac{\pgfkeysvalueof{/tikz/circuitikz/multipoles/external pad fraction}}
+                    \ifnum\padfrac>0
+                        \pgf at circ@res at temp=\pgf at circ@res at step\divide\pgf at circ@res at temp by \padfrac
+                        % left side pads
+                        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at temp+\pgf at circ@res at up+(\pgf at circ@dip at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}}
+                        \pgfpathlineto{\pgfpoint{\pgf at circ@res at left-\pgf at circ@res at other}{\pgf at circ@res at temp+\pgf at circ@res at up+(\pgf at circ@dip at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}}
+                        \pgfpathlineto{\pgfpoint{\pgf at circ@res at left-\pgf at circ@res at other}{-\pgf at circ@res at temp+\pgf at circ@res at up+(\pgf at circ@dip at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}}
+                        \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{-\pgf at circ@res at temp+\pgf at circ@res at up+(\pgf at circ@dip at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}}
+                        % right side pads
+                        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at temp+\pgf at circ@res at up+(\pgf at circ@dip at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}}
+                        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right+\pgf at circ@res at other}{\pgf at circ@res at temp+\pgf at circ@res at up+(\pgf at circ@dip at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}}
+                        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right+\pgf at circ@res at other}{-\pgf at circ@res at temp+\pgf at circ@res at up+(\pgf at circ@dip at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}}
+                        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{-\pgf at circ@res at temp+\pgf at circ@res at up+(\pgf at circ@dip at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}}
+                    \else
+                        % left side pins
+                        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up+(\pgf at circ@dip at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}}
+                        \pgfpathlineto{\pgfpoint{\pgf at circ@res at left-\pgf at circ@res at other}{\pgf at circ@res at up+(\pgf at circ@dip at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}}
+                        % right side pins
+                        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up+(\pgf at circ@dip at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}}
+                        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right+\pgf at circ@res at other}{\pgf at circ@res at up+(\pgf at circ@dip at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}}
+                    \fi
+                    \advance\c at pgf@counta by -1\relax%
+                \repeatpgfmathloop
+                \pgfusepath{stroke}
+            \endpgfscope
+            \fi
+        }%
+        % \pgf at sh@s@<name of the shape here> contains all the code for the shape
+        % and is executed just before a node is drawn.
+        \pgfutil at g@addto at macro\pgf at sh@s at dipchip{%
+            % Start with the maximum pin number and go backwards.
+            % If the anchor is undefined, create it. Otherwise stop.
+            \c at pgf@counta=\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/num pins}%
+            \divide\c at pgf@counta by 2 \pgf at circ@count at b=\c at pgf@counta
+            \pgfmathloop%
+            \ifnum\c at pgf@counta>0
+                % left side, pins 1..npins/2
+                % we will create two anchors per pin: the "normal one" like `pin 1` for the
+                % electrical contact, and the "border one" like `bpin 1` for labels.
+                % they will coincide if `external pins width` is set to 0.
+                \expandafter\xdef\csname pgf at anchor@dipchip at bpin\space\the\c at pgf@counta\endcsname{%
+                    \noexpand\pgf at circ@chippinanchorLB{\the\c at pgf@counta}%
+                }
+                \expandafter\xdef\csname pgf at anchor@dipchip at pin\space\the\c at pgf@counta\endcsname{%
+                    \noexpand\pgf at circ@chippinanchorL{\the\c at pgf@counta}%
+                }
+                % right side
+                \pgf at circ@count at c=\numexpr2*\pgf at circ@count at b-\c at pgf@counta+1\relax
+                \expandafter\xdef\csname pgf at anchor@dipchip at bpin\space\the\pgf at circ@count at c\endcsname{%
+                    \noexpand\pgf at circ@chippinanchorRB{\the\c at pgf@counta}%
+                }%
+                \expandafter\xdef\csname pgf at anchor@dipchip at pin\space\the\pgf at circ@count at c\endcsname{%
+                    \noexpand\pgf at circ@chippinanchorR{\the\c at pgf@counta}%
+                }%
+                \advance\c at pgf@counta by -1\relax%
+                \repeatpgfmathloop%
+            }%
+        }
+
+% QFP (quad flat package) chips
+
+\pgfdeclareshape{qfpchip}{
+    \savedanchor\centerpoint{%
+        \pgf at x=-.5\wd\pgfnodeparttextbox%
+        \pgf at y=-.5\ht\pgfnodeparttextbox%
+        \advance\pgf at y by+.5\dp\pgfnodeparttextbox%
+    }%
+    \savedanchor\origin{\pgfpoint{0pt}{0pt}}
+    \anchor{center}{\origin}
+    \anchor{text}{\centerpoint}% to adjust text
+    \saveddimen\height{%
+        \pgfmathsetlength\pgf at x{((\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/num pins}+2)
+        *\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/pin spacing})*\pgf at circ@Rlen/4}%
+    }%
+    \saveddimen\width{%
+        \pgfmathsetlength\pgf at x{((\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/num pins}+2)
+        *\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/pin spacing})*\pgf at circ@Rlen/4}%
+    }%
+    \saveddimen{\chipspacing}{\pgfmathsetlength\pgf at x{\pgf at circ@Rlen*\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/pin spacing}}}
+    \saveddimen{\extshift}{\pgfmathsetlength\pgf at x{\pgf at circ@Rlen*\pgfkeysvalueof{/tikz/circuitikz/multipoles/external pins width}}}
+    % standard anchors
+    \savedanchor\northwest{%
+        \pgfmathsetlength\pgf at y{0.5*((\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/num pins}+2)
+        *\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/pin spacing})*\pgf at circ@Rlen/4}%
+        \pgf at x=-\pgf at y
+    }
+    \anchor{dot}{\northwest
+        \pgfmathsetlength\pgf at x{\pgf at x + 0.3*\chipspacing}
+        \pgfmathsetlength\pgf at y{\pgf at y - 0.3*\chipspacing}
+    }
+    \anchor{nw}{\northwest}
+    \anchor{ne}{\northwest\pgf at x=-\pgf at x}
+    \anchor{se}{\northwest\pgf at x=-\pgf at x\pgf at y=-\pgf at y}
+    \anchor{sw}{\northwest\pgf at y=-\pgf at y}
+    \anchor{north west}{\northwest}
+    \anchor{north east}{\northwest\pgf at x=-\pgf at x}
+    \anchor{south east}{\northwest\pgf at x=-\pgf at x \pgf at y=-\pgf at y}
+    \anchor{south west}{\northwest\pgf at y=-\pgf at y}
+    \anchor{n}{\northwest\pgf at x=0pt }
+    \anchor{e}{\northwest\pgf at x=-\pgf at x\pgf at y=0pt }
+    \anchor{s}{\northwest\pgf at x=0pt\pgf at y=-\pgf at y}
+    \anchor{w}{\northwest\pgf at y=0pt }
+    \anchor{north}{\northwest\pgf at x=0pt }
+    \anchor{east}{\northwest\pgf at x=-\pgf at x\pgf at y=0pt }
+    \anchor{south}{\northwest\pgf at x=0pt\pgf at y=-\pgf at y}
+    \anchor{west}{\northwest\pgf at y=0pt }
+    % start drawing
+    \backgroundpath{%
+        \northwest
+        \pgf at circ@res at up = \pgf at y
+        \pgf at circ@res at down = -\pgf at y
+        \pgf at circ@res at right = -\pgf at x
+        \pgf at circ@res at left = \pgf at x
+        \pgf at circ@res at step = \pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/pin spacing}\pgf at circ@Rlen
+        \pgf at circ@res at other = \pgfkeysvalueof{/tikz/circuitikz/multipoles/external pins width}\pgf at circ@Rlen
+        \pgfscope% (for the line width)
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/multipoles/thickness}\pgflinewidth}
+        %% upside mark
+        \ifpgf at circuit@chip at topmark
+            \pgfpathmoveto{\pgfpoint{-\width/2}{\height/2-\pgf at circ@res at step/2}}
+            \pgfpathlineto{\pgfpoint{-\width/2+\pgf at circ@res at step/2}{\height/2}}
+        \else
+            \pgfpathmoveto{\pgfpoint{-\width/2}{\height/2}}
+        \fi
+        %% rest of the shape
+        \pgfpathlineto{\pgfpoint{\width/2}{\height/2}}
+        \pgfpathlineto{\pgfpoint{\width/2}{-\height/2}}
+        \pgfpathlineto{\pgfpoint{-\width/2}{-\height/2}}
+        \pgfpathclose
+        \pgf at circ@draworfill
+        % Adding the pin number
+        \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+        \ifpgf at circuit@chip at shownumbers
+            \c at pgf@counta=\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/num pins}%
+            \divide\c at pgf@counta by 4 \pgf at circ@count at b=\c at pgf@counta
+            % thanks to @marmot: https://tex.stackexchange.com/a/473571/38080
+            \ifpgf at circuit@chip at straightnumbers
+                \pgfgettransformentries\a\b\temp\temp\temp\temp
+                \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
+                \pgfmathtruncatemacro{\quadrant}{mod(4+int(360+(\rot+45)/90),4)}
+            \else
+                \pgfmathsetmacro{\rot}{0}
+                \pgfmathsetmacro{\quadrant}{0}
+            \fi
+            \def\pgf at circ@strut{\vrule width 0pt height 1em depth 0.4em\relax}
+            \def\mytext{\pgfkeysvalueof{/tikz/circuitikz/multipoles/font}\space\pgf at circ@strut\the\pgf at circ@count at c\space}
+            \pgfmathloop%
+            \ifnum\c at pgf@counta>0
+                \ifcase\quadrant % rotation 0
+                    % left
+                    \pgf at circ@count at c=\c at pgf@counta
+                    \pgftext[left,
+                        at=\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up+(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step},
+                        rotate=\rot]{\mytext}
+                    % bottom
+                    \pgf at circ@count at c=\numexpr\pgf at circ@count at b+\c at pgf@counta\relax
+                    \pgftext[bottom,
+                        at=\pgfpoint{\pgf at circ@res at left-(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}{\pgf at circ@res at down},
+                        rotate=\rot]{\mytext}
+                    % right
+                    \pgf at circ@count at c=\numexpr3*\pgf at circ@count at b-\c at pgf@counta+1\relax
+                    \pgftext[right,
+                        at=\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up+(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step},
+                        rotate=\rot]{\mytext}
+                    % top
+                    \pgf at circ@count at c=\numexpr3*\pgf at circ@count at b+\c at pgf@counta\relax
+                    \pgftext[top,
+                        at=\pgfpoint{\pgf at circ@res at right+(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}{\pgf at circ@res at up},
+                        rotate=\rot]{\mytext}
+                \or % rotation -90
+                    % left
+                    \pgf at circ@count at c=\c at pgf@counta
+                    \pgftext[top,
+                        at=\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up+(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step},
+                        rotate=\rot]{\mytext}
+                    % bottom
+                    \pgf at circ@count at c=\numexpr\pgf at circ@count at b+\c at pgf@counta\relax
+                    \pgftext[left,
+                        at=\pgfpoint{\pgf at circ@res at left-(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}{\pgf at circ@res at down},
+                        rotate=\rot]{\mytext}
+                    % right
+                    \pgf at circ@count at c=\numexpr3*\pgf at circ@count at b-\c at pgf@counta+1\relax
+                    \pgftext[bottom,
+                        at=\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up+(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step},
+                        rotate=\rot]{\mytext}
+                    % top
+                    \pgf at circ@count at c=\numexpr3*\pgf at circ@count at b+\c at pgf@counta\relax
+                    \pgftext[right,
+                        at=\pgfpoint{\pgf at circ@res at right+(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}{\pgf at circ@res at up},
+                        rotate=\rot]{\mytext}
+                \or %rotation 180
+                    % left
+                    \pgf at circ@count at c=\c at pgf@counta
+                    \pgftext[right,
+                        at=\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up+(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step},
+                        rotate=\rot]{\mytext}
+                    % bottom
+                    \pgf at circ@count at c=\numexpr\pgf at circ@count at b+\c at pgf@counta\relax
+                    \pgftext[top,
+                        at=\pgfpoint{\pgf at circ@res at left-(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}{\pgf at circ@res at down},
+                        rotate=\rot]{\mytext}
+                    % right
+                    \pgf at circ@count at c=\numexpr3*\pgf at circ@count at b-\c at pgf@counta+1\relax
+                    \pgftext[left,
+                        at=\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up+(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step},
+                        rotate=\rot]{\mytext}
+                    % top
+                    \pgf at circ@count at c=\numexpr3*\pgf at circ@count at b+\c at pgf@counta\relax
+                    \pgftext[bottom,
+                        at=\pgfpoint{\pgf at circ@res at right+(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}{\pgf at circ@res at up},
+                        rotate=\rot]{\mytext}
+                \or % rotation +90
+                    % left
+                    \pgf at circ@count at c=\c at pgf@counta
+                    \pgftext[bottom,
+                        at=\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up+(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step},
+                        rotate=\rot]{\mytext}
+                    % bottom
+                    \pgf at circ@count at c=\numexpr\pgf at circ@count at b+\c at pgf@counta\relax
+                    \pgftext[right,
+                        at=\pgfpoint{\pgf at circ@res at left-(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}{\pgf at circ@res at down},
+                        rotate=\rot]{\mytext}
+                    % right
+                    \pgf at circ@count at c=\numexpr3*\pgf at circ@count at b-\c at pgf@counta+1\relax
+                    \pgftext[top,
+                        at=\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up+(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step},
+                        rotate=\rot]{\mytext}
+                    % top
+                    \pgf at circ@count at c=\numexpr3*\pgf at circ@count at b+\c at pgf@counta\relax
+                    \pgftext[left,
+                        at=\pgfpoint{\pgf at circ@res at right+(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}{\pgf at circ@res at up},
+                        rotate=\rot]{\mytext}
+                \fi
+                \advance\c at pgf@counta-1\relax%
+                \repeatpgfmathloop
+            \fi
+            \endpgfscope
+            \ifdim\pgf at circ@res at other>0pt
+            \pgfscope
+                \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/multipoles/external pins thickness}\pgflinewidth}
+                \c at pgf@counta=\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/num pins}%
+                \divide\c at pgf@counta by 4 \pgf at circ@count at b=\c at pgf@counta
+                \pgfmathloop%
+                \ifnum\c at pgf@counta>0
+                    \edef\padfrac{\pgfkeysvalueof{/tikz/circuitikz/multipoles/external pad fraction}}
+                    \ifnum\padfrac>0
+                        \pgf at circ@res at temp=\pgf at circ@res at step\divide\pgf at circ@res at temp by \padfrac
+                        % left side pads
+                        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at temp+\pgf at circ@res at up+(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}}
+                        \pgfpathlineto{\pgfpoint{\pgf at circ@res at left-\pgf at circ@res at other}{\pgf at circ@res at temp+\pgf at circ@res at up+(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}}
+                        \pgfpathlineto{\pgfpoint{\pgf at circ@res at left-\pgf at circ@res at other}{-\pgf at circ@res at temp+\pgf at circ@res at up+(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}}
+                        \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{-\pgf at circ@res at temp+\pgf at circ@res at up+(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}}
+                        % bottom side pads
+                        \pgfpathmoveto{\pgfpoint{-\pgf at circ@res at temp+\pgf at circ@res at left-(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}{\pgf at circ@res at down}}
+                        \pgfpathlineto{\pgfpoint{-\pgf at circ@res at temp+\pgf at circ@res at left-(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}{\pgf at circ@res at down-\pgf at circ@res at other}}
+                        \pgfpathlineto{\pgfpoint{\pgf at circ@res at temp+\pgf at circ@res at left-(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}{\pgf at circ@res at down-\pgf at circ@res at other}}
+                        \pgfpathlineto{\pgfpoint{\pgf at circ@res at temp+\pgf at circ@res at left-(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}{\pgf at circ@res at down}}
+                        % right side pads
+                        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at temp+\pgf at circ@res at up+(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}}
+                        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right+\pgf at circ@res at other}{\pgf at circ@res at temp+\pgf at circ@res at up+(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}}
+                        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right+\pgf at circ@res at other}{-\pgf at circ@res at temp+\pgf at circ@res at up+(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}}
+                        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{-\pgf at circ@res at temp+\pgf at circ@res at up+(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}}
+                        % top side pads
+                        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at temp+\pgf at circ@res at right+(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}{\pgf at circ@res at up}}
+                        \pgfpathlineto{\pgfpoint{\pgf at circ@res at temp+\pgf at circ@res at right+(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}{\pgf at circ@res at up+\pgf at circ@res at other}}
+                        \pgfpathlineto{\pgfpoint{-\pgf at circ@res at temp+\pgf at circ@res at right+(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}{\pgf at circ@res at up+\pgf at circ@res at other}}
+                        \pgfpathlineto{\pgfpoint{-\pgf at circ@res at temp+\pgf at circ@res at right+(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}{\pgf at circ@res at up}}
+                    \else
+                        % left side pins
+                        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up+(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}}
+                        \pgfpathlineto{\pgfpoint{\pgf at circ@res at left-\pgf at circ@res at other}{\pgf at circ@res at up+(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}}
+                        % bottom side pins
+                        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left-(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}{\pgf at circ@res at down}}
+                        \pgfpathlineto{\pgfpoint{\pgf at circ@res at left-(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}{\pgf at circ@res at down-\pgf at circ@res at other}}
+                        % right side pins
+                        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up+(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}}
+                        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right+\pgf at circ@res at other}{\pgf at circ@res at up+(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}}
+                        % top side pins
+                        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right+(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}{\pgf at circ@res at up}}
+                        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right+(\pgf at circ@qfp at pin@shift-\the\c at pgf@counta)*\pgf at circ@res at step}{\pgf at circ@res at up+\pgf at circ@res at other}}
+                    \fi
+                    \advance\c at pgf@counta-1\relax%
+                \repeatpgfmathloop
+                \pgfusepath{stroke}
+            \endpgfscope
+            \fi
+        }%
+        % \pgf at sh@s@<name of the shape here> contains all the code for the shape
+        % and is executed just before a node is drawn.
+        \pgfutil at g@addto at macro\pgf at sh@s at qfpchip{%
+            % Start with the maximum pin number and go backwards.
+            % If the anchor is undefined, create it. Otherwise stop.
+            \c at pgf@counta=\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/num pins}%
+            \divide\c at pgf@counta by 4 \pgf at circ@count at b=\c at pgf@counta
+            \pgfmathloop%
+            \ifnum\c at pgf@counta>0
+                % left side; 1..npins/4
+                \expandafter\xdef\csname pgf at anchor@qfpchip at pin\space\the\c at pgf@counta\endcsname{%
+                    \noexpand\pgf at circ@chippinanchorQL{\the\c at pgf@counta}%
+                }
+                \expandafter\xdef\csname pgf at anchor@qfpchip at bpin\space\the\c at pgf@counta\endcsname{%
+                    \noexpand\pgf at circ@chippinanchorQLB{\the\c at pgf@counta}%
+                }
+                % bottom side;
+                \pgf at circ@count at c=\numexpr2*\pgf at circ@count at b-\c at pgf@counta+1\relax
+                \expandafter\xdef\csname pgf at anchor@qfpchip at pin\space\the\pgf at circ@count at c\endcsname{%
+                    \noexpand\pgf at circ@chippinanchorQB{\the\c at pgf@counta}%
+                }
+                \expandafter\xdef\csname pgf at anchor@qfpchip at bpin\space\the\pgf at circ@count at c\endcsname{%
+                    \noexpand\pgf at circ@chippinanchorQBB{\the\c at pgf@counta}%
+                }
+                % right side; 2*npins/4+1, 3*npins/4
+                \pgf at circ@count at c=\numexpr3*\pgf at circ@count at b-\c at pgf@counta+1\relax
+                \expandafter\xdef\csname pgf at anchor@qfpchip at pin\space\the\pgf at circ@count at c\endcsname{%
+                    \noexpand\pgf at circ@chippinanchorQR{\the\c at pgf@counta}%
+                }
+                \expandafter\xdef\csname pgf at anchor@qfpchip at bpin\space\the\pgf at circ@count at c\endcsname{%
+                    \noexpand\pgf at circ@chippinanchorQRB{\the\c at pgf@counta}%
+                }
+                % top side
+                \pgf at circ@count at c=\numexpr3*\pgf at circ@count at b+\c at pgf@counta\relax
+                \expandafter\xdef\csname pgf at anchor@qfpchip at pin\space\the\pgf at circ@count at c\endcsname{%
+                    \noexpand\pgf at circ@chippinanchorQT{\the\c at pgf@counta}%
+                }
+                \expandafter\xdef\csname pgf at anchor@qfpchip at bpin\space\the\pgf at circ@count at c\endcsname{%
+                    \noexpand\pgf at circ@chippinanchorQTB{\the\c at pgf@counta}%
+                }
+                \advance\c at pgf@counta-1\relax%
+                \repeatpgfmathloop%
+            }%
+        }
+
+%% anchors for DIP
+\def\pgf at circ@chippinanchorR#1{%
+  % When this macro is called,
+  % \extshift, \height and \chipspacing will be defined.
+    \pgfpoint{\width/2+\extshift}{\height/2+(\pgf at circ@dip at pin@shift-#1)*\chipspacing}%
+}
+\def\pgf at circ@chippinanchorL#1{%
+  % When this macro is called,
+  % \extshift, \height and \chipspacing will be defined.
+    \pgfpoint{-\width/2-\extshift}{\height/2+(\pgf at circ@dip at pin@shift-#1)*\chipspacing}%
+}
+\def\pgf at circ@chippinanchorRB#1{%
+  % When this macro is called,
+  % \extshift, \height and \chipspacing will be defined.
+    \pgfpoint{\width/2}{\height/2+(\pgf at circ@dip at pin@shift-#1)*\chipspacing}%
+}
+\def\pgf at circ@chippinanchorLB#1{%
+  % When this macro is called,
+  % \extshift, \height and \chipspacing will be defined.
+    \pgfpoint{-\width/2}{\height/2+(\pgf at circ@dip at pin@shift-#1)*\chipspacing}%
+}
+
+%% anchors for QFP
+\def\pgf at circ@chippinanchorQR#1{%
+  % When this macro is called,
+  % \extshift, \height and \chipspacing will be defined.
+    \pgfpoint{\width/2+\extshift}{\height/2+(\pgf at circ@qfp at pin@shift-#1)*\chipspacing}%
+}
+\def\pgf at circ@chippinanchorQL#1{%
+  % When this macro is called,
+  % \extshift, \height and \chipspacing will be defined.
+    \pgfpoint{-\width/2-\extshift}{\height/2+(\pgf at circ@qfp at pin@shift-#1)*\chipspacing}%
+}
+\def\pgf at circ@chippinanchorQT#1{%
+  % When this macro is called,
+  % \extshift, \height and \chipspacing will be defined.
+    \pgfpoint{\width/2+(\pgf at circ@qfp at pin@shift-#1)*\chipspacing}{\height/2+\extshift}%
+}
+\def\pgf at circ@chippinanchorQB#1{%
+  % When this macro is called,
+  % \extshift, \height and \chipspacing will be defined.
+    \pgfpoint{\width/2+(\pgf at circ@qfp at pin@shift-#1)*\chipspacing}{-\height/2-\extshift}%
+}
+\def\pgf at circ@chippinanchorQRB#1{%
+  % When this macro is called,
+  % \extshift, \height and \chipspacing will be defined.
+    \pgfpoint{\width/2}{\height/2+(\pgf at circ@qfp at pin@shift-#1)*\chipspacing}%
+}
+\def\pgf at circ@chippinanchorQLB#1{%
+  % When this macro is called,
+  % \extshift, \height and \chipspacing will be defined.
+    \pgfpoint{-\width/2}{\height/2+(\pgf at circ@qfp at pin@shift-#1)*\chipspacing}%
+}
+\def\pgf at circ@chippinanchorQTB#1{%
+  % When this macro is called,
+  % \extshift, \height and \chipspacing will be defined.
+    \pgfpoint{\width/2+(\pgf at circ@qfp at pin@shift-#1)*\chipspacing}{\height/2}%
+}
+\def\pgf at circ@chippinanchorQBB#1{%
+  % When this macro is called,
+  % \extshift, \height and \chipspacing will be defined.
+    \pgfpoint{\width/2+(\pgf at circ@qfp at pin@shift-#1)*\chipspacing}{-\height/2}%
+}
+


Property changes on: trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircmultipoles.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex	2019-05-10 21:14:43 UTC (rev 51070)
+++ trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex	2019-05-10 21:15:08 UTC (rev 51071)
@@ -3,7 +3,7 @@
 
 % Names
 \ctikzset{name/.style = { n=#1 } } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@@@
-\ctikzset{n/.code = { 
+\ctikzset{n/.code = {
 	\pgfkeys{/tikz/circuitikz/bipole/name=#1}
 }}
 
@@ -33,118 +33,110 @@
 
 % Initialize paths
 \def\pgfcircresetpath{
-	\ctikzset{bipole/name=, bipole/label/name=, bipole/label/position=90, ,bipole/annotation/name=, bipole/annotation/position=-90, 
-		bipole/inverted=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 voltageoutsideofsymbol=false,bipole/is strokedsymbol=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
-   }
+    \ctikzset{bipole/name=, bipole/label/name=, bipole/label/position=90, ,bipole/annotation/name=, bipole/annotation/position=-90,
+        bipole/inverted=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 voltageoutsideofsymbol=false,bipole/is strokedsymbol=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
+    }
 }
 
 %% Helper function for path-function to ensure using anchors between nodes
 \def\set at explicit@center at anchor#1{
-	\pgfutil at ifundefined{pgf at sh@ns@#1}
-	{
-	%This coordinate is no node(but a relative position or a coordinate), no further handling needed
-	}{
-	\pgfutil at in@.{#1}
-	\ifpgfutil at in@
-	% Anchor is used, do nothing!
-	\else%
-		\let\tikz at moveto@waiting=\relax
-		\pgfpathmoveto{\tikz at last@position}%force movement, because tikz at moveto@waiting
-		\edef#1{#1.center}%ensure using center anchor
-	\fi
-	}
+    \pgfutil at ifundefined{pgf at sh@ns@#1}
+    {
+        %This coordinate is no node(but a relative position or a coordinate), no further handling needed
+        }{
+        \pgfutil at in@.{#1}
+        \ifpgfutil at in@
+            % Anchor is used, do nothing!
+    \else%
+        \let\tikz at moveto@waiting=\relax
+        \pgfpathmoveto{\tikz at last@position}%force movement, because tikz at moveto@waiting
+        \edef#1{#1.center}%ensure using center anchor
+    \fi
 }
+}
 
 
 %% Generic bipole path
 \def\pgf at circ@bipole at path#1#2{
 
-\pgfextra{
-		\set at explicit@center at anchor{\tikztostart}
-		\set at explicit@center at anchor{\tikztotarget}
-		\pgfsyssoftpath at getcurrentpath{\myp at th}%% save current path to extend after calculation of correct start/end coordinates
-		\ctikzset{bipole/kind = #1}
-		\edef\pgf at temp{\ctikzvalof{bipole/name}}
-		\def\pgf at circ@temp{}
-		\ifx\pgf at temp\pgf at circ@temp % if it has not a name
-			\pgfmathrandominteger{\pgf at circ@rand}{1000}{9999}
-			\ctikzset{bipole/name = #2\pgf at circ@rand} % create it
-		\fi
-	}
-	
-		(\tikztostart) coordinate (\ctikzvalof{bipole/name}start)%necessary to get correct coordinates in the case of relativ start/end or constructions like ((node1)-|(node2))
-		(\tikztotarget) coordinate (\ctikzvalof{bipole/name}end)
-		\pgfextra{
-			\pgfmathanglebetweenpoints{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}}
-							{\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}}
-			\edef\pgf at circ@direction{\pgfmathresult}%Calculate direction(angle) of path
-			\pgfsyssoftpath at setcurrentpath{\myp at th}		
-		}
-	\pgfextra{\def\pgf at temp{open}\def\pgf at circ@temp{#1}}
-	\ifx\pgf at temp\pgf at circ@temp  % if it is an open
-	\else
-		--($(\ctikzvalof{bipole/name}start) ! .5\pgflinewidth ! (\ctikzvalof{bipole/name}end)$) %ugly workaround to get correct linejoins(node breaks path?)
-	\fi
-		($(\tikztostart) ! .5 ! (\tikztotarget)$)%%positio of middle node 
-		node[#1shape, rotate=\pgf at circ@direction, yscale=\ctikzvalof{mirror value}, xscale=\ctikzvalof{invert value}] 
-			(\ctikzvalof{bipole/name}) {}
-			\ifpgf at circuit@bipole at inverted
-				\ifcsname pgf at anchor@#1shape at pathstart\endcsname%if special path-anchors are defined, use them!
-					coordinate	(anchorstartnode) at (\ctikzvalof{bipole/name}.pathend)
-					coordinate	(anchorendnode) at (\ctikzvalof{bipole/name}.pathstart)
-				\else
-					coordinate	(anchorstartnode) at (\ctikzvalof{bipole/name}.right)
-					coordinate	(anchorendnode) at (\ctikzvalof{bipole/name}.left)
-				\fi
-			\else
-				\ifcsname pgf at anchor@#1shape at pathstart\endcsname%if special path-anchors are defined, use them!
-					coordinate	(anchorstartnode) at (\ctikzvalof{bipole/name}.pathstart)
-					coordinate	(anchorendnode) at (\ctikzvalof{bipole/name}.pathend)
-				\else
-					coordinate	(anchorstartnode) at (\ctikzvalof{bipole/name}.left)
-					coordinate	(anchorendnode) at (\ctikzvalof{bipole/name}.right)
-				\fi
-			\fi
-	\pgfextra{\def\pgf at temp{open}\def\pgf at circ@temp{#1}}
-	\ifx\pgf at temp\pgf at circ@temp  % if it is an open
-	\else
-		\ifpgf at circuit@bipole at strokedsymbol%draw line thrue symbol(e.g. diodes)
-			\ifcsname pgf at anchor@#1shape at strokepathstart\endcsname%if special path-anchors are defined, use them!
-				(\ctikzvalof{bipole/name}start.center) -- (\ctikzvalof{bipole/name}.strokepathstart)
-				(\ctikzvalof{bipole/name}.strokepathend)  -- (\ctikzvalof{bipole/name}end.center)
-			\else
-				(\ctikzvalof{bipole/name}start.center) -- (\ctikzvalof{bipole/name}end.center)
-			\fi
-		\else		
-			(\ctikzvalof{bipole/name}start.center) -- (anchorstartnode)
-			(anchorendnode)  -- (\ctikzvalof{bipole/name}end.center)
-		\fi
-	\fi
-	
-	\drawpoles
-	\pgf at circ@ifkeyempty{bipole/label/name}\else\pgf at circ@drawlabels{label}\fi
-	\pgf at circ@ifkeyempty{bipole/annotation/name}\else\pgf at circ@drawlabels{annotation}\fi
-	\pgf at circ@ifkeyempty{bipole/voltage/label/name}\else\pgf at circ@drawvoltage\fi
-	\pgf at circ@ifkeyempty{bipole/current/label/name}\else\pgf at circ@drawcurrent\fi
-	\pgf at circ@ifkeyempty{bipole/flow/label/name}\else\pgf at circ@drawflow\fi
-	\pgfextra{\def\pgf at temp{open}\def\pgf at circ@temp{#1}}
-	\ifx\pgf at temp\pgf at circ@temp  % if it is an open
-		(\ctikzvalof{bipole/name}end)%Move to end of path
-	\else
-		($(\ctikzvalof{bipole/name}end) ! .5\pgflinewidth ! (\ctikzvalof{bipole/name}start)$) -- (\ctikzvalof{bipole/name}end)%ugly workaround to get correct linejoins(node breaks path?)
-		%tikztostart and tikztotarget could not be used, because it would break if target coordinate is something like (node1-|node2)
-		
-	\fi
-	% reset
-	\pgfextra{
-		\pgfcircresetpath
-	}  
-	\tikztonodes%draw pending nodes an path
+    \pgfextra{
+        \set at explicit@center at anchor{\tikztostart}
+        \set at explicit@center at anchor{\tikztotarget}
+        \pgfsyssoftpath at getcurrentpath{\myp at th}%% save current path to extend after calculation of correct start/end coordinates
+        \ctikzset{bipole/kind = #1}
+        \edef\pgf at temp{\ctikzvalof{bipole/name}}
+        \def\pgf at circ@temp{}
+        \ifx\pgf at temp\pgf at circ@temp % if it has not a name
+            \pgfmathrandominteger{\pgf at circ@rand}{1000}{9999}
+            \ctikzset{bipole/name = #2\pgf at circ@rand} % create it
+        \fi
+    }
+
+    (\tikztostart) coordinate (\ctikzvalof{bipole/name}start)%necessary to get correct coordinates in the case of relative start/end or constructions like ((node1)-|(node2))
+    (\tikztotarget) coordinate (\ctikzvalof{bipole/name}end)
+    \pgfextra{
+        \pgfmathanglebetweenpoints{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}}
+        {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}}
+        \pgfmathround{\pgfmathresult}
+        \edef\pgf at circ@direction{\pgfmathresult}%Calculate direction(angle) of path
+        \pgfsyssoftpath at setcurrentpath{\myp at th}
+    }
+    \pgfextra{\def\pgf at temp{open}\def\pgf at circ@temp{#1}}
+    \ifx\pgf at temp\pgf at circ@temp  % if it is an open
+        \else
+            --($(\ctikzvalof{bipole/name}start) ! .5\pgflinewidth ! (\ctikzvalof{bipole/name}end)$) %ugly workaround to get correct linejoins(node breaks path?)
+        \fi
+        ($(\tikztostart) ! .5 ! (\tikztotarget)$)%%positio of middle node
+        node[#1shape, rotate=\pgf at circ@direction, yscale=\ctikzvalof{mirror value}, xscale=\ctikzvalof{invert value}]
+        (\ctikzvalof{bipole/name}) {}
+        \ifpgf at circuit@bipole at inverted
+            \ifcsname pgf at anchor@#1shape at pathstart\endcsname%if special path-anchors are defined, use them!
+                coordinate	(anchorstartnode) at (\ctikzvalof{bipole/name}.pathend)
+                coordinate	(anchorendnode) at (\ctikzvalof{bipole/name}.pathstart)
+            \else
+                coordinate	(anchorstartnode) at (\ctikzvalof{bipole/name}.right)
+                coordinate	(anchorendnode) at (\ctikzvalof{bipole/name}.left)
+            \fi
+            \else
+            \ifcsname pgf at anchor@#1shape at pathstart\endcsname%if special path-anchors are defined, use them!
+                coordinate	(anchorstartnode) at (\ctikzvalof{bipole/name}.pathstart)
+                coordinate	(anchorendnode) at (\ctikzvalof{bipole/name}.pathend)
+            \else
+                coordinate	(anchorstartnode) at (\ctikzvalof{bipole/name}.left)
+                coordinate	(anchorendnode) at (\ctikzvalof{bipole/name}.right)
+            \fi
+        \fi
+        \pgfextra{\def\pgf at temp{open}\def\pgf at circ@temp{#1}}
+        \ifx\pgf at temp\pgf at circ@temp  % if it is an open
+        \else
+            (\ctikzvalof{bipole/name}start.center) -- (anchorstartnode)
+            (anchorendnode)  -- (\ctikzvalof{bipole/name}end.center)
+        \fi
+
+        \drawpoles
+        \pgf at circ@ifkeyempty{bipole/label/name}\else\pgf at circ@drawlabels{label}\fi
+        \pgf at circ@ifkeyempty{bipole/annotation/name}\else\pgf at circ@drawlabels{annotation}\fi
+        \pgf at circ@ifkeyempty{bipole/voltage/label/name}\else\pgf at circ@drawvoltage\fi
+        \pgf at circ@ifkeyempty{bipole/current/label/name}\else\pgf at circ@drawcurrent\fi
+        \pgf at circ@ifkeyempty{bipole/flow/label/name}\else\pgf at circ@drawflow\fi
+        \pgfextra{\def\pgf at temp{open}\def\pgf at circ@temp{#1}}
+        \ifx\pgf at temp\pgf at circ@temp  % if it is an open
+            (\ctikzvalof{bipole/name}end)%Move to end of path
+        \else
+            ($(\ctikzvalof{bipole/name}end) ! .5\pgflinewidth ! (\ctikzvalof{bipole/name}start)$) -- (\ctikzvalof{bipole/name}end)%ugly workaround to get correct linejoins(node breaks path?)
+            %tikztostart and tikztotarget could not be used, because it would break if target coordinate is something like (node1-|node2)
+
+        \fi
+    % reset
+    \pgfextra{
+        \pgfcircresetpath
+    }
+    \tikztonodes%draw pending nodes an path
 }
 
 
@@ -151,6 +143,7 @@
 %% Path definitions
 \def\pgf at circ@resistor at path#1{\ifpgf at circuit@europeanresistor\pgf at circ@bipole at path{generic}{#1}\else\pgf at circ@bipole at path{resistor}{#1}\fi}
 \def\pgf at circ@vresistor at path#1{\ifpgf at circuit@europeanresistor\pgf at circ@bipole at path{tgeneric}{#1}\else\pgf at circ@bipole at path{vresistor}{#1}\fi}
+\def\pgf at circ@sresistor at path#1{\ifpgf at circuit@europeanresistor\pgf at circ@bipole at path{thermistor}{#1}\else\pgf at circ@bipole at path{resistivesens}{#1}\fi}
 \def\pgf at circ@potentiometer at path#1{\ifpgf at circuit@europeanresistor\pgf at circ@bipole at path{genericpotentiometer}{#1}\else\pgf at circ@bipole at path{potentiometer}{#1}\fi}
 \def\pgf at circ@thermistor at path#1{\pgf at circ@bipole at path{thermistor}{#1}}
 \def\pgf at circ@thermistorptc at path#1{\pgf at circ@bipole at path{thermistorptc}{#1}}
@@ -157,6 +150,7 @@
 \def\pgf at circ@thermistorntc at path#1{\pgf at circ@bipole at path{thermistorntc}{#1}}
 \def\pgf at circ@varistor at path#1{\pgf at circ@bipole at path{varistor}{#1}}
 \def\pgf at circ@capacitor at path#1{\pgf at circ@bipole at path{capacitor}{#1}}
+\def\pgf at circ@capacitivesens at path#1{\pgf at circ@bipole at path{capacitivesens}{#1}}
 \def\pgf at circ@ecapacitor at path#1{\pgf at circ@bipole at path{ecapacitor}{#1}}
 \def\pgf at circ@polarcapacitor at path#1{\pgf at circ@bipole at path{polarcapacitor}{#1}}
 \def\pgf at circ@vcapacitor at path#1{\pgf at circ@bipole at path{vcapacitor}{#1}}
@@ -167,42 +161,63 @@
 \def\pgf at circ@europeaninductor at path#1{\pgf at circ@bipole at path{fullgeneric}{#1}}
 \def\pgf at circ@americaninductor at path#1{\pgf at circ@bipole at path{americaninductor}{#1}}
 \def\pgf at circ@cuteinductor at path#1{\pgf at circ@bipole at path{cuteinductor}{#1}}
+\def\pgf at circ@cutechoke at path#1{\pgf at circ@bipole at path{cutechoke}{#1}}
 \def\pgf at circ@inductor at path#1{%
-	\pgfextra{
-		\edef\pgf at circ@temp{\ctikzvalof{inductor}}%
-		\def\pgf at temp{european}%
-	}
-	\ifx\pgf at temp\pgf at circ@temp%
-		\pgf at circ@europeaninductor at path{#1}%
-	\else%
-		\pgfextra{	\def\pgf at temp{cute} }%
-		\ifx\pgf at temp\pgf at circ@temp%
-			\pgf at circ@cuteinductor at path{#1}%
-		\else%
-			\pgf at circ@americaninductor at path{#1}%
-		\fi%
-	\fi%
+    \pgfextra{
+        \edef\pgf at circ@temp{\ctikzvalof{inductor}}%
+        \def\pgf at temp{european}%
+    }
+    \ifx\pgf at temp\pgf at circ@temp%
+        \pgf at circ@europeaninductor at path{#1}%
+    \else%
+        \pgfextra{	\def\pgf at temp{cute} }%
+        \ifx\pgf at temp\pgf at circ@temp%
+            \pgf at circ@cuteinductor at path{#1}%
+        \else%
+            \pgf at circ@americaninductor at path{#1}%
+        \fi%
+    \fi%
 }
 \def\pgf at circ@vinductor at path#1{
-	\pgfextra{
-		\edef\pgf at circ@temp{\ctikzvalof{inductor}}%
-		\def\pgf at temp{european}%
-	}
-	\ifx\pgf at temp\pgf at circ@temp%
-		\pgf at circ@veuropeaninductor at path{#1}%
-	\else%
-		\pgfextra{	\def\pgf at temp{cute} }%
-		\ifx\pgf at temp\pgf at circ@temp%
-			\pgf at circ@vcuteinductor at path{#1}%
-		\else%
-			\pgf at circ@vamericaninductor at path{#1}%
-		\fi%
-	\fi%
+    \pgfextra{
+        \edef\pgf at circ@temp{\ctikzvalof{inductor}}%
+        \def\pgf at temp{european}%
+    }
+    \ifx\pgf at temp\pgf at circ@temp%
+        \pgf at circ@veuropeaninductor at path{#1}%
+    \else%
+        \pgfextra{	\def\pgf at temp{cute} }%
+        \ifx\pgf at temp\pgf at circ@temp%
+            \pgf at circ@vcuteinductor at path{#1}%
+        \else%
+            \pgf at circ@vamericaninductor at path{#1}%
+        \fi%
+    \fi%
 }
+\def\pgf at circ@inductivesens at path#1{%
+    \pgfextra{
+        \edef\pgf at circ@temp{\ctikzvalof{inductor}}%
+        \def\pgf at temp{european}%
+    }
+    \ifx\pgf at temp\pgf at circ@temp%
+        \pgf at circ@europeaninductivesens at path{#1}%
+    \else%
+        \pgfextra{	\def\pgf at temp{cute} }%
+        \ifx\pgf at temp\pgf at circ@temp%
+            \pgf at circ@cuteinductivesens at path{#1}%
+        \else%
+            \pgf at circ@americaninductivesens at path{#1}%
+        \fi%
+    \fi%
+}
 \def\pgf at circ@veuropeaninductor at path#1{\pgf at circ@bipole at path{tfullgeneric}{#1}}
 \def\pgf at circ@vamericaninductor at path#1{\pgf at circ@bipole at path{vamericaninductor}{#1}}
 \def\pgf at circ@vcuteinductor at path#1{\pgf at circ@bipole at path{vcuteinductor}{#1}}
+\def\pgf at circ@europeaninductivesens at path#1{\pgf at circ@bipole at path{sfullgeneric}{#1}}
+\def\pgf at circ@americaninductivesens at path#1{\pgf at circ@bipole at path{samericaninductor}{#1}}
+\def\pgf at circ@cuteinductivesens at path#1{\pgf at circ@bipole at path{scuteinductor}{#1}}
 \def\pgf at circ@lamp at path#1{\pgf at circ@bipole at path{lamp}{#1}}
+\def\pgf at circ@bulb at path#1{\pgf at circ@bipole at path{bulb}{#1}}
 \def\pgf at circ@esource at path#1{\pgf at circ@bipole at path{esource}{#1}}
 \def\pgf at circ@pvsource at path#1{\pgf at circ@bipole at path{pvsource}{#1}}
 \def\pgf at circ@vsource at path#1{\pgf at circ@bipole at path{vsource}{#1}}
@@ -228,6 +243,7 @@
 \def\pgf at circ@nos at path#1{\pgf at circ@bipole at path{nos}{#1}}
 \def\pgf at circ@ncs at path#1{\pgf at circ@bipole at path{ncs}{#1}}
 \def\pgf at circ@pushbutton at path#1{\pgf at circ@bipole at path{pushbutton}{#1}}
+\def\pgf at circ@ncpushbutton at path#1{\pgf at circ@bipole at path{ncpushbutton}{#1}}
 \def\pgf at circ@open at path#1{\pgf at circ@bipole at path{open}{#1}}
 \def\pgf at circ@generic at path#1{\pgf at circ@bipole at path{generic}{#1}}
 \def\pgf at circ@ageneric at path#1{\pgf at circ@bipole at path{ageneric}{#1}}
@@ -237,6 +253,7 @@
 \def\pgf at circ@ammeter at path#1{\pgf at circ@bipole at path{ammeter}{#1}}
 \def\pgf at circ@ohmmeter at path#1{\pgf at circ@bipole at path{ohmmeter}{#1}}
 \def\pgf at circ@voltmeter at path#1{\pgf at circ@bipole at path{voltmeter}{#1}}
+\def\pgf at circ@oscope at path#1{\pgf at circ@bipole at path{oscope}{#1}}
 \def\pgf at circ@empty at path#1{}
 \def\pgf at circ@photoresistor at path#1{\pgf at circ@bipole at path{photoresistor}{#1}}
 \def\pgf at circ@emptythyristor at path#1{\pgf at circ@bipole at path{emptythyristor}{#1}}
@@ -246,6 +263,7 @@
 \def\pgf at circ@emptytriac at path#1{\pgf at circ@bipole at path{emptytriac}{#1}}
 \def\pgf at circ@fulltriac at path#1{\pgf at circ@bipole at path{fulltriac}{#1}}
 \def\pgf at circ@tline at path#1{\pgf at circ@bipole at path{tline}{#1}}
+\def\pgf at circ@mstline at path#1{\pgf at circ@bipole at path{mstline}{#1}}
 \def\pgf at circ@squid at path#1{\pgf at circ@bipole at path{squid}{#1}}
 \def\pgf at circ@barrier at path#1{\pgf at circ@bipole at path{barrier}{#1}}
 \def\pgf at circ@thermocouple at path#1{\pgf at circ@bipole at path{thermocouple}{#1}}
@@ -280,10 +298,8 @@
 \def\pgf at circ@spring at path#1{\pgf at circ@bipole at path{spring}{#1}}
 \def\pgf at circ@mass at path#1{\pgf at circ@bipole at path{mass}{#1}}
 \def\pgf at circ@damper at path#1{\pgf at circ@bipole at path{damper}{#1}}
+\def\pgf at circ@viscoe at path#1{\pgf at circ@bipole at path{viscoe}{#1}}
 
-
-
-
 %% Styles
 
 \def\comnpatname{\ifpgf at circuit@compat *\else\fi}
@@ -296,6 +312,7 @@
 \compattikzset{spring/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@spring at path, l=#1}}
 \compattikzset{mass/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@mass at path, l=#1}}
 \compattikzset{damper/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@damper at path, l=#1}}
+\compattikzset{viscoe/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@viscoe at path, l=#1}}
 \compattikzset{resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf at circ@resistor at path, l=#1}}
 \compattikzset{american resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf at circ@bipole at path{resistor}{#1}, l=#1}}
 \compattikzset{european resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf at circ@bipole at path{generic}{#1}, l=#1}}
@@ -326,6 +343,7 @@
 \compattikzset{gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@gfsurgearrester at path, l=#1}}
 \compattikzset{american inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@americaninductor at path, l=#1}}
 \compattikzset{cute inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@cuteinductor at path, l=#1}}
+\compattikzset{cute choke/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@cutechoke at path, l=#1}}
 \compattikzset{european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@europeaninductor at path, l=#1}}
 \compattikzset{variable inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@vinductor at path, l=#1}}
 \compattikzset{variable european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@veuropeaninductor at path, l=#1}}
@@ -334,6 +352,7 @@
 \compattikzset{tline/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@tline at path, l=#1}}
 \compattikzset{transmission line/.style = {tline = #1}}
 \compattikzset{TL/.style = {tline = #1}}
+\compattikzset{mstline/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@mstline at path, l=#1}}
 \compattikzset{european voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@vsource at path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
 \compattikzset{american voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@vsourceam at path, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
 \compattikzset{european current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@isource at path, \circuitikzbasekey/bipole/is current=true, i=#1}}
@@ -364,6 +383,7 @@
 \compattikzset{open/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@open at path}}
 
 \compattikzset{lamp/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@lamp at path}}
+\compattikzset{bulb/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@bulb at path, l=#1}}
 
 \compattikzset{squid/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@squid at path}}
 \compattikzset{barrier/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@barrier at path}}
@@ -392,7 +412,7 @@
 \compattikzset{detector/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@detector at path}}
 
 % % % % % %
-% % Beginn of Diodes
+% % Begin of Diodes
 % % % % % %
 
 \def\pgf at circ@fulldiode at path#1{\pgf at circ@bipole at path{fulldiode}{#1}}
@@ -403,6 +423,7 @@
 \def\pgf at circ@fulllediode at path#1{\pgf at circ@bipole at path{fulllediode}{#1}}
 \def\pgf at circ@fullpdiode at path#1{\pgf at circ@bipole at path{fullpdiode}{#1}}
 \def\pgf at circ@fullvarcap at path#1{\pgf at circ@bipole at path{fullvarcap}{#1}}
+\def\pgf at circ@fullbidirectionaldiode at path#1{\pgf at circ@bipole at path{fullbidirectionaldiode}{#1}}
 \def\pgf at circ@emptydiode at path#1{\pgf at circ@bipole at path{emptydiode}{#1}}
 \def\pgf at circ@emptyzdiode at path#1{\pgf at circ@bipole at path{emptyzdiode}{#1}}
 \def\pgf at circ@emptyzzdiode at path#1{\pgf at circ@bipole at path{emptyzzdiode}{#1}}
@@ -411,6 +432,7 @@
 \def\pgf at circ@emptylediode at path#1{\pgf at circ@bipole at path{emptylediode}{#1}}
 \def\pgf at circ@emptypdiode at path#1{\pgf at circ@bipole at path{emptypdiode}{#1}}
 \def\pgf at circ@emptyvarcap at path#1{\pgf at circ@bipole at path{emptyvarcap}{#1}}
+\def\pgf at circ@emptybidirectionaldiode at path#1{\pgf at circ@bipole at path{emptybidirectionaldiode}{#1}}
 
 \compattikzset{full diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@fulldiode at path}}
 \compattikzset{full Schottky diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@fullsdiode at path}}
@@ -420,6 +442,7 @@
 \compattikzset{full photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@fullpdiode at path}}
 \compattikzset{full led/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@fulllediode at path}}
 \compattikzset{full varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@fullvarcap at path}}
+\compattikzset{full bidirectionaldiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@fullbidirectionaldiode at path}}
 \compattikzset{full thyristor/.style =  {\circuitikzbasekey, /tikz/to path=\pgf at circ@fullthyristor at path}}
 \compattikzset{full triac/.style =  {\circuitikzbasekey, /tikz/to path=\pgf at circ@fulltriac at path}}
 
@@ -431,6 +454,7 @@
 \compattikzset{empty photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@emptypdiode at path}}
 \compattikzset{empty led/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@emptylediode at path}}
 \compattikzset{empty varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@emptyvarcap at path}}
+\compattikzset{empty bidirectionaldiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@emptybidirectionaldiode at path}}
 \compattikzset{empty thyristor/.style =  {\circuitikzbasekey, /tikz/to path=\pgf at circ@emptythyristor at path}}
 \compattikzset{empty triac/.style =  {\circuitikzbasekey, /tikz/to path=\pgf at circ@emptytriac at path}}
 
@@ -457,6 +481,7 @@
 \compattikzset{diode/.style = {\comnpatname \pgfcircdiodestylemacro diode}}
 \compattikzset{thyristor/.style =  {\comnpatname \pgfcircdiodestylemacro thyristor}}
 \compattikzset{triac/.style =  {\comnpatname \ifpgf at circuit@fulldiode full \else empty \fi triac}}%no stroke triac!
+\compattikzset{bidirectionaldiode/.style =  {\comnpatname \ifpgf at circuit@fulldiode full \else empty \fi bidirectionaldiode}}%no stroke bidirectionaldiode! (based on triac)
 
 %% Define Shortcuts
 \compattikzset{Do/.style = {\comnpatname empty diode}}
@@ -467,6 +492,7 @@
 \compattikzset{pDo/.style = {\comnpatname empty photodiode}}
 \compattikzset{leDo/.style = {\comnpatname empty led}}
 \compattikzset{VCo/.style = {\comnpatname empty varcap}}
+\compattikzset{biDo/.style = {\comnpatname empty bidirectionaldiode}}
 \compattikzset{Tyo/.style = {\comnpatname empty thyristor}}
 \compattikzset{Tro/.style = {\comnpatname empty triac}}
 
@@ -478,6 +504,7 @@
 \compattikzset{pD*/.style = {\comnpatname full photodiode}}
 \compattikzset{leD*/.style = {\comnpatname full led}}
 \compattikzset{VC*/.style = {\comnpatname full varcap}}
+\compattikzset{biD*/.style = {\comnpatname full bidirectionaldiode}}
 \compattikzset{Ty*/.style = {\comnpatname full thyristor}}
 \compattikzset{Tr*/.style = {\comnpatname full triac}}
 
@@ -489,6 +516,7 @@
 \compattikzset{pD/.style = {\comnpatname photodiode}}
 \compattikzset{leD/.style = {\comnpatname led}}
 \compattikzset{VC/.style = {\comnpatname varcap}}
+\compattikzset{biD/.style = {\comnpatname bidirectionaldiode}}
 \compattikzset{Ty/.style = {\comnpatname thyristor}}
 \compattikzset{Tr/.style = {\comnpatname triac}}
 
@@ -502,6 +530,7 @@
 \compattikzset{VC-/.style = {\comnpatname stroke varcap}}
 \compattikzset{Ty-/.style = {\comnpatname stroke thyristor}}
 \compattikzset{Tr-/.style = {\comnpatname empty triac}}%no stroke triac!
+\compattikzset{biD-/.style = {\comnpatname empty bidirectionaldiode}}%no stroke bidirectionaldiode! (based on triac)
 
 % % % % % %
 % % End of Diodes
@@ -517,12 +546,39 @@
 \compattikzset{normal open switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@nos at path, l=#1}}
 \compattikzset{switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@cspst at path, l=#1}}
 \compattikzset{push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@pushbutton at path, l=#1}}
+\compattikzset{nopb/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@pushbutton at path, l=#1}}
+\compattikzset{normally open push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@pushbutton at path, l=#1}}
+\compattikzset{ncpb/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@ncpushbutton at path, l=#1}}
+\compattikzset{normally closed push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@ncpushbutton at path, l=#1}}
 \compattikzset{toggle switch/.style =  {\circuitikzbasekey, /tikz/to path=\pgf at circ@toggleswitch at path}}
 
 \compattikzset{ammeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@ammeter at path}}
 \compattikzset{voltmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@voltmeter at path}}
 \compattikzset{ohmmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@ohmmeter at path}}
+\tikzset{oscope/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@oscope at path, l=#1}}
 
+% cute switches
+%% closed cute switch
+\def\pgf at circ@cuteclosedswitch at path#1{\pgf at circ@bipole at path{cuteclosedswitch}{#1}}
+\compattikzset{cute closed switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@cuteclosedswitch at path, l=#1}}
+\compattikzset{ccsw/.style= {\comnpatname cute closed switch= #1}}
+
+%% open cute switch
+\def\pgf at circ@cuteopenswitch at path#1{\pgf at circ@bipole at path{cuteopenswitch}{#1}}
+\compattikzset{cute open switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@cuteopenswitch at path, l=#1}}
+\compattikzset{cosw/.style= {\comnpatname cute open switch= #1}}
+
+%% closing cute switch
+\def\pgf at circ@cuteclosingswitch at path#1{\pgf at circ@bipole at path{cuteclosingswitch}{#1}}
+\compattikzset{cute closing switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@cuteclosingswitch at path, l=#1}}
+\compattikzset{ccgsw/.style= {\comnpatname cute closing switch= #1}}
+
+%% opening cute switch
+\def\pgf at circ@cuteopeningswitch at path#1{\pgf at circ@bipole at path{cuteopeningswitch}{#1}}
+\compattikzset{cute opening switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@cuteopeningswitch at path, l=#1}}
+\compattikzset{cogsw/.style= {\comnpatname cute opening switch= #1}}
+
+
 % short forms
 \compattikzset{esource/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@esource at path, \circuitikzbasekey/bipole/is voltage=true,\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true,  v=#1}}
 \compattikzset{pvsource/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@pvsource at path, \circuitikzbasekey/bipole/is voltage=true,\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true,  v=#1}}
@@ -549,7 +605,6 @@
 \compattikzset{controlled isourcesin/.style = {\comnpatname controlled sinusoidal current source = #1}}
 
 \compattikzset{R/.style= {\comnpatname resistor = #1}}
-%\ifpgf at 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}}
@@ -569,13 +624,13 @@
 \compattikzset{sqV/.style = {\comnpatname square voltage source = #1}}
 \compattikzset{tV/.style = {\comnpatname triangle voltage source = #1}}
 \compattikzset{csV/.style = {\comnpatname controlled sinusoidal voltage source = #1}}
-\def\pgf at 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} } 
+\def\pgf at 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 at temp{_>} \pgf at temp{_<} \pgf at temp{^>} \pgf at temp{^<} 
+\pgf at temp{_>} \pgf at temp{_<} \pgf at temp{^>} \pgf at temp{^<}
 \pgf at temp{>} \pgf at temp{<} \pgf at temp{^} \pgf at temp{_}
 
 %current sources
@@ -583,18 +638,64 @@
 \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 at 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} } 
+\def\pgf at 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 at temp{_>} \pgf at temp{_<} \pgf at temp{^>} \pgf at temp{^<}
 \pgf at temp{>_} \pgf at temp{<_} \pgf at temp{>^} \pgf at temp{<^}
 \pgf at temp{>} \pgf at temp{<} \pgf at temp{^} \pgf at temp{_}
 
+% cute sources
+\def\pgf at circ@vsourceC at path#1{\pgf at circ@bipole at path{vsourceC}{#1}}
+\compattikzset{cute european voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@vsourceC at path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{vsourceC/.style= {\comnpatname cute european voltage source= #1}}
+\compattikzset{ceV/.style= {\comnpatname cute european voltage source= #1}}
 
+\def\pgf at circ@isourceC at path#1{\pgf at circ@bipole at path{isourceC}{#1}}
+\compattikzset{cute european current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@isourceC at path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{isourceC/.style= {\comnpatname cute european current source= #1}}
+\compattikzset{ceI/.style= {\comnpatname cute european current source= #1}}
 
+\def\pgf at circ@cvsourceC at path#1{\pgf at circ@bipole at path{cvsourceC}{#1}}
+\compattikzset{cute european controlled voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@cvsourceC at path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{cvsourceC/.style= {\comnpatname cute european controlled voltage source= #1}}
+\compattikzset{cceV/.style= {\comnpatname cute european controlled voltage source= #1}}
+
+\def\pgf at circ@cisourceC at path#1{\pgf at circ@bipole at path{cisourceC}{#1}}
+\compattikzset{cute european controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@cisourceC at path,  \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{cisourceC/.style= {\comnpatname cute european controlled current source= #1}}
+\compattikzset{cceI/.style= {\comnpatname cute european controlled current source= #1}}
+
+% noise sources
+\def\pgf at circ@vsourceN at path#1{\pgf at circ@bipole at path{vsourceN}{#1}}
+\compattikzset{noise voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@vsourceN at path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{vsourceN/.style= {\comnpatname noise voltage source= #1}}
+\compattikzset{nV/.style= {\comnpatname noise voltage source= #1}}
+
+\def\pgf at circ@isourceN at path#1{\pgf at circ@bipole at path{isourceN}{#1}}
+\compattikzset{noise current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@isourceN at path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{isourceN/.style= {\comnpatname noise current source= #1}}
+\compattikzset{nI/.style= {\comnpatname noise current source= #1}}
+
+% resistive sensor american style
+\def\pgf at circ@resistivesens at path#1{\pgf at circ@bipole at path{resistivesens}{#1}}
+\compattikzset{american resistive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@resistivesens at path, l=#1}}
+\compattikzset{european resistive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@thermistorntc at path, l=#1}}
+\compattikzset{resistive sensor/.style= {\circuitikzbasekey, /tikz/to path=\pgf at circ@sresistor at path, l=#1}}
+\compattikzset{sR/.style= {\comnpatname resistive sensor= #1}}
+
+\compattikzset{capacitive sensor/.style= {\circuitikzbasekey, /tikz/to path=\pgf at circ@capacitivesens at path, l=#1}}
+\compattikzset{sC/.style= {\comnpatname capacitive sensor= #1}}
+
+\compattikzset{cute inductive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@cuteinductivesens at path, l=#1}}
+\compattikzset{european inductive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@europeaninductivesens at path, l=#1}}
+\compattikzset{american inductive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@americaninductivesens at path, l=#1}}
+\compattikzset{inductive sensor/.style= {\circuitikzbasekey, /tikz/to path=\pgf at circ@inductivesens at path, l=#1}}
+\compattikzset{sL/.style= {\comnpatname inductive sensor= #1}}
+
 \compattikzset{Mr/.style = {\comnpatname memristor}}
 
 \compattikzset{cspst/.style = {\comnpatname closing switch = #1}}
@@ -606,75 +707,79 @@
 \compattikzset{vdd/.style = {\comnpatname vcc = #1}}
 \compattikzset{vss/.style = {\comnpatname vee = #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}
-	}
-}
+% activate the to-style crossing
+\def\pgf at circ@crossing at path#1{\pgf at circ@bipole at path{crossing}{#1}}
+\compattikzset{crossing/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@crossing at path, l=#1}}
+\compattikzset{xing/.style= {\comnpatname crossing= #1}}
 
-\ifpgf at 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
+%% loudspeaker and microphone
 
+\def\pgf at circ@loudspeaker at path#1{\pgf at circ@bipole at path{loudspeaker}{#1}}
+\compattikzset{loudspeaker/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@loudspeaker at path, l=#1}}
+
+\def\pgf at circ@mic at path#1{\pgf at circ@bipole at path{mic}{#1}}
+\compattikzset{mic/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@mic at path, l=#1}}
+
+% more instrument
+\def\pgf at circ@rmeter at path#1{\pgf at circ@bipole at path{rmeter}{#1}}
+\compattikzset{rmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@rmeter at path, l=#1}}
+\def\pgf at circ@rmeterwa at path#1{\pgf at circ@bipole at path{rmeterwa}{#1}}
+\compattikzset{rmeterwa/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@rmeterwa at path, l=#1}}
+\def\pgf at circ@smeter at path#1{\pgf at circ@bipole at path{smeter}{#1}}
+\compattikzset{smeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@smeter at path, l=#1}}
+% current loop probes
+\def\pgf at circ@iloop at path#1{\pgf at circ@bipole at path{iloop}{#1}}
+\compattikzset{iloop/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@iloop at path, l=#1}}
+\def\pgf at circ@iloop2 at path#1{\pgf at circ@bipole at path{iloop2}{#1}}
+\compattikzset{iloop2/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@iloop2 at path, l=#1}}
+% qucs-style probes
+\def\pgf at circ@qiprobe at path#1{\pgf at circ@bipole at path{qiprobe}{#1}}
+\compattikzset{qiprobe/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@qiprobe at path, l=#1}}
+\def\pgf at circ@qvprobe at path#1{\pgf at circ@bipole at path{qvprobe}{#1}}
+\compattikzset{qvprobe/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@qvprobe at path, l=#1}}
+\def\pgf at circ@qpprobe at path#1{\pgf at circ@bipole at path{qpprobe}{#1}}
+\compattikzset{qpprobe/.style = {\circuitikzbasekey, /tikz/to path=\pgf at circ@qpprobe at path, l=#1}}
+
+
 % Transistor like bipoles
 
 \def\pgf at circ@trans at path#1#2{
-	\pgfextra{
-		\edef\pgf at temp{\pgfkeysvalueof{/tikz/circuitikz/bipole/name}}
-		\def\pgf at circ@temp{#2}
-		\ifx\pgf at temp\pgf at circ@temp % if it has not a name
-			\pgfmathrandominteger{\pgf at circ@rand}{1000}{9999}
-			\ctikzset{bipole/name = trans\pgf at circ@rand} % create it
-		\fi
-	}
-	\ifpgf at circuit@bipole at inverted
-		(\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{
-		\pgfmathanglebetweenpoints{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}}
-					   {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}}
-		\pgfmathadd{\pgfmathresult}{-90}
-		\edef\pgf at circ@direction{\pgfmathresult}
-	}
-	($(\tikztostart) ! .5 ! (\tikztotarget)$) 
-		node[#1, /tikz/rotate=\pgf at circ@direction, xscale=\ctikzvalof{mirror value}]
-			(\ctikzvalof{bipole/name}) {} node {\ctikzvalof{bipole/label/name}}
-		\ifcsname pgf at anchor@#1 at pathstart\endcsname%if special path-anchors are defined, use them!
-			(\ctikzvalof{bipole/name}start.center) --(\ctikzvalof{bipole/name}.pathstart)
-			(\ctikzvalof{bipole/name}.pathend)  -- (\ctikzvalof{bipole/name}end.center)
-		\else
-			(\ctikzvalof{bipole/name}start.center) --(\ctikzvalof{bipole/name}.left)
-			(\ctikzvalof{bipole/name}.right)  -- (\ctikzvalof{bipole/name}end.center)
-		\fi
-	\pgfextra{
-		\pgfcircresetpath
-	}  
-	(\tikztotarget) 	\tikztonodes  % e si continua
+    \pgfextra{
+        \edef\pgf at temp{\pgfkeysvalueof{/tikz/circuitikz/bipole/name}}
+        \def\pgf at circ@temp{#2}
+        \ifx\pgf at temp\pgf at circ@temp % if it has not a name
+            \pgfmathrandominteger{\pgf at circ@rand}{1000}{9999}
+            \ctikzset{bipole/name = trans\pgf at circ@rand} % create it
+        \fi
+    }
+    \ifpgf at circuit@bipole at inverted
+        (\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{
+        \pgfmathanglebetweenpoints{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}}
+        {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}}
+        \pgfmathadd{\pgfmathresult}{-90}
+        \pgfmathround{\pgfmathresult}
+        \edef\pgf at circ@direction{\pgfmathresult}
+    }
+    ($(\tikztostart) ! .5 ! (\tikztotarget)$)
+    node[#1, /tikz/rotate=\pgf at circ@direction, xscale=\ctikzvalof{mirror value}]
+    (\ctikzvalof{bipole/name}) {} node {\ctikzvalof{bipole/label/name}}
+    \ifcsname pgf at anchor@#1 at pathstart\endcsname%if special path-anchors are defined, use them!
+        (\ctikzvalof{bipole/name}start.center) --(\ctikzvalof{bipole/name}.pathstart)
+        (\ctikzvalof{bipole/name}.pathend)  -- (\ctikzvalof{bipole/name}end.center)
+    \else
+        (\ctikzvalof{bipole/name}start.center) --(\ctikzvalof{bipole/name}.left)
+        (\ctikzvalof{bipole/name}.right)  -- (\ctikzvalof{bipole/name}end.center)
+    \fi
+    \pgfextra{
+        \pgfcircresetpath
+    }
+    (\tikztotarget) 	\tikztonodes  % e si continua
 }
 
 
@@ -685,6 +790,7 @@
 \pgf at circ@definetranspath{elmech}
 \pgf at circ@definetranspath{nmos}
 \pgf at circ@definetranspath{pmos}
+\pgf at circ@definetranspath{hemt}
 \pgf at circ@definetranspath{npn}
 \pgf at circ@definetranspath{pnp}
 \pgf at circ@definetranspath{nfet}

Modified: trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex	2019-05-10 21:14:43 UTC (rev 51070)
+++ trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex	2019-05-10 21:15:08 UTC (rev 51071)
@@ -5,535 +5,829 @@
 % 1. under the LaTeX Project Public License and/or
 % 2. under the GNU Public License.
 %
-% See the file doc/LICENSE for more details.
+% See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %% Quadripoles
 
 \long\def\pgfcircdeclarequadpole#1#2#3{
-	\pgfdeclareshape{#1}
-	{
-	  \anchor{center}{
-	  	\northwest
-		\pgf at x=0pt
-	  }
-	  \savedanchor\northwest{%
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/height}\pgf at circ@Rlen
-		\pgf at y=.5\pgf at y
-		\pgf at x=.5\pgf at circ@Rlen
-		\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/width}\pgf at x
-	  }
-	  \anchor{A2}{
-		\northwest
-		\pgf at y=-\pgf at y
-	  }
-	  \anchor{B1}{
-		\northwest
-		\pgf at x=-\pgf at x
-	  }
-	  \anchor{A1}{
-		\northwest
-	  }
-	  \anchor{B2}{
-		\northwest
-		\pgf at x=-\pgf at x
-		\pgf at y=-\pgf at y
-	  }
-	  \anchor{north}{
-	  	\northwest
-		\pgf at x=0pt
-	  }
-	  \anchor{south}{
-	  	\northwest
-		\pgf at x=0pt
-		\pgf at y=-\pgf at y
-	  }
-	  \anchor{west}{
-	  	\northwest
-		\pgf at y=0pt
-	  }
-	  \anchor{east}{
-	  	\northwest
-		\pgf at y=0pt
-		\pgf at x=-\pgf at x
-	  }
-	  \anchor{south west}{
-		\northwest
-		\pgf at y=-\pgf at y
-	  }
-	  \anchor{north east}{
-		\northwest
-		\pgf at x=-\pgf at x
-	  }
-	  \anchor{north west}{
-		\northwest
-	  }
-	  \anchor{south east}{
-		\northwest
-		\pgf at x=-\pgf at x
-		\pgf at y=-\pgf at y
-	  }	  
-	  \anchor{base}{
-	  	\northwest
-		\pgf at x=0pt	  	
-	  }
-	  #3
-	  \backgroundpath{			
-			\pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}	
-			
-			\northwest
-			\pgf at circ@res at up = \pgf at y 
-			\pgf at circ@res at down = -\pgf at y
-			\pgf at circ@res at right = -\pgf at x
-			\pgf at circ@res at left = \pgf at x
-			
-			#2
-	  
-	  }
-	}
+    \pgfdeclareshape{#1}
+    {
+        \anchor{center}{
+            \northwest
+            \pgf at x=0pt
+            \pgf at y=0pt
+        }
+        \savedmacro{\stretto}{\def\stretto{0.4}}
+        \savedanchor\northwest{%
+            \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/height}\pgf at circ@Rlen
+            \pgf at y=.5\pgf at y
+            \pgf at x=.5\pgf at circ@Rlen
+            \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/width}\pgf at x
+        }
+        \anchor{A2}{
+            \northwest
+            \pgf at y=-\pgf at y
+        }
+        \anchor{B1}{
+            \northwest
+            \pgf at x=-\pgf at x
+        }
+        \anchor{A1}{
+            \northwest
+        }
+        \anchor{B2}{
+            \northwest
+            \pgf at x=-\pgf at x
+            \pgf at y=-\pgf at y
+        }
+        %% notice for the dot anchors: I use the cute inductors as reference
+        %% size; if you change one you have to change all of them.
+        \anchor{inner dot A1}{
+            \northwest
+            \pgfmathsetlength\pgf at x{\stretto*\pgf at x +
+            \ctikzvalof{bipoles/cuteinductor/height}*\pgf at circ@Rlen/2}
+            \pgfmathsetlength\pgf at y{0.5*\pgf at circ@Rlen}
+        }
+        \anchor{outer dot A1}{
+            \northwest
+            \pgfmathsetlength\pgf at x{\stretto*\pgf at x -
+            \ctikzvalof{bipoles/cuteinductor/height}*\pgf at circ@Rlen/2}
+            \pgfmathsetlength\pgf at y{0.5*\pgf at circ@Rlen}
+        }
+        \anchor{inner dot A2}{
+            \northwest
+            \pgfmathsetlength\pgf at x{\stretto*\pgf at x +
+            \ctikzvalof{bipoles/cuteinductor/height}*\pgf at circ@Rlen/2}
+            \pgfmathsetlength\pgf at y{-0.5*\pgf at circ@Rlen}
+        }
+        \anchor{outer dot A2}{
+            \northwest
+            \pgfmathsetlength\pgf at x{\stretto*\pgf at x -
+            \ctikzvalof{bipoles/cuteinductor/height}*\pgf at circ@Rlen/2}
+            \pgfmathsetlength\pgf at y{-0.5*\pgf at circ@Rlen}
+        }
+        \anchor{inner dot B1}{
+            \northwest
+            \pgfmathsetlength\pgf at x{-\stretto*\pgf at x -
+            \ctikzvalof{bipoles/cuteinductor/height}*\pgf at circ@Rlen/2}
+            \pgfmathsetlength\pgf at y{0.5*\pgf at circ@Rlen}
+        }
+        \anchor{outer dot B1}{
+            \northwest
+            \pgfmathsetlength\pgf at x{-\stretto*\pgf at x +
+            \ctikzvalof{bipoles/cuteinductor/height}*\pgf at circ@Rlen/2}
+            \pgfmathsetlength\pgf at y{0.5*\pgf at circ@Rlen}
+        }
+        \anchor{inner dot B2}{
+            \northwest
+            \pgfmathsetlength\pgf at x{-\stretto*\pgf at x -
+            \ctikzvalof{bipoles/cuteinductor/height}*\pgf at circ@Rlen/2}
+            \pgfmathsetlength\pgf at y{-0.5*\pgf at circ@Rlen}
+        }
+        \anchor{outer dot B2}{
+            \northwest
+            \pgfmathsetlength\pgf at x{-\stretto*\pgf at x +
+            \ctikzvalof{bipoles/cuteinductor/height}*\pgf at circ@Rlen/2}
+            \pgfmathsetlength\pgf at y{-0.5*\pgf at circ@Rlen}
+        }
+        \anchor{north}{
+            \northwest
+            \pgf at x=0pt
+        }
+        \anchor{south}{
+            \northwest
+            \pgf at x=0pt
+            \pgf at y=-\pgf at y
+        }
+        \anchor{west}{
+            \northwest
+            \pgf at y=0pt
+        }
+        \anchor{east}{
+            \northwest
+            \pgf at y=0pt
+            \pgf at x=-\pgf at x
+        }
+        \anchor{south west}{
+            \northwest
+            \pgf at y=-\pgf at y
+        }
+        \anchor{north east}{
+            \northwest
+            \pgf at x=-\pgf at x
+        }
+        \anchor{north west}{
+            \northwest
+        }
+        \anchor{south east}{
+            \northwest
+            \pgf at x=-\pgf at x
+            \pgf at y=-\pgf at y
+        }
+        \anchor{base}{
+            \northwest
+            \pgf at x=0pt
+        }
+        #3
+        \backgroundpath{
+            \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+            \northwest
+            \pgf at circ@res at up = \pgf at y
+            \pgf at circ@res at down = -\pgf at y
+            \pgf at circ@res at right = -\pgf at x
+            \pgf at circ@res at left = \pgf at x
+            #2
+        }
+    }
 }
 
 
-
 \def\pgf at circ@drawtransformerbasicanchor{
-	\pgfkeysvalueof{/tikz/circuitikz/quadpoles/trans/height}
-	 \anchor{AA2}{
-		\northwest
-		\pgf at x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf at x
-		\pgf at x=.7\pgf at x
-		\pgf at y=-\pgf at y
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf at y
-	  }
-	  \anchor{BB1}{
-		\northwest
-		\pgf at x=-\pgf at x
-		\pgf at x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf at x
-		\pgf at x=.7\pgf at x
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf at y
-	  }
-	  \anchor{AA1}{
-		\northwest
-		\pgf at x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf at x
-		\pgf at x=.7\pgf at x
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf at y
-	  }
-	  \anchor{BB2}{
-		\northwest
-		\pgf at x=-\pgf at x
-		\pgf at x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf at x
-		\pgf at x=.7\pgf at x
-		\pgf at y=-\pgf at y
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf at y
-	  }
+    \pgfkeysvalueof{/tikz/circuitikz/quadpoles/trans/height}
+    \anchor{AA2}{
+        \northwest
+        \pgf at x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf at x
+        \pgf at x=.7\pgf at x
+        \pgf at y=-\pgf at y
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf at y
+    }
+    \anchor{BB1}{
+        \northwest
+        \pgf at x=-\pgf at x
+        \pgf at x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf at x
+        \pgf at x=.7\pgf at x
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf at y
+    }
+    \anchor{AA1}{
+        \northwest
+        \pgf at x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf at x
+        \pgf at x=.7\pgf at x
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf at y
+    }
+    \anchor{BB2}{
+        \northwest
+        \pgf at x=-\pgf at x
+        \pgf at x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf at x
+        \pgf at x=.7\pgf at x
+        \pgf at y=-\pgf at y
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf at y
+    }
 }
 
 \def\pgf at circ@drawtransformerbasicbody{
-	\def\stretto{.4}
-	\pgfscope             
-			\pgfslopedattimetrue 
-			\pgfallowupsidedownattimetrue
-			\pgftransformlineattime{.5}{%
-				\pgfpoint%
-					{\stretto\pgf at circ@res at left}%
-					{\pgf at circ@res at up}%
-			}{%
-				\pgfpoint
-					{\stretto\pgf at circ@res at left}%
-					{\pgf at circ@res at down}%
-			}
-			
-			\edef\pgf at circ@temp{\ctikzvalof{inductor}}%
-			\def\pgf at temp{european}%
-			\ifx\pgf at temp\pgf at circ@temp%
-				\pgfnode{fullgenericshape}{center}{}{pgf at inductor1}{\pgfusepath{stroke}}
-			\else%
-				\def\pgf at temp{cute}
-				\ifx\pgf at temp\pgf at circ@temp%
-					\pgfnode{cuteinductorshape}{center}{}{pgf at inductor1}{\pgfusepath{stroke}}
-				\else%
-					\pgfnode{americaninductorshape}{center}{}{pgf at inductor1}{\pgfusepath{stroke}}
-				\fi%
-			\fi%
+    \pgfscope
+        \pgfslopedattimetrue
+        \pgfallowupsidedownattimetrue
+        \pgftransformlineattime{.5}{%
+            \pgfpoint%
+            {\stretto\pgf at circ@res at left}%
+            {\pgf at circ@res at up}%
+            }{%
+            \pgfpoint
+            {\stretto\pgf at circ@res at left}%
+            {\pgf at circ@res at down}%
+        }
 
-			
-	\endpgfscope
-	\pgfscope             
-			\pgfslopedattimetrue 
-			\pgfallowupsidedownattimetrue
-			\pgftransformlineattime{.5}{%
-				\pgfpoint%
-					{\stretto\pgf at circ@res at right}%
-					{\pgf at circ@res at down}%
-			}{%
-				\pgfpoint
-					{\stretto\pgf at circ@res at right}%
-					{\pgf at circ@res at up}%
-			}
+        \edef\pgf at circ@temp{\ctikzvalof{inductor}}%
+        \def\pgf at temp{european}%
+        \ifx\pgf at temp\pgf at circ@temp%
+            \pgfnode{fullgenericshape}{center}{}{pgf at inductor1}{\pgfusepath{stroke}}
+        \else%
+            \def\pgf at temp{cute}
+            \ifx\pgf at temp\pgf at circ@temp%
+                \pgfnode{cuteinductorshape}{center}{}{pgf at inductor1}{\pgfusepath{stroke}}
+            \else%
+                \pgfnode{americaninductorshape}{center}{}{pgf at inductor1}{\pgfusepath{stroke}}
+            \fi%
+        \fi%
 
-			\edef\pgf at circ@temp{\ctikzvalof{inductor}}%
-			\def\pgf at temp{european}%
-			\ifx\pgf at temp\pgf at circ@temp%
-				\pgfnode{fullgenericshape}{center}{}{pgf at inductor2}{\pgfusepath{stroke}}
-			\else%
-				\def\pgf at temp{cute} 
-				\ifx\pgf at temp\pgf at circ@temp%
-					\pgfnode{cuteinductorshape}{center}{}{pgf at inductor2}{\pgfusepath{stroke}}
-				\else%
-					\pgfnode{americaninductorshape}{center}{}{pgf at inductor2}{\pgfusepath{stroke}}
-				\fi%
-			\fi%
-			
-	\endpgfscope
-	
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint{\stretto\pgf at circ@res at left}{\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpointanchor{pgf at inductor1}{b}}
-	
-	\pgfpathmoveto{\pgfpointanchor{pgf at inductor1}{a}}
-	\pgfpathlineto{\pgfpoint{\stretto\pgf at circ@res at left}{\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
-	
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint{\stretto\pgf at circ@res at right}{\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpointanchor{pgf at inductor2}{a}}
-	
-	\pgfpathmoveto{\pgfpointanchor{pgf at inductor2}{b}}
-	\pgfpathlineto{\pgfpoint{\stretto\pgf at circ@res at right}{\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-	
-	\pgfusepath{draw}
-	
+
+    \endpgfscope
+    \pgfscope
+        \pgfslopedattimetrue
+        \pgfallowupsidedownattimetrue
+        \pgftransformlineattime{.5}{%
+            \pgfpoint%
+            {\stretto\pgf at circ@res at right}%
+            {\pgf at circ@res at down}%
+            }{%
+            \pgfpoint
+            {\stretto\pgf at circ@res at right}%
+            {\pgf at circ@res at up}%
+        }
+
+        \edef\pgf at circ@temp{\ctikzvalof{inductor}}%
+        \def\pgf at temp{european}%
+        \ifx\pgf at temp\pgf at circ@temp%
+            \pgfnode{fullgenericshape}{center}{}{pgf at inductor2}{\pgfusepath{stroke}}
+        \else%
+            \def\pgf at temp{cute}
+            \ifx\pgf at temp\pgf at circ@temp%
+                \pgfnode{cuteinductorshape}{center}{}{pgf at inductor2}{\pgfusepath{stroke}}
+            \else%
+                \pgfnode{americaninductorshape}{center}{}{pgf at inductor2}{\pgfusepath{stroke}}
+            \fi%
+        \fi%
+
+    \endpgfscope
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\stretto\pgf at circ@res at left}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpointanchor{pgf at inductor1}{b}}
+
+    \pgfpathmoveto{\pgfpointanchor{pgf at inductor1}{a}}
+    \pgfpathlineto{\pgfpoint{\stretto\pgf at circ@res at left}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\stretto\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpointanchor{pgf at inductor2}{a}}
+
+    \pgfpathmoveto{\pgfpointanchor{pgf at inductor2}{b}}
+    \pgfpathlineto{\pgfpoint{\stretto\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+
+    \pgfusepath{draw}
+
 }
 
 
-	
-	% contrib Kristofer M. Monisit
-	
-	\pgfdeclareshape{fd op amp}
-	{
-	  \anchor{center}{\pgfpointorigin}
-	  \savedanchor\northwest{%
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf at circ@Rlen
-		\pgf at y=.5\pgf at y
-		\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf at circ@Rlen
-		\pgf at x=.5\pgf at x
-	  }
-	  \anchor{south}{
-		\northwest
-		\pgf at y=-\pgf at y
-	  }
-	  \anchor{north}{
-		\northwest
-	  }
-	  \savedanchor\left{%
-	  	\pgf at y=0pt
-	  }
-	  \savedanchor\inOne{%
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf at circ@Rlen
-		\pgf at y=.5\pgf at y
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at y
-		\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf at circ@Rlen
-		\pgf at x=.5\pgf at x
-	  }
-	  \anchor{-}{
-		\inOne
-	  }
-	  \anchor{+}{
-		\inOne
-		\pgf at y=-\pgf at y
-	  }
-	  \savedanchor\up{%
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf at circ@Rlen
-		\pgf at y=.5\pgf at y
-		\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf at circ@Rlen
-		\pgf at x=.5\pgf at x
-			\pgf at circ@res at up = \pgf at y
-			\pgf at circ@res at right = -\pgf at x
-			\pgf at circ@res at left = \pgf at x
-	    \pgfpointlineattime{
-			\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/up pos}}{
-			\pgfpoint{
-				\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf at circ@res at left}
-				{\pgf at circ@res at up}}
-			{\pgfpoint{.7\pgf at circ@res at right}{0pt}}
-	  }
-	  \anchor{up}{
-		\up
-	  }
-	  \anchor{down}{
-		\up
-		\pgf at y=-\pgf at y
-	  }
-	  \anchor{out +}{
-		\northwest
-		\pgf at y=.5\pgf at y
-		\pgf at x=-.7\pgf at x
-	  }
-	  \anchor{out -}{
-		\northwest
-		\pgf at y=-.5\pgf at y
-		\pgf at x=-.7\pgf at x
-	  }
-	  \anchor{west}{
-	  	\left
-      }
-		\anchor{east}{
-			\left
-			\pgf at x=-\pgf at x
-		}
 
-	  \backgroundpath{
-			\pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+% contrib Kristofer M. Monisit
 
-      \northwest
-      \pgf at circ@res at up = \pgf at y
-      \pgf at circ@res at down = -\pgf at y
-      \pgf at circ@res at right = -\pgf at x
-      \pgf at circ@res at left = \pgf at x
+\pgfdeclareshape{fd op amp}
+{
+    \anchor{center}{\pgfpointorigin}
+    \savedanchor\northwest{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+    }
+    \savedanchor\outline{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+    \ifpgf at circuit@oa at oplusup\else\pgf at y=-\pgf at y\fi
+    }
+    \anchor{south}{
+        \northwest
+        \pgf at y=-\pgf at y\pgf at x=0pt\relax
+    }
+    \anchor{north}{
+        \northwest\pgf at x=0pt\relax
+    }
+    \savedanchor\left{%
+        \pgf at y=0pt
+    }
+    \savedanchor\inOneFixed{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+    }
+    \anchor{in up}{
+        \inOneFixed
+    }
+    \anchor{in down}{
+        \inOneFixed
+        \pgf at y=-\pgf at y
+    }
+    \savedanchor\inOne{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+    \ifpgf at circuit@oa at iplusup\pgf at y=-\pgf at y\fi
+    }
+    \anchor{-}{
+        \inOne
+    }
+    \anchor{+}{
+        \inOne
+        \pgf at y=-\pgf at y
+    }
+    \savedanchor\up{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+        \pgf at circ@res at up = \pgf at y
+        \pgf at circ@res at right = -\pgf at x
+        \pgf at circ@res at left = \pgf at x
+        \pgfpointlineattime{
+            \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/up pos}}{
+            \pgfpoint{
+            \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf at circ@res at left}
+        {\pgf at circ@res at up}}
+        {\pgfpoint{.7\pgf at circ@res at right}{0pt}}
+    }
+    \anchor{up}{
+        \up
+    }
+    \anchor{down}{
+        \up
+        \pgf at y=-\pgf at y
+    }
+    \anchor{out up}{
+        \northwest
+        \pgf at y=.5\pgf at y
+        \pgf at x=-.7\pgf at x
+    }
+    \anchor{out down}{
+        \northwest
+        \pgf at y=-.5\pgf at y
+        \pgf at x=-.7\pgf at x
+    }
+    \anchor{out +}{
+        \outline
+        \pgf at y=.5\pgf at y
+        \pgf at x=-.7\pgf at x
+    }
+    \anchor{out -}{
+        \outline
+        \pgf at y=-.5\pgf at y
+        \pgf at x=-.7\pgf at x
+    }
+    \anchor{west}{
+        \left
+    }
+    \anchor{east}{
+        \left
+        \pgf at x=-.7\pgf at x
+    }
 
-      % Negative input terminal
-      \pgfpathmoveto{\pgfpoint
-        {\pgf at circ@res at left}
-        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at circ@res at up}}
-      \pgfpathlineto{\pgfpoint
-        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf at circ@res at left}
-        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at circ@res at up}}
-      \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at circ@res at up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $-$}
-  
+    \anchor{south west}{ \northwest \pgf at y=-\pgf at y }
+    \anchor{north east}{ \northwest \pgf at x=-.7\pgf at x }
+    \anchor{north west}{ \northwest }
+    \anchor{south east}{ \northwest \pgf at x=-.7\pgf at x \pgf at y=-\pgf at y }
+    \backgroundpath{
+        \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
 
-      % Positive input terminal
-      \pgfpathmoveto{\pgfpoint
-        {\pgf at circ@res at left}
-        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at circ@res at down}}
-      \pgfpathlineto{\pgfpoint
-        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf at circ@res at left}
-        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at circ@res at down}}
-      \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at circ@res at down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $+$}
-  
+        \northwest
+        \pgf at circ@res at up = \pgf at y
+        \pgf at circ@res at down = -\pgf at y
+        \pgf at circ@res at right = -\pgf at x
+        \pgf at circ@res at left = \pgf at x
 
-      % Negative output terminal
-      \pgfpathmoveto{\pgfpoint
-        {0.7\pgf at circ@res at right}
-        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at circ@res at down}}
-      \pgfpathlineto{\pgfpoint
-        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}}
-        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at circ@res at down}}
-      \pgftext[left, at=\pgfpoint{0.3\pgf at circ@res at left}{.3\pgf at circ@res at down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $-$}
-  
+        % Triangle
+        \pgfscope
+            \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/quadpoles/thickness}\pgflinewidth}
+            \pgftransformxshift{.7\pgf at circ@res at left}
+            \pgf at circ@res at step=\pgf at circ@res at right
+            \advance\pgf at circ@res at step by -\pgf at circ@res at left
+            \pgf at circ@res at step=.7\pgf at circ@res at step
+            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
+            \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
+            \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
+            \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{0pt}}
+            \pgfpathclose
+            \pgf at circ@draworfill
+        \endpgfscope
+        % Negative input terminal
+        \pgfpathmoveto{\pgfpoint
+            {\pgf at circ@res at left}
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf at circ@res at left}
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at circ@res at up}}
+        \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at circ@res at up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} \ifpgf at circuit@oa at iplusup$+$\else$-$\fi}
 
-      % Positive output terminal
-      \pgfpathmoveto{\pgfpoint
-        {0.7\pgf at circ@res at right}
-        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at circ@res at up}}
-      \pgfpathlineto{\pgfpoint
-        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}}
-        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at circ@res at up}}
-      \pgftext[left, at=\pgfpoint{0.3\pgf at circ@res at left}{.3\pgf at circ@res at up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $+$}
-  
-	  \pgfsetrectcap
-      % Draw them all!
-      \pgfusepath{draw}
+        % Positive input terminal
+        \pgfpathmoveto{\pgfpoint
+            {\pgf at circ@res at left}
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf at circ@res at left}
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at circ@res at down}}
+        \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at circ@res at down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} \ifpgf at circuit@oa at iplusup$-$\else$+$\fi}
 
-      % Triangle
-      \pgfscope
-        \pgfsetlinewidth{2\pgflinewidth}
-        \pgftransformxshift{.7\pgf at circ@res at left}
-        \pgf at circ@res at step=\pgf at circ@res at right
-        \advance\pgf at circ@res at step by -\pgf at circ@res at left
-        \pgf at circ@res at step=.7\pgf at circ@res at step
-        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
-        \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
-        \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
-        \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{0pt}}
-        \pgfpathclose
+        % Negative output terminal
+        \pgfpathmoveto{\pgfpoint
+            {0.7\pgf at circ@res at right}
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}}
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at circ@res at down}}
+        \pgftext[left, at=\pgfpoint{0.3\pgf at circ@res at left}{.3\pgf at circ@res at down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} \ifpgf at circuit@oa at oplusup$-$\else$+$\fi}
+
+        % Positive output terminal
+        \pgfpathmoveto{\pgfpoint
+            {0.7\pgf at circ@res at right}
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}}
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at circ@res at up}}
+        \pgftext[left, at=\pgfpoint{0.3\pgf at circ@res at left}{.3\pgf at circ@res at up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} \ifpgf at circuit@oa at oplusup$+$\else$-$\fi}
+
+        \pgfsetrectcap
+        % Draw them all!
         \pgfusepath{draw}
-      \endpgfscope
-	  }
-	}
 
+    }
+}
 
 
+%% instrumentation amplifier diff output
 
-\pgfcircdeclarequadpole{transformer}{
+\pgfdeclareshape{fd inst amp}
+{
+    % when tikz calls the anchor it wants the relative position in the lengths
+    % \pgf at x  \pgf at y
+    % \pgfpoint* functions set that variables
+    % anchors are visible outside and run on use
+    \anchor{center}{\pgfpointorigin}
+    % savedanchors are internals and run on node creation (not use)
+    % bounding-box top left
+    \savedanchor\northwest{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+    }
+    \anchor{nw}{
+        \northwest
+    }
+    \anchor{south}{
+        \northwest
+        \pgf at y=-\pgf at y\pgf at x=0pt\relax
+    }
+    \anchor{north}{
+        \northwest\pgf at x=0pt\relax
+    }
+    \savedanchor\left{%
+        \pgf at y=0pt
+    }
+    \anchor{leftedge}
+    {\left
+        \pgf at x = \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf at x
+    }
+    \savedanchor\inOneFixed{%
+          \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf at circ@Rlen
+          \pgf at y=.5\pgf at y
+          \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at y
+          \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf at circ@Rlen
+          \pgf at x=.5\pgf at x
+    }
+    \anchor{in up}{
+        \inOneFixed
+    }
+    \anchor{in down}{
+        \inOneFixed
+        \pgf at y=-\pgf at y
+    }
+    \savedanchor\inOne{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+        \ifpgf at circuit@oa at iplusup\pgf at y=-\pgf at y\fi
+    }
+    \anchor{-}{
+        \inOne
+    }
+    \anchor{+}{
+        \inOne
+        \pgf at y=-\pgf at y
+    }
+    \savedanchor\up{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+        \pgf at circ@res at up = \pgf at y
+        \pgf at circ@res at right = -\pgf at x
+        \pgf at circ@res at left = \pgf at x
+        \pgfpointlineattime{
+            \pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/up pos}}{
+            \pgfpoint{
+            \pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/port width}\pgf at circ@res at left}
+        {\pgf at circ@res at up}}
+        {\pgfpoint{.7\pgf at circ@res at right}{.6\pgf at circ@res at up}}
+    }
+    \anchor{up}{
+        \up
+    }
+    \anchor{down}{
+        \up
+        \pgf at y=-\pgf at y
+    }
+    % reference voltage input anchors.
+    \savedanchor\refv{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+        \pgf at circ@res at up = \pgf at y
+        \pgf at circ@res at right = -\pgf at x
+        \pgf at circ@res at left = \pgf at x
+        \pgfpointlineattime{
+            \pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/refv pos}}{
+            \pgfpoint{
+            \pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/port width}\pgf at circ@res at left}
+        {\pgf at circ@res at up}}
+        {\pgfpoint{.7\pgf at circ@res at right}{.6\pgf at circ@res at up}}
+    }
+    % we need both because they are normally drawn under the amp, and if you
+    % mirror it vertically you need them
+    \anchor{refv up}{
+        \refv
+    }
+    \anchor{refv down}{
+        \refv
+        \pgf at y=-\pgf at y
+    }
+    \savedanchor\outport{
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/width}\pgf at circ@Rlen
+        \pgf at x=-.5\pgf at x
+        \ifpgf at circuit@oa at oplusup\else\pgf at y=-\pgf at y\fi
+    }
+    \anchor{out}{
+        \outport
+        \pgf at y=0pt
+    }
+    \anchor{out +}{
+        \outport
+    }
+    \anchor{out -}{
+        \outport
+        \pgf at y=-\pgf at y
+    }
+    \savedanchor\outportfixed{
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/width}\pgf at circ@Rlen
+        \pgf at x=-.5\pgf at x
+    }
+    \anchor{out up}{
+        \outportfixed
+    }
+    \anchor{out down}{
+        \outportfixed
+        \pgf at y=-\pgf at y
+    }
+    %
+    \anchor{west}{
+        \left
+    }
+    \anchor{east}{
+        \left
+        \pgf at x=-\pgf at x
+    }
+    \anchor{south west}{ \northwest \pgf at y=-\pgf at y }
+    \anchor{north east}{ \northwest \pgf at x=-\pgf at x }
+    \anchor{north west}{ \northwest }
+    \anchor{south east}{ \northwest \pgf at x=-\pgf at x \pgf at y=-\pgf at y }
+    \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
 
-	\pgf at circ@drawtransformerbasicbody
+    % let's start drawing the component
+    \backgroundpath{
+        \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+        %
+        \northwest
+        \pgf at circ@res at up = \pgf at y
+        \pgf at circ@res at down = -\pgf at y
+        \pgf at circ@res at right = -\pgf at x
+        \pgf at circ@res at left = \pgf at x
+        % main component, normally in thicker lines
+        \pgfscope
+            \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
+            \pgftransformxshift{.7\pgf at circ@res at left}
+            \pgf at circ@res at step=\pgf at circ@res at right
+            \advance\pgf at circ@res at step by -\pgf at circ@res at left
+            \pgf at circ@res at step=.7\pgf at circ@res at step
+            %first point (near output)
+            \pgfpathmoveto{\pgfpoint{1.4\pgf at circ@res at right}{0}}
+            %from the exit to the top (short side)... (note that the .6 must be copied in \up and \refv anchors
+            \pgfpathlineto{\pgfpoint{1.4\pgf at circ@res at right}{.6\pgf at circ@res at up}}
+            % and then to the input "front up", "down", to the output short side "down"
+            \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
+            \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
+            \pgfpathlineto{\pgfpoint{1.4\pgf at circ@res at right}{.6\pgf at circ@res at down}}
+            % ...and close
+            \pgfpathclose
+            \pgf at circ@draworfill
+        \endpgfscope
+        % input terminal up
+        \pgfpathmoveto{\pgfpoint
+            {\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf at circ@res at up}}
+        %
+        \pgfpathlineto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/port width}\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf at circ@res at up}}
+        %
+        \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/port width}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf at circ@res at up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/font} \ifpgf at circuit@oa at iplusup$+$\else$-$\fi}
 
+        % input terminal down
+        \pgfpathmoveto{\pgfpoint
+            {\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf at circ@res at down}}
+        %
+        \pgfpathlineto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/port width}\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf at circ@res at down}}
+        \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/port width}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf at circ@res at down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/font} \ifpgf at circuit@oa at iplusup$-$\else$+$\fi}
+        % output leads down and up
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{.7\pgf at circ@res at right}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf at circ@res at down}} %
+        \pgftext[right, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/port width}\pgf at circ@res at right}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf at circ@res at down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/font}\ifpgf at circuit@oa at oplusup$-\;$\else$+\;$\fi}
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{.7\pgf at circ@res at right}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf at circ@res at up}} %
+        \pgftext[right, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/port width}\pgf at circ@res at right}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf at circ@res at up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/font}\ifpgf at circuit@oa at oplusup$+\;$\else$-\;$\fi}
+        %
+        \pgfsetrectcap
+        \pgfusepath{draw}
+    }
+}
+
+
+\pgfcircdeclarequadpole{transformer}{
+    \pgf at circ@drawtransformerbasicbody
 }{\pgf at circ@drawtransformerbasicanchor}
 
 \pgfcircdeclarequadpole{transformer core}{
 
-	\pgf at circ@drawtransformerbasicbody
-	
-	\pgfmoveto{\pgfpoint%
-					{\ctikzvalof{quadpoles/transformer core/core width}\pgf at circ@res at right}%
-					{\ctikzvalof{quadpoles/transformer core/core height}\pgf at circ@res at down}%
-					}
-	\pgflineto{
-				\pgfpoint
-					{\ctikzvalof{quadpoles/transformer core/core width}\pgf at circ@res at right}%
-					{\ctikzvalof{quadpoles/transformer core/core height}\pgf at circ@res at up}%
-					}
+    \pgf at circ@drawtransformerbasicbody
 
-	\pgfmoveto{\pgfpoint%
-					{\ctikzvalof{quadpoles/transformer core/core width}\pgf at circ@res at left}%
-					{\ctikzvalof{quadpoles/transformer core/core height}\pgf at circ@res at down}%
-					}
-	\pgflineto{
-				\pgfpoint
-					{\ctikzvalof{quadpoles/transformer core/core width}\pgf at circ@res at left}%
-					{\ctikzvalof{quadpoles/transformer core/core height}\pgf at circ@res at up}%
-					}					
-	
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth}
-	\pgfusepath{draw}
+    \pgfmoveto{\pgfpoint%
+        {\ctikzvalof{quadpoles/transformer core/core width}\pgf at circ@res at right}%
+        {\ctikzvalof{quadpoles/transformer core/core height}\pgf at circ@res at down}%
+    }
+    \pgflineto{
+        \pgfpoint
+        {\ctikzvalof{quadpoles/transformer core/core width}\pgf at circ@res at right}%
+        {\ctikzvalof{quadpoles/transformer core/core height}\pgf at circ@res at up}%
+    }
+
+    \pgfmoveto{\pgfpoint%
+        {\ctikzvalof{quadpoles/transformer core/core width}\pgf at circ@res at left}%
+        {\ctikzvalof{quadpoles/transformer core/core height}\pgf at circ@res at down}%
+    }
+    \pgflineto{
+        \pgfpoint
+        {\ctikzvalof{quadpoles/transformer core/core width}\pgf at circ@res at left}%
+        {\ctikzvalof{quadpoles/transformer core/core height}\pgf at circ@res at up}%
+    }
+
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth}
+    \pgfusepath{draw}
 }{\pgf at circ@drawtransformerbasicanchor}
 
 
 \pgfcircdeclarequadpole{gyrator}{
 
-	\def\stretto{.4}
-	
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint{\stretto\pgf at circ@res at left}{\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint{\stretto\pgf at circ@res at left}{\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
-	
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint{\stretto\pgf at circ@res at right}{\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint{\stretto\pgf at circ@res at right}{\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-	
-	\pgfusepath{draw}
-	
-	\pgfsetlinewidth{2\pgflinewidth}
-	\pgfpathmoveto{\pgfpoint{\stretto\pgf at circ@res at left}{.7*\stretto\pgf at circ@res at down}}
-	\pgfpatharc{90}{270}{.7*\stretto\pgf at circ@res at down}
-	
-	\pgfpathmoveto{\pgfpoint{\stretto\pgf at circ@res at right}{.7*\stretto\pgf at circ@res at up}}
-	\pgfpatharc{-90}{90}{.7*\stretto\pgf at circ@res at down}
-	\pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\stretto\pgf at circ@res at left}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\stretto\pgf at circ@res at left}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
 
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\stretto\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\stretto\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+
+    \pgfusepath{draw}
+
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/quadpoles/thickness}\pgflinewidth}
+    \pgfpathmoveto{\pgfpoint{\stretto\pgf at circ@res at left}{.7*\stretto\pgf at circ@res at down}}
+    \pgfpatharc{90}{270}{.7*\stretto\pgf at circ@res at down}
+
+    \pgfpathmoveto{\pgfpoint{\stretto\pgf at circ@res at right}{.7*\stretto\pgf at circ@res at up}}
+    \pgfpatharc{-90}{90}{.7*\stretto\pgf at circ@res at down}
+    \pgfusepath{draw}
+
 }{}
 
 %% four-port
 % defines a general outer box for four-ports
-% TikZ usage: 
+% TikZ usage:
 %		\draw (0,0) node[coupler](coup){\SI{-3}{dB}}
 %		(coup.port1) to[short,-o] ++(-1,0)
 %
 
 \long\def\pgfcircdeclarefourport#1#2{
-	\pgfdeclareshape{#1}{
-		\anchor{center}{
-			\northwest
-			\pgf at x=0pt
-			\pgf at y=0pt
-		}
-		\savedanchor\northwest{%
-			\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/height}\pgf at circ@Rlen
-			\pgf at y=.5\pgf at y
-			\pgf at x=.5\pgf at circ@Rlen
-			\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/width}\pgf at x
-			}
-		\anchor{north}{
-			\northwest
-			\pgf at x=0pt
-		}
-		\anchor{south}{
-			\northwest
-			\pgf at x=0pt
-			\pgf at y=-\pgf at y
-		}
-		\anchor{west}{
-			\northwest
-			\pgf at y=0pt
-		}
-		\anchor{east}{
-			\northwest
-			\pgf at y=0pt
-			\pgf at x=-\pgf at x
-		}
-		\anchor{south west}{
-			\northwest
-			\pgf at y=-\pgf at y
-		}
-		\anchor{north east}{
-			\northwest
-			\pgf at x=-\pgf at x
-		}
-			\anchor{north west}{
-			\northwest
-		}
-		\anchor{south east}{
-			\northwest
-			\pgf at x=-\pgf at x
-			\pgf at y=-\pgf at y
-		}
-		\anchor{port1}{
-			\northwest
-			\pgf at y=-0.5\pgf at y
-		}
-		\anchor{port2}{
-			\northwest
-			\pgf at x=-\pgf at x
-			\pgf at y=-0.5\pgf at y
-		}
-		\anchor{port3}{
-			\northwest
-			\pgf at x=-\pgf at x
-			\pgf at y=0.5\pgf at y
-		}
-		\anchor{port4}{
-			\northwest
-			\pgf at y=0.5\pgf at y
-		}
-		\anchor{1}{
-			\northwest
-			\pgf at y=-0.5\pgf at y
-		}
-		\anchor{2}{
-			\northwest
-			\pgf at x=-\pgf at x
-			\pgf at y=-0.5\pgf at y
-		}
-		\anchor{3}{
-			\northwest
-			\pgf at x=-\pgf at x
-			\pgf at y=0.5\pgf at y
-		}
-		\anchor{4}{
-			\northwest
-			\pgf at y=0.5\pgf at y
-		}
-		
-		\anchor{text}{
-			\northwest
-			\advance \pgf at y by 0.5\ht\pgfnodeparttextbox
-			\pgf at x=-.5\wd\pgfnodeparttextbox
-		}
-		\backgroundpath{			
-				\pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}	
-			
-				\northwest
-				\pgf at circ@res at up = \pgf at y 
-				\pgf at circ@res at down = -\pgf at y
-				\pgf at circ@res at right = -\pgf at x
-				\pgf at circ@res at left = \pgf at x
-			
-				\pgfstartlinewidth=\pgflinewidth
+    \pgfdeclareshape{#1}{
+        \anchor{center}{
+            \northwest
+            \pgf at x=0pt
+            \pgf at y=0pt
+        }
+        \savedanchor\northwest{%
+            \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/height}\pgf at circ@Rlen
+            \pgf at y=.5\pgf at y
+            \pgf at x=.5\pgf at circ@Rlen
+            \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/width}\pgf at x
+        }
+        \anchor{north}{
+            \northwest
+            \pgf at x=0pt
+        }
+        \anchor{south}{
+            \northwest
+            \pgf at x=0pt
+            \pgf at y=-\pgf at y
+        }
+        \anchor{west}{
+            \northwest
+            \pgf at y=0pt
+        }
+        \anchor{east}{
+            \northwest
+            \pgf at y=0pt
+            \pgf at x=-\pgf at x
+        }
+        \anchor{south west}{
+            \northwest
+            \pgf at y=-\pgf at y
+        }
+        \anchor{north east}{
+            \northwest
+            \pgf at x=-\pgf at x
+        }
+        \anchor{north west}{
+            \northwest
+        }
+        \anchor{south east}{
+            \northwest
+            \pgf at x=-\pgf at x
+            \pgf at y=-\pgf at y
+        }
+        \anchor{port1}{
+            \northwest
+            \pgf at y=-0.5\pgf at y
+        }
+        \anchor{port2}{
+            \northwest
+            \pgf at x=-\pgf at x
+            \pgf at y=-0.5\pgf at y
+        }
+        \anchor{port3}{
+            \northwest
+            \pgf at x=-\pgf at x
+            \pgf at y=0.5\pgf at y
+        }
+        \anchor{port4}{
+            \northwest
+            \pgf at y=0.5\pgf at y
+        }
+        \anchor{1}{
+            \northwest
+            \pgf at y=-0.5\pgf at y
+        }
+        \anchor{2}{
+            \northwest
+            \pgf at x=-\pgf at x
+            \pgf at y=-0.5\pgf at y
+        }
+        \anchor{3}{
+            \northwest
+            \pgf at x=-\pgf at x
+            \pgf at y=0.5\pgf at y
+        }
+        \anchor{4}{
+            \northwest
+            \pgf at y=0.5\pgf at y
+        }
 
-				% draw outer box
-				\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-				\pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-				\pgfusepath{draw}
-				
-				% draw inner stuff
-				#2
-				
-				% draw inner text
-				\pgftext[center,x=-0.15\pgf at circ@res at step,y=0]{\ctikzvalof{bipoles/twoport/text}}
-		}
-	}
+        \anchor{text}{
+            \northwest
+            \advance \pgf at y by 0.5\ht\pgfnodeparttextbox
+            \pgf at x=-.5\wd\pgfnodeparttextbox
+        }
+        \backgroundpath{
+            \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+            \northwest
+            \pgf at circ@res at up = \pgf at y
+            \pgf at circ@res at down = -\pgf at y
+            \pgf at circ@res at right = -\pgf at x
+            \pgf at circ@res at left = \pgf at x
+
+            \pgfstartlinewidth=\pgflinewidth
+
+            % draw outer box
+            \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+            \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+            \pgfusepath{draw}
+
+            % draw inner stuff
+            #2
+
+            % draw inner text
+            \pgftext[center,x=-0.15\pgf at circ@res at step,y=0]{\ctikzvalof{bipoles/twoport/text}}
+        }
+    }
 }
 
 % four-port
@@ -542,49 +836,47 @@
 
 % straight coupler
 \pgfcircdeclarefourport{coupler}{
-	\pgfsetlinewidth{\pgfstartlinewidth}
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0.5\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0.5\pgf at circ@res at up}}
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0.5\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0.5\pgf at circ@res at down}}
-	\pgfusepath{draw}
-	
-	\pgfpathmoveto{\pgfpoint{0.7\pgf at circ@res at left}{0.4\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint{0.7\pgf at circ@res at right}{0.4\pgf at circ@res at up}}
-	\pgfsetarrows{latex-latex}
-	\pgfusepath{draw}
-	\pgfpathmoveto{\pgfpoint{0.7\pgf at circ@res at left}{0.4\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint{0.7\pgf at circ@res at right}{0.4\pgf at circ@res at down}}
-	\pgfsetarrows{latex-latex}
-	\pgfusepath{draw}
+    \pgfsetlinewidth{\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0.5\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0.5\pgf at circ@res at up}}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0.5\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0.5\pgf at circ@res at down}}
+    \pgfusepath{draw}
+
+    \pgfpathmoveto{\pgfpoint{0.7\pgf at circ@res at left}{0.4\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{0.7\pgf at circ@res at right}{0.4\pgf at circ@res at up}}
+    \pgfsetarrows{latex-latex}
+    \pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{0.7\pgf at circ@res at left}{0.4\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{0.7\pgf at circ@res at right}{0.4\pgf at circ@res at down}}
+    \pgfsetarrows{latex-latex}
+    \pgfusepath{draw}
 }
 
 % "bended" coupler
 \pgfcircdeclarefourport{coupler2}{
-	\pgfsetlinewidth{\pgfstartlinewidth}
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0.5\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0.5\pgf at circ@res at up}}
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0.5\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0.5\pgf at circ@res at down}}
-	\pgfusepath{draw}
-	
-	\pgfpathmoveto{\pgfpoint{0.1\pgf at circ@res at left}{0pt}}
-	\pgfpatharc{0}{90} {0.4\pgf at circ@res at up}
-	\pgfsetarrowsend{latex}
-	\pgfusepath{draw}
-	\pgfpathmoveto{\pgfpoint{0.1\pgf at circ@res at left}{0pt}}
-	\pgfpatharc{0}{-90} {0.4\pgf at circ@res at up}
-	\pgfsetarrowsend{latex}
-	\pgfusepath{draw}
-	
-	\pgfpathmoveto{\pgfpoint{0.1\pgf at circ@res at right}{0pt}}
-	\pgfpatharc{180}{90} {0.4\pgf at circ@res at up}
-	\pgfsetarrowsend{latex}
-	\pgfusepath{draw}
-	\pgfpathmoveto{\pgfpoint{0.1\pgf at circ@res at right}{0pt}}
-	\pgfpatharc{-180}{-90} {0.4\pgf at circ@res at up}
-	\pgfsetarrowsend{latex}
-	\pgfusepath{draw}
-	
-	
+    \pgfsetlinewidth{\pgfstartlinewidth}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0.5\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0.5\pgf at circ@res at up}}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0.5\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0.5\pgf at circ@res at down}}
+    \pgfusepath{draw}
+
+    \pgfpathmoveto{\pgfpoint{0.1\pgf at circ@res at left}{0pt}}
+    \pgfpatharc{0}{90} {0.4\pgf at circ@res at up}
+    \pgfsetarrowsend{latex}
+    \pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{0.1\pgf at circ@res at left}{0pt}}
+    \pgfpatharc{0}{-90} {0.4\pgf at circ@res at up}
+    \pgfsetarrowsend{latex}
+    \pgfusepath{draw}
+
+    \pgfpathmoveto{\pgfpoint{0.1\pgf at circ@res at right}{0pt}}
+    \pgfpatharc{180}{90} {0.4\pgf at circ@res at up}
+    \pgfsetarrowsend{latex}
+    \pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{0.1\pgf at circ@res at right}{0pt}}
+    \pgfpatharc{-180}{-90} {0.4\pgf at circ@res at up}
+    \pgfsetarrowsend{latex}
+    \pgfusepath{draw}
 }

Modified: trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex	2019-05-10 21:14:43 UTC (rev 51070)
+++ trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex	2019-05-10 21:15:08 UTC (rev 51071)
@@ -5,135 +5,266 @@
 % 1. under the LaTeX Project Public License and/or
 % 2. under the GNU Public License.
 %
-% See the file doc/LICENSE for more details.
+% See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %%  Other shapes
 
-
 %% Nothing
 
 \pgfdeclareshape{emptyshape}{
-	\savedanchor{\northeast}{%
-		\pgf at x=.5\wd\pgfnodeparttextbox%
-		\pgf at y=.5\ht\pgfnodeparttextbox%
-   }
-	\anchor{north}{
-		\northeast
-		\pgf at x=0cm
-	}
-	\anchor{east}{%
-		\northeast
-		\pgf at y=0cm
-   }
-	\anchor{south}{%
-		\northeast
-		\pgf at y=-\pgf at y
-		\pgf at x=0cm
-   }
-	\anchor{west}{
-		\northeast
-		\pgf at y=0cm
-		\pgf at x=-\pgf at x
-	}
-	\anchor{text}{%
-		\pgfpointorigin
-   }
-	\anchor{center}{
-		\pgfpointorigin
-	}
+    \savedanchor{\northeast}{%
+        \pgf at x=.5\wd\pgfnodeparttextbox%
+        \pgf at y=.5\ht\pgfnodeparttextbox%
+    }
+    \anchor{north}{\northeast\pgf at x=0cm\relax}
+    \anchor{east}{\northeast\pgf at y=0cm\relax}
+    \anchor{south}{\northeast\pgf at y=-\pgf at y \pgf at x=0cm\relax}
+    \anchor{west}{\northeast\pgf at y=0cm\pgf at x=-\pgf at x}
+    \anchor{north east}{\northeast}
+    \anchor{north west}{\northeast\pgf at x=-\pgf at x}
+    \anchor{south east}{\northeast\pgf at y=-\pgf at y}
+    \anchor{south west}{\northeast\pgf at y=-\pgf at y\pgf at x=-\pgf at x}
+    \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
+    \anchor{center}{
+        \pgfpointorigin
+    }
 }
 
 %% Full terminal
 
 \pgfdeclareshape{circ}{
-	\anchor{center}{
-		\pgfpointorigin
-	}
-	\anchorborder{
-		\pgf at circ@res at left=\pgf at x
-		\pgf at circ@res at up=\pgf at y
-		\pgfpointborderellipse{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}
-}{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf at circ@Rlen}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf at circ@Rlen}}		
-	}
-	\behindforegroundpath{		
-		
-		\pgfscope
-			\pgfpathcircle{\pgfpointorigin}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf at circ@Rlen}
-			\pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
-			\pgfusepath{draw,fill}		
-		\endpgfscope
+    \anchor{center}{
+        \pgfpointorigin
+    }
+    \savedanchor\northwest{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/nodes width}\pgf at circ@Rlen
+        \pgf at x=-\pgf at y
+    }
+    \anchor{center}{ \pgf at y=0pt \pgf at x=0pt }
+    \anchor{east}{ \northwest \pgf at y=0pt \pgf at x=-\pgf at x  }
+    \anchor{e}{ \northwest \pgf at y=0pt \pgf at x=-\pgf at x  }
+    \anchor{west}{ \northwest \pgf at y=0pt }
+    \anchor{w}{ \northwest \pgf at y=0pt }
+    \anchor{south}{ \northwest \pgf at x=0pt \pgf at y=-\pgf at y }
+    \anchor{s}{ \northwest \pgf at x=0pt \pgf at y=-\pgf at y }
+    \anchor{north}{ \northwest \pgf at x=0pt }
+    \anchor{n}{ \northwest \pgf at x=0pt }
+    \anchor{south west}{ \northwest \pgf at y=-\pgf at y }
+    \anchor{north east}{ \northwest \pgf at x=-\pgf at x }
+    \anchor{north west}{ \northwest }
+    \anchor{south east}{ \northwest \pgf at x=-\pgf at x \pgf at y=-\pgf at y }
+    \anchorborder{
+        \pgf at circ@res at left=\pgf at x
+        \pgf at circ@res at up=\pgf at y
+        \pgfpointborderellipse{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}
+        }{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf at circ@Rlen}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf at circ@Rlen}}
+    }
+    \behindforegroundpath{
 
-		}
+        \pgfscope
+            \pgfpathcircle{\pgfpointorigin}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf at circ@Rlen}
+            \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+            \pgfsetfillopacity{1.0}
+            \pgfusepath{draw,fill}
+        \endpgfscope
+
+    }
 }
 
 %% Empty terminal
 
 \pgfdeclareshape{ocirc}{
-	\anchor{center}{
-		\pgfpointorigin
-	}
-	\anchorborder{
-		\pgf at circ@res at left=\pgf at x
-		\pgf at circ@res at up=\pgf at y
-		\pgfpointborderellipse{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}
-}{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf at circ@Rlen}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf at circ@Rlen}}		
-	}
+    \anchor{center}{
+        \pgfpointorigin
+    }
+    \savedanchor\northwest{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/nodes width}\pgf at circ@Rlen
+        \pgf at x=-\pgf at y
+    }
+    \anchor{center}{ \pgf at y=0pt \pgf at x=0pt }
+    \anchor{east}{ \northwest \pgf at y=0pt \pgf at x=-\pgf at x  }
+    \anchor{e}{ \northwest \pgf at y=0pt \pgf at x=-\pgf at x  }
+    \anchor{west}{ \northwest \pgf at y=0pt }
+    \anchor{w}{ \northwest \pgf at y=0pt }
+    \anchor{south}{ \northwest \pgf at x=0pt \pgf at y=-\pgf at y }
+    \anchor{s}{ \northwest \pgf at x=0pt \pgf at y=-\pgf at y }
+    \anchor{north}{ \northwest \pgf at x=0pt }
+    \anchor{n}{ \northwest \pgf at x=0pt }
+    \anchor{south west}{ \northwest \pgf at y=-\pgf at y }
+    \anchor{north east}{ \northwest \pgf at x=-\pgf at x }
+    \anchor{north west}{ \northwest }
+    \anchor{south east}{ \northwest \pgf at x=-\pgf at x \pgf at y=-\pgf at y }
+    \anchorborder{
+        \pgf at circ@res at left=\pgf at x
+        \pgf at circ@res at up=\pgf at y
+        \pgfpointborderellipse{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}
+        }{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf at circ@Rlen}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf at circ@Rlen}}
+    }
 
-	\behindforegroundpath{		
-		
-		\pgfscope
-			\pgfpathcircle{\pgfpointorigin}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf at circ@Rlen}
-			\pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
-			\pgfsetfillcolor{white}
-			\pgfusepath{draw,fill}		
-		\endpgfscope
+    \behindforegroundpath{
 
-		}
+        \pgfscope
+            \pgfpathcircle{\pgfpointorigin}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf at circ@Rlen}
+            \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+            \ifx\tikz at fillcolor\pgfutil at empty
+                \pgfsetfillcolor{white}
+            \else
+                \pgfsetfillcolor{\tikz at fillcolor}
+            \fi
+            \pgfsetfillopacity{1.0}
+            \pgfusepath{draw,fill}
+        \endpgfscope
+
+    }
 }
 
 %% Diamond terminal
 
 \pgfdeclareshape{diamondpole}{
-	\anchor{center}{
-		\pgfpointorigin
-	}
-	\anchorborder{
-		\pgf at circ@res at left=\pgf at x
-		\pgf at circ@res at up=\pgf at y
-	}
-	\behindforegroundpath{		
-		\pgfscope
-			\pgfmathsetlength{\pgf at circ@res at temp}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf at circ@Rlen}
-			\pgftransformrotate{45}
-			\pgfpathrectanglecorners
-			{\pgfpoint{\pgf at circ@res at left-\pgf at circ@res at temp}{\pgf at circ@res at up+\pgf at circ@res at temp}}
-			{\pgfpoint{\pgf at circ@res at left+\pgf at circ@res at temp}{\pgf at circ@res at up-\pgf at circ@res at temp}}
-			\pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
-			\pgfusepath{draw,fill}		
-		\endpgfscope
-		}
+    \anchor{center}{
+        \pgfpointorigin
+    }
+    \savedanchor\northwest{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/nodes width}\pgf at circ@Rlen
+        \pgf at x=-\pgf at y
+    }
+    \anchor{center}{ \pgf at y=0pt \pgf at x=0pt }
+    \anchor{east}{ \northwest \pgf at y=0pt \pgf at x=-\pgf at x  }
+    \anchor{e}{ \northwest \pgf at y=0pt \pgf at x=-\pgf at x  }
+    \anchor{west}{ \northwest \pgf at y=0pt }
+    \anchor{w}{ \northwest \pgf at y=0pt }
+    \anchor{south}{ \northwest \pgf at x=0pt \pgf at y=-\pgf at y }
+    \anchor{s}{ \northwest \pgf at x=0pt \pgf at y=-\pgf at y }
+    \anchor{north}{ \northwest \pgf at x=0pt }
+    \anchor{n}{ \northwest \pgf at x=0pt }
+    \anchor{south west}{ \northwest \pgf at y=-\pgf at y }
+    \anchor{north east}{ \northwest \pgf at x=-\pgf at x }
+    \anchor{north west}{ \northwest }
+    \anchor{south east}{ \northwest \pgf at x=-\pgf at x \pgf at y=-\pgf at y }
+    \anchorborder{
+        \pgf at circ@res at left=\pgf at x
+        \pgf at circ@res at up=\pgf at y
+    }
+    \behindforegroundpath{
+        \pgfscope
+            \pgfmathsetlength{\pgf at circ@res at temp}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf at circ@Rlen}
+            \pgftransformrotate{45}
+            \pgfpathrectanglecorners
+            {\pgfpoint{\pgf at circ@res at left-\pgf at circ@res at temp}{\pgf at circ@res at up+\pgf at circ@res at temp}}
+            {\pgfpoint{\pgf at circ@res at left+\pgf at circ@res at temp}{\pgf at circ@res at up-\pgf at circ@res at temp}}
+            \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+            \pgfsetfillopacity{1.0}
+            \pgfusepath{draw,fill}
+        \endpgfscope
+    }
 }
 
+% BNC connector
+
+\pgfdeclareshape{bnc}{
+    \anchor{center}{
+        \pgfpointorigin
+    }
+    % BNC size is 2.5 times the size of the internal "ocirc"
+    \savedanchor\northwest{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/nodes width}\pgf at circ@Rlen
+        \pgf at y=2.5\pgf at y
+        \pgf at x=-\pgf at y
+    }
+    % center is on the opening
+    \anchor{center}{ \northwest \pgf at y=0pt \pgf at x=-\pgf at x  }
+    \anchor{zero}{ \pgfpointorigin }
+    \anchor{hot}{ \northwest \pgf at y=0pt \pgf at x=-\pgf at x  }
+    \anchor{shield}{ \northwest \pgf at x=0pt \pgf at y=-\pgf at y }
+    % geo-anchors
+    \anchor{east}{ \northwest \pgf at y=0pt \pgf at x=-\pgf at x  }
+    \anchor{right}{ \northwest \pgf at y=0pt \pgf at x=-\pgf at x  }
+    \anchor{west}{ \northwest \pgf at y=0pt }
+    \anchor{left}{ \northwest \pgf at y=0pt }
+    \anchor{south}{ \northwest \pgf at x=0pt \pgf at y=-\pgf at y }
+    \anchor{north}{ \northwest \pgf at x=0pt }
+    \anchor{south west}{ \northwest \pgf at y=-\pgf at y }
+    \anchor{north east}{ \northwest \pgf at x=-\pgf at x }
+    \anchor{north west}{ \northwest }
+    \anchor{south east}{ \northwest \pgf at x=-\pgf at x \pgf at y=-\pgf at y }
+    % put the node text above and centered
+    \anchor{text}{\pgfextracty{\pgf at circ@res at up}{\northwest}
+        \pgfpoint{-.5\wd\pgfnodeparttextbox}{
+            \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf at circ@res at up\relax
+        }
+    }
+    \anchorborder{
+        \pgf at circ@res at left=\pgf at x
+        \pgf at circ@res at up=\pgf at y
+        \pgfpointborderellipse{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}
+        }{\pgfpoint{2.5*\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf at circ@Rlen}{2.5*\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf at circ@Rlen}}
+    }
+    \behindforegroundpath{
+        \pgfextracty{\pgf at circ@res at other}{\northwest}
+        \pgf at circ@res at step=\pgfkeysvalueof{/tikz/circuitikz/nodes width}\pgf at circ@Rlen
+        \pgfscope
+            \pgfstartlinewidth=\pgflinewidth
+            \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgflinewidth}
+            \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+            % external circle
+            \pgfscope
+                % clipping path: first a rectangle bigger then the shape
+                % to avoid problems with the line thickness
+                \pgfpathrectanglecorners{\pgfpoint{-2\pgf at circ@res at other}{-2\pgf at circ@res at other}}
+                    {\pgfpoint{2\pgf at circ@res at other}{2\pgf at circ@res at other}}
+                % next the opening to the right
+                \pgfpathrectanglecorners{\pgfpoint{-\pgf at circ@res at step}{-\pgf at circ@res at step}}
+                    {\pgfpoint{2\pgf at circ@res at other}{\pgf at circ@res at step}}
+                % do the difference and clip before drawing
+                \pgfseteorule
+                \pgfusepath{clip}
+                \pgfpathcircle{\pgfpointorigin}{\pgf at circ@res at other}
+                \pgfusepath{draw}
+            \endpgfscope
+            % internal circle
+            \pgfpathcircle{\pgfpointorigin}{\pgf at circ@res at step}
+            \pgf at circ@draworfill
+            % and the contact line to the right
+            \pgfsetlinewidth{\pgfstartlinewidth}
+            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
+            \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{0pt}}
+            \pgfusepath{draw}
+        \endpgfscope
+    }
+}
+
 %% Fill for correct rectangular joins
 
 \pgfdeclareshape{rectjoinfill}{
-	\anchor{center}{
-		\pgfpointorigin
-	}
-	\anchorborder{
-		\pgf at circ@res at left=\pgf at x
-		\pgf at circ@res at up=\pgf at y
-	}
-	\behindforegroundpath{		
-		\pgfscope
-			\pgfpathrectanglecorners
-			{\pgfpoint{0}{.5\pgflinewidth}}
-			{\pgfpoint{0}{-.5\pgflinewidth}}
-			\pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
-			\pgfusepath{draw,fill}		
-		\endpgfscope
-		}
+    \savedanchor{\northeast}{%
+        \pgf at x=.5\pgflinewidth%
+        \pgf at y=.5\pgflinewidth%
+    }
+    \anchor{north}{\northeast\pgf at x=0cm\relax}
+    \anchor{east}{\northeast\pgf at y=0cm\relax}
+    \anchor{south}{\northeast\pgf at y=-\pgf at y \pgf at x=0cm\relax}
+    \anchor{west}{\northeast\pgf at y=0cm\pgf at x=-\pgf at x}
+    \anchor{north east}{\northeast}
+    \anchor{north west}{\northeast\pgf at x=-\pgf at x}
+    \anchor{south east}{\northeast\pgf at y=-\pgf at y}
+    \anchor{south west}{\northeast\pgf at y=-\pgf at y\pgf at x=-\pgf at x}
+    \anchor{center}{
+        \pgfpointorigin
+    }
+    \anchorborder{
+        \pgf at circ@res at left=\pgf at x
+        \pgf at circ@res at up=\pgf at y
+    }
+    \behindforegroundpath{
+        \pgfscope
+            \pgfpathrectanglecorners
+            {\pgfpoint{0}{.5\pgflinewidth}}
+            {\pgfpoint{0}{-.5\pgflinewidth}}
+            \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+            \pgfusepath{draw,fill}
+        \endpgfscope
+    }
 }
 
 
@@ -140,89 +271,130 @@
 %% Current arrow
 
 \pgfdeclareshape{currarrow}{
-	\anchor{center}{
-		\pgfpointorigin
-	}
-		\anchor{tip}{
-		\pgfpointorigin
-			\pgf at circ@res at step = \pgf at circ@Rlen
-				\divide \pgf at circ@res at step by 16
-		\pgf at x	=\pgf at circ@res at step
-		}
-	\behindforegroundpath{		
-		
-		\pgfscope
-			\pgf at circ@res at step = \pgf at circ@Rlen
-			\divide \pgf at circ@res at step by 16
+    \savedanchor{\northeast}{%
+        \pgf at circ@res at step = \pgf at circ@Rlen
+        \divide \pgf at circ@res at step by \pgfkeysvalueof{/tikz/circuitikz/current arrow scale}
+        \pgf at x=.5\pgf at circ@res at step
+        \pgf at y=\pgf at x%
+    }
+    \anchor{north}{\northeast\pgf at x=0cm\relax}
+    \anchor{east}{\northeast\pgf at y=0cm\relax}
+    \anchor{south}{\northeast\pgf at y=-\pgf at y \pgf at x=0cm\relax}
+    \anchor{west}{\northeast\pgf at y=0cm\pgf at x=-\pgf at x}
+    \anchor{north east}{\northeast}
+    \anchor{north west}{\northeast\pgf at x=-\pgf at x}
+    \anchor{south east}{\northeast\pgf at y=-\pgf at y}
+    \anchor{south west}{\northeast\pgf at y=-\pgf at y\pgf at x=-\pgf at x}
+    \anchor{center}{
+        \pgfpointorigin
+    }
+    \anchor{tip}{
+        \pgfpointorigin
+        \pgf at circ@res at step = \pgf at circ@Rlen
+        \divide \pgf at circ@res at step by \pgfkeysvalueof{/tikz/circuitikz/current arrow scale}
+        \pgf at x	=\pgf at circ@res at step
+    }
+    \behindforegroundpath{
+        \pgfscope
+            \pgf at circ@res at step = \pgf at circ@Rlen
+            \divide \pgf at circ@res at step by \pgfkeysvalueof{/tikz/circuitikz/current arrow scale}
 
-			\pgfpathmoveto{\pgfpoint{-.7\pgf at circ@res at step}{0pt}}
-			\pgfpathlineto{\pgfpoint{-.7\pgf at circ@res at step}{-.8\pgf at circ@res at step}}
-			\pgfpathlineto{\pgfpoint{1\pgf at circ@res at step}{0pt}}
-			\pgfpathlineto{\pgfpoint{-.7\pgf at circ@res at step}{.8\pgf at circ@res at step}}
-			\pgfpathlineto{\pgfpoint{-.7\pgf at circ@res at step}{0pt}}			
-			\pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
-			\pgfusepath{draw,fill}
+            \pgfpathmoveto{\pgfpoint{-.7\pgf at circ@res at step}{0pt}}
+            \pgfpathlineto{\pgfpoint{-.7\pgf at circ@res at step}{-.8\pgf at circ@res at step}}
+            \pgfpathlineto{\pgfpoint{1\pgf at circ@res at step}{0pt}}
+            \pgfpathlineto{\pgfpoint{-.7\pgf at circ@res at step}{.8\pgf at circ@res at step}}
+            \pgfpathlineto{\pgfpoint{-.7\pgf at circ@res at step}{0pt}}
+            \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+            \pgfusepath{draw,fill}
 
-		\endpgfscope
-	}
-
+        \endpgfscope
+    }
 }
 
 %% Flow arrow
 
 \pgfdeclareshape{flowarrow}{
-	\anchor{center}{
-		\pgfpointorigin
-	}
-		\anchor{tip}{
-		\pgfpointorigin
-			\pgf at circ@res at step = \pgf at circ@Rlen
-				\divide \pgf at circ@res at step by 16
-		\pgf at x	=\pgf at circ@res at step
-		}
-	\behindforegroundpath{
-		\pgfscope
-			\pgf at circ@res at step = \pgf at circ@Rlen
-			\divide \pgf at circ@res at step by 4
-			\pgfpathmoveto{\pgfpoint{-\pgf at circ@res at step}{0pt}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{0pt}}
-			\pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
-			\pgfusepath{draw}
-			\pgftransformshift{\pgfpoint{\pgf at circ@res at step}{0pt}}
-			\pgfnode{currarrow}{tip}{}{}{\pgfusepath{fill}}
-		\endpgfscope
-	}
+    \savedanchor{\northeast}{%
+        \pgf at circ@res at step = \pgf at circ@Rlen
+        \divide \pgf at circ@res at step by \pgfkeysvalueof{/tikz/circuitikz/current arrow scale}
+        \pgf at y=.5\pgf at circ@res at step
+        \pgf at circ@res at step = \pgf at circ@Rlen
+        \divide \pgf at circ@res at step by 4
+        \pgf at x=\pgf at circ@res at step%
+    }
+    \anchor{north}{\northeast\pgf at x=0cm\relax}
+    \anchor{east}{\northeast\pgf at y=0cm\relax}
+    \anchor{south}{\northeast\pgf at y=-\pgf at y \pgf at x=0cm\relax}
+    \anchor{west}{\northeast\pgf at y=0cm\pgf at x=-\pgf at x}
+    \anchor{north east}{\northeast}
+    \anchor{north west}{\northeast\pgf at x=-\pgf at x}
+    \anchor{south east}{\northeast\pgf at y=-\pgf at y}
+    \anchor{south west}{\northeast\pgf at y=-\pgf at y\pgf at x=-\pgf at x}
+    \anchor{center}{
+        \pgfpointorigin
+    }
+    \anchor{tip}{
+        \pgfpointorigin
+        \pgf at circ@res at step = \pgf at circ@Rlen
+        \divide \pgf at circ@res at step by \pgfkeysvalueof{/tikz/circuitikz/current arrow scale}
+        \pgf at x	=\pgf at circ@res at step
+    }
+    \behindforegroundpath{
+        \pgfscope
+            \pgf at circ@res at step = \pgf at circ@Rlen
+            \divide \pgf at circ@res at step by 4
+            \pgfpathmoveto{\pgfpoint{-\pgf at circ@res at step}{0pt}}
+            \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{0pt}}
+            \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+            \pgfusepath{draw}
+            \pgftransformshift{\pgfpoint{\pgf at circ@res at step}{0pt}}
+            \pgfnode{currarrow}{tip}{}{}{\pgfusepath{fill}}
+        \endpgfscope
+    }
 }
 
 %% Input arrow
 
 \pgfdeclareshape{inputarrow}{
-	\savedanchor{\tip}{
-		\pgfpointorigin
-	}
-	\anchor{center}{
-		\tip
-	}
-	\anchor{tip}{
-		\tip
-	}
-	\behindforegroundpath{		
-		
-		\pgfscope
-			\pgf at circ@res at step = \pgf at circ@Rlen
-			\divide \pgf at circ@res at step by 16
+    \savedanchor{\northeast}{% this is really not northeast, really -northwest
+        \pgf at circ@res at step = \pgf at circ@Rlen
+        \divide \pgf at circ@res at step by \pgfkeysvalueof{/tikz/circuitikz/current arrow scale}
+        \pgf at y=.5\pgf at circ@res at step
+        \pgf at x=1.7\pgf at circ@res at step
+    }
+    \anchor{north}{\northeast\pgf at x=0cm\relax}
+    \anchor{east}{\northeast\pgf at y=0cm\relax\pgf at x=0cm\relax}
+    \anchor{south}{\northeast\pgf at y=-\pgf at y \pgf at x=0cm\relax}
+    \anchor{west}{\northeast\pgf at y=0cm\pgf at x=-\pgf at x}
+    \anchor{north east}{\northeast\pgf at x=0cm\relax}
+    \anchor{north west}{\northeast\pgf at x=-\pgf at x}
+    \anchor{south east}{\northeast\pgf at y=-\pgf at y\pgf at x=0cm\relax}
+    \anchor{south west}{\northeast\pgf at y=-\pgf at y\pgf at x=-\pgf at x}
+    \savedanchor{\tip}{
+        \pgfpointorigin
+    }
+    \anchor{center}{
+        \tip
+    }
+    \anchor{tip}{
+        \tip
+    }
+    \behindforegroundpath{
 
-			\pgfpathmoveto{\pgfpoint{-1.7\pgf at circ@res at step}{0pt}}
-			\pgfpathlineto{\pgfpoint{-1.7\pgf at circ@res at step}{-.8\pgf at circ@res at step}}
-			\pgfpathlineto{\pgfpoint{0pt}{0pt}}
-			\pgfpathlineto{\pgfpoint{-1.7\pgf at circ@res at step}{.8\pgf at circ@res at step}}
-			\pgfpathlineto{\pgfpoint{-1.7\pgf at circ@res at step}{0pt}}			
-			\pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
-			\pgfusepath{fill}
+        \pgfscope
+            \pgf at circ@res at step = \pgf at circ@Rlen
+            \divide \pgf at circ@res at step by 16
 
-		\endpgfscope
-	}
+            \pgfpathmoveto{\pgfpoint{-1.7\pgf at circ@res at step}{0pt}}
+            \pgfpathlineto{\pgfpoint{-1.7\pgf at circ@res at step}{-.8\pgf at circ@res at step}}
+            \pgfpathlineto{\pgfpoint{0pt}{0pt}}
+            \pgfpathlineto{\pgfpoint{-1.7\pgf at circ@res at step}{.8\pgf at circ@res at step}}
+            \pgfpathlineto{\pgfpoint{-1.7\pgf at circ@res at step}{0pt}}
+            \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+            \pgfusepath{fill}
 
+        \endpgfscope
+    }
 }
 
 
@@ -229,20 +401,103 @@
 %% box
 
 \pgfdeclareshape{box}{
-	\anchor{center}{
-		\pgfpointorigin
-	}
-	\behindforegroundpath{		
-		
-		\pgfscope
-			\pgf at circ@res at step = \ctikzvalof{bipoles/twoport/width}\pgf at circ@Rlen
-			\pgf at circ@res at step = 0.5\pgf at circ@res at step
-			\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-			\pgfpathrectanglecorners{\pgfpoint{-\pgf at circ@res at step}{\pgf at circ@res at step}}{\pgfpoint{\pgf at circ@res at step}{-\pgf at circ@res at step}}
-			\pgfusepath{draw}
-		\endpgfscope
-	}
+    \anchor{center}{
+        \pgfpointorigin
+    }
+    \behindforegroundpath{
 
+        \pgfscope
+            \pgf at circ@res at step = \ctikzvalof{bipoles/twoport/width}\pgf at circ@Rlen
+            \pgf at circ@res at step = 0.5\pgf at circ@res at step
+            \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+            \pgfpathrectanglecorners{\pgfpoint{-\pgf at circ@res at step}{\pgf at circ@res at step}}{\pgfpoint{\pgf at circ@res at step}{-\pgf at circ@res at step}}
+            \pgf at circ@draworfill
+        \endpgfscope
+    }
+
 }
 
+
+% full nodes for wire crossing
+
+\pgfdeclareshape{jump crossing}
+{
+    \savedanchor\northwest{%
+        \pgf at y=\ctikzvalof{bipoles/crossing/size}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at x=-\pgf at y
+    }
+    \anchor{center}{ \pgf at y=0pt \pgf at x=0pt }
+    \anchor{east}{ \northwest \pgf at y=0pt \pgf at x=-\pgf at x  }
+    \anchor{e}{ \northwest \pgf at y=0pt \pgf at x=-\pgf at x  }
+    \anchor{west}{ \northwest \pgf at y=0pt }
+    \anchor{w}{ \northwest \pgf at y=0pt }
+    \anchor{south}{ \northwest \pgf at x=0pt \pgf at y=-\pgf at y }
+    \anchor{s}{ \northwest \pgf at x=0pt \pgf at y=-\pgf at y }
+    \anchor{north}{ \northwest \pgf at x=0pt }
+    \anchor{n}{ \northwest \pgf at x=0pt }
+    \anchor{south west}{ \northwest \pgf at y=-\pgf at y }
+    \anchor{north east}{ \northwest \pgf at x=-\pgf at x }
+    \anchor{north west}{ \northwest }
+    \anchor{south east}{ \northwest \pgf at x=-\pgf at x \pgf at y=-\pgf at y }
+    \behindbackgroundpath{
+        \northwest
+        \pgf at circ@res at up = \pgf at y
+        \pgf at circ@res at down = -\pgf at y
+        \pgf at circ@res at right = -\pgf at x
+        \pgf at circ@res at left = \pgf at x
+        % horizontal jumper
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+        \pgfpathlineto{\pgfpoint{0.4\pgf at circ@res at left}{0pt}}
+        \pgfpatharc{0}{-180}{0.4*\pgf at circ@res at left}
+        \pgfsetbeveljoin
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+        % vertical, broken path
+        \pgfpathmoveto{\pgfpoint{0pt}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{0pt}{0.5\pgf at circ@res at up}}
+        \pgfpathmoveto{\pgfpoint{0pt}{0.3\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
+        \pgfusepath{draw}
+
+    }
+}
+\pgfdeclareshape{plain crossing}
+{
+    \savedanchor\northwest{%
+        \pgf at y=\ctikzvalof{bipoles/crossing/size}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at x=-\pgf at y
+    }
+    \anchor{center}{ \pgf at y=0pt \pgf at x=0pt }
+    \anchor{east}{ \northwest \pgf at y=0pt \pgf at x=-\pgf at x  }
+    \anchor{e}{ \northwest \pgf at y=0pt \pgf at x=-\pgf at x  }
+    \anchor{west}{ \northwest \pgf at y=0pt }
+    \anchor{w}{ \northwest \pgf at y=0pt }
+    \anchor{south}{ \northwest \pgf at x=0pt \pgf at y=-\pgf at y }
+    \anchor{s}{ \northwest \pgf at x=0pt \pgf at y=-\pgf at y }
+    \anchor{north}{ \northwest \pgf at x=0pt }
+    \anchor{n}{ \northwest \pgf at x=0pt }
+    \anchor{south west}{ \northwest \pgf at y=-\pgf at y }
+    \anchor{north east}{ \northwest \pgf at x=-\pgf at x }
+    \anchor{north west}{ \northwest }
+    \anchor{south east}{ \northwest \pgf at x=-\pgf at x \pgf at y=-\pgf at y }
+    \behindbackgroundpath{
+        \northwest
+        \pgf at circ@res at up = \pgf at y
+        \pgf at circ@res at down = -\pgf at y
+        \pgf at circ@res at right = -\pgf at x
+        \pgf at circ@res at left = \pgf at x
+        % horizontal jumper
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+        % vertical, broken path
+        \pgfpathmoveto{\pgfpoint{0pt}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{0pt}{0.1\pgf at circ@res at up}}
+        \pgfpathmoveto{\pgfpoint{0pt}{0.1\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
+        \pgfusepath{draw}
+
+    }
+}
+
 \endinput

Modified: trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex	2019-05-10 21:14:43 UTC (rev 51070)
+++ trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex	2019-05-10 21:15:08 UTC (rev 51071)
@@ -5,1294 +5,1424 @@
 % 1. under the LaTeX Project Public License and/or
 % 2. under the GNU Public License.
 %
-% See the file doc/LICENSE for more details.
+% See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %% Tripoles
 
+\pgfdeclareshape{spdt}{
+    \savedanchor\northwest{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+    }
+    \anchor{left}{%
+        \northwest
+        \pgf at y=0pt
+    }
+    \anchor{in}{
+        \northwest
+        \pgf at y=0pt
+    }
+    \anchor{out 1}{
+        \northwest
+        \pgf at x=-\pgf at x
+    }
+    \anchor{out 2}{
+        \northwest
+        \pgf at x=-\pgf at x
+        \pgf at y=-\pgf at y
+    }
+    \anchor{center}{
+        \pgf at y=0pt
+        \pgf at x=0pt
+    }
+    \anchor{east}{
+        \northwest
+        \pgf at y=0pt
+        \pgf at x=-\pgf at x
+    }
+    \anchor{west}{
+        \northwest
+        \pgf at y=0pt
+    }
+    \anchor{south}{
+        \northwest
+        \pgf at x=0pt
+        \pgf at y=-\pgf at y
+    }
+    \anchor{north}{
+        \northwest
+        \pgf at x=0pt
+    }
+    \anchor{south west}{
+        \northwest
+        \pgf at y=-\pgf at y
+    }
+    \anchor{north east}{
+        \northwest
+        \pgf at x=-\pgf at x
+    }
+    \anchor{north west}{
+        \northwest
+    }
+    \anchor{south east}{
+        \northwest
+        \pgf at x=-\pgf at x
+        \pgf at y=-\pgf at y
+    }
+    \backgroundpath{
+        \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
 
 
-\pgfdeclareshape{spdt}
-	{
-	  \savedanchor\northwest{%
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/height}\pgf at circ@Rlen
-		\pgf at y=.5\pgf at y
-		\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/width}\pgf at circ@Rlen
-		\pgf at x=.5\pgf at x
-	  }
-	  \anchor{left}{%
-	  	\northwest
-	  	\pgf at y=0pt
-	  }
-	  \anchor{in}{
-	  	\northwest
-	  	\pgf at y=0pt
-	  }	  
-	  \anchor{out 1}{
-		\northwest
-		\pgf at x=-\pgf at x
-	  }
-	  \anchor{out 2}{
-		\northwest
-		\pgf at x=-\pgf at x
-		\pgf at y=-\pgf at y
-	  }
-  	  \anchor{center}{
-		\pgf at y=0pt
-		\pgf at x=0pt
-	  }
-	  \anchor{east}{
-	  	\northwest
-		\pgf at y=0pt
-	  	\pgf at x=-\pgf at x  
-	  }
-	  \anchor{west}{
-	  	\northwest
-		\pgf at y=0pt
-	  }
-	  \anchor{south}{
-		\northwest
-		\pgf at x=0pt
-		\pgf at y=-\pgf at y
-	  }
-	  \anchor{north}{
-		\northwest
-		\pgf at x=0pt
-	  }
-	  \anchor{south west}{
-		\northwest
-		\pgf at y=-\pgf at y
-	  }
-	  \anchor{north east}{
-		\northwest
-		\pgf at x=-\pgf at x
-	  }
-	  \anchor{north west}{
-		\northwest
-	  }
-	  \anchor{south east}{
-		\northwest
-		\pgf at x=-\pgf at x
-		\pgf at y=-\pgf at y
-	  }	  
-	  \backgroundpath{			
-			\pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}	
-			
-			
-			\northwest
-			\pgf at circ@res at up = \pgf at y 
-			\pgf at circ@res at down = -\pgf at y
-			\pgf at circ@res at right = -\pgf at x  
-			\pgf at circ@res at left = \pgf at x  
-			\pgf at circ@res at other = \pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/margin}\pgf at circ@res at left
-			
-		
-	  	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{-\pgf at circ@res at other}{\pgf at circ@res at up}}
-	  	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{-\pgf at circ@res at other}{\pgf at circ@res at down}}
-		
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{0pt}}
-		
-		\pgfusepath{draw}
-		
-		\pgfscope
-			\pgftransformshift{\pgfpoint{-\pgf at circ@res at other}{\pgf at circ@res at up}}
-			\pgfnode{ocirc}{center}{}{spdt1}{\pgfusepath{stroke}}
-		\endpgfscope
-		\pgfscope
-			\pgftransformshift{\pgfpoint{-\pgf at circ@res at other}{\pgf at circ@res at down}}
-			\pgfnode{ocirc}{center}{}{}{\pgfusepath{stroke}}
-		\endpgfscope
-		\pgfscope
-			\pgftransformshift{\pgfpoint{\pgf at circ@res at other}{0pt}}
-			\pgfnode{ocirc}{center}{}{spdt2}{\pgfusepath{stroke}}
-		\endpgfscope
-		
-		
-		\pgfscope
-			\pgfpathmoveto{\pgfpointshapeborder{spdt2}{\pgfpointorigin}}
-			\pgfpathlineto{
-				\pgfpointadd{\pgfpointshapeborder{spdt1}{\pgfpoint{-\pgf at circ@res at other}{-100pt}}}
-				{\pgfpoint{-.05\pgf at circ@res at up}{-.05\pgf at circ@res at up}}
-			}
-			\pgfsetlinewidth{2\pgflinewidth}
-			\pgfusepath{draw}
-		\endpgfscope
-	  }
-	}
-	
-	
-	
+        \northwest
+        \pgf at circ@res at up = \pgf at y
+        \pgf at circ@res at down = -\pgf at y
+        \pgf at circ@res at right = -\pgf at x
+        \pgf at circ@res at left = \pgf at x
+        \pgf at circ@res at other = \pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/margin}\pgf at circ@res at left
+
+
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{-\pgf at circ@res at other}{\pgf at circ@res at up}}
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{-\pgf at circ@res at other}{\pgf at circ@res at down}}
+
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{0pt}}
+
+        \pgfusepath{draw}
+
+        \pgfscope
+            \pgftransformshift{\pgfpoint{-\pgf at circ@res at other}{\pgf at circ@res at up}}
+            \pgfnode{ocirc}{center}{}{spdt1}{\pgfusepath{stroke}}
+        \endpgfscope
+        \pgfscope
+            \pgftransformshift{\pgfpoint{-\pgf at circ@res at other}{\pgf at circ@res at down}}
+            \pgfnode{ocirc}{center}{}{}{\pgfusepath{stroke}}
+        \endpgfscope
+        \pgfscope
+            \pgftransformshift{\pgfpoint{\pgf at circ@res at other}{0pt}}
+            \pgfnode{ocirc}{center}{}{spdt2}{\pgfusepath{stroke}}
+        \endpgfscope
+
+
+        \pgfscope
+            \pgfpathmoveto{\pgfpointshapeborder{spdt2}{\pgfpointorigin}}
+            \pgfpathlineto{
+                \pgfpointadd{\pgfpointshapeborder{spdt1}{\pgfpoint{-\pgf at circ@res at other}{-100pt}}}
+                {\pgfpoint{-.05\pgf at circ@res at up}{-.05\pgf at circ@res at up}}
+            }
+            \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
+            \pgfusepath{draw}
+        \endpgfscope
+    }
+}
+
+
+% cute switch "node" shapes, matching with cute "to" shapes
+% #1 -> name
+% #2 -> barposition
+% #3 -> arrowcode
+\long\def\pgfcircdeclarecutespdt#1#2#3{
+    \pgfdeclareshape{#1}
+    {
+        \savedanchor\northwest{%
+            \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/cuteswitch/height}\pgf at circ@Rlen
+            \pgf at y=.5\pgf at y
+            \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/width}\pgf at circ@Rlen
+            \pgf at x=.25\pgf at x
+        }
+        \savedanchor\midlever{
+            % these values are calculated when we create the definition of the shape.
+            \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/cuteswitch/height}\pgf at circ@Rlen
+            \pgf at circ@res at temp=\pgfkeysvalueof{/tikz/circuitikz/nodes width}\pgf at circ@Rlen
+            \pgf at circ@res at temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf at circ@res at temp
+            \pgf at circ@res at down = -.5\pgf at y
+            \pgf at circ@res at up = .5\pgf at y
+            \pgfextracty{\pgf at circ@res at other}{#2}
+            \pgf at x=0pt
+            \pgf at y=.5\pgf at circ@res at other
+        }
+        % mid of the lever, to stack switches
+        \anchor{mid}{\midlever}
+
+        \anchor{left}{\northwest \pgf at y=0pt }
+        \anchor{in}{ \northwest \pgf at y=0pt}
+        \anchor{out 1}{ \northwest \pgf at x=-\pgf at x }
+        \anchor{out 2}{ \northwest \pgf at x=-\pgf at x \pgf at y=-\pgf at y }
+
+        \anchor{center}{ \pgf at y=0pt \pgf at x=0pt }
+        \anchor{east}{ \northwest \pgf at y=0pt \pgf at x=-\pgf at x  }
+        \anchor{west}{ \northwest \pgf at y=0pt }
+        \anchor{south}{ \northwest \pgf at x=0pt \pgf at y=-\pgf at y }
+        \anchor{north}{ \northwest \pgf at x=0pt }
+        \anchor{south west}{ \northwest \pgf at y=-\pgf at y }
+        \anchor{north east}{ \northwest \pgf at x=-\pgf at x }
+        \anchor{north west}{ \northwest }
+        \anchor{south east}{ \northwest \pgf at x=-\pgf at x \pgf at y=-\pgf at y }
+
+        \backgroundpath{
+            \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+            \northwest
+            \pgf at circ@res at up = \pgf at y
+            \pgf at circ@res at down = -\pgf at y
+            \pgf at circ@res at right = -\pgf at x
+            \pgf at circ@res at left = \pgf at x
+
+            \pgfscope
+            % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
+            \pgf at circ@res at temp=\pgfkeysvalueof{/tikz/circuitikz/nodes width}\pgf at circ@Rlen
+            \pgf at circ@res at temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf at circ@res at temp
+            \pgfsetlinewidth{2\pgf at circ@res at temp}
+            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+            \pgfpathlineto{#2}
+            \pgfsetroundcap\pgfusepath{draw}
+            \endpgfscope
+            \pgfscope % arrow
+            #3
+            \endpgfscope
+            % terminals
+            \pgfscope
+            \pgftransformshift{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+            \pgfnode{ocirc}{center}{}{spdt1}{\pgfusepath{stroke}}
+            \endpgfscope
+            \pgfscope
+            \pgftransformshift{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+            \pgfnode{ocirc}{center}{}{}{\pgfusepath{stroke}}
+            \endpgfscope
+            \pgfscope
+            \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+            \pgfnode{ocirc}{center}{}{spdt2}{\pgfusepath{stroke}}
+            \endpgfscope
+
+        }
+    }
+}
+
+\pgfcircdeclarecutespdt{cute spdt up}
+{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up-1.5\pgf at circ@res at temp}}
+{}
+
+\pgfcircdeclarecutespdt{cute spdt mid}
+{\pgfpoint{\pgf at circ@res at right}{0pt}}
+{}
+
+\pgfcircdeclarecutespdt{cute spdt down}
+{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down+1.5\pgf at circ@res at temp}}
+{}
+
+\pgfcircdeclarecutespdt{cute spdt up arrow}
+{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up-1.5\pgf at circ@res at temp}}
+{
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth}
+    \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}} % in node
+    \pgfpathmoveto{\pgfpointpolar{70}{1.5\pgf at circ@res at right}}
+    \pgfpatharc{70}{-50}{1.5\pgf at circ@res at right}
+    \pgfsetarrowsend{latexslim}
+    \pgfusepath{draw}
+}
+
+\pgfcircdeclarecutespdt{cute spdt mid arrow}
+{\pgfpoint{\pgf at circ@res at right}{0pt}}
+{
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth}
+    \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}} % in node
+    \pgfsetarrowsstart{latexslim}
+    \pgfpathmoveto{\pgfpointpolar{-60}{1.5\pgf at circ@res at right}}
+    \pgfpatharc{-60}{60}{1.5\pgf at circ@res at right}
+    \pgfsetarrowsend{latexslim}
+    \pgfusepath{draw}
+}
+
+\pgfcircdeclarecutespdt{cute spdt down arrow}
+{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down+1.5\pgf at circ@res at temp}}
+{
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth}
+    \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}} % in node
+    \pgfpathmoveto{\pgfpointpolar{-50}{1.5\pgf at circ@res at right}}
+    \pgfpatharc{-50}{70}{1.5\pgf at circ@res at right}
+    \pgfsetarrowsend{latexslim}
+    \pgfusepath{draw}
+}
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %%
 %%       Logic ports
 %%
+%% Code from John Kormylo at tex.stackexchange.com
+%% See https://tex.stackexchange.com/questions/372993/is-it-possible-to-implement-multiple-input-logic-ports-with-circuitikz
+%% Integration and fixes from Romano Giannetti and TheTeXnician <38565529+TheTeXnician at users.noreply.github.com>
+%%
 
+\newcount\pgf at circ@res at count% reserve global register
 
+\def\pgf at circ@logicport at input#1% #1 = \pgfmathcounter
+{%
+    \pgfextracty{\pgf at circ@res at up}{\northeast}%
+    \step
+    \pgf at circ@res at step=\dimexpr 2\pgf at y -2\pgf at circ@res at up\relax
+    \advance\pgf at y by -#1\pgf at circ@res at step\relax
+}%
 
+% #1 = \pgfmathcounter #2=type #3 specificic port
+% type is 1 for and,nand; 2 for or,nor; 3 for xor,xnor, 4 for european.
+\def\pgf at circ@logicport at baseinput#1#2#3%
+{%
+    % and and nand
+    \ifnum #2=1\relax
+        \pgfextracty{\pgf at circ@res at up}{\northeast}%
+        \pgfextractx{\pgf at circ@res at left}{\southwest}%
+        \step
+        \pgf at circ@res at step=\dimexpr 2\pgf at y -2\pgf at circ@res at up\relax
+        \advance\pgf at y by -#1\pgf at circ@res at step\relax
+        \pgf at x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #3 port/port width}\pgf at circ@res at left
+    \fi
+    % or and nor
+    \ifnum #2=2\relax
+        \pgfextracty{\pgf at circ@res at up}{\northeast}%
+        \pgfextractx{\pgf at circ@res at left}{\southwest}%
+        \pgfextractx{\pgf at circ@res at right}{\northeast}%
+        \step
+        \pgf at circ@res at step=\dimexpr 2\pgf at y -2\pgf at circ@res at up\relax
+        \advance\pgf at y by -#1\pgf at circ@res at step\relax
+        \edef\pgf at circ@math at angle{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #3 port/angle}}%
+        \pgf at circ@res at other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #3 port/inner}\pgf at circ@res at right
+        \pgfmathsetlengthmacro{\pgf at circ@math at xradius}{\pgf at circ@res at other /(1 - cos(\pgf at circ@math at angle)}%
+        \pgfmathsetlengthmacro{\pgf at circ@math at yradius}{\pgf at circ@res at up /sin(\pgf at circ@math at angle)}%
+        \pgf at circ@res at other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #3 port/port width}\pgf at circ@res at right
+        \pgfmathsetlengthmacro{\pgf at circ@math at xorigin}{\pgf at circ@res at other + \pgf at circ@math at xradius*cos(\pgf at circ@math at angle)}%
+        \pgf at circ@res at temp=\pgf at y
+        \pgfmathsetmacro{\pgf at circ@math at angle}{asin(\pgf at circ@res at temp/\pgf at circ@math at yradius)}%
+        \pgfmathsetlength{\pgf at circ@res at other}{\pgf at circ@math at xradius*cos(\pgf at circ@math at angle)-\pgf at circ@math at xorigin}%
+        \pgf at x=\pgf at circ@res at other
+    \fi
+    % xor and xnor
+    \ifnum #2=3\relax
+        \pgfextracty{\pgf at circ@res at up}{\northeast}%
+        \pgfextractx{\pgf at circ@res at left}{\southwest}%
+        \pgfextractx{\pgf at circ@res at right}{\northeast}%
+        \pgfkeysgetvalue{/tikz/circuitikz/tripoles/american #3 port/angle}{\pgf at circ@math at angle}%
+        \pgf at circ@res at other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #3 port/inner}\pgf at circ@res at right
+        \pgfmathsetlengthmacro{\pgf at circ@math at xradius}{\pgf at circ@res at other /(1 - cos(\pgf at circ@math at angle)}%
+        \pgfmathsetlengthmacro{\pgf at circ@math at yradius}{\pgf at circ@res at up / sin(\pgf at circ@math at angle))}%
+        \pgf at circ@res at other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #3 port/port width}\pgf at circ@res at right
+        \pgfmathsetlengthmacro{\pgf at circ@math at xorigin}{\pgf at circ@res at other + \pgf at circ@math at xradius*cos(\pgf at circ@math at angle)}%
+        \pgf at circ@res at temp=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #3 port/distance}\pgf at circ@res at right
+        \pgfmathsetlengthmacro{\pgf at circ@math at distance}{\pgf at circ@res at temp}
+        % this compensates for the effect of the line width on the gap between the arcs
+        \pgfmathsetlengthmacro{\pgf at circ@math at yradiusA}{\pgf at circ@math at yradius -2\pgflinewidth}%
+        \pgfmathsetlengthmacro{\pgf at circ@math at xradiusA}{\pgf at circ@math at xradius -2\pgflinewidth}%
 
+        \step
+        \pgf at circ@res at step=\dimexpr 2\pgf at y -2\pgf at circ@res at up\relax
+        \advance\pgf at y by -#1\pgf at circ@res at step\relax
+         \pgf at circ@res at temp=\pgf at y
+            \pgfmathsetmacro{\pgf at circ@math at angle}{asin(\pgf at circ@res at temp  / \pgf at circ@math at yradiusA)}%
+        \pgfmathsetlength{\pgf at circ@res at other}{\pgf at circ@math at xradiusA*cos(\pgf at circ@math at angle)-\pgf at circ@math at xorigin}%
+        \advance\pgf at circ@res at other by -\pgf at circ@math at distance
+        \pgf at x=\pgf at circ@res at other
+    \fi
+    % european
+    \ifnum #2=4\relax
+        \pgfextracty{\pgf at circ@res at up}{\northeast}%
+        \pgfextractx{\pgf at circ@res at other}{\left}%
+        \step
+        \pgf at circ@res at step=\dimexpr 2\pgf at y -2\pgf at circ@res at up\relax
+        \advance\pgf at y by -#1\pgf at circ@res at step\relax
+        \pgf at x=\pgf at circ@res at other
+    \fi
+}%
 
+%%% american
+\long\def\pgfcircdeclarelogicport#1#2#3{%
+    \pgfdeclareshape{american #1 port}%
+    {%
+        \savedmacro\resize{% automatic
+            \pgf at circ@res at up = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/height}\pgf at circ@Rlen
+            \pgf at circ@res at up = .5\pgf at circ@res at up
+            \pgf at circ@res at down = -\pgf at circ@res at up
+            \pgf at circ@res at right = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/width}\pgf at circ@Rlen
+            \pgf at circ@res at right = .5\pgf at circ@res at right
+            \pgf at circ@res at left = -\pgf at circ@res at right
+        }%
+        \savedmacro\inputs{% get number of inputs
+            \pgf at circ@res at count=\pgfkeysvalueof{/tikz/number inputs}\relax%
+            \ifnum\pgf at circ@res at count=0
+                \pgf at circ@res at count=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/inputs}\relax%
+            \fi
+        \ifnum\pgf at circ@res at count<2 \pgf at circ@res at count=2\fi
+    \ifnum\pgf at circ@res at count>16 \pgf at circ@res at count=16\fi
+        \def\inputs{\the\pgf at circ@res at count}%
+    }%
+    \savedanchor\step{% 1/2 gap at edges
+        \pgf at circ@res at step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/height}\pgf at circ@Rlen
+        \divide\pgf at circ@res at step by \pgf at circ@res at count
+        \pgfpoint{\pgf at circ@res at left}{\dimexpr\pgf at circ@res at up+0.5\pgf at circ@res at step}%
+    }%
+    \savedanchor\northeast{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \savedanchor\southwest{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+    \savedanchor\left{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/port width}\pgf at circ@res at left}{0pt}}
+    \savedanchor\right{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/port width}\pgf at circ@res at right}{0pt}}
+    \savedanchor\origin{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/origin}\pgf at circ@res at right}{0pt}}
 
-\long\def\pgfcircdeclarelogicport#1#2{
-	\pgfdeclareshape{american #1 port}
-	{
-	  \savedanchor\northwest{%
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/height}\pgf at circ@Rlen
-		\pgf at y=.5\pgf at y
-		\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/width}\pgf at circ@Rlen
-		\pgf at x=.5\pgf at x
-	  }
-	  \savedanchor\left{%
-	  	\pgf at y=0pt
-	  }
-	  \savedanchor\inOne{%
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/height}\pgf at circ@Rlen
-		\pgf at y=.5\pgf at y
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/input height}\pgf at y
-		\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/width}\pgf at circ@Rlen
-		\pgf at x=.5\pgf at x
-	  }	  
-	  \anchor{in 1}{
-		\inOne
-	  }
-	  \anchor{in}{
-		\inOne
-	  }	  
-	  \anchor{in 2}{
-		\inOne
-		\pgf at y=-\pgf at y
-	  }
-	  \anchor{out}{
-		\northwest
-		\pgf at y=0pt
-		\pgf at x=-\pgf at x
-	  }
-  	  \anchor{center}{
-		\northwest
-		\pgf at y=0pt
-		\pgf at x=-.8\pgf at x  
-	  }
-	  \anchor{east}{
-	  	\left
-	  	\pgf at x=-.8\pgf at x  
-	  }
-	  \anchor{west}{
-	  	\left
-	  }
-	  \anchor{south}{
-		\northwest
-		\pgf at x=0pt
-		\pgf at y=-\pgf at y
-	  }
-	  \anchor{north}{
-		\northwest
-		\pgf at x=0pt
-	  }
-	  \anchor{south west}{
-		\northwest
-		\pgf at y=-\pgf at y
-	  }
-	  \anchor{north east}{
-		\northwest
-		\pgf at x=-\pgf at x
-	  }
-	  \anchor{north west}{
-		\northwest
-	  }
-	  \anchor{south east}{
-		\northwest
-		\pgf at x=-\pgf at x
-		\pgf at y=-\pgf at y
-	  }	  
-	  \backgroundpath{			
-			\pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}	
-			
-			
-			\northwest
-			\pgf at circ@res at up = \pgf at y 
-			\pgf at circ@res at down = -\pgf at y
-			\pgf at circ@res at right = -\pgf at x
-			\pgf at circ@res at left = \pgf at x
-			
-			#2
-	  
-	  }
-	}
+    \anchor{center}{\origin}% for backwards compatibility
+    \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
+
+    % create input anchors
+    \expandafter\pgfutil at g@addto at macro\csname pgf at sh@s at american #1 port\endcsname{%
+        \pgfmathloop%
+        \ifnum\pgfmathcounter>\pgf at circ@res at count%
+    \else%
+        %\pgfutil at ifundefined{pgf at anchor@american #1 port at in \pgfmathcounter}{%
+        \expandafter\xdef\csname pgf at anchor@american #1 port at in \pgfmathcounter\endcsname{%
+            \noexpand\pgf at circ@logicport at input{\pgfmathcounter}% defined above
+        }%
+        \expandafter\xdef\csname pgf at anchor@american #1 port at bin \pgfmathcounter\endcsname{%
+            \noexpand\pgf at circ@logicport at baseinput{\pgfmathcounter}{#2}{#1}% defined above
+        }%
+        %}{}%
+        \repeatpgfmathloop%
+    }
+
+    \anchor{out}{\northeast\pgf at y=0pt}
+    \anchor{bout}{\right\pgf at y=0pt}
+
+
+    \anchor{left}{\left}% edges of component mius leads
+    \anchor{right}{\right}
+
+    \anchor{north east}{\northeast}% see \Compass macro
+    \anchor{south west}{\southwest}
+    \anchor{north}{\pgfextracty{\pgf at circ@res at up}{\northeast}%
+    \pgfpoint{0cm}{\pgf at circ@res at up}}
+    \anchor{north west}{\pgfextracty{\pgf at circ@res at up}{\northeast}%
+        \pgfextractx{\pgf at circ@res at left}{\southwest}%
+    \pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+    \anchor{west}{\pgfextractx{\pgf at circ@res at left}{\southwest}%
+    \pgfpoint{\pgf at circ@res at left}{0cm}}
+    \anchor{south}{\pgfextracty{\pgf at circ@res at down}{\southwest}%
+    \pgfpoint{0cm}{\pgf at circ@res at down}}
+    \anchor{south east}{\pgfextracty{\pgf at circ@res at down}{\southwest}%
+        \pgfextractx{\pgf at circ@res at right}{\northeast}%
+    \pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \anchor{east}{\pgfextractx{\pgf at circ@res at right}{\northeast}%
+    \pgfpoint{\pgf at circ@res at right}{0cm}}
+
+    \backgroundpath{
+        \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+        #3
+    }
 }
+}
+%%% american and %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\pgfcircdeclarelogicport{and}{1}{
+    \pgfextracty{\pgf at circ@res at temp}{\step}%
+    \pgf at circ@res at step = \dimexpr 2\pgf at circ@res at temp -2\pgf at circ@res at up\relax
+    \pgf at circ@res at count = \inputs\relax
+    \loop\ifnum\pgf at circ@res at count>0
+        \advance\pgf at circ@res at temp by -\pgf at circ@res at step
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at temp}}%
+        \pgfpathlineto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf at circ@res at left}
+        {\pgf at circ@res at temp}}
+        \advance\pgf at circ@res at count by -1
+        \repeat
 
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+    \pgfpathlineto{\pgfpoint
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf at circ@res at right}
+    {0pt}}
 
-\pgfcircdeclarelogicport{and}{
-	\pgfpathmoveto{\pgfpoint
-		{\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/input height}\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/input height}\pgf at circ@res at up}}
-	
-	\pgfpathmoveto{\pgfpoint
-		{\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/input height}\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/input height}\pgf at circ@res at down}}
-	
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
-	\pgfpathlineto{\pgfpoint
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf at circ@res at right}
-		{0pt}}
-	
-	\pgfusepath{draw}
-	
-	\pgfsetlinewidth{2\pgflinewidth}
-	\pgfpathmoveto{\pgfpoint
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf at circ@res at left}
-		{\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf at circ@res at left}
-		{\pgf at circ@res at down}}
-	\pgfpathcurveto
-		{\pgfpoint{.0\pgf at circ@res at left}{\pgf at circ@res at down}}
-		{\pgfpoint
-			{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf at circ@res at right}
-			{.5\pgf at circ@res at down}}
-		{\pgfpoint
-			{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf at circ@res at right}
-			{0pt}}
-	\pgfpathcurveto
-		{\pgfpoint
-			{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf at circ@res at right}
-			{.5\pgf at circ@res at up}}
-		{\pgfpoint{.0\pgf at circ@res at left}{\pgf at circ@res at up}}
-		{\pgfpoint
-			{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf at circ@res at left}
-			{\pgf at circ@res at up}}	
-	\pgfusepath{draw}
+    \pgfusepath{draw}
+
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
+    \pgf at circ@res at other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf at circ@res at left
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at down}}
+    \pgfpatharc{-90}{90}{-2\pgf at circ@res at other and \pgf at circ@res at up}
+    \pgfpathclose
+    \pgf at circ@draworfill
+    }
+%%% american nand %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+    \pgfcircdeclarelogicport{nand}{1}{
+    \pgfextracty{\pgf at circ@res at temp}{\step}%
+    \pgf at circ@res at step = \dimexpr 2\pgf at circ@res at temp -2\pgf at circ@res at up\relax
+    \pgf at circ@res at count = \inputs\relax
+    \loop\ifnum\pgf at circ@res at count>0
+        \advance\pgf at circ@res at temp by -\pgf at circ@res at step
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at temp}}%
+        \pgfpathlineto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf at circ@res at left}
+        {\pgf at circ@res at temp}}
+        \advance\pgf at circ@res at count by -1
+    \repeat
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+    \pgfpathlineto{\pgfpoint
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf at circ@res at right} {0pt}}
+
+    \pgfusepath{draw}
+
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
+    \pgf at circ@res at step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/circle width}\pgf at circ@res at right
+    \pgf at circ@res at other = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf at circ@res at right
+    \pgf at circ@res at temp = \dimexpr 2\pgf at circ@res at other - \pgf at circ@res at step\relax
+
+    \pgfpathmoveto{\pgfpoint{-\pgf at circ@res at other}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{-\pgf at circ@res at other}{\pgf at circ@res at down}}
+    \pgfpatharc{-90}{90}{\pgf at circ@res at temp and \pgf at circ@res at up}
+    \pgfpathclose
+
+    \pgfpathellipse
+    {\pgfpoint{\pgf at circ@res at other-.5\pgf at circ@res at step}{0pt}}
+    {\pgfpoint{.5\pgf at circ@res at step}{0pt}}
+    {\pgfpoint{0pt}{.5\pgf at circ@res at step}}
+
+    \pgf at circ@draworfill
 }
+%%% american nor %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\pgfcircdeclarelogicport{nor}{2}{
+    \edef\pgf at circ@math at angle{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/angle}}%
+    \pgf at circ@res at other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/inner}\pgf at circ@res at right
+    \pgfmathsetlengthmacro{\pgf at circ@math at xradius}{\pgf at circ@res at other /(1 - cos(\pgf at circ@math at angle)}%
+    \pgfmathsetlengthmacro{\pgf at circ@math at yradius}{\pgf at circ@res at up /sin(\pgf at circ@math at angle)}%
+    \pgf at circ@res at other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/port width}\pgf at circ@res at right
+    \pgfmathsetlengthmacro{\pgf at circ@math at xorigin}{\pgf at circ@res at other + \pgf at circ@math at xradius*cos(\pgf at circ@math at angle)}%
 
+    \pgfextracty{\pgf at circ@res at temp}{\step}%
+    \pgf at circ@res at step = \dimexpr 2\pgf at circ@res at temp -2\pgf at circ@res at up\relax
+    \pgf at circ@res at count = \inputs\relax
+    \loop\ifnum\pgf at circ@res at count>0
+        \advance\pgf at circ@res at temp by -\pgf at circ@res at step
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at temp}}%
+        \pgfmathsetmacro{\pgf at circ@math at angle}{asin(\pgf at circ@res at temp/\pgf at circ@math at yradius)}%
+        \pgfmathsetlength{\pgf at circ@res at other}{\pgf at circ@math at xradius*cos(\pgf at circ@math at angle)-\pgf at circ@math at xorigin}%
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at temp}}%
+        \advance\pgf at circ@res at count by -1
+    \repeat
 
+    \pgf at circ@res at other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/port width}\pgf at circ@res at right
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{0pt}}
 
-\pgfcircdeclarelogicport{nand}{
-	\pgfpathmoveto{\pgfpoint
-		{\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/input height}\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/input height}\pgf at circ@res at up}}
-	
-	\pgfpathmoveto{\pgfpoint
-		{\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/input height}\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/input height}\pgf at circ@res at down}}
-	
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
-	\pgfpathlineto{\pgfpoint
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf at circ@res at right}
-		{0pt}}
-	
-	\pgfusepath{draw}
-	
-	\pgfsetlinewidth{2\pgflinewidth}
+    \pgfusepath{draw}
 
-	\pgf at circ@res at step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/circle width}\pgf at circ@res at right
-	\pgf at circ@res at other = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf at circ@res at right
-	
-	\pgfpathmoveto{\pgfpoint{-\pgf at circ@res at other}{\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint{-\pgf at circ@res at other}{\pgf at circ@res at down}}
-	\pgfpathcurveto
-		{\pgfpoint{.0\pgf at circ@res at left}{\pgf at circ@res at down}}
-		{\pgfpoint{\pgf at circ@res at other-\pgf at circ@res at step}{.5\pgf at circ@res at down}}
-		{\pgfpoint{\pgf at circ@res at other-\pgf at circ@res at step}{0pt}}
-	\pgfpathcurveto
-		{\pgfpoint{\pgf at circ@res at other-\pgf at circ@res at step}{.5\pgf at circ@res at up}}
-		{\pgfpoint{.0\pgf at circ@res at left}{\pgf at circ@res at up}}
-		{\pgfpoint
-			{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf at circ@res at left}
-			{\pgf at circ@res at up}}	
-	\pgfpathellipse
-		{\pgfpoint{\pgf at circ@res at other-.5\pgf at circ@res at step}{0pt}}
-		{\pgfpoint{.5\pgf at circ@res at step}{0pt}}
-		{\pgfpoint{0pt}{.5\pgf at circ@res at step}}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
 
-	\pgfusepath{draw}
+    \edef\pgf at circ@math at angle{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/angle}}%
+    \pgf at circ@res at step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/circle width}\pgf at circ@res at right
+    \pgf at circ@res at temp = \dimexpr 2\pgf at circ@res at other - \pgf at circ@res at step\relax
+    \advance\pgf at circ@res at other by -\pgf at circ@res at step
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{0pt}}% for symmetry
+    \pgfpatharc{0}{90}{\pgf at circ@res at temp and \pgf at circ@res at up}%
+    \pgfpatharc{\pgf at circ@math at angle}{-\pgf at circ@math at angle}{\pgf at circ@math at xradius and \pgf at circ@math at yradius}%
+    \pgfpatharc{-90}{0}{\pgf at circ@res at temp and \pgf at circ@res at up}%
+    \pgfpathclose
+
+    \pgfpathellipse
+    {\pgfpoint{\pgf at circ@res at other+.5\pgf at circ@res at step}{0pt}}
+    {\pgfpoint{.5\pgf at circ@res at step}{0pt}}
+    {\pgfpoint{0pt}{.5\pgf at circ@res at step}}
+
+    \pgf at circ@draworfill
 }
+%%% american or %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\pgfcircdeclarelogicport{or}{2}{
+    \edef\pgf at circ@math at angle{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/angle}}%
+    \pgf at circ@res at other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/inner}\pgf at circ@res at right
+    \pgfmathsetlengthmacro{\pgf at circ@math at xradius}{\pgf at circ@res at other /(1 - cos(\pgf at circ@math at angle)}%
+    \pgfmathsetlengthmacro{\pgf at circ@math at yradius}{\pgf at circ@res at up /sin(\pgf at circ@math at angle)}%
+    \pgf at circ@res at other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/port width}\pgf at circ@res at right
+    \pgfmathsetlengthmacro{\pgf at circ@math at xorigin}{\pgf at circ@res at other + \pgf at circ@math at xradius*cos(\pgf at circ@math at angle)}%
 
+    \pgfextracty{\pgf at circ@res at temp}{\step}%
+    \pgf at circ@res at step = \dimexpr 2\pgf at circ@res at temp -2\pgf at circ@res at up\relax
+    \pgf at circ@res at count = \inputs\relax
+    \loop\ifnum\pgf at circ@res at count>0
+        \advance\pgf at circ@res at temp by -\pgf at circ@res at step
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at temp}}%
+        \pgfmathsetmacro{\pgf at circ@math at angle}{asin(\pgf at circ@res at temp/\pgf at circ@math at yradius)}%
+        \pgfmathsetlength{\pgf at circ@res at other}{\pgf at circ@math at xradius*cos(\pgf at circ@math at angle)-\pgf at circ@math at xorigin}%
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at temp}}%
+        \advance\pgf at circ@res at count by -1
+    \repeat
 
-\pgfcircdeclarelogicport{nor}{
-	\pgfpathmoveto{\pgfpoint
-		{\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input height}\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint
-		{(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input skip})*\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input height}\pgf at circ@res at up}}
-	
-	\pgfpathmoveto{\pgfpoint
-		{\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input height}\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint
-		{(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input skip})*\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input height}\pgf at circ@res at down}}
-	
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
-	\pgfpathlineto{\pgfpoint
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/port width}\pgf at circ@res at right}
-		{0pt}}	
-	
-	\pgfusepath{draw}
-	
-	\pgf at circ@res at other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/port width}\pgf at circ@res at right
-	\pgf at circ@res at step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/circle width}\pgf at circ@res at right
-		
-	\pgfsetlinewidth{2\pgflinewidth}
-	\pgfpathmoveto{\pgfpoint{-\pgf at circ@res at other}{\pgf at circ@res at up}}
-	\pgfpathcurveto
-		{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/aaa}\pgf at circ@res at left}{\pgf at circ@res at up}}
-		{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/bbb}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ccc}\pgf at circ@res at up}}
-		{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/bbb}\pgf at circ@res at left}{0pt}}
-	\pgfpathcurveto
-		{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/bbb}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ccc}\pgf at circ@res at down}}
-		{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/aaa}\pgf at circ@res at left}{\pgf at circ@res at down}}
-		{\pgfpoint{-\pgf at circ@res at other}{\pgf at circ@res at down}}	
+    \pgf at circ@res at other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/port width}\pgf at circ@res at right
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{0pt}}
 
-	\pgfpathcurveto
-		{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ddd}\pgf at circ@res at left}{\pgf at circ@res at down}}
-		{\pgfpoint{\pgf at circ@res at other-\pgf at circ@res at step}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ccc}\pgf at circ@res at down}}
-		{\pgfpoint{\pgf at circ@res at other-\pgf at circ@res at step}{0pt}}
-	\pgfpathcurveto
-		{\pgfpoint{\pgf at circ@res at other-\pgf at circ@res at step}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ccc}\pgf at circ@res at up}}
-		{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ddd}\pgf at circ@res at left}{\pgf at circ@res at up}}
-		{\pgfpoint{-\pgf at circ@res at other}{\pgf at circ@res at up}}	
-		
-	\pgfpathellipse
-		{\pgfpoint{\pgf at circ@res at other-.5\pgf at circ@res at step}{0pt}}
-		{\pgfpoint{.5\pgf at circ@res at step}{0pt}}
-		{\pgfpoint{0pt}{.5\pgf at circ@res at step}}
-		
-	\pgfusepath{draw}
+    \pgfusepath{draw}
+
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
+
+    \edef\pgf at circ@math at angle{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/angle}}%
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{0pt}}% for symmetry
+    \pgfpatharc{0}{90}{2\pgf at circ@res at other and \pgf at circ@res at up}%
+    \pgfpatharc{\pgf at circ@math at angle}{-\pgf at circ@math at angle}{\pgf at circ@math at xradius and \pgf at circ@math at yradius}%
+    \pgfpatharc{-90}{0}{2\pgf at circ@res at other and \pgf at circ@res at up}%
+    \pgfpathclose
+
+    \pgf at circ@draworfill
 }
+%%% american xor %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\pgfcircdeclarelogicport{xor}{3}{
+    \pgfkeysgetvalue{/tikz/circuitikz/tripoles/american xor port/angle}{\pgf at circ@math at angle}%
+    \pgf at circ@res at other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/inner}\pgf at circ@res at right
+    \pgfmathsetlengthmacro{\pgf at circ@math at xradius}{\pgf at circ@res at other /(1 - cos(\pgf at circ@math at angle)}%
+    \pgfmathsetlengthmacro{\pgf at circ@math at yradius}{\pgf at circ@res at up / sin(\pgf at circ@math at angle))}%
+    \pgf at circ@res at other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/port width}\pgf at circ@res at right
+    \pgfmathsetlengthmacro{\pgf at circ@math at xorigin}{\pgf at circ@res at other + \pgf at circ@math at xradius*cos(\pgf at circ@math at angle)}%
+    \pgf at circ@res at temp=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/distance}\pgf at circ@res at right
+    \pgfmathsetlengthmacro{\pgf at circ@math at distance}{\pgf at circ@res at temp}
+    % this compensates for the effect of the line width on the gap between the arcs
+    \pgfmathsetlengthmacro{\pgf at circ@math at yradiusA}{\pgf at circ@math at yradius -2\pgflinewidth}%
+    \pgfmathsetlengthmacro{\pgf at circ@math at xradiusA}{\pgf at circ@math at xradius -2\pgflinewidth}%
 
+    \pgfextracty{\pgf at circ@res at temp}{\step}%
+    \pgf at circ@res at step = \dimexpr 2\pgf at circ@res at temp -2\pgf at circ@res at up\relax
+    \pgf at circ@res at count = \inputs\relax
+    \loop\ifnum\pgf at circ@res at count>0
+        \advance\pgf at circ@res at temp by -\pgf at circ@res at step
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at temp}}%
+        \pgfmathsetmacro{\pgf at circ@math at angle}{asin(\pgf at circ@res at temp  / \pgf at circ@math at yradiusA)}%
+        \pgfmathsetlength{\pgf at circ@res at other}{\pgf at circ@math at xradiusA*cos(\pgf at circ@math at angle)-\pgf at circ@math at xorigin}%
+        \advance\pgf at circ@res at other by -\pgf at circ@math at distance
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at temp}}%
+        \advance\pgf at circ@res at count by -1
+    \repeat
 
+    \pgf at circ@res at other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/port width}\pgf at circ@res at right
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{0pt}}
 
+    \pgfusepath{draw}
 
-\pgfcircdeclarelogicport{or}{
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
 
-	
-	\pgfpathmoveto{\pgfpoint
-		{\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input height}\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint
-		{(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input skip})*\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input height}\pgf at circ@res at up}}
-	
-	\pgfpathmoveto{\pgfpoint
-		{\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input height}\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint
-		{(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input skip})*\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input height}\pgf at circ@res at down}}
-	
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
-	\pgfpathlineto{\pgfpoint
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/port width}\pgf at circ@res at right}
-		{0pt}}	
-	
-	\pgfusepath{draw}
-	\pgf at circ@res at other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/port width}\pgf at circ@res at right
-	\pgfsetlinewidth{2\pgflinewidth}
-	\pgfpathmoveto{\pgfpoint{-\pgf at circ@res at other}{\pgf at circ@res at up}}
-	\pgfpathcurveto
-		{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/aaa}\pgf at circ@res at left}{\pgf at circ@res at up}}
-		{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/bbb}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ccc}\pgf at circ@res at up}}
-		{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/bbb}\pgf at circ@res at left}{0pt}}
-	\pgfpathcurveto
-		{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/bbb}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ccc}\pgf at circ@res at down}}
-		{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/aaa}\pgf at circ@res at left}{\pgf at circ@res at down}}
-		{\pgfpoint{-\pgf at circ@res at other}{\pgf at circ@res at down}}	
+    \edef\pgf at circ@math at angle{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/angle}}%
 
-	\pgfpathcurveto
-		{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ddd}\pgf at circ@res at left}{\pgf at circ@res at down}}
-		{\pgfpoint{\pgf at circ@res at other}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ccc}\pgf at circ@res at down}}
-		{\pgfpoint{\pgf at circ@res at other}{0pt}}
-	\pgfpathcurveto
-		{\pgfpoint{\pgf at circ@res at other}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ccc}\pgf at circ@res at up}}
-		{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ddd}\pgf at circ@res at left}{\pgf at circ@res at up}}
-		{\pgfpoint{-\pgf at circ@res at other}{\pgf at circ@res at up}}	
-	\pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{0pt}}% for symmetry
+    \pgfpatharc{0}{90}{2\pgf at circ@res at other and \pgf at circ@res at up}%
+    \pgfpatharc{\pgf at circ@math at angle}{-\pgf at circ@math at angle}{\pgf at circ@math at xradius and \pgf at circ@math at yradius}%
+    \pgfpatharc{-90}{0}{2\pgf at circ@res at other and \pgf at circ@res at up}%
+    \pgfpathclose
+    \pgf at circ@draworfill
+
+    \pgfmathsetlength{\pgf at circ@res at temp}{(\pgf at circ@math at yradiusA)*sin(\pgf at circ@math at angle)}%
+
+    \pgfpathmoveto{\pgfpoint{-\pgf at circ@res at other-\pgf at circ@math at distance}{\pgf at circ@res at temp}}% first arc
+    \pgfpatharc{\pgf at circ@math at angle}{-\pgf at circ@math at angle}{\pgf at circ@math at xradiusA and \pgf at circ@math at yradiusA}%
+
+    \pgfusepath{draw}
 }
+%%% american xnor %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\pgfcircdeclarelogicport{xnor}{3}{
+    \pgfkeysgetvalue{/tikz/circuitikz/tripoles/american xnor port/angle}{\pgf at circ@math at angle}%
+    \pgf at circ@res at other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/inner}\pgf at circ@res at right
+    \pgfmathsetlengthmacro{\pgf at circ@math at xradius}{\pgf at circ@res at other /(1 - cos(\pgf at circ@math at angle)}%
+    \pgfmathsetlengthmacro{\pgf at circ@math at yradius}{\pgf at circ@res at up / sin(\pgf at circ@math at angle))}%
+    \pgf at circ@res at other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}\pgf at circ@res at right
+    \pgfmathsetlengthmacro{\pgf at circ@math at xorigin}{\pgf at circ@res at other + \pgf at circ@math at xradius*cos(\pgf at circ@math at angle)}%
+    \pgf at circ@res at temp=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/distance}\pgf at circ@res at right
+    \pgfmathsetlengthmacro{\pgf at circ@math at distance}{\pgf at circ@res at temp}
+    % this compensates for the effect of the line width on the gap between the arcs
+    \pgfmathsetlengthmacro{\pgf at circ@math at yradiusA}{\pgf at circ@math at yradius -2\pgflinewidth}%
+    \pgfmathsetlengthmacro{\pgf at circ@math at xradiusA}{\pgf at circ@math at xradius -2\pgflinewidth}%
 
+    \pgfextracty{\pgf at circ@res at temp}{\step}%
+    \pgf at circ@res at step = \dimexpr 2\pgf at circ@res at temp -2\pgf at circ@res at up\relax
+    \pgf at circ@res at count = \inputs\relax
+    \loop\ifnum\pgf at circ@res at count>0
+        \advance\pgf at circ@res at temp by -\pgf at circ@res at step
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at temp}}%
+        \pgfmathsetmacro{\pgf at circ@math at angle}{asin(\pgf at circ@res at temp  / \pgf at circ@math at yradiusA)}%
+        \pgfmathsetlength{\pgf at circ@res at other}{\pgf at circ@math at xradiusA*cos(\pgf at circ@math at angle)-\pgf at circ@math at xorigin}%
+        \advance\pgf at circ@res at other by -\pgf at circ@math at distance
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at temp}}%
+        \advance\pgf at circ@res at count by -1
+    \repeat
 
-\pgfcircdeclarelogicport{xor}{
+    \pgf at circ@res at other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}\pgf at circ@res at right
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{0pt}}
 
-	\pgfpathmoveto{\pgfpoint
-		{\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input height}\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint
-		{(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input skip})*\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input height}\pgf at circ@res at up}}
-	
-	\pgfpathmoveto{\pgfpoint
-		{\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input height}\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint
-		{(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input skip})*\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input height}\pgf at circ@res at down}}
-	
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
-	\pgfpathlineto{\pgfpoint
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/port width}\pgf at circ@res at right}
-		{0pt}}	
-	
-	\pgfusepath{draw}
-	\pgf at circ@res at other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/port width}\pgf at circ@res at right
-	\pgfsetlinewidth{2\pgflinewidth}
-	\pgfpathmoveto{\pgfpoint{-\pgf at circ@res at other}{\pgf at circ@res at up}}
-	\pgfpathcurveto
-		{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/aaa}\pgf at circ@res at left}{\pgf at circ@res at up}}
-		{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf at circ@res at up}}
-		{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf at circ@res at left}{0pt}}
-	\pgfpathcurveto
-		{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf at circ@res at down}}
-		{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/aaa}\pgf at circ@res at left}{\pgf at circ@res at down}}
-		{\pgfpoint{-\pgf at circ@res at other}{\pgf at circ@res at down}}	
+    \pgfusepath{draw}
 
-	\pgfpathcurveto
-		{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ddd}\pgf at circ@res at left}{\pgf at circ@res at down}}
-		{\pgfpoint{\pgf at circ@res at other}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf at circ@res at down}}
-		{\pgfpoint{\pgf at circ@res at other}{0pt}}
-	\pgfpathcurveto
-		{\pgfpoint{\pgf at circ@res at other}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf at circ@res at up}}
-		{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ddd}\pgf at circ@res at left}{\pgf at circ@res at up}}
-		{\pgfpoint{-\pgf at circ@res at other}{\pgf at circ@res at up}}	
-		
-	\def\pgf at circ@temp{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/distance}\pgf at circ@res at right+}
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@temp-\pgf at circ@res at other}{\pgf at circ@res at up}}
-	
-	\pgfpathcurveto
-		{\pgfpoint{\pgf at circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/aaa}\pgf at circ@res at left}{.95*\pgf at circ@res at up}}
-		{\pgfpoint{\pgf at circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf at circ@res at up}}
-		{\pgfpoint{\pgf at circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf at circ@res at left}{0pt}}
-	\pgfpathcurveto
-		{\pgfpoint{\pgf at circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf at circ@res at down}}
-		{\pgfpoint{\pgf at circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/aaa}\pgf at circ@res at left}{.95*\pgf at circ@res at down}}
-		{\pgfpoint{\pgf at circ@temp-\pgf at circ@res at other}{.95*\pgf at circ@res at down}}	
-				
-	\pgfusepath{draw}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
+
+    \edef\pgf at circ@math at angle{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/angle}}%
+    \pgf at circ@res at step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/circle width}\pgf at circ@res at right
+    \pgf at circ@res at temp = \dimexpr 2\pgf at circ@res at other - \pgf at circ@res at step\relax
+    \advance\pgf at circ@res at other by -\pgf at circ@res at step
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{0pt}}% for symmetry
+    \pgfpatharc{0}{90}{\pgf at circ@res at temp and \pgf at circ@res at up}%
+    \pgfpatharc{\pgf at circ@math at angle}{-\pgf at circ@math at angle}{\pgf at circ@math at xradius and \pgf at circ@math at yradius}%
+    \pgfpatharc{-90}{0}{\pgf at circ@res at temp and \pgf at circ@res at up}%
+    \pgfpathclose
+
+    \pgfpathellipse
+    {\pgfpoint{\pgf at circ@res at other+.5\pgf at circ@res at step}{0pt}}
+    {\pgfpoint{.5\pgf at circ@res at step}{0pt}}
+    {\pgfpoint{0pt}{.5\pgf at circ@res at step}}
+    \pgf at circ@draworfill
+
+    \pgf at circ@res at other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}\pgf at circ@res at left
+    \pgfmathsetlength{\pgf at circ@res at temp}{(\pgf at circ@math at yradiusA)*sin(\pgf at circ@math at angle)}%
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at other-\pgf at circ@math at distance}{\pgf at circ@res at temp}}% first arc
+    \pgfpatharc{\pgf at circ@math at angle}{-\pgf at circ@math at angle}{\pgf at circ@math at xradiusA and \pgf at circ@math at yradiusA}%
+
+    \pgfusepath{draw}
 }
 
+%%% Original one-input ports
 
+\pgfdeclareshape{american not port}{
+    \anchor{center}{\pgfpointorigin}
+    \savedanchor\northwest{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+    }
+    \savedanchor\left{%
+        \pgf at y=0pt
+    }
+    \anchor{in}{
+        \northwest
+        \pgf at y=0pt
+    }
+    \anchor{out}{
+        \northwest
+        \pgf at y=0pt
+        \pgf at x=-\pgf at x
+    }
+    \anchor{center}{
+        \pgfpointorigin
+    }
+    \anchor{east}{
+        \left
+        \pgf at x=-.8\pgf at x
+    }
+    \anchor{west}{
+        \left
+    }
+    \anchor{south}{
+        \northwest
+        \pgf at x=0pt
+        \pgf at y=-\pgf at y
+    }
+    \anchor{north}{
+        \northwest
+        \pgf at x=0pt
+    }
+    \anchor{south west}{
+        \northwest
+        \pgf at y=-\pgf at y
+    }
+    \anchor{north east}{
+        \northwest
+        \pgf at x=-\pgf at x
+    }
+    \anchor{north west}{
+        \northwest
+    }
+    \anchor{south east}{
+        \northwest
+        \pgf at x=-\pgf at x
+        \pgf at y=-\pgf at y
+    }
+    \backgroundpath{
+        \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
 
-\pgfcircdeclarelogicport{xnor}{
 
-	\pgfpathmoveto{\pgfpoint
-		{\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input height}\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint
-		{(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input skip})*\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input height}\pgf at circ@res at up}}
-	
-	\pgfpathmoveto{\pgfpoint
-		{\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input height}\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint
-		{(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input skip})*\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input height}\pgf at circ@res at down}}
-	
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
-	\pgfpathlineto{\pgfpoint
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}\pgf at circ@res at right}
-		{0pt}}	
-	
-	\pgfusepath{draw}
-	\pgf at circ@res at other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}\pgf at circ@res at right
-	\pgf at circ@res at step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/circle width}\pgf at circ@res at right
+        \northwest
+        \pgf at circ@res at up = \pgf at y
+        \pgf at circ@res at down = -\pgf at y
+        \pgf at circ@res at right = -\pgf at x
+        \pgf at circ@res at left = \pgf at x
 
-	\pgfsetlinewidth{2\pgflinewidth}
-	\pgfpathmoveto{\pgfpoint{-\pgf at circ@res at other}{\pgf at circ@res at up}}
-	\pgfpathcurveto
-		{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/aaa}\pgf at circ@res at left}{\pgf at circ@res at up}}
-		{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf at circ@res at up}}
-		{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf at circ@res at left}{0pt}}
-	\pgfpathcurveto
-		{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf at circ@res at down}}
-		{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/aaa}\pgf at circ@res at left}{\pgf at circ@res at down}}
-		{\pgfpoint{-\pgf at circ@res at other}{\pgf at circ@res at down}}	
+        \pgf at circ@res at other = \pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/circle width}\pgf at circ@res at right
 
-	\pgfpathcurveto
-		{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ddd}\pgf at circ@res at left}{\pgf at circ@res at down}}
-		{\pgfpoint{\pgf at circ@res at other-\pgf at circ@res at step}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf at circ@res at down}}
-		{\pgfpoint{\pgf at circ@res at other-\pgf at circ@res at step}{0pt}}
-	\pgfpathcurveto
-		{\pgfpoint{\pgf at circ@res at other-\pgf at circ@res at step}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf at circ@res at up}}
-		{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ddd}\pgf at circ@res at left}{\pgf at circ@res at up}}
-		{\pgfpoint{-\pgf at circ@res at other}{\pgf at circ@res at up}}	
-		
-	\def\pgf at circ@temp{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/distance}\pgf at circ@res at right+}
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@temp-\pgf at circ@res at other}{\pgf at circ@res at up}}
-	
-	\pgfpathcurveto
-		{\pgfpoint{\pgf at circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/aaa}\pgf at circ@res at left}{.95*\pgf at circ@res at up}}
-		{\pgfpoint{\pgf at circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf at circ@res at up}}
-		{\pgfpoint{\pgf at circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf at circ@res at left}{0pt}}
-	\pgfpathcurveto
-		{\pgfpoint{\pgf at circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf at circ@res at down}}
-		{\pgfpoint{\pgf at circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/aaa}\pgf at circ@res at left}{.95*\pgf at circ@res at down}}
-		{\pgfpoint{\pgf at circ@temp-\pgf at circ@res at other}{.95*\pgf at circ@res at down}}	
-		
-		
-	\pgfpathellipse
-		{\pgfpoint{\pgf at circ@res at other-.5\pgf at circ@res at step}{0pt}}
-		{\pgfpoint{.5\pgf at circ@res at step}{0pt}}
-		{\pgfpoint{0pt}{.5\pgf at circ@res at step}}
-				
-	\pgfusepath{draw}
+        \pgfscope
+            \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
+            \pgftransformxshift{.7\pgf at circ@res at left}
+            \pgf at circ@res at step=\pgf at circ@res at right
+            \advance\pgf at circ@res at step by -\pgf at circ@res at left
+            \pgf at circ@res at step=.7\pgf at circ@res at step
+
+            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step-\pgf at circ@res at other}{0pt}}
+            \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
+            \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
+            \pgfpathlineto{\pgfpoint{\pgf at circ@res at step-\pgf at circ@res at other}{0pt}}
+            \pgf at circ@draworfill
+            \pgfpathellipse
+            {\pgfpoint{\pgf at circ@res at step-.5\pgf at circ@res at other}{0pt}}
+            {\pgfpoint{.5\pgf at circ@res at other}{0pt}}
+            {\pgfpoint{0pt}{.5\pgf at circ@res at other}}
+            \pgf at circ@draworfill
+        \endpgfscope
+
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+        \pgfpathlineto{\pgfpoint{.7\pgf at circ@res at left}{0pt}}
+
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+        \pgfpathlineto{\pgfpoint{.7\pgf at circ@res at right}{0pt}}
+
+        \pgfusepath{draw}
+
+    }
 }
 
+\pgfdeclareshape{invschmitt}{
+    \anchor{center}{\pgfpointorigin}
+    \savedanchor\northwest{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+    }
+    \savedanchor\left{%
+        \pgf at y=0pt
+    }
+    \anchor{in}{
+        \northwest
+        \pgf at y=0pt
+    }
+    \anchor{out}{
+        \northwest
+        \pgf at y=0pt
+        \pgf at x=-\pgf at x
+    }
+    \anchor{center}{
+        \pgfpointorigin
+    }
+    \anchor{east}{
+        \left
+        \pgf at x=-.8\pgf at x
+    }
+    \anchor{west}{
+        \left
+    }
+    \anchor{south}{
+        \northwest
+        \pgf at x=0pt
+        \pgf at y=-\pgf at y
+    }
+    \anchor{north}{
+        \northwest
+        \pgf at x=0pt
+    }
+    \anchor{south west}{
+        \northwest
+        \pgf at y=-\pgf at y
+    }
+    \anchor{north east}{
+        \northwest
+        \pgf at x=-\pgf at x
+    }
+    \anchor{north west}{
+        \northwest
+    }
+    \anchor{south east}{
+        \northwest
+        \pgf at x=-\pgf at x
+        \pgf at y=-\pgf at y
+    }
+    \backgroundpath{
+        \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
 
-\pgfdeclareshape{american not port}
-	{
-	  \anchor{center}{\pgfpointorigin}
-	  \savedanchor\northwest{%
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/height}\pgf at circ@Rlen
-		\pgf at y=.5\pgf at y
-		\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/width}\pgf at circ@Rlen
-		\pgf at x=.5\pgf at x
-	  }
-	  \savedanchor\left{%
-	  	\pgf at y=0pt
-	  }
-	  \anchor{in}{
-		\northwest
-		\pgf at y=0pt
-	  }
-	  \anchor{out}{
-		\northwest
-		\pgf at y=0pt
-		\pgf at x=-\pgf at x
-	  }
-	  \anchor{center}{
-	  	\pgfpointorigin
-	  }
-	  \anchor{east}{
-	  	\left
-	  	\pgf at x=-.8\pgf at x  
-	  }
-	  \anchor{west}{
-	  	\left
-	  }
-	  \anchor{south}{
-		\northwest
-		\pgf at x=0pt
-		\pgf at y=-\pgf at y
-	  }
-	  \anchor{north}{
-		\northwest
-		\pgf at x=0pt
-	  }
-	  	  \anchor{south west}{
-		\northwest
-		\pgf at y=-\pgf at y
-	  }
-	  \anchor{north east}{
-		\northwest
-		\pgf at x=-\pgf at x
-	  }
-	  \anchor{north west}{
-		\northwest
-	  }
-	  \anchor{south east}{
-		\northwest
-		\pgf at x=-\pgf at x
-		\pgf at y=-\pgf at y
-	  }	  
-	  \backgroundpath{			
-			\pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}	
-			
-			
-			\northwest
-			\pgf at circ@res at up = \pgf at y 
-			\pgf at circ@res at down = -\pgf at y
-			\pgf at circ@res at right = -\pgf at x
-			\pgf at circ@res at left = \pgf at x
-			
-		\pgf at circ@res at other = \pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/circle width}\pgf at circ@res at right
-						
-	\pgfscope
-		\pgfsetlinewidth{2\pgflinewidth}
-		\pgftransformxshift{.7\pgf at circ@res at left}
-		\pgf at circ@res at step=\pgf at circ@res at right
-		\advance\pgf at circ@res at step by -\pgf at circ@res at left
-		\pgf at circ@res at step=.7\pgf at circ@res at step
-		
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at step-\pgf at circ@res at other}{0pt}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at step-\pgf at circ@res at other}{0pt}}
-		\pgfusepath{draw}
-		\pgfpathellipse
-			{\pgfpoint{\pgf at circ@res at step-.5\pgf at circ@res at other}{0pt}}
-			{\pgfpoint{.5\pgf at circ@res at other}{0pt}}
-			{\pgfpoint{0pt}{.5\pgf at circ@res at other}}
-		\pgfusepath{draw}
-	\endpgfscope
-		
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
-		\pgfpathlineto{\pgfpoint{.7\pgf at circ@res at left}{0pt}}
-		
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
-		\pgfpathlineto{\pgfpoint{.7\pgf at circ@res at right}{0pt}}
-	
-		\pgfusepath{draw}
-	  
-	  }
-	}
+        \northwest
+        \pgf at circ@res at up = \pgf at y
+        \pgf at circ@res at down = -\pgf at y
+        \pgf at circ@res at right = -\pgf at x
+        \pgf at circ@res at left = \pgf at x
 
-\pgfdeclareshape{invschmitt}
-	{
-	  \anchor{center}{\pgfpointorigin}
-	  \savedanchor\northwest{%
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/height}\pgf at circ@Rlen
-		\pgf at y=.5\pgf at y
-		\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/width}\pgf at circ@Rlen
-		\pgf at x=.5\pgf at x
-	  }
-	  \savedanchor\left{%
-	  	\pgf at y=0pt
-	  }
-	  \anchor{in}{
-		\northwest
-		\pgf at y=0pt
-	  }
-	  \anchor{out}{
-		\northwest
-		\pgf at y=0pt
-		\pgf at x=-\pgf at x
-	  }
-	  \anchor{center}{
-	  	\pgfpointorigin
-	  }
-	  \anchor{east}{
-	  	\left
-	  	\pgf at x=-.8\pgf at x  
-	  }
-	  \anchor{west}{
-	  	\left
-	  }
-	  \anchor{south}{
-		\northwest
-		\pgf at x=0pt
-		\pgf at y=-\pgf at y
-	  }
-	  \anchor{north}{
-		\northwest
-		\pgf at x=0pt
-	  }
-	  	  \anchor{south west}{
-		\northwest
-		\pgf at y=-\pgf at y
-	  }
-	  \anchor{north east}{
-		\northwest
-		\pgf at x=-\pgf at x
-	  }
-	  \anchor{north west}{
-		\northwest
-	  }
-	  \anchor{south east}{
-		\northwest
-		\pgf at x=-\pgf at x
-		\pgf at y=-\pgf at y
-	  }	  
-	  \backgroundpath{			
-			\pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}	
-			
-			
-			\northwest
-			\pgf at circ@res at up = \pgf at y 
-			\pgf at circ@res at down = -\pgf at y
-			\pgf at circ@res at right = -\pgf at x
-			\pgf at circ@res at left = \pgf at x
-			
-		\pgf at circ@res at other = \pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/circle width}\pgf at circ@res at right
-						
-	\pgfscope
-		\pgfsetlinewidth{2\pgflinewidth}
-		\pgftransformxshift{.7\pgf at circ@res at left}
-		\pgf at circ@res at step=\pgf at circ@res at right
-		\advance\pgf at circ@res at step by -\pgf at circ@res at left
-		\pgf at circ@res at step=.7\pgf at circ@res at step
-		
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at step-\pgf at circ@res at other}{0pt}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
-		\pgfpathclose
-		\pgfusepath{draw}
-		\pgfpathellipse
-			{\pgfpoint{\pgf at circ@res at step-.5\pgf at circ@res at other}{0pt}}
-			{\pgfpoint{.5\pgf at circ@res at other}{0pt}}
-			{\pgfpoint{0pt}{.5\pgf at circ@res at other}}
-				\pgfsetfillcolor{white}
-		\pgfusepath{draw,fill}
-	\endpgfscope
-		
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
-		\pgfpathlineto{\pgfpoint{.7\pgf at circ@res at left}{0pt}}
-		
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
-		\pgfpathlineto{\pgfpoint{.7\pgf at circ@res at right}{0pt}}
-				\pgfusepath{draw}
-		%draw inner shape
-		
-		\pgfsetlinewidth{2\pgflinewidth}
-		
-		\pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at left}{.3\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{.4\pgf at circ@res at left}{.3\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{.4\pgf at circ@res at left}{.3\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{.05\pgf at circ@res at left}{.3\pgf at circ@res at up}}
-		\pgfpathmoveto{\pgfpoint{.4\pgf at circ@res at left}{.3\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{.25\pgf at circ@res at left}{.3\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{.25\pgf at circ@res at left}{.3\pgf at circ@res at up}}
-		\pgfusepath{draw}
-	  
-	  }
-	}
+        \pgf at circ@res at other = \pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/circle width}\pgf at circ@res at right
 
-\pgfdeclareshape{schmitt}
-	{
-	  \anchor{center}{\pgfpointorigin}
-	  \savedanchor\northwest{%
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/height}\pgf at circ@Rlen
-		\pgf at y=.5\pgf at y
-		\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/width}\pgf at circ@Rlen
-		\pgf at x=.5\pgf at x
-	  }
-	  \savedanchor\left{%
-	  	\pgf at y=0pt
-	  }
-	  \anchor{in}{
-		\northwest
-		\pgf at y=0pt
-	  }
-	  \anchor{out}{
-		\northwest
-		\pgf at y=0pt
-		\pgf at x=-\pgf at x
-	  }
-	  \anchor{center}{
-	  	\pgfpointorigin
-	  }
-	  \anchor{east}{
-	  	\left
-	  	\pgf at x=-.8\pgf at x  
-	  }
-	  \anchor{west}{
-	  	\left
-	  }
-	  \anchor{south}{
-		\northwest
-		\pgf at x=0pt
-		\pgf at y=-\pgf at y
-	  }
-	  \anchor{north}{
-		\northwest
-		\pgf at x=0pt
-	  }
-	  	  \anchor{south west}{
-		\northwest
-		\pgf at y=-\pgf at y
-	  }
-	  \anchor{north east}{
-		\northwest
-		\pgf at x=-\pgf at x
-	  }
-	  \anchor{north west}{
-		\northwest
-	  }
-	  \anchor{south east}{
-		\northwest
-		\pgf at x=-\pgf at x
-		\pgf at y=-\pgf at y
-	  }	  
-	  \backgroundpath{			
-			\pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}	
-			
-			
-			\northwest
-			\pgf at circ@res at up = \pgf at y 
-			\pgf at circ@res at down = -\pgf at y
-			\pgf at circ@res at right = -\pgf at x
-			\pgf at circ@res at left = \pgf at x
-			
-		\pgf at circ@res at other = \pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/circle width}\pgf at circ@res at right
-						
-	\pgfscope
-		\pgfsetlinewidth{2\pgflinewidth}
-		\pgftransformxshift{.7\pgf at circ@res at left}
-		\pgf at circ@res at step=\pgf at circ@res at right
-		\advance\pgf at circ@res at step by -\pgf at circ@res at left
-		\pgf at circ@res at step=.7\pgf at circ@res at step
-		
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at step-\pgf at circ@res at other}{0pt}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
-		\pgfpathclose
-		\pgfusepath{draw}
-	\endpgfscope
-		
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
-		\pgfpathlineto{\pgfpoint{.7\pgf at circ@res at left}{0pt}}
-		
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
-		\pgfpathlineto{\pgfpoint{.7\pgf at circ@res at right-\pgf at circ@res at other}{0pt}}
-				\pgfusepath{draw}
-		%draw inner shape
-		
-		\pgfsetlinewidth{2\pgflinewidth}
-		
-		\pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at left}{.3\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{.4\pgf at circ@res at left}{.3\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{.4\pgf at circ@res at left}{.3\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{.05\pgf at circ@res at left}{.3\pgf at circ@res at up}}
-		\pgfpathmoveto{\pgfpoint{.4\pgf at circ@res at left}{.3\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{.25\pgf at circ@res at left}{.3\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{.25\pgf at circ@res at left}{.3\pgf at circ@res at up}}
-		\pgfusepath{draw}
-	  
-	  }
-	}
+        \pgfscope
+            \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
+            \pgftransformxshift{.7\pgf at circ@res at left}
+            \pgf at circ@res at step=\pgf at circ@res at right
+            \advance\pgf at circ@res at step by -\pgf at circ@res at left
+            \pgf at circ@res at step=.7\pgf at circ@res at step
 
+            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step-\pgf at circ@res at other}{0pt}}
+            \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
+            \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
+            \pgfpathclose
+            \pgf at circ@draworfill
+            \pgfpathellipse
+            {\pgfpoint{\pgf at circ@res at step-.5\pgf at circ@res at other}{0pt}}
+            {\pgfpoint{.5\pgf at circ@res at other}{0pt}}
+            {\pgfpoint{0pt}{.5\pgf at circ@res at other}}
+            \pgf at circ@draworfill
+        \endpgfscope
 
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+        \pgfpathlineto{\pgfpoint{.7\pgf at circ@res at left}{0pt}}
 
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+        \pgfpathlineto{\pgfpoint{.7\pgf at circ@res at right}{0pt}}
+        \pgfusepath{draw}
+        %draw inner shape
+
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
+
+        \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at left}{.3\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at left}{.3\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at left}{.3\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{.05\pgf at circ@res at left}{.3\pgf at circ@res at up}}
+        \pgfpathmoveto{\pgfpoint{.4\pgf at circ@res at left}{.3\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{.25\pgf at circ@res at left}{.3\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{.25\pgf at circ@res at left}{.3\pgf at circ@res at up}}
+        \pgfusepath{draw}
+
+    }
+}
+
+\pgfdeclareshape{schmitt}{
+    \anchor{center}{\pgfpointorigin}
+    \savedanchor\northwest{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+    }
+    \savedanchor\left{%
+        \pgf at y=0pt
+    }
+    \anchor{in}{
+        \northwest
+        \pgf at y=0pt
+    }
+    \anchor{out}{
+        \northwest
+        \pgf at y=0pt
+        \pgf at x=-\pgf at x
+    }
+    \anchor{center}{
+        \pgfpointorigin
+    }
+    \anchor{east}{
+        \left
+        \pgf at x=-.8\pgf at x
+    }
+    \anchor{west}{
+        \left
+    }
+    \anchor{south}{
+        \northwest
+        \pgf at x=0pt
+        \pgf at y=-\pgf at y
+    }
+    \anchor{north}{
+        \northwest
+        \pgf at x=0pt
+    }
+    \anchor{south west}{
+        \northwest
+        \pgf at y=-\pgf at y
+    }
+    \anchor{north east}{
+        \northwest
+        \pgf at x=-\pgf at x
+    }
+    \anchor{north west}{
+        \northwest
+    }
+    \anchor{south east}{
+        \northwest
+        \pgf at x=-\pgf at x
+        \pgf at y=-\pgf at y
+    }
+    \backgroundpath{
+        \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+
+        \northwest
+        \pgf at circ@res at up = \pgf at y
+        \pgf at circ@res at down = -\pgf at y
+        \pgf at circ@res at right = -\pgf at x
+        \pgf at circ@res at left = \pgf at x
+
+        \pgf at circ@res at other = \pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/circle width}\pgf at circ@res at right
+
+        \pgfscope
+            \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
+            \pgftransformxshift{.7\pgf at circ@res at left}
+            \pgf at circ@res at step=\pgf at circ@res at right
+            \advance\pgf at circ@res at step by -\pgf at circ@res at left
+            \pgf at circ@res at step=.7\pgf at circ@res at step
+
+            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step-\pgf at circ@res at other}{0pt}}
+            \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
+            \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
+            \pgfpathclose
+            \pgf at circ@draworfill
+        \endpgfscope
+
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+        \pgfpathlineto{\pgfpoint{.7\pgf at circ@res at left}{0pt}}
+
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+        \pgfpathlineto{\pgfpoint{.7\pgf at circ@res at right-\pgf at circ@res at other}{0pt}}
+        \pgfusepath{draw}
+        %draw inner shape
+
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
+
+        \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at left}{.3\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at left}{.3\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at left}{.3\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{.05\pgf at circ@res at left}{.3\pgf at circ@res at up}}
+        \pgfpathmoveto{\pgfpoint{.4\pgf at circ@res at left}{.3\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{.25\pgf at circ@res at left}{.3\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{.25\pgf at circ@res at left}{.3\pgf at circ@res at up}}
+        \pgfusepath{draw}
+
+    }
+}
+
+
+%%% start european logic ports, from John Kormylo
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%
 
 % #1 - name
 % #2 - text inside
 % #3 - number of inputs
-% #4 - is it a not
+% #4 = is it a not?
 
 \long\def\pgfcircdeclareeurologicport#1#2#3#4{
-	\pgfdeclareshape{european #1 port}
-	{
-	  \savedanchor\northwest{%
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/height}\pgf at circ@Rlen
-		\pgf at y=.5\pgf at y
-		\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/width}\pgf at circ@Rlen
-		\pgf at x=.5\pgf at x
-	  }
-	  \savedanchor\left{%
-	  	\pgf at y=0pt
-	  }
-	  \savedanchor\inOne{%
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/height}\pgf at circ@Rlen
-		\pgf at y=.5\pgf at y
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/input height}\pgf at y
-		\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/width}\pgf at circ@Rlen
-		\pgf at x=.5\pgf at x
-	  }	  
-	  \anchor{in}{
-		\inOne
-	  }
-	  \anchor{in 1}{
-		\inOne
-	  }
-	  \anchor{in 2}{
-		\inOne
-		\pgf at y=-\pgf at y
-	  }
-	  \anchor{out}{
-		\northwest
-		\pgf at y=0pt
-		\pgf at x=-\pgf at x
-	  }
-  	  \anchor{center}{
-		\northwest
-		\pgf at y=0pt
-		\pgf at x=-.8\pgf at x  
-	  }
-	  \anchor{east}{
-	  	\left
-	  	\pgf at x=-.8\pgf at x  
-	  }
-	  \anchor{west}{
-	  	\left
-	  }
-	  \anchor{south}{
-		\northwest
-		\pgf at x=0pt
-		\pgf at y=-\pgf at y
-	  }
-	  \anchor{north}{
-		\northwest
-		\pgf at x=0pt
-	  }
-	  \anchor{south west}{
-		\northwest
-		\pgf at y=-\pgf at y
-	  }
-	  \anchor{north east}{
-		\northwest
-		\pgf at x=-\pgf at x
-	  }
-	  \anchor{north west}{
-		\northwest
-	  }
-	  \anchor{south east}{
-		\northwest
-		\pgf at x=-\pgf at x
-		\pgf at y=-\pgf at y
-	  }	  
-	  \backgroundpath{			
-			\pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}	
-			\northwest
-			\pgf at circ@res at up = \pgf at y 
-			\pgf at circ@res at down = -\pgf at y
-			\pgf at circ@res at right = -\pgf at x
-			\pgf at circ@res at left = \pgf at x
-			\def\pgf at temp{1}
-			\def\pgf at circ@temp{#3}
-			\ifx\pgftemp\pgf at circ@temp % one input
-				\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
-				\pgfpathlineto{
-					\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf at circ@res at left}{0pt}}
-			\else % two inputs
-				\pgfpathmoveto{
-					\pgfpoint{\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/input height}\pgf at circ@res at up}}
-				\pgfpathlineto{
-					\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf at circ@res at left}
-					{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/input height}\pgf at circ@res at up}}
-					%
-				\pgfpathmoveto{
-					\pgfpoint{\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/input height}\pgf at circ@res at down}}
-				\pgfpathlineto{
-					\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf at circ@res at left}
-					{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/input height}\pgf at circ@res at down}}
-			\fi%
-			%
-			%
-			\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
-			\pgfpathlineto{
-				\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf at circ@res at right}{0pt}}
-			%
-			\edef\pgf at temp{not}
-			\edef\pgf at circ@temp{#4}
-			\ifx\pgf at temp\pgf at circ@temp % is a not
-				\pgfpathmoveto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/not width}\pgf at circ@res at right}{0pt}}
-				\pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf at circ@res at right}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/not height}\pgf at circ@res at up}}
-			\fi
-			%
-			\pgfusepath{draw}
-			%
-			\pgfpathmoveto{\pgfpointorigin}
-			\pgftext{#2}
-			%
-			%
-			%
-			\pgfsetlinewidth{2\pgflinewidth}
-			\pgfpathrectanglecorners
-				{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf at circ@res at left}{\pgf at circ@res at up}}
-				{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf at circ@res at right}{\pgf at circ@res at down}}
-			\pgfusepath{draw}
-%
-%
-	  }
-	}
-}
+    \pgfdeclareshape{european #1 port}
+    {
+        \savedmacro\resize{% automatic
+            \pgf at circ@res at up = \pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/height}\pgf at circ@Rlen
+            \pgf at circ@res at up = .5\pgf at circ@res at up
+            \pgf at circ@res at down = -\pgf at circ@res at up
+            \pgf at circ@res at right = \pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/width}\pgf at circ@Rlen
+            \pgf at circ@res at right = .5\pgf at circ@res at right
+            \pgf at circ@res at left = -\pgf at circ@res at right
+        }%
+        \savedmacro\inputs{% get number of inputs
+            \pgf at circ@res at count=\pgfkeysvalueof{/tikz/number inputs}\relax%
+            \ifnum\pgf at circ@res at count=0
+                \pgf at circ@res at count=\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/inputs}\relax%
+            \fi
+        \ifnum\pgf at circ@res at count<2 \pgf at circ@res at count=2\fi
+    \ifnum\pgf at circ@res at count>16 \pgf at circ@res at count=16\fi
+        \def\inputs{\the\pgf at circ@res at count}%
+    }%
+    \savedanchor\step{% 1/2 gap at edges
+        \pgf at circ@res at step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/height}\pgf at circ@Rlen
+        \divide\pgf at circ@res at step by #3
+        \pgfpoint{\pgf at circ@res at left}{\dimexpr\pgf at circ@res at up+0.5\pgf at circ@res at step}%
+    }%
+    \savedanchor\northeast{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}%
+    \savedanchor\southwest{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}%
+    \savedanchor\left{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf at circ@res at left}{0pt}}%
+    \savedanchor\right{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf at circ@res at right}{0pt}}%
+    \savedanchor\origin{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/origin}\pgf at circ@res at right}{0pt}}%
 
+    \anchor{center}{\origin}% for backwards compatibility
+    % the text anchor overlaps the logic symbol
+    \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}%
+    % create input anchors
+    \ifnum#3=1\relax
+        \anchor{in}{\pgfpoint{\pgf at circ@res at left}{0pt}}% or \step
+    \else
+        \expandafter\pgfutil at g@addto at macro\csname pgf at sh@s at european #1 port\endcsname{%
+            \pgfmathloop%
+            \ifnum\pgfmathcounter>#3%
+        \else%
+            %\pgfutil at ifundefined{pgf at anchor@european #1 port at in \pgfmathcounter}{% redundant
+            \expandafter\xdef\csname pgf at anchor@european #1 port at in \pgfmathcounter\endcsname{%
+                \noexpand\pgf at circ@logicport at input{\pgfmathcounter}% defined above
+            }%
+            \expandafter\xdef\csname pgf at anchor@european #1 port at bin \pgfmathcounter\endcsname{%
+                \noexpand\pgf at circ@logicport at baseinput{\pgfmathcounter}{4}{#1}% defined above
+            }%
+            %}{}%
+            \repeatpgfmathloop%
+        }
+    \fi
+    \anchor{out}{\northeast\pgf at y=0pt}
+    \anchor{bout}{\right\pgf at y=0pt}
 
+    \anchor{left}{\left}% edges of component minus leads
+    \anchor{right}{\right}
 
-\pgfcircdeclareeurologicport{and}{$\&$}{2}{}
-\pgfcircdeclareeurologicport{or}{$\ge 1$}{2}{}
-\pgfcircdeclareeurologicport{xor}{$=1$}{2}{}
+    \anchor{north east}{\northeast}% see \Compass macro
+    \anchor{south west}{\southwest}
+    \anchor{north}{\pgfextracty{\pgf at circ@res at up}{\northeast}%
+    \pgfpoint{0cm}{\pgf at circ@res at up}}
+    \anchor{north west}{\pgfextracty{\pgf at circ@res at up}{\northeast}%
+        \pgfextractx{\pgf at circ@res at left}{\southwest}%
+    \pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+    \anchor{west}{\pgfextractx{\pgf at circ@res at left}{\southwest}%
+    \pgfpoint{\pgf at circ@res at left}{0cm}}
+    \anchor{south}{\pgfextracty{\pgf at circ@res at down}{\southwest}%
+    \pgfpoint{0cm}{\pgf at circ@res at down}}
+    \anchor{south east}{\pgfextracty{\pgf at circ@res at down}{\southwest}%
+        \pgfextractx{\pgf at circ@res at right}{\northeast}%
+    \pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \anchor{east}{\pgfextractx{\pgf at circ@res at right}{\northeast}%
+    \pgfpoint{\pgf at circ@res at right}{0cm}}
+
+    \backgroundpath{
+        \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+        \pgfscope
+            \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
+            \pgfpathrectanglecorners
+            {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf at circ@res at left}{\pgf at circ@res at up}}
+            {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf at circ@res at right}{\pgf at circ@res at down}}
+            \pgf at circ@draworfill
+        \endpgfscope
+        \ifnum#3=1\relax
+            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}%
+            \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf at circ@res at left}{0pt}}%
+        \else
+            \pgfextracty{\pgf at circ@res at temp}{\step}%
+            \pgf at circ@res at step = \dimexpr 2\pgf at circ@res at temp -2\pgf at circ@res at up\relax
+            %\pgf at circ@res at count = #3\relax% redundant
+            \loop\ifnum\pgf at circ@res at count>0
+                \advance\pgf at circ@res at temp by -\pgf at circ@res at step
+                \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at temp}}%
+                \pgfpathlineto{\pgfpoint
+                    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf at circ@res at left}
+                {\pgf at circ@res at temp}}
+                \advance\pgf at circ@res at count by -1
+                \repeat
+            \fi
+            %
+            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+            \pgfpathlineto{%
+            \pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf at circ@res at right}{0pt}}
+            %
+            \edef\pgf at temp{not}
+            \edef\pgf at circ@temp{#4}
+            \ifx\pgf at temp\pgf at circ@temp % is a not
+                \pgfpathmoveto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/not width}\pgf at circ@res at right}{0pt}}
+                \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf at circ@res at right}%
+                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/not height}\pgf at circ@res at up}}
+            \fi
+            %
+            \pgfusepath{draw}
+            %
+            \pgfpathmoveto{\pgfpointorigin}
+            \pgftext{#2}
+            %
+            %
+            %
+        }
+    }
+}
+\pgfcircdeclareeurologicport{and}{\&}{\pgf at circ@res at count}{}
+\pgfcircdeclareeurologicport{or}{$\ge 1$}{\pgf at circ@res at count}{}
+\pgfcircdeclareeurologicport{xor}{$=1$}{\pgf at circ@res at count}{}
 \pgfcircdeclareeurologicport{not}{$1$}{1}{not}
-\pgfcircdeclareeurologicport{nand}{$\&$}{2}{not}
-\pgfcircdeclareeurologicport{nor}{$\ge 1$}{2}{not}
-\pgfcircdeclareeurologicport{xnor}{$=1$}{2}{not}
+\pgfcircdeclareeurologicport{nand}{\&}{\pgf at circ@res at count}{not}
+\pgfcircdeclareeurologicport{nor}{$\ge 1$}{\pgf at circ@res at count}{not}
+\pgfcircdeclareeurologicport{xnor}{$=1$}{\pgf at circ@res at count}{not}
 
+%% end european logic ports
+
 \long\def\pgfcircdeclaretransistor#1#2#3{
-	\pgfdeclareshape{#1}
-	{
-	\anchor{center}{
-		 \pgfpointorigin
-	 }
-	\savedanchor\northeast{% upper right
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/height}\pgf at circ@Rlen
-		\pgf at y=.5\pgf at y
-		\pgf at x=0pt
-	}
-	\savedanchor\left{%center left
-	  	\pgf at y=0pt
-		\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/width}\pgf at circ@Rlen
-	}
-	\anchor{text}{
-	 \northeast
-	 \pgf at y=.7\pgf at y
-	 \pgf at x= \pgf at circ@Rlen
-	 \pgf at x=0.1\pgf at x
-	}
-	\anchor{pathstart}{ % south
-		  	\northeast
-			\pgf at y=-\pgf at y
-	}
-	\anchor{pathend}{
-		  	\northeast
-	}  
-	\anchor{north}{
-			\northeast
-			\pgf at circ@res at step=\pgf at y
-			\left
-			\pgf at y=\pgf at circ@res at step
-			\pgf at x=.5\pgf at x
-		}  
-	 \anchor{west}{
-			\left
-	 }
-	 \anchor{east}{
-		  	\northeast
-			\pgf at y=0pt
-	 }  
-	\anchor{south}{
-			\northeast
-			\pgf at circ@res at step=\pgf at y
-			\left
-			\pgf at y=-\pgf at circ@res at step
-			\pgf at x=.5\pgf at x
-	}
-	\anchor{south west}{
-			\northeast
-			\pgf at circ@res at step=\pgf at y
-			\left
-			\pgf at y=-\pgf at circ@res at step
-	}
-	\anchor{north east}{
-		\northeast
-	}
-	\anchor{north west}{
-			\northeast
-			\pgf at circ@res at step=\pgf at y
-			\left
-			\pgf at y=\pgf at circ@res at step
-	}
-	\anchor{south east}{
-		\northeast
-		\pgf at y=-\pgf at y
-	}
-	\anchor{B}{
-			 \northeast
-	         \pgf at circ@res at step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf at y
-	         \left
-	         \pgf at y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf at circ@res at step
-	}
-	\anchor{base}{
-			 \northeast
-	         \pgf at circ@res at step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf at y
-	         \left
-	         \pgf at y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf at circ@res at step
-	}
-		\anchor{G}{
-	         \northeast
-	         \pgf at circ@res at step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf at y
-	         \left
-	         \pgf at y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf at circ@res at step
-		}
-		\anchor{gate}{
-	         \northeast
-	         \pgf at circ@res at step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf at y
-	         \left
-	         \pgf at y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf at circ@res at step
-		}	
-	 \anchor{nobase}{
-	 		 	\left
-	 		 	\pgf at x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at x
-	 }
-	 	\anchor{nogate}{
-	 		\left
-	 		\pgf at x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf at x
-	 	}	
-	 	\anchor{E}{
-	 		\northeast
-	 		\pgf at y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf at y
-	 	}
-	 	\anchor{emitter}{
-	 		\northeast
-	 		\pgf at y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf at y
-	 	}
-	 	\anchor{C}{
-	 		\northeast
-	 		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf at y
-	 	}
-	 	\anchor{collector}{
-	 		\northeast
-	 		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf at y
-	 	}
-	 	\anchor{S}{
-	 		\northeast
-	 		\pgf at y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf at y
-	 	}
-	 	\anchor{source}{
-	 		\northeast
-	 		\pgf at y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf at y
-	 	}
-	 	\anchor{D}{
-	 		\northeast
-	 		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf at y
-	 	}
-	 	\anchor{drain}{
-	 		\northeast
-	 		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf at y
-	 	}	
-	  #2
-	  \backgroundpath{
-	  	\pgftransformationadjustments		
-			\pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}	
-			%
-			\ifnum \pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction} > 0
-				\pgf at circuit@trans at ntypetrue
-			\else
-				\pgf at circuit@trans at ntypefalse
-			\fi
-			\northeast
-			\pgf at circ@res at up = \pgf at y 
-			\pgf at circ@res at down = -\pgf at y
-			\pgf at circ@res at right = \pgf at x
-			\left
-			\pgf at circ@res at left = \pgf at x
-			%
-			#3
-			% BODY DIODE
-			\ifpgf at circuit@fet at bodydiode
-			\drawbodydiode{#1}
-			\fi
-	  %
-	  }
-	}
+    \pgfdeclareshape{#1}
+    {
+        \anchor{center}{
+            \pgfpointorigin
+        }
+        \savedanchor\northeast{% upper right
+            \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/height}\pgf at circ@Rlen
+            \pgf at y=.5\pgf at y
+            \pgf at x=0pt
+        }
+        \savedanchor\left{%center left
+            \pgf at y=0pt
+            \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/width}\pgf at circ@Rlen
+        }
+        \anchor{text}{
+            \northeast
+            \pgf at y=.7\pgf at y
+            \pgf at x= \pgf at circ@Rlen
+            \pgf at x=0.1\pgf at x
+        }
+        \anchor{pathstart}{ % south
+            \northeast
+            \pgf at y=-\pgf at y
+        }
+        \anchor{pathend}{
+            \northeast
+        }
+        \anchor{north}{
+            \northeast
+            \pgf at circ@res at step=\pgf at y
+            \left
+            \pgf at y=\pgf at circ@res at step
+            \pgf at x=.5\pgf at x
+        }
+        \anchor{west}{
+            \left
+        }
+        \anchor{east}{
+            \northeast
+            \pgf at y=0pt
+        }
+        \anchor{south}{
+            \northeast
+            \pgf at circ@res at step=\pgf at y
+            \left
+            \pgf at y=-\pgf at circ@res at step
+            \pgf at x=.5\pgf at x
+        }
+        \anchor{south west}{
+            \northeast
+            \pgf at circ@res at step=\pgf at y
+            \left
+            \pgf at y=-\pgf at circ@res at step
+        }
+        \anchor{north east}{
+            \northeast
+        }
+        \anchor{north west}{
+            \northeast
+            \pgf at circ@res at step=\pgf at y
+            \left
+            \pgf at y=\pgf at circ@res at step
+        }
+        \anchor{south east}{
+            \northeast
+            \pgf at y=-\pgf at y
+        }
+        \anchor{B}{
+            \northeast
+            \pgf at circ@res at step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf at y
+            \left
+            \pgf at y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf at circ@res at step
+        }
+        \anchor{base}{
+            \northeast
+            \pgf at circ@res at step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf at y
+            \left
+            \pgf at y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf at circ@res at step
+        }
+        \anchor{G}{
+            \northeast
+            \pgf at circ@res at step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf at y
+            \left
+            \pgf at y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf at circ@res at step
+        }
+        \anchor{gate}{
+            \northeast
+            \pgf at circ@res at step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf at y
+            \left
+            \pgf at y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf at circ@res at step
+        }
+        \anchor{nobase}{
+            \left
+            \pgf at x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at x
+        }
+        \anchor{nogate}{
+            \left
+            \pgf at x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf at x
+        }
+        \anchor{E}{
+            \northeast
+            \pgf at y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf at y
+        }
+        \anchor{emitter}{
+            \northeast
+            \pgf at y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf at y
+        }
+        \anchor{C}{
+            \northeast
+            \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf at y
+        }
+        \anchor{collector}{
+            \northeast
+            \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf at y
+        }
+        \anchor{S}{
+            \northeast
+            \pgf at y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf at y
+        }
+        \anchor{source}{
+            \northeast
+            \pgf at y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf at y
+        }
+        \anchor{D}{
+            \northeast
+            \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf at y
+        }
+        \anchor{drain}{
+            \northeast
+            \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf at y
+        }
+        #2
+        \backgroundpath{
+            \pgftransformationadjustments
+            \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+            %
+            \ifnum \pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction} > 0
+            \pgf at circuit@trans at ntypetrue
+            \else
+            \pgf at circuit@trans at ntypefalse
+        \fi
+        \northeast
+        \pgf at circ@res at up = \pgf at y
+        \pgf at circ@res at down = -\pgf at y
+        \pgf at circ@res at right = \pgf at x
+        \left
+        \pgf at circ@res at left = \pgf at x
+        %
+        #3
+        % BODY DIODE
+        \ifpgf at circuit@fet at bodydiode
+            \drawbodydiode{#1}
+        \fi
+        %
+    }
 }
+}
 
 \long\def\drawbodydiode#1{
-        \pgfscope
-	         \pgftransformshift{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode distance}\pgf at circ@res at left}{\pgf at circ@res at up+\pgf at circ@res at down}}
-	        \pgftransformrotate{90}
-			\pgftransformscale{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode scale}}
-			\ifpgf at circuit@fulldiode
-				\pgfnode{fulldiodeshape}{center}{}{pgf at bodydiode}{\pgfusepath{fill}}
-			\else
-				\pgfnode{emptydiodeshape}{center}{}{pgf at bodydiode}{\pgfusepath{fill}}
-			\fi
-		\endpgfscope
-		%Draw upper connection to body diode
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}
-						{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode distance}\pgf at circ@res at left}
-						{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf at circ@res at up}}
-			 	\pgfpathlineto{\pgfpointanchor{pgf at bodydiode}{east}}
-		\pgfusepath{draw}
-		\pgfscope
-	        \pgftransformshift{\pgfpoint{\pgf at circ@res at right}
-        	       {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf at circ@res at up}}
-   	       	\pgftransformscale{0.5}
+    \pgfscope
+        \pgftransformshift{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode distance}\pgf at circ@res at left}{\pgf at circ@res at up+\pgf at circ@res at down}}
+        \pgftransformrotate{90}
+        \pgftransformscale{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode scale}}
+        \ifpgf at circuit@fulldiode
+            \pgfnode{fulldiodeshape}{center}{}{pgf at bodydiode}{\pgfusepath{fill}}
+        \else
+            \pgfnode{emptydiodeshape}{center}{}{pgf at bodydiode}{\pgfusepath{fill}}
+        \fi
+    \endpgfscope
+    % Draw stroke line
+    \ifpgf at circuit@strokediode
+        \pgfpathmoveto{\pgfpointanchor{pgf at bodydiode}{west}}
+        \pgfpathlineto{\pgfpointanchor{pgf at bodydiode}{east}}
+        \pgfusepath{stroke}
+    \fi
+    %Draw upper connection to body diode
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}
+    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode distance}\pgf at circ@res at left}
+    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpointanchor{pgf at bodydiode}{east}}
+    \pgfusepath{draw}
+    \pgfscope
+        \pgftransformshift{\pgfpoint{\pgf at circ@res at right}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf at circ@res at up}}
+        \pgftransformscale{0.5}
         \pgfnode{circ}{center}{}{}{\pgfusepath{fill}}
-      \endpgfscope{}
-   		%Draw lower connection to body diode
-	   \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}
-	        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode distance}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf at circ@res at down}}
-			 	\pgfpathlineto{\pgfpointanchor{pgf at bodydiode}{west}}
-		\pgfusepath{draw}
-		\pgfscope
-      \pgftransformshift{\pgfpoint{\pgf at circ@res at right}		        	       {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf at circ@res at down}}
-  	       		\pgftransformscale{0.5}
-      \pgfnode{circ}{center}{}{}{\pgfusepath{fill}}
+    \endpgfscope{}
+    %Draw lower connection to body diode
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}
+    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode distance}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpointanchor{pgf at bodydiode}{west}}
+    \pgfusepath{draw}
+    \pgfscope
+        \pgftransformshift{\pgfpoint{\pgf at circ@res at right}		        	       {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf at circ@res at down}}
+        \pgftransformscale{0.5}
+        \pgfnode{circ}{center}{}{}{\pgfusepath{fill}}
     \endpgfscope
 }
 
 \long\def\declarebpt#1{
-	\pgfcircdeclaretransistor{#1}{}{
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}
-			{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint
-			{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
-			{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height 2}\pgf at circ@res at up}}
-		\pgfusepath{draw}
-	
-		\pgfscope
-		\pgfpathmoveto{\pgfpoint
-			{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
-			{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint
-			{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
-			{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf at circ@res at down}}
-		\pgfsetlinewidth{2\pgflinewidth}
-		\pgfusepath{draw}
-		\endpgfscope
-		
-		\pgfpathmoveto{\pgfpoint
-			{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
-			{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height 2}\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}
-			{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}		
-		\pgfusepath{draw}
-		%draw arrow depending on type of transiytor
-	 	\pgfscope
-	 	\pgfslopedattimetrue
-	 	\pgfallowupsidedownattimetrue
-	 	\pgfresetnontranslationattimefalse
-		\ifpgf at circuit@trans at ntype
-		 	\pgftransformlineattime{.5}{%
-		 		\pgfpoint%
-		 			{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}%
-		 			{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height 2}\pgf at circ@res at down}%
-		 	}{%
-		 		\pgfpoint{\pgf at circ@res at right}%
-		 			{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf at circ@res at down}%
-		 	}
-		\else
-		 	\pgftransformlineattime{.5}{%
-		 		\pgfpoint{\pgf at circ@res at right}%
-		 				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf at circ@res at up}%
-		 		}{%
-		 		\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}%
-		 				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height 2}\pgf at circ@res at up}%
-		 		}
-		\fi
-		\pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
-		\endpgfscope
-	
-		\ifpgf at circuit@bpt at drawphoto
-					\pgfscope
-					\pgfsetarrowsstart{latex'}
-					\pgfpathmoveto{\pgfpointadd{\pgfpoint
-										{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
-										{\pgf at circ@res at up+\pgf at circ@res at down}}
-										{\pgfpoint{0.05\pgf at circ@res at left}{0.1\pgf at circ@res at up}}}
-					\pgfpathlineto{\pgfpointadd{\pgfpoint
-										{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
-										{\pgf at circ@res at up+\pgf at circ@res at down}}
-										{\pgfpoint{0.5\pgf at circ@res at left}{0.3\pgf at circ@res at up}}}
-					\pgfusepath{draw}
-					\pgfpathmoveto{\pgfpointadd{\pgfpoint
-										{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
-										{\pgf at circ@res at up+\pgf at circ@res at down}}
-										{\pgfpoint{0.05\pgf at circ@res at left}{-0.1\pgf at circ@res at up}}}
-					\pgfpathlineto{\pgfpointadd{\pgfpoint
-										{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
-										{\pgf at circ@res at up+\pgf at circ@res at down}}
-										{\pgfpoint{0.5\pgf at circ@res at left}{0.1\pgf at circ@res at up}}}
-					\pgfusepath{draw}
-					\endpgfscope
-		\else
-		\ifpgf at circuit@bpt at drawbase
-			\pgfpathmoveto{\pgfpoint
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
-				{\pgf at circ@res at up+\pgf at circ@res at down}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf at circ@res at up+\pgf at circ@res at down}}
-			\pgfusepath{draw}
-		\fi
-		\fi
-	}
+    \pgfcircdeclaretransistor{#1}{}{
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height 2}\pgf at circ@res at up}}
+        \pgfusepath{draw}
+
+        \pgfscope
+            \pgfpathmoveto{\pgfpoint
+                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf at circ@res at up}}
+            \pgfpathlineto{\pgfpoint
+                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf at circ@res at down}}
+            \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
+            \pgfusepath{draw}
+        \endpgfscope
+
+        \pgfpathmoveto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height 2}\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+        \pgfusepath{draw}
+        %draw arrow depending on type of transistor
+        \pgfscope
+            \pgfslopedattimetrue
+            \pgfallowupsidedownattimetrue
+            \pgfresetnontranslationattimefalse
+            \ifpgf at circuit@trans at ntype
+                \pgftransformlineattime{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/arrow pos}}{%
+                    \pgfpoint%
+                    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}%
+                    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height 2}\pgf at circ@res at down}%
+                    }{%
+                    \pgfpoint{\pgf at circ@res at right}%
+                    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf at circ@res at down}%
+                }
+            \else
+                \pgftransformlineattime{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/arrow pos}}{%
+                    \pgfpoint{\pgf at circ@res at right}%
+                    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf at circ@res at up}%
+                    }{%
+                    \pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}%
+                    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height 2}\pgf at circ@res at up}%
+                }
+            \fi
+            \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+        \endpgfscope
+
+        \ifpgf at circuit@bpt at drawphoto
+            \pgfscope
+                \pgfsetarrowsstart{latexslim}
+                \pgfpathmoveto{\pgfpointadd{\pgfpoint
+                        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
+                    {\pgf at circ@res at up+\pgf at circ@res at down}}
+                {\pgfpoint{0.05\pgf at circ@res at left}{0.1\pgf at circ@res at up}}}
+                \pgfpathlineto{\pgfpointadd{\pgfpoint
+                        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
+                    {\pgf at circ@res at up+\pgf at circ@res at down}}
+                {\pgfpoint{0.5\pgf at circ@res at left}{0.3\pgf at circ@res at up}}}
+                \pgfusepath{draw}
+                \pgfpathmoveto{\pgfpointadd{\pgfpoint
+                        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
+                    {\pgf at circ@res at up+\pgf at circ@res at down}}
+                {\pgfpoint{0.05\pgf at circ@res at left}{-0.1\pgf at circ@res at up}}}
+                \pgfpathlineto{\pgfpointadd{\pgfpoint
+                        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
+                    {\pgf at circ@res at up+\pgf at circ@res at down}}
+                {\pgfpoint{0.5\pgf at circ@res at left}{0.1\pgf at circ@res at up}}}
+                \pgfusepath{draw}
+            \endpgfscope
+            \else
+            \ifpgf at circuit@bpt at drawbase
+                \pgfpathmoveto{\pgfpoint
+                    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
+                {\pgf at circ@res at up+\pgf at circ@res at down}}
+                \pgfpathlineto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf at circ@res at up+\pgf at circ@res at down}}
+                \pgfusepath{draw}
+            \fi
+        \fi
+    }
 }
 
 \declarebpt{npn}
@@ -1299,84 +1429,84 @@
 \declarebpt{pnp}
 
 \long\def\declareigbt#1{
-\pgfcircdeclaretransistor{#1}{}
-{
-	%draw upper connection
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height 2}\pgf at circ@res at up}}
-	\pgfusepath{draw}
+    \pgfcircdeclaretransistor{#1}{}
+    {
+        %draw upper connection
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height 2}\pgf at circ@res at up}}
+        \pgfusepath{draw}
 
-	%draw thicker gate lines
-	\pgfscope
-	\pgfpathmoveto{\pgfpoint
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf at circ@res at up+\pgfverticaltransformationadjustment*.5\pgflinewidth}}
-	\pgfpathlineto{\pgfpoint
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf at circ@res at down-\pgfverticaltransformationadjustment*.5\pgflinewidth}}
-	\pgfpathmoveto{\pgfpoint
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf at circ@res at up+\pgfverticaltransformationadjustment*.5\pgflinewidth}}
-	\pgfpathlineto{\pgfpoint
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf at circ@res at down-\pgfverticaltransformationadjustment*.5\pgflinewidth}}
-	\pgfsetlinewidth{2\pgflinewidth}
-	\pgfusepath{draw}
-	\endpgfscope
-	%draw lower connection		
-	\pgfpathmoveto{\pgfpoint
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height 2}\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}		
-	\pgfusepath{draw}
-	%draw arrow depending on type of transiytor
- 	\pgfscope
- 	\pgfslopedattimetrue
- 	\pgfallowupsidedownattimetrue
- 	\pgfresetnontranslationattimefalse
-	\ifpgf at circuit@trans at ntype
-	 	\pgftransformlineattime{.5}{%
-	 		\pgfpoint%
-	 			{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}%
-	 			{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height 2}\pgf at circ@res at down}%
-	 	}{%
-	 		\pgfpoint{\pgf at circ@res at right}%
-	 			{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf at circ@res at down}%
-	 	}
-	\else
-	 	\pgftransformlineattime{.5}{%
-	 		\pgfpoint{\pgf at circ@res at right}%
-	 				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf at circ@res at up}%
-	 		}{%
-	 		\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}%
-	 				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height 2}\pgf at circ@res at up}%
-	 		}
-	\fi
-	\pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
-	\endpgfscope
-	%draw gate
-	\ifpgf at circuit@trans at ntype	
-		\pgfpathmoveto{\pgfpoint
-			{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf at circ@res at left}
-			{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}%
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf at circ@res at down}}				
-	\else
-		\pgfpathmoveto{\pgfpoint
-			{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf at circ@res at left}
-			{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}%
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf at circ@res at up}}			
-	\fi
-	\pgfusepath{draw}
+        %draw thicker gate lines
+        \pgfscope
+            \pgfpathmoveto{\pgfpoint
+                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf at circ@res at left}
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf at circ@res at up+\pgfverticaltransformationadjustment*.5\pgflinewidth}}
+            \pgfpathlineto{\pgfpoint
+                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf at circ@res at left}
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf at circ@res at down-\pgfverticaltransformationadjustment*.5\pgflinewidth}}
+            \pgfpathmoveto{\pgfpoint
+                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf at circ@res at up+\pgfverticaltransformationadjustment*.5\pgflinewidth}}
+            \pgfpathlineto{\pgfpoint
+                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf at circ@res at down-\pgfverticaltransformationadjustment*.5\pgflinewidth}}
+            \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
+            \pgfusepath{draw}
+        \endpgfscope
+        %draw lower connection
+        \pgfpathmoveto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height 2}\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+        \pgfusepath{draw}
+        %draw arrow depending on type of transiytor
+        \pgfscope
+            \pgfslopedattimetrue
+            \pgfallowupsidedownattimetrue
+            \pgfresetnontranslationattimefalse
+            \ifpgf at circuit@trans at ntype
+                \pgftransformlineattime{.5}{%
+                    \pgfpoint%
+                    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}%
+                    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height 2}\pgf at circ@res at down}%
+                    }{%
+                    \pgfpoint{\pgf at circ@res at right}%
+                    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf at circ@res at down}%
+                }
+            \else
+                \pgftransformlineattime{.5}{%
+                    \pgfpoint{\pgf at circ@res at right}%
+                    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf at circ@res at up}%
+                    }{%
+                    \pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}%
+                    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height 2}\pgf at circ@res at up}%
+                }
+            \fi
+            \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+        \endpgfscope
+        %draw gate
+        \ifpgf at circuit@trans at ntype
+            \pgfpathmoveto{\pgfpoint
+                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf at circ@res at left}
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf at circ@res at down}}
+            \pgfpathlineto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}%
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf at circ@res at down}}
+        \else
+            \pgfpathmoveto{\pgfpoint
+                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf at circ@res at left}
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf at circ@res at up}}
+            \pgfpathlineto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}%
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf at circ@res at up}}
+        \fi
+        \pgfusepath{draw}
+    }
 }
-}
 
 \declareigbt{pigbt}
 \declareigbt{nigbt}
@@ -1385,247 +1515,282 @@
 
 
 \pgfcircdeclaretransistor{nmos}{}{%
-			\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf at circ@res at up}}
-			\pgfpathlineto{\pgfpoint
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf at circ@res at left}
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf at circ@res at up}}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}
+    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf at circ@res at left}
+    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf at circ@res at up}}
 
-			\pgfpathmoveto{\pgfpoint
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf at circ@res at left}
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf at circ@res at down}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf at circ@res at down}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
-			\pgfusepath{draw}
-			
-			\pgfscope
-			\pgfpathmoveto{\pgfpoint
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf at circ@res at left}
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base height}\pgf at circ@res at up}}
-			\pgfpathlineto{\pgfpoint
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf at circ@res at left}
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base height}\pgf at circ@res at down}}
-			\pgfpathmoveto{\pgfpoint
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf at circ@res at left}
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf at circ@res at up}}
-			\pgfpathlineto{\pgfpoint
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf at circ@res at left}
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf at circ@res at down}}
-			\pgfsetlinewidth{2\pgflinewidth}
-			\pgfusepath{draw}
-			\endpgfscope
-		\ifpgf at circuit@mos at arrows
-			\pgfscope             
-			\pgfslopedattimetrue 
-			\pgfallowupsidedownattimetrue
-			\pgfresetnontranslationattimefalse
-			\pgftransformlineattime{.6}{%
-				\pgfpoint%
-					{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf at circ@res at left}%
-					{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf at circ@res at down}%
-			}{%
-				\pgfpoint
-					{\pgf at circ@res at right}%
-					{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf at circ@res at down}%
-			}
-			\pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
-			\endpgfscope
-		\fi
+    \pgfpathmoveto{\pgfpoint
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf at circ@res at left}
+    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}
+    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+    \pgfusepath{draw}
 
-		\ifpgf at circuit@bpt at drawgate			
-			\pgfpathmoveto{\pgfpoint
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf at circ@res at left}
-				{\pgf at circ@res at up+\pgf at circ@res at down}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf at circ@res at up+\pgf at circ@res at down}}
-			\pgfusepath{draw}
-		\fi
+    \pgfscope
+        \pgfpathmoveto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base height}\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base height}\pgf at circ@res at down}}
+        \pgfpathmoveto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf at circ@res at down}}
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
+        \pgfusepath{draw}
+    \endpgfscope
+    \ifpgf at circuit@mos at arrows
+        \pgfscope
+            \pgfslopedattimetrue
+            \pgfallowupsidedownattimetrue
+            \pgfresetnontranslationattimefalse
+            \pgftransformlineattime{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/arrow pos}}{%
+                \pgfpoint%
+                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf at circ@res at left}%
+                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf at circ@res at down}%
+                }{%
+                \pgfpoint
+                {\pgf at circ@res at right}%
+                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf at circ@res at down}%
+            }
+            \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+        \endpgfscope
+    \fi
+
+    \ifpgf at circuit@bpt at drawgate
+        \pgfpathmoveto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf at circ@res at left}
+        {\pgf at circ@res at up+\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf at circ@res at up+\pgf at circ@res at down}}
+        \pgfusepath{draw}
+    \fi
 }
 
 
 \pgfcircdeclaretransistor{pmos}{}{%
-			\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf at circ@res at up}}
-			\pgfpathlineto{\pgfpoint
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf at circ@res at left}
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf at circ@res at up}}
-			\pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}
+    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf at circ@res at left}
+    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf at circ@res at up}}
+    \pgfusepath{draw}
 
-		\ifpgf at circuit@mos at arrows
-			\pgfscope             
-			\pgfslopedattimetrue 
-			\pgfallowupsidedownattimetrue
-			\pgfresetnontranslationattimefalse
-			\pgftransformlineattime{.4}{%
-				\pgfpoint%
-					{\pgf at circ@res at right}%
-					{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf at circ@res at up}%
-			}{%
-				\pgfpoint
-					{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf at circ@res at left}%
-					{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf at circ@res at up}%
-			}
-			\pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
-			\endpgfscope
-		\fi
+    \ifpgf at circuit@mos at arrows
+        \pgfscope
+            \pgfslopedattimetrue
+            \pgfallowupsidedownattimetrue
+            \pgfresetnontranslationattimefalse
+            \pgftransformlineattime{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/arrow pos}}{%
+                \pgfpoint%
+                {\pgf at circ@res at right}%
+                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf at circ@res at up}%
+                }{%
+                \pgfpoint
+                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf at circ@res at left}%
+                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf at circ@res at up}%
+            }
+            \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+        \endpgfscope
+    \fi
 
-			\pgfscope
-			\pgfpathmoveto{\pgfpoint
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf at circ@res at left}
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base height}\pgf at circ@res at up}}
-			\pgfpathlineto{\pgfpoint
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf at circ@res at left}
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base height}\pgf at circ@res at down}}
-			\pgfpathmoveto{\pgfpoint
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf at circ@res at left}
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf at circ@res at up}}
-			\pgfpathlineto{\pgfpoint
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf at circ@res at left}
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf at circ@res at down}}
-			\pgfsetlinewidth{2\pgflinewidth}
-			\pgfusepath{draw}
-			\endpgfscope
-			
-			\pgfpathmoveto{\pgfpoint
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf at circ@res at left}
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf at circ@res at down}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf at circ@res at down}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}		
+    \pgfscope
+        \pgfpathmoveto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base height}\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base height}\pgf at circ@res at down}}
+        \pgfpathmoveto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf at circ@res at down}}
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
+        \pgfusepath{draw}
+    \endpgfscope
 
+    \pgfpathmoveto{\pgfpoint
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf at circ@res at left}
+    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}
+    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
 
-			\pgfusepath{draw}		
-			\ifpgf at circuit@bpt at drawgate
-				\pgfpathmoveto{\pgfpoint
-					{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf at circ@res at left}
-					{\pgf at circ@res at up+\pgf at circ@res at down}}
-				\pgfpathlineto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf at circ@res at up+\pgf at circ@res at down}}
-				\pgfusepath{draw}
-			\fi
-			\pgfpathcircle{\pgfpoint
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf at circ@res at left - \pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf at circ@Rlen}
-				{\pgf at circ@res at up+\pgf at circ@res at down}}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf at circ@Rlen}
-			\ifpgf at circuit@pmos at emptycircle
-				\pgfsetfillcolor{white}
-			\fi
-			\pgfusepath{draw,fill}		
+
+    \pgfusepath{draw}
+    \ifpgf at circuit@bpt at drawgate
+        \pgfpathmoveto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf at circ@res at left}
+        {\pgf at circ@res at up+\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf at circ@res at up+\pgf at circ@res at down}}
+        \pgfusepath{draw}
+    \fi
+    \pgfpathcircle{\pgfpoint
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf at circ@res at left - \pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf at circ@Rlen}
+    {\pgf at circ@res at up+\pgf at circ@res at down}}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf at circ@Rlen}
+    \ifpgf at circuit@pmos at emptycircle
+        \pgfsetfillcolor{white}
+    \fi
+    \pgfusepath{draw,fill}
 }
 
+%% HEMT FET Transistor
+\pgfcircdeclaretransistor{hemt}{}{%
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}
+    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/gate height}\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/base width}\pgf at circ@res at left}
+    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/gate height}\pgf at circ@res at up}}
+
+    \pgfpathmoveto{\pgfpoint
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/base width}\pgf at circ@res at left}
+    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/gate height}\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}
+    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/gate height}\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+    \pgfusepath{draw}
+
+    \pgfscope
+        \pgfpathmoveto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/base width}\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/base height}\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/base width}\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/base height}\pgf at circ@res at down}}
+        \pgfsetlinewidth{2\pgflinewidth}
+        \pgfusepath{draw}
+    \endpgfscope
+
+    \pgfpathmoveto{\pgfpoint
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/base width}\pgf at circ@res at left}
+    {\pgf at circ@res at up+\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf at circ@res at up+\pgf at circ@res at down}}
+    \pgfusepath{draw}
+}
+
 \long\def\drawfetcore#1{
-	\pgftransformationadjustments
-		%top connection
-      \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
-      \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}
-        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf at circ@res at up}}
-      \pgfpathlineto{\pgfpoint
+    \pgftransformationadjustments
+    %top connection
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}
+    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint
         {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
-        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf at circ@res at up}}
-		\pgfusepath{draw}
-		\pgfscope
-      \pgfpathmoveto{\pgfpoint
-        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
+    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf at circ@res at up}}
+    \pgfusepath{draw}
+    \pgfscope
+        \pgfpathmoveto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
         {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf at circ@res at up}}
-		\ifpgf at circuit@trans at depletiontype
-		      \pgfpathlineto{\pgfpoint
-		        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
-		        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf at circ@res at down}}
-		\else
+        \ifpgf at circuit@trans at depletiontype
+            \pgfpathlineto{\pgfpoint
+                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf at circ@res at down}}
+        \else
 
-      \pgfpathlineto{\pgfpoint
-        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
-        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf at circ@res at up*0.45}}
-      \pgfpathmoveto{\pgfpoint
-        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
-        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf at circ@res at up*0.25}}
-      \pgfpathlineto{\pgfpoint
-        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
-        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf at circ@res at down*0.25}}
-      \pgfpathmoveto{\pgfpoint
-        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
-        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base height}\pgf at circ@res at down*0.45}}
-      \pgfpathlineto{\pgfpoint
-        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
-        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf at circ@res at down}}
+            \pgfpathlineto{\pgfpoint
+                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf at circ@res at up*0.45}}
+            \pgfpathmoveto{\pgfpoint
+                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf at circ@res at up*0.25}}
+            \pgfpathlineto{\pgfpoint
+                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf at circ@res at down*0.25}}
+            \pgfpathmoveto{\pgfpoint
+                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base height}\pgf at circ@res at down*0.45}}
+            \pgfpathlineto{\pgfpoint
+                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf at circ@res at down}}
         \fi
-      \pgfsetlinewidth{2\pgflinewidth}
-		\pgfusepath{draw}
-		\endpgfscope
-		%Bulk connection line
-      \pgfpathmoveto{\pgfpoint
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
+        \pgfusepath{draw}
+    \endpgfscope
+    %Bulk connection line
+    \pgfpathmoveto{\pgfpoint
         {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
-        {\pgf at circ@res at up+\pgf at circ@res at down}}
-      \pgfpathlineto{\pgfpoint{\pgf at circ@res at right+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
-        {\pgf at circ@res at up+\pgf at circ@res at down}}
-      
-      %bottom connection
-      \pgfpathmoveto{\pgfpoint
+    {\pgf at circ@res at up+\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
+    {\pgf at circ@res at up+\pgf at circ@res at down}}
+
+    %bottom connection
+    \pgfpathmoveto{\pgfpoint
         {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}
-        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf at circ@res at down}}
-      \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}
-       {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf at circ@res at down}}
-      \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}    
-      \pgfusepath{draw}
-     
-     %draw thick gate line 
+    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}
+    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+    \pgfusepath{draw}
+
+    %draw thick gate line
     \pgfscope
-    \pgfpathmoveto{\pgfpoint
-      {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf at circ@res at left}
-      {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf at circ@res at up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
-    \pgfpathlineto{\pgfpoint
-      {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf at circ@res at left}
-      {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf at circ@res at down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
-    \pgfsetlinewidth{2\pgflinewidth}
-    \pgfusepath{draw}
+        \pgfpathmoveto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf at circ@res at up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+        \pgfpathlineto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf at circ@res at down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
+        \pgfusepath{draw}
     \endpgfscope
-    
-      \pgfscope
-          \pgfslopedattimetrue 
-          \pgfallowupsidedownattimetrue
-          \pgfresetnontranslationattimefalse
-          
-          \pgftransformlineattime{.6}{%
+
+    \pgfscope
+        \pgfslopedattimetrue
+        \pgfallowupsidedownattimetrue
+        \pgfresetnontranslationattimefalse
+
+        \pgftransformlineattime{.6}{%
             \pgfpoint
-              {\pgf at circ@res at right}%
-              {\pgf at circ@res at up+\pgf at circ@res at down}%
-          }{%
+            {\pgf at circ@res at right}%
+            {\pgf at circ@res at up+\pgf at circ@res at down}%
+            }{%
             \pgfpoint%
-              {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}%
-              {\pgf at circ@res at up+\pgf at circ@res at down}%
-          }
-          	  \ifpgf at circuit@trans at ntype
-          	  \else
-          	  \pgftransformrotate{180}
-          	  \fi
-          \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
-          \endpgfscope
-      
-      	% GATE CONNECTION
-      	\ifpgf at circuit@bpt at drawgate
-			\ifpgf at circuit@trans at ntype
-		      	\pgfpathmoveto{\pgfpoint
-		      		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf at circ@res at left}
-		      		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf at circ@res at down}}
-		      	\pgfpathlineto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf at circ@res at down}}
-	      	\else
-		      	\pgfpathmoveto{\pgfpoint
-		      		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf at circ@res at left}
-		      		{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf at circ@res at down}}
-		      	\pgfpathlineto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf at circ@res at down}}      	
-	      	\fi
-      	\pgfusepath{draw}
-      	\fi
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf at circ@res at left}%
+            {\pgf at circ@res at up+\pgf at circ@res at down}%
+        }
+        \ifpgf at circuit@trans at ntype
+    \else
+        \pgftransformrotate{180}
+    \fi
+    \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+\endpgfscope
 
+% GATE CONNECTION
+\ifpgf at circuit@bpt at drawgate
+    \ifpgf at circuit@trans at ntype
+        \pgfpathmoveto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf at circ@res at down}}
+    \else
+        \pgfpathmoveto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf at circ@res at left}
+        {-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf at circ@res at down}}
+    \fi
+    \pgfusepath{draw}
+\fi
+
 }
 
 \long\def\pgfdeclaretransistorwrapperaddbulk#1#2#3
 {\pgfcircdeclaretransistor{#1}{
-	\anchor{bulk}{\left\pgf at x=0pt}
- 	\anchor{B}{\left\pgf at x=0pt}%override Base anchor from npn&igbt
-	 #2
-	 }
-	 {#3}
+        \anchor{bulk}{\left\pgf at x=0pt}
+        \anchor{B}{\left\pgf at x=0pt}%override Base anchor from npn&igbt
+        #2
+    }
+    {#3}
 }
 
 
@@ -1636,28 +1801,28 @@
 
 
 \pgfdeclaretransistorwrapperaddbulk{pfet}{}{%
-	\pgf at circuit@trans at depletiontypefalse
-	\drawfetcore{pfet}
+    \pgf at circuit@trans at depletiontypefalse
+    \drawfetcore{pfet}
 }
 
 % N-CHANNEL IGFET ENHANCEMENT TYPE
-\pgfdeclaretransistorwrapperaddbulk{nigfete}{}{%	
-	\pgf at circuit@trans at depletiontypefalse
-	\drawfetcore{nigfete}
-	     
-      % SOURCE CONNECTION
-      \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
-      \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}    
-      \pgfusepath{draw}
-      
-      % SOLDER DOT at source-bulk connection
-      \ifpgf at circuit@fet at solderdot
-      \pgfscope
-        \pgftransformshift{\pgfpoint{\pgf at circ@res at right}{
-          \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf at circ@res at down}}
-        \pgfnode{circ}{center}{}{}{}
-      \endpgfscope{}
-      \fi
+\pgfdeclaretransistorwrapperaddbulk{nigfete}{}{%
+    \pgf at circuit@trans at depletiontypefalse
+    \drawfetcore{nigfete}
+
+    % SOURCE CONNECTION
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \pgfusepath{draw}
+
+    % SOLDER DOT at source-bulk connection
+    \ifpgf at circuit@fet at solderdot
+        \pgfscope
+            \pgftransformshift{\pgfpoint{\pgf at circ@res at right}{
+            \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf at circ@res at down}}
+            \pgfnode{circ}{center}{}{}{}
+    \endpgfscope{}
+\fi
 }
 
 
@@ -1665,16 +1830,16 @@
 
 % N-CHANNEL IGFET ENHANCEMENT TYPE with Bulk connector
 \pgfdeclaretransistorwrapperaddbulk{nigfetebulk}{}{%
-	\pgf at circuit@trans at depletiontypefalse
-	\drawfetcore{nigfetebulk}
+    \pgf at circuit@trans at depletiontypefalse
+    \drawfetcore{nigfetebulk}
     % SOLDER DOT at source-bulk connection
-      \ifpgf at circuit@fet at solderdot
-      \pgfscope
-        \pgftransformshift{\pgfpoint{\pgf at circ@res at right}{
-          \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate height}\pgf at circ@res at down}}
-        \pgfnode{circ}{center}{}{}{}
-      \endpgfscope{}
-      \fi
+    \ifpgf at circuit@fet at solderdot
+        \pgfscope
+            \pgftransformshift{\pgfpoint{\pgf at circ@res at right}{
+            \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate height}\pgf at circ@res at down}}
+            \pgfnode{circ}{center}{}{}{}
+        \endpgfscope{}
+    \fi
 }
 
 
@@ -1681,281 +1846,269 @@
 
 % N-CHANNEL IGFET DEPLETION TYPE
 \pgfdeclaretransistorwrapperaddbulk{nigfetd}{}{%
-	\pgf at circuit@trans at depletiontypetrue
-	\drawfetcore{nigfetd}
+    \pgf at circuit@trans at depletiontypetrue
+    \drawfetcore{nigfetd}
 
-      % SOURCE CONNECTION
-      \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
-      \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}    
-      \pgfusepath{draw}
-             
-      % SOLDER DOT at source-bulk connection
-      \ifpgf at circuit@fet at solderdot
-      \pgfscope
-        \pgftransformshift{\pgfpoint{\pgf at circ@res at right}{
-          \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf at circ@res at down}}
-        \pgfnode{circ}{center}{}{}{}
-      \endpgfscope{}
-      \fi
+    % SOURCE CONNECTION
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+    \pgfusepath{draw}
+
+    % SOLDER DOT at source-bulk connection
+    \ifpgf at circuit@fet at solderdot
+        \pgfscope
+            \pgftransformshift{\pgfpoint{\pgf at circ@res at right}{
+            \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf at circ@res at down}}
+            \pgfnode{circ}{center}{}{}{}
+        \endpgfscope{}
+    \fi
 }
 
 % P-CHANNEL IGFET ENHANCEMENT TYPE
 \pgfdeclaretransistorwrapperaddbulk{pigfete}{}{%
-	\pgf at circuit@trans at depletiontypefalse
-	\drawfetcore{pigfete}
-      \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
-    
-      % SOURCE CONNECTION
-      \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
-      \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}    
-      \pgfusepath{draw}
-      
-      
-      % SOLDER DOT at source-bulk connection
-      \ifpgf at circuit@fet at solderdot
-      \pgfscope
-        \pgftransformshift{\pgfpoint{\pgf at circ@res at right}{
-          \pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate height}\pgf at circ@res at up}}
-        \pgfnode{circ}{center}{}{}{}
-      \endpgfscope
-      \fi
+    \pgf at circuit@trans at depletiontypefalse
+    \drawfetcore{pigfete}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+
+    % SOURCE CONNECTION
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfusepath{draw}
+
+
+    % SOLDER DOT at source-bulk connection
+    \ifpgf at circuit@fet at solderdot
+        \pgfscope
+            \pgftransformshift{\pgfpoint{\pgf at circ@res at right}{
+            \pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate height}\pgf at circ@res at up}}
+            \pgfnode{circ}{center}{}{}{}
+        \endpgfscope
+    \fi
 }
 
 % P-CHANNEL IGFET ENHANCEMENT TYPE with bulk connector
 \pgfdeclaretransistorwrapperaddbulk{pigfetebulk}{}{%
-	\pgf at circuit@trans at depletiontypefalse
-	\drawfetcore{pigfetebulk}
+    \pgf at circuit@trans at depletiontypefalse
+    \drawfetcore{pigfetebulk}
 }
 
 
 % P-CHANNEL IGFET DEPLETION TYPE
 \pgfdeclaretransistorwrapperaddbulk{pigfetd}{}{%
-	\pgf at circuit@trans at depletiontypetrue
-	\drawfetcore{pigfetd}
-  
-      % SOURCE CONNECTION
-      \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
-      \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}    
-      \pgfusepath{draw}
-      
-            
-      % SOLDER DOT at source-bulk connection
-      \ifpgf at circuit@fet at solderdot
-      \pgfscope
-        \pgftransformshift{\pgfpoint{\pgf at circ@res at right}{
-          \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf at circ@res at up}}
-        \pgfnode{circ}{center}{}{}{}
-      \endpgfscope{}
-      \fi
+    \pgf at circuit@trans at depletiontypetrue
+    \drawfetcore{pigfetd}
+
+    % SOURCE CONNECTION
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfusepath{draw}
+
+
+    % SOLDER DOT at source-bulk connection
+    \ifpgf at circuit@fet at solderdot
+        \pgfscope
+            \pgftransformshift{\pgfpoint{\pgf at circ@res at right}{
+            \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf at circ@res at up}}
+            \pgfnode{circ}{center}{}{}{}
+        \endpgfscope{}
+    \fi
 }
 
 \pgfcircdeclaretransistor{njfet}{}{%
-			\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf at circ@res at up}}
-			\pgfpathlineto{\pgfpoint
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf at circ@res at left}
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf at circ@res at up}}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}
+    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf at circ@res at left}
+    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf at circ@res at up}}
 
-			\pgfpathmoveto{\pgfpoint
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf at circ@res at left}
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf at circ@res at down}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf at circ@res at down}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}		
-			\pgfusepath{draw}
-			
-			\pgfscope
-			\pgfpathmoveto{\pgfpoint
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf at circ@res at left}
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height}\pgf at circ@res at up}}
-			\pgfpathlineto{\pgfpoint
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf at circ@res at left}
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height}\pgf at circ@res at down}}
-			\pgfsetlinewidth{2\pgflinewidth}
-			\pgfusepath{draw}
-			\endpgfscope
-			
-			\pgfscope             
-			\pgfslopedattimetrue 
-			\pgfallowupsidedownattimetrue
-			\pgfresetnontranslationattimefalse
-			\pgftransformlineattime{.6}{%
-				\pgfpoint{\pgf at circ@res at left}%
-					{\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf at circ@res at down}%
-			}{%
-				\pgfpoint
-					{\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf at circ@res at left}%
-					{\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf at circ@res at down}%
-			}
-			\pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
-			\endpgfscope
-	
-			\pgfpathmoveto{\pgfpoint
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf at circ@res at left}
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf at circ@res at down}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf at circ@res at down}}
-			\pgfusepath{draw}
+    \pgfpathmoveto{\pgfpoint
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf at circ@res at left}
+    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}
+    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+    \pgfusepath{draw}
+
+    \pgfscope
+        \pgfpathmoveto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height}\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height}\pgf at circ@res at down}}
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
+        \pgfusepath{draw}
+    \endpgfscope
+
+    \pgfscope
+        \pgfslopedattimetrue
+        \pgfallowupsidedownattimetrue
+        \pgfresetnontranslationattimefalse
+        \pgftransformlineattime{.6}{%
+            \pgfpoint{\pgf at circ@res at left}%
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf at circ@res at down}%
+            }{%
+            \pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf at circ@res at left}%
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf at circ@res at down}%
+        }
+        \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+    \endpgfscope
+
+    \pgfpathmoveto{\pgfpoint
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf at circ@res at left}
+    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
+    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf at circ@res at down}}
+    \pgfusepath{draw}
 }
 
 
 \pgfcircdeclaretransistor{pjfet}{}{%
-			\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf at circ@res at up}}
-			\pgfpathlineto{\pgfpoint
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf at circ@res at left}
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf at circ@res at up}}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}
+    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf at circ@res at left}
+    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf at circ@res at up}}
 
-			\pgfpathmoveto{\pgfpoint
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf at circ@res at left}
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf at circ@res at down}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf at circ@res at down}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}		
-			\pgfusepath{draw}
-			
-			\pgfscope
-			\pgfpathmoveto{\pgfpoint
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf at circ@res at left}
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height}\pgf at circ@res at up}}
-			\pgfpathlineto{\pgfpoint
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf at circ@res at left}
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height}\pgf at circ@res at down}}
-			\pgfsetlinewidth{2\pgflinewidth}
-			\pgfusepath{draw}
-			\endpgfscope
-			
-			\pgfscope             
-			\pgfslopedattimetrue 
-			\pgfallowupsidedownattimetrue
-			\pgfresetnontranslationattimefalse
-			\pgftransformlineattime{.4}{%
-				\pgfpoint%
-					{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf at circ@res at left}%
-					{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf at circ@res at up}%
-			}{%
-				\pgfpoint{\pgf at circ@res at left}%
-					{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf at circ@res at up}%
-			}
-			\pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
-			\endpgfscope
+    \pgfpathmoveto{\pgfpoint
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf at circ@res at left}
+    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}
+    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+    \pgfusepath{draw}
 
-					
-			\pgfpathmoveto{\pgfpoint
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf at circ@res at left}
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf at circ@res at up}}
-			\pgfpathlineto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
-				{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf at circ@res at up}}
-			\pgfusepath{draw}
+    \pgfscope
+        \pgfpathmoveto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height}\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height}\pgf at circ@res at down}}
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
+        \pgfusepath{draw}
+    \endpgfscope
+
+    \pgfscope
+        \pgfslopedattimetrue
+        \pgfallowupsidedownattimetrue
+        \pgfresetnontranslationattimefalse
+        \pgftransformlineattime{.4}{%
+            \pgfpoint%
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf at circ@res at left}%
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf at circ@res at up}%
+            }{%
+            \pgfpoint{\pgf at circ@res at left}%
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf at circ@res at up}%
+        }
+        \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+    \endpgfscope
+
+
+    \pgfpathmoveto{\pgfpoint
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf at circ@res at left}
+    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
+    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf at circ@res at up}}
+    \pgfusepath{draw}
 }
 
 
 \pgfdeclaretransistorwrapperaddbulk{isfet}{}{%
-      \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
-      % DRAIN CONNECTION 
-      \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}
-        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf at circ@res at up}}
-      % DRAIN
-      \pgfpathlineto{\pgfpoint
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+    % DRAIN CONNECTION
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}
+    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf at circ@res at up}}
+    % DRAIN
+    \pgfpathlineto{\pgfpoint
         {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf at circ@res at left}
-        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf at circ@res at up}}
-      \pgfusepath{draw}
-      
-      % GATE, DEPLETION TYPE
-      \pgfscope %% added
-      \pgfpathmoveto{\pgfpoint
-        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf at circ@res at left}
+    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf at circ@res at up}}
+    \pgfusepath{draw}
+
+    % GATE, DEPLETION TYPE
+    \pgfscope %% added
+        \pgfpathmoveto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf at circ@res at left}
         {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base height}\pgf at circ@res at up}}
-      \pgfpathlineto{\pgfpoint
-        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf at circ@res at left}
+        \pgfpathlineto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf at circ@res at left}
         {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base height}\pgf at circ@res at down}}
-      \pgfsetlinewidth{2\pgflinewidth} %% added
-      \pgfusepath{draw} %% added
-      \endpgfscope %% added
-      
-      % BULK
-      \pgfpathmoveto{\pgfpoint
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth} %% added
+        \pgfusepath{draw} %% added
+    \endpgfscope %% added
+
+    % BULK
+    \pgfpathmoveto{\pgfpoint
         {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf at circ@res at left}
-        {\pgf at circ@res at up+\pgf at circ@res at down}}
-       \pgfpathlineto{\pgfpoint{\pgf at circ@res at right+.5\pgflinewidth}
-         {\pgf at circ@res at up+\pgf at circ@res at down}}
+    {\pgf at circ@res at up+\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right+.5\pgflinewidth}
+    {\pgf at circ@res at up+\pgf at circ@res at down}}
 
-      % SOURCE
-      \pgfpathmoveto{\pgfpoint
+    % SOURCE
+    \pgfpathmoveto{\pgfpoint
         {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf at circ@res at left}
-        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf at circ@res at down}}
-      \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}
-         {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf at circ@res at down}}
-      % SOURCE CONNECTION
-      \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
-      \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}    
-      \pgfusepath{draw}
-      
-      % GATE
-      %\pgfscope
-      %\pgfpathmoveto{\pgfpoint
-       % {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate width}\pgf at circ@res at left}
-       % {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf at circ@res at up}}
-      %\pgfpathlineto{\pgfpoint
-       % {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate width}\pgf at circ@res at left}
-       % {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf at circ@res at down}}
-      %\pgfsetlinewidth{2\pgflinewidth}
-      %\pgfusepath{draw}
-      %\endpgfscope
-      
-            
-      % SOLDER DOT at source-bulk connection
-      \ifpgf at circuit@fet at solderdot
-	      \pgfscope
-	        \pgftransformshift{\pgfpoint{\pgf at circ@res at right}{
-	          \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf at circ@res at down}}
-	        \pgfnode{circ}{center}{}{}{}
-	      \endpgfscope{}
-      \fi
-      % ARROW
-      \pgfscope
-      \pgfslopedattimetrue 
-      \pgfallowupsidedownattimetrue
-      \pgfresetnontranslationattimefalse
-      \pgftransformlineattime{.6}{%
-        \pgfpoint
-          {\pgf at circ@res at right}%
-          {\pgf at circ@res at up+\pgf at circ@res at down}%
-      }{%
-        \pgfpoint%
-          {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf at circ@res at left}%
-          {\pgf at circ@res at up+\pgf at circ@res at down}%
-      }
-      \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
-      \endpgfscope
-      \pgfusepath{draw}
-      
-      % Wavy lines
-      	\pgfscope
-			\pgfpathmoveto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves x sep}\pgf at circ@res at up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves y sep}\pgf at circ@res at up}}
-			\pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf at circ@res at up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf at circ@res at up}}
-			\pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf at circ@res at up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf at circ@res at up}}
-			\pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf at circ@res at up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf at circ@res at up}}
-			\pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf at circ@res at up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf at circ@res at up}}
-			\pgfusepath{draw}
+    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}
+    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf at circ@res at down}}
+    % SOURCE CONNECTION
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+    \pgfusepath{draw}
 
-			\pgfpathmoveto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves x sep}\pgf at circ@res at up}{0cm}}
-			\pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf at circ@res at up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf at circ@res at up}}
-			\pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf at circ@res at up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf at circ@res at up}}
-			\pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf at circ@res at up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf at circ@res at up}}
-			\pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf at circ@res at up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf at circ@res at up}}
-			\pgfusepath{draw}
 
-			\pgfpathmoveto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves x sep}\pgf at circ@res at up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves y sep}\pgf at circ@res at up}}
-			\pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf at circ@res at up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf at circ@res at up}}
-			\pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf at circ@res at up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf at circ@res at up}}
-			\pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf at circ@res at up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf at circ@res at up}}
-			\pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf at circ@res at up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf at circ@res at up}}
-			\pgfusepath{draw}
-		\endpgfscope
+    % SOLDER DOT at source-bulk connection
+    \ifpgf at circuit@fet at solderdot
+        \pgfscope
+            \pgftransformshift{\pgfpoint{\pgf at circ@res at right}{
+            \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf at circ@res at down}}
+            \pgfnode{circ}{center}{}{}{}
+        \endpgfscope{}
+    \fi
+    % ARROW
+    \pgfscope
+        \pgfslopedattimetrue
+        \pgfallowupsidedownattimetrue
+        \pgfresetnontranslationattimefalse
+        \pgftransformlineattime{.6}{%
+            \pgfpoint
+            {\pgf at circ@res at right}%
+            {\pgf at circ@res at up+\pgf at circ@res at down}%
+            }{%
+            \pgfpoint%
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf at circ@res at left}%
+            {\pgf at circ@res at up+\pgf at circ@res at down}%
+        }
+        \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+    \endpgfscope
+    \pgfusepath{draw}
 
+    % Wavy lines
+    \pgfscope
+        \pgfpathmoveto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves x sep}\pgf at circ@res at up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves y sep}\pgf at circ@res at up}}
+        \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf at circ@res at up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf at circ@res at up}}
+        \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf at circ@res at up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf at circ@res at up}}
+        \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf at circ@res at up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf at circ@res at up}}
+        \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf at circ@res at up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf at circ@res at up}}
+        \pgfusepath{draw}
+
+        \pgfpathmoveto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves x sep}\pgf at circ@res at up}{0cm}}
+        \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf at circ@res at up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf at circ@res at up}}
+        \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf at circ@res at up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf at circ@res at up}}
+        \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf at circ@res at up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf at circ@res at up}}
+        \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf at circ@res at up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf at circ@res at up}}
+        \pgfusepath{draw}
+
+        \pgfpathmoveto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves x sep}\pgf at circ@res at up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves y sep}\pgf at circ@res at up}}
+        \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf at circ@res at up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf at circ@res at up}}
+        \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf at circ@res at up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf at circ@res at up}}
+        \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf at circ@res at up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf at circ@res at up}}
+        \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf at circ@res at up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf at circ@res at up}}
+        \pgfusepath{draw}
+    \endpgfscope
+
 }
 
 
@@ -1976,45 +2129,49 @@
 		\northeast
 		\pgf at y=0cm
 	}
-}{\ctikzvalof{tripoles/thyristor/height 2}}{fullthyristor}{\ctikzvalof{tripoles/thyristor/height}}{\ctikzvalof{tripoles/thyristor/width}}{
+}
+{\ctikzvalof{tripoles/thyristor/height 2}}
+{fullthyristor}{\ctikzvalof{tripoles/thyristor/height}}
+{\ctikzvalof{tripoles/thyristor/width}}
+{
 
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
 
-	\pgf at circ@res at other = \ctikzvalof{tripoles/thyristor/diode width left}\pgf at circ@res at left
-	\pgf at circ@res at step = \ctikzvalof{tripoles/thyristor/diode width right}\pgf at circ@res at right
+    \pgf at circ@res at other = \ctikzvalof{tripoles/thyristor/diode width left}\pgf at circ@res at left
+    \pgf at circ@res at step = \ctikzvalof{tripoles/thyristor/diode width right}\pgf at circ@res at right
 
-	\pgfscope
-		\pgftransformxshift{\pgf at circ@res at other}
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at step-\pgf at circ@res at other}{0pt}}
-				
-		\pgfpathlineto{\pgfpoint{0pt}{-\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}} 
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at step-\pgf at circ@res at other}{0pt}}
-		\pgfusepath{draw,fill}
-		
-		\pgfsetlinewidth{\pgfstartlinewidth}
-		
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at step-\pgf at circ@res at other}{0pt}}
-		\pgfpathlineto{\pgfpoint{2*\pgf at circ@res at step-2*\pgf at circ@res at other}{\ctikzvalof{tripoles/thyristor/diode height}\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{2*\pgf at circ@res at step-2*\pgf at circ@res at other}{\pgf at circ@res at up}}
-		\pgfusepath{draw}
-	\endpgfscope
-	
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{-\pgf at circ@res at down}}
-	
-	\pgfusepath{draw}
-	
-	\pgfsetlinewidth{\pgfstartlinewidth}
-	
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{0pt}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{0pt}}
-	
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
-	
-	\pgfusepath{draw}
-	
+    \pgfscope
+        \pgftransformxshift{\pgf at circ@res at other}
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step-\pgf at circ@res at other}{0pt}}
+
+        \pgfpathlineto{\pgfpoint{0pt}{-\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at step-\pgf at circ@res at other}{0pt}}
+        \pgfusepath{draw,fill}
+
+        \pgfsetlinewidth{\pgfstartlinewidth}
+
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step-\pgf at circ@res at other}{0pt}}
+        \pgfpathlineto{\pgfpoint{2*\pgf at circ@res at step-2*\pgf at circ@res at other}{\ctikzvalof{tripoles/thyristor/diode height}\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{2*\pgf at circ@res at step-2*\pgf at circ@res at other}{\pgf at circ@res at up}}
+        \pgfusepath{draw}
+    \endpgfscope
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{-\pgf at circ@res at down}}
+
+    \pgfusepath{draw}
+
+    \pgfsetlinewidth{\pgfstartlinewidth}
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{0pt}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+
+    \pgfusepath{draw}
+
 }
 
 %% Empty thyristor
@@ -2034,45 +2191,58 @@
 		\northeast
 		\pgf at y=0cm
 	}
-}{\ctikzvalof{tripoles/thyristor/height 2}}{emptythyristor}{\ctikzvalof{tripoles/thyristor/height}}{\ctikzvalof{tripoles/thyristor/width}}{
+}
+{\ctikzvalof{tripoles/thyristor/height 2}}
+{emptythyristor}{\ctikzvalof{tripoles/thyristor/height}}
+{\ctikzvalof{tripoles/thyristor/width}}
+{
 
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
 
-	\pgf at circ@res at other = \ctikzvalof{tripoles/thyristor/diode width left}\pgf at circ@res at left
-	\pgf at circ@res at step = \ctikzvalof{tripoles/thyristor/diode width right}\pgf at circ@res at right
+    \pgf at circ@res at other = \ctikzvalof{tripoles/thyristor/diode width left}\pgf at circ@res at left
+    \pgf at circ@res at step = \ctikzvalof{tripoles/thyristor/diode width right}\pgf at circ@res at right
 
-	\pgfscope
-		\pgftransformxshift{\pgf at circ@res at other}
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at step-\pgf at circ@res at other}{0pt}}
-				
-		\pgfpathlineto{\pgfpoint{0pt}{-\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}} 
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at step-\pgf at circ@res at other}{0pt}}
-		\pgfusepath{draw}
-		
-		\pgfsetlinewidth{\pgfstartlinewidth}
-		
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at step-\pgf at circ@res at other}{0pt}}
-		\pgfpathlineto{\pgfpoint{2*\pgf at circ@res at step-2*\pgf at circ@res at other}{\ctikzvalof{tripoles/thyristor/diode height}\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{2*\pgf at circ@res at step-2*\pgf at circ@res at other}{\pgf at circ@res at up}}
-		\pgfusepath{draw}
-	\endpgfscope
-	
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{-\pgf at circ@res at down}}
-	
-	\pgfusepath{draw}
-	
-	\pgfsetlinewidth{\pgfstartlinewidth}
-	
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{0pt}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{0pt}}
-	
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
-	
-	\pgfusepath{draw}
-	
+    \pgfscope
+        \pgftransformxshift{\pgf at circ@res at other}
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step-\pgf at circ@res at other}{0pt}}
+
+        \pgfpathlineto{\pgfpoint{0pt}{-\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
+        \pgfpathclose
+        \pgf at circ@draworfill
+        \pgfscope
+            % to allow filling, we need to draw explicitily the stroke here.
+            \pgfsetlinewidth{\pgfstartlinewidth}
+            \ifpgf at circuit@bipole at strokedsymbol
+                \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step-\pgf at circ@res at other}{0pt}}
+                \pgfpathlineto{\pgfpoint{0pt}{0pt}}
+                \pgfusepath{draw}
+            \fi
+        \endpgfscope
+
+        \pgfsetlinewidth{\pgfstartlinewidth}
+
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step-\pgf at circ@res at other}{0pt}}
+        \pgfpathlineto{\pgfpoint{2*\pgf at circ@res at step-2*\pgf at circ@res at other}{\ctikzvalof{tripoles/thyristor/diode height}\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{2*\pgf at circ@res at step-2*\pgf at circ@res at other}{\pgf at circ@res at up}}
+        \pgfusepath{draw}
+    \endpgfscope
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{-\pgf at circ@res at down}}
+
+    \pgfusepath{draw}
+
+    \pgfsetlinewidth{\pgfstartlinewidth}
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{0pt}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+
+    \pgfusepath{draw}
+
 }
 
 %% Empty triac
@@ -2092,42 +2262,47 @@
 		\northeast
 		\pgf at y=0cm
 	}
-}{\ctikzvalof{tripoles/triac/height}}{emptytriac}{\ctikzvalof{tripoles/triac/height}}{\ctikzvalof{tripoles/triac/width}}{
+}
+{\ctikzvalof{tripoles/triac/height}}
+{emptytriac}
+{\ctikzvalof{tripoles/triac/height}}
+{\ctikzvalof{tripoles/triac/width}}
+{
 
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
 
-	\pgf at circ@res at other = \ctikzvalof{tripoles/triac/diode width left}\pgf at circ@res at left
-	\pgf at circ@res at step = \ctikzvalof{tripoles/triac/diode width right}\pgf at circ@res at right
+    \pgf at circ@res at other = \ctikzvalof{tripoles/triac/diode width left}\pgf at circ@res at left
+    \pgf at circ@res at step = \ctikzvalof{tripoles/triac/diode width right}\pgf at circ@res at right
 
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{0pt}}
-	\pgfpathlineto{\pgfpoint{0.95\pgf at circ@res at step}{0.707*(\pgf at circ@res at other-\pgf at circ@res at step)}} % sqrt(1/2)
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{1.414*(\pgf at circ@res at other-\pgf at circ@res at step)}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{-1.414*(\pgf at circ@res at other-\pgf at circ@res at step)}}
-	
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
-	\pgfpathlineto{\pgfpoint{0.95\pgf at circ@res at other}{-0.707*(\pgf at circ@res at other-\pgf at circ@res at step)}} % sqrt(1/2)
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{-1.414*(\pgf at circ@res at other-\pgf at circ@res at step)}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{1.414*(\pgf at circ@res at other-\pgf at circ@res at step)}}
-	
-	\pgfusepath{draw}
-	
-	\pgfsetlinewidth{\pgfstartlinewidth}
-	
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{-0.707*(\pgf at circ@res at other-\pgf at circ@res at step)}} % sqrt(1/2)
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{-1.414*(\pgf at circ@res at other-\pgf at circ@res at step)}} % sqrt(1/2)
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}} % sqrt(1/2)
-	
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{0pt}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{0pt}}
-	
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
-	
-	\pgfusepath{draw}
-	
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{0pt}}
+    \pgfpathlineto{\pgfpoint{0.95\pgf at circ@res at step}{0.707*(\pgf at circ@res at other-\pgf at circ@res at step)}} % sqrt(1/2)
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{1.414*(\pgf at circ@res at other-\pgf at circ@res at step)}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{-1.414*(\pgf at circ@res at other-\pgf at circ@res at step)}}
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
+    \pgfpathlineto{\pgfpoint{0.95\pgf at circ@res at other}{-0.707*(\pgf at circ@res at other-\pgf at circ@res at step)}} % sqrt(1/2)
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{-1.414*(\pgf at circ@res at other-\pgf at circ@res at step)}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{1.414*(\pgf at circ@res at other-\pgf at circ@res at step)}}
+
+    \pgf at circ@draworfill
+
+    \pgfsetlinewidth{\pgfstartlinewidth}
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{-0.707*(\pgf at circ@res at other-\pgf at circ@res at step)}} % sqrt(1/2)
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{-1.414*(\pgf at circ@res at other-\pgf at circ@res at step)}} % sqrt(1/2)
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}} % sqrt(1/2)
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{0pt}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+
+    \pgfusepath{draw}
+
 }
 
-%% Empty triac
+%% Full triac
 
 \pgfcircdeclarebipole{
 	\anchor{gate}{
@@ -2144,47 +2319,45 @@
 		\northeast
 		\pgf at y=0cm
 	}
-}{\ctikzvalof{tripoles/triac/height}}{fulltriac}{\ctikzvalof{tripoles/triac/height}}{\ctikzvalof{tripoles/triac/width}}{
+}
+{\ctikzvalof{tripoles/triac/height}}
+{fulltriac}
+{\ctikzvalof{tripoles/triac/height}}
+{\ctikzvalof{tripoles/triac/width}}
+{
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
 
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgf at circ@res at other = \ctikzvalof{tripoles/triac/diode width left}\pgf at circ@res at left
+    \pgf at circ@res at step = \ctikzvalof{tripoles/triac/diode width right}\pgf at circ@res at right
 
-	\pgf at circ@res at other = \ctikzvalof{tripoles/triac/diode width left}\pgf at circ@res at left
-	\pgf at circ@res at step = \ctikzvalof{tripoles/triac/diode width right}\pgf at circ@res at right
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{0pt}}
+    \pgfpathlineto{\pgfpoint{0.95\pgf at circ@res at step}{0.707*(\pgf at circ@res at other-\pgf at circ@res at step)}} % sqrt(1/2)
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{1.414*(\pgf at circ@res at other-\pgf at circ@res at step)}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{-1.414*(\pgf at circ@res at other-\pgf at circ@res at step)}}
 
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{0pt}}
-	\pgfpathlineto{\pgfpoint{0.95\pgf at circ@res at step}{0.707*(\pgf at circ@res at other-\pgf at circ@res at step)}} % sqrt(1/2)
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{1.414*(\pgf at circ@res at other-\pgf at circ@res at step)}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{-1.414*(\pgf at circ@res at other-\pgf at circ@res at step)}}
-	
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
-	\pgfpathlineto{\pgfpoint{0.95\pgf at circ@res at other}{-0.707*(\pgf at circ@res at other-\pgf at circ@res at step)}} % sqrt(1/2)
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{-1.414*(\pgf at circ@res at other-\pgf at circ@res at step)}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{1.414*(\pgf at circ@res at other-\pgf at circ@res at step)}}
-	
-	\pgfusepath{draw,fill}
-	
-	\pgfsetlinewidth{\pgfstartlinewidth}
-	
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{-0.707*(\pgf at circ@res at other-\pgf at circ@res at step)}} % sqrt(1/2)
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{-1.414*(\pgf at circ@res at other-\pgf at circ@res at step)}} % sqrt(1/2)
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}} % sqrt(1/2)
-	
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{0pt}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{0pt}}
-	
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
-	\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
-	
-	\pgfusepath{draw}
-	
-}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
+    \pgfpathlineto{\pgfpoint{0.95\pgf at circ@res at other}{-0.707*(\pgf at circ@res at other-\pgf at circ@res at step)}} % sqrt(1/2)
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{-1.414*(\pgf at circ@res at other-\pgf at circ@res at step)}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{1.414*(\pgf at circ@res at other-\pgf at circ@res at step)}}
 
+    \pgfusepath{draw,fill}
 
+    \pgfsetlinewidth{\pgfstartlinewidth}
 
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{-0.707*(\pgf at circ@res at other-\pgf at circ@res at step)}} % sqrt(1/2)
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{-1.414*(\pgf at circ@res at other-\pgf at circ@res at step)}} % sqrt(1/2)
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}} % sqrt(1/2)
 
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{0pt}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{0pt}}
 
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
 
+    \pgfusepath{draw}
 
+}
+
 \pgfcircdeclarebipole{
 	\anchor{out 1}{
 		\northeast
@@ -2194,407 +2367,884 @@
 		\northeast
 		\pgf at y=.8\pgf at y
 	}
-}{\ctikzvalof{tripoles/toggleswitch/height 2}}{toggleswitch}{\ctikzvalof{tripoles/toggleswitch/height}}{\ctikzvalof{tripoles/toggleswitch/width}}{
+}
+{\ctikzvalof{tripoles/toggleswitch/height 2}}
+{toggleswitch}
+{\ctikzvalof{tripoles/toggleswitch/height}}
+{\ctikzvalof{tripoles/toggleswitch/width}}
+{
 
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
-	\pgfpathlineto{\pgfpoint{.3\pgf at circ@res at left}{0pt}}
-	\pgfusepath{draw}
-	\pgfscope
-	\pgfpathmoveto{\pgfpoint{.3\pgf at circ@res at left}{0pt}}
-	\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-	\pgfpathlineto{\pgfpoint{.7\pgf at circ@res at right}{.5\pgf at circ@res at up}}
-	\pgfusepath{draw}
-	\endpgfscope
-	
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
-	\pgfpathlineto{\pgfpoint{.5\pgf at circ@res at right}{0}}
-	
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{.8\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint{.5\pgf at circ@res at right}{.8\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint{.5\pgf at circ@res at right}{.15\pgf at circ@res at up}}
-	\pgfusepath{draw}
-	
-	
-	\pgfpathmoveto{\pgfpoint{.2\pgf at circ@res at left}{\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint{.2\pgf at circ@res at right}{\pgf at circ@res at up}}
-	\pgfusepath{draw}
-	
-	\pgfsetdash{{.08\pgf at circ@res at up}{.04\pgf at circ@res at up}{.7\pgf at circ@res at up}{.04\pgf at circ@res at up}{.8\pgf at circ@res at up}}{0cm}
-	\pgfpathmoveto{\pgfpoint{0}{\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint{0}{.8\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint{.2\pgf at circ@res at left}{.6\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint{0}{.4\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint{0}{.2\pgf at circ@res at up}}
-	\pgfusepath{draw}
-	\pgfsetdash{}{0cm}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+    \pgfpathlineto{\pgfpoint{.3\pgf at circ@res at left}{0pt}}
+    \pgfusepath{draw}
+    \pgfscope
+        \pgfpathmoveto{\pgfpoint{.3\pgf at circ@res at left}{0pt}}
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+        \pgfpathlineto{\pgfpoint{.7\pgf at circ@res at right}{.5\pgf at circ@res at up}}
+        \pgfusepath{draw}
+    \endpgfscope
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+    \pgfpathlineto{\pgfpoint{.5\pgf at circ@res at right}{0}}
+
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{.8\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{.5\pgf at circ@res at right}{.8\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{.5\pgf at circ@res at right}{.15\pgf at circ@res at up}}
+    \pgfusepath{draw}
+
+
+    \pgfpathmoveto{\pgfpoint{.2\pgf at circ@res at left}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{.2\pgf at circ@res at right}{\pgf at circ@res at up}}
+    \pgfusepath{draw}
+
+    \pgfsetdash{{.08\pgf at circ@res at up}{.04\pgf at circ@res at up}{.7\pgf at circ@res at up}{.04\pgf at circ@res at up}{.8\pgf at circ@res at up}}{0cm}
+    \pgfpathmoveto{\pgfpoint{0}{\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{0}{.8\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{.2\pgf at circ@res at left}{.6\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{0}{.4\pgf at circ@res at up}}
+    \pgfpathlineto{\pgfpoint{0}{.2\pgf at circ@res at up}}
+    \pgfusepath{draw}
+    \pgfsetdash{}{0cm}
 }
 
+%% operational and instrumentation amplifiers
 
+\pgfdeclareshape{op amp}
+{
+    \anchor{center}{\pgfpointorigin}
+    \savedanchor\northwest{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+    }
+    \anchor{south}{
+        \northwest
+        \pgf at y=-\pgf at y
+        \pgf at x=0pt
+    }
+    \anchor{north}{
+        \northwest
+        \pgf at x=0pt
+    }
+    \savedanchor\left{%
+        \pgf at y=0pt
+    }
+    \anchor{leftedge}
+    {\left
+        \pgf at x = \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf at x
+    }
+    \savedanchor\inOneFixed{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+    }
+    \anchor{in up}{
+        \inOneFixed
+    }
+    \anchor{in down}{
+        \inOneFixed
+        \pgf at y=-\pgf at y
+    }
 
+    \savedanchor\inOne{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+    \ifpgf at circuit@oa at iplusup\pgf at y=-\pgf at y\fi
+    }
+    \anchor{-}{
+        \inOne
+    }
+    \anchor{+}{
+        \inOne
+        \pgf at y=-\pgf at y
+    }
+    \savedanchor\up{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+        \pgf at circ@res at up = \pgf at y
+        \pgf at circ@res at right = -\pgf at x
+        \pgf at circ@res at left = \pgf at x
+        \pgfpointlineattime{
+            \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/up pos}}{
+            \pgfpoint{
+            \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf at circ@res at left}
+        {\pgf at circ@res at up}}
+        {\pgfpoint{.7\pgf at circ@res at right}{0pt}}
+    }
+    \anchor{up}{
+        \up
+    }
+    \anchor{down}{
+        \up
+        \pgf at y=-\pgf at y
+    }
+    \anchor{out}{
+        \northwest
+        \pgf at y=0pt
+        \pgf at x=-\pgf at x
+    }
+    \anchor{west}{
+        \left
+    }
+    \anchor{east}{
+        \left
+        \pgf at x=-\pgf at x
+    }
 
+    \anchor{south west}{ \northwest \pgf at y=-\pgf at y }
+    \anchor{north east}{ \northwest \pgf at x=-\pgf at x }
+    \anchor{north west}{ \northwest }
+    \anchor{south east}{ \northwest \pgf at x=-\pgf at x \pgf at y=-\pgf at y }
 
+    \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
 
+    \backgroundpath{
+        \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
 
 
+        \northwest
+        \pgf at circ@res at up = \pgf at y
+        \pgf at circ@res at down = -\pgf at y
+        \pgf at circ@res at right = -\pgf at x
+        \pgf at circ@res at left = \pgf at x
 
+        \pgfscope
+            \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
+            \pgftransformxshift{.7\pgf at circ@res at left}
+            \pgf at circ@res at step=\pgf at circ@res at right
+            \advance\pgf at circ@res at step by -\pgf at circ@res at left
+            \pgf at circ@res at step=.7\pgf at circ@res at step
 
-\pgfdeclareshape{op amp}
-	{
-	  \anchor{center}{\pgfpointorigin}
-	  \savedanchor\northwest{%
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf at circ@Rlen
-		\pgf at y=.5\pgf at y
-		\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf at circ@Rlen
-		\pgf at x=.5\pgf at x
-	  }
-	  \anchor{south}{
-		\northwest
-		\pgf at y=-\pgf at y
-		\pgf at x=0pt
-	  }
-	  \anchor{north}{
-		\northwest
-		\pgf at x=0pt
-	  }
-	  \savedanchor\left{%
-	  	\pgf at y=0pt
-	  }
-	  \anchor{leftedge}
-	  {\left
-		  \pgf at x = \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf at x
-	  }
-	  \savedanchor\inOne{%
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf at circ@Rlen
-		\pgf at y=.5\pgf at y
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at y
-		\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf at circ@Rlen
-		\pgf at x=.5\pgf at x
-	  }	  
-	  \anchor{-}{
-		\inOne
-	  }
-	  \anchor{+}{
-		\inOne
-		\pgf at y=-\pgf at y
-	  }
-	  \savedanchor\up{%
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf at circ@Rlen
-		\pgf at y=.5\pgf at y
-		\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf at circ@Rlen
-		\pgf at x=.5\pgf at x
-			\pgf at circ@res at up = \pgf at y 
-			\pgf at circ@res at right = -\pgf at x
-			\pgf at circ@res at left = \pgf at x
-	    \pgfpointlineattime{
-			\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/up pos}}{
-			\pgfpoint{
-				\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf at circ@res at left}
-				{\pgf at circ@res at up}}
-			{\pgfpoint{.7\pgf at circ@res at right}{0pt}}
-	  }
-	  \anchor{up}{
-		\up
-	  }
-	  \anchor{down}{
-		\up
-		\pgf at y=-\pgf at y
-	  }
-	  \anchor{out}{
-		\northwest
-		\pgf at y=0pt
-		\pgf at x=-\pgf at x
-	  }
-	  	\anchor{west}{
-		  	\left
-    	  }
-		  \anchor{east}{
-		  	\left
-		  	\pgf at x=-\pgf at x
-		  }  
-	  
-	  \backgroundpath{			
-			\pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}	
-			
-			
-			\northwest
-			\pgf at circ@res at up = \pgf at y 
-			\pgf at circ@res at down = -\pgf at y
-			\pgf at circ@res at right = -\pgf at x
-			\pgf at circ@res at left = \pgf at x
-			
-	\pgfpathmoveto{\pgfpoint
-		{\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at circ@res at up}}
-	\pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at circ@res at up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $-$}
-	
+            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
+            \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
+            \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
+            \pgfpathclose
+            \pgf at circ@draworfill
+        \endpgfscope
 
-	\pgfpathmoveto{\pgfpoint
-		{\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at circ@res at down}}
-	\pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at circ@res at down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $+$}
-		
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
-	\pgfpathlineto{\pgfpoint{.7\pgf at circ@res at right}{0pt}}
-	\pgfsetrectcap
-	\pgfusepath{draw}
+        \pgfpathmoveto{\pgfpoint
+            {\pgf at circ@res at left}
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf at circ@res at left}
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at circ@res at up}}
+        \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at circ@res at up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} \ifpgf at circuit@oa at iplusup$+$\else$-$\fi}
 
-						
-	\pgfscope
-		\pgfsetlinewidth{2\pgflinewidth}
-		\pgftransformxshift{.7\pgf at circ@res at left}
-		\pgf at circ@res at step=\pgf at circ@res at right
-		\advance\pgf at circ@res at step by -\pgf at circ@res at left
-		\pgf at circ@res at step=.7\pgf at circ@res at step
-		
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
-		\pgfpathclose
-		\pgfusepath{draw}
-	\endpgfscope
-		
-		
-	  
-	  }
-	}
 
+        \pgfpathmoveto{\pgfpoint
+            {\pgf at circ@res at left}
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf at circ@res at left}
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at circ@res at down}}
+        \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at circ@res at down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} \ifpgf at circuit@oa at iplusup$-$\else$+$\fi}
+
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+        \pgfpathlineto{\pgfpoint{.7\pgf at circ@res at right}{0pt}}
+        \pgfsetrectcap
+        \pgfusepath{draw}
+
+
+    }
+}
+
 %op amp shape as in european standard en 60617
 \pgfdeclareshape{en amp}
 {
-	\anchor{center}{\pgfpointorigin}
-	\savedanchor\northwest{%
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/height}\pgf at circ@Rlen
-		\pgf at y=.5\pgf at y
-		\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/width}\pgf at circ@Rlen
-		\pgf at x=.5\pgf at x
-	}
-	\anchor{south}{
-		\northwest
-		\pgf at y=-\pgf at y
-		\pgf at x=0pt
-	}
-	\anchor{north}{
-		\northwest
-		\pgf at x=0pt
-	}
-	\savedanchor\left{%
-	  	\pgf at y=0pt
-	}
-	\anchor{leftedge}
-	{
-		\left
-	 	\pgf at x = \pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/port width}\pgf at x
-	}
-	\savedanchor\inOne{%
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/height}\pgf at circ@Rlen
-		\pgf at y=.5\pgf at y
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/input height}\pgf at y
-		\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/width}\pgf at circ@Rlen
-		\pgf at x=.5\pgf at x
-	}	  
-	\anchor{-}{
-		\inOne
-	}
-	\anchor{+}{
-		\inOne
-		\pgf at y=-\pgf at y
-	}
-	\anchor{up}{
-		\northwest
-		\pgf at x=0pt
-	}
-	\anchor{down}{
-		\northwest
-		\pgf at x=0pt
-		\pgf at y=-\pgf at y
-	}
-	\anchor{out}{
-		\northwest
-		\pgf at y=0pt
-		\pgf at x=-\pgf at x
-	}
-	\anchor{west}{
-		\left
-	}
-	\anchor{east}{
-	  	\left
-		\pgf at x=-\pgf at x
-	}
-	\backgroundpath{			
-			\pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}	
-			\northwest
-			\pgf at circ@res at up = \pgf at y 
-			\pgf at circ@res at down = -\pgf at y
-			\pgf at circ@res at right = -\pgf at x
-			\pgf at circ@res at left = \pgf at x
-			
-	\pgfpathmoveto{\pgfpoint
-		{\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/input height}\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/port width}\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/input height}\pgf at circ@res at up}}
-	\pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/port width}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/input height}\pgf at circ@res at up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/font} $-$}
-	
-	\pgfpathmoveto{\pgfpoint
-		{\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/input height}\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/port width}\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/input height}\pgf at circ@res at down}}
-	\pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/port width}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/input height}\pgf at circ@res at down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/font} $+$}
-		
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
-	\pgfpathlineto{\pgfpoint{.7\pgf at circ@res at right}{0pt}}
-	\pgfsetrectcap
-	\pgfusepath{draw}
-				
-	\pgfscope
-		\pgfsetlinewidth{2\pgflinewidth}
-		\pgfpathmoveto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf at circ@res at left}{\pgf at circ@res at down}}
-		\pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf at circ@res at left}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf at circ@res at right}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfpathclose
-		\pgfusepath{draw}
-	\endpgfscope
+    \anchor{center}{\pgfpointorigin}
+    \savedanchor\northwest{%
+        \pgf at y=\ctikzvalof{tripoles/en amp/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at x=-\ctikzvalof{tripoles/en amp/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+    }
+    \anchor{south}{
+        \northwest
+        \pgf at y=-\pgf at y
+        \pgf at x=0pt
+    }
+    \anchor{north}{
+        \northwest
+        \pgf at x=0pt
+    }
+    \savedanchor\left{%
+        \pgf at y=0pt
+    }
+    \anchor{leftedge}
+    {
+        \left
+        \pgf at x = \ctikzvalof{tripoles/en amp/port width}\pgf at x
+    }
+    \savedanchor\inOneFixed{%
+        \pgf at y=\ctikzvalof{tripoles/op amp/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at y=\ctikzvalof{tripoles/op amp/input height}\pgf at y
+        \pgf at x=-\ctikzvalof{tripoles/op amp/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+    }
+    \anchor{in up}{
+        \inOneFixed
+    }
+    \anchor{in down}{
+        \inOneFixed
+        \pgf at y=-\pgf at y
+    }
+    \savedanchor\inOne{%
+        \pgf at y=\ctikzvalof{tripoles/en amp/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at y=\ctikzvalof{tripoles/en amp/input height}\pgf at y
+        \pgf at x=-\ctikzvalof{tripoles/en amp/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+    \ifpgf at circuit@oa at iplusup\pgf at y=-\pgf at y\fi
+    }
+    \anchor{-}{
+        \inOne
+    }
+    \anchor{+}{
+        \inOne
+        \pgf at y=-\pgf at y
+    }
+    \anchor{up}{
+        \northwest
+        \pgf at x=0pt
+    }
+    \anchor{down}{
+        \northwest
+        \pgf at x=0pt
+        \pgf at y=-\pgf at y
+    }
+    \anchor{out}{
+        \northwest
+        \pgf at y=0pt
+        \pgf at x=-\pgf at x
+    }
+    \anchor{west}{
+        \left
+    }
+    \anchor{east}{
+        \left
+        \pgf at x=-\pgf at x
+    }
+    \anchor{south west}{ \northwest \pgf at y=-\pgf at y }
+    \anchor{north east}{ \northwest \pgf at x=-\pgf at x }
+    \anchor{north west}{ \northwest }
+    \anchor{south east}{ \northwest \pgf at x=-\pgf at x \pgf at y=-\pgf at y }
+    \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
 
-	\pgftext[base,y=-3ex,at=\pgfpoint{.3\pgf at circ@res at left}{\pgf at circ@res at up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/font2} $\triangleright$}
-	\pgftext[base,y=-3ex,at=\pgfpoint{.3\pgf at circ@res at right}{\pgf at circ@res at up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/font2} $\infty$}
-	  }
+    \backgroundpath{
+        \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+        \northwest
+        \pgf at circ@res at up = \pgf at y
+        \pgf at circ@res at down = -\pgf at y
+        \pgf at circ@res at right = -\pgf at x
+        \pgf at circ@res at left = \pgf at x
+
+        \pgfscope
+            \pgfsetlinewidth{\ctikzvalof{tripoles/thickness}\pgflinewidth}
+            \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf at circ@res at left}{\pgf at circ@res at down}}
+            \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf at circ@res at left}{\pgf at circ@res at up}}
+            \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf at circ@res at right}{\pgf at circ@res at up}}
+            \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf at circ@res at right}{\pgf at circ@res at down}}
+            \pgfpathclose
+            \pgf at circ@draworfill
+        \endpgfscope
+
+        \pgfpathmoveto{\pgfpoint
+            {\pgf at circ@res at left}
+            {\ctikzvalof{tripoles/en amp/input height}\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint
+            {\ctikzvalof{tripoles/en amp/port width}\pgf at circ@res at left}
+            {\ctikzvalof{tripoles/en amp/input height}\pgf at circ@res at up}}
+        \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf at circ@res at left}{\ctikzvalof{tripoles/en amp/input height}\pgf at circ@res at up}]{\ctikzvalof{tripoles/en amp/font} \ifpgf at circuit@oa at iplusup$+$\else$-$\fi}
+
+        \pgfpathmoveto{\pgfpoint
+            {\pgf at circ@res at left}
+            {\ctikzvalof{tripoles/en amp/input height}\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint
+            {\ctikzvalof{tripoles/en amp/port width}\pgf at circ@res at left}
+            {\ctikzvalof{tripoles/en amp/input height}\pgf at circ@res at down}}
+        \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf at circ@res at left}{\ctikzvalof{tripoles/en amp/input height}\pgf at circ@res at down}]{\ctikzvalof{tripoles/en amp/font} \ifpgf at circuit@oa at iplusup$-$\else$+$\fi}
+
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+        \pgfpathlineto{\pgfpoint{.7\pgf at circ@res at right}{0pt}}
+        \pgfsetrectcap
+        \pgfusepath{draw}
+
+
+        \pgftext[top, y=-.5ex, at=\pgfpoint{0pt}{\pgf at circ@res at up}]{\hbox{\ctikzvalof{tripoles/en amp/font2}\ctikzvalof{tripoles/en amp/text}}}
+        % \pgftext[top, y=-.5ex, at=\pgfpoint{0pt}{\pgf at circ@res at up}]{\ctikzvalof{tripoles/en amp/font2}$\mathstrut{\triangleright}\,\mathrm{A}$}
+    }
 }
 
 %%Transkonduktanzverstärker
 \pgfdeclareshape{gm amp}
-	{
-	  \anchor{center}{\pgfpointorigin}
-	  \savedanchor\northwest{%
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/height}\pgf at circ@Rlen
-		\pgf at y=.5\pgf at y
-		\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/width}\pgf at circ@Rlen
-		\pgf at x=.5\pgf at x
-	  }
-	  \anchor{south}{
-		\northwest
-		\pgf at y=-\pgf at y
-	  }
-	  \anchor{north}{
-		\northwest
-	  }
-	  \savedanchor\left{%
-	  	\pgf at y=0pt
-	  }
-	  \anchor{leftedge}
-	  {\left
-  	  	\pgf at x = \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf at x
-	  }
-	  \savedanchor\inOne{%
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/height}\pgf at circ@Rlen
-		\pgf at y=.5\pgf at y
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf at y
-		\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/width}\pgf at circ@Rlen
-		\pgf at x=.5\pgf at x
-	  }	  
-	  \anchor{-}{
-		\inOne
-	  }
-	  \anchor{+}{
-		\inOne
-		\pgf at y=-\pgf at y
-	  }
-	  \savedanchor\up{%
-		\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/height}\pgf at circ@Rlen
-		\pgf at y=.5\pgf at y
-		\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/width}\pgf at circ@Rlen
-		\pgf at x=.5\pgf at x
-			\pgf at circ@res at up = \pgf at y 
-			\pgf at circ@res at right = -\pgf at x
-			\pgf at circ@res at left = \pgf at x
-	    \pgfpointlineattime{
-			\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/up pos}}{
-			\pgfpoint{
-				\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf at circ@res at left}
-				{\pgf at circ@res at up}}
-			{\pgfpoint{.7\pgf at circ@res at right}{0pt}}
-	  }
-	  \anchor{up}{
-		\up
-	  }
-	  \anchor{down}{
-		\up
-		\pgf at y=-\pgf at y
-	  }
-	  \anchor{out}{
-		\northwest
-		\pgf at y=0pt
-		\pgf at x=-\pgf at x
-	  }
-	  	\anchor{west}{
-		  	\left
-    	  }
-		  \anchor{east}{
-		  	\left
-		  	\pgf at x=-\pgf at x
-		  }  
-	  
-	  \backgroundpath{			
-			\pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}	
-						
-			\northwest
-			\pgf at circ@res at up = \pgf at y 
-			\pgf at circ@res at down = -\pgf at y
-			\pgf at circ@res at right = -\pgf at x
-			\pgf at circ@res at left = \pgf at x
-			
-	\pgfpathmoveto{\pgfpoint
-		{\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf at circ@res at up}}
-	\pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf at circ@res at up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $-$}
-	
+{
+    \anchor{center}{\pgfpointorigin}
+    \savedanchor\northwest{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+    }
+    \anchor{south}{
+        \northwest
+        \pgf at y=-\pgf at y
+    }
+    \anchor{north}{
+        \northwest
+    }
+    \savedanchor\left{%
+        \pgf at y=0pt
+    }
+    \anchor{leftedge}
+    {\left
+        \pgf at x = \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf at x
+    }
+    \savedanchor\inOneFixed{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+    }
+    \anchor{in up}{
+        \inOneFixed
+    }
+    \anchor{in down}{
+        \inOneFixed
+        \pgf at y=-\pgf at y
+    }
+    \savedanchor\inOne{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+    \ifpgf at circuit@oa at iplusup\pgf at y=-\pgf at y\fi
+    }
+    \anchor{-}{
+        \inOne
+    }
+    \anchor{+}{
+        \inOne
+        \pgf at y=-\pgf at y
+    }
+    \savedanchor\up{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+        \pgf at circ@res at up = \pgf at y
+        \pgf at circ@res at right = -\pgf at x
+        \pgf at circ@res at left = \pgf at x
+        \pgfpointlineattime{
+            \pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/up pos}}{
+            \pgfpoint{
+            \pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf at circ@res at left}
+        {\pgf at circ@res at up}}
+        {\pgfpoint{.7\pgf at circ@res at right}{0pt}}
+    }
+    \anchor{up}{
+        \up
+    }
+    \anchor{down}{
+        \up
+        \pgf at y=-\pgf at y
+    }
+    \anchor{out}{
+        \northwest
+        \pgf at y=0pt
+        \pgf at x=-\pgf at x
+    }
+    \anchor{west}{
+        \left
+    }
+    \anchor{east}{
+        \left
+        \pgf at x=-\pgf at x
+    }
+    \anchor{south west}{ \northwest \pgf at y=-\pgf at y }
+    \anchor{north east}{ \northwest \pgf at x=-\pgf at x }
+    \anchor{north west}{ \northwest }
+    \anchor{south east}{ \northwest \pgf at x=-\pgf at x \pgf at y=-\pgf at y }
 
-	\pgfpathmoveto{\pgfpoint
-		{\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf at circ@res at down}}
-	\pgfpathlineto{\pgfpoint
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf at circ@res at left}
-		{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf at circ@res at down}}
-	\pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf at circ@res at down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $+$}
-		
-	\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
-	\pgfpathlineto{\pgfpoint{.3\pgf at circ@res at right}{0pt}} %
-		\pgfsetrectcap
-	\pgfusepath{draw}
+    \anchor{text}{\northwest
+        \pgf at x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf at x
+    \pgfpoint{-.5\wd\pgfnodeparttextbox+.25\pgf at x}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
 
-	\pgfscope
-		\pgfsetlinewidth{2\pgflinewidth}
-		\pgftransformxshift{.7\pgf at circ@res at left}
-		\pgf at circ@res at step=\pgf at circ@res at right
-		\advance\pgf at circ@res at step by -\pgf at circ@res at left
-		\pgf at circ@res at step=.7\pgf at circ@res at step
-		%Umrandung:
-		\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0}} %geändert startpunkt neu am ausgangsstrich
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{.5\pgf at circ@res at up}}%vom Ausgang nach oben
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}} %neu ecke links oben nach rechts oben
-		\pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}} %bei deneigängen runter 
-		\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{.5\pgf at circ@res at down}}%ecke links unten nach rechts unten
-		\pgfpathclose
-		\pgfusepath{draw}
-	\endpgfscope
-  
-	  }
-	}	
+    \backgroundpath{
+        \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
 
+        \northwest
+        \pgf at circ@res at up = \pgf at y
+        \pgf at circ@res at down = -\pgf at y
+        \pgf at circ@res at right = -\pgf at x
+        \pgf at circ@res at left = \pgf at x
 
+        \pgfscope
+            \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
+            \pgftransformxshift{.7\pgf at circ@res at left}
+            \pgf at circ@res at step=\pgf at circ@res at right
+            \advance\pgf at circ@res at step by -\pgf at circ@res at left
+            \pgf at circ@res at step=.7\pgf at circ@res at step
+            %Umrandung:
+            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0}} %geändert startpunkt neu am ausgangsstrich
+            \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{.5\pgf at circ@res at up}}%vom Ausgang nach oben
+            \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}} %neu ecke links oben nach rechts oben
+            \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}} %bei deneigängen runter
+            \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{.5\pgf at circ@res at down}}%ecke links unten nach rechts unten
+            \pgfpathclose
+            \pgf at circ@draworfill
+        \endpgfscope
 
+        \pgfpathmoveto{\pgfpoint
+            {\pgf at circ@res at left}
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf at circ@res at left}
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf at circ@res at up}}
+        \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf at circ@res at up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} \ifpgf at circuit@oa at iplusup$+$\else$-$\fi}
+
+
+        \pgfpathmoveto{\pgfpoint
+            {\pgf at circ@res at left}
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf at circ@res at left}
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf at circ@res at down}}
+        \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf at circ@res at down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} \ifpgf at circuit@oa at iplusup$-$\else$+$\fi}
+
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+        \pgfpathlineto{\pgfpoint{.3\pgf at circ@res at right}{0pt}} %
+        \pgfsetrectcap
+        \pgfusepath{draw}
+
+    }
+}
+
+%% instrumentation amplifier
+
+\pgfdeclareshape{inst amp}
+{
+    % when tikz calls the anchor it wants the relative position in the lengths
+    % \pgf at x  \pgf at y
+    % \pgfpoint* functions set that variables
+    % anchors are visible outside and run on use
+    \anchor{center}{\pgfpointorigin}
+    % savedanchors are internals and run on node creation (not use)
+    % bounding-box top left
+    \savedanchor\northwest{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+    }
+    \anchor{nw}{
+        \northwest
+    }
+    \anchor{south}{
+        \northwest
+        \pgf at y=-\pgf at y
+    }
+    \anchor{north}{
+        \northwest
+    }
+    \savedanchor\left{%
+        \pgf at y=0pt
+    }
+    \anchor{leftedge}
+    {\left
+        \pgf at x = \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf at x
+    }
+    \savedanchor\inOneFixed{%
+          \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf at circ@Rlen
+          \pgf at y=.5\pgf at y
+          \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at y
+          \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf at circ@Rlen
+          \pgf at x=.5\pgf at x
+    }
+    \anchor{in up}{
+        \inOneFixed
+    }
+    \anchor{in down}{
+        \inOneFixed
+        \pgf at y=-\pgf at y
+    }
+    \savedanchor\inOne{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/input height}\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+        \ifpgf at circuit@oa at iplusup\pgf at y=-\pgf at y\fi
+    }
+    \anchor{-}{
+        \inOne
+    }
+    \anchor{+}{
+        \inOne
+        \pgf at y=-\pgf at y
+    }
+    \savedanchor\up{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+        \pgf at circ@res at up = \pgf at y
+        \pgf at circ@res at right = -\pgf at x
+        \pgf at circ@res at left = \pgf at x
+        \pgfpointlineattime{
+            \pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/up pos}}{
+            \pgfpoint{
+            \pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/port width}\pgf at circ@res at left}
+        {\pgf at circ@res at up}}
+        {\pgfpoint{.7\pgf at circ@res at right}{.6\pgf at circ@res at up}}
+    }
+    \anchor{up}{
+        \up
+    }
+    \anchor{down}{
+        \up
+        \pgf at y=-\pgf at y
+    }
+    % reference voltage input anchors.
+    \savedanchor\refv{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+        \pgf at circ@res at up = \pgf at y
+        \pgf at circ@res at right = -\pgf at x
+        \pgf at circ@res at left = \pgf at x
+        \pgfpointlineattime{
+            \pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/refv pos}}{
+            \pgfpoint{
+            \pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/port width}\pgf at circ@res at left}
+        {\pgf at circ@res at up}}
+        {\pgfpoint{.7\pgf at circ@res at right}{.6\pgf at circ@res at up}}
+    }
+    % we need both because they are normally drawn under the amp, and if you
+    % mirror it vertically you need them
+    \anchor{refv up}{
+        \refv
+    }
+    \anchor{refv down}{
+        \refv
+        \pgf at y=-\pgf at y
+    }
+    \anchor{out}{
+        \northwest
+        \pgf at y=0pt
+        \pgf at x=-\pgf at x
+    }
+    \anchor{west}{
+        \left
+    }
+    \anchor{east}{
+        \left
+        \pgf at x=-\pgf at x
+    }
+    \anchor{south west}{ \northwest \pgf at y=-\pgf at y }
+    \anchor{north east}{ \northwest \pgf at x=-\pgf at x }
+    \anchor{north west}{ \northwest }
+    \anchor{south east}{ \northwest \pgf at x=-\pgf at x \pgf at y=-\pgf at y }
+
+    \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
+
+    % let's start drawing the component
+    \backgroundpath{
+        \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+        %
+        \northwest
+        \pgf at circ@res at up = \pgf at y
+        \pgf at circ@res at down = -\pgf at y
+        \pgf at circ@res at right = -\pgf at x
+        \pgf at circ@res at left = \pgf at x
+        % main component, normally in thicker lines
+        \pgfscope
+            \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
+            \pgftransformxshift{.7\pgf at circ@res at left}
+            \pgf at circ@res at step=\pgf at circ@res at right
+            \advance\pgf at circ@res at step by -\pgf at circ@res at left
+            \pgf at circ@res at step=.7\pgf at circ@res at step
+            %first point (near output)
+            \pgfpathmoveto{\pgfpoint{1.4\pgf at circ@res at right}{0}}
+            %from the exit to the top (short side)... (note that the .6 must be copied in \up and \refv anchors
+            \pgfpathlineto{\pgfpoint{1.4\pgf at circ@res at right}{.6\pgf at circ@res at up}}
+            % and then to the input "front up", "down", to the output short side "down"
+            \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
+            \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
+            \pgfpathlineto{\pgfpoint{1.4\pgf at circ@res at right}{.6\pgf at circ@res at down}}
+            % ...and close
+            \pgfpathclose
+            \pgf at circ@draworfill
+        \endpgfscope
+        % input terminal -
+        \pgfpathmoveto{\pgfpoint
+            {\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/input height}\pgf at circ@res at up}}
+        %
+        \pgfpathlineto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/port width}\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/input height}\pgf at circ@res at up}}
+        %
+        \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/port width}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/input height}\pgf at circ@res at up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/font} \ifpgf at circuit@oa at iplusup$+$\else$-$\fi}
+
+        % input terminal +
+        \pgfpathmoveto{\pgfpoint
+            {\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/input height}\pgf at circ@res at down}}
+        %
+        \pgfpathlineto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/port width}\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/input height}\pgf at circ@res at down}}
+    \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/port width}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/input height}\pgf at circ@res at down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/font} \ifpgf at circuit@oa at iplusup$-$\else$+$\fi}
+        % output lead
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+        \pgfpathlineto{\pgfpoint{.7\pgf at circ@res at right}{0pt}} %
+        %
+        \pgfsetrectcap
+        \pgfusepath{draw}
+    }
+}
+
+% instrumentation amplifier, with terminals for gain resistance between inputs
+\pgfdeclareshape{inst amp ra}
+{
+    \anchor{center}{\pgfpointorigin}
+    % bounding-box top left
+    \savedanchor\northwest{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+    }
+    \anchor{nw}{
+        \northwest
+    }
+    \anchor{south}{
+        \northwest
+        \pgf at y=-\pgf at y\pgf at x=0pt\relax
+    }
+    \anchor{north}{
+        \northwest\pgf at x=0pt\relax
+    }
+    \savedanchor\left{%
+        \pgf at y=0pt
+    }
+    \anchor{leftedge}
+    {\left
+        \pgf at x = \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf at x
+    }
+    % inputs (+-)
+    \savedanchor\inOneFixed{%
+          \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf at circ@Rlen
+          \pgf at y=.5\pgf at y
+          \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at y
+          \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf at circ@Rlen
+          \pgf at x=.5\pgf at x
+    }
+    \anchor{in up}{
+        \inOneFixed
+    }
+    \anchor{in down}{
+        \inOneFixed
+        \pgf at y=-\pgf at y
+    }
+    \savedanchor\inOne{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/input height}\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+        \ifpgf at circuit@oa at iplusup\pgf at y=-\pgf at y\fi
+    }
+    \anchor{-}{
+        \inOne
+    }
+    \anchor{+}{
+        \inOne
+        \pgf at y=-\pgf at y
+    }
+    % R ampli anchors. They are by default at 20% more than R-length distance
+    % you can change that with the `ra pos` key (use 0.5 for one-R).
+    \savedanchor\raOneFixed{%
+          \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf at circ@Rlen
+          \pgf at y=.5\pgf at y
+          \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf at y
+          \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf at circ@Rlen
+          \pgf at x=.5\pgf at x
+    }
+    \anchor{ra up}{
+        \inOneFixed
+    }
+    \anchor{ra down}{
+        \inOneFixed
+        \pgf at y=-\pgf at y
+    }
+    \savedanchor\raOne{%
+        \pgf at y=\pgf at circ@Rlen
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/ra pos}\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+        \ifpgf at circuit@oa at iplusup\pgf at y=-\pgf at y\fi
+    }
+    \anchor{ra-}{
+        \raOne
+    }
+    \anchor{ra+}{
+        \raOne
+        \pgf at y=-\pgf at y
+    }
+    % power supplies
+    \savedanchor\up{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+        \pgf at circ@res at up = \pgf at y
+        \pgf at circ@res at right = -\pgf at x
+        \pgf at circ@res at left = \pgf at x
+        \pgfpointlineattime{
+            \pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/up pos}}{
+            \pgfpoint{
+            \pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/port width}\pgf at circ@res at left}
+        {\pgf at circ@res at up}}
+        {\pgfpoint{.7\pgf at circ@res at right}{.4\pgf at circ@res at up}}
+    }
+    \anchor{up}{
+        \up
+    }
+    \anchor{down}{
+        \up
+        \pgf at y=-\pgf at y
+    }
+    % reference voltage input anchors.
+    \savedanchor\refv{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/height}\pgf at circ@Rlen
+        \pgf at y=0.5\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/width}\pgf at circ@Rlen
+        \pgf at x=0.5\pgf at x
+        \pgf at circ@res at up = \pgf at y
+        \pgf at circ@res at right = -\pgf at x
+        \pgf at circ@res at left = \pgf at x
+        \pgfpointlineattime{
+            \pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/refv pos}}{
+            \pgfpoint{
+            \pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/port width}\pgf at circ@res at left}
+        {\pgf at circ@res at up}}
+        {\pgfpoint{.7\pgf at circ@res at right}{.4\pgf at circ@res at up}}
+    }
+    % we need both because they are normally drawn under the amp, and if you
+    % mirror it vertically you need them
+    \anchor{refv up}{
+        \refv
+    }
+    \anchor{refv down}{
+        \refv
+        \pgf at y=-\pgf at y
+    }
+    \anchor{out}{
+        \northwest
+        \pgf at y=0pt
+        \pgf at x=-\pgf at x
+    }
+    \anchor{west}{
+        \left
+    }
+    \anchor{east}{
+        \left
+        \pgf at x=-\pgf at x
+    }
+    \anchor{south west}{ \northwest \pgf at y=-\pgf at y }
+    \anchor{north east}{ \northwest \pgf at x=-\pgf at x }
+    \anchor{north west}{ \northwest }
+    \anchor{south east}{ \northwest \pgf at x=-\pgf at x \pgf at y=-\pgf at y }
+
+    \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
+
+    % drawing of the component
+    \backgroundpath{
+        \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+        \northwest
+        \pgf at circ@res at up = \pgf at y
+        \pgf at circ@res at down = -\pgf at y
+        \pgf at circ@res at right = -\pgf at x
+        \pgf at circ@res at left = \pgf at x
+
+        % main component, normally in thicker lines
+        \pgfscope
+            \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
+            \pgftransformxshift{.7\pgf at circ@res at left}
+            \pgf at circ@res at step=\pgf at circ@res at right
+            \advance\pgf at circ@res at step by -\pgf at circ@res at left
+            \pgf at circ@res at step=.7\pgf at circ@res at step
+            %primer punto: la linea de salida (lado componente)
+            \pgfpathmoveto{\pgfpoint{1.4\pgf at circ@res at right}{0}}
+            %from the exit to the top (short side)... (note that the .4 must be copied in \up anchor
+            \pgfpathlineto{\pgfpoint{1.4\pgf at circ@res at right}{.4\pgf at circ@res at up}}
+            % and then to the input "front up", "down", to the output short side "down"
+            \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
+            \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
+            \pgfpathlineto{\pgfpoint{1.4\pgf at circ@res at right}{.4\pgf at circ@res at down}}
+            % ...and close
+            \pgfpathclose
+            \pgf at circ@draworfill
+        \endpgfscope
+
+        % ra terminal -
+        \pgfpathmoveto{\pgfpoint
+            {\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/ra pos}\pgf at circ@Rlen}}
+        %
+        \pgfpathlineto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/port width}\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/ra pos}\pgf at circ@Rlen}}
+        % ra terminal +
+        \pgfpathmoveto{\pgfpoint
+            {\pgf at circ@res at left}
+        {-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/ra pos}\pgf at circ@Rlen}}
+        %
+        \pgfpathlineto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/port width}\pgf at circ@res at left}
+        {-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/ra pos}\pgf at circ@Rlen}}
+        % input terminal -
+        \pgfpathmoveto{\pgfpoint
+            {\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/input height}\pgf at circ@res at up}}
+        %
+        \pgfpathlineto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/port width}\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/input height}\pgf at circ@res at up}}
+        %
+        \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/port width}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/input height}\pgf at circ@res at up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/font} \ifpgf at circuit@oa at iplusup$+$\else$-$\fi}
+
+        % input terminal +
+        \pgfpathmoveto{\pgfpoint
+            {\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/input height}\pgf at circ@res at down}}
+        %
+        \pgfpathlineto{\pgfpoint
+            {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/port width}\pgf at circ@res at left}
+        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/input height}\pgf at circ@res at down}}
+        \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/port width}\pgf at circ@res at left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/input height}\pgf at circ@res at down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/font} \ifpgf at circuit@oa at iplusup$-$\else$+$\fi}
+        % output lead
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+        \pgfpathlineto{\pgfpoint{.7\pgf at circ@res at right}{0pt}} %
+        %
+        \pgfsetrectcap
+        \pgfusepath{draw}
+    }
+}
 %% Potentiometer
 \pgfcircdeclarebipole{
 	\anchor{wiper}{
@@ -2604,40 +3254,44 @@
 	\anchor{W}{
 		\northeast
 		\pgfpoint{0pt}{\pgf at y}
-	}	
-}{\ctikzvalof{bipoles/potentiometer/height 2}}{potentiometer}{\ctikzvalof{bipoles/potentiometer/height}}{\ctikzvalof{bipoles/potentiometer/width}}{
-\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-\pgftransformationadjustments
-\pgfmathsetlength{\pgf at circ@res at step}{\ctikzvalof{bipoles/resistor/width}\pgf at circ@Rlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
-\divide \pgf at circ@res at step by 12
+	}
+}
+{\ctikzvalof{bipoles/potentiometer/height 2}}
+{potentiometer}{\ctikzvalof{bipoles/potentiometer/height}}
+{\ctikzvalof{bipoles/potentiometer/width}}
+{
+    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+    \pgftransformationadjustments
+    \pgfmathsetlength{\pgf at circ@res at step}{\ctikzvalof{bipoles/resistor/width}\pgf at circ@Rlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
+    \divide \pgf at circ@res at step by 12
 
-\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf at circ@res at zero}}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf at circ@res at zero}}
 
-\pgf at circ@res at other = \pgf at circ@res at left
-\advance\pgf at circ@res at other by \pgf at circ@res at step 
-\pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{-\pgf at circ@res at down}}
-\advance\pgf at circ@res at other by 2\pgf at circ@res at step 
-\pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at down}}
-\advance\pgf at circ@res at other by 2\pgf at circ@res at step
-\pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{-\pgf at circ@res at down}}
-\advance\pgf at circ@res at other by 2\pgf at circ@res at step
-\pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at down}}
-\advance\pgf at circ@res at other by 2\pgf at circ@res at step
-\pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{-\pgf at circ@res at down}}
-\advance\pgf at circ@res at other by 2\pgf at circ@res at step
-\pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at down}}
-\advance\pgf at circ@res at other by \pgf at circ@res at step
-\pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at zero}}
-\pgfsetbeveljoin
-\pgfusepath{draw}
+    \pgf at circ@res at other = \pgf at circ@res at left
+    \advance\pgf at circ@res at other by \pgf at circ@res at step
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{-\pgf at circ@res at down}}
+    \advance\pgf at circ@res at other by 2\pgf at circ@res at step
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at down}}
+    \advance\pgf at circ@res at other by 2\pgf at circ@res at step
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{-\pgf at circ@res at down}}
+    \advance\pgf at circ@res at other by 2\pgf at circ@res at step
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at down}}
+    \advance\pgf at circ@res at other by 2\pgf at circ@res at step
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{-\pgf at circ@res at down}}
+    \advance\pgf at circ@res at other by 2\pgf at circ@res at step
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at down}}
+    \advance\pgf at circ@res at other by \pgf at circ@res at step
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at zero}}
+    \pgfsetbeveljoin
+    \pgfusepath{draw}
 
-\pgfscope
-	%\pgfsetlinewidth{\pgfstartlinewidth}
-	\pgfsetarrowsend{latex'}
-	\pgfpathmoveto{\pgfpoint{0pt}{\pgf at circ@res at up}}
-	\pgfpathlineto{\pgfpoint{0pt}{-\pgf at circ@res at down}}
-	\pgfusepath{draw}
-\endpgfscope
+    \pgfscope
+        %\pgfsetlinewidth{\pgfstartlinewidth}
+        \pgfsetarrowsend{latexslim}
+        \pgfpathmoveto{\pgfpoint{0pt}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{0pt}{-\pgf at circ@res at down}}
+        \pgfusepath{draw}
+    \endpgfscope
 }
 
 
@@ -2644,7 +3298,7 @@
 
 
 
-%% Generic tunable 
+%% Generic tunable
 
 \pgfcircdeclarebipole{
 	\anchor{wiper}{
@@ -2651,394 +3305,403 @@
 		\northeast
 		\pgfpoint{0pt}{\pgf at y}
 	}
-}{\ctikzvalof{bipoles/generic potentiometer/height 2}}{genericpotentiometer}{\ctikzvalof{bipoles/generic potentiometer/height}}{\ctikzvalof{bipoles/generic potentiometer/width}}{
+}
+{\ctikzvalof{bipoles/generic potentiometer/height 2}}
+{genericpotentiometer}
+{\ctikzvalof{bipoles/generic potentiometer/height}}
+{\ctikzvalof{bipoles/generic potentiometer/width}}
+{
 
-		\pgf at circ@res at step = \ctikzvalof{bipoles/resistor/width}\pgf at circ@Rlen
-		\divide \pgf at circ@res at step by 14
+    \pgf at circ@res at step = \ctikzvalof{bipoles/resistor/width}\pgf at circ@Rlen
+    \divide \pgf at circ@res at step by 14
 
-		\pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{-\pgf at circ@res at down}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-		\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-					
-		\pgfusepath{draw} 
-		
-		\pgfscope
-		%\pgfsetlinewidth{\pgfstartlinewidth}
-		\pgfsetarrowsend{latex'}
-		\pgfpathmoveto{\pgfpoint{0pt}{\pgf at circ@res at up}}
-		\pgfpathlineto{\pgfpoint{0pt}{-\pgf at circ@res at down}}
-		\pgfusepath{draw}
-		\endpgfscope
+    \pgfscope
+        \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{-\pgf at circ@res at down}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+        \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+        \pgf at circ@draworfill
+    \endpgfscope
+    \pgfscope
+        %\pgfsetlinewidth{\pgfstartlinewidth}
+        \pgfsetarrowsend{latexslim}
+        \pgfpathmoveto{\pgfpoint{0pt}{\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{0pt}{-\pgf at circ@res at down}}
+        \pgfusepath{draw}
+    \endpgfscope
 }
 
 
 \pgfdeclareshape{mixer}
 {
-	\savedanchor\northwest{
-		\ifpgf at circuit@boxed
-			\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf at circ@Rlen
-			\pgf at y=.5\pgf at y
-			\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf at circ@Rlen
-			\pgf at x=.5\pgf at x
-		\else	
-			\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/mixer/width}\pgf at circ@Rlen
-			\pgf at y=.5\pgf at y
-			\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/mixer/width}\pgf at circ@Rlen
-			\pgf at x=.5\pgf at x
-		\fi
-	}
-	\anchor{center}{
-		\pgfpointorigin
-	}
-	\anchor{left}{%
-		\northwest
-		\pgf at y=0pt
-	}
-	\anchor{1}{
-		\northwest
-		\pgf at y=0pt
-	}
-	\anchor{2}{
-		\northwest
-		\pgf at y=-\pgf at y
-		\pgf at x=0pt
-	}
-	\anchor{3}{
-		\northwest
-		\pgf at y=0pt
-		\pgf at x=-\pgf at x
-	}
-	\anchor{4}{
-		\northwest
-		\pgf at y=\pgf at y
-		\pgf at x=0pt
-	}
-	\anchor{in 1}{
-		\northwest
-		\pgf at y=0pt
-	}
-	\anchor{in1}{
-		\northwest
-		\pgf at y=0pt
-	}
-	\anchor{in}{
-		\northwest
-		\pgf at y=0pt
-	}	  
-	\anchor{in 2}{
-		\northwest
-		\pgf at y=-\pgf at y
-		\pgf at x=0pt
-	}
-	\anchor{in2}{
-		\northwest
-		\pgf at y=-\pgf at y
-		\pgf at x=0pt
-	}
-	\anchor{out}{
-		\northwest
-		\pgf at y=0pt
-		\pgf at x=-\pgf at x
-	}
-	\anchor{center}{
-		\pgf at y=0pt
-		\pgf at x=0pt
-	}
-	\anchor{east}{
-		\northwest
-		\pgf at y=0pt
-		\pgf at x=-\pgf at x  
-	}
-	\anchor{west}{
-		\northwest
-		\pgf at y=0pt
-	}
-	\anchor{south}{
-		\northwest
-		\pgf at x=0pt
-		\pgf at y=-\pgf at y
-	}
-	\anchor{north}{
-		\northwest
-		\pgf at x=0pt
-	}
-	\anchor{south west}{
-		\northwest
-		\pgf at y=-\pgf at y
-	}
-	\anchor{north east}{
-		\northwest
-		\pgf at x=-\pgf at x
-	}
-	\anchor{north west}{
-		\northwest
-	}
-	\anchor{south east}{
-		\northwest
-		\pgf at x=-\pgf at x
-		\pgf at y=-\pgf at y
-	}
-	\backgroundpath{
-		\pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}	
-			
-		\pgf at circ@res at step=\ctikzvalof{tripoles/mixer/width}\pgf at circ@Rlen
-			
-		\pgfscope
-			\pgfstartlinewidth=\pgflinewidth
-			
-			% draw outer box
-			\ifpgf at circuit@boxed
-				\pgfnode{box}{center}{}{pgf at box}{\pgfusepath{draw}}
-			\fi
-			
-			% draw outer circle
-			\ifpgf at circuit@boxed
-				\pgf at circ@res at step=.7\pgf at circ@res at step
-				\pgfsetdash{}{0pt}	% draw solid circle if boxed
-			\else
-				\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-			\fi
-			\pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf at circ@res at step}
-			\pgfusepath{draw}
-			
-			% draw inner stuff
-			\pgfsetdash{}{0pt}	% always draw solid line for inner symbol
-			\pgfsetlinewidth{\pgfstartlinewidth}
-			\pgfpathmoveto{\pgfpointorigin}
-			\pgfpathmoveto{\pgfpointpolar{135}{0.5\pgf at circ@res at step}}
-			\pgfpathlineto{\pgfpointpolar{-45}{0.5\pgf at circ@res at step}}
-			\pgfpathmoveto{\pgfpointorigin}
-			\pgfpathmoveto{\pgfpointpolar{45}{0.5\pgf at circ@res at step}}
-			\pgfpathlineto{\pgfpointpolar{-135}{0.5\pgf at circ@res at step}}
-			\pgfusepath{draw}
-			
-		\endpgfscope
-	}
+    \savedanchor\northwest{
+        \ifpgf at circuit@boxed
+            \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf at circ@Rlen
+            \pgf at y=.5\pgf at y
+            \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf at circ@Rlen
+            \pgf at x=.5\pgf at x
+        \else
+            \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/mixer/width}\pgf at circ@Rlen
+            \pgf at y=.5\pgf at y
+            \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/mixer/width}\pgf at circ@Rlen
+            \pgf at x=.5\pgf at x
+        \fi
+    }
+    \anchor{center}{
+        \pgfpointorigin
+    }
+    \anchor{left}{%
+        \northwest
+        \pgf at y=0pt
+    }
+    \anchor{1}{
+        \northwest
+        \pgf at y=0pt
+    }
+    \anchor{2}{
+        \northwest
+        \pgf at y=-\pgf at y
+        \pgf at x=0pt
+    }
+    \anchor{3}{
+        \northwest
+        \pgf at y=0pt
+        \pgf at x=-\pgf at x
+    }
+    \anchor{4}{
+        \northwest
+        \pgf at y=\pgf at y
+        \pgf at x=0pt
+    }
+    \anchor{in 1}{
+        \northwest
+        \pgf at y=0pt
+    }
+    \anchor{in1}{
+        \northwest
+        \pgf at y=0pt
+    }
+    \anchor{in}{
+        \northwest
+        \pgf at y=0pt
+    }
+    \anchor{in 2}{
+        \northwest
+        \pgf at y=-\pgf at y
+        \pgf at x=0pt
+    }
+    \anchor{in2}{
+        \northwest
+        \pgf at y=-\pgf at y
+        \pgf at x=0pt
+    }
+    \anchor{out}{
+        \northwest
+        \pgf at y=0pt
+        \pgf at x=-\pgf at x
+    }
+    \anchor{center}{
+        \pgf at y=0pt
+        \pgf at x=0pt
+    }
+    \anchor{east}{
+        \northwest
+        \pgf at y=0pt
+        \pgf at x=-\pgf at x
+    }
+    \anchor{west}{
+        \northwest
+        \pgf at y=0pt
+    }
+    \anchor{south}{
+        \northwest
+        \pgf at x=0pt
+        \pgf at y=-\pgf at y
+    }
+    \anchor{north}{
+        \northwest
+        \pgf at x=0pt
+    }
+    \anchor{south west}{
+        \northwest
+        \pgf at y=-\pgf at y
+    }
+    \anchor{north east}{
+        \northwest
+        \pgf at x=-\pgf at x
+    }
+    \anchor{north west}{
+        \northwest
+    }
+    \anchor{south east}{
+        \northwest
+        \pgf at x=-\pgf at x
+        \pgf at y=-\pgf at y
+    }
+    \backgroundpath{
+        \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+        \pgf at circ@res at step=\ctikzvalof{tripoles/mixer/width}\pgf at circ@Rlen
+
+        \pgfscope
+            \pgfstartlinewidth=\pgflinewidth
+
+            % draw outer box
+            \ifpgf at circuit@boxed
+                \pgfnode{box}{center}{}{pgf at box}{\pgfusepath{draw}}
+            \fi
+
+            % draw outer circle
+            \ifpgf at circuit@boxed
+                \pgf at circ@res at step=.7\pgf at circ@res at step
+                \pgfsetdash{}{0pt}	% draw solid circle if boxed
+            \else
+                \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+            \fi
+            \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf at circ@res at step}
+            \pgf at circ@draworfill
+
+            % draw inner stuff
+            \pgfsetdash{}{0pt}	% always draw solid line for inner symbol
+            \pgfsetlinewidth{\pgfstartlinewidth}
+            \pgfpathmoveto{\pgfpointorigin}
+            \pgfpathmoveto{\pgfpointpolar{135}{0.5\pgf at circ@res at step}}
+            \pgfpathlineto{\pgfpointpolar{-45}{0.5\pgf at circ@res at step}}
+            \pgfpathmoveto{\pgfpointorigin}
+            \pgfpathmoveto{\pgfpointpolar{45}{0.5\pgf at circ@res at step}}
+            \pgfpathlineto{\pgfpointpolar{-135}{0.5\pgf at circ@res at step}}
+            \pgfusepath{draw}
+
+        \endpgfscope
+    }
 }
 
 \pgfdeclareshape{adder}
 {
-	\savedanchor\northwest{
-		\ifpgf at circuit@boxed
-			\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf at circ@Rlen
-			\pgf at y=.5\pgf at y
-			\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf at circ@Rlen
-			\pgf at x=.5\pgf at x
-		\else	
-			\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/adder/width}\pgf at circ@Rlen
-			\pgf at y=.5\pgf at y
-			\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/adder/width}\pgf at circ@Rlen
-			\pgf at x=.5\pgf at x
-		\fi
-	}
-	\anchor{center}{
-		\pgfpointorigin
-	}
-	\anchor{left}{%
-		\northwest
-		\pgf at y=0pt
-	}
-	\anchor{1}{
-		\northwest
-		\pgf at y=0pt
-	}
-	\anchor{2}{
-		\northwest
-		\pgf at y=-\pgf at y
-		\pgf at x=0pt
-	}
-	\anchor{3}{
-		\northwest
-		\pgf at y=0pt
-		\pgf at x=-\pgf at x
-	}
-	\anchor{4}{
-		\northwest
-		\pgf at y=\pgf at y
-		\pgf at x=0pt
-	}
-	\anchor{in 1}{
-		\northwest
-		\pgf at y=0pt
-	}
-	\anchor{in1}{
-		\northwest
-		\pgf at y=0pt
-	}
-	\anchor{in}{
-		\northwest
-		\pgf at y=0pt
-	}	  
-	\anchor{in 2}{
-		\northwest
-		\pgf at y=-\pgf at y
-		\pgf at x=0pt
-	}
-	\anchor{in2}{
-		\northwest
-		\pgf at y=-\pgf at y
-		\pgf at x=0pt
-	}
-	\anchor{out}{
-		\northwest
-		\pgf at y=0pt
-		\pgf at x=-\pgf at x
-	}
-	\anchor{center}{
-		\pgf at y=0pt
-		\pgf at x=0pt
-	}
-	\anchor{east}{
-		\northwest
-		\pgf at y=0pt
-		\pgf at x=-\pgf at x  
-	}
-	\anchor{west}{
-		\northwest
-		\pgf at y=0pt
-	}
-	\anchor{south}{
-		\northwest
-		\pgf at x=0pt
-		\pgf at y=-\pgf at y
-	}
-	\anchor{north}{
-		\northwest
-		\pgf at x=0pt
-	}
-	\anchor{south west}{
-		\northwest
-		\pgf at y=-\pgf at y
-	}
-	\anchor{north east}{
-		\northwest
-		\pgf at x=-\pgf at x
-	}
-	\anchor{north west}{
-		\northwest
-	}
-	\anchor{south east}{
-		\northwest
-		\pgf at x=-\pgf at x
-		\pgf at y=-\pgf at y
-	}
-	\backgroundpath{
-		\pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}	
-			
-		\pgf at circ@res at step=\ctikzvalof{tripoles/adder/width}\pgf at circ@Rlen
-			
-		\pgfscope
-			\pgfstartlinewidth=\pgflinewidth
-			
-			% draw outer box
-			\ifpgf at circuit@boxed
-				\pgfnode{box}{center}{}{pgf at box}{\pgfusepath{draw}}
-			\fi
-			
-			% draw outer circle
-			\ifpgf at circuit@boxed
-				\pgf at circ@res at step=.7\pgf at circ@res at step{}
-				\pgfsetdash{}{0pt}	% draw solid circle if boxed
-			\else
-				\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-			\fi
-			\pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf at circ@res at step}
-			\pgfusepath{draw}
-			
-			% draw inner stuff
-			\pgfsetdash{}{0pt}	% always draw solid line for inner symbol
-			\pgfsetlinewidth{\pgfstartlinewidth}
-			
-			\pgfpathmoveto{\pgfpointorigin}
-			\pgfpathmoveto{\pgfpointpolar{0}{0.3\pgf at circ@res at step}}
-			\pgfpathlineto{\pgfpointpolar{180}{0.3\pgf at circ@res at step}}
-			\pgfpathmoveto{\pgfpointorigin}
-			\pgfpathmoveto{\pgfpointpolar{90}{0.3\pgf at circ@res at step}}
-			\pgfpathlineto{\pgfpointpolar{270}{0.3\pgf at circ@res at step}}
-			\pgfsetlinewidth{2\pgflinewidth}
-			\pgfusepath{draw}
-			
-		\endpgfscope				  
-	}
+    \savedanchor\northwest{
+        \ifpgf at circuit@boxed
+            \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf at circ@Rlen
+            \pgf at y=.5\pgf at y
+            \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf at circ@Rlen
+            \pgf at x=.5\pgf at x
+        \else
+            \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/adder/width}\pgf at circ@Rlen
+            \pgf at y=.5\pgf at y
+            \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/adder/width}\pgf at circ@Rlen
+            \pgf at x=.5\pgf at x
+        \fi
+    }
+    \anchor{center}{
+        \pgfpointorigin
+    }
+    \anchor{left}{%
+        \northwest
+        \pgf at y=0pt
+    }
+    \anchor{1}{
+        \northwest
+        \pgf at y=0pt
+    }
+    \anchor{2}{
+        \northwest
+        \pgf at y=-\pgf at y
+        \pgf at x=0pt
+    }
+    \anchor{3}{
+        \northwest
+        \pgf at y=0pt
+        \pgf at x=-\pgf at x
+    }
+    \anchor{4}{
+        \northwest
+        \pgf at y=\pgf at y
+        \pgf at x=0pt
+    }
+    \anchor{in 1}{
+        \northwest
+        \pgf at y=0pt
+    }
+    \anchor{in1}{
+        \northwest
+        \pgf at y=0pt
+    }
+    \anchor{in}{
+        \northwest
+        \pgf at y=0pt
+    }
+    \anchor{in 2}{
+        \northwest
+        \pgf at y=-\pgf at y
+        \pgf at x=0pt
+    }
+    \anchor{in2}{
+        \northwest
+        \pgf at y=-\pgf at y
+        \pgf at x=0pt
+    }
+    \anchor{out}{
+        \northwest
+        \pgf at y=0pt
+        \pgf at x=-\pgf at x
+    }
+    \anchor{center}{
+        \pgf at y=0pt
+        \pgf at x=0pt
+    }
+    \anchor{east}{
+        \northwest
+        \pgf at y=0pt
+        \pgf at x=-\pgf at x
+    }
+    \anchor{west}{
+        \northwest
+        \pgf at y=0pt
+    }
+    \anchor{south}{
+        \northwest
+        \pgf at x=0pt
+        \pgf at y=-\pgf at y
+    }
+    \anchor{north}{
+        \northwest
+        \pgf at x=0pt
+    }
+    \anchor{south west}{
+        \northwest
+        \pgf at y=-\pgf at y
+    }
+    \anchor{north east}{
+        \northwest
+        \pgf at x=-\pgf at x
+    }
+    \anchor{north west}{
+        \northwest
+    }
+    \anchor{south east}{
+        \northwest
+        \pgf at x=-\pgf at x
+        \pgf at y=-\pgf at y
+    }
+    \backgroundpath{
+        \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+        \pgf at circ@res at step=\ctikzvalof{tripoles/adder/width}\pgf at circ@Rlen
+
+        \pgfscope
+            \pgfstartlinewidth=\pgflinewidth
+
+            % draw outer box
+            \ifpgf at circuit@boxed
+                \pgfnode{box}{center}{}{pgf at box}{\pgfusepath{draw}}
+            \fi
+
+            % draw outer circle
+            \ifpgf at circuit@boxed
+                \pgf at circ@res at step=.7\pgf at circ@res at step{}
+                \pgfsetdash{}{0pt}	% draw solid circle if boxed
+            \else
+                \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+            \fi
+            \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf at circ@res at step}
+            \pgf at circ@draworfill
+
+            % draw inner stuff
+            \pgfsetdash{}{0pt}	% always draw solid line for inner symbol
+            \pgfsetlinewidth{\pgfstartlinewidth}
+
+            \pgfpathmoveto{\pgfpointorigin}
+            \pgfpathmoveto{\pgfpointpolar{0}{0.3\pgf at circ@res at step}}
+            \pgfpathlineto{\pgfpointpolar{180}{0.3\pgf at circ@res at step}}
+            \pgfpathmoveto{\pgfpointorigin}
+            \pgfpathmoveto{\pgfpointpolar{90}{0.3\pgf at circ@res at step}}
+            \pgfpathlineto{\pgfpointpolar{270}{0.3\pgf at circ@res at step}}
+            \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
+            \pgfusepath{draw}
+
+        \endpgfscope
+    }
 }
 
 \pgfdeclareshape{oscillator}
 {
-	\savedanchor\northwest{
-		\ifpgf at circuit@boxed
-			\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf at circ@Rlen
-			\pgf at y=.5\pgf at y
-			\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf at circ@Rlen
-		\else	
-			\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/oscillator/width}\pgf at circ@Rlen
-			\pgf at y=.5\pgf at y
-			\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/oscillator/width}\pgf at circ@Rlen
-		\fi
-	}
-	\anchor{center}{
-		\pgfpointorigin
-	}
-	\anchor{north}{
-		\northwest
-		\pgf at x=.5\pgf at x
-	}
-	\anchor{south}{
-		\northwest
-		\pgf at x=.5\pgf at x
-		\pgf at y=-\pgf at y
-	}
-	\anchor{east}{
-		\northwest
-		\pgf at y=0pt
-		\pgf at x=0pt
-	}
-	\anchor{west}{
-		\northwest
-		\pgf at y=0pt
-	}
-	\anchor{text}{
-		\pgf at x=-2\pgf at x
-		\advance \pgf at x by -.5\wd\pgfnodeparttextbox
-		\advance \pgf at y by -1.5\ht\pgfnodeparttextbox
-	}
-	\backgroundpath{
-		\pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
-			
-		\pgf at circ@res at step=\ctikzvalof{tripoles/oscillator/width}\pgf at circ@Rlen{}
-			
-		\pgfscope
-			\pgfstartlinewidth=\pgflinewidth
-			
-			\pgftransformxshift{-0.5\pgf at circ@res at step} % The oscillator is shifted to the left, so a connection comes out of the anchor "east"
-			
-			% draw outer box
-			\ifpgf at circuit@boxed{}
-				\pgfnode{box}{center}{}{pgf at box}{\pgfusepath{draw}}
-			\fi
-			
-			% draw outer circle
-			\ifpgf at circuit@boxed
-				\pgf at circ@res at step=.7\pgf at circ@res at step{}
-				\pgfsetdash{}{0pt}	% draw solid circle if boxed
-			\else
-				\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-			\fi
-			\pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf at circ@res at step}
-			\pgfusepath{draw}
-			
-			% draw inner sine waves
-			\pgfsetdash{}{0pt}	% always draw solid line for inner symbol
-			\pgfsetlinewidth{\pgfstartlinewidth}
-			\pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
-			\pgfpathmoveto{\pgfpoint{-0.3\pgf at circ@res at step}{0\pgf at circ@res at step}}
-			\pgfpathsine{\pgfpoint{.15\pgf at circ@res at step}{.15\pgf at circ@res at step}}
-			\pgfpathcosine{\pgfpoint{.15\pgf at circ@res at step}{-.15\pgf at circ@res at step}}
-			\pgfpathsine{\pgfpoint{.15\pgf at circ@res at step}{-.15\pgf at circ@res at step}}
-			\pgfpathcosine{\pgfpoint{.15\pgf at circ@res at step}{.15\pgf at circ@res at step}}
-		
-			\pgfusepath{draw}
-			
-		\endpgfscope				  
-	}
+    \savedanchor\northwest{
+        \ifpgf at circuit@boxed
+            \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf at circ@Rlen
+            \pgf at y=.5\pgf at y
+            \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf at circ@Rlen
+        \else
+            \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/oscillator/width}\pgf at circ@Rlen
+            \pgf at y=.5\pgf at y
+            \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/oscillator/width}\pgf at circ@Rlen
+        \fi
+    }
+    \anchor{center}{
+        \pgfpointorigin
+    }
+    \anchor{north}{
+        \northwest
+        \pgf at x=.5\pgf at x
+    }
+    \anchor{south}{
+        \northwest
+        \pgf at x=.5\pgf at x
+        \pgf at y=-\pgf at y
+    }
+    \anchor{east}{
+        \northwest
+        \pgf at y=0pt
+        \pgf at x=0pt
+    }
+    \anchor{west}{
+        \northwest
+        \pgf at y=0pt
+    }
+    \anchor{south west}{ \northwest \pgf at y=-\pgf at y}
+    \anchor{north east}{ \northwest \pgf at x=0pt\relax}
+    \anchor{north west}{ \northwest }
+    \anchor{south east}{ \northwest \pgf at x=0pt \pgf at y=-\pgf at y }
+    \anchor{text}{
+        \pgf at x=-2\pgf at x
+        \advance \pgf at x by -.5\wd\pgfnodeparttextbox
+        \advance \pgf at y by -1.5\ht\pgfnodeparttextbox
+    }
+    \backgroundpath{
+        \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+        \pgf at circ@res at step=\ctikzvalof{tripoles/oscillator/width}\pgf at circ@Rlen{}
+
+        \pgfscope
+            \pgfstartlinewidth=\pgflinewidth
+
+            \pgftransformxshift{-0.5\pgf at circ@res at step} % The oscillator is shifted to the left, so a connection comes out of the anchor "east"
+
+            % draw outer box
+            \ifpgf at circuit@boxed{}
+                \pgfnode{box}{center}{}{pgf at box}{\pgfusepath{draw}}
+            \fi
+
+            % draw outer circle
+            \ifpgf at circuit@boxed
+                \pgf at circ@res at step=.7\pgf at circ@res at step{}
+                \pgfsetdash{}{0pt}	% draw solid circle if boxed
+            \else
+                \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+            \fi
+            \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf at circ@res at step}
+            \pgf at circ@draworfill
+
+            % draw inner sine waves
+            \pgfsetdash{}{0pt}	% always draw solid line for inner symbol
+            \pgfsetlinewidth{\pgfstartlinewidth}
+            \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
+            \pgfpathmoveto{\pgfpoint{-0.3\pgf at circ@res at step}{0\pgf at circ@res at step}}
+            \pgfpathsine{\pgfpoint{.15\pgf at circ@res at step}{.15\pgf at circ@res at step}}
+            \pgfpathcosine{\pgfpoint{.15\pgf at circ@res at step}{-.15\pgf at circ@res at step}}
+            \pgfpathsine{\pgfpoint{.15\pgf at circ@res at step}{-.15\pgf at circ@res at step}}
+            \pgfpathcosine{\pgfpoint{.15\pgf at circ@res at step}{.15\pgf at circ@res at step}}
+
+            \pgfusepath{draw}
+
+        \endpgfscope
+    }
 }
 
 \pgfdeclareshape{circulator}
@@ -3049,7 +3712,7 @@
 			\pgf at y=.5\pgf at y
 			\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf at circ@Rlen
 			\pgf at x=.5\pgf at x
-		\else	
+		\else
 			\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/circulator/width}\pgf at circ@Rlen
 			\pgf at y=.5\pgf at y
 			\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/circulator/width}\pgf at circ@Rlen
@@ -3080,7 +3743,7 @@
 	\anchor{east}{
 		\northwest
 		\pgf at y=0pt
-		\pgf at x=-\pgf at x  
+		\pgf at x=-\pgf at x
 	}
 	\anchor{west}{
 		\northwest
@@ -3112,18 +3775,18 @@
 		\pgf at y=-\pgf at y
 	}
 	\backgroundpath{
-		\pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}	
-			
+		\pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
 		\pgf at circ@res at step=\ctikzvalof{tripoles/circulator/width}\pgf at circ@Rlen
-			
+
 		\pgfscope
 			\pgfstartlinewidth=\pgflinewidth
-			
+
 			% draw outer box
 			\ifpgf at circuit@boxed
 				\pgfnode{box}{center}{}{pgf at box}{\pgfusepath{draw}}
 			\fi
-			
+
 			% draw outer circle
 			\ifpgf at circuit@boxed{}
 				\pgf at circ@res at step=.7\pgf at circ@res at step{}
@@ -3132,19 +3795,19 @@
 				\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
 			\fi
 			\pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf at circ@res at step}
-			\pgfusepath{draw}
-			
+                        \pgf at circ@draworfill
+
 			% inner arrow
 			\pgfsetdash{}{0pt}	% always draw solid line for inner symbol
 			\pgfsetlinewidth{\pgfstartlinewidth}
-			
+
 			\pgfsetarrowsend{latex}
 			\pgfpathmoveto{\pgfpoint{-0.25\pgf at circ@res at step}{0}}
 			\pgfpatharc{180}{-90} {0.25\pgf at circ@res at step}
 			\pgfpathlineto{\pgfpoint{-5pt}{-0.2\pgf at circ@res at step}}
 			\pgfusepath{draw}
-			
-		\endpgfscope				  
+
+		\endpgfscope
 	}
 }
 
@@ -3151,373 +3814,368 @@
 
 % Wilkinson divider
 \pgfdeclareshape{wilkinson}{
-		\anchor{center}{
-			\northwest
-			\pgf at x=0pt
-			\pgf at y=0pt
-		}
-		\savedanchor\northwest{%
-			\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/wilkinson/height}\pgf at circ@Rlen
-			\pgf at y=.5\pgf at y
-			\pgf at x= \pgf at circ@Rlen
-			\pgf at x=.5\pgf at x
-			\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/wilkinson/width}\pgf at x
-			}
-		\anchor{north}{
-			\northwest
-			\pgf at x=0pt
-		}
-		\anchor{south}{
-			\northwest
-			\pgf at x=0pt
-			\pgf at y=-\pgf at y
-		}
-		\anchor{west}{
-			\northwest
-			\pgf at y=0pt
-		}
-		\anchor{east}{
-			\northwest
-			\pgf at y=0pt
-			\pgf at x=-\pgf at x
-		}
-		\anchor{south west}{
-			\northwest
-			\pgf at y=-\pgf at y
-		}
-		\anchor{north east}{
-			\northwest
-			\pgf at x=-\pgf at x
-		}
-			\anchor{north west}{
-			\northwest
-		}
-		\anchor{south east}{
-			\northwest
-			\pgf at x=-\pgf at x
-			\pgf at y=-\pgf at y
-		}
-		\anchor{in}{
-			\northwest
-			\pgf at y=0pt
-		}
-		\anchor{out1}{
-			\northwest
-			\pgf at x=-\pgf at x
-			\pgf at y=-0.5\pgf at y
-		}
-		\anchor{out2}{
-			\northwest
-			\pgf at x=-\pgf at x
-			\pgf at y=0.5\pgf at y
-		}
-		\anchor{text}{
-			\northwest
-			\advance \pgf at y by 0.5\ht\pgfnodeparttextbox
-			\pgf at x=-.5\wd\pgfnodeparttextbox
-		}
-		\backgroundpath{			
-				\pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}	
-			
-				\northwest
-				\pgf at circ@res at up = \pgf at y 
-				\pgf at circ@res at down = -\pgf at y
-				\pgf at circ@res at right = -\pgf at x
-				\pgf at circ@res at left = \pgf at x
-			
-				\pgfstartlinewidth=\pgflinewidth
+    \anchor{center}{
+        \northwest
+        \pgf at x=0pt
+        \pgf at y=0pt
+    }
+    \savedanchor\northwest{%
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/wilkinson/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at x= \pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/wilkinson/width}\pgf at x
+    }
+    \anchor{north}{
+        \northwest
+        \pgf at x=0pt
+    }
+    \anchor{south}{
+        \northwest
+        \pgf at x=0pt
+        \pgf at y=-\pgf at y
+    }
+    \anchor{west}{
+        \northwest
+        \pgf at y=0pt
+    }
+    \anchor{east}{
+        \northwest
+        \pgf at y=0pt
+        \pgf at x=-\pgf at x
+    }
+    \anchor{south west}{
+        \northwest
+        \pgf at y=-\pgf at y
+    }
+    \anchor{north east}{
+        \northwest
+        \pgf at x=-\pgf at x
+    }
+    \anchor{north west}{
+        \northwest
+    }
+    \anchor{south east}{
+        \northwest
+        \pgf at x=-\pgf at x
+        \pgf at y=-\pgf at y
+    }
+    \anchor{in}{
+        \northwest
+        \pgf at y=0pt
+    }
+    \anchor{out1}{
+        \northwest
+        \pgf at x=-\pgf at x
+        \pgf at y=-0.5\pgf at y
+    }
+    \anchor{out2}{
+        \northwest
+        \pgf at x=-\pgf at x
+        \pgf at y=0.5\pgf at y
+    }
+    \anchor{text}{
+        \northwest
+        \advance \pgf at y by 0.5\ht\pgfnodeparttextbox
+        \pgf at x=-.5\wd\pgfnodeparttextbox
+    }
+    \backgroundpath{
+        \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
 
-				% draw outer box
-				\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-				\pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
-				\pgfusepath{draw}
-				
-				% draw inner stuff
-				\pgfsetdash{}{0pt}	% always draw solid line for inner symbol
-				\pgfsetarrows{-} %never draw arrows
-				\pgfsetlinewidth{\pgfstartlinewidth}
-				\pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
-				\pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at left}{0pt}}
-				\pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0.5\pgf at circ@res at up}}
-				\pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at right}{0.5\pgf at circ@res at up}}
-				\pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at left}{0pt}}
-				\pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at right}{0.5\pgf at circ@res at down}}
-				\pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0.5\pgf at circ@res at 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 at circ@res at right}{0pt}}
-					\pgftransformrotate{90}
-					
-					% calculate size of resistor
-					\ifpgf at circuit@europeanresistor
-						\pgfmathparse{\pgf at circ@res at up / \pgf at circ@Rlen / \ctikzvalof{bipoles/generic/width} / 2}
-						\pgftransformscale{\pgfmathresult}
-						\pgfnode{genericshape}{center}{}{pgf at generic}{\pgfusepath{fill}}
-					\else
-						\pgfmathparse{\pgf at circ@res at up / \pgf at circ@Rlen / \ctikzvalof{bipoles/resistor/width} / 2}
-						\pgftransformscale{\pgfmathresult}
-						\pgfnode{resistorshape}{center}{}{pgf at resistor}{\pgfusepath{fill}}
-					\fi
-				}
-				
-				\pgfpathmoveto{\pgfpoint{0.5\pgf at circ@res at right}{0.5\pgf at circ@res at up}}
-				\pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at right}{0.25\pgf at circ@res at up}}
-				
-				\pgfpathmoveto{\pgfpoint{0.5\pgf at circ@res at right}{0.25\pgf at circ@res at down}}
-				\pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at right}{0.5\pgf at circ@res at down}}
-				\pgfusepath{draw}
+        \northwest
+        \pgf at circ@res at up = \pgf at y
+        \pgf at circ@res at down = -\pgf at y
+        \pgf at circ@res at right = -\pgf at x
+        \pgf at circ@res at left = \pgf at x
 
-		}
+        \pgfstartlinewidth=\pgflinewidth
+
+        % draw outer box
+        \pgf at circ@twoportbox
+
+        % draw inner stuff
+        \pgfsetdash{}{0pt}	% always draw solid line for inner symbol
+        \pgfsetarrows{-} %never draw arrows
+        \pgfsetlinewidth{\pgfstartlinewidth}
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+        \pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at left}{0pt}}
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0.5\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at right}{0.5\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at left}{0pt}}
+        \pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at right}{0.5\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0.5\pgf at circ@res at 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 at circ@res at right}{0pt}}
+            \pgftransformrotate{90}
+
+            % calculate size of resistor
+            \ifpgf at circuit@europeanresistor
+                \pgfmathparse{\pgf at circ@res at up / \pgf at circ@Rlen / \ctikzvalof{bipoles/generic/width} / 2}
+                \pgftransformscale{\pgfmathresult}
+                \pgfnode{genericshape}{center}{}{pgf at generic}{\pgfusepath{fill}}
+            \else
+                \pgfmathparse{\pgf at circ@res at up / \pgf at circ@Rlen / \ctikzvalof{bipoles/resistor/width} / 2}
+                \pgftransformscale{\pgfmathresult}
+                \pgfnode{resistorshape}{center}{}{pgf at resistor}{\pgfusepath{fill}}
+            \fi
+        }
+
+        \pgfpathmoveto{\pgfpoint{0.5\pgf at circ@res at right}{0.5\pgf at circ@res at up}}
+        \pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at right}{0.25\pgf at circ@res at up}}
+
+        \pgfpathmoveto{\pgfpoint{0.5\pgf at circ@res at right}{0.25\pgf at circ@res at down}}
+        \pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at right}{0.5\pgf at circ@res at down}}
+        \pgfusepath{draw}
+
+    }
 }
 
 % electromechanical device (motor/generator)
 \pgfdeclareshape{elmech}
 {
-	\savedanchor\northwest{
-			\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/elmech/height}\pgf at circ@Rlen
-			\pgf at y=.5\pgf at y
-			\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/elmech/width}\pgf at circ@Rlen
-			\pgf at x=.5\pgf at x
-	}
-	\anchor{center}{
-		\pgfpointorigin
-	}
-	  \anchor{text}{
-		\pgfpointorigin
-		\advance \pgf at x by -.5\wd\pgfnodeparttextbox
-		\advance \pgf at y by -.5\ht\pgfnodeparttextbox
-	}
-	\anchor{left}{%
-		\northwest
-		\pgf at y=0pt
-	}
-	\anchor{right}{%
-		\northwest
-		\pgf at y=0pt
-		\pgf at x=-\pgf at x
-	}
-	\anchor{top}{
-		\northwest
-		\pgf at x=0pt
-	}
-	\anchor{pathstart}{
-		\northwest
-		\pgf at x=0pt
-	}
-	\anchor{pathend}{
-		\northwest
-		\pgf at x=0pt
-		\pgf at y=-\pgf at y
-	}
-	\anchor{bottom}{
-		\northwest
-		\pgf at x=0pt
-		\pgf at y=-\pgf at y
-	}
-	\anchor{center}{
-		\pgf at y=0pt
-		\pgf at x=0pt
-	}
-	\anchor{east}{
-		\northwest
-		\pgf at y=0pt
-		\pgf at x=-\pgf at x
-	}
-	\anchor{west}{
-		\northwest
-		\pgf at y=0pt
-	}
-	\anchor{south}{
-		\northwest
-		\pgf at x=0pt
-		\pgf at y=-\pgf at y
-	}
-	\anchor{north}{
-		\northwest
-		\pgf at x=0pt
-	}
-		\backgroundpath{
-		\pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
-		\pgf at circ@res at step=\ctikzvalof{tripoles/elmech/width}\pgf at circ@Rlen
-		\pgf at circ@res at up=\ctikzvalof{tripoles/elmech/height}\pgf at circ@Rlen
-		\pgfscope
-			\pgfstartlinewidth=\pgflinewidth
-			% draw outer box
-		%	\ifpgf at circuit@boxed
-		%		\pgfnode{box}{center}{}{pgf at box}{\pgfusepath{draw}}
-		%	\fi
-			% draw outer circle
-			%\ifpgf at circuit@boxed
-			%	\pgf at circ@res at step=.7\pgf at circ@res at step
-			%	\pgfsetdash{}{0pt}	% draw solid circle if boxed
-			%\else
-				\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-			%\fi
-			\pgfpathrectangle{\pgfpoint{-.25\pgf at circ@res at step}{-.5\pgf at circ@res at up}}{\pgfpoint{.5\pgf at circ@res at step}{\pgf at circ@res at up}}
-			\pgfsetfillcolor{black}
-			\pgfusepath{draw,fill}
-			\pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf at circ@res at step}
-			\pgfsetfillcolor{white}
-			\pgfusepath{draw,fill}
-		\endpgfscope
-	}
+    \savedanchor\northwest{
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/elmech/height}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/elmech/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+    }
+    \anchor{center}{
+        \pgfpointorigin
+    }
+    \anchor{text}{
+        \pgfpointorigin
+        \advance \pgf at x by -.5\wd\pgfnodeparttextbox
+        \advance \pgf at y by -.5\ht\pgfnodeparttextbox
+    }
+    \anchor{left}{%
+        \northwest
+        \pgf at y=0pt
+    }
+    \anchor{right}{%
+        \northwest
+        \pgf at y=0pt
+        \pgf at x=-\pgf at x
+    }
+    \anchor{top}{
+        \northwest
+        \pgf at x=0pt
+    }
+    \anchor{pathstart}{
+        \northwest
+        \pgf at x=0pt
+    }
+    \anchor{pathend}{
+        \northwest
+        \pgf at x=0pt
+        \pgf at y=-\pgf at y
+    }
+    \anchor{bottom}{
+        \northwest
+        \pgf at x=0pt
+        \pgf at y=-\pgf at y
+    }
+    \anchor{center}{
+        \pgf at y=0pt
+        \pgf at x=0pt
+    }
+    \anchor{east}{
+        \northwest
+        \pgf at y=0pt
+        \pgf at x=-\pgf at x
+    }
+    \anchor{west}{
+        \northwest
+        \pgf at y=0pt
+    }
+    \anchor{south}{
+        \northwest
+        \pgf at x=0pt
+        \pgf at y=-\pgf at y
+    }
+    \anchor{north}{
+        \northwest
+        \pgf at x=0pt
+    }
+    \anchor{south west}{ \northwest \pgf at y=-\pgf at y }
+    \anchor{north east}{ \northwest \pgf at x=-\pgf at x }
+    \anchor{north west}{ \northwest }
+    \anchor{south east}{ \northwest \pgf at x=-\pgf at x \pgf at y=-\pgf at y }
+    \backgroundpath{
+        \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+        \pgf at circ@res at step=\ctikzvalof{tripoles/elmech/width}\pgf at circ@Rlen
+        \pgf at circ@res at up=\ctikzvalof{tripoles/elmech/height}\pgf at circ@Rlen
+        \pgfscope
+            \pgfstartlinewidth=\pgflinewidth
+            \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+            \pgfscope % clip the bar: whole size minus the circle
+                \pgfpathrectanglecorners{\pgfpoint{-.5\pgf at circ@res at step}{-.5\pgf at circ@res at up}}{\pgfpoint{.5\pgf at circ@res at step}{.5\pgf at circ@res at up}}
+                \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf at circ@res at step}
+                \pgfseteorule
+                \pgfusepath{clip}
+                \pgfpathrectangle{\pgfpoint{-.25\pgf at circ@res at step}{-.5\pgf at circ@res at up}}{\pgfpoint{.5\pgf at circ@res at step}{\pgf at circ@res at up}}
+                \pgfsetfillcolor{black}
+                \pgfusepath{fill, draw}
+            \endpgfscope
+            \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf at circ@res at step}
+            \ifx\tikz at fillcolor\pgfutil at empty
+                \pgfsetfillcolor{white}
+            \else
+                \pgfsetfillcolor{\tikz at fillcolor}
+            \fi
+            \pgfusepath{draw, fill}
+        \endpgfscope
+    }
 }
 
 \pgfdeclareshape{magnetron}
 {
-	\savedanchor\northwest{
-			\pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/magnetron/width}\pgf at circ@Rlen
-			\pgf at y=.5\pgf at y
-			\pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/magnetron/width}\pgf at circ@Rlen
-			\pgf at x=.5\pgf at x
-	}
-	\anchor{center}{
-		\pgfpointorigin
-	}
-	\anchor{anode}{
-		\northwest
-		\pgf at x=0pt
-		\pgf at y=-\pgf at y
-	}
-	\anchor{cathode1}{
-		\northwest
-		\pgf at circ@res at step=\pgf at y
-		\pgfmathparse{cos(105)}
-		\pgf at x=\pgfmathresult\pgf at circ@res at step
-		\pgfmathparse{sin(105)}
-		\pgf at y=\pgfmathresult\pgf at circ@res at step
-		%\pgfpointorigin
-		%\pgfpathmoveto{\pgfpointpolar{105}{\pgf at circ@res at step}}%not working in a scaled tikzpicture
-	}
-	\anchor{cathode2}{
-		\northwest
-		\pgf at circ@res at step=\pgf at y
-		\pgfmathparse{cos(75)}
-		\pgf at x=\pgfmathresult\pgf at circ@res at step
-		\pgfmathparse{sin(75)}
-		\pgf at y=\pgfmathresult\pgf at circ@res at step
-		%\pgfpointorigin
-		%\pgfpathmoveto{\pgfpointpolar{75}{\pgf at circ@res at step}}%not working in a scaled tikzpicture
-	}
-	  \anchor{text}{
-		\pgfpointorigin
-		\advance \pgf at x by -.5\wd\pgfnodeparttextbox
-		\advance \pgf at y by -.5\ht\pgfnodeparttextbox
-	}
-	\anchor{left}{%
-		\northwest
-		\pgf at y=0pt
-	}
-	\anchor{right}{%
-		\northwest
-		\pgf at y=0pt
-		\pgf at x=-\pgf at x
-	}
-	\anchor{top}{
-		\northwest
-		\pgf at x=0pt
-	}
-	\anchor{pathstart}{
-		\northwest
-		\pgf at x=0pt
-	}
-	\anchor{pathend}{
-		\northwest
-		\pgf at x=0pt
-		\pgf at y=-\pgf at y
-	}
-	\anchor{bottom}{
-		\northwest
-		\pgf at x=0pt
-		\pgf at y=-\pgf at y
-	}
-	\anchor{center}{
-		\pgf at y=0pt
-		\pgf at x=0pt
-	}
-	\anchor{east}{
-		\northwest
-		\pgf at y=0pt
-		\pgf at x=-\pgf at x
-	}
-	\anchor{west}{
-		\northwest
-		\pgf at y=0pt
-	}
-	\anchor{south}{
-		\northwest
-		\pgf at x=0pt
-		\pgf at y=-\pgf at y
-	}
-	\anchor{north}{
-		\northwest
-		\pgf at x=0pt
-	}
-		\backgroundpath{
-		\pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
-		\pgf at circ@res at step=\ctikzvalof{tripoles/magnetron/width}\pgf at circ@Rlen
-			\northwest
-			\pgf at circ@res at up = \pgf at y 
-			\pgf at circ@res at down = -\pgf at y
-			\pgf at circ@res at right = -\pgf at x  
-			\pgf at circ@res at left = \pgf at x
-			\pgfmathsetlength{\pgf at circ@res at other}{sin(15)*\pgf at circ@res at up}
+    \savedanchor\northwest{
+        \pgf at y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/magnetron/width}\pgf at circ@Rlen
+        \pgf at y=.5\pgf at y
+        \pgf at x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/magnetron/width}\pgf at circ@Rlen
+        \pgf at x=.5\pgf at x
+    }
+    \anchor{center}{
+        \pgfpointorigin
+    }
+    \anchor{anode}{
+        \northwest
+        \pgf at x=0pt
+        \pgf at y=-\pgf at y
+    }
+    \anchor{cathode1}{
+        \northwest
+        \pgf at circ@res at step=\pgf at y
+        \pgfmathparse{cos(105)}
+        \pgf at x=\pgfmathresult\pgf at circ@res at step
+        \pgfmathparse{sin(105)}
+        \pgf at y=\pgfmathresult\pgf at circ@res at step
+        %\pgfpointorigin
+        %\pgfpathmoveto{\pgfpointpolar{105}{\pgf at circ@res at step}}%not working in a scaled tikzpicture
+    }
+    \anchor{cathode2}{
+        \northwest
+        \pgf at circ@res at step=\pgf at y
+        \pgfmathparse{cos(75)}
+        \pgf at x=\pgfmathresult\pgf at circ@res at step
+        \pgfmathparse{sin(75)}
+        \pgf at y=\pgfmathresult\pgf at circ@res at step
+        %\pgfpointorigin
+        %\pgfpathmoveto{\pgfpointpolar{75}{\pgf at circ@res at step}}%not working in a scaled tikzpicture
+    }
+    \anchor{text}{
+        \pgfpointorigin
+        \advance \pgf at x by -.5\wd\pgfnodeparttextbox
+        \advance \pgf at y by -.5\ht\pgfnodeparttextbox
+    }
+    \anchor{left}{%
+        \northwest
+        \pgf at y=0pt
+    }
+    \anchor{right}{%
+        \northwest
+        \pgf at y=0pt
+        \pgf at x=-\pgf at x
+    }
+    \anchor{top}{
+        \northwest
+        \pgf at x=0pt
+    }
+    \anchor{pathstart}{
+        \northwest
+        \pgf at x=0pt
+    }
+    \anchor{pathend}{
+        \northwest
+        \pgf at x=0pt
+        \pgf at y=-\pgf at y
+    }
+    \anchor{bottom}{
+        \northwest
+        \pgf at x=0pt
+        \pgf at y=-\pgf at y
+    }
+    \anchor{center}{
+        \pgf at y=0pt
+        \pgf at x=0pt
+    }
+    \anchor{east}{
+        \northwest
+        \pgf at y=0pt
+        \pgf at x=-\pgf at x
+    }
+    \anchor{west}{
+        \northwest
+        \pgf at y=0pt
+    }
+    \anchor{south}{
+        \northwest
+        \pgf at x=0pt
+        \pgf at y=-\pgf at y
+    }
+    \anchor{north}{
+        \northwest
+        \pgf at x=0pt
+    }
+    \anchor{south west}{ \northwest \pgf at y=-\pgf at y }
+    \anchor{north east}{ \northwest \pgf at x=-\pgf at x }
+    \anchor{north west}{ \northwest }
+    \anchor{south east}{ \northwest \pgf at x=-\pgf at x \pgf at y=-\pgf at y }
+    \backgroundpath{
+        \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+        \pgf at circ@res at step=\ctikzvalof{tripoles/magnetron/width}\pgf at circ@Rlen
+        \northwest
+        \pgf at circ@res at up = \pgf at y
+        \pgf at circ@res at down = -\pgf at y
+        \pgf at circ@res at right = -\pgf at x
+        \pgf at circ@res at left = \pgf at x
+        \pgfmathsetlength{\pgf at circ@res at other}{sin(15)*\pgf at circ@res at up}
 
-		\pgfscope
-			\pgfstartlinewidth=\pgflinewidth
-			% draw outer box
-		%	\ifpgf at circuit@boxed
-		%		\pgfnode{box}{center}{}{pgf at box}{\pgfusepath{draw}}
-		%	\fi
-			% draw outer circle
-			%\ifpgf at circuit@boxed
-			%	\pgf at circ@res at step=.7\pgf at circ@res at step
-			%	\pgfsetdash{}{0pt}	% draw solid circle if boxed
-			%\else
-				\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-			%\fi
-			%create outer circle
-			\pgfpathcircle{\pgfpoint{0}{0}} {\pgf at circ@res at right}
-			\pgfsetfillcolor{white}
-			\pgfusepath{draw}
-			%create chambers
-			 \foreach \angle in {45,135,225,315}{
-						\pgfpathmoveto{ \pgfpointpolar{\angle}{0.6\pgf at circ@res at right}}
-						\pgfpathlineto{ \pgfpointpolar{\angle}{\pgf at circ@res at right}}
-					}
-			\pgfsetroundcap
-			\pgfusepath{draw}
-			\pgfscope
-			%draw connection from outside
-			%anode
-				\pgfsetlinewidth{\pgfstartlinewidth}
-				\pgfpathmoveto{\pgfpoint{0\pgf at circ@res at left}{\pgf at circ@res at down}}
-				\pgfpathlineto{\pgfpoint{0\pgf at circ@res at right}{.5\pgf at circ@res at down}}
-				%cathodes
-				\pgfpathmoveto{\pgfpointpolar{105}{\pgf at circ@res at up}}
-				\pgfpathlineto{\pgfpoint{-\pgf at circ@res at other}{.5\pgf at circ@res at up}}
-				\pgfpathmoveto{\pgfpointpolar{75}{\pgf at circ@res at up}}
-				\pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{.5\pgf at circ@res at up}}
-				\pgfsetbuttcap
-				\pgfusepath{draw}
-			\endpgfscope
-			%create cathode
-			\pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{.5\pgf at circ@res at up}}
-			\pgfpathlineto{\pgfpoint{0}{.15\pgf at circ@res at up}}
-			\pgfpathlineto{\pgfpoint{-\pgf at circ@res at other}{.5\pgf at circ@res at up}}
-						\pgfusepath{draw}
-			%create anode
-			\pgfpathmoveto{\pgfpoint{0.3\pgf at circ@res at left}{.5\pgf at circ@res at down}}
-			\pgfpathlineto{\pgfpoint{0.3\pgf at circ@res at right}{.5\pgf at circ@res at down}}
-			
-			\pgfsetbuttcap
-			\pgfusepath{draw}
-		\endpgfscope
-	}
+        \pgfscope
+            \pgfstartlinewidth=\pgflinewidth
+            \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+            %create outer circle
+            \pgfpathcircle{\pgfpoint{0}{0}} {\pgf at circ@res at right}
+            \pgf at circ@draworfill
+            %create chambers
+            \foreach \angle in {45,135,225,315}{
+                \pgfpathmoveto{ \pgfpointpolar{\angle}{0.6\pgf at circ@res at right}}
+                \pgfpathlineto{ \pgfpointpolar{\angle}{\pgf at circ@res at right}}
+            }
+            \pgfsetroundcap
+            \pgfusepath{draw}
+            \pgfscope
+                %draw connection from outside
+                %anode
+                \pgfsetlinewidth{\pgfstartlinewidth}
+                \pgfpathmoveto{\pgfpoint{0\pgf at circ@res at left}{\pgf at circ@res at down}}
+                \pgfpathlineto{\pgfpoint{0\pgf at circ@res at right}{.5\pgf at circ@res at down}}
+                %cathodes
+                \pgfpathmoveto{\pgfpointpolar{105}{\pgf at circ@res at up}}
+                \pgfpathlineto{\pgfpoint{-\pgf at circ@res at other}{.5\pgf at circ@res at up}}
+                \pgfpathmoveto{\pgfpointpolar{75}{\pgf at circ@res at up}}
+                \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{.5\pgf at circ@res at up}}
+                \pgfsetbuttcap
+                \pgfusepath{draw}
+            \endpgfscope
+            %create cathode
+            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{.5\pgf at circ@res at up}}
+            \pgfpathlineto{\pgfpoint{0}{.15\pgf at circ@res at up}}
+            \pgfpathlineto{\pgfpoint{-\pgf at circ@res at other}{.5\pgf at circ@res at up}}
+            \pgfusepath{draw}
+            %create anode
+            \pgfpathmoveto{\pgfpoint{0.3\pgf at circ@res at left}{.5\pgf at circ@res at down}}
+            \pgfpathlineto{\pgfpoint{0.3\pgf at circ@res at right}{.5\pgf at circ@res at down}}
+
+            \pgfsetbuttcap
+            \pgfusepath{draw}
+        \endpgfscope
+    }
 }
 
 \endinput

Modified: trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex	2019-05-10 21:14:43 UTC (rev 51070)
+++ trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex	2019-05-10 21:15:08 UTC (rev 51071)
@@ -5,11 +5,11 @@
 % 1. under the LaTeX Project Public License and/or
 % 2. under the GNU Public License.
 %
-% See the file doc/LICENSE for more details.
+% See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
 
 %\def\pgf at circ@handleSI#1{%
  % \pgf at circ@siunitx at resfalse
-%  
+%
  % \edef\len{\stringlength[e]{#1}}
   %\testmatchingchar[e]{#1}{\len}{>}%
   %\ifmatchingchar%
@@ -19,38 +19,38 @@
 	  %\pgf at circ@siunitx at restrue
 %	\else
 %	\fi
-  %\else 
+  %\else
   %\fi
 %}
 
 \def\pgf at circ@handleSI#1{
-	\noexpandarg
-        	\def\pgf at temp{}
-	\StrBetween{#1}{<}{>}[\pgf at circ@handleSI at unit]
-	\StrLen{\pgf at circ@handleSI at unit}[\pgf at circ@handleSI at unit@len]
+    \noexpandarg
+    \def\pgf at temp{}
+    \StrBetween{#1}{<}{>}[\pgf at circ@handleSI at unit]
+    \StrLen{\pgf at circ@handleSI at unit}[\pgf at circ@handleSI at unit@len]
 
-	\ifnum\pgf at circ@handleSI at unit@len=0  
-	  \pgf at circ@siunitx at resfalse  
-	\else  
-	  \IfEndWith{#1}{>}{
-	  	\pgf at circ@siunitx at restrue 
-		\noexpandarg
-	  	\StrBefore{#1}{<}[\pgf at circ@handleSI at val]		
-                %\typeout{si |#1|}
-	  }{
-	  	\pgf at circ@siunitx at resfalse 
-                %\typeout{no si |#1|}
-	  }
-	\fi
+    \ifnum\pgf at circ@handleSI at unit@len=0
+    \pgf at circ@siunitx at resfalse
+    \else
+    \IfEndWith{#1}{>}{
+        \pgf at circ@siunitx at restrue
+        \noexpandarg
+        \StrBefore{#1}{<}[\pgf at circ@handleSI at val]
+        %\typeout{si |#1|}
+        }{
+        \pgf at circ@siunitx at resfalse
+        %\typeout{no si |#1|}
+    }
+\fi
 }
 
 \def\pgf at circ@ifkeyempty#1{
-	\pgfextra{
-		\ctikzset{#1/.get=\pgf at circ@temp}
-		\edef\pgf at temp{}
-	}
-	\ifx\pgf at circ@temp\pgf at temp
-}
+    \pgfextra{
+        \ctikzset{#1/.get=\pgf at circ@temp}
+        \edef\pgf at temp{}
+    }
+    \ifx\pgf at circ@temp\pgf at temp
+    }
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %%    Math routines
@@ -57,5 +57,4 @@
 
 \def\pgf at circ@stripdecimals#1.#2\pgf at nil{#1}
 
-
-\endinput
\ No newline at end of file
+\endinput

Modified: trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex	2019-05-10 21:14:43 UTC (rev 51070)
+++ trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex	2019-05-10 21:15:08 UTC (rev 51071)
@@ -5,7 +5,7 @@
 % 1. under the LaTeX Project Public License and/or
 % 2. under the GNU Public License.
 %
-% See the file doc/LICENSE for more details.
+% See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %%  Voltage management
@@ -12,31 +12,31 @@
 
 
 \ctikzset{v^>/.style = {
-		v = #1,
-		\circuitikzbasekey/bipole/voltage/direction = forward,
-		\circuitikzbasekey/bipole/voltage/position = above
-	}
+        v = #1,
+        \circuitikzbasekey/bipole/voltage/direction = forward,
+        \circuitikzbasekey/bipole/voltage/position = above
+    }
 }
 
 \ctikzset{v^</.style = {
-		v = #1,
-		\circuitikzbasekey/bipole/voltage/direction = backward,
-		\circuitikzbasekey/bipole/voltage/position = above
-	}
+        v = #1,
+        \circuitikzbasekey/bipole/voltage/direction = backward,
+        \circuitikzbasekey/bipole/voltage/position = above
+    }
 }
 
 \ctikzset{v_>/.style = {
-		v = #1,
-		\circuitikzbasekey/bipole/voltage/direction = forward,
-		\circuitikzbasekey/bipole/voltage/position = below
-	} 
+        v = #1,
+        \circuitikzbasekey/bipole/voltage/direction = forward,
+        \circuitikzbasekey/bipole/voltage/position = below
+    }
 }
 
 \ctikzset{v_</.style = {
-		v = #1,
-		\circuitikzbasekey/bipole/voltage/direction = backward,
-		\circuitikzbasekey/bipole/voltage/position = below
-	}
+        v = #1,
+        \circuitikzbasekey/bipole/voltage/direction = backward,
+        \circuitikzbasekey/bipole/voltage/position = below
+    }
 }
 
 \ctikzset{v_/.style = {v = #1, \circuitikzbasekey/bipole/voltage/position = below} }
@@ -47,305 +47,370 @@
 % Default position varies whether the component is a voltage source
 % or not
 \ctikzset{v/.code = {
-			\ifpgf at circuit@bipole at isvoltage
-				\pgfkeys{\circuitikzbasekey/bipole/voltage/position=above,
-					\circuitikzbasekey/bipole/voltage/direction=forward}
-			\else
-				\ifpgf at circ@oldvoltagedirection
-				\pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
-					\circuitikzbasekey/bipole/voltage/direction=backward}
-				\else
-				\pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
-					\circuitikzbasekey/bipole/voltage/direction=forward}
-				\fi
-			\fi
-			\ifpgf at circ@oldvoltagedirection\else
-			\ifpgf at circuit@bipole at iscurrent
-			\ifpgf at circuit@bipole at current@backward
-					\pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
-					\circuitikzbasekey/bipole/voltage/direction=forward}
-			\else
-					\pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
-					\circuitikzbasekey/bipole/voltage/direction=backward}
-			\fi\fi\fi
-	\pgfkeys{/tikz/circuitikz/bipole/voltage/label/name=#1}
-	\ctikzsetvalof{bipole/voltage/label/unit}{}
-	\ifpgf at circ@siunitx 
-		\pgf at circ@handleSI{#1}
-		\ifpgf at circ@siunitx at res
-			\edef\pgf at temp{\pgf at circ@handleSI at val}
-			\pgfkeyslet{/tikz/circuitikz/bipole/voltage/label/name}{\pgf at temp}
-			\edef\pgf at temp{\pgf at circ@handleSI at unit}
-			\pgfkeyslet{/tikz/circuitikz/bipole/voltage/label/unit}{\pgf at temp}
-		\else
-		\fi
-	\else
-	\fi
-	}
+        \ifpgf at circuit@bipole at isvoltage
+            \pgfkeys{\circuitikzbasekey/bipole/voltage/position=above,
+            \circuitikzbasekey/bipole/voltage/direction=forward}
+        \else
+            \ifpgf at circ@oldvoltagedirection
+                \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
+                \circuitikzbasekey/bipole/voltage/direction=backward}
+            \else
+                \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
+                \circuitikzbasekey/bipole/voltage/direction=forward}
+            \fi
+        \fi
+        \ifpgf at circ@oldvoltagedirection
+            \ifpgf at circuit@bipole at iscurrent\ifpgf at circ@fixbatteries
+                \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
+                \circuitikzbasekey/bipole/voltage/direction=forward}
+        \fi\fi
+        \else
+        \ifpgf at circuit@bipole at iscurrent
+            \ifpgf at circuit@bipole at current@backward
+                \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
+                \circuitikzbasekey/bipole/voltage/direction=forward}
+            \else
+                \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
+                \circuitikzbasekey/bipole/voltage/direction=backward}
+            \fi\fi\fi
+            \pgfkeys{/tikz/circuitikz/bipole/voltage/label/name=#1}
+            \ctikzsetvalof{bipole/voltage/label/unit}{}
+            \ifpgf at circ@siunitx
+                \pgf at circ@handleSI{#1}
+                \ifpgf at circ@siunitx at res
+                    \edef\pgf at temp{\pgf at circ@handleSI at val}
+                    \pgfkeyslet{/tikz/circuitikz/bipole/voltage/label/name}{\pgf at temp}
+                    \edef\pgf at temp{\pgf at circ@handleSI at unit}
+                    \pgfkeyslet{/tikz/circuitikz/bipole/voltage/label/unit}{\pgf at temp}
+                \else
+            \fi
+            \else
+        \fi
+    }
 }
 
+% american voltage font selection and symbol definition
+% the default font command is {} --- nothing
+\def\pgf at circ@avfont{\ctikzvalof{voltage/american font}}
+%
+% plus and minus symbols (default is $+$ and $-$, see pgfcirc.defines.tex)
+% notice that the double braces are needed  to be able
+% to use \boldmath in the font (although it is semi-deprecated...)
+%
+\def\pgf at circ@avplus{\ctikzvalof{voltage/american plus}}
+\def\pgf at circ@avminus{\ctikzvalof{voltage/american minus}}
 
-
-
 %% Output routine for generic bipoles
 
 \def\pgf at circ@drawvoltagegeneric{
-	\pgfextra{
-			\edef\pgf at temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/straight label distance}
-			\pgfkeysifdefined{\pgf at temp}
-				{ 
-					\edef\partheight{\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/straight label distance}}
-					\edef\tmpdistfromline{(\partheight\pgf at circ@Rlen)}
-				}
-				{
-				\pgfkeysifdefined{/tikz/circuitikz/bipoles/voltage/straight label distance}
-					{
-						\edef\partheight{\ctikzvalof{bipoles/voltage/straight label distance}}
-						\edef\tmpdistfromline{(\partheight\pgf at circ@Rlen)}
-					}
-					{%calculate default value from part height
-						\edef\partheight{0.5*\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/height}}
-						\edef\tmpdistfromline{(\partheight\pgf at circ@Rlen+0.2\pgf at circ@Rlen)}
-					}
-				}
-		\ifnum \ctikzvalof{mirror value}=-1
-			\ifpgf at circuit@bipole at inverted
-				\ifpgf at circuit@bipole at voltage@straight
-					\def\distfromline{\tmpdistfromline}
-				\else
-					\def\distfromline{\ctikzvalof{voltage/distance from line}\pgf at circ@Rlen}
-				\fi
-			\else
-				\ifpgf at circuit@bipole at voltage@straight
-					\def\distfromline{-\tmpdistfromline}
-				\else
-					\def\distfromline{-\ctikzvalof{voltage/distance from line}\pgf at circ@Rlen}
-				\fi
-			\fi
-		\else
-			\ifpgf at circuit@bipole at inverted
-				\ifpgf at circuit@bipole at voltage@straight
-					\def\distfromline{-\tmpdistfromline}
-				\else
-					\def\distfromline{-\ctikzvalof{voltage/distance from line}\pgf at circ@Rlen}
-				\fi
-			\else
-				\ifpgf at circuit@bipole at voltage@straight
-					\def\distfromline{\tmpdistfromline}
-				\else
-					\def\distfromline{\ctikzvalof{voltage/distance from line}\pgf at circ@Rlen}
-				\fi
-			\fi
-		\fi
-		\ifpgf at circuit@bipole at voltage@below
-			\def\pgf at circ@voltage at angle{90}
-		\else
-			\def\pgf at circ@voltage at angle{-90}
-		\fi
-		\edef\pgf at temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/distance from node}
-		\pgfkeysifdefined{\pgf at temp}
-			{ \edef\distacefromnode{\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/distance from node}} }
-			{ \edef\distacefromnode{\ctikzvalof{voltage/distance from node}} }
-		\edef\pgf at temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/bump b}
-		\pgfkeysifdefined{\pgf at temp}
-			{ \edef\bumpb{\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/bump b}} }
-			{ \edef\bumpb{\ctikzvalof{voltage/bump b}} }
-	}
-	% %\pgf at circ@Rlen/16 is equal to the length of the currarrow
-	coordinate (pgfcirc at midtmp) at ($(\tikztostart) ! \pgf at circ@Rlen/16 ! (anchorstartnode)$) %absolute move, minimum space is length of arrowhead
-	coordinate (pgfcirc at midtmp) at ($(pgfcirc at midtmp) ! \distacefromnode ! (anchorstartnode)$)
+    \pgfextra{
+        \edef\pgf at temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/straight label distance}
+        \pgfkeysifdefined{\pgf at temp}
+        {
+            \edef\partheight{\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/straight label distance}}
+            \edef\tmpdistfromline{(\partheight\pgf at circ@Rlen)}
+        }
+        {
+            \pgfkeysifdefined{/tikz/circuitikz/bipoles/voltage/straight label distance}
+            {
+                \edef\partheight{\ctikzvalof{bipoles/voltage/straight label distance}}
+                \edef\tmpdistfromline{(\partheight\pgf at circ@Rlen)}
+            }
+            {%calculate default value from part height
+                \edef\pgf at temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/height}
+                \pgfkeysifdefined{\pgf at temp}
+                {
+                    \edef\partheight{0.5*\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/height}}
+                    \edef\tmpdistfromline{(\partheight\pgf at circ@Rlen+0.2\pgf at circ@Rlen)}
+                }
+                {
+                    \edef\tmpdistfromline{(.5\pgf at circ@Rlen)} %fallback to fixed value
+                }
+            }
+        }
+        \ifnum \ctikzvalof{mirror value}=-1
+        \ifpgf at circuit@bipole at inverted
+            \ifpgf at circuit@bipole at voltage@straight
+                \def\distfromline{\tmpdistfromline}
+            \else
+                \def\distfromline{\ctikzvalof{voltage/distance from line}\pgf at circ@Rlen}
+            \fi
+            \else
+            \ifpgf at circuit@bipole at voltage@straight
+                \def\distfromline{-\tmpdistfromline}
+            \else
+                \def\distfromline{-\ctikzvalof{voltage/distance from line}\pgf at circ@Rlen}
+            \fi
+        \fi
+        \else
+            \ifpgf at circuit@bipole at inverted
+                \ifpgf at circuit@bipole at voltage@straight
+                    \def\distfromline{-\tmpdistfromline}
+                \else
+                    \def\distfromline{-\ctikzvalof{voltage/distance from line}\pgf at circ@Rlen}
+                \fi
+                \else
+                \ifpgf at circuit@bipole at voltage@straight
+                    \def\distfromline{\tmpdistfromline}
+                \else
+                    \def\distfromline{\ctikzvalof{voltage/distance from line}\pgf at circ@Rlen}
+                \fi
+            \fi
+        \fi
+        \ifpgf at circuit@bipole at voltage@below
+            \def\pgf at circ@voltage at angle{90}
+        \else
+            \def\pgf at circ@voltage at angle{-90}
+        \fi
+        \edef\pgf at temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/distance from node}
+        \pgfkeysifdefined{\pgf at temp}
+        { \edef\distacefromnode{\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/distance from node}} }
+        { \edef\distacefromnode{\ctikzvalof{voltage/distance from node}} }
+        \edef\pgf at temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/bump b}
+        \pgfkeysifdefined{\pgf at temp}
+        { \edef\bumpb{\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/bump b}} }
+        { \edef\bumpb{\ctikzvalof{voltage/bump b}} }
+        \edef\shiftv{\ctikzvalof{voltage/shift}}
+        \pgfmathsetmacro{\bumpb}{\bumpb + \shiftv} %% adjust the bump is shift
+        \ifpgf at circuit@bipole at inverted
+            \pgfmathsetmacro{\shiftv}{-\shiftv}
+        \fi
+        \ifnum \ctikzvalof{mirror value} = -1
+            \pgfmathsetmacro{\shiftv}{-\shiftv}
+        \fi
+    }
+    % %\pgf at circ@Rlen/\pgfkeysvalueof{/tikz/circuitikz/current arrow scale} is equal to the length of the currarrow
+    coordinate (pgfcirc at midtmp) at ($(\tikztostart) ! \pgf at circ@Rlen/\pgfkeysvalueof{/tikz/circuitikz/current arrow scale} ! (anchorstartnode)$) %absolute move, minimum space is length of arrowhead
+    coordinate (pgfcirc at midtmp) at ($(pgfcirc at midtmp) ! \distacefromnode ! (anchorstartnode)$)
 
-	coordinate (pgfcirc at Vfrom) at ($(pgfcirc at midtmp) ! -\distfromline ! \pgf at circ@voltage at angle:(anchorstartnode)$)
-	coordinate (pgfcirc at midtmp) at ($(\tikztotarget) ! \pgf at circ@Rlen/16 ! (anchorendnode)$)%absolute move, minimum space is length of arrowhead
-	coordinate (pgfcirc at midtmp) at ($(pgfcirc at midtmp) ! \distacefromnode ! (anchorendnode)$)
+    coordinate (pgfcirc at Vfrom) at ($(pgfcirc at midtmp) ! -\distfromline ! \pgf at circ@voltage at angle:(anchorstartnode)$)
+    coordinate (pgfcirc at midtmp) at ($(\tikztotarget) ! \pgf at circ@Rlen/\pgfkeysvalueof{/tikz/circuitikz/current arrow scale} ! (anchorendnode)$)%absolute move, minimum space is length of arrowhead
+    coordinate (pgfcirc at midtmp) at ($(pgfcirc at midtmp) ! \distacefromnode ! (anchorendnode)$)
 
-	coordinate (pgfcirc at Vto) at ($(pgfcirc at midtmp) ! \distfromline ! \pgf at circ@voltage at angle : (anchorendnode)$)
+    coordinate (pgfcirc at Vto) at ($(pgfcirc at midtmp) ! \distfromline ! \pgf at circ@voltage at angle : (anchorendnode)$)
 
-	\ifpgf at circuit@bipole at voltage@below
-		coordinate (pgfcirc at Vcont1) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.-110)$)
-		coordinate (pgfcirc at Vcont2) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.-70)$)
-	\else
-		coordinate (pgfcirc at Vcont1) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.110)$)
-		coordinate (pgfcirc at Vcont2) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.70)$)
-	\fi
+    \ifpgf at circuit@bipole at voltage@below
+        coordinate (pgfcirc at Vto) at ($(pgfcirc at Vto) ! \shiftv!90 :  (anchorendnode)$)
+        coordinate (pgfcirc at Vfrom) at ($(pgfcirc at Vfrom) ! \shiftv!-90 :  (anchorstartnode)$)
+        coordinate (pgfcirc at Vcont1) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.-110)$)
+        coordinate (pgfcirc at Vcont2) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.-70)$)
+    \else
+        coordinate (pgfcirc at Vto) at ($(pgfcirc at Vto) ! -\shiftv!90 :  (anchorendnode)$)
+        coordinate (pgfcirc at Vfrom) at ($(pgfcirc at Vfrom) ! -\shiftv!-90 :  (anchorstartnode)$)
+        coordinate (pgfcirc at Vcont1) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.110)$)
+        coordinate (pgfcirc at Vcont2) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.70)$)
+    \fi
 
-	\ifpgf at circuit@europeanvoltage
-		\ifpgf at circuit@bipole at voltage@straight
-			\ifpgf at circuit@bipole at voltage@backward
-				(pgfcirc at Vto) --(pgfcirc at Vfrom) node[currarrow, sloped,  allow upside down, pos=1,anchor=tip] {}
-			\else
-				(pgfcirc at Vfrom) --(pgfcirc at Vto) node[currarrow, sloped,  allow upside down, pos=1,anchor=tip] {}
-			\fi
-		\else
-			\ifpgf at circuit@bipole at voltage@backward
-				(pgfcirc at Vto) .. controls (pgfcirc at Vcont2)  and (pgfcirc at Vcont1) ..
-					node[currarrow, sloped,  allow upside down, pos=1] {}
-				(pgfcirc at Vfrom)
-			\else
-				(pgfcirc at Vfrom) .. controls (pgfcirc at Vcont1)  and (pgfcirc at Vcont2) ..
-					node[currarrow, sloped,  allow upside down, pos=1] {}
-				(pgfcirc at Vto)
-			\fi
-		\fi
-	\else
-		\ifpgf at circuit@bipole at voltage@backward
-			\ifpgf at circ@oldvoltagedirection
-				(pgfcirc at Vfrom) node[inner sep=0, anchor=\pgf at circ@bipole at voltage@label at anchor]{\scriptsize$+$}
-				(pgfcirc at Vto) node[inner sep=0, anchor=\pgf at circ@bipole at voltage@label at anchor]{$-$}
-			\else
-				(pgfcirc at Vfrom) node[inner sep=0, anchor=\pgf at circ@bipole at voltage@label at anchor]{\scriptsize$-$}
-				(pgfcirc at Vto) node[inner sep=0, anchor=\pgf at circ@bipole at voltage@label at anchor]{$+$}
-			\fi
-		\else
-			\ifpgf at circ@oldvoltagedirection
-				(pgfcirc at Vfrom) node[inner sep=0, anchor=\pgf at circ@bipole at voltage@label at anchor]{\scriptsize$-$}
-				(pgfcirc at Vto) node[inner sep=0, anchor=\pgf at circ@bipole at voltage@label at anchor]{$+$}
-			\else
-				(pgfcirc at Vfrom) node[inner sep=0, anchor=\pgf at circ@bipole at voltage@label at anchor]{\scriptsize$+$}
-				(pgfcirc at Vto) node[inner sep=0, anchor=\pgf at circ@bipole at voltage@label at anchor]{$-$}
-			\fi
-		\fi
-	\fi
+    \ifpgf at circuit@europeanvoltage
+        \ifpgf at circuit@bipole at voltage@straight
+            \ifpgf at circuit@bipole at voltage@backward
+                (pgfcirc at Vto) --(pgfcirc at Vfrom) node[currarrow, sloped,  allow upside down, pos=1,anchor=tip] {}
+            \else
+                (pgfcirc at Vfrom) --(pgfcirc at Vto) node[currarrow, sloped,  allow upside down, pos=1,anchor=tip] {}
+            \fi
+            \else
+            \ifpgf at circuit@bipole at voltage@backward
+                (pgfcirc at Vto) .. controls (pgfcirc at Vcont2)  and (pgfcirc at Vcont1) ..
+                node[currarrow, sloped,  allow upside down, pos=1] {}
+                (pgfcirc at Vfrom)
+            \else
+                (pgfcirc at Vfrom) .. controls (pgfcirc at Vcont1)  and (pgfcirc at Vcont2) ..
+                node[currarrow, sloped,  allow upside down, pos=1] {}
+                (pgfcirc at Vto)
+            \fi
+        \fi
+        \else
+        \ifpgf at circuit@bipole at voltage@backward
+            \ifpgf at circ@oldvoltagedirection
+                (pgfcirc at Vfrom) node[inner sep=0, node font=\pgf at circ@avfont,
+                    anchor=\pgf at circ@bipole at voltage@label at anchor]{\pgf at circ@avplus}
+                (pgfcirc at Vto) node[inner sep=0, node font=\pgf at circ@avfont,
+                    anchor=\pgf at circ@bipole at voltage@label at anchor]{\pgf at circ@avminus}
+            \else
+                (pgfcirc at Vfrom) node[inner sep=0, node font=\pgf at circ@avfont,
+                    anchor=\pgf at circ@bipole at voltage@label at anchor]{\pgf at circ@avminus}
+                (pgfcirc at Vto) node[inner sep=0, node font=\pgf at circ@avfont,
+                    anchor=\pgf at circ@bipole at voltage@label at anchor]{\pgf at circ@avplus}
+            \fi
+            \else
+            \ifpgf at circ@oldvoltagedirection
+                (pgfcirc at Vfrom) node[inner sep=0, node font=\pgf at circ@avfont,
+                    anchor=\pgf at circ@bipole at voltage@label at anchor]{\pgf at circ@avminus}
+                (pgfcirc at Vto) node[inner sep=0, node font=\pgf at circ@avfont,
+                    anchor=\pgf at circ@bipole at voltage@label at anchor]{\pgf at circ@avplus}
+            \else
+                (pgfcirc at Vfrom) node[inner sep=0, node font=\pgf at circ@avfont,
+                    anchor=\pgf at circ@bipole at voltage@label at anchor]{\pgf at circ@avplus}
+                (pgfcirc at Vto) node[inner sep=0, node font=\pgf at circ@avfont,
+                    anchor=\pgf at circ@bipole at voltage@label at anchor]{\pgf at circ@avminus}
+            \fi
+        \fi
+    \fi
 }
 
 %% Output routine for voltage sources
 \def\pgf at circ@drawvoltagegenerator{
-	\ifpgf at circuit@bipole at voltage@below
-		coordinate (pgfcirc at Vfrom) at ($(\ctikzvalof{bipole/name}.center) ! \ctikzvalof{voltage/bump a} ! (\ctikzvalof{bipole/name}.-120)$)
-		coordinate (pgfcirc at Vto) at ($(\ctikzvalof{bipole/name}.center) ! \ctikzvalof{voltage/bump a} ! (\ctikzvalof{bipole/name}.-60)$)
-	\else
-		coordinate (pgfcirc at Vfrom) at ($ (\ctikzvalof{bipole/name}.center) ! \ctikzvalof{voltage/bump a} ! (\ctikzvalof{bipole/name}.120)$)
-		coordinate (pgfcirc at Vto) at ($ (\ctikzvalof{bipole/name}.center) ! \ctikzvalof{voltage/bump a} ! (\ctikzvalof{bipole/name}.60)$)
-	\fi
-	\ifpgf at circuit@europeanvoltage
-		\ifpgf at circuit@bipole at voltage@backward
-			(pgfcirc at Vto)  -- node[currarrow, sloped,  allow upside down, pos=1] {} (pgfcirc at Vfrom)
-		\else
-			(pgfcirc at Vfrom)  -- node[currarrow, sloped,  allow upside down, pos=1] {} (pgfcirc at Vto)
-		\fi
-	\else% american voltage
-		\ifpgf at circuit@bipole at voltageoutsideofsymbol
-		% if it is a battery, must put + and -
-			\ifpgf at circuit@bipole at voltage@backward
-				(pgfcirc at Vfrom)  node {$-$}  (pgfcirc at Vto) node {$+$}
-			\else
-				(pgfcirc at Vfrom)  node {$+$}  (pgfcirc at Vto) node {$-$}
-			\fi
-		\fi
-	\fi
+    % the following is affected indirectly by voltage/shift, you can move the arrow with voltage/bump a.
+    % it's not perfect, but I can't find the way to do it correctly...
+    \pgfextra{
+        \edef\shiftv{\ctikzvalof{voltage/shift}}
+        \edef\bumpa{\ctikzvalof{voltage/bump a}}
+        \pgfmathsetmacro{\bumpaplus}{\bumpa + \shiftv}
+    }
+    \ifpgf at circuit@bipole at voltage@below
+        coordinate (pgfcirc at Vfrom) at ($(\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.-120)$)
+        coordinate (pgfcirc at Vto) at ($(\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.-60)$)
+    \else
+        coordinate (pgfcirc at Vfrom) at ($ (\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.120)$)
+        coordinate (pgfcirc at Vto) at ($ (\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.60)$)
+    \fi
+    \ifpgf at circuit@europeanvoltage
+        \ifpgf at circuit@bipole at voltage@backward
+            (pgfcirc at Vto)  -- node[currarrow, sloped,  allow upside down, pos=1] {} (pgfcirc at Vfrom)
+        \else
+            (pgfcirc at Vfrom)  -- node[currarrow, sloped,  allow upside down, pos=1] {} (pgfcirc at Vto)
+        \fi
+        \else% american voltage
+        \ifpgf at circuit@bipole at voltageoutsideofsymbol
+            % if it is a battery, must put + and -
+
+            \ifpgf at circ@fixbatteries
+                \ifpgf at circuit@bipole at voltage@backward
+                    (pgfcirc at Vfrom)  node[node font=\pgf at circ@avfont] {\pgf at circ@avplus}
+                    (pgfcirc at Vto) node[node font=\pgf at circ@avfont] {\pgf at circ@avminus}
+                \else
+                    (pgfcirc at Vfrom)  node[node font=\pgf at circ@avfont] {\pgf at circ@avminus}
+                    (pgfcirc at Vto) node[node font=\pgf at circ@avfont] {\pgf at circ@avplus}
+                \fi
+                \else
+                \ifpgf at circuit@bipole at voltage@backward
+                    (pgfcirc at Vfrom)  node[node font=\pgf at circ@avfont] {\pgf at circ@avminus}
+                    (pgfcirc at Vto) node[node font=\pgf at circ@avfont] {\pgf at circ@avplus}
+                \else
+                    (pgfcirc at Vfrom)  node[node font=\pgf at circ@avfont] {\pgf at circ@avplus}
+                    (pgfcirc at Vto) node[node font=\pgf at circ@avfont] {\pgf at circ@avminus}
+                \fi
+            \fi
+        \fi
+    \fi
 }
 
 %% Output routine
-\def\pgf at circ@drawvoltage{% node name 
-%\pgf at circ@direction
-	\pgfextra{
-		\edef\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at nil}
-		\ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
-			\ifpgf at circuit@bipole at voltage@below
-				\def\pgf at circ@bipole at voltage@label at anchor{north west}
-			\else \def\pgf at circ@bipole at voltage@label at anchor{south east}
-			\fi
-		\fi\fi
-		\ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
-			\ifpgf at circuit@bipole at voltage@below
-				\def\pgf at circ@bipole at voltage@label at anchor{west}
-			\else \def\pgf at circ@bipole at voltage@label at anchor{east}
-			\fi
-		\fi\fi
-		\ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
-			\ifpgf at circuit@bipole at voltage@below
-				 \def\pgf at circ@bipole at voltage@label at anchor{south west}
-			\else \def\pgf at circ@bipole at voltage@label at anchor{north east}
-			\fi
-		\fi\fi
-		\ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
-			\ifpgf at circuit@bipole at voltage@below
-				  \def\pgf at circ@bipole at voltage@label at anchor{south}
-			\else\def\pgf at circ@bipole at voltage@label at anchor{north}
-			\fi
-		\fi\fi
-		\ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
-			\ifpgf at circuit@bipole at voltage@below
-				 \def\pgf at circ@bipole at voltage@label at anchor{south east}
-			\else\def\pgf at circ@bipole at voltage@label at anchor{north west}
-			\fi
-		\fi\fi
-		\ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
-			\ifpgf at circuit@bipole at voltage@below
-				 \def\pgf at circ@bipole at voltage@label at anchor{east}
-			\else \def\pgf at circ@bipole at voltage@label at anchor{west}
-			\fi
-		\fi\fi
-		\ifnum\pgfcircmathresult >274 \ifnum\pgfcircmathresult <356
-			\ifpgf at circuit@bipole at voltage@below
-				  \def\pgf at circ@bipole at voltage@label at anchor{north east}
-			\else\def\pgf at circ@bipole at voltage@label at anchor{south west}
-			\fi
-		\fi\fi
-		\ifnum\pgfcircmathresult >-1 \ifnum\pgfcircmathresult <5
-			\ifpgf at circuit@bipole at voltage@below
-				 \def\pgf at circ@bipole at voltage@label at anchor{north}
-			\else\def\pgf at circ@bipole at voltage@label at anchor{south}
-			\fi
-		\fi\fi
-		\ifnum\pgfcircmathresult >355 \ifnum\pgfcircmathresult <361
-			\ifpgf at circuit@bipole at voltage@below
-				  \def\pgf at circ@bipole at voltage@label at anchor{north}
-			\else\def\pgf at circ@bipole at voltage@label at anchor{south}
-			\fi
-		\fi\fi
+\def\pgf at circ@drawvoltage{% node name
+    \pgfextra{ %WARNING: indentation is probably wrong
+        \edef\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at nil}
+        \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
+        \ifpgf at circuit@bipole at voltage@below
+            \def\pgf at circ@bipole at voltage@label at anchor{north west}
+        \else
+            \def\pgf at circ@bipole at voltage@label at anchor{south east}
+        \fi
+        \fi\fi
+        \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
+        \ifpgf at circuit@bipole at voltage@below
+            \def\pgf at circ@bipole at voltage@label at anchor{west}
+        \else
+            \def\pgf at circ@bipole at voltage@label at anchor{east}
+        \fi
+        \fi\fi
+        \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
+        \ifpgf at circuit@bipole at voltage@below
+            \def\pgf at circ@bipole at voltage@label at anchor{south west}
+        \else \def\pgf at circ@bipole at voltage@label at anchor{north east}
+        \fi
+        \fi\fi
+        \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
+        \ifpgf at circuit@bipole at voltage@below
+            \def\pgf at circ@bipole at voltage@label at anchor{south}
+        \else\def\pgf at circ@bipole at voltage@label at anchor{north}
+        \fi
+        \fi\fi
+        \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
+        \ifpgf at circuit@bipole at voltage@below
+            \def\pgf at circ@bipole at voltage@label at anchor{south east}
+        \else\def\pgf at circ@bipole at voltage@label at anchor{north west}
+        \fi
+        \fi\fi
+        \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
+        \ifpgf at circuit@bipole at voltage@below
+            \def\pgf at circ@bipole at voltage@label at anchor{east}
+        \else \def\pgf at circ@bipole at voltage@label at anchor{west}
+        \fi
+        \fi\fi
+        \ifnum\pgfcircmathresult >274 \ifnum\pgfcircmathresult <356
+        \ifpgf at circuit@bipole at voltage@below
+            \def\pgf at circ@bipole at voltage@label at anchor{north east}
+        \else\def\pgf at circ@bipole at voltage@label at anchor{south west}
+        \fi
+        \fi\fi
+        \ifnum\pgfcircmathresult >-1 \ifnum\pgfcircmathresult <5
+        \ifpgf at circuit@bipole at voltage@below
+            \def\pgf at circ@bipole at voltage@label at anchor{north}
+        \else\def\pgf at circ@bipole at voltage@label at anchor{south}
+        \fi
+        \fi\fi
+        \ifnum\pgfcircmathresult >355 \ifnum\pgfcircmathresult <361
+        \ifpgf at circuit@bipole at voltage@below
+            \def\pgf at circ@bipole at voltage@label at anchor{north}
+        \else\def\pgf at circ@bipole at voltage@label at anchor{south}
+        \fi
+        \fi\fi
 
-		\ifnum \ctikzvalof{mirror value}=-1
-			\ifpgf at circuit@bipole at voltage@below
-				\pgf at circuit@bipole at voltage@belowfalse
-			\else
-				\pgf at circuit@bipole at voltage@belowtrue
-			\fi
-		\fi
+        \ifnum \ctikzvalof{mirror value}=-1
+            \ifpgf at circuit@bipole at voltage@below
+                \pgf at circuit@bipole at voltage@belowfalse
+            \else
+                \pgf at circuit@bipole at voltage@belowtrue
+            \fi
+        \fi
 
-		\ifpgf at circuit@bipole at inverted
-			\ifpgf at circuit@bipole at voltage@below
-				\pgf at circuit@bipole at voltage@belowfalse
-			\else
-				\pgf at circuit@bipole at voltage@belowtrue
-			\fi
-		\fi
+        \ifpgf at circuit@bipole at inverted
+            \ifpgf at circuit@bipole at voltage@below
+                \pgf at circuit@bipole at voltage@belowfalse
+            \else
 
-		\ifpgf at circuit@bipole at voltage@below
-			\def\pgf at circ@bipole at voltage@label at where{-90}
-		\else
-			\def\pgf at circ@bipole at voltage@label at where{90}
-		\fi
+                \pgf at circuit@bipole at voltage@belowtrue
+            \fi
+        \fi
 
+        \ifpgf at circuit@bipole at voltage@below
+            \def\pgf at circ@bipole at voltage@label at where{-90}
+        \else
+            \def\pgf at circ@bipole at voltage@label at where{90}
+        \fi
 
-		\edef\pgf at temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/european label distance}
-		\pgfkeysifdefined{\pgf at temp}
-			{ \edef\eudist{\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/european label distance}} }
-			{ \edef\eudist{\ctikzvalof{voltage/european label distance}} }
 
-	\pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
-	}%end pgfextra
+        \edef\pgf at temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/european label distance}
+        \pgfkeysifdefined{\pgf at temp}
+        { \edef\eudist{\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/european label distance}} }
+        { \edef\eudist{\ctikzvalof{voltage/european label distance}} }
+        \edef\shiftv{\ctikzvalof{voltage/shift}}
+        % adjust the label distance to the shift.
+        \pgfmathsetmacro{\eudistplus}{\eudist+\shiftv}
 
-		\ifpgf at circuit@bipole at isvoltage
-			\pgf at circ@drawvoltagegenerator
-		\else
-			\pgf at circ@drawvoltagegeneric
-		\fi
+        \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
+    }%end pgfextra
 
-	%	(\ctikzvalof{bipole/name}.\pgf at circ@bipole at voltage@label at where) %Zeile sinnlos!?
-		\ifpgf at circuit@bipole at voltage@straight
-			coordinate (Vlab) at ($(pgfcirc at Vto)!0.5!(pgfcirc at Vfrom) $)
-			node [anchor=\pgf at circ@bipole at voltage@label at anchor, inner sep=2pt]
-					  at (Vlab) { \pgf at circ@finallabels{voltage/label} }
-		\else
-		coordinate (Vlab) at ($(\ctikzvalof{bipole/name}.center) !
-			\ifpgf at circuit@europeanvoltage
-				\eudist
-			\else
-				\ctikzvalof{voltage/american label distance}
-			\fi !
-			(\ctikzvalof{bipole/name}.\pgf at circ@bipole at voltage@label at where)$)
-		node [anchor=\pgf at circ@bipole at voltage@label at anchor, inner sep=2pt] at (Vlab) { \pgf at circ@finallabels{voltage/label} }
-		\fi
+    \ifpgf at circuit@bipole at isvoltage
+        \pgf at circ@drawvoltagegenerator
+    \else
+        \pgf at circ@drawvoltagegeneric
+    \fi
+
+    %	(\ctikzvalof{bipole/name}.\pgf at circ@bipole at voltage@label at where) %Zeile sinnlos!?
+    \ifpgf at circuit@bipole at voltage@straight
+        coordinate (Vlab) at ($(pgfcirc at Vto)!0.5!(pgfcirc at Vfrom) $)
+        node [anchor=\pgf at circ@bipole at voltage@label at anchor, inner sep=2pt]
+        at (Vlab) { \pgf at circ@finallabels{voltage/label} }
+    \else
+        coordinate (Vlab) at ($(\ctikzvalof{bipole/name}.center) !
+        \ifpgf at circuit@europeanvoltage
+            \eudistplus
+        \else
+            \ctikzvalof{voltage/american label distance}
+        \fi !
+        (\ctikzvalof{bipole/name}.\pgf at circ@bipole at voltage@label at where)$)
+        node [anchor=\pgf at circ@bipole at voltage@label at anchor, inner sep=2pt] at (Vlab) { \pgf at circ@finallabels{voltage/label} }
+    \fi
 }%end drawvoltages
 \endinput

Modified: trunk/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty	2019-05-10 21:14:43 UTC (rev 51070)
+++ trunk/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty	2019-05-10 21:15:08 UTC (rev 51071)
@@ -1,4 +1,4 @@
-% Copyright 2007-2016 by Massimo Redaelli
+% Copyright 2007-2019 by Massimo Redaelli
 %
 % This file may be distributed and/or modified
 %
@@ -5,299 +5,333 @@
 % 1. under the LaTeX Project Public License and/or
 % 2. under the GNU Public License.
 %
-% See the file doc/LICENSE for more details.
+% See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
 
-
 \NeedsTeXFormat{LaTeX2e}
 
-\def\pgfcircversion{0.8.3}
-\def\pgfcircversiondate{2017/05/28}
+\def\pgfcircversion{0.9.0}
+\def\pgfcircversiondate{2019/05/10}
 
 \ProvidesPackage{circuitikz}%
-        [\pgfcircversiondate{} The CircuiTikz circuit drawing package version \pgfcircversion]
+[\pgfcircversiondate{} The CircuiTikz circuit drawing package version \pgfcircversion]
 
 %% Version 3.0 of pgf/TikZ is required
 \RequirePackage{tikz}
 \usetikzlibrary{calc}
-\usepgflibrary{arrows}
+%
+% "arrows" library is deprecated, and behave badly with
+% arrows on short paths. Change to the new arrows.meta
+% In pfgcirc.define, we will add the old definition of
+% latex' which we have lost in the transition
+%
+\usetikzlibrary{arrows.meta, bending}
 
-
 % The options are listed in the manual in this order
 
 \DeclareOption{europeanvoltage}{
-	\ctikzset{voltage=european}
+    \ctikzset{voltage=european}
 }
 
 \DeclareOption{straightvoltages}{
-	\pgf at circuit@bipole at voltage@straighttrue
+    \pgf at circuit@bipole at voltage@straighttrue
 }
 
 \DeclareOption{americanvoltage}{
-	\ctikzset{voltage=american}
+    \ctikzset{voltage=american}
 }
 
 \DeclareOption{europeancurrent}{
-	\ctikzset{current = european}
+    \ctikzset{current = european}
 }
 
 \DeclareOption{americancurrent}{
-	\ctikzset{current = american}
+    \ctikzset{current = american}
 }
 
 
 
 \DeclareOption{americanresistor}{
-	\ctikzset{resistor = american}
+    \ctikzset{resistor = american}
 }
 
 \DeclareOption{europeanresistor}{
-	\ctikzset{resistor = european}
+    \ctikzset{resistor = european}
 }
 
 \DeclareOption{americaninductor}{
-	\ctikzset{inductor = american}
+    \ctikzset{inductor = american}
 }
 
 \DeclareOption{europeaninductor}{
-	\ctikzset{inductor = european}
+    \ctikzset{inductor = european}
 }
 
 \DeclareOption{cuteinductor}{
-	\ctikzset{inductor = cute}
+    \ctikzset{inductor = cute}
 }
 
 \DeclareOption{americanport}{
-	\ctikzset{logic ports = american}
+    \ctikzset{logic ports = american}
 }
 
 \DeclareOption{europeanport}{
-	\ctikzset{logic ports = european}
+    \ctikzset{logic ports = european}
 }
 
 \DeclareOption{europeanport}{
-	\ctikzset{logic ports = european}
+    \ctikzset{logic ports = european}
 }
 
 \DeclareOption{european}{
-	\ctikzset{voltage=european} \ctikzset{current=european} \ctikzset{inductor=european}
-	 \ctikzset{resistor=european} \ctikzset{logic ports=european} \ctikzset{gas filled surge arrester choice = european}
+    \ctikzset{voltage=european} \ctikzset{current=european} \ctikzset{inductor=european}
+    \ctikzset{resistor=european} \ctikzset{logic ports=european} \ctikzset{gas filled surge arrester choice = european}
 }
 
 \DeclareOption{american}{
-	\ctikzset{voltage=american} \ctikzset{current=american} \ctikzset{resistor=american} \ctikzset{inductor=american} \ctikzset{gas filled surge arrester choice = american}
-	\ctikzset{logic ports = american}
+    \ctikzset{voltage=american} \ctikzset{current=american} \ctikzset{resistor=american} \ctikzset{inductor=american} \ctikzset{gas filled surge arrester choice = american}
+    \ctikzset{logic ports = american}
 }
 
 \DeclareOption{fulldiodes}{
-	\ctikzset{diode = full}
+    \ctikzset{diode = full}
 }
 
 \DeclareOption{emptydiodes}{
-	\ctikzset{diode = empty}
+    \ctikzset{diode = empty}
 }
 
 \DeclareOption{europeanvoltages}{
-	\ctikzset{voltage=european}
+    \ctikzset{voltage=european}
 }
 
 \DeclareOption{americanvoltages}{
-	\ctikzset{voltage=american}
+    \ctikzset{voltage=american}
 }
 
 \DeclareOption{europeancurrents}{
-	\ctikzset{current = european}
+    \ctikzset{current = european}
 }
 
 \DeclareOption{americancurrents}{
-	\ctikzset{current = american}
+    \ctikzset{current = american}
 }
 
 \DeclareOption{americanresistors}{
-	\ctikzset{resistor = american}
+    \ctikzset{resistor = american}
 }
 
 \DeclareOption{europeanresistors}{
-	\ctikzset{resistor = european}
+    \ctikzset{resistor = european}
 }
 
 \DeclareOption{americaninductors}{
-	\ctikzset{inductor = american}
+    \ctikzset{inductor = american}
 }
 
 \DeclareOption{europeaninductors}{
-	\ctikzset{inductor = european}
+    \ctikzset{inductor = european}
 }
 
 \DeclareOption{cuteinductors}{
-	\ctikzset{inductor = cute}
+    \ctikzset{inductor = cute}
 }
 
 \DeclareOption{americanports}{
-	\ctikzset{logic ports = american}
+    \ctikzset{logic ports = american}
 }
 
 \DeclareOption{europeanports}{
-	\ctikzset{logic ports = european}
+    \ctikzset{logic ports = european}
 }
 
 \DeclareOption{americangfsurgearrester}{
-	\ctikzset{gas filled surge arrester choice = american}
+    \ctikzset{gas filled surge arrester choice = american}
 }
 
 \DeclareOption{europeangfsurgearrester}{
-	\ctikzset{gas filled surge arrester choice = european}
+    \ctikzset{gas filled surge arrester choice = european}
 }
 
 \DeclareOption{siunitx}{
-	\pgf at circ@siunitxtrue
+    \pgf at circ@siunitxtrue
 }
 
 \DeclareOption{nosiunitx}{
-	\pgf at circ@siunitxfalse
+    \pgf at circ@siunitxfalse
 }
 
 \DeclareOption{fulldiode}{
-	\ctikzset{diode = full}
+    \ctikzset{diode = full}
 }
 
 \DeclareOption{emptydiode}{
-	\ctikzset{diode = empty}
+    \ctikzset{diode = empty}
 }
 
 \DeclareOption{strokediode}{
-	\ctikzset{diode = stroke}
+    \ctikzset{diode = stroke}
 }
 
 \DeclareOption{arrowmos}{
-	\pgf at circuit@mos at arrowstrue
+    \pgf at circuit@mos at arrowstrue
 }
 
 \DeclareOption{noarrowmos}{
-	\pgf at circuit@mos at arrowsfalse
+    \pgf at circuit@mos at arrowsfalse
 }
 
 \DeclareOption{fetbodydiode}{
-	\pgf at circuit@fet at bodydiodetrue
+    \pgf at circuit@fet at bodydiodetrue
 }
 
 \DeclareOption{nofetbodydiode}{
-	\pgf at circuit@fet at bodydiodefalse
+    \pgf at circuit@fet at bodydiodefalse
 }
 
 \DeclareOption{fetsolderdot}{
-	\pgf at circuit@fet at solderdottrue
+    \pgf at circuit@fet at solderdottrue
 }
 
 \DeclareOption{nofetsolderdot}{
-	\pgf at circuit@fet at solderdotfalse
+    \pgf at circuit@fet at solderdotfalse
 }
 
 \DeclareOption{emptypmoscircle}{
-	\pgf at circuit@pmos at emptycircletrue
+    \pgf at circuit@pmos at emptycircletrue
 }
 
 
 \DeclareOption{lazymos}{
-	\ctikzset{tripoles/nmos/width=.5}
-	\ctikzset{tripoles/nmos/gate height=.35}
-	\ctikzset{tripoles/nmos/base height=.35}
-	\ctikzset{tripoles/nmos/height/.initial=1.2}
-	\ctikzset{tripoles/nmos/base width=.5}
-	\ctikzset{tripoles/nmos/gate width=.65}
-	
-	\ctikzset{tripoles/pmos/width=.5}
-	\ctikzset{tripoles/pmos/gate height=.35}
-	\ctikzset{tripoles/pmos/base height=.35}
-	\ctikzset{tripoles/pmos/height/.initial=1.2}
-	\ctikzset{tripoles/pmos/base width=.5}
-	\ctikzset{tripoles/pmos/gate width=.65}
-	
-	\pgf at circuit@pmos at emptycircletrue
+    \ctikzset{tripoles/nmos/width=.5}
+    \ctikzset{tripoles/nmos/gate height=.35}
+    \ctikzset{tripoles/nmos/base height=.35}
+    \ctikzset{tripoles/nmos/height/.initial=1.2}
+    \ctikzset{tripoles/nmos/base width=.5}
+    \ctikzset{tripoles/nmos/gate width=.65}
+
+    \ctikzset{tripoles/pmos/width=.5}
+    \ctikzset{tripoles/pmos/gate height=.35}
+    \ctikzset{tripoles/pmos/base height=.35}
+    \ctikzset{tripoles/pmos/height/.initial=1.2}
+    \ctikzset{tripoles/pmos/base width=.5}
+    \ctikzset{tripoles/pmos/gate width=.65}
+
+    \pgf at circuit@pmos at emptycircletrue
 }
 
 \DeclareOption{straightlabels}{
-	\ctikzset{label/align = straight}
+    \ctikzset{label/align = straight}
 }
 
 \DeclareOption{rotatelabels}{
-	\ctikzset{label/align = rotate}
+    \ctikzset{label/align = rotate}
 }
 
 \DeclareOption{smartlabels}{
-	\ctikzset{label/align = smart}
+    \ctikzset{label/align = smart}
 }
 
 \DeclareOption{compatibility}{
-	\pgf at circuit@compattrue
+    \pgf at circuit@compattrue
 }
 
 \DeclareOption{oldvoltagedirection}{
-	\pgf at circ@oldvoltagedirectiontrue
+    \pgf at circ@oldvoltagedirectiontrue
+    \pgf at circ@explicitvdirtrue
+    \pgf at circ@fixbatteriesfalse
 }
 \DeclareOption{nooldvoltagedirection}{
-	\pgf at circ@oldvoltagedirectionfalse
+    \pgf at circ@oldvoltagedirectionfalse
+    \pgf at circ@explicitvdirtrue
+    \pgf at circ@fixbatteriesfalse
 }
 
+\DeclareOption{RPvoltages}{
+    \pgf at circ@oldvoltagedirectiontrue
+    \pgf at circ@explicitvdirtrue
+    \pgf at circ@fixbatteriestrue
+}
+\DeclareOption{EFvoltages}{
+    \pgf at circ@oldvoltagedirectionfalse
+    \pgf at circ@explicitvdirtrue
+    \pgf at circ@fixbatteriestrue
+}
+
+
 \DeclareOption{betterproportions}{
-	\ctikzset{monopoles/ground/width/.initial=.15}
+    \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{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{bipoles/bidirectionaldiode/height/.initial=.66}
+    \ctikzset{bipoles/bidirectionaldiode/width/.initial=.6}
+    \ctikzset{bipoles/bidirectionaldiode/diode width left/.initial=.3}
+    \ctikzset{bipoles/bidirectionaldiode/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}
+    \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}
 }
 
+% This is a nice hack that prints all the shapes declared
+% by the package. Very useful for coverage testing and debugging.
+%
+% \let\origpgfdeclareshape=\pgfdeclareshape
+% \def\pgfdeclareshape#1{%
+%     \typeout{SHAPE:\space"#1"}%
+%     \origpgfdeclareshape{#1}
+% }
+
+
 %%%%%%%%%
 \input pgfcirc.defines.tex
 \input pgfcircutils.tex
@@ -307,6 +341,7 @@
 \input pgfcircbipoles.tex
 \input pgfcirctripoles.tex
 \input pgfcircquadpoles.tex
+\input pgfcircmultipoles.tex
 
 \input pgfcirclabel.tex
 \input pgfcircvoltage.tex
@@ -313,7 +348,8 @@
 \input pgfcirccurrent.tex
 \input pgfcircflow.tex
 
-\ExecuteOptions{nofetbodydiode,nofetsolderdot,nooldvoltagedirection,europeancurrents,europeanvoltages,americanports,americanresistors,cuteinductors,europeangfsurgearrester,nosiunitx,noarrowmos,smartlabels,nocompatibility}
+% notice that the default is nooldvoltagedirections; it's not explicitly set to allow for the warning
+\ExecuteOptions{nofetbodydiode, nofetsolderdot, europeancurrents, europeanvoltages,americanports, americanresistors, cuteinductors ,europeangfsurgearrester, nosiunitx, noarrowmos, smartlabels, nocompatibility}
 
 \ProcessOptions\relax
 
@@ -321,12 +357,20 @@
 
 \ifpgf at circ@siunitx
     \RequirePackage{xstring}[2009/03/13]
-	%\expandafter\let\csname angstrom\endcsname\relax
-	\RequirePackage{siunitx}
+    %\expandafter\let\csname angstrom\endcsname\relax
+    \RequirePackage{siunitx}
 \fi
 
+\ifpgf at circ@explicitvdir\else
+    \PackageWarningNoLine{circuitikz}{%
+        You did not specify one of the voltage directions:\MessageBreak
+        \space\space    oldvoltagedirections, nooldvoltagedirections, \MessageBreak
+        \space\space    RPvoltages or EFvoltages \MessageBreak
+        Default directions may have changed, \MessageBreak
+        please check the manual%
+    }
+\fi
 
-
 \newenvironment{circuitikz}{\begin{tikzpicture}}{\end{tikzpicture}}
 %override (unused) circuitikz environment for compability to externalization)
 \let\circuitikz\tikzpicture



More information about the tex-live-commits mailing list