強制多列忽略兩列之間的額外間距

強制多列忽略兩列之間的額外間距

我需要透過在表中新增額外的空間來分隔表中的一些列組。但是,如果在寬度為 1 的多列內部指定了標題,則新增的空格之前的標題將以包含該空格的區域為中心。這是一個 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}

與第二個表格相比,第一個表格錯位了 (2) 和 (3): 在此輸入影像描述

有沒有辦法強制第一個行為與第二個相同,同時將多列定義保留在第一行?

注意:我知道長度為 1 的多列並不理想,但這些是使用 Stata 的 esttab 套件自動產生的,我不知道如何解決這個問題。基於同樣的原因,我無法在 (2) 和 (3) 之間新增額外的列。

答案1

您省略了空間規範\multicolumn

在此輸入影像描述

\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}

相關內容