5

With siunitx (up to date on MacTeX 2014), I would like to use something simple like

\numrange{1/100}{1/1000}

But I just get an error.

Is there a way to typeset this with siunitx?

6

AFAIK fractions with / are not supported, when siunitx parses the input numbers. However the parsing can be disabled:

\documentclass{article}
\usepackage{siunitx}

\begin{document}
\numrange[parse-numbers=false]{1/100}{1/1000}
\end{document}

Result

From the documentation of package siunitx:

parse-numbers The parse-numbers option turns the entire parsing system on and off. The option is made available for two reasons. First, if all of the numbers in a document are to be reproduced ‘as given’, turning off the parser will represent a significant saving in processing required. Second, it allows the use of arbitrary TeX code in numbers. If the parser is turned off, the input will be printed in math mode (requiring \text to protect any text in the number).

\num[parse-numbers = false]{\sqrt{2}} \\
\SI[parse-numbers = false]{\sqrt{3}}{\metre}
| improve this answer | |
  • Multi-part numbers are not allowed in ranges: you can have \num{1/1000} but conceptually this is two numbers :-) – Joseph Wright Sep 20 '14 at 8:45
  • @JosephWright Then you want to introduce something like \multipartnumrange? ;-) Fun aside: 1/100 is just a different way to write a rational number, other forms: 0.01 or 1 %. – Heiko Oberdiek Sep 20 '14 at 15:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.