# Why is siunitx unable to typeset this mixed symbolic and numeric argument to \SI?

I'm using the MacTeX 2011 Distribution on OSX Lion (both with all updates installed) and I get a strange error from the siunitx package, that did not occur with MacTex 2010 on Snow Leopard.

As a minimal example

\documentclass{article}
\usepackage{siunitx}
\sisetup{mode=text,per-mode=symbol,input-symbols={\pi\cdot}}
\begin{document}
\SI{2 \pi \cdot 10}{\kilo\hertz}
\end{document}


will fail to be typeset with the error Missing \$ inserted., whereas changing the \SI command to

\SI{2 \pi \cdot 1}{\kilo\hertz}


will be typeset with no errors.

Can someone explain, why siunitx fails to parse the first command correctly?

-

If you force text mode for output, it is down to you to ensure that math mode is selected for symbols which require it. As egreg has pointed out, one option is simply to turn off the parser and allow any math mode material in the number. The alternative approach requires that you create a suitable wrapper for each math mode symbol:

\documentclass{article}
\usepackage{siunitx}
\sisetup{mode=text,per-mode=symbol,input-symbols=\mypi\mycdot}
\protected\def\mypi{\ensuremath{\pi}}
\protected\def\mycdot{\ensuremath{\cdot}}
\begin{document}
\SI{2 \mypi \mycdot 10}{\kilo\hertz}
\end{document}

-
Thanks! That solves this issue. Any idea why this was no problem with MacTex 2010 ? –  TFG Dec 12 '11 at 11:33
@TFG I'd need to know which siunitx version we are talking about. 'MacTeX 2010' covers a lot, depending on when you updated it. –  Joseph Wright Dec 12 '11 at 11:51
According to texdoc I am using the version released on 2011/12/09 right now. The version I used before and that had no problems with this notation was released on 2010/7/15. –  TFG Dec 12 '11 at 12:01
@TFG I'd need to see your full log. This does not work for me with any release of siunitx that I know of! (E-mail directly to me might be best: joseph.wright@morningstar2.co.uk) –  Joseph Wright Dec 12 '11 at 12:14

You have to turn off the number parsing in the first argument:

\SI[parse-numbers=false]{2\pi\cdot10}{\kilo\hertz}


Page 22 of the documentation.

-