需要帮助重新格式化表格

需要帮助重新格式化表格

我并不经常使用 LaTeX,目前我正尝试重新格式化一年前写的一篇论文。新格式规范的边距比旧规范更紧,所以我有这个

\begin{table}[h!]
\scriptsize
\centering
\caption{Performance Summary}
\label{PerfSummary}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|}
\cline{1-4} \cline{6-9}
\multicolumn{3}{|c|}{Method} & \multicolumn{1}{l|}{Average} & \multicolumn{1}{l|}{} & \multicolumn{3}{c|}{Method} & \multicolumn{1}{l|}{Maximum} \\ \cline{1-4} \cline{6-9} 
Triage++ & Reactive & $\alpha_{++}$ Begins High & 10.21 &  & Triage++ & Schedule & $\alpha_{++}$ Begins High & 10.94 \\ \cline{1-4} \cline{6-9} 
Triage++ & Schedule & $\alpha_{++}$ Begins High & 10.05 &  & Triage++ & Fixed $\alpha_{++}$ &  & 10.7 \\ \cline{1-4} \cline{6-9} 
Triage++ & Fixed $\alpha_{++}$ &  & 9.81 &  & Triage++ & Reactive & $\alpha_{++}$ Begins High & 10.68 \\ \cline{1-4} \cline{6-9} 
Triage++ & Schedule & $\alpha_{++}$ Begins Low & 9.46 &  & Triage++ & Schedule & $\alpha_{++}$ Begins Low & 10.49 \\ \cline{1-4} \cline{6-9} 
Triage+ & Reactive & $\alpha_{+}$ Begins Low & 9.35 &  & Triage+ & Fixed $\alpha_{+}$ &  & 10.11 \\ \cline{1-4} \cline{6-9} 
Triage++ & Reactive & $\alpha_{++}$ Begins Low & 8.27 &  & Triage+ & Reactive & $\alpha_{+}$ Begins Low & 9.92 \\ \cline{1-4} \cline{6-9} 
Triage+ & Schedule & $\alpha_{+}$ Begins Low & 6.23 &  & Triage+ & Schedule & $\alpha_{+}$ Begins Low & 9.83 \\ \cline{1-4} \cline{6-9} 
Triage+ & Schedule & $\alpha_{+}$ Begins High & 5.56 &  & Triage+ & Schedule & $\alpha_{+}$ Begins High & 9.74 \\ \cline{1-4} \cline{6-9} 
Triage+ & Fixed $\alpha_{+}$ &  & 4.6 &  & Triage++ & Reactive & $\alpha_{++}$ Begins Low & 9.14 \\ \cline{1-4} \cline{6-9} 
Triage+ & Reactive & $\alpha_{+}$ Begins High & 1.3 &  & Triage+ & Reactive & $\alpha_{+}$ Begins High & 2.38 \\ \cline{1-4} \cline{6-9} 
\end{tabular}
\end{table}

生成此表

在此处输入图片描述

您可以看到现在它太宽了。我想将两个部分“堆叠”在一张表中,但不确定该怎么做。或者,我可以将它们分成两个具有不同编号的表……我可以处理。

所以我想我问的是 a) 美学建议,你认为它们作为独特的表格或“堆叠”读起来更好,以及 b) 如果有必要,如何堆叠它们......

答案1

正如 Peter 所建议的,删除规则后表格会看起来更好。使用 booktabs,表格会变得更好看 :-)

我使用了您提供的数据,并将其制作成一个表格中的两个表格。

\documentclass[11pt]{article}
%
\usepackage{siunitx}
\usepackage{booktabs}

\begin{document}

\begin{table}[h!]
\scriptsize
\centering
\caption{Performance Summary}
\label{PerfSummary}
\begin{tabular}{lllS}
\toprule
\multicolumn{3}{c}{Method} & \multicolumn{1}{l}{Average}          \\
\midrule
  Triage++ & Reactive            & $\alpha_{++}$ Begins High & 10.21 \\
  Triage++ & Schedule            & $\alpha_{++}$ Begins High & 10.05 \\
  Triage++ & Fixed $\alpha_{++}$ &                           & 9.81  \\
  Triage++ & Schedule            & $\alpha_{++}$ Begins Low  & 9.46  \\
  Triage+  & Reactive            & $\alpha_{+}$ Begins Low   & 9.35  \\
  Triage++ & Reactive            & $\alpha_{++}$ Begins Low  & 8.27  \\
  Triage+  & Schedule            & $\alpha_{+}$ Begins Low   & 6.23  \\
  Triage+  & Schedule            & $\alpha_{+}$ Begins High  & 5.56  \\
  Triage+  & Fixed $\alpha_{+}$  &                           & 4.6   \\
  Triage+  & Reactive            & $\alpha_{+}$ Begins High  & 1.3   \\
\bottomrule
\end{tabular}

\bigskip
\begin{tabular}{lllS}
\toprule
\multicolumn{3}{c}{Method} & \multicolumn{1}{l}{Maximum}          \\
\midrule
  Triage++ & Schedule            & $\alpha_{++}$ Begins High & 10.94 \\
  Triage++ & Fixed $\alpha_{++}$ &                           & 10.7 \\ 
  Triage++ & Reactive            & $\alpha_{++}$ Begins High & 10.68 \\
  Triage++ & Schedule            & $\alpha_{++}$ Begins Low  & 10.49 \\
  Triage+  & Fixed $\alpha_{+}$  &                           & 10.11 \\
  Triage+  & Reactive            & $\alpha_{+}$ Begins Low   & 9.92 \\ 
  Triage+  & Schedule            & $\alpha_{+}$ Begins Low   & 9.83 \\ 
  Triage+  & Schedule            & $\alpha_{+}$ Begins High  & 9.74 \\ 
  Triage++ & Reactive            & $\alpha_{++}$ Begins Low  & 9.14 \\ 
  Triage+  & Reactive            & $\alpha_{+}$ Begins High  & 2.38 \\ 
\bottomrule
\end{tabular}

\end{table}

\end{document}

输出如下所示: 在此处输入图片描述

答案2

如果对数字列使用 S` 列类型,则两个表可以放在一个水平块中geometry, which defines more sensible margins if you don't have marginal notes. You even can use footnote size. I use the,以便在小数点上对齐:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{array, caption, booktabs, siunitx}
\usepackage[showframe]{geometry}

\begin{document}

\begin{table}[h!]
  \footnotesize
  \setlength{\tabcolsep}{4pt}\captionsetup{font =footnotesize}
  \centering\sisetup{table-format =2.2, table-number-alignment=center}
  \caption{Performance Summary}
  \label{PerfSummary}
  \begin{tabular}{lllSclllS}
    \cmidrule[\heavyrulewidth]{1-4} \cmidrule[\heavyrulewidth]{6-9}
    \cmidrule(lr){1-3} \cmidrule(lr){4-4}\cmidrule(lr){6-8}\cmidrule(lr){9-9}
    \multicolumn{3}{c}{Method} &{Average} & & \multicolumn{3}{c}{Method} & {Maximum} \\
    \cmidrule(lr){1-3} \cmidrule{4-4}\cmidrule(lr){6-8}\cmidrule{9-9}
    Triage++ & Reactive & $\alpha_{++}$ Begins High & 10.21 & & Triage++ & Schedule & $\alpha_{++}$ Begins High & 10.94 \\
    Triage++ & Schedule & $\alpha_{++}$ Begins High & 10.05 & & Triage++ & Fixed $\alpha_{++}$ & & 10.7 \\
    Triage++ & Fixed $\alpha_{++}$ & & 9.81 & & Triage++ & Reactive & $\alpha_{++}$ Begins High & 10.68 \\
    Triage++ & Schedule & $\alpha_{++}$ Begins Low & 9.46 & & Triage++ & Schedule & $\alpha_{++}$ Begins Low & 10.49 \\
    Triage+ & Reactive & $\alpha_{+}$ Begins Low & 9.35 & & Triage+ & Fixed $\alpha_{+}$ & & 10.11 \\
    Triage++ & Reactive & $\alpha_{++}$ Begins Low & 8.27 & & Triage+ & Reactive & $\alpha_{+}$ Begins Low & 9.92 \\
    Triage+ & Schedule & $\alpha_{+}$ Begins Low & 6.23 & & Triage+ & Schedule & $\alpha_{+}$ Begins Low & 9.83 \\
    Triage+ & Schedule & $\alpha_{+}$ Begins High & 5.56 & & Triage+ & Schedule & $\alpha_{+}$ Begins High & 9.74 \\
    Triage+ & Fixed $\alpha_{+}$ & & 4.6 & & Triage++ & Reactive & $\alpha_{++}$ Begins Low & 9.14 \\
    Triage+ & Reactive & $\alpha_{+}$ Begins High & 1.3 & & Triage+ & Reactive & $\alpha_{+}$ Begins High & 2.38 \\
    \cmidrule[\heavyrulewidth]{1-4} \cmidrule[\heavyrulewidth]{6-9}
  \end{tabular}
\end{table}

\end{document} 

在此处输入图片描述

相关内容