我希望可变电感器的抽头带有箭头,就像可变电阻器或电位器一样,如下所示。关于如何添加它,有什么建议吗?我尝试过带和不带“to[short,...”的“->”。我试过“-A”。我忘了什么?
\documentclass{standalone}
\usepackage[utf8]{inputenc}
\usepackage[siunitx, RPvoltages]{circuitikz}
\begin{document}
\pagestyle{empty}
\begin{circuitikz}[american]
\draw (0,0) to[L, name=L, mirror] ++(0,-2) coordinate(tap) -- ++(0,-1);
\draw (tap) -- ++(1,0) coordinate(end) -- (L.midtap -| end) -- (L.midtap);
\draw (0,-3) to[potentiometer, name=R] ++(0,-2) coordinate(tapR) -- ++(0,-1);
\draw (tapR) -- ++(1,0) coordinate(endR) -- (R.wiper -| endR) -- (R.wiper);
\end{circuitikz}
\end{document}
感谢您的任何帮助和建议。
-凯文
答案1
一个可能的(粗鲁的)解决方案是:
\documentclass[margin=3mm]{standalone}
\usepackage[siunitx, RPvoltages]{circuitikz}
\usetikzlibrary[arrows.meta]
\begin{document}
\begin{circuitikz}[american]
\draw (0,0) to [short,-*] ++ (0,1) coordinate (a)
to [L, name=L] ++ (0,2);
\draw[Stealth-] (L.center) -- ++ (1,0) |- (a)
;
\end{circuitikz}
\end{document}
编辑:
不要使用坐标(L.center)
,因为在这种特殊情况下它可以正常工作,而应该使用(L.midtap)
,它适用于任何形状的电感(参见@rmano 答案):
\begin{circuitikz}[american]
\draw (0,0) to [short,-*] ++ (0,1) coordinate (a)
to [L, name=L] ++ (0,2);
\draw[Stealth-] (L.midtap) -- ++ (1,0) |- (a)
;
\end{circuitikz}
答案2
@Zarko 的回答是正确的做法。我建议使用锚点midtap
并明智地使用,mirror
使其适用于其他大号-形状。
请注意,使用mirror
有点像“调整”的事情,因为它取决于形状以及电感中有多少个“环路”......
\documentclass[margin=2.718mm]{standalone}
\usepackage[siunitx, RPvoltages]{circuitikz}
\usetikzlibrary[arrows.meta]
\begin{document}
\begin{circuitikz}[]
\draw (0,0) to [short,-*] ++ (0,1) coordinate (a)
to [L, mirror, name=L] ++ (0,2);
\draw[Stealth-] (L.midtap) -- ++ (1,0) |- (a);
\begin{scope}[american, xshift=3cm]
\draw (0,0) to [short,-*] ++ (0,1) coordinate (a)
to [L, name=L] ++ (0,2);
\draw[Stealth-] (L.midtap) -- ++ (1,0) |- (a);
\end{scope}
\begin{scope}[american, xshift=6cm,
circuitikz/inductors/coils=5]
\draw (0,0) to [short,-*] ++ (0,1) coordinate (a)
to [L, mirror, name=L] ++ (0,2);
\draw[Stealth-] (L.midtap) -- ++ (1,0) |- (a);
\end{scope}
\begin{scope}[european, xshift=9cm]
\draw (0,0) to [short,-*] ++ (0,1) coordinate (a)
to [L, mirror, name=L] ++ (0,2);
\draw[Stealth-] (L.midtap) -- ++ (1,0) |- (a);
\end{scope}
\end{circuitikz}
\end{document}
如果您想要与 (*) 其余部分相同的“假”箭头circuitikz
,您可以:
\documentclass[margin=2.718mm]{standalone}
\usepackage[siunitx, RPvoltages]{circuitikz}
\usetikzlibrary[arrows.meta]
\begin{document}
\begin{circuitikz}[]
\draw (0,0) to [short,-*] ++ (0,1) coordinate (a)
to [L, mirror, name=L] ++ (0,2);
\draw[] (L.midtap) node[inputarrow, xscale=-1]{}
-- ++ (1,0) |- (a);
\end{circuitikz}
\end{document}
(*)有关箭头的更多详细信息circuitikz
,请参阅https://tex.stackexchange.com/a/549354/38080