# in Circuitikz, source of error for direction to battery

The following code snippet produces the correct picture but also it gives an error message, namely:

undefined control sequence. ...terry1,invert, l_=\SI{12}{\ volt}] (0,4)

\begin{center}
\begin{circuitikz}
\draw (0,0)
to[battery1, invert, l_=\SI{33}{\ volt}] (0,4) % The voltage source
to[R=$5 \ ohms$, i=$I_1$] (4,4)
to[R=$5 \ ohms$, i>_=$I_3$] (4,0) % The resistor
to[R=$5 \ ohms$] (0,0);
\draw (8,4)
to[R, l_=$5 \ ohms$,  i_=$I_2$] (4,4);
\draw (8,4)
to[battery1,l_=\SI{10}{\ volt}] (8,0)
to[R=$5 \ ohms$] (4,0);
\end{circuitikz}
\end{center}


what is my error and how do I correct it?

• Probably using on siunitx package. Add to premable.
– user31034
Oct 29 '19 at 20:36
• You have a space in \ volt... And in general you are using the siunitx package wrong. It's \SI{12}{\volt} , no spaces. Oct 29 '19 at 21:10

I guess, that you like to draw your scheme as follows:

For writing units circuitikz offer siunitx mode, in which it adopt siunitx syntax \SI{ number }{ unit } to number<units>. See MWE below:

\documentclass[margin=3mm]{standalone}
\usepackage[siunitx]{circuitikz}

\begin{document}
\begin{circuitikz}
\draw (0,0)
to[battery1, invert, l_=33<\volt>] (0,4) % <---
to[R=5<\ohm>, i=$I_1$] (4,4) % <---
to[R=5<\ohm>, i>_=$I_3$] (4,0) % <---
to[R=5<\ohm>] (0,0); % <---
\draw (8,4)
to[R, l_=5<\ohm>, i_=$I_2$] (4,4); % <---
\draw (8,4)
to[battery1,l_=10<\volt>] (8,0) % <---
to[R=5<\ohm>] (4,0); % <---
\end{circuitikz}
\end{document}

• You do not need to re-load siunitx if specified in the circuitikz options... ;-) otherwise it's a bug. You can load it before if you want to play with options. Oct 30 '19 at 9:59
• @Rmano, you are right. Corrected (removed explicit siunitx loading). Oct 30 '19 at 10:20