[Tex/LaTex] circuit buffer input with inverted bubble

circuitikztikz-circuit-libtikz-pgf

The related question Circuitikz inverter bubble shows how to invert an input on an AND gate. How can I do this on a buffer gate? (rightward facing triangle) I can't seem to find the documentation. I tried using the node[buffer, inputs=i] but it doesn't seem to recognize the inputs key.


Update: It looks like I can do it in a tikzpicture but not inside a circuitikz element. The following works, but I need to combine this and connect to some things in a circuitikz element:

\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{circuits.logic.US} 

\begin{document}
\begin{tikzpicture}[circuit logic US]
\node (a) [buffer gate, inputs=i] {};
\end{tikzpicture}%
\end{document}

enter image description here

is there a way to use this inside a circuitikz drawing?

Best Answer

A possilbe solution is to define a buffer gate called \buffergate via \newcommand syntax that takes two arguments #1=name and #2= rotation angle. The proposed solutions redefine not port into \buffergate, so that buffer gate can be used inside a circuitiz drawing. An example from circuitikz is borrowed and the proposals follow.

\newcommand{\buffergate}[2] 
{  % #1 = name , #2 = rotation angle
\begin{scope}[transform shape,rotate=#2]
\draw[thick] (#1) ++(-16pt,0) coordinate[ocirc,xshift=-2pt](#1in) -- ++(0,16pt) -- ++
(30pt,-16pt)coordinate(a) -- ++(-30pt,-16pt) -- cycle;
\draw (a) --++(6pt,0)coordinate(#1out);
\end{scope}
}

The logic behind is to call not port, color it with white, give it a label name, use the command \bufergate, as shown below.

\draw (1,0) node[not port,color=white,name=not1] () {};
\buffergate{not1}{0}  % 0 = horizontal 

enter image description here

Code

\documentclass[border=10pt,varwidth]{standalone}  
\usepackage{tikz}
\usepackage[american,siunitx]{circuitikz}
\usetikzlibrary{calc,positioning}

\newcommand{\buffergate}[2] 
{  % #1 = name , #2 = rotation angle
\begin{scope}[transform shape,rotate=#2]
\draw[thick] (#1) ++(-16pt,0) coordinate[ocirc,xshift=-2pt](#1in) -- ++(0,16pt) -- ++(30pt,-16pt)coordinate(a) -- ++(-30pt,-16pt) -- cycle;
\draw (a) --++(6pt,0)coordinate(#1out);
\end{scope}
}

\begin{document}  

An example from circuitikz 

\begin{circuitikz} 
\draw
(1,0) node[not port] (not1) {}
(3,0) node[not port] (not2) {}
(0,0) -- (not1.in)
(not2.in) -- (not1.out)
++(0,-1) node[ground] {} to [C] (not1.out)
(not2.out) -| (4,1) -| (0,0);
\end{circuitikz}


\medskip

Proposed solution 1 -- node 

\medskip

\begin{circuitikz} 
\draw
(1,0) node[not port,color=white,name=not1] () {};
\buffergate{not1}{0}
\draw (3,0) node[not port,color=white,name=not2] () {};
\buffergate{not2}{-90}
\draw (0,0) -- (not1.in);
\draw(1.7,-1) node[ground] {} to [C] (not1out)
(not2out) -| (4,1) -| (0,0);
\draw (not1out) --++(0.5,0)|- (not2in);
\end{circuitikz}



\medskip

Proposed solution 2 -- path

\medskip

\begin{circuitikz} 
\path(0.5,0) to[not port,color=white,name=not1] (1.5,0);
\buffergate{not1}{0}
\path(2.5,0) to[not port,color=white,name=not2] (3.5,0);
\buffergate{not2}{90}
\draw (0,0) -- (not1in);
\draw (1.7,-1) node[ground] {} to [C] (not1out)
(not2out) -| (4,1) -| (0,0);
\draw (not1out) --++(0.5,0)|- (not2in);
\end{circuitikz}

\end{document}