# circuitikz connection missplacement

i have the following code:

\usepackage{circuitikz}
\usepackage{tikz}
\usetikzlibrary{circuits.logic.US,circuits.logic.IEC}

....

\begin{circuitikz}
\draw
(0,0) node[nand port] (nand1) {}
(nand1.in 2) -- (nand1.out)
(nand1.in 1) node[anchor=east] {$x(t)$}
(nand1.out) node[anchor=west] {$y(t)$};
\end{circuitikz}


The code should create a nand gate with a loop like this:

But somehow the loop connection is routed through the gate:

How can I fix this?

This is too complicated for a comment, but I would suggest the following modifications to AboAmmar's answer:

\documentclass{standalone}
\usepackage{circuitikz}
\begin{document}

\begin{circuitikz}[american ports]
\draw
(0,0) node[nand port] (nand1) {}
(nand1.in 2) -- ++(0,-5mm)-| (nand1.out)
to[short,*-] ++(5mm,0) node[anchor=west] {$y(t)$}
(nand1.in 1) node[anchor=east] {$x(t)$};
\end{circuitikz}

\end{document}


• This solution seems to be the cleanest thanks. – h44z Nov 4 '15 at 19:57

You can do some thing like this:

\documentclass{article}
\usepackage{circuitikz}
\usetikzlibrary{circuits.logic.US,circuits.logic.IEC}
\begin{document}

\begin{circuitikz}
\draw
(0,0) node[nand port] (nand1) {}
(nand1.in 2) --++(0,-5mm)-| (nand1.out)
--++(5mm,0) node[anchor=west] {$y(t)$}
(nand1.in 1) node[anchor=east] {$x(t)$};
\end{circuitikz}

\end{document}


• So far as I know, circuitikz doesn't have libraries circuits.logic.US and circuits.logic.IEC, even more, mixing circuitikz and TikZ can make problems. Anyway, since my answer is almost the same in you were faster in uploading, I erase mine :-) – Zarko Nov 4 '15 at 17:14
• I have a couple of suggestions, as shown below (above?). – John Kormylo Nov 4 '15 at 18:39