我有以下代码:
\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}
代码应该创建一个具有如下循环的与非门:
但不知何故,环路连接是通过门进行的:
我怎样才能解决这个问题?
答案1
这对于评论来说太复杂了,但我建议对 AboAmmar 的答案进行以下修改:
\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}
答案2
你可以做这样的事:
\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}