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.

With the latest TeXlive update to the 2012 version, for some reason I am getting missing $ inserted messages, when using the inter-unit-product option for \si.

For example, this is taken directly from the PDF documentation:

\documentclass{minimal}

\usepackage{mathtools}
\usepackage{siunitx}

\begin{document}
\[
    \si[inter-unit-product={}\cdot{}]{\farad\squared\lumen\candela}
\]
\end{document}

and it fails to compile for me with the above error.

share|improve this question
    
In math mode, that is. –  mSSM Jul 23 '12 at 1:23
1  
Can you provide a MWE? –  J M Jul 23 '12 at 1:37
    
Not really necessary here, but sure. –  mSSM Jul 23 '12 at 1:41
    
This seems to work fine \si[inter-unit-product={$\cdot$}]{\farad\squared\lumen\candela} with TeXLive2011. Or if you want the extra spacing use [inter-unit-product={${}\cdot{}$}]. TeXLive2011 even requires this -- perhaps an error in the documentation? –  Peter Grill Jul 23 '12 at 1:47
    
Or the method that they wrote word-for-word in the manual, using the ensuremath command. I also found that it works if you surround the whole command in $s –  J M Jul 23 '12 at 1:49

1 Answer 1

up vote 8 down vote accepted

It looks both you and I were looking at an older version of the documentation. I just downloaded the latest version (2012-07-22) which suggests the use of

\si[inter-unit-product=\ensuremath{{}\cdot{}}]

which yields:

enter image description here

Code:

\documentclass{article}
\usepackage{siunitx}

\begin{document}
\[
    \si[inter-unit-product=\ensuremath{{}\cdot{}}]{\farad\squared\lumen\candela}
\]
\end{document}
share|improve this answer
    
Wow...this is a legitimate use of \ensuremath! –  Ryan Reich Jul 23 '12 at 2:14
    
@RyanReich: Yeah was about to replace it with $ fearing @egreg's wrath :-), but then realized in this case he would probably let it slide since you may want to use units outside of math mode. –  Peter Grill Jul 23 '12 at 2:20
    
Even better: you have no way of knowing how the inter-unit product is actually produced internally. This is truly a "just use this math symbol" situation. –  Ryan Reich Jul 23 '12 at 3:00

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.