texlive[53515] Master/texmf-dist: circuitikz (23jan20)

commits+karl at tug.org commits+karl at tug.org
Thu Jan 23 22:55:34 CET 2020


Revision: 53515
          http://tug.org/svn/texlive?view=revision&revision=53515
Author:   karl
Date:     2020-01-23 22:55:34 +0100 (Thu, 23 Jan 2020)
Log Message:
-----------
circuitikz (23jan20)

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/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/ctikzmanutils.sty
    trunk/Master/texmf-dist/tex/context/third/circuitikz/t-circuitikz.tex
    trunk/Master/texmf-dist/tex/generic/circuitikz/ctikzstyle-legacy.tex
    trunk/Master/texmf-dist/tex/generic/circuitikz/ctikzstyle-romano.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/pgfcirclabel.tex
    trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircmultipoles.tex
    trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex
    trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex
    trunk/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty

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	2020-01-23 21:55:17 UTC (rev 53514)
+++ trunk/Master/texmf-dist/doc/generic/circuitikz/CHANGELOG.md	2020-01-23 21:55:34 UTC (rev 53515)
@@ -1,6 +1,16 @@
 <!--- 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 1.0.0-pre2 (2020-01-23)
+
+    **Really** last additions toward the 1.0.0 version. The most important change is the addition of multiplexer and de-multiplexers; also added the multi-wires (bus) markers.
+
+    - Added mux-demux shapes
+    - Added the possibility to suppress the input leads in logic gates
+    - Added multiple wires markers
+    - Added a style to switch off the automatic rotation of instruments
+    - Changed the shape of the or-type american logic ports (reversible with a flag)
+
 * Version 1.0.0-pre1 (2019-12-22)
 
     Last additions before the long promised 1.0! In this pre-release we feature a flip-flop library, a revamped configurability of amplifiers (and a new amplifier as a bonus) and some bug fix around the clock.

Modified: trunk/Master/texmf-dist/doc/latex/circuitikz/changelog.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuitikz/changelog.tex	2020-01-23 21:55:17 UTC (rev 53514)
+++ trunk/Master/texmf-dist/doc/latex/circuitikz/changelog.tex	2020-01-23 21:55:34 UTC (rev 53515)
@@ -5,6 +5,27 @@
 
 \begin{itemize}
 \item
+  Version 1.0.0-pre2 (2020-01-23)
+
+  \textbf{Really} last additions toward the 1.0.0 version. The most
+  important change is the addition of multiplexer and de-multiplexers;
+  also added the multi-wires (bus) markers.
+
+  \begin{itemize}
+  \tightlist
+  \item
+    Added mux-demux shapes
+  \item
+    Added the possibility to suppress the input leads in logic gates
+  \item
+    Added multiple wires markers
+  \item
+    Added a style to switch off the automatic rotation of instruments
+  \item
+    Changed the shape of the or-type american logic ports (reversible
+    with a flag)
+  \end{itemize}
+\item
   Version 1.0.0-pre1 (2019-12-22)
 
   Last additions before the long promised 1.0! In this pre-release we

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	2020-01-23 21:55:17 UTC (rev 53514)
+++ trunk/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.tex	2020-01-23 21:55:34 UTC (rev 53515)
@@ -1704,6 +1704,26 @@
 
 The \texttt{rmeter}, \texttt{rmaterwa}, and \texttt{smeter} have the same behavior.
 
+However, if you prefer that the \texttt{oscope}, \texttt{rmeter}, \texttt{smeter}  and \texttt{rmeterwa} instruments rotate the text or the diagram,
+you can use the key or style \texttt{rotated instruments} (the default style is \texttt{straight instruments}).
+
+\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
+    \begin{circuitikz}[scale=0.8, transform shape]
+    \ctikzset{rotated instruments} % new default
+    \draw (0,0) to[oscope] ++(0:3);
+    \draw (0,0) to[oscope] ++(60:3);
+    \draw (0,0) to[rmeter, t=A] ++(120:3);
+    % local override
+    \draw (0,0) to[rmeterwa, t=A, straight instruments] ++(180:3);
+    \ctikzset{straight instruments} % back to default
+    \draw (0,0) to[rmeterwa, t=A] ++(240:3);
+    % local override
+    \draw (0,0) to[smeter, t=A, rotated instruments] ++(300:3);
+\end{circuitikz}
+\end{LTXexample}
+
+
+
 \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.
@@ -1915,6 +1935,24 @@
 
 You can change the scale of all the miscellaneous elements by setting the key \texttt{misc/scale} to something different from the default \texttt{1.0}.
 
+\subsection{Multiple wires (buses)}
+
+This are simple drawings to indicate multiple wires.
+\begin{groupdesc}
+\circuitdescbip{multiwire}{Single line multiple wires}{multiwire}
+\circuitdescbip{bmultiwire}{Double line multiple wires}{bmultiwire}
+\end{groupdesc}
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+    \draw (0,0) to[multiwire=4] ++(1,0);
+    \draw (0,-2) to[bmultiwire=6] ++(1,0);
+\end{circuitikz}
+\end{LTXexample}
+
+
+
+
 \subsection{Crossings}
 
 Path style:
@@ -3211,7 +3249,7 @@
 
 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.
 
-You can change the symbols ``$+$'' or ``$-$'' appearing in the amplifiers if you want, both globally and on component-by-component basis. The plus and minus symbols can be changed with \verb|\ctikzset| of the keys \texttt{amplifiers/plus} and +\texttt{amplifiers/minus} (which defaults to the math mode plus or minus cited before), or using the styles \texttt{amp plus} and \texttt{amp minus}.
+You can change the symbols ``$+$'' or ``$-$'' appearing in the amplifiers if you want, both globally and on component-by-component basis. The plus and minus symbols can be changed with \verb|\ctikzset| of the keys \texttt{amplifiers/plus} and \texttt{amplifiers/minus} (which defaults to the math mode plus or minus cited before), or using the styles \texttt{amp plus} and \texttt{amp minus}.
 
 The font used is set in several keys, but you can change it globally with \verb|\tikzset{amp symbol font}|, which has a default of 10-point  (in \LaTeX, and the corresponding one in \ConTeXt). You can change it for example with
 \begin{lstlisting}
@@ -3346,6 +3384,23 @@
 \end{LTXexample}
 
 
+\subsubsection{Designing your own amplifier}
+
+If you need a different kind of amplifier, you can use the \texttt{muxdemux}
+(see section~\ref{sec:muxdemuxes}) shape for defining one that suits your needs (you need version \texttt{1.0.0} for this to work).
+
+\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
+\tikzset{tdax/.style={muxdemux,
+        muxdemux def={NL=2, Lh=3, NR=1, Rh=0,
+        NB=4, NT=5}, font=\scriptsize\ttfamily}}
+\begin{circuitikz}
+    \draw (0,0) node[tdax](A){TDA1};
+    \draw (2.5,0) node[tdax,
+        muxdemux def={Rh=0.5}]{TDA2};
+\end{circuitikz}
+\end{LTXexample}
+
+
 \subsection{Switches and buttons}
 
 Switches and button come in to-style (the simple ones and the pushbuttons), and as nodes.
@@ -3667,10 +3722,36 @@
 
 \subsubsection{Logic port customization}
 
+Since version \texttt{1.0.0}, the default shape of the family of american ``or'' ports has changed to a more ``pointy'' one, for better distinguish them from the ``and''-type ports. You can still going back to the previous aspect with the key \texttt{american or shape} that can be set to \texttt{pointy} or \texttt{roundy}. The \texttt{legacy} style will enact the old, roundy style also.
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[
+    american]
+    % legacy shapes
+    \ctikzset{american or shape=roundy}
+    \ctikzset{logic ports/fill=yellow}
+    \node [or port](O1) at (0,0) {};
+    \node [nor port](O2) at (0,-1.5) {};
+    \node [xor port](O3) at (0,-3) {};
+    \node [xnor port](O4) at (0,-4.5) {};
+    \begin{scope}[xshift=3cm]
+    % new shapes
+        \ctikzset{american or shape=pointy}
+        \node [or port](O1) at (0,0) {};
+        \node [nor port](O2) at (0,-1.5) {};
+        \node [xor port](O3) at (0,-3) {};
+        \node [xnor port](O4) at (0,-4.5) {};
+    \end{scope}
+\end{circuitikz}
+\end{LTXexample}
+
+
 Logic port class is called \texttt{logic ports}, so you can scale them all with \texttt{logic ports/scale} (default \texttt{1.0}).
 
-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):
+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).
 
+It is possible to change height and width of the logic ports using the parameters \texttt{tripoles/american \emph{type} port/} plus \texttt{width} or \texttt{height}:
+
 \begin{LTXexample}[varwidth=true]
 \tikz \draw (0,0) node[nand port] {}; \par
 \ctikzset{tripoles/american nand port/input height=.2}
@@ -3679,6 +3760,7 @@
 \tikz \draw (0,0) node[nand port] {};
 \end{LTXexample}
 
+
 This is especially useful if you have ports with more than two inputs, which are instantiated
 with the parameter \texttt{number inputs} :
 
@@ -3697,6 +3779,35 @@
 \end{circuitikz}
 \end{LTXexample}
 
+You can suppress the drawing of the logic ports input leads by using the boolean key \texttt{logic ports draw input leads}  (default \texttt{true}) or, locally, with the style \texttt{no inputs leads} (that can be reverted with \texttt{input leads}),  like in the following example. The anchors do not change and you have to take responsibility do do the connection to the ``border''-anchors.
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+    \node [or port](O1) at (0,2) {};
+    \node [or port, no input leads](O1) at (2,2) {};
+    \ctikzset{logic ports draw input leads=false}
+    \node [and port](O1) at (0,0) {};
+    \node [nand port, input leads](O1) at (2,0) {};
+\end{circuitikz}
+\end{LTXexample}
+
+This is useful if you need to draw a generic port, like the one following here:
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+    \ctikzset{tripoles/american nand port/height=1.6}
+    \draw (0,0)
+    node[american nand port,
+    circuitikz/tripoles/american nand port/height=1.1,
+    number inputs=5, no input leads,
+    ] (B) {Pn};
+    \draw (B.in 1) -- (B.bin 1) (B.in 5) -- (B.bin 5);
+    \node[rotate=90] at (B.in 3) {\dots};
+\end{circuitikz}
+\end{LTXexample}
+
+The flag works also for the european-style ports, and it suppress only the input leads because the negated ports in european style are ill-specified if you do not draw the output leads (and moreover, it seems really less useful).
+
 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]
