[Tex/LaTex] siunitx error: “invalid-token-in-number” when using math in \numrange

math-modesiunitx

I want to show a range from 0 to infinity. I'm using this line of LaTeX with siunitx imported:

\numrange[range-phrase = --]{0}{\infty}

That line gives this error:

siunitx error: "invalid-token-in-number"

I've also tried with $'s around the \infty. What is the correct way to render this range?

Best Answer

As Troy notes, \numrange has a Boolean flag that controls this behavior: parse-numbers.

\numrange[range-phrase = --, parse-numbers=false]{0}{\infty}