Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

For example when I use \ohm or \micro it throws an error. For example, in the MWE:

\documentclass{article}
\usepackage{circuitikz}
\begin{document}
\begin{circuitikz} \draw
    (0,0) to [C=$100\ohm$](2,0)
    ;
\end{circuitikz}

It produces the error:

"Undefined control sequence:    \pgfk@/tikz/circuitikz/bipole/label/name ...0\ohm :
(0,0) to [C=$100\ohm$](2,0)"

I updated the package and it didn't help.

share|improve this question

2 Answers 2

up vote 8 down vote accepted

You have to load circuitikz with the siunitx option.

Also, the correct syntax is |component| = |value|<|unit|>. The unit macro needs to be surrounded by < and >. The expression may not be put in math mode by surrounding it with $.

Here's an example:

\documentclass{article}
\usepackage[siunitx]{circuitikz}
\begin{document}
\begin{circuitikz}
    \draw (0,0) to [R=1<\ohm>] (2,0);
\end{circuitikz}
\end{document}
share|improve this answer
    
Thanks. However, as I wrote down, I would have preferred to use the simpler format as in pastebin.com/w8f4Pc9v without the '<>' is it obsolete? –  Andro Oct 19 '11 at 5:45
1  
That syntax was never officially supported, as I understand it. If you use ConTeXt, circuitikz defines a number of units and a mock \SI command so your document still compiles. The unit definitions are of the form \def\ohm{\Omega}, which then of course makes it possible to write $100\ohm$ (in that case you need to have the $ signs). You can find the list of definitions in the file t-circuitikz.tex, if you want to copy them into your document. However, I would recommend sticking with the official syntax: It's the same number of keystrokes, and siunitx is a very powerful package. –  Jake Oct 19 '11 at 6:14

You should use the siunitx package for the units:

enter image description here

\documentclass{article}
\usepackage{tikz}% 
\usepackage{circuitikz}
\usepackage{siunitx}

\begin{document}
\begin{circuitikz} \draw
    (0,0) to [C=$\SI{100}{\ohm}$](2,0);
\end{circuitikz}
\end{document}​
share|improve this answer
    
Thanks. So I understand that text in the following format: pastebin.com/w8f4Pc9v is now obsolete? it seems simpler than writing \SI{}{} every time –  Andro Oct 19 '11 at 5:42
    
I would recommend you figure out how you want to handle units in general and use that method consistently thruout. –  Peter Grill Oct 19 '11 at 15:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.