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.

I'm trying to use the following with siunitx:

\omega_x = \SI{100\pi}{rad.s^{-1}}

But it comes out wrong. There is a space placed between 10 and 0π, as if π was actually a digit rather than a symbol. How do I get siunitx to treat it as a symbol?

I'd prefer an option to be used with the \usepackage declaration, to make the behaviour system-wide. An alternative package would also be helpful.

Image for clarification:

siunitx output, with superfluous space between the zeros

Also, I'd prefer a way that supported multiple symbols. I'm using the TeX Live 2012 distribution, last updated on September 25, if that helps.

share|improve this question
1  
Would \SI[parse-numbers=false]{100\pi}{rad.s^{-1}} help? See section 5.4 of the documentation. –  egreg Sep 29 '12 at 12:25
    
@egreg It would, in this case, but unfortunately it wouldn't work the way I want in the case of \SI{1000\pi}{rad.s^{-1}}, for example. –  Hameer Abbasi Sep 29 '12 at 12:40
    
I found this thread, but nothing it it seems to work. Also, the input-symbols option (page 20-21 of the documentation‌​) lists a default value of \pi\dots, but even so, manually setting it doesn't fix my problem. –  Hameer Abbasi Sep 29 '12 at 12:45
    
What would you want in the case of 1000\pi? –  egreg Sep 29 '12 at 13:09
    
A spacing between the rendering of 1 and 000\pi. To my understanding, parse-numbers=false eliminates all automatic spacing in the numbers section. –  Hameer Abbasi Sep 29 '12 at 13:12
add comment

1 Answer 1

up vote 4 down vote accepted

Some things I'd suggest:

Code

\documentclass{article}
\usepackage{siunitx}
\DeclareSIUnit{\pii}{\ensuremath{\pi}}
\newcommand*{\customSI}[4][]{\num[#1]{#2}#3\,\si[#1]{#4}} % \, should be substituted for siunitx' inter-unit-product
\newcommand*{\customSIcustom}[4][]{\SI[parse-numbers=false,#1]{\num[parse-numbers=true,#1]{#2}#3}{#4}}

\begin{document}
\(\omega_x = \SI[parse-numbers=false]{\num[parse-numbers=true]{10000}\pi}{rad.s^{-1}}\)\\
\(\omega_x = \customSIcustom{10000}{\pi}{rad.s^{-1}}\)\\
\(\omega_x = \customSI{10000}{\pi}{rad.s^{-1}}\)\\
\(\omega_x = \SI{10000}{\pii.rad.s^{-1}}\)\\
\(\omega_x = \SI[number-unit-product={}]{10000}{\pii.rad.s^{-1}}\)
\end{document}

Output

updated

share|improve this answer
    
The customSI option is perfect! Thank you so much. –  Hameer Abbasi Sep 29 '12 at 14:17
    
However, I prefer defining a command for the first option. For anyone wanting to do this, I suspect \newcommand*{\customSI}[4][]{\SI[parse-numbers=false,#1]{\num[parse-numbers=tru‌​e]{#2}#3}{#4}} would do it. –  Hameer Abbasi Sep 29 '12 at 14:25
    
@HameerAbbasi I've updated my answer. Take a look at \customSIcustom (and choose a more appropriate name). –  Qrrbrbirlbel Sep 29 '12 at 14:32
    
@HameerAbbasi It works in my MWE. Maybe a conflicting package? You can also issue #1 to the inner \num. –  Qrrbrbirlbel Sep 29 '12 at 14:45
    
I have no idea why it doesn't work anymore. \newcommand*{\customSIcustom}[4][]{\SI[parse-numbers=false,#1]{\num[parse-numbe‌​rs=true,#1]{#2}#3}{#4}} treats everything as parse-numbers=false I'm only using the standard ams* and inputenc packages. –  Hameer Abbasi Sep 29 '12 at 15:00
show 2 more comments

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.