0

I need to separate some groups of columns in a table by adding extra space between them. However, if there are headings specified inside of a multicolumn of width one, the heading right before the added space is centered around the area including the space. Here is a MWE:

    \documentclass{article}
    \begin{document}  

    \begin{tabular}{lcc@{\hskip 0.5in}cc}
    & \multicolumn{1}{c}{(1)} & \multicolumn{1}{c}{(2)} & \multicolumn{1}{c}{(3)} & \multicolumn{1}{c}{(4)} \\
    Line 1 & One &Two& Three & Four\\
    Line 2 & Five & Six & Seven & Eight
    \end{tabular}

    \begin{tabular}{lcc@{\hskip 0.5in}cc}
    & (1) & (2) & (3) & (4) \\
    Line 1 & One &Two& Three & Four\\
    Line 2 & Five & Six & Seven & Eight
    \end{tabular}

    \end{document}

The first tabular misplaces (2) and (3) compared to the second one: enter image description here

Is there a way to force the first to behave the same as the second while keeping the multicolumn definitions in the first row?

Note: I know it is not ideal to have multicolumns of length 1, but these are generated automatically using Stata's esttab package and I am not aware of a solution how to go around this. For the same reason I cannot add an extra column between (2) and (3).

3
  • If you do not use any \multicolumn elsewhere, then do \renewcommand{\multicolumn}{#3}.
    – TeXnician
    Commented Apr 21, 2017 at 15:20
  • Thanks! Unfortunately, I do use it elsewhere in the document. Besides, even in the MWE this executes the following error: Illegal parameter number in definition of \multicolumn. \renewcommand{\multicolumn}{#3} Commented Apr 21, 2017 at 15:25
  • Oh yeah, I forgot the parameters, sorry, but if you use it somewhere else it is no option.
    – TeXnician
    Commented Apr 21, 2017 at 15:26

1 Answer 1

1

You had omitted the space specification in the \multicolumn

enter image description here

\documentclass{article}
\begin{document}  

\begin{tabular}{lcc@{\hskip 0.5in}cc}
& \multicolumn{1}{c}{(1)} & \multicolumn{1}{c@{\hskip 0.5in}}{(2)} & \multicolumn{1}{c}{(3)} & \multicolumn{1}{c}{(4)} \\
Line 1 & One &Two& Three & Four\\
Line 2 & Five & Six & Seven & Eight
\end{tabular}

\begin{tabular}{lcc@{\hskip 0.5in}cc}
& (1) & (2) & (3) & (4) \\
Line 1 & One &Two& Three & Four\\
Line 2 & Five & Six & Seven & Eight
\end{tabular}

\end{document}
3
  • Thanks! Unfortunately, this does not help me. The \multicolumn space specification is not created by me but automatically from Stata and as far as I know I cannot control it. I can only control what is inside of the third argument. Commented Apr 21, 2017 at 16:01
  • OK, so I've experimented a bit with this solution and I can make it work using this way. There is, however, one little glitch - the answer does fix the position of (2), however, (3) is still a bit misplaced. Is there a way to similalry redefine the \multicolumn{1}{c}{(3)} part? Commented Apr 21, 2017 at 19:40
  • @RadekJanhuba oh you want @{}c in that case. Commented Apr 21, 2017 at 19:48

You must log in to answer this question.

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