@@ -3807,7 +3918,7 @@
 
 \subsection{Flip-flops}\label{sec:flipflops}
 
-Flip-flops are an hybrid between the logic ports and the chips. They have a class by themselves (\texttt{flipflops}) but the default parameters are set at the same values as the logic gates one.
+Flip-flops (available since version \texttt{1.0.0}) are an hybrid between the logic ports and the chips. They have a class by themselves (\texttt{flipflops}) but the default parameters are set at the same values as the logic gates one.
 
 The default flip flop is empty: it is just a rectangular box like a blank \texttt{dipchip}  with 6 pins.
 \begin{groupdesc}
@@ -3894,7 +4005,7 @@
 \end{groupdesc}
 \endgroup
 
-The standard definition of the default flip-flops are the following (you can find them in the file \texttt{pgfcircmultipoles.tex}):
+The standard definition of the default flip-flops are the following (in the file \texttt{pgfcircmultipoles.tex}):
 
 \begin{lstlisting}[basicstyle=\small\ttfamily]
 \tikzset{
@@ -3970,6 +4081,184 @@
 \end{tikzpicture}
 \end{LTXexample}
 
+\subsection{Multiplexer and de-multiplexer}\label{sec:muxdemuxes}
+
+The shape used for muxes and de-muxes is probably the most configurable shape of the package; it has been added by Romano in \texttt{v1.0.0}. The basic shape is a multiplexer with 8 input pin, one output pin, and three control pins ($2^3\to1$ multiplexer). The pins are not named as input or output pins (see below for a full description for anchors) for reasons that will be clear later.
+
+\begin{groupdesc}
+    \circuitdesc*[0.7]{muxdemux}{mux-demux}{MD1}(lpin 1/180/0.2, lpin 2/180/0.2, bpin 1/-90/0.2, blpin 1/0/0.2, blpin 2/0/0.2, bbpin 1/90/0.2, rpin 1/0/0.1, brpin 1/-110/0.1)
+\end{groupdesc}
+
+You can define a custom shape for the \texttt{muxdemux}es using an interface similar to the one used in flip-flops; for example:
+
+\begin{lstlisting}
+\tikzset{demux/.style={muxdemux, muxdemux def={Lh=4, Rh=8, NL=1, NB=3, NR=8}}}
+\end{lstlisting}
+
+will generate the following shape (the definition above is already defined in the package):
+
+\begin{groupdesc}
+    \circuitdesc*[0.7]{demux}{Demultiplexer $1\to2^3$ with \texttt{Lh=4, Rh=8, NL=1, NB=3, NR=8} }{MD2}
+\end{groupdesc}
+
+The shape can be also defined with an inset. For example it can be used like this to define a 1-bit adder (also already available):
+
+\begin{lstlisting}
+\tikzset{one bit adder/.style={muxdemux,
+         muxdemux def={Lh=4, NL=2, Rh=2, NR=1, NB=1, w=1.5,
+         inset w=0.5, inset Lh=2, inset Rh=1.5}}}
+\end{lstlisting}
+\begin{groupdesc}
+    \circuitdesc*{one bit adder}{One-bit adder}{\Large$\oplus$}
+\end{groupdesc}
+
+Or a Arithmetic Logic Unit (again, already defined by default):
+
+\begin{lstlisting}
+\tikzset{ALU/.style={muxdemux,
+         muxdemux def={Lh=5, NL=2, Rh=2, NR=1, NB=2, NT=1, w=2,
+         inset w=1, inset Lh=2, inset Rh=0, square pins=1}}}
+\end{lstlisting}
+\begin{groupdesc}
+    \circuitdesc*{ALU}{ALU}{\rotatebox{90}{\small\ttfamily ALU}}
+\end{groupdesc}
+
+\subsubsection{Mux-Demux: design your own shape}
+
+\begin{minipage}{0.45\linewidth}
+\RaggedRight
+In designing the shape there are several parameters to be taken into account. In the diagram on the right they are shown in a (hopefully) practical way. The parameter can be set in a node or in a style using the \texttt{muxdemux def} key as shown above, or set with \verb|\ctikzset| as \texttt{multipoles/muxdemux/Lh} keys and so on.
+\end{minipage}%
+\begin{minipage}{0.5\linewidth}
+\centering
+\begin{circuitikz}[quote/.style={thin, blue, <->}, refline/.style={red, dashed}]
+    \def\myquotev#1#2#3#4{%
+        \draw [refline] (A.#1) -- ++(#2,0) coordinate(tmp) --++(#3,0);
+        \draw [quote] (tmp|-A.center) -- (tmp |- A.#1)
+        node [midway, below=4pt, sloped, fill=white]{\texttt{#4}};
+    }
+    \def\myquoteh#1#2#3#4#5{%
+        \draw [refline] (A.#1) -- ++(0,#2) coordinate(tmp) --++(0,#3);
+        \draw [quote] (tmp) -- (tmp -| A.#5)
+        node [right, fill=white]{\texttt{#4}};
+    }
+    \begin{scope}
+        \clip (-4,-0.5) rectangle (2,3);
+        \node [muxdemux, muxdemux def={NL=6, NR=3, NT=3,
+        inset w=1.0, inset Lh=3.0, inset Rh=2.0}, no input leads](A) at(0,0) {};
+        \draw [refline] (-4,0) -- (2,0);
+        \draw [refline] (0,-1) -- (0,3);
+    \end{scope}
+    \myquotev{top left}{-2.8}{-.2}{Lh}
+    \myquotev{inset top left}{-2.0}{-.2}{inset Lh}
+    \myquotev{inset top right}{-1.4}{-.2}{inset Rh}
+    \myquotev{top right}{.5}{.2}{Rh}
+    \myquoteh{top left}{.3}{.2}{w}{center}
+    \myquoteh{inset top left}{-1.5}{-.2}{inset w}{inset top right}
+\end{circuitikz}
+\end{minipage}
+
+\bigskip
+
+The default values are $\texttt{Lh}=8$, $\texttt{Rh}=6$, $\texttt{w}=3$ and no inset: $\texttt{inset Lh}=\texttt{inset Rh}=\texttt{inset w}=0$. In addition, you can set the following parameters:
+\begin{description}
+    \item [NL, NR, NB, NT]: number of pins relatively on the left, right, bottom and top side (default \texttt{8}, \texttt{1}, \texttt{3}, \texttt{0}). When an inset is active (in other words, when $\texttt{Lh}>0$) the pins are positioned on the top and bottom part, not in the inset; the exception is when the number of left pins is odd, in which case you have one pin set on the center of the inset.
+    If you do not want a pin in one side, use \texttt{0} as number of pins.
+    \item [square pins]: set to \texttt{0} (default) if you want the square pins to stick out following the slope of the bottom or top side, \texttt{1} if you want them to stick out in a square way (see the example above for the ALU).
+\end{description}
+All the distances are multiple of \texttt{multipoles/muxdemux/base len} (default \texttt{0.4}, to be set with \verb|\ctikzset|), which is relative to the basic length. That value has been chosen so that, if you have a numbers of pins which is equal to the effective distance where they are spread (which is \texttt{Lh} without inset, $\texttt{Lh}- (\texttt{inset Lh})$ with an inset), then the distance is the same as the default pin distance in chips, as shown in the next circuit. In the same drawing you can see the effect of \texttt{square pins} parameters (without it, the rightmost bottom lead of the \texttt{mux 4by2} shape will not connect with the below one).
+
+\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
+\begin{circuitikz}
+    \tikzset{mux 4by2/.style={muxdemux,
+        muxdemux def={Lh=4, NL=4, Rh=3,
+        NB=2, w=2, square pins=1}}}
+    \node [dipchip, num pins=8](A) at (0,0) {IC1};
+    \node [one bit adder, scale=-1, anchor=lpin 2]
+        at (A.pin 1){};
+    \node [mux 4by2, anchor=lpin 1](B)
+        at (A.pin 8){MUX};
+    \node [qfpchip, num pins=8, anchor=pin 8] at
+        (B.bpin 1) {IC2};
+\end{circuitikz}
+\end{LTXexample}
+
+\subsubsection{Mux-Demux customization}
+
+Mux-demuxes have the normal parameters of their class (\texttt{muxdemuxes}):  you can scale them with the \verb|\ctikzset| key \texttt{muxdemuxes/scale}, control the border thickness with \texttt{muxdemuxes/thickness} and the default fill color with  \texttt{muxdemuxes/fill} --- they are set, by default, at the same values than \texttt{logic ports}.
+
+External pins' length is controlled by the key \texttt{multipoles/external pins width} (default \texttt{0.2}) or by the style \texttt{external pins width}. The parameter
+\texttt{multipoles/external pins thickness} is also respected.
+like in chips. In addition, like in logic ports, you can suppress the
+drawing of the leads by using the boolean key
+\texttt{logic ports draw input leads} (default \texttt{true}) or, locally,
+with the style \texttt{no inputs leads} (that can be reverted with
+\texttt{input leads}).
+
+The main difference between setting \texttt{external pins width} to \texttt{0} or using \texttt{no inputs lead} is that in the first case the normal pin anchors and the border anchors will coincide, and in the second case they will not move and stay where they should have been if the leads were drawn.
+
+\subsubsection{Mux-Demux anchors}
+
+Mux-demuxes have a plethora of anchors. As in the case of chips, the geographic anchors mark the rectangle occupied by the component, without taking into account the pin leads.
+
+\begin{quote}
+    \scalebox{0.7}{%
+        \geocoord[baseline=(N.center)]{muxdemux}
+        \showanchors[baseline=(N.center)]{muxdemux}{X}(top left/180/0.3, top/90/0.3, top right/0/0.3,
+        bottom left/180/0.3, bottom/-90/0.3, bottom right/0/0.3, left/180/0.3, right/0/0.3,
+        center/45/0.2, center up/0/0.4, center down/0/0.4)
+        \showanchors[baseline=(N.center)]{muxdemux, muxdemux def={NL=6, NR=3, NT=3, inset w=1.0,
+        inset Lh=3.0, inset Rh=2.0}, no input leads}{}(inset top left/180/0.3, inset top/90/0.5,
+        inset top right/0/0.3, inset bottom left/180/0.3, inset bottom/-90/0.5,
+        inset bottom right/-20/0.3, inset left/180/0.3, inset right/-20/0.2, inset center/135/0.2,
+        narrow center/20/0.2, center up/45/0.4, center down/-45/0.4)
+}
+\end{quote}
+
+The pins anchors are named \texttt{lpin}, \texttt{rpin}, \texttt{bpin} and \texttt{tpin} for the left, right, bottom and top pin respectively, and points to the ``external'' pin. The border pins are named the same, with a \texttt{b} added in front: \texttt{blpin}, \texttt{brpin}, \texttt{bbpin} and \texttt{btpin}.
+The following graph will show the numbering and position of the pin anchors.
+
+\begin{quote}
+\begin{circuitikz}
+    \node [muxdemux, muxdemux def={NL=4, NR=3, NT=3, NB=3, w=2, inset w=0.5,
+        Lh=4, inset Lh=2.0, inset Rh=1.0, square pins=1}](C) at (0,0) {X};
+    \node [muxdemux, muxdemux def={NL=7, NR=8, NT=4, inset w=1.0,
+        inset Lh=4.0, inset Rh=0.0}](D) at (4,0) {X};
+    \foreach \myn/\NL/\NR/\NB/\NT in {C/4/3/3/3,D/7/8/3/4} {
+        \foreach \myp in {1,...,\NL} \node[right, font=\tiny] at (\myn.blpin \myp){\myp};
+        \foreach \myp in {1,...,\NR} \node[left, font=\tiny] at(\myn.brpin \myp) {\myp};
+        \foreach \myp in {1,...,\NB} \node[above, font=\tiny] at (\myn.bbpin \myp){\myp};
+        \foreach \myp in {1,...,\NT} \node[below, font=\tiny] at (\myn.btpin \myp){\myp};
+    }
+    \path (C.lpin 1) \showcoord(lpin 1)<180:0.3>;
+    \path (D.blpin 1) \showcoord(blpin 1)<135:0.3>;
+    \path (C.tpin 1) \showcoord(tpin 1)<180:0.3>;
+    \path (D.btpin 1) \showcoord(btpin 1)<45:0.3>;
+    \path (C.rpin 1) \showcoord(rpin 1)<0:0.3>;
+    \path (D.brpin 1) \showcoord(brpin 1)<45:0.3>;
+    \path (C.bpin 2) \showcoord(bpin 2)<-90:0.3>;
+    \path (C.bbpin 2) \showcoord(bbpin 2)<-60:0.3>;
+    \path (D.bbpin 2) \showcoord(bbpin 2)<-45:0.3>;
+\end{circuitikz}
+\end{quote}
+
+
+The code that implemented the printing of the numbers (which in \texttt{muxdemux}es, differently from chips, are never printed automatically) in the last graph is the following one.
+
+\begin{lstlisting}[basicstyle=\small\ttfamily]
+\begin{circuitikz}
+\node [muxdemux, muxdemux def={NL=4, NR=3, NT=3, NB=3, w=2, inset w=0.5,
+    Lh=4, inset Lh=2.0, inset Rh=1.0, square pins=1}](C) at (0,0) {X};
+\node [muxdemux, muxdemux def={NL=7, NR=8, NT=4, inset w=1.0,
+    inset Lh=4.0, inset Rh=0.0}](D) at (4,0) {X};
+\foreach \myn/\NL/\NR/\NB/\NT in {C/4/3/3/3,D/7/8/3/4} {
+    \foreach \myp in {1,...,\NL} \node[right, font=\tiny] at (\myn.blpin \myp){\myp};
+    \foreach \myp in {1,...,\NR} \node[left, font=\tiny] at(\myn.brpin \myp) {\myp};
+    \foreach \myp in {1,...,\NB} \node[above, font=\tiny] at (\myn.bbpin \myp){\myp};
+    \foreach \myp in {1,...,\NT} \node[below, font=\tiny] at (\myn.btpin \myp){\myp};
+}
+\end{lstlisting}
+
 \subsection{Chips (integrated circuits)}
 
 \texttt{CircuiTikZ} supports two types of variable-pin chips: DIP (Dual-in-Line Package) and QFP (Quad-Flat Package).

Modified: trunk/Master/texmf-dist/doc/latex/circuitikz/ctikzmanutils.sty
===================================================================
--- trunk/Master/texmf-dist/doc/latex/circuitikz/ctikzmanutils.sty	2020-01-23 21:55:17 UTC (rev 53514)
+++ trunk/Master/texmf-dist/doc/latex/circuitikz/ctikzmanutils.sty	2020-01-23 21:55:34 UTC (rev 53515)
@@ -3,6 +3,7 @@
 \RequirePackage{ifthen}
 \RequirePackage{xparse}
 \RequirePackage{showexpl}
+\RequirePackage{ragged2e}
 %
 % The following trick is used to silence showexpl a bit, so that the
 % logs are readable...
@@ -61,7 +62,7 @@
         \end{circuitikz}%
         }{\sloppy%
         {#4, type: node\IfBooleanT{#1}{, fillable}%
-    } (\texttt{node[#3]\IfValueT{#7}{(N)}\{#5\}}). \index{#3}%
+        } (\texttt{node[\detokenize{#3}]\IfValueT{#7}{(N)}\{\detokenize{#5}\}}). \index{#3}%
         \checkclass{N}%
     }%
 }
@@ -131,7 +132,7 @@
 }
 
 
-\def\geolrcoord#1{\showanchors{#1}{text}(north/90/0.4, north east/45/0.4, east/0/0.4,
+\newcommand{\geolrcoord}[2][]{\showanchors[#1]{#2}{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
@@ -138,7 +139,7 @@
     )
 }
 
-\def\geocoord#1{\showanchors{#1}{text}(north/90/0.4, north east/45/0.4, east/0/0.4,
+\newcommand{\geocoord}[2][]{\showanchors[#1]{#2}{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

Modified: trunk/Master/texmf-dist/tex/context/third/circuitikz/t-circuitikz.tex
===================================================================
--- trunk/Master/texmf-dist/tex/context/third/circuitikz/t-circuitikz.tex	2020-01-23 21:55:17 UTC (rev 53514)
+++ trunk/Master/texmf-dist/tex/context/third/circuitikz/t-circuitikz.tex	2020-01-23 21:55:34 UTC (rev 53515)
@@ -1,5 +1,5 @@
-\def\pgfcircversion{1.0.0-pre1}
-\def\pgfcircversiondate{2019/12/22}
+\def\pgfcircversion{1.0.0-pre2}
+\def\pgfcircversiondate{2020/01/23}
 \writestatus{loading}{\pgfcircversiondate{} The CircuiTikz circuit drawing package version \pgfcircversion}
 
 \usemodule[tikz]

Modified: trunk/Master/texmf-dist/tex/generic/circuitikz/ctikzstyle-legacy.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/circuitikz/ctikzstyle-legacy.tex	2020-01-23 21:55:17 UTC (rev 53514)
+++ trunk/Master/texmf-dist/tex/generic/circuitikz/ctikzstyle-legacy.tex	2020-01-23 21:55:34 UTC (rev 53515)
@@ -110,6 +110,7 @@
 logic ports/fill=none,
 logic ports/thickness=none,
 logic ports origin=legacy, % it can be "center" (better)
+american or shape=roundy,% could be pointy
 %
 % flip-flops
 flipflops/scale=1.0

Modified: trunk/Master/texmf-dist/tex/generic/circuitikz/ctikzstyle-romano.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/circuitikz/ctikzstyle-romano.tex	2020-01-23 21:55:17 UTC (rev 53514)
+++ trunk/Master/texmf-dist/tex/generic/circuitikz/ctikzstyle-romano.tex	2020-01-23 21:55:34 UTC (rev 53515)
@@ -55,7 +55,8 @@
 % Logic ports
 logic ports/scale=1.0,
 logic ports/thickness=2.0,
-logic ports origin=center, % it can be "center" (better)
+logic ports origin=center,
+american or shape=pointy,
 %
 % flip-flops
 flipflops/scale=1.0

Modified: trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex	2020-01-23 21:55:17 UTC (rev 53514)
+++ trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex	2020-01-23 21:55:34 UTC (rev 53515)
@@ -364,6 +364,10 @@
 \ctikzset{flipflops/fill/.initial=none}
 \ctikzset{flipflops/thickness/.initial=none}
 
+\ctikzset{muxdemuxes/scale/.initial=1.0}
+\ctikzset{muxdemuxes/fill/.initial=none}
+\ctikzset{muxdemuxes/thickness/.initial=none}
+
 \ctikzset{chips/scale/.initial=1.0}
 \ctikzset{chips/fill/.initial=none}
 \ctikzset{chips/thickness/.initial=none}
@@ -658,6 +662,11 @@
 \ctikzset{bipoles/short/width/.initial=0} %dummy width for voltage positioning
 %\ctikzset{bipoles/short/voltage/straight label distance/.initial=.2}
 %\ctikzset{bipoles/short/voltage/distance from node/.initial=.5}
+% multiwire
+\ctikzset{bipoles/multiwire/height/.initial=0.4}
+\ctikzset{bipoles/multiwire/width/.initial=0.2}
+\ctikzset{bipoles/multiwire/spacing/.initial=0.05}
+
 \ctikzset{bipoles/ammeter/height/.initial=.60}
 \ctikzset{bipoles/ammeter/width/.initial=.60}
 \ctikzset{bipoles/ohmmeter/height/.initial=.60}
@@ -673,6 +682,15 @@
 \ctikzset{bipoles/iloop/height/.initial=.60}
 \ctikzset{bipoles/oscope/height/.initial=.60}
 \ctikzset{bipoles/oscope/width/.initial=.60}
+
+% option to not rotate the new (Romano's) instruments
+\newif\ifpgf at circuit@straightinstruments\pgf at circuit@straightinstrumentstrue
+\pgfkeys{/tikz/straight instruments/.add code={}{\pgf at circuit@straightinstrumentstrue}}
+\ctikzset{straight instruments/.add code={}{\pgf at circuit@straightinstrumentstrue}}
+\pgfkeys{/tikz/rotated instruments/.add code={}{\pgf at circuit@straightinstrumentsfalse}}
+\ctikzset{rotated instruments/.add code={}{\pgf at circuit@straightinstrumentsfalse}}
+
+
 \ctikzset{bipoles/buffer/height/.initial=1}
 \ctikzset{bipoles/buffer/width/.initial=1}
 \ctikzset{bipoles/not port/width/.initial=1}
@@ -1144,7 +1162,18 @@
     }%
 }
 
+\newif\ifpgfcirc at roundy@or at shapes\pgfcirc at roundy@or at shapesfalse
+\ctikzset{american or shape/.is choice}
+\ctikzset{american or shape/roundy/.code={\pgfcirc at roundy@or at shapestrue}}
+\ctikzset{american or shape/pointy/.code={\pgfcirc at roundy@or at shapesfalse}}
 
+\newif\ifpgfcirc at draw@leads\pgfcirc at draw@leadstrue
+\ctikzset{logic ports draw input leads/.is choice}
+\ctikzset{logic ports draw input leads/true/.code={\pgfcirc at draw@leadstrue}}
+\ctikzset{logic ports draw input leads/false/.code={\pgfcirc at draw@leadsfalse}}
+\tikzset{input leads/.code={\pgfcirc at draw@leadstrue}}
+\tikzset{no input leads/.code={\pgfcirc at draw@leadsfalse}}
+
 \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}
@@ -1283,11 +1312,27 @@
 \pgfkeys{/tikz/number inputs/.default=0}
 
 %% flip-flop specific keys (most others are the same as chips)
+
 \ctikzset{multipoles/flipflop/font/.initial=\pgf at circ@font at small}
 \ctikzset{multipoles/flipflop/fontud/.initial=\pgf at circ@font at tiny}
 \ctikzset{multipoles/flipflop/width/.initial=1.2}
 \ctikzset{multipoles/flipflop/pin spacing/.initial=0.6}
 \ctikzset{multipoles/flipflop/clock wedge size/.initial=0.2}
+
+%% muxdemuxes keys
+
+\ctikzset{multipoles/muxdemux/base len/.initial=0.4}
+\ctikzset{multipoles/muxdemux/Lh/.initial=8.0}
+\ctikzset{multipoles/muxdemux/Rh/.initial=6.0}
+\ctikzset{multipoles/muxdemux/w/.initial=3.0}
+\ctikzset{multipoles/muxdemux/inset w/.initial=0.0}
+\ctikzset{multipoles/muxdemux/inset Lh/.initial=0.0}
+\ctikzset{multipoles/muxdemux/inset Rh/.initial=0.0}
+\ctikzset{multipoles/muxdemux/NL/.initial=8}
+\ctikzset{multipoles/muxdemux/NR/.initial=1}
+\ctikzset{multipoles/muxdemux/NB/.initial=3}
+\ctikzset{multipoles/muxdemux/NT/.initial=0}
+\ctikzset{multipoles/muxdemux/square pins/.initial=0}
 %
 % switches for op amps
 % changing input polarity

Modified: trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex	2020-01-23 21:55:17 UTC (rev 53514)
+++ trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex	2020-01-23 21:55:34 UTC (rev 53515)
@@ -231,6 +231,37 @@
 {\ctikzvalof{bipoles/open/width}}
 { }
 
+% multiwire(s)
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/multiwire/height}}
+{multiwire}
+{\ctikzvalof{bipoles/multiwire/height}}
+{\ctikzvalof{bipoles/multiwire/width}}
+{
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+    \pgfusepath{draw}
+}
+
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/multiwire/height}}
+{bmultiwire}
+{\ctikzvalof{bipoles/multiwire/height}}
+{\ctikzvalof{bipoles/multiwire/width}}
+{
+    \pgf at circ@res at other=\ctikzvalof{bipoles/multiwire/spacing}\pgf at circ@Rlen
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left+\pgf at circ@res at other}{\pgf at circ@res at down}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at up}}
+    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+    \pgfusepath{draw}
+}
 %% Generic bipole - used as resistor by some (bleah)
 \pgfcircdeclarebipolescaled{resistors}
 {}
@@ -2997,8 +3028,12 @@
         \pgf at circ@draworfill
     \endpgfscope
     % get the rotation
-    \pgfgettransformentries\a\b\temp\temp\temp\temp
-    \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
+    \ifpgf at circuit@straightinstruments
+        \pgfgettransformentries\a\b\temp\temp\temp\temp
+        \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
+    \else
+        \edef\rot{0}
+    \fi
     % and unrotate the scope
     \pgfscope
         \pgftransformrotate{\rot}
@@ -3037,8 +3072,12 @@
     \pgf at circ@draworfill
     % draw the text label
     % get the rotation
-    \pgfgettransformentries\a\b\temp\temp\temp\temp
-    \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
+    \ifpgf at circuit@straightinstruments
+        \pgfgettransformentries\a\b\temp\temp\temp\temp
+        \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
+    \else
+        \edef\rot{0}
+    \fi
     % and unrotate the scope
     \pgfscope
         \pgfsetcolor{\ctikzvalof{color}}
@@ -3061,8 +3100,12 @@
     \pgf at circ@draworfill
     % draw the text label
     % get the rotation
-    \pgfgettransformentries\a\b\temp\temp\temp\temp
-    \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
+    \ifpgf at circuit@straightinstruments
+        \pgfgettransformentries\a\b\temp\temp\temp\temp
+        \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
+    \else
+        \edef\rot{0}
+    \fi
     % and unrotate the scope
     \pgfscope
         \pgftransformrotate{\rot}
@@ -3118,8 +3161,12 @@
         \pgf at circ@draworfill
     \endpgfscope
     % get the rotation
-    \pgfgettransformentries\a\b\temp\temp\temp\temp
-    \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
+    \ifpgf at circuit@straightinstruments
+        \pgfgettransformentries\a\b\temp\temp\temp\temp
+        \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
+    \else
+        \edef\rot{0}
+    \fi
     % and unrotate the scope
     \pgfscope
         \pgftransformrotate{\rot}

Modified: trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcirclabel.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcirclabel.tex	2020-01-23 21:55:17 UTC (rev 53514)
+++ trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcirclabel.tex	2020-01-23 21:55:34 UTC (rev 53515)
@@ -182,7 +182,9 @@
         % 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}
+        \pgfgettransformentries{\tmpa}{\tmpb}{\tmpc}{\tmpd}{\tmp}{\tmp}%
+        \pgfmathsetmacro{\myscale}{sqrt(abs(\tmpa*\tmpd-\tmpb*\tmpc))}% abs should not be needed
+        % \typeout{ROT\tmpa\space\tmpb\space\tmpc\space\tmpd\space\myscale}
         \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
@@ -216,7 +218,9 @@
     \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}
+        \pgfgettransformentries{\tmpa}{\tmpb}{\tmpc}{\tmpd}{\tmp}{\tmp}%
+        \pgfmathsetmacro{\myscale}{sqrt(abs(\tmpa*\tmpd-\tmpb*\tmpc))}% abs should not be needed
+        % \typeout{ROT\tmpa\space\tmpb\space\tmpc\space\tmpd\space\myscale}
         \pgfmathsetlength\pgf at circ@res at temp{\pgf at circ@ls/\myscale}
         \pgfmathadd{\pgf at circ@labanc}{90}
         \pgfmathround{\pgfmathresult}

Modified: trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircmultipoles.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircmultipoles.tex	2020-01-23 21:55:17 UTC (rev 53514)
+++ trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircmultipoles.tex	2020-01-23 21:55:34 UTC (rev 53515)
@@ -1281,5 +1281,492 @@
                 \advance\pgf at circ@count at a by -1\relax%
                 \repeatpgfmathloop%
             }%
