\documentclass[10pt,a4paper]{article}
\usepackage{circuitikz}
\begin{document}
\begin{circuitikz}
\draw
(0,0) to[short, -*] (1,0) -- (2,0) node[and port, anchor=in 1] (myand1) {}
(1,-1) node[american not port,rotate=-90] (prvone) {}
(myand1.in 2) -| (2,-4)
(1,0) -| (prvone.in)
(myand1.south) node[and port, below=\baselineskip] (myand2) {}
(myand2.in 1) node[circ]{}
(prvone.out) |- (myand2.in 2)
;
\node[
dipchip,
num pins=6,
hide numbers,
no topmark,
external pins width=0](ff1) at (3.5,0) {};
\node [right,font=\tiny] at (ff1.bpin 1) {\textsl{S}};
\node [right,font=\tiny] at (ff1.bpin 2) {\textsl{CP}};
\node [right,font=\tiny] at (ff1.bpin 3) {\textsl{R}};
\node [left,font=\tiny] at (ff1.bpin 6) {\textsl{Q}};
\node [left,font=\tiny] at (ff1.bpin 4) {\textsl{\ctikztextnot{Q}}};
\end{circuitikz}
\end{document}
我是 LaTex 的初学者。有任何帮助、书籍或手册可以教我如何使用 circuitikz 来获取类似这样的模式吗?我读过 CTAN 手册,但帮助不大。不知道如何连接自定义元素。提前谢谢您。
答案1
基本原理与 myand1 相同。使用锚关键字来定位要对齐的组件部分。在本例中,我将 (ff1.pin 1) 定位在 (myand1.out) 的右侧,然后将 (myand2.out) 定位在 (ff1.pin 3) 的左侧。
\documentclass[10pt,a4paper]{article}
\usepackage{circuitikz}
\begin{document}
\begin{circuitikz}
\draw
(0,0) to[short, -*] (1,0) -- (2,0) node[and port, anchor=in 1] (myand1) {}
(1,-1) node[american not port,rotate=-90] (prvone) {}
(myand1.in 2) -| (2,-4)
(1,0) -| (prvone.in)
;
\ctikzset{multipoles/dipchip/pin spacing=0.5}% increasee size of dipchip
\draw (myand1.out) -- ++(1,0) node[anchor=pin 1,
dipchip,
num pins=6,
hide numbers,
no topmark,
external pins width=0](ff1) {}
(ff1.pin 3) -- ++(-1,0) node[and port, anchor=out] (myand2) {}
(myand2.in 1) node[circ]{}
(prvone.out) |- (myand2.in 2);
\node [right,font=\tiny] at (ff1.bpin 1) {\textsl{S}};
\node [right,font=\tiny] at (ff1.bpin 2) {\textsl{CP}};
\node [right,font=\tiny] at (ff1.bpin 3) {\textsl{R}};
\node [left,font=\tiny] at (ff1.bpin 6) {\textsl{Q}};
\node [left,font=\tiny] at (ff1.bpin 4) {\textsl{\ctikztextnot{Q}}};
\end{circuitikz}
\end{document}