TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I used to format number grouping with a protected space (~). Now I'm switching to siunitx's \num. According to the package documentation ...

The formatter removes ‘hard’ spaces (\, and ~)

but when I surround my numbers with \num it produces the following error output

! siunitx error: "invalid-token-in-number"
! Invalid token '\protect ' in numerical input.

l.5 \num{60~000}

| Numbers can only contain tokens defined using the 'input-...' options:
| the token '\protect ' is not set up as a valid part of a number.

I tried to include \protect to the input-ignore option but it just changes the invalid token in the error message to \unhbox and \voidb.

Here is a MWE (Miktex v2.9 and siunitx v2.5s):

%\sisetup{input-ignore={\protect }}

Of course, one could just remove the tilde character in each number but how would I include it into the ignored input tokens? Do I misinterpret the package documentation?

share|improve this question
up vote 11 down vote accepted

That's a mistake in the documentation: currently the standard settings ignore \, but not ~. I'll fix that in a maintenance release: for the moment use

  input-protect-tokens = ~\approx\dots\ge\geq\gg\le\leq\ll\mp\pi\pm\sim}
share|improve this answer
Logged as github.com/josephwright/siunitx/issues/256 and likely to be actioned by the weekend. I've got a few minor issues to address, one of which means I'll have to bump the version to 2.6. Bother me if CTAN is not updated by Monday! – Joseph Wright Sep 3 '14 at 9:26
Great, thank you. – Harald Sep 3 '14 at 9:29
It's amazing to have such people one the site! – clabacchio Sep 3 '14 at 14:47
A proper fix has now gone to CTAN: should be with users of TeX Live/MiKTeX within a few days. – Joseph Wright Sep 5 '14 at 8:17
@JosephWright updated my library today. Works like a charm and makes the workaround unnecessary :) – Harald Sep 11 '14 at 14:24

Your Answer


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.