-        }
+}
 
+%
+% MUX-DEMUXES
+%
+% Thanks to @marmot
+\tikzset{muxdemux def/.code=\pgfqkeys{\circuitikzbasekey/multipoles/muxdemux}{#1}}
+\tikzset{demux/.style={muxdemux, muxdemux def={Lh=4, Rh=8, NL=1, NB=3, NR=8}}}
+\tikzset{one bit adder/.style={muxdemux,
+         muxdemux def={Lh=4, NL=2, Rh=2, NR=1, NB=1, w=1.5,
+         inset w=0.5, inset Lh=2, inset Rh=1.5}}}
+\tikzset{ALU/.style={muxdemux,
+         muxdemux def={Lh=5, NL=2, Rh=2, NR=1, NB=2, NT=1, w=2,
+         inset w=1, inset Lh=2, inset Rh=0, square pins=1}}}
+%generic mux-demux shape
+\pgfdeclareshape{muxdemux}{
+    \savedmacro{\ctikzclass}{\edef\ctikzclass{muxdemuxes}}
+    \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf at x}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}}
+    \savedmacro{\thisshape}{\def\thisshape{\tikz at fig@name}}
+    % pins on the four sides
+    % \savedmacro\NL{%
+    %         \pgf at circ@count at a=\ctikzvalof{multipoles/muxdemux/NL}%
+    %         \def\NL{\the\pgf at circ@count at a}
+    % }
+    \savedmacro\NL{\edef\NL{\ctikzvalof{multipoles/muxdemux/NL}}}
+    \savedmacro\NR{\edef\NR{\ctikzvalof{multipoles/muxdemux/NR}}}
+    \savedmacro\NT{\edef\NT{\ctikzvalof{multipoles/muxdemux/NT}}}
+    \savedmacro\NB{\edef\NB{\ctikzvalof{multipoles/muxdemux/NB}}}
+    \savedmacro\squarepins{\edef\squarepins{\ctikzvalof{multipoles/muxdemux/square pins}}}
+    % topleft and topright sizes
+    \savedanchor{\topleft}{%
+        \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+        \pgfmathsetlength\pgf at y{\ctikzvalof{multipoles/muxdemux/base len}*\ctikzvalof{multipoles/muxdemux/Lh}*\pgf at circ@scaled at Rlen/2}
+        \pgfmathsetlength\pgf at x{-\ctikzvalof{multipoles/muxdemux/base len}*\ctikzvalof{multipoles/muxdemux/w}*\pgf at circ@scaled at Rlen/2}
+    }
+    \savedanchor{\topright}{%
+        \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+        \pgfmathsetlength\pgf at y{\ctikzvalof{multipoles/muxdemux/base len}*\ctikzvalof{multipoles/muxdemux/Rh}*\pgf at circ@scaled at Rlen/2}
+        \pgfmathsetlength\pgf at x{\ctikzvalof{multipoles/muxdemux/base len}*\ctikzvalof{multipoles/muxdemux/w}*\pgf at circ@scaled at Rlen/2}
+    }
+    \savedanchor{\insetnortheast}{%
+        \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+        \pgfmathsetlength\pgf at y{\ctikzvalof{multipoles/muxdemux/base len}*\ctikzvalof{multipoles/muxdemux/inset Lh}*\pgf at circ@scaled at Rlen/2}
+        \pgfmathsetlength\pgf at x{-\ctikzvalof{multipoles/muxdemux/base len}*
+        (\ctikzvalof{multipoles/muxdemux/w}-2*\ctikzvalof{multipoles/muxdemux/inset w})*\pgf at circ@scaled at Rlen/2}
+    }
+    \saveddimen{\insethright}{
+        \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+        \pgfmathsetlength\pgf at x{\ctikzvalof{multipoles/muxdemux/base len}*\ctikzvalof{multipoles/muxdemux/inset Rh}*\pgf at circ@scaled at Rlen/2}}
+    \saveddimen{\extshift}{
+        \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+        \pgfmathsetlength\pgf at x{\pgf at circ@scaled at Rlen*\ctikzvalof{multipoles/external pins width}}}
+    \savedanchor{\northwest}{%
+        \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+        \pgfmathsetlength\pgf at y{\ctikzvalof{multipoles/muxdemux/base len}*max(\ctikzvalof{multipoles/muxdemux/Rh},\ctikzvalof{multipoles/muxdemux/Lh})*\pgf at circ@scaled at Rlen/2}
+        \pgfmathsetlength\pgf at x{-\ctikzvalof{multipoles/muxdemux/base len}*\ctikzvalof{multipoles/muxdemux/w}*\pgf at circ@scaled at Rlen/2}
+    }
+    \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 }
+    \anchor{center}{\pgfpointorigin}
+    \anchor{top right}{\topright}
+    \anchor{bottom right}{\topright\pgf at y=-\pgf at y}
+    \anchor{right}{\topright\pgf at y=0pt\relax}
+    \anchor{top left}{\topleft}
+    \anchor{bottom left}{\topleft\pgf at y=-\pgf at y}
+    \anchor{left}{\topleft\pgf at y=0pt\relax}
+    \anchor{top}{\topright\pgf at ya=\pgf at y \topleft \advance\pgf at y by \pgf at ya
+        \divide\pgf at y by 2 \pgf at x=0pt\relax}
+    \anchor{bottom}{\topright\pgf at ya=\pgf at y \topleft \advance\pgf at y by \pgf at ya
+        \divide\pgf at y by 2 \pgf at y=-\pgf at y \pgf at x=0pt\relax}
+    \anchor{inset top right}{\pgf at ya=\insethright\insetnortheast\advance\pgf at y by -0.5\pgf at ya}
+    \anchor{inset bottom right}{\pgf at ya=\insethright\insetnortheast\advance\pgf at y by -0.5\pgf at ya\pgf at y=-\pgf at y}
+    \anchor{inset right}{\insetnortheast\pgf at y=0pt\relax}
+    \anchor{inset top left}{\insetnortheast\pgf at ya=\pgf at y\topleft\pgf at y=\pgf at ya}
+    \anchor{inset bottom left}{\insetnortheast\pgf at ya=\pgf at y\topleft\pgf at y=-\pgf at ya}
+    \anchor{inset left}{\topleft\pgf at y=0pt\relax}
+    \anchor{inset bottom}{\topleft\pgf at xa=\pgf at x\pgf at ya=\insethright
+        \insetnortheast\pgf at xb=\pgf at x\pgf at yb=\pgf at x
+        \pgfpoint{(\pgf at xa+\pgf at xb)/2}{-\pgf at ya+\pgf at yb/2}}
+    \anchor{inset top}{\topleft\pgf at xa=\pgf at x\pgf at ya=\insethright
+        \insetnortheast\pgf at xb=\pgf at x\pgf at yb=\pgf at x
+        \pgfpoint{(\pgf at xa+\pgf at xb)/2}{\pgf at ya-\pgf at yb/2}}
+    \anchor{inset center}{\topleft\pgf at xa=\pgf at x\insetnortheast
+        \advance\pgf at x by \pgf at xa \divide\pgf at x by 2 \pgf at y=0pt\relax}
+    \anchor{narrow center}{\insetnortheast\pgf at xa=\pgf at x\topright
+        \advance\pgf at x by \pgf at xa \divide\pgf at x by 2\pgf at y=0pt\relax}
+    \anchor{center up}{\topright\pgf at ya=\pgf at y \topleft \advance\pgf at y by \pgf at ya
+        \divide\pgf at y by 2
+        \pgf at yb = \insethright \advance\pgf at y by \pgf at yb
+        \divide\pgf at y by 2 \pgf at x=0pt\relax}
+    \anchor{center down}{\topright\pgf at ya=\pgf at y \topleft \advance\pgf at y by \pgf at ya
+        \divide\pgf at y by 2
+        \pgf at yb = \insethright \advance\pgf at y by \pgf at yb
+        \divide\pgf at y by 2 \pgf at y=-\pgf at y \pgf at x=0pt\relax}
+    \anchor{text}{%
+        \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+        \pgfmathsetlength\pgf at x{\ctikzvalof{multipoles/muxdemux/base len}*
+          \ctikzvalof{multipoles/muxdemux/inset w}*\pgf at circ@scaled at Rlen/2}
+        \advance\pgf at x by -.5\wd\pgfnodeparttextbox%
+        \pgf at y=-.5\ht\pgfnodeparttextbox%
+        \advance\pgf at y by+.5\dp\pgfnodeparttextbox%
+    }%
+    \backgroundpath{%
+        \topleft
+        \pgf at circ@res at up = \pgf at y
+        \pgf at circ@res at down = -\pgf at y
+        \pgf at circ@res at left = \pgf at x
+        \topright
+        \pgf at circ@res at other = \pgf at y
+        \pgf at circ@res at right = \pgf at x
+        \insetnortheast
+        \pgf at circ@res at step = \pgf at x
+        \pgf at circ@res at temp = \pgf at y
+        %
+        % external block
+        %
+        \pgfscope% (for the line width)
+            \pgf at circ@setlinewidth{multipoles}{\pgflinewidth}
+            \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 other}}
+            \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{-\pgf at circ@res at other}}
+            \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+            % inset, starting down
+            \ifdim\pgf at circ@res at temp>0pt % inset
+                % \typeout{INSETw\space\the\pgf at circ@res at right\space x\space\the\pgf at circ@res at step\space  y\space\the\pgf at circ@res at temp}
+                \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{-\pgf at circ@res at temp}}
+                \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{-\insethright}}
+                \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{\insethright}}
+                \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at temp}}
+            \fi
+            \pgfpathclose
+            \pgf at circ@draworfill
+        \endpgfscope
+        % now we have to draw the pins, if needed
+        \ifdim\extshift>0pt\ifpgfcirc at draw@leads\pgfscope % let's avoid too much indent
+        % Ok, we have to draw the leads (a.k.a. pins)
+            \pgfsetlinewidth{\ctikzvalof{multipoles/external pins thickness}\pgflinewidth}
+            % We mimic the anchors here --- probably there is a better way
+            % left pins
+            \ifnum\NL>0\relax % not indented, closed on \repeatpgfmathloop
+            \pgf at circ@count at a=\NL\relax
+            \pgf at circ@count at b=\NL \divide\pgf at circ@count at b by 2 % see https://tex.stackexchange.com/questions/146523/why-does-numexpr-integer-division-round-rather-than-truncate
+            \topleft\pgf at circ@res at left=\pgf at x \pgf at circ@res at up=\pgf at y
+            \insetnortheast\pgf at circ@res at right=\pgf at x \pgf at circ@res at down=\pgf at y
+            \ifdim\pgf at circ@res at down>0pt % check if we have an inset
+            % we have to check oddity
+                \ifodd\NL
+                    \ifnum\NL=1
+                        % only centerpin, step should not be used, but anyway...
+                        \pgfmathsetlength{\pgf at circ@res at step}{2*(\pgf at circ@res at up-\pgf at circ@res at down)/(\NL)}
+                    \else
+                        \pgfmathsetlength{\pgf at circ@res at step}{2*(\pgf at circ@res at up-\pgf at circ@res at down)/(\NL-1)}
+                    \fi
+                \else
+                    \pgfmathsetlength{\pgf at circ@res at step}{2*(\pgf at circ@res at up-\pgf at circ@res at down)/\NL}
+                \fi
+            \else % no inset
+                \pgfmathsetlength{\pgf at circ@res at step}{2*\pgf at circ@res at up/\NL}
+            \fi
+            \pgfmathloop%
+            \ifnum\pgf at circ@count at a>0
+                %%%%%
+                \ifdim\pgf at circ@res at down>0pt % check if we have an inset
+                    \ifnum\pgf at circ@count at a>\pgf at circ@count at b\relax
+                        % for lower pins we have to shift them down
+                        % \typeout{DEBUGTEST1\space #1\space entering\space \NL}
+                        \ifodd\NL
+                            % odd number of pins
+                            \ifnum\pgf at circ@count at a=\numexpr\the\pgf at circ@count at b+1\relax
+                                % centerpin!
+                                \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+                                \ifnum\squarepins>0
+                                    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left-\extshift}{0pt}}
+                                \else
+                                    \pgfpathlineto{\pgfpoint{\pgf at circ@res at right-\extshift}{0pt}}
+                                \fi
+                            \else
+                                \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up+(0.5-\pgf at circ@count at a+1)*\pgf at circ@res at step-2*\pgf at circ@res at down}}
+                                \pgfpathlineto{\pgfpoint{\pgf at circ@res at left-\extshift}{\pgf at circ@res at up+(0.5-\pgf at circ@count at a+1)*\pgf at circ@res at step-2*\pgf at circ@res at down}}
+                            \fi
+                        \else
+                            % even numer of pins: just go down
+                            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up+(0.5-\pgf at circ@count at a)*\pgf at circ@res at step-2*\pgf at circ@res at down}}
+                            \pgfpathlineto{\pgfpoint{\pgf at circ@res at left-\extshift}{\pgf at circ@res at up+(0.5-\pgf at circ@count at a)*\pgf at circ@res at step-2*\pgf at circ@res at down}}
+                        \fi
+                    \else
+                        % nothing need for #1<=NL/2
+                        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up+(0.5-\pgf at circ@count at a)*\pgf at circ@res at step}}
+                        \pgfpathlineto{\pgfpoint{\pgf at circ@res at left-\extshift}{\pgf at circ@res at up+(0.5-\pgf at circ@count at a)*\pgf at circ@res at step}}
+                    \fi
+                \else
+                % no inset
+                    \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up+(0.5-\pgf at circ@count at a)*\pgf at circ@res at step}}
+                    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left-\extshift}{\pgf at circ@res at up+(0.5-\pgf at circ@count at a)*\pgf at circ@res at step}}
+                \fi
+                %%%%%
+                \advance\pgf at circ@count at a by -1\relax%
+            \repeatpgfmathloop\fi%
+            % right pins
+            \ifnum\NR>0\pgf at circ@count at a=\NR\relax
+            \pgfmathloop%
+            \topright\pgf at circ@res at right=\pgf at x \pgf at circ@res at up=\pgf at y
+            \pgfmathsetlength{\pgf at circ@res at step}{2*\pgf at circ@res at up/\NR}
+            \ifnum\pgf at circ@count at a>0
+                \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up+(0.5-\pgf at circ@count at a)*\pgf at circ@res at step}}
+                \pgfpathlineto{\pgfpoint{\pgf at circ@res at right+\extshift}{\pgf at circ@res at up+(0.5-\pgf at circ@count at a)*\pgf at circ@res at step}}
+            \advance\pgf at circ@count at a by -1\relax%
+            \repeatpgfmathloop\fi%
+            % bottom pins
+            \ifnum\NB>0\pgf at circ@count at a=\NB\relax %%%
+            \pgfmathloop%
+            \topleft\pgf at circ@res at left=\pgf at x \pgf at circ@res at up=\pgf at y
+            \topright\pgf at circ@res at right=\pgf at x \pgf at circ@res at down=\pgf at y
+            \pgfmathsetlength{\pgf at circ@res at step}{2*\pgf at circ@res at right/\NB}
+            \pgfmathsetlength{\pgf at circ@res at other}{(\pgf at circ@res at down-\pgf at circ@res at up)/(\pgf at circ@res at right-\pgf at circ@res at left)*\pgf at circ@res at step}
+            \ifnum\pgf at circ@count at a>0
+                \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left+(\pgf at circ@count at a-0.5)*\pgf at circ@res at step}
+                {-\pgf at circ@res at down+(\NB-\pgf at circ@count at a+0.5)*\pgf at circ@res at other}}
+                \ifnum\squarepins>0
+                    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left+(\pgf at circ@count at a-0.5)*\pgf at circ@res at step}
+                    {-max(\pgf at circ@res at down, \pgf at circ@res at up)-\extshift}}
+                \else
+                    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left+(\pgf at circ@count at a-0.5)*\pgf at circ@res at step}
+                    {-\pgf at circ@res at down+(\NB-\pgf at circ@count at a+0.5)*\pgf at circ@res at other-\extshift}}
+                \fi
+            \advance\pgf at circ@count at a by -1\relax%
+            \repeatpgfmathloop\fi%
+            % top pins
+            \ifnum\NT>0\pgf at circ@count at a=\NT\relax
+            \pgfmathloop%
+            \topleft\pgf at circ@res at left=\pgf at x \pgf at circ@res at up=\pgf at y
+            \topright\pgf at circ@res at right=\pgf at x \pgf at circ@res at down=\pgf at y
+            \pgfmathsetlength{\pgf at circ@res at step}{2*\pgf at circ@res at right/\NT}
+            \pgfmathsetlength{\pgf at circ@res at other}{(\pgf at circ@res at down-\pgf at circ@res at up)/(\pgf at circ@res at right-\pgf at circ@res at left)*\pgf at circ@res at step}
+            \ifnum\pgf at circ@count at a>0
+                \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left+(\pgf at circ@count at a-0.5)*\pgf at circ@res at step}
+                {\pgf at circ@res at down-(\NT-\pgf at circ@count at a+0.5)*\pgf at circ@res at other}}
+                \ifnum\squarepins>0
+                    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left+(\pgf at circ@count at a-0.5)*\pgf at circ@res at step}
+                    {max(\pgf at circ@res at down, \pgf at circ@res at up)+\extshift}}
+                \else
+                    \pgfpathlineto{\pgfpoint{\pgf at circ@res at left+(\pgf at circ@count at a-0.5)*\pgf at circ@res at step}
+                    {\pgf at circ@res at down-(\NT-\pgf at circ@count at a+0.5)*\pgf at circ@res at other+\extshift}}
+                \fi
+            \advance\pgf at circ@count at a by -1\relax%
+            \repeatpgfmathloop\fi%
+        % end drawing pins; stroke them
+        \pgfusepath{stroke}
+        \endpgfscope\fi\fi
+    }
+    % let's start adding anchors
+    \pgfutil at g@addto at macro\pgf at sh@s at muxdemux{%
+        % left side anchors
+        \pgf at circ@count at a=\NL\relax
+        % \typeout{STARTGENERATINGLEFT\space\the\pgf at circ@count at a\space FOR\space\thisshape\space\NL}
+        \pgfmathloop%
+        \ifnum\pgf at circ@count at a>0
+        % \typeout{GENERATINGLEFT\space\the\pgf at circ@count at a\space FOR\space\thisshape\space\NL}
+            % we will create two anchors per pin: the "normal one" like `lpin 1` for the
+            % external leads, and the "border one" like `blpin 1` for internal ones.
+            % they will coincide if `external pins width` is set to 0.
+            \expandafter\xdef\csname pgf at anchor@muxdemux at lpin\space\the\pgf at circ@count at a\endcsname{%
+                \noexpand\pgf at circ@muxdemux at L@anchor{\the\pgf at circ@count at a}{1}%
+            }
+            \expandafter\xdef\csname pgf at anchor@muxdemux at blpin\space\the\pgf at circ@count at a\endcsname{%
+                \noexpand\pgf at circ@muxdemux at L@anchor{\the\pgf at circ@count at a}{0}%
+            }
+            \advance\pgf at circ@count at a by -1\relax%
+        \repeatpgfmathloop%
+        % right anchors
+        \pgf at circ@count at a=\NR\relax
+        \pgfmathloop%
+        \ifnum\pgf at circ@count at a>0
+            % we will create two anchors per pin: the "normal one" like `rpin 1` for the
+            % external leads, and the "border one" like `brpin 1` for internal ones.
+            % they will coincide if `external pins width` is set to 0.
+            \expandafter\xdef\csname pgf at anchor@muxdemux at rpin\space\the\pgf at circ@count at a\endcsname{%
+                \noexpand\pgf at circ@muxdemux at R@anchor{\the\pgf at circ@count at a}{1}%
+            }
+            \expandafter\xdef\csname pgf at anchor@muxdemux at brpin\space\the\pgf at circ@count at a\endcsname{%
+                \noexpand\pgf at circ@muxdemux at R@anchor{\the\pgf at circ@count at a}{0}%
+            }
+            \advance\pgf at circ@count at a by -1\relax%
+        \repeatpgfmathloop%
+        % bottom anchors
+        \pgf at circ@count at a=\NB\relax
+        \pgfmathloop%
+        \ifnum\pgf at circ@count at a>0
+            % we will create two anchors per pin: the "normal one" like `bpin 1` for the
+            % external leads, and the "border one" like `bbpin 1` for internal ones.
+            % they will coincide if `external pins width` is set to 0.
+            \expandafter\xdef\csname pgf at anchor@muxdemux at bpin\space\the\pgf at circ@count at a\endcsname{%
+                \noexpand\pgf at circ@muxdemux at B@anchor{\the\pgf at circ@count at a}{1}%
+            }
+            \expandafter\xdef\csname pgf at anchor@muxdemux at bbpin\space\the\pgf at circ@count at a\endcsname{%
+                \noexpand\pgf at circ@muxdemux at B@anchor{\the\pgf at circ@count at a}{0}%
+            }
+            \advance\pgf at circ@count at a by -1\relax%
+        \repeatpgfmathloop%
+        % top anchors
+        \pgf at circ@count at a=\NT\relax
+        \pgfmathloop%
+        \ifnum\pgf at circ@count at a>0
+            % we will create two anchors per pin: the "normal one" like `tpin 1` for the
+            % external leads, and the "border one" like `btpin 1` for internal ones.
+            % they will coincide if `external pins width` is set to 0.
+            \expandafter\xdef\csname pgf at anchor@muxdemux at tpin\space\the\pgf at circ@count at a\endcsname{%
+                \noexpand\pgf at circ@muxdemux at T@anchor{\the\pgf at circ@count at a}{1}%
+            }
+            \expandafter\xdef\csname pgf at anchor@muxdemux at btpin\space\the\pgf at circ@count at a\endcsname{%
+                \noexpand\pgf at circ@muxdemux at T@anchor{\the\pgf at circ@count at a}{0}%
+            }
+            \advance\pgf at circ@count at a by -1\relax%
+        \repeatpgfmathloop%
+    }%
+}
+
+%% left anchors for muxdemux
+
+\def\pgf at circ@muxdemux at L@anchor#1#2{% #1: pin number #2: 0 for border pin, 1 for external pin
+    \topleft
+    \pgf at xa=\pgf at x
+    \pgf at ya=\pgf at y
+    \insetnortheast
+    \pgf at xb=\pgf at x
+    \pgf at yb=\pgf at y
+    \ifnum#1>\NL
+        \PackageError{circuitikz}{%
+            You requested left pin #1 for mux/demux shape \thisshape\space \MessageBreak
+            which has been defined with \NL\space left pins%
+        }{Please check the manual about mux/demux shapes; if you press return I'll try to continue}
+    \fi
+    \pgf at circ@count at a=\NL \divide\pgf at circ@count at a by 2 % see https://tex.stackexchange.com/questions/146523/why-does-numexpr-integer-division-round-rather-than-truncate
+    % \typeout{LEFT \the\pgf at xa \space \the\pgf at ya \space \NL}
+    \ifnum\NL>1
+        \ifdim\pgf at yb>0pt % check if we have an inset
+        % we have to check oddity
+            \ifodd\NL
+                \pgfmathsetlength{\pgf at circ@res at step}{2*(\pgf at ya-\pgf at yb)/(\NL-1)}
+            \else
+                \pgfmathsetlength{\pgf at circ@res at step}{2*(\pgf at ya-\pgf at yb)/\NL}
+            \fi
+        \else % no inset
+            \pgfmathsetlength{\pgf at circ@res at step}{2*\pgf at ya/\NL}
+        \fi
+        \ifdim\pgf at yb>0pt % check if we have an inset
+            \ifnum#1>\pgf at circ@count at a\relax
+                % for lower pins we have to shift them down
+                % \typeout{DEBUGTEST1\space #1\space entering\space \NL}
+                \ifodd\NL
+                    % odd number of pins
+                    \ifnum#1=\numexpr\the\pgf at circ@count at a+1\relax
+                        % centerpin!
+                        \ifnum#2=0\relax
+                            \pgfpoint{\pgf at xb}{0pt}
+                        \else
+                            \ifnum\squarepins>0
+                                \pgfpoint{\pgf at xa-#2*\extshift}{0pt}
+                            \else
+                                \pgfpoint{\pgf at xb-#2*\extshift}{0pt}
+                            \fi
+                        \fi
+                    \else
+                        \pgfpoint{\pgf at xa-#2*\extshift}{\pgf at ya+(0.5-#1+1)*\pgf at circ@res at step-2*\pgf at yb}
+                    \fi
+                \else
+                    % even numer of pins: just go down
+                    \pgfpoint{\pgf at xa-#2*\extshift}{\pgf at ya+(0.5-#1)*\pgf at circ@res at step-2*\pgf at yb}
+                \fi
+            \else
+                % nothing need for #1<=NL/2
+                \pgfpoint{\pgf at xa-#2*\extshift}{\pgf at ya+(0.5-#1)*\pgf at circ@res at step}
+            \fi
+        \else
+        % no inset
+            \pgfpoint{\pgf at xa-#2*\extshift}{\pgf at ya+(0.5-#1)*\pgf at circ@res at step}
+        \fi
+    \else
+        \pgfpoint{\pgf at xa-#2*\extshift}{0pt}
+    \fi
+}
+
+% right anchors
+\def\pgf at circ@muxdemux at R@anchor#1#2{% #1: pin number #2: 0 for border pin, 1 for external pin
+    \topright
+    \pgf at xa=\pgf at x
+    \pgf at ya=\pgf at y
+    \ifnum#1>\NR
+        \PackageError{circuitikz}{%
+            You requested right pin #1 for mux/demux shape \thisshape\space \MessageBreak
+            which has been defined with \NR\space right pins%
+        }{Please check the manual about mux/demux shapes; if you press return I'll try to continue}
+    \fi
+    \ifnum\NR>1
+        \pgfmathsetlength{\pgf at circ@res at step}{2*\pgf at ya/\NR}
+        \pgfpoint{\pgf at xa+#2*\extshift}{\pgf at ya+(0.5-#1)*\pgf at circ@res at step}
+    \else
+        \pgfpoint{\pgf at xa+#2*\extshift}{0pt}
+    \fi
+}
+
+% bottom anchors
+\def\pgf at circ@muxdemux at B@anchor#1#2{% #1: pin number #2: 0 for border pin, 1 for external pin
+    \topleft
+    \pgf at xa=\pgf at x
+    \pgf at ya=\pgf at y
+    \topright
+    \pgf at xb=\pgf at x
+    \pgf at yb=\pgf at y
+    \ifnum#1>\NB
+        \PackageError{circuitikz}{%
+            You requested bottom pin #1 for mux/demux shape \thisshape\space \MessageBreak
+            which has been defined with \NB\space bottom pins%
+        }{Please check the manual about mux/demux shapes; if you press return I'll try to continue}
+    \fi
+    \ifnum\NB>0
+        % \typeout{DEBUGTESTtopleft\space\the\pgf at ya \space topright\space\the\pgf at yb \space\NB}
+        \pgfmathsetlength{\pgf at circ@res at step}{2*\pgf at xb/\NB}
+        \pgfmathsetlength{\pgf at circ@res at other}{(\pgf at yb-\pgf at ya)/(\pgf at xb-\pgf at xa)*\pgf at circ@res at step}
+        \pgfmathsetlength\pgf at x{\pgf at xa+(#1-0.5)*\pgf at circ@res at step}
+        \ifnum#2=0\relax
+            \pgfmathsetlength\pgf at y{-\pgf at yb+(\NB-#1+0.5)*\pgf at circ@res at other}
+        \else
+            \ifnum\squarepins>0\relax
+                \pgfmathsetlength\pgf at y{-max(\pgf at ya,\pgf at yb)-\extshift}
+            \else
+                \pgfmathsetlength\pgf at y{-\pgf at yb+(\NB-#1+0.5)*\pgf at circ@res at other-\extshift}
+            \fi
+        \fi
+    \else
+        % should not happen, give the same as pin 1 anyway
+        \ifnum#2=0\relax
+        \pgfpoint{0pt}{-\pgf at yb+(\pgf at yb-\pgf at ya)/2}
+        \else
+            \pgfpoint{0pt}{-max(\pgf at ya,\pgf at yb)-\extshift}
+        \fi
+    \fi
+}
+
+% top anchors
+\def\pgf at circ@muxdemux at T@anchor#1#2{% #1: pin number #2: 0 for border pin, 1 for external pin
+    \topleft
+    \pgf at xa=\pgf at x
+    \pgf at ya=\pgf at y
+    \topright
+    \pgf at xb=\pgf at x
+    \pgf at yb=\pgf at y
+    \ifnum#1>\NT
+        \PackageError{circuitikz}{%
+            You requested top pin #1 for mux/demux shape \thisshape\space \MessageBreak
+            which has been defined with \NT\space top pins%
+        }{Please check the manual about mux/demux shapes; if you press return I'll try to continue}
+    \fi
+    \ifnum\NT>0
+        \pgfmathsetlength{\pgf at circ@res at step}{2*\pgf at xb/\NT}
+        \pgfmathsetlength{\pgf at circ@res at other}{(\pgf at yb-\pgf at ya)/(\pgf at xb-\pgf at xa)*\pgf at circ@res at step}
+        \pgfmathsetlength\pgf at x{\pgf at xa+(#1-0.5)*\pgf at circ@res at step}
+        \ifnum#2=0\relax
+            \pgfmathsetlength\pgf at y{\pgf at yb-(\NT-#1+0.5)*\pgf at circ@res at other}
+        \else
+            \ifnum\squarepins>0
+                \pgfmathsetlength\pgf at y{max(\pgf at ya,\pgf at yb)+\extshift}
+            \else
+                \pgfmathsetlength\pgf at y{\pgf at yb-(\NT-#1+0.5)*\pgf at circ@res at other+\extshift}
+            \fi
+        \fi
+    \else
+        % should not happen, give the same as pin 1 anyway
+        \ifnum#2=0\relax
+        \pgfpoint{0pt}{\pgf at yb-(\pgf at yb-\pgf at ya)/2}
+        \else
+            \pgfpoint{0pt}{max(\pgf at ya,\pgf at yb)+\extshift}
+        \fi
+    \fi
+}

Modified: trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex	2020-01-23 21:55:17 UTC (rev 53514)
+++ trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex	2020-01-23 21:55:34 UTC (rev 53515)
@@ -796,8 +796,14 @@
 \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}}
+% multiwire(s)
+\def\pgf at circ@bmultiwire at path#1{\pgf at circ@bipole at path{bmultiwire}{#1}}
+\compattikzset{bmultiwire/.style = {\circuitikzbasekey,
+/tikz/to path=\pgf at circ@bmultiwire at path, l=#1}}
+\def\pgf at circ@multiwire at path#1{\pgf at circ@bipole at path{multiwire}{#1}}
+\compattikzset{multiwire/.style = {\circuitikzbasekey,
+/tikz/to path=\pgf at circ@multiwire at path, l=#1}}
 
-
 % Transistor like bipoles
 
 \def\pgf at circ@trans at path#1#2{

Modified: trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex	2020-01-23 21:55:17 UTC (rev 53514)
+++ trunk/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex	2020-01-23 21:55:34 UTC (rev 53515)
@@ -415,7 +415,7 @@
     \anchor{bout}{\right\pgf at y=0pt}
 
 
-    \anchor{left}{\left}% edges of component mius leads
+    \anchor{left}{\left}% edges of component minus leads
     \anchor{right}{\right}
 
     \anchor{north east}{\northeast}% see \Compass macro
@@ -446,22 +446,25 @@
     \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
-            {\ctikzvalof{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
+    \ifpgfcirc at draw@leads
+        %input leads
+        \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
+                {\ctikzvalof{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
-
+    \fi
+    % output lead
     \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
     \pgfpathlineto{\pgfpoint
         {\ctikzvalof{tripoles/american and port/port width}\pgf at circ@res at right}
     {0pt}}
-
     \pgfusepath{draw}
 
+
     \pgf at circ@setlinewidth{tripoles}{\pgflinewidth}
     \pgf at circ@res at other=\ctikzvalof{tripoles/american and port/port width}\pgf at circ@res at left
 
@@ -476,14 +479,17 @@
     \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
-            {\ctikzvalof{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
+    \ifpgfcirc at draw@leads
+        %input leads
+        \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
+                {\ctikzvalof{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
+    \fi
 
     \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
     \pgfpathlineto{\pgfpoint
@@ -490,7 +496,6 @@
         {\ctikzvalof{tripoles/american nand port/port width}\pgf at circ@res at right} {0pt}}
 
     \pgfusepath{draw}
-
     \pgf at circ@setlinewidth{tripoles}{\pgflinewidth}
     \pgf at circ@res at step = \ctikzvalof{tripoles/american nand port/circle width}\pgf at circ@res at right
     \pgf at circ@res at other = \ctikzvalof{tripoles/american nand port/port width}\pgf at circ@res at right
@@ -520,14 +525,17 @@
     \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
+    \ifpgfcirc at draw@leads
+        %input leads
+        \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
+    \fi
 
     \pgf at circ@res at other=\ctikzvalof{tripoles/american nor port/port width}\pgf at circ@res at right
     \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
@@ -542,12 +550,23 @@
     \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
+    % main shape
+    \ifpgfcirc at roundy@or at shapes
+        \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
+    \else
+        \pgfmathsetlength{\pgf at circ@res at temp}{\pgf at circ@math at xradius*cos(\pgf at circ@math at angle)-\pgf at circ@math at xorigin}%
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at temp}{\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}%
+        \pgfpathcurveto{\pgfpoint{0.3\pgf at circ@res at right}{\pgf at circ@res at down}}{\pgfpoint{0.3\pgf at circ@res at right}{0.5\pgf at circ@res at down}}{\pgfpoint{\pgf at circ@res at other}{0pt}}
+        \pgfpathcurveto{\pgfpoint{0.3\pgf at circ@res at right}{0.5\pgf at circ@res at up}}{\pgfpoint{0.3\pgf at circ@res at right}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at temp}{\pgf at circ@res at up}}
+        \pgfpathclose
+    \fi
 
+    % not dot
     \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}}
@@ -567,14 +586,17 @@
     \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
+    \ifpgfcirc at draw@leads
+        %input leads
+        \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
+    \fi
 
     \pgf at circ@res at other=\ctikzvalof{tripoles/american or port/port width}\pgf at circ@res at right
     \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
@@ -586,11 +608,21 @@
 
     \edef\pgf at circ@math at angle{\ctikzvalof{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
+    % main shape
+    \ifpgfcirc at roundy@or at shapes
+        \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
+    \else
+        \pgfmathsetlength{\pgf at circ@res at temp}{\pgf at circ@math at xradius*cos(\pgf at circ@math at angle)-\pgf at circ@math at xorigin}%
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at temp}{\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}%
+        \pgfpathcurveto{\pgfpoint{0.3\pgf at circ@res at right}{\pgf at circ@res at down}}{\pgfpoint{0.3\pgf at circ@res at right}{0.5\pgf at circ@res at down}}{\pgfpoint{\pgf at circ@res at other}{0pt}}
+        \pgfpathcurveto{\pgfpoint{0.3\pgf at circ@res at right}{0.5\pgf at circ@res at up}}{\pgfpoint{0.3\pgf at circ@res at right}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at temp}{\pgf at circ@res at up}}
+        \pgfpathclose
+    \fi
 
     \pgf at circ@draworfill
 }
@@ -611,15 +643,18 @@
     \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
+    \ifpgfcirc at draw@leads
+        %input leads
+        \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
+    \fi
 
     \pgf at circ@res at other=\ctikzvalof{tripoles/american xor port/port width}\pgf at circ@res at right
     \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
@@ -631,11 +666,21 @@
 
     \edef\pgf at circ@math at angle{\ctikzvalof{tripoles/american xor 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
+    % main shape
+    \ifpgfcirc at roundy@or at shapes
+        \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
+    \else
+        \pgfmathsetlength{\pgf at circ@res at temp}{\pgf at circ@math at xradius*cos(\pgf at circ@math at angle)-\pgf at circ@math at xorigin}%
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at temp}{\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}%
+        \pgfpathcurveto{\pgfpoint{0.3\pgf at circ@res at right}{\pgf at circ@res at down}}{\pgfpoint{0.3\pgf at circ@res at right}{0.5\pgf at circ@res at down}}{\pgfpoint{\pgf at circ@res at other}{0pt}}
+        \pgfpathcurveto{\pgfpoint{0.3\pgf at circ@res at right}{0.5\pgf at circ@res at up}}{\pgfpoint{0.3\pgf at circ@res at right}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at temp}{\pgf at circ@res at up}}
+        \pgfpathclose
+    \fi
     \pgf at circ@draworfill
 
     \pgfmathsetlength{\pgf at circ@res at temp}{(\pgf at circ@math at yradiusA)*sin(\pgf at circ@math at angle)}%
@@ -662,15 +707,18 @@
     \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
+    \ifpgfcirc at draw@leads
+        %input leads
+        \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
+    \fi
 
     \pgf at circ@res at other=\ctikzvalof{tripoles/american xnor port/port width}\pgf at circ@res at right
     \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
@@ -685,11 +733,21 @@
     \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
+    % main shape
+    \ifpgfcirc at roundy@or at shapes
+        \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
+    \else
+        \pgfmathsetlength{\pgf at circ@res at temp}{\pgf at circ@math at xradius*cos(\pgf at circ@math at angle)-\pgf at circ@math at xorigin}%
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at temp}{\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}%
+        \pgfpathcurveto{\pgfpoint{0.3\pgf at circ@res at right}{\pgf at circ@res at down}}{\pgfpoint{0.3\pgf at circ@res at right}{0.5\pgf at circ@res at down}}{\pgfpoint{\pgf at circ@res at other}{0pt}}
+        \pgfpathcurveto{\pgfpoint{0.3\pgf at circ@res at right}{0.5\pgf at circ@res at up}}{\pgfpoint{0.3\pgf at circ@res at right}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at temp}{\pgf at circ@res at up}}
+        \pgfpathclose
+    \fi
 
     \pgfpathellipse
     {\pgfpoint{\pgf at circ@res at other+.5\pgf at circ@res at step}{0pt}}
@@ -813,8 +871,11 @@
             \pgf at circ@draworfill
         \endpgfscope
 
-        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
-        \pgfpathlineto{\pgfpoint{.7\pgf at circ@res at left}{0pt}}
+        \ifpgfcirc at draw@leads
+            %input leads
+            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+            \pgfpathlineto{\pgfpoint{.7\pgf at circ@res at left}{0pt}}
+        \fi
 
         \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
         \pgfpathlineto{\pgfpoint{.7\pgf at circ@res at right}{0pt}}
@@ -921,8 +982,11 @@
             \pgf at circ@draworfill
         \endpgfscope
 
-        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
-        \pgfpathlineto{\pgfpoint{.7\pgf at circ@res at left}{0pt}}
+        \ifpgfcirc at draw@leads
+            %input leads
+            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+            \pgfpathlineto{\pgfpoint{.7\pgf at circ@res at left}{0pt}}
+        \fi
 
         \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
         \pgfpathlineto{\pgfpoint{.7\pgf at circ@res at right}{0pt}}
@@ -949,6 +1013,11 @@
         \northwest
         \pgf at y=0pt
     }
+    \anchor{bin}{
+        \northwest
+        \pgf at y=0pt
+        \pgf at x=0.7\pgf at x
+    }
     \anchor{bin 1}{
         \northwest
         \pgf at y=0pt
@@ -1031,8 +1100,11 @@
             \pgf at circ@draworfill
         \endpgfscope
 
-        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
-        \pgfpathlineto{\pgfpoint{.7\pgf at circ@res at left}{0pt}}
+        \ifpgfcirc at draw@leads
+            %input leads
+            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+            \pgfpathlineto{\pgfpoint{.7\pgf at circ@res at left}{0pt}}
+        \fi
 
         \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
         \pgfpathlineto{\pgfpoint{.7\pgf at circ@res at right}{0pt}}
@@ -1072,6 +1144,11 @@
         \northwest
         \pgf at y=0pt
     }
+    \anchor{bin}{
+        \northwest
+        \pgf at y=0pt
+        \pgf at x=0.7\pgf at x
+    }
     \anchor{bin 1}{
         \northwest
         \pgf at y=0pt
@@ -1148,8 +1225,11 @@
             \pgf at circ@draworfill
         \endpgfscope
 
-        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
-        \pgfpathlineto{\pgfpoint{.7\pgf at circ@res at left}{0pt}}
+        \ifpgfcirc at draw@leads
+            %input leads
+            \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+            \pgfpathlineto{\pgfpoint{.7\pgf at circ@res at left}{0pt}}
+        \fi
 
         \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}}
@@ -1272,39 +1352,42 @@
             {\pgfpoint{\ctikzvalof{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{\ctikzvalof{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
-                    {\ctikzvalof{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
+        \ifpgfcirc at draw@leads
+            %input leads
+            \ifnum#3=1\relax
+                \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}%
+                \pgfpathlineto{\pgfpoint{\ctikzvalof{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
+                        {\ctikzvalof{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{\ctikzvalof{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{\ctikzvalof{tripoles/european #1 port/not width}\pgf at circ@res at right}{0pt}}
-                \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf at circ@res at right}%
-                {\ctikzvalof{tripoles/european #1 port/not height}\pgf at circ@res at up}}
-            \fi
-            %
-            \pgfusepath{draw}
-            %
-            \pgfpathmoveto{\pgfpointorigin}
-            \pgftext{#2}
+        \fi
+        %
+        \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+        \pgfpathlineto{%
+        \pgfpoint{\ctikzvalof{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{\ctikzvalof{tripoles/european #1 port/not width}\pgf at circ@res at right}{0pt}}
+            \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf at circ@res at right}%
+            {\ctikzvalof{tripoles/european #1 port/not height}\pgf at circ@res at up}}
+        \fi
+        %
+        \pgfusepath{draw}
+        %
+        \pgfpathmoveto{\pgfpointorigin}
+        \pgftext{#2}
         }
     }
 }

Modified: trunk/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty	2020-01-23 21:55:17 UTC (rev 53514)
+++ trunk/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty	2020-01-23 21:55:34 UTC (rev 53515)
@@ -9,8 +9,8 @@
 
 \NeedsTeXFormat{LaTeX2e}
 
-\def\pgfcircversion{1.0.0-pre1}
-\def\pgfcircversiondate{2019/12/22}
+\def\pgfcircversion{1.0.0-pre2}
+\def\pgfcircversiondate{2020/01/23}
 
 \ProvidesPackage{circuitikz}%
 [\pgfcircversiondate{} The CircuiTikz circuit drawing package version \pgfcircversion]



More information about the tex-live-commits mailing list