I have a tabular environment where I am using siunitx column specifications for numbers and multicolumns to place centered text above these columns. It seems that the centering is not perfect in this case:







\begin{tabular}{r*{2}{@{\hskip 8pt}S[table-format=.2]S[table-format=.2]S[table-format=.2]}}
    & \multicolumn{3}{c}{Foo et al} & \multicolumn{3}{c}{Foo et al} \\
                     & {max}  & {max}  & {max} & {max}  & {max}  & {max}\\
    bla              &  0.50  &  0.72  &  0.71 &  0.50  &  0.72  &  0.71\\


Results in:

misplaced centers

As you can see, the l of "et al" is at different positions above the word "max". Can someone explain this?

  • \begin{tabular}{@{\hskip 8pt}r*{2}{@{\hskip 8pt}S[table-format=.2]S[table-format=.2]S[table-format=.2]}@{\hskip 8pt}} would be a compromise which works. The problem is that you add space to the fourth column's right but not to the seventh. Why do you tweak around with the spacings? I would not do that. – LaRiFaRi Aug 31 '16 at 13:44
  • @LaRiFaRi Might work in this minimized example, but in my actual problem it doesn't solve it. My original table just doesn't fit the width and I want to group columns. That's why I fiddle with the spaced. – languitar Aug 31 '16 at 14:34

An alternative:

\begin{tabular}{r@{\hskip 4pt}
            *{2}{@{\hskip 4pt}*{3}{S[table-format=0.2]}@{\hskip 4pt}}}
    & \multicolumn{3}{c}{Foo et al} & \multicolumn{3}{c}{Foo et al} \\
                     & {max}  & {max}  & {max} & {max}  & {max}  & {max}\\

i.e.: additional spaces between column groups is symmetric distributed, consequently multicolumns are not shifted anymore.

| improve this answer | |

Ok, multicolumn needs to be informed about the additional spaces that were added. So:

\multicolumn{3}{c@{\hskip 8pt}}{\citeauthor{Foo2010}}

solves the issue.

This was adapted from: https://tex.stackexchange.com/a/262762/112195

| improve this answer | |

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.