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.

! Undefined control sequence.

\documentclass[12pt]{article}
\usepackage{siunitx}
\begin{document}
\si{300}{\nanogram\per\millilitre}
\end{document}

Why?

share|improve this question
    
While in this case it was easy enough to guess the message you were getting, it is usually best to post the full text of an error message rather than just part of it. –  Joseph Wright May 30 '11 at 9:40
add comment

3 Answers 3

up vote 7 down vote accepted

You have to use \SI{<number>}{<unit macros>} if you want to typeset a number with units (instead of the lowercase \si, which typesets just units), and unit prefixes like \milli and \nano have to be separated from the unit macros \liter and \gram:

\documentclass[12pt]{article}
\usepackage{siunitx}
\begin{document}
\SI{300}{\nano\gram\per\milli\litre}
\end{document}
share|improve this answer
add comment

Jake answered the core question: units and prefixes have to be given separately. However, I think I should add a few comments. There are simply too many potential combinations to provide all of them, and so the core of the package only defines separate prefixes and units. You can define additional units using \DeclareSIUnit

\DeclareSIUnit\nanogram{\nano\gram}

There are a large number of abbreviated units, which currently have to be loaded as an option

\documentclass[12pt]{article}
\usepackage{siunitx}
\sisetup{load-configurations = abbreviations}
\begin{document}
\SI{300}{\ng\per\ml}
\end{document}

(I'm planning to revise this so that they are loaded as standard when I do the v2.3 updates: hopefully this will happen some time in June.)

On the \si versus \SI issue, using \si as you have will mean that the package treats 300 as a unit, then does a 'free standing unit' approach to the later part. This is not going to give you the correct output.

share|improve this answer
    
Thanks got the abbrev tip - a real time-saver and reduces text clutter. :) –  ptrcao May 30 '11 at 9:46
add comment

You need to use \SI instead of \si.

share|improve this answer
add comment

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.