![在 Circuitikz 中添加电压箭头时出现黑色节点](https://linux22.com/image/337859/%E5%9C%A8%20Circuitikz%20%E4%B8%AD%E6%B7%BB%E5%8A%A0%E7%94%B5%E5%8E%8B%E7%AE%AD%E5%A4%B4%E6%97%B6%E5%87%BA%E7%8E%B0%E9%BB%91%E8%89%B2%E8%8A%82%E7%82%B9.png)
我在 Circuitikz 中绘制了一个带有非反相运算放大器的电路,到目前为止,我所做的唯一修改是缩放了整个电路并改变了电压箭头的参数以使其笔直。现在,没有电压箭头,一切看起来都很好,但是当我添加它们时,输入和输出连接器(A 和 C)的上部节点突然变黑。我不知道为什么会发生这种情况,任何帮助都将不胜感激!
\documentclass[12pt]{article}
\usepackage[european]{circuitikz}
\usetikzlibrary{arrows}
\begin{document}
\begin center
\begin{circuitikz}[scale=.8,transform shape ]
\ctikzset{voltage/distance from node=.2}% defines arrow's distance from nodes
\ctikzset{voltage/distance from line=.02}% defines arrow's distance from wires
\ctikzset{voltage/bump b/.initial=.1}% defines arrow's curvature
\draw % draw nodes
(0, 0) node[op amp,yscale=-1] (opamp) {}
(-3,0.5) node[ocirc] (A) {}
(-3,-3.8) node [ocirc] (B) {}
(5,0) node[ocirc] (C) {}
(5,-3.8) node[ocirc] (D) {}
(opamp.+) to (A)
(opamp.-) -| (-1.5,-1.8)
to[short,*-] (.5,-1.8)
to [C,l=$C$] (2,-1.8)
to [R,l=$R_1$] (3.2,-1.8)
to [short,-] (3.8,-1.8) to [short,-*] (3.8,0)
(opamp.out) to [short,-o] (C)
(B) to[short,-] (-1.5,-3.8) to [R,l=$R_2$,*-*] (-1.5,-1.8)
(-1.5,-3.8) [short,*-o] to (D)
%draw voltage arrows
(A) to [open,v=$u_e(t)$] (B)
(C) to [open, v^=$u_a(t)$] (D)
;
\end{circuitikz}
\end center
\end{document}
这是实际得到的电路:
答案1
通过在指定电压说明符后添加代码来添加电压说明符,而无需创建新节点。例如:(opamp.+) to (A) to [open,v=$u_e(t)$] (B)
建议
- 不要指定手动选项,例如曲率,除非您确定这些不是您所在国家/地区使用的标准。有一个选项可以获取欧洲符号。
- 不要使用
center
环境。\centering
而应使用,通常在figure
环境内部。
输出
代码
\documentclass[12pt]{article}
\usepackage[european]{circuitikz}
\usetikzlibrary{arrows}
\begin{document}
\begin{figure}[hbt]
\centering
\begin{circuitikz}[scale=.8,transform shape ]
\ctikzset{voltage/distance from node=.2}% defines arrow's distance from nodes
\ctikzset{voltage/distance from line=.02}% defines arrow's distance from wires
\ctikzset{voltage/bump b/.initial=.1}% defines arrow's curvature
\draw % draw nodes
(0, 0) node[op amp,yscale=-1] (opamp) {}
(-3,0.5) node[ocirc] (A) {}
(-3,-3.8) node [ocirc] (B) {}
(5,0) node[ocirc] (C) {}
(5,-3.8) node[ocirc] (D) {}
(opamp.+) to (A) to [open,v=$u_e(t)$] (B)
(opamp.-) -| (-1.5,-1.8)
to[short,*-] (.5,-1.8)
to [C,l=$C$] (2,-1.8)
to [R,l=$R_1$] (3.2,-1.8)
to [short,-] (3.8,-1.8) to [short,-*] (3.8,0)
(opamp.out) to [short,-o] (C) to [open, v^=$u_a(t)$] (D)
(B) to[short,-] (-1.5,-3.8) to [R,l=$R_2$,*-*] (-1.5,-1.8)
(-1.5,-3.8) [short,*-o] to (D)
;
\end{circuitikz}
\end{figure}
\end{document}