我根据答案编辑了我的代码。
\documentclass{article}
\usepackage{tikz}
\usepackage{circuitikz}
\begin{document}
\begin{figure}
\begin{center}
\begin{circuitikz}
\draw (0,2.5) node (H) [label={[xshift=-2ex]H}]{}
to[R={r}](5,2.5) node (D) [label={[yshift=2ex]D}]{}
to[C={$C_1$}](10,2.5) node (C) [label={[yshift=2ex]C}]{}
to[C={$C_2$}](15,2.5) node (G) [label={[xshift=2ex]G}]{}
to[battery1=$E_4$](15,-2.5) node (F) [label={[xshift=2ex]F}]{}
to[R={r}](10,-2.5) node (B) [label={[yshift=-4ex]B}]{}
to[R={r}](5,-2.5) node (A) [label={[yshift=-4ex]A}]{}
to[C={$C_3$}](0,-2.5) node (E) [label={[xshift=-2ex]E}]{}
(0,2.5) to[battery1=$E_3$](0,-2.5)
(5,2.5) to[battery1=$E_1$](5,-2.5)
(10,2.5)to[battery1=$E_2$](10,-2.5)
(0,2.5)to[short](0,7.5)
(15,2.5)to[short](15,7.5)
(0,-2.5)to[short](0,-7.5)
(15,-2.5)to[short](15,-7.5)
(0,7.5)to[R={r}](15,7.5)
(0,-7.5)to[C={$C_4$}](15,-7.5);
\draw [red] (D)--(A)--(F)--(15,7.5)--(0,7.5)--(0,2.5)--(D);
\end{circuitikz}
\end{center}
\end{figure}
\end{document}
这将创建以下电路。节点 D、A、F 之间有间隙。我该如何填补它?我如何制作显示电流流动的动画?
答案1
这就是你要找的东西吗?
\documentclass{article}
\usepackage{tikz}
\usepackage{circuitikz}
\begin{document}
\begin{figure}
\begin{center}
\begin{circuitikz}[
every node/.style={inner sep = 0pt, outer sep = 0}
]
\draw (0,2.5) node (H) [label={[xshift=-2ex]H}]{}
to[R={r}](5,2.5) node (D) [label={[yshift=2ex]D}]{}
to[C={$C_1$}](10,2.5) node (C) [label={[yshift=2ex]C}]{}
to[C={$C_2$}](15,2.5) node (G) [label={[xshift=2ex]G}]{}
to[battery1=$E_4$](15,-2.5) node (F) [label={[xshift=2ex]F}]{}
to[R={r}](10,-2.5) node (B) [label={[yshift=-3ex]B}]{}
to[R={r}](5,-2.5) node (A) [label={[yshift=-3ex]A}]{}
to[C={$C_3$}](0,-2.5) node (E) [label={[xshift=-2ex]E}]{}
(0,2.5) to[battery1=$E_3$](0,-2.5)
(5,2.5) to[battery1=$E_1$](5,-2.5)
(10,2.5)to[battery1=$E_2$](10,-2.5)
(0,2.5)to[short](0,7.5)
(15,2.5)to[short](15,7.5)
(0,-2.5)to[short](0,-7.5)
(15,-2.5)to[short](15,-7.5)
(0,7.5)to[R={r}](15,7.5)
(0,-7.5)to[C={$C_4$}](15,-7.5);
\draw[red, opacity = 0.3, line width = 3pt] (A) rectangle (G);
\end{circuitikz}
\end{center}
\end{figure}
\end{document}
而且当然 ...