1

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:

connection ok

But somehow the loop connection is routed through the gate:

connection not ok

How can I fix this?

0

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}

corrected

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

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}

enter image description here

  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.