0

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:

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage{csquotes}
\usepackage{url}
\usepackage[binary-units=true,detect-all]{siunitx}
\usepackage{booktabs}

\title{TEST}
\author{TEST}

\begin{document}

\maketitle

\section{TEST}

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

\end{document}

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?

2
  • \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, 2016 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, 2016 at 14:34

2 Answers 2

1

An alternative:

\begin{tabular}{r@{\hskip 4pt}
            *{2}{@{\hskip 4pt}*{3}{S[table-format=0.2]}@{\hskip 4pt}}}
    \toprule
    & \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.

0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .