Circuitikz:我不能把等号放在名字里面

Circuitikz:我不能把等号放在名字里面

我用标签中的箭头代替了我想要的等号。我怎样才能在那里放等号?

我想把同样的和电缆跳线放在一起。我不知道如何使用它。

\documentclass{standalone}
\usepackage{circuitikz}

\begin{document}

\begin {circuitikz} [american]
\draw


(0,0) node[op amp] (opamp) {}

(opamp.-) to[short,-] ++(-1,0)
to [R, l_=$1K\Omega$] ++(-2,0)
to [V, l_=$B_3\rightarrow 1v$] ++(0,-4)
to node[ground]{} ++(0,0)

(opamp.-) to [short, *-] ++(0,3) 
 to [short, -] ++(2,0) 
to [R, l_=$2K \Omega$] (3,3.5)
to [short,-] ++(1,0)
to[short, -*] ++(0,-3.5)
(opamp.out) to [short, -o]++ (4,0) node[right]{$V_o$}

(opamp.+) -| ++(0,-3) node[ground]{}

(opamp.up) to [short, -]  ++(0,5)
to [short, -] ++(8,0)
to [V,l_=$B_3 \rightarrow 15v$] ++(0,-4) 

to [V,l_=$B_2 \rightarrow 15 v$] (8,-3) 
 to[short,-] (8,-3) coordinate (leftC)
  to (leftC -| opamp.down)
  to[short,-] (opamp.down)
(8,0)[short,*-] (7.9,2) to node[ground]{} (10,2)
;

\end{circuitikz}

\end{document}

在此处输入图片描述

答案1

您需要{}在标签周围添加一对括号,并且正如这里的人们所建议的那样,您可以利用 来解放自己,不再需要正确格式化单位siunitx

\documentclass[border=5pt]{standalone}
\usepackage{circuitikz}
\usepackage{siunitx}

\begin{document}
\begin {circuitikz} [american]
\draw


(0,0) node[op amp] (opamp) {}

(opamp.-) to[short,-] ++(-1,0)
to [R, l_=${R_1=\SI{1}{\kohm}}$] ++(-2,0)
to [V, l_=${B_1=\SI{1}{V}}$] ++(0,-4)
to node[ground]{} ++(0,0)

(opamp.-) to [short, *-] ++(0,3) 
 to [short, -] ++(2,0) 
to [R, l_=${R_2=\SI{2}{\kohm}}$] (3,3.5)
to [short,-] ++(1,0)
to[short, -*] ++(0,-3.5)
(opamp.out) to [short, -o]++ (4,0) node[right]{$V_o$}

(opamp.+) -| ++(0,-3) node[ground]{}

(opamp.up) to [short, -]  ++(0,5)
to [short, -] ++(8,0)
to [V,l_=${B_3=\SI{15}{V}}$] ++(0,-4) 

to [V,l_=${B_2=\SI{15}{V}}$] (8,-3) 
 to[short,-] (8,-3) coordinate (leftC)
  to (leftC -| opamp.down)
  to[short,-] (opamp.down)
(8,0)[short,*-] (7.9,2) to node[ground]{} (10,2)
;

\end{circuitikz}

\end{document}

在此处输入图片描述

答案2

在手册中,您可以阅读(在有关标签的章节的开头):

在此处输入图片描述

这是一种可能的解决方案(我确实会避免跳跃交叉,很明显这里没有连接,学生应该学习绘制电路的正常方式;此外,我在这里使用了正确的单位打印):

\documentclass[border=2.78pt]{standalone}
\usepackage[EFvoltages, siunitx]{circuitikz}

\begin{document}
\begin {circuitikz} [american]
\def\eq{=}
\draw
(0,0) node[op amp] (opamp) {}

(opamp.-) to[short,-] ++(-1,0)
to [R, l_=\SI{1}{\kohm}] ++(-2,0)
to [V, l_=$B_3\eq\SI{1}{V}$] ++(0,-4)
to node[ground]{} ++(0,0)

(opamp.-) to [short, *-] ++(0,3)
 to [short, -] ++(2,0)
 to [R, l_=\SI{2}{\kohm}] (3,3.5)
to [short,-] ++(1,0)
to[short, -*] ++(0,-3.5)
(opamp.out) to [short, -o]++ (4,0) node[right]{$V_o$}

(opamp.+) -| ++(0,-3) node[ground]{}

(opamp.up) to [short, -]  ++(0,5)
to [short, -] ++(8,0)
to [V,l_=$B_3 \eq \SI{15}{V}$] ++(0,-4)

to [V,l_=$B_2 \eq \SI{15}{V}$] (8,-3)
 to[short,-] (8,-3) coordinate (leftC)
  to (leftC -| opamp.down)
  to[short,-] (opamp.down)
(8,0)[short,*-] (7.9,2) to node[ground]{} (10,2)
;
\end{circuitikz}
\end{document}

在此处输入图片描述

相关内容