# siunitx tables and commands between columns

I'd like to add parenthesis around some columns in a table, using the siunitx package. I'm using the > and < column specifiers, and they seem to work... except in the last column, where some additional space is inserted. This is sample code:

\documentclass{article}
\usepackage{siunitx}
\begin{document}

\sisetup{table-format = 1.2,table-auto-round = true}

\begin{tabular}
{l*{4}{S@{~}
>{{(}}
S[table-format=1.1,
table-figures-exponent=1,table-sign-exponent=true,
scientific-notation=true,
table-space-text-pre=(,table-space-text-post=)]
<{{)}}
}
}
A & 1.234&0.987e-4  & 4.567&0.654e-5  \\
B & 2.345&0.876e-3  & 5.678&0.543e-3  \\
C & 3.456&0.765     & 6.789&0.432     \\
\end{tabular}

\end{document}


And the result:

As you can see, there's an unwanted space before the closing parenthesis in the second column.

Am I doing something wrong? Is there a better way of inserting the parentheses (or anything else)?

-

The manual mentions that there can be some issues with the very last cell. The usual way around this is to use the TeX \cr primitive to end the cell:

\documentclass{article}
\usepackage{siunitx}
\begin{document}

\sisetup{table-format = 1.2,table-auto-round = true}

\begin{tabular}
{l*{2}{S@{~}
>{{(}}
S[table-format=1.1e-1,
scientific-notation=true,
table-space-text-pre=(,table-space-text-post=)]
<{{)}}
}
}
A & 1.234&0.987e-4  & 4.567&0.654e-5  \cr
B & 2.345&0.876e-3  & 5.678&0.543e-3  \cr
C & 3.456&0.765     & 6.789&0.432     \cr
\end{tabular}

\end{document}


(I've tided up your table-format a bit, too.)

-
Thanks, that's section "7.13 Adding items after the last column of a tabular", for the record, I see it now. Thanks for the table-format hint too. –  Jellby Jul 25 '13 at 9:56
Adding a fake column? –  egreg Jul 25 '13 at 13:46