[Tex/LaTex] How to put a label on a wire using CircuiTikz

circuitikzlabels

I would like to put a label on a short circuit element.

I have tried something like this:

     \draw
     (2,2) to [short=$L = \lambda/4$, *-*] (5.5,2)
     (2,0) to [short, *-*] (5.5,0);

but nothing happens.

How can I do that?

Thank you.

Best Answer

You should use the notation l={<label>}:

\documentclass[tikz,border=10pt]{standalone}
\usepackage{circuitikz}

\begin{document}
\begin{circuitikz}
 \draw
     (2,2) to [short,l=${L = \lambda/4}$, *-*] (5.5,2)
     (2,0) to [short, *-*] (5.5,0);
\end{circuitikz}
\end{document}

The result:

enter image description here

The reason behind which the label needs to be grouped in this case can be found in Use math equation as bchart label.