即使使用 \centering 或 \begin{center},我的 latex 表格仍然没有居中

即使使用 \centering 或 \begin{center},我的 latex 表格仍然没有居中

以下是最低限度的工作示例:

\begin{table}[!htbp]
\begin{center}
\caption[caption,justification=centering]{Summary of the cake-cutting procedures.}
\label{tab:procedures}
\begin{tabular}{lccccc}
    \toprule
    Procedure                      & Agents & EXP1 & EXP2 & EF & Prop \\
    \midrule
    Cut and choose (2ACC)                & 2      & \ding{51}    & \ding{51}    & \ding{51}         & \ding{51}            \\
    Cut middle          (2SCC)           & 2      & \ding{51}    & \ding{51}    & \ding{51}         & \ding{51}            \\
    Selfridge--Conway  (3SC)  & 3      & \ding{51}    & \ding{51}    & \ding{51}         & \ding{51}            \\
    Dubins--Spanier ($n$DS) & $n$      & \ding{51}(3,4)  & \ding{51}(2,3)  & $\times$        & \ding{51}            \\
    Knaster--Banach ($n$KB) &$n$      & \ding{51}(3,4)    & \ding{51}(3)    &     $\times$   & \ding{51}            \\
    Even--Paz   ($n$EP)                    & $n$      & \ding{51} (4)&$\times$  & $\times$        & \ding{51}           \\
    \bottomrule
\end{tabular}
\begin{tablenotes}
    \footnotesize EF refers to envy-freeness. Prop refers to proportionality.
\end{tablenotes}
\end{center}
\end{table}

但结果就是这样,明显没有居中 在此处输入图片描述

答案1

如果tablenotes来自threeparttable,您可能应该使用threeparttable。的可选参数\caption是 LOT。Tablenotes 需要\items。

\documentclass{article}
\usepackage{caption}
\usepackage{booktabs}
\usepackage{threeparttable}
\usepackage{pifont}
\usepackage{showframe}% MWE only

\begin{document}
\begin{table}[htbp]% [!] almost never has any effect.
\centering
\begin{threeparttable}
\captionsetup{justification=centering}% which has no effect on single ine captions.
\caption[Cake cutting]{Summary of the cake-cutting procedures.}
\label{tab:procedures}
\begin{tabular}{lccccc}
    \toprule
    Procedure                      & Agents & EXP1 & EXP2 & EF & Prop \\
    \midrule
    Cut and choose (2ACC)                & 2      & \ding{51}    & \ding{51}    & \ding{51}         & \ding{51}            \\
    Cut middle          (2SCC)           & 2      & \ding{51}    & \ding{51}    & \ding{51}         & \ding{51}            \\
    Selfridge--Conway  (3SC)  & 3      & \ding{51}    & \ding{51}    & \ding{51}         & \ding{51}            \\
    Dubins--Spanier ($n$DS) & $n$      & \ding{51}(3,4)  & \ding{51}(2,3)  & $\times$        & \ding{51}            \\
    Knaster--Banach ($n$KB) &$n$      & \ding{51}(3,4)    & \ding{51}(3)    &     $\times$   & \ding{51}            \\
    Even--Paz   ($n$EP)                    & $n$      & \ding{51} (4)&$\times$  & $\times$        & \ding{51}           \\
    \bottomrule
\end{tabular}
\begin{tablenotes}
  \item \footnotesize EF refers to envy-freeness. Prop refers to proportionality.
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}

相关内容