I'm using the siunitx
package to automatically put thousand separators in all my tabular
environments.
It works fine, but not if you have a column header. This seemingly innocuous MWE fails to compile with an utterly bizarre error:
\documentclass{article}
\usepackage[group-separator={,}]{siunitx}
% Adds the S column for formatting numbers like 10,000
\begin{document}
\begin{tabular}{llSS}
& & Trade Value & Estimation Error \\
& & (\$US M) & (\$US M) \\
USA & GBR & 15574 & -5753 \\
GBR & USA & 15668 & -4127 \\
USA & JPN & 4261 & 3092 \\
GBR & LUX & 1590 & 2766 \\
\end{tabular}
\end{document}
I've gleaned from questions like this that the answer is to do multicolumn{1}{c}{My Header}
.
This seems like a bore, given all my tables have headers.
The alternatives all seem to involve putting every number into an environment like \num
. This is clearly no solution at all, if your tables are large.
Is there a package which will put thousand separators into my tabulars
without the need for either the multicolumn
headers or the \num{}
around every number in the table?
S
-columns all the time. – henry Jun 4 '15 at 14:18