I keep getting spurious spaces when I use the siunitx in a tabular environment in the presence of a percent (%) symbol. I am trying to align at the decimal point.

My code is:

    One   & 0.1234\percent \tabularnewline
    Two   & 1.234\percent  \tabularnewline
    Three & 12.34\percent  \tabularnewline
    Four  & 123.4\percent  \tabularnewline
    Five  & 1234\percent   \tabularnewline
    Six   & 1234.0\percent \tabularnewline

and the resulting output is:


The decimal-point alignment is working but the percent symbol has increasing number of spaces as the whole number part of the number increases.

Is there a way of removing these spaces easily, so that the percent symbols appear right after the number? I can hack it by having the percent symbol appear as a unit in a separate column, i.e.

    One & 0.1234 & \percent \tabularnewline

but is there a way of having the percent symbol right next to the number as it appears for One, Two and Three above, e.g.


Thank you!

  • Welcome to TeX.SE! What you call a spurious space is actually a conscious design decision; see p. 81 of the user guide of the siunitx package.
    – Mico
    Jul 18 '12 at 11:41
  • Or perhaps it is the problem stated in page 45 of siunitx documentation? (btw, my siunitx guide has only 60 pages)
    – JLDiaz
    Jul 18 '12 at 11:45
  • I forgot to add: If you must have a percent symbol without any space between the numbers and the symbols, (a) use the \% control sequence instead of \percent and (b) issue the command \sisetup{input-symbols=\%} ahead of the table in question.
    – Mico
    Jul 18 '12 at 11:49
  • @JLDiaz: Which version of siunitx is installed on your system? (The one on my system is numbered 2.5e.)
    – Mico
    Jul 18 '12 at 11:50

The S column is intended for numbers only: it is not the same as using both arguments to \SI. Normally, I would suggest either using two separate columns and remove the inter-column padding uisng @{}:


    One   &    0.1234 & \percent \\
    Two   &    1.234  & \percent \\
    Three &   12.34   & \percent \\
    Four  &  123.4    & \percent \\
    Five  & 1234      & \percent \\
    Six   & 1234.0    & \percent \\


or even better adding this information to the header


    & {Value/\si{\percent}} \\
    One   &    0.1234 \\
    Two   &    1.234  \\
    Three &   12.34   \\
    Four  &  123.4    \\
    Five  & 1234      \\
    Six   & 1234.0    \\


If you do want the input as given, you need free-standing-units, alter the definition of \percent and fiddle a bit with the alignment settings


    One   &    0.1234\percent \\
    Two   &    1.234 \percent \\
    Three &   12.34  \percent \\
    Four  &  123.4   \percent \\
    Five  & 1234     \percent \\
    Six   & 1234.0   \percent \\

  • 1
    I'm assuming siunitx version 2.x: update the question if a version 1.x answer is needed!
    – Joseph Wright
    Jul 18 '12 at 11:52
  • Thank you all. I have version 1.x at the moment so I am updating to the latest siunitx, and will then attempt the above fix/es. If that fails, then I might ask for version 1.x fix.
    – salestial
    Jul 18 '12 at 12:31
  • @salestial If you are getting siunitx v2 from CTAN, you must also get the latest l3kernel and l3packages. They have to 'match' and were all updated 48 h ago!
    – Joseph Wright
    Jul 18 '12 at 12:35
  • It works! It was indeed a version problem - version 1.3 was not even supporting (or was throwing an error) keyword arguments to S. All sorted now though - thanks all!
    – salestial
    Jul 18 '12 at 13:07

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.