我画了一个简单的电路图CircuiTikZ,但我的电线不知怎么地就伸进了电阻器,看起来不太好看。我想这很容易修复,但我做不到。
\documentclass{article}
\usepackage[european,straightvoltages]{circuitikz}
\begin{document}
\begin{circuitikz}
\draw (0,2) to[open,v=$u_q(t)$] (0,0);
\draw (0,2) to[short,o-] (1,2);
\draw (1,2) to[R, l=$R$, v>=$u_R(t)$] (2,2);
\draw (2,2) -- (3,2);
\draw (3,2) to[L, l=$L$,v>=$u_{ind}(t)$] (4,2);
\draw (4,2) -- (5,2);
\draw (5,2) to[short,i=$i(t)$] (5,0);
\draw (0,0) to[short,o-] (5,0);
\end{circuitikz}
\end{document}
答案1
您正在使用代码将线路过度绘制到“R”组件中
\draw (0,2) to[short,o-] (1,2);
现在看一下:
\documentclass{article}
\usepackage[european,straightvoltages]{circuitikz}
\begin{document}
\begin{circuitikz}
\draw (0,2) to[open,v=$u_q(t)$] (0,0);
\draw (0,2) to[short,o-] (0,2);
\draw (0,2) to[R, l=$R$, v>=$u_R(t)$] (2,2);
\draw (2,2) -- (3,2);
\draw (3,2) to[L, l=$L$,v>=$u_{ind}(t)$] (4,2);
\draw (4,2) -- (5,2);
\draw (5,2) to[short,i=$i(t)$] (5,0);
\draw (0,0) to[short,o-] (5,0);
\end{circuitikz}
\end{document}
通过相对定位你不会出错-- 将产生相同的结果
并避免导线与电感器(“L”)重叠:
\documentclass{article}
\usepackage[european,straightvoltages]{circuitikz}
\begin{document}
\begin{circuitikz}
\draw (0,2) to [open,v=$u_q(t)$] (0,0);
\draw (0,2) to [short,o-] ++(0,0)
to [R, l=$R$, v>=$u_R(t)$] ++(2,0)
to [L, l=$L$,v>=$u_{ind}(t)$] ++(3,0)
to [short] ++(0.5,0)
to [short,i=$i(t)$] ++(0,-2)
to (0,0)
to [short,o-] (0,0);
\end{circuitikz}
\end{document}