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

2 Answers 2

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

This is a minor update! In the most recently updated version (10/28/2014) of siunitx, this code works, and produces the correct symbol and spacing.

\usepackage[inter-unit-product=\cdot]{siunitx}

The code from the answer here:

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

no longer seems to work, and will throw an error about a missing $ or }. I discovered this quite by accident, and thought I would share.

Edit

Here is an MWE, asked for in the comments:

\documentclass[]{article}
\usepackage[inter-unit-product=\ensuremath{{}\cdot{}}]{siunitx}

\begin{document}

\si{\joule\per\cm\squared\per\hour}

\end{document}
share|improve this answer
    
I tested this, and here is what I found: using \sisetup{inter-unit-product=\ensuremath{{}\cdot{}}} did work, and produced the correct spacing and symbols. However, loading the option like so: \usepackage[inter-unit-product=\ensuremath{{}\cdot{}}]{siunitx} does not work. This produces the errors described above. I will post an MWE above. –  Ethan Deneault Dec 2 at 18:27
2  
I very strongly discourage load time options for siunitx: the way that the LaTeX kernel handles such things means that expansion can lead to issues. \sisetup is strongly preferred. –  Joseph Wright Dec 2 at 18:56

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.