Label name in circuitikz

Putting the label in a \mbox seems to do the trick. Try the following version:

\documentclass{standalone}
\usepackage{tikz}
\usepackage[siunitx,european,americanresistors]{circuitikz}
\begin{document}
\begin{tikzpicture}[american currents]
    \draw (0,0) to[R,label=\mbox{$R_1=\SI{2}{\ohm}$}] (2,0);
\end{tikzpicture}
\end{document}

enter image description here


The problem is that TikZ thinks a = identifies a new option. Like in

(0,0) node[R,l=test=yes]

it is assumed that l=tes and t=yes (or something like this... At least it breaks!)

Inside a math environment, you can escape the "equals" by {=}:

(0,0) to[R,l=$R_g{=}\SI{10}{\ohm}$] ++(2,0);

Tags:

Circuitikz