\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{circuitikz}
\usetikzlibrary{shapes.geometric, arrows}
\begin{document}
\begin{tikzpicture}
\draw (0,0) node[ground]{} to[R=$R_B$] ++(0,2) coordinate(a)
-- ++(0,1) node[op amp, anchor=+](A){}
(a) to[R=$R_A$, *-] (a-|A.out) -- (A.out);
\end{tikzpicture}
\end{document}
我尝试这样做,但我遇到了问题,抱歉我的英语不好,有人能帮忙吗
答案1
来源--https://tex.stackexchange.com/a/592731/38080
盒子里的电路
\documentclass{article}
\usepackage{graphicx}
\usepackage[export]{adjustbox}
\usepackage[RPvoltages]{circuitikz}
\newsavebox{\mycirc}
\sbox{\mycirc}{% no stray spaces
\begin{tikzpicture}
\draw (0,0) node[ground]{} to[R=$R_B$] ++(0,2) coordinate(a)
-- ++(0,1) node[op amp, anchor=-, yscale=-1](A){}
(a) to[R=$R_A$, *-] (a-|A.out) -- (A.out);
\draw(A.out)to[short, -o,]++(1,0)node[above]{$V_{out}$};
\draw(A.+)to[short, -o,]++(-1,0)node[above]{$V_{in}$};
\end{tikzpicture}% no stray spaces
}
\begin{document}
\begin{tikzpicture}[]
\node [draw, text width=3cm, align=center]{% no stray spaces
\adjustbox{width=3cm, height=3cm, keepaspectratio}{\usebox{\mycirc}}%
};
\end{tikzpicture}
\end{document}
独立使用
\documentclass{article}
\usepackage{graphicx}
\usepackage[export]{adjustbox}
\usepackage[RPvoltages]{circuitikz}
\begin{document}
\begin{tikzpicture}
\draw (0,0) node[ground]{} to[R=$R_B$] ++(0,2) coordinate(a)
-- ++(0,1) node[op amp, anchor=-, yscale=-1](A){}
(a) to[R=$R_A$, *-] (a-|A.out) -- (A.out);
\draw(A.out)to[short, -o,]++(1,0)node[above]{$V_{out}$};
\draw(A.+)to[short, -o,]++(-1,0)node[above]{$V_{in}$};
\end{tikzpicture}
\end{document}
编辑 Bill Nace 查询
\documentclass{article}
\usepackage{graphicx}
\usepackage[export]{adjustbox}
\usepackage[RPvoltages]{circuitikz}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}
\draw (0,0) node[ground]{} to[R=$R_B$] ++(0,2) coordinate(a)
-- ++(0,1) node[op amp, anchor=-, yscale=-1](A){}
(a) to[R=$R_A$, *-] (a-|A.out)coordinate[label={}](b) ;
\draw(A.out)coordinate[ label=](c)to[short, -o,]++(1,0)node[above]{$V_{out}$};
\draw(A.+)to[short, -o,]++(-1,0)node[above]{$V_{in}$};
\draw[<-, red, in=180, out=-45](b) to ++(2,-2)node[right](){\scriptsize (a) {\texttt {-|}} (A.out)};
\draw[circle,fill= green](c)circle(1pt);
\draw[circle,fill= red](b)circle(1pt);
\draw [<-, green, in=180, out=-45](c) to ++(2,-2)node[right](){\scriptsize (A.out)};
\end{tikzpicture}
\end{document}