3

How can I draw an up and down arrow on a closing switch in circuitikz? Please see my current code, the output it produces, and the desired output below. Additionally, how can I add a comment "100kHz" above the switch?

My Code:

\documentclass{article}

\usepackage{circuitikz}

\begin{document}
    
    \begin{circuitikz}
    
        \draw (0,0) to[closing switch] (5,0);
    
    \end{circuitikz}
    
\end{document}

My Output: enter image description here

My Desired Output: enter image description here

3
  • 2
    Add label=100kHZ for the label. The other should be easy, but not sure it is. (But I didn't look at the docs - maybe there's a different style of switch you could use?)
    – cfr
    Commented Jun 16 at 7:22
  • @crf: thanks a lot! do you know how to control the position of the label? Commented Jun 16 at 7:32
  • See at ctan.org/pkg/circuitikz, package documentation. Search for label (many hits) // For the arrows at the switch, see ch. "3.2.3 Descriptions" ...
    – MS-SPO
    Commented Jun 16 at 7:42

1 Answer 1

6

If you have a recent version of circuitikz, the options for tuning the arrows work also for traditional switches (they used to work only for "cute" switches).

\documentclass{article}
\usepackage[siunitx, RPvoltages]{circuitikz}

\begin{document}
    \begin{circuitikz}
        \draw (0,0) to[closing switch, switch start arrow=latexslim,
            l=\qty{100}{\kHz}] (5,0);
    \end{circuitikz}
\end{document}

enter image description here

adding label distance=10pt gives:

enter image description here

Relevant parts of the (current) manual: 4.21.5 Switch arrows (should be easy to spot...)

enter image description here

...and 5.1.1 Label and annotation position

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .