TransWikia.com

My latex table is still not centered, even after using centering or begin{center}

TeX - LaTeX Asked by fox on July 30, 2021

Minimally working example below:

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}

But the result is this, clearly not centered
enter image description here

One Answer

If tablenotes is from threeparttable, you should probably use threeparttable. The optional argument for caption is for the LOT. Tablenotes requires 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}

Answered by John Kormylo on July 30, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP