5

I'd like the tap of a variable inductor to have an arrowhead, like for a variable resistor or potentiometer, as shown below. Any suggestions on how to add this? I've tried "->" with and without "to[short,...". I've tried "-A". What am I forgetting?

\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}

Variable inductor(without arrowhead on tap) and potentiometer

Thanks for any help and suggestions.

-Kevin

Zarko
  • 296,517

2 Answers2

6

A possible (rude) solution is:

\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}

enter image description here

Edit:
Instead of use coordinate (L.center), which in this particular case works fine, is more correct to use (L.midtap), which works at any shape for inductance (see @rmano answer):

\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}
Zarko
  • 296,517
6

@Zarko's answer is the correct way to do it. I would suggest using the midtap anchor and judicious use of mirror to make it general for other L-shapes.

Notice that the use of mirror is a bit of an "adjust it" thing, because it depends on the shape and on how many "loops" you have in the inductance...

\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}

enter image description here

If you want the same "fake" arrow of the rest of circuitikz(*), you can:

\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}

enter image description here


(*) For a bit more details about arrows in circuitikz, see https://tex.stackexchange.com/a/549354/38080

Rmano
  • 40,848
  • 3
  • 64
  • 125
  • Thank you for your answer (+1). I tried to use ˙.midtap` option but it didn't work for me :-(. Now I figured out why -- I wrongly spell this option name ... – Zarko Oct 11 '22 at 11:21
  • @Rmano, thank you very much for your answer, and for all your work on circuitikz. I'm really enjoying learning this system. Thanks, also, for teaching me the simplified line drawing in "-- ++(1,0) |- (a)" which I"m sure is in the pgftikz manual, but I didn't learn about it until now. – Kevin Zembower Oct 11 '22 at 13:35
  • Thanks! It's called perpendicular coordinate system: https://tikz.dev/tikz-coordinates#sec-13.3.1 – Rmano Oct 11 '22 at 13:42
  • 1
    @Rmano, thanks. I do know about "perpendicular coordinates." They would be written like I did, as "(R.wiper -| endR)". But, you wrote, "\draw[] (L.midtap) node[inputarrow, xscale=-1]{} -- ++ (1,0) |- (a)" which, in English, I interpret as "draw the arrowhead at the L midtap, then draw a line one unit right, then, from this point, USING ONLY horizontal and vertical lines (first horizontal, then vertical) write a line to point a." That was the part that was new to me. Thanks, again. – Kevin Zembower Oct 11 '22 at 14:24
  • Ah, yes. You could be interested by https://tex.stackexchange.com/questions/45347/vertical-and-horizontal-lines-in-pgf-tikz also.... – Rmano Oct 11 '22 at 14:43