Brief background: I have created a table using the S
column type provided by the siunitx
package. This column type allows aligning the data and column headers just fine.
My problem: The table is too wide for my document, despite setting the width as \textwidth
. I suspect this is because every column uses the same formatting and leaves room for a leading (
and a trailing )
, even if it is not needed for each column.
MRE:
\documentclass[12pt,a4paper,titlepage,usenames]{article}
\usepackage[left=60mm,right=20mm,top=30mm,bottom=30mm]{geometry}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{tabu}
\begin{document}
\begin{table}[h]
\sisetup{
table-space-text-pre={(},
table-space-text-post={)},
input-open-uncertainty = ,
input-close-uncertainty = ,
table-format=2.2,
table-text-alignment=right,
table-align-text-pre = false,
table-align-text-post = false
}
\scriptsize
\begin{tabular*}{\textwidth}{l@{\extracolsep{\fill}} *{11}{S}}
\toprule
$i$ & {$\beta^{1i}$} & {$\beta^{2i}$} & {$\beta^{3i}$} & {$\beta^{4i}$} & {$E(c^i)$} & {$\sigma(\Delta c^i)$} & {$E(r^{e,i})$} & {$\sigma(r^i)$} & {$trn^i$} & {$Size^i$} & {$BM^i$} \\
& {$(\cdot 100)$} & {$(\cdot 100)$} & {$(\cdot 100)$} & {$(\cdot 100)$} & {$(\%)$} & {$(\%)$} & {$(\%)$} & {$(\%)$} & {$(\%)$} & {$(EUR)$} & \\
\midrule
1 & 1.43 & 0.00 & 0.00 & 0.00 & 0.26 & 0.00 & 0.96 & 1.97 & 0.50 & 28.45 & 3.14 \\
& (21.34) & (7.49) & (-6.67) & (-3.39) & & & & & & & \\
3 & 1.41 & 0.00 & 0.00 & 0.00 & 0.25 & -0.00 & 0.66 & 1.78 & 0.83 & 61.16 & 0.88 \\
& (29.14) & (9.91) & (-7.12) & (-1.27) & & & & & & & \\
5 & 1.30 & 0.00 & 0.00 & 0.00 & 0.25 & 0.00 & 1.56 & 2.11 & 14.69 & 5.45 & 0.00 \\
& (20.18) & (9.84) & (-4.12) & (-3.29) & & & & & & & \\
\bottomrule
\end{tabular*}
\end{table}
\end{document}
This leads to:
Where the two columns to the right overlap the tables edge.
My question: Can TEX figure out the correct column width automatically? How could I otherwise specify that for the columns on the right hand side, that not so much space for brackets is needed?
Thank you, C.