横向模式下的标题和表格没有 sidewaystable 吗?

横向模式下的标题和表格没有 sidewaystable 吗?

我四处寻找不使用 sidewaystable 的横向模式标题和宽表的示例。我编译的表需要调整大小,因此我使用 \footnotesize。但是,调整大小会导致表移动到新页面。

\documentclass[10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{lscape}
\usepackage{booktabs}

\begin{document}
\begin{landscape}
\section{Introduction}
\begin{table}[ht]
\centering
\footnotesize
\caption{Descriptive Statistics - All Davis Cup Groups}\label{desc_davis_all}
\begin{tabular}{lrrrrr|rrrrr|rrrrr} \toprule
& \multicolumn{5}{c}{Favorite's team Lagging} & \multicolumn{5}{c}{Favorite's team Even} & \multicolumn{5}{c}{Favorite's team Leading}\\
\cmidrule{2-6} \cmidrule{7-11} \cmidrule{12-16}
 & Count & Min & Max & Mean & Stdev & Count & Min & Max & Mean & Stdev & Count & Min & Max & Mean & Stdev \\
\midrule
Total Obs. & 646 & 0 & 0 & 0 & 0 & 1037 & 0 & 0 & 0 & 0 & 764 & 0 & 0 & 0 & 0 \\ 
  Treatment Dummy & 343 & 0 & 1 & 0.531 & 0.499 & 563 & 0 & 1 & 0.543 & 0.498 & 425 & 0 & 1 & 0.556 & 0.497 \\ 
  \\
  \textit{Davis Cup Groups} &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\ 
  World Group & 233 & 0 & 1 & 0.361 & 0.481 & 370 & 0 & 1 & 0.357 & 0.479 & 258 & 0 & 1 & 0.338 & 0.473 \\ 
  Group 1 & 188 & 0 & 1 & 0.291 & 0.455 & 323 & 0 & 1 & 0.311 & 0.463 & 241 & 0 & 1 & 0.315 & 0.465 \\ 
  Group 2 & 225 & 0 & 1 & 0.348 & 0.477 & 344 & 0 & 1 & 0.332 & 0.471 & 265 & 0 & 1 & 0.347 & 0.476 \\ 
  \\
  \textit{Tournament Rounds} &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\ 
  Round of 16 & 80 & 0 & 1 & 0.124 & 0.33 & 126 & 0 & 1 & 0.122 & 0.327 & 84 & 0 & 1 & 0.11 & 0.313 \\ 
  Quarter Finals & 131 & 0 & 1 & 0.203 & 0.402 & 209 & 0 & 1 & 0.202 & 0.401 & 157 & 0 & 1 & 0.205 & 0.404 \\ 
  Semi Finals & 149 & 0 & 1 & 0.231 & 0.422 & 232 & 0 & 1 & 0.224 & 0.417 & 160 & 0 & 1 & 0.209 & 0.407 \\ 
  Finals & 100 & 0 & 1 & 0.155 & 0.362 & 186 & 0 & 1 & 0.179 & 0.384 & 150 & 0 & 1 & 0.196 & 0.397 \\ 
  Playoffs & 149 & 0 & 1 & 0.231 & 0.422 & 230 & 0 & 1 & 0.222 & 0.416 & 180 & 0 & 1 & 0.236 & 0.425 \\ 
  Playoffs - Round 2 & 37 & 0 & 1 & 0.057 & 0.233 & 54 & 0 & 1 & 0.052 & 0.222 & 33 & 0 & 1 & 0.043 & 0.203 \\ 
  \\
  \textit{Favorite \& Underdog} &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\ 
  Favorite wins & 440 & 0 & 1 & 0.681 & 0.466 & 768 & 0 & 1 & 0.741 & 0.439 & 615 & 0 & 1 & 0.805 & 0.396 \\ 
  Favorite Log Rank & 3964.02 & 0 & 10.576 & 6.136 & 2.259 & 6680.796 & 0 & 10.727 & 6.442 & 2.14 & 4639.54 & 0 & 10.886 & 6.073 & 2.315 \\ 
  Favorite Head 2 Head & 428 & 0 & 17 & 0.663 & 1.413 & 515 & 0 & 9 & 0.497 & 1.024 & 489 & 0 & 12 & 0.64 & 1.306 \\ 
  Favorite Home Adv. & 282 & 0 & 1 & 0.437 & 0.496 & 530 & 0 & 1 & 0.511 & 0.5 & 451 & 0 & 1 & 0.59 & 0.492 \\ 
  Underdog Log Rank & 4959.01 & 2.322 & 10.937 & 7.676 & 1.845 & 8430.42 & 3.17 & 11.037 & 8.13 & 1.621 & 6050.523 & 1.585 & 10.979 & 7.92 & 1.806 \\ 
  Underdog Head 2 Head & 296 & 0 & 8 & 0.458 & 0.995 & 364 & 0 & 6 & 0.351 & 0.817 & 258 & 0 & 5 & 0.338 & 0.77 \\ 
  Underdog Home Adv. & 364 & 0 & 1 & 0.563 & 0.496 & 507 & 0 & 1 & 0.489 & 0.5 & 313 & 0 & 1 & 0.41 & 0.492 \\ 
  Head 2 head diff & 132 & -7 & 12 & 0.204 & 1.286 & 151 & -5 & 8 & 0.146 & 0.993 & 231 & -4 & 10 & 0.302 & 1.128 \\ 
  Log rank diff & -994.99 & -6.977 & 0 & -1.54 & 1.308 & -1749.624 & -8.033 & 0 & -1.687 & 1.427 & -1410.984 & -8.836 & 0 & -1.847 & 1.476 \\ 
\bottomrule
\end{tabular}
\end{table}
\end{landscape}
\end{document}

当我运行一个小表时,我得到了预期的效果:

\documentclass[10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{lscape}
\usepackage{booktabs}

\begin{document}
\begin{landscape}
\section{Introduction}
\begin{table}[ht]
\centering
\footnotesize
\caption{Descriptive Statistics - All Davis Cup Groups}\label{desc_davis_all}
\begin{tabular}{lrrrrr|rrrrr|rrrrr} \toprule
& \multicolumn{5}{c}{Favorite's team Lagging} & \multicolumn{5}{c}{Favorite's team Even} & \multicolumn{5}{c}{Favorite's team Leading}\\
\cmidrule{2-6} \cmidrule{7-11} \cmidrule{12-16}
 & Count & Min & Max & Mean & Stdev & Count & Min & Max & Mean & Stdev & Count & Min & Max & Mean & Stdev \\
\midrule
Total Obs. & 646 & 0 & 0 & 0 & 0 & 1037 & 0 & 0 & 0 & 0 & 764 & 0 & 0 & 0 & 0 \\ 
  Treatment Dummy & 343 & 0 & 1 & 0.531 & 0.499 & 563 & 0 & 1 & 0.543 & 0.498 & 425 & 0 & 1 & 0.556 & 0.497 \\ 
  \\
  \textit{Davis Cup Groups} &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\ 
  World Group & 233 & 0 & 1 & 0.361 & 0.481 & 370 & 0 & 1 & 0.357 & 0.479 & 258 & 0 & 1 & 0.338 & 0.473 \\ 
  Group 1 & 188 & 0 & 1 & 0.291 & 0.455 & 323 & 0 & 1 & 0.311 & 0.463 & 241 & 0 & 1 & 0.315 & 0.465 \\ 
  Group 2 & 225 & 0 & 1 & 0.348 & 0.477 & 344 & 0 & 1 & 0.332 & 0.471 & 265 & 0 & 1 & 0.347 & 0.476 \\ 
\bottomrule
\end{tabular}
\end{table}
\end{landscape}
\end{document}

有什么建议可以解决这个问题吗?我更希望标题和表格采用相同的横向方向

答案1

这是一个(部分)解决方案,使用\tabcolsep。我删除了丑陋的垂直规则,使用 选项将组与较短的\cmidrules分开(l)。然而,仍然有一个过满的 \hbox,您可以通过更改文档中的垂直边距来删除它。

\documentclass[10pt]{article}%
\usepackage[utf8]{inputenc}
\usepackage[showframe]{geometry}
\usepackage{amsmath}
\usepackage{lscape}
\usepackage{array, booktabs, caption}

\begin{document}

\begin{landscape}
\section{Introduction}
\begin{table}[ht]
\centering\setlength{\tabcolsep}{3pt}
\setlength\cmidrulekern{1em}
\renewcommand\arraystretch{1.12}
\footnotesize
\caption{Descriptive Statistics - All Davis Cup Groups}\label{desc_davis_all}
\begin{tabular}{l*{15} {>{$}r<{$}}} \toprule
& \multicolumn{5}{c}{Favorite's team Lagging} & \multicolumn{5}{c}{Favorite's team Even} & \multicolumn{5}{c}{Favorite's team Leading}\\
\cmidrule(l{0.25em}){2-6} \cmidrule(l){7-11} \cmidrule(l){12-16}
 & \text{Count} & \text{Min} & \text{Max} & \text{Mean} & \text{Stdev} & \text{Count} & \text{Min} & \text{Max} & \text{Mean} & \text{Stdev} & \text{Count} & \text{Min} & \text{Max} & \text{Mean} & \text{Stdev}\\
\midrule
Total Obs. & 646 & 0 & 0 & 0 & 0 & 1037 & 0 & 0 & 0 & 0 & 764 & 0 & 0 & 0 & 0 \\
  Treatment Dummy & 343 & 0 & 1 & 0.531 & 0.499 & 563 & 0 & 1 & 0.543 & 0.498 & 425 & 0 & 1 & 0.556 & 0.497 \\
\addlinespace
   \textit{Davis Cup Groups} & & & & & & & & & & & & & & & \\
  World Group & 233 & 0 & 1 & 0.361 & 0.481 & 370 & 0 & 1 & 0.357 & 0.479 & 258 & 0 & 1 & 0.338 & 0.473 \\
  Group 1 & 188 & 0 & 1 & 0.291 & 0.455 & 323 & 0 & 1 & 0.311 & 0.463 & 241 & 0 & 1 & 0.315 & 0.465 \\
  Group 2 & 225 & 0 & 1 & 0.348 & 0.477 & 344 & 0 & 1 & 0.332 & 0.471 & 265 & 0 & 1 & 0.347 & 0.476 \\
\addlinespace
  \textit{Tournament Rounds} & & & & & & & & & & & & & & & \\
  Round of 16 & 80 & 0 & 1 & 0.124 & 0.33 & 126 & 0 & 1 & 0.122 & 0.327 & 84 & 0 & 1 & 0.11 & 0.313 \\
  Quarter Finals & 131 & 0 & 1 & 0.203 & 0.402 & 209 & 0 & 1 & 0.202 & 0.401 & 157 & 0 & 1 & 0.205 & 0.404 \\
  Semi Finals & 149 & 0 & 1 & 0.231 & 0.422 & 232 & 0 & 1 & 0.224 & 0.417 & 160 & 0 & 1 & 0.209 & 0.407 \\
  Finals & 100 & 0 & 1 & 0.155 & 0.362 & 186 & 0 & 1 & 0.179 & 0.384 & 150 & 0 & 1 & 0.196 & 0.397 \\
  Playoffs & 149 & 0 & 1 & 0.231 & 0.422 & 230 & 0 & 1 & 0.222 & 0.416 & 180 & 0 & 1 & 0.236 & 0.425 \\
  Playoffs - Round 2 & 37 & 0 & 1 & 0.057 & 0.233 & 54 & 0 & 1 & 0.052 & 0.222 & 33 & 0 & 1 & 0.043 & 0.203 \\
\addlinespace
  \textit{Favorite \& Underdog} & & & & & & & & & & & & & & & \\
  Favorite wins & 440 & 0 & 1 & 0.681 & 0.466 & 768 & 0 & 1 & 0.741 & 0.439 & 615 & 0 & 1 & 0.805 & 0.396 \\
  Favorite Log Rank & 3964.02 & 0 & 10.576 & 6.136 & 2.259 & 6680.796 & 0 & 10.727 & 6.442 & 2.14 & 4639.54 & 0 & 10.886 & 6.073 & 2.315 \\
  Favorite Head 2 Head & 428 & 0 & 17 & 0.663 & 1.413 & 515 & 0 & 9 & 0.497 & 1.024 & 489 & 0 & 12 & 0.64 & 1.306 \\
  Favorite Home Adv. & 282 & 0 & 1 & 0.437 & 0.496 & 530 & 0 & 1 & 0.511 & 0.5 & 451 & 0 & 1 & 0.59 & 0.492 \\
\addlinespace
  Underdog Log Rank & 4959.01 & 2.322 & 10.937 & 7.676 & 1.845 & 8430.42 & 3.17 & 11.037 & 8.13 & 1.621 & 6050.523 & 1.585 & 10.979 & 7.92 & 1.806 \\
  Underdog Head 2 Head & 296 & 0 & 8 & 0.458 & 0.995 & 364 & 0 & 6 & 0.351 & 0.817 & 258 & 0 & 5 & 0.338 & 0.77 \\
  Underdog Home Adv. & 364 & 0 & 1 & 0.563 & 0.496 & 507 & 0 & 1 & 0.489 & 0.5 & 313 & 0 & 1 & 0.41 & 0.492 \\
\addlinespace
  Head 2 head diff & 132 & -7 & 12 & 0.204 & 1.286 & 151 & -5 & 8 & 0.146 & 0.993 & 231 & -4 & 10 & 0.302 & 1.128 \\
  Log rank diff & -994.99 & -6.977 & 0 & -1.54 & 1.308 & -1749.624 & -8.033 & 0 & -1.687 & 1.427 & -1410.984 & -8.836 & 0 & -1.847 & 1.476 \\
\bottomrule
\end{tabular}
\end{table}
\end{landscape}

\end{document} 

在此处输入图片描述

相关内容