Circuitikz - 电容器不会显示

Circuitikz - 电容器不会显示
\documentclass[11pt]{article}
\usepackage{circuitikz}
\usepackage{tikz}
\begin{document}


\begin{circuitikz}
\node[op amp] at (2,1) (op1) {};
\node[ground] at (0,0) (gnd1) {};
\node[ocirc] at ($(op1.-)+(-3,0)$) (input) {};
\node[ocirc] at ($(op1.out)+(2,0)$) (output) {};
\node[capacitor] at (2,2.5) (c1) {};

\draw
(gnd1) |- (op1.+)
(input) to [R, bipoles/length=35pt] ($(input)+(2.5,0)$) -- (op1.-)
(op1.out) -- (output)
($(op1.out)+(1,0)$) |- (c1) -| ($(op1.-)+(-1,0)$);
\end{circuitikz}

\begin{circuitikz}
\node[capacitor] at (1,1) {};
\end{circuitikz}

\end{document}

我正在尝试绘制一个常规积分器电路,但我的电容器不会显示出来。我使用 C 和电容器作为节点名称。这是我从上面的代码中得到的结果:

在此处输入图片描述

最好的,

马修

答案1

该网站的某处有以下答案(不幸的是我现在找不到它):

    \documentclass{standalone}
\usepackage{circuitikz}
    \usetikzlibrary{calc}

\begin{document}
    \begin{circuitikz}[every pin/.append style={align=left, text=blue}]
    \scriptsize
  \draw
  (0, 0) node[op amp] (opamp) {\textcolor{blue}{OA}}
  (opamp.-) to[R] (-3, 0.5)
  (opamp.-) to[short,*-] ++(0,1.5) coordinate (leftC)
  to[C] (leftC -| opamp.out)
  to[short,-*] (opamp.out);
\node[pin=above left: \textcolor{red}{opamp.-}: coordinates of\\
                      OA's inverting (negative)\\
                      input] at (opamp.-) {};
\node[pin=above left: \textcolor{red}{++(0,1.5)} -- vertical offset \\
                      OA's inverting imput named     \\
                      "opamp.-" determine position   \\
                      of the coordinate (leftC)
                      ] at ($(opamp.-)+(0,1.5)$) {};
\node[pin=above right: \textcolor{red}{leftC $-|$ opamp.out}:\\
                      determine the coordinate of\\
                      intersection of lines:\\
                      horizontal from C and \\
                      vertical from OA output\\
                      (see dashed red lines)] at (leftC -| opamp.out) {};
    \draw[dashed, red]  (leftC) -- + (31mm,0)
                        (opamp.out) -- + (0,31mm);
%%%% explanations:
\node[pin=below right:\textcolor{red}{opamp} is name of     \\
                      coordinates {(0,0)}. They\\
                      determine the position\\
                      of OA] at (0,0) {};
\node[pin=below left:OA's non inverting input\\
                      (not used)] at (opamp.+) {};
\node[pin=above right:\textcolor{red}{opamp.out} is name of     \\
                      OA's output coordinates] at (opamp.out) {};
    \end{circuitikz}
\end{document}

这使:

在此处输入图片描述

为了您的需要,您只需要删除所有解释,但是,它们可以用来查看如何用封装绘制电路circuitikz

与你的代码进行比较,你会发现你在哪里犯了错误。考虑上面的例子,很容易得出以下解决方案:

\documentclass[margin=3mm]{standalone}
\usepackage{circuitikz}
\usetikzlibrary{calc}

\begin{document}
\begin{circuitikz}[every pin/.append style={align=left, text=blue}]
\footnotesize
\draw
(0, 0) node[op amp] (opamp) {}
(opamp.-) to[R,l_=R1,-o] (-3, 0.5)
(opamp.-) to[short,*-] ++(0,1.5) coordinate (leftC)
to[C,l=C1] (leftC -| opamp.out)
to[short,-*] (opamp.out) 
(opamp.+) -- + (0,-0.5) node[ground] {}
(opamp.out) to[short,-o] + (0.5,0)
;
\end{circuitikz}
\end{document}

这使:

在此处输入图片描述

相关内容