答案1
基于这个优秀的答案从彼得·吉尔,这里有两种新样式(名为opampdownlbl
和opampuplbl
),用于处理放置并在节点的顶部和底部绘制水平线。
\documentclass{article}
\usepackage{circuitikz}
\tikzset{opampdownlbl/.style={
below,
draw=none,
append after command={
(\tikzlastnode.north) edge ([shift={(-5pt,0pt)}]\tikzlastnode.north) edge ([shift={(+5pt,0pt)}]\tikzlastnode.north)
}},
opampuplbl/.style={
above,
draw=none,
append after command={
(\tikzlastnode.south) edge ([shift={(-5pt,0pt)}]\tikzlastnode.south) edge ([shift={(+5pt,0pt)}]\tikzlastnode.south)
}}}
\begin{document}
\begin{circuitikz}[american inductors]
\draw (7,2.5) node[op amp] (opamp){}
(opamp.down) ++ (0,-.5) node[opampdownlbl] {$-Va$} -- (opamp.down)
(opamp.up) ++ (0,.5) node[opampuplbl] {$+Va$} -- (opamp.up);
\end{circuitikz}
\end{document}