我正在尝试缩短这张表
但没有任何成功。这个表对于页面来说太大了。它应该包含 8 列而不是 6 列。我通过 Stata 软件编写了代码。供您参考,这是相关代码。
\begin{table}[htbp]\centering
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\caption{Individual Effort}
\begin{tabular}{l*{8}{c}}
\hline\hline
&\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}&\multicolumn{1}{c}{(3)}&\multicolumn{1}{c}{(4)}&\multicolumn{1}{c}{(5)}&\multicolumn{1}{c}{(6)}&\multicolumn{1}{c}{(7)}&\multicolumn{1}{c}{(8)}\\
&\multicolumn{1}{c}{Model 1}&\multicolumn{1}{c}{Model 2}&\multicolumn{1}{c}{Model 3}&\multicolumn{1}{c}{Model 4}&\multicolumn{1}{c}{Model 5}&\multicolumn{1}{c}{Model 6}&\multicolumn{1}{c}{Model 7}&\multicolumn{1}{c}{Model 8}\\
\hline
Future & -0.00346\sym{***}& -0.0139\sym{***}& -0.00426\sym{***}& -0.0133\sym{***}& & -0.00705\sym{***}& -0.0102\sym{***}& -0.0102\sym{***}\\
& (-3.69) & (-12.67) & (-4.55) & (-12.13) & & (-7.37) & (-8.61) & (-8.61) \\
[1em]
Favourite's previous games& 0.0129\sym{**} & 0.0235\sym{***}& 0.0148\sym{***}& 0.0234\sym{***}& & 0.0212\sym{***}& 0.0237\sym{***}& 0.0237\sym{***}\\
& (3.02) & (5.45) & (3.47) & (5.46) & & (4.85) & (5.39) & (5.39) \\
[1em]
Underdog's previous games& -0.0121\sym{*} & -0.0177\sym{***}& -0.0142\sym{**} & -0.0186\sym{***}& & -0.0219\sym{***}& -0.0230\sym{***}& -0.0230\sym{***}\\
& (-2.37) & (-3.47) & (-2.79) & (-3.66) & & (-4.44) & (-4.67) & (-4.67) \\
[1em]
Heterogeneity& -0.00639\sym{***}& -0.00525\sym{***}& -0.00616\sym{***}& -0.00520\sym{***}& -0.00522\sym{***}& -0.00463\sym{***}& -0.00439\sym{***}& -0.00439\sym{***}\\
& (-32.66) & (-25.65) & (-30.74) & (-24.88) & (-15.42) & (-14.04) & (-13.40) & (-13.40) \\
[1em]
Spread & 0.0000402 & -0.00157 & -0.00109 & -0.00203 & -0.00107 & -0.00376 & -0.00364 & -0.00364 \\
& (0.03) & (-1.02) & (-0.70) & (-1.32) & (-1.43) & (-1.81) & (-1.78) & (-1.78) \\
\_cons & 11.33\sym{***}& 12.52\sym{***}& 9.548\sym{*} & 10.41\sym{*} & 11.35\sym{***}& 11.77\sym{***}& 12.14\sym{***}& 12.14\sym{***}\\
& (52.05) & (55.29) & (2.05) & (2.24) & (67.09) & (64.19) & (63.73) & (63.73) \\
\hline
\(N\) & 36194 & 36194 & 36194 & 36194 & 37060 & 36194 & 36194 & 36194 \\
\hline\hline
\multicolumn{9}{l}{\footnotesize \textit{t} statistics in parentheses}\\
\multicolumn{9}{l}{\footnotesize \sym{*} \(p<0.05\), \sym{**} \(p<0.01\), \sym{***} \(p<0.001\)}\\
\end{tabular}
\end{table}
这是 Overleaf 上的主要代码:
\documentclass{article}
\usepackage[utf8]{inputenc}
\title{project1}
\author{sadas}
\date{January 2023}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{graphics}
\usepackage{subcaption}
\usepackage{mwe}
\begin{document}
\input{table3a.tex}
\end{document}
答案1
为了正常适合,您必须将其缩小到难以辨认的程度。另一方面,旋转后它非常适合。
\documentclass{article}
\usepackage[utf8]{inputenc}
\title{project1}
\author{sadas}
\date{January 2023}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{subcaption}
\usepackage{showframe}% MWE only
\begin{document}
\begin{table}[p]
\rotatebox{90}{\begin{minipage}[c][\textwidth][c]{\textheight}
\centering
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\caption{Individual Effort}
\begin{tabular}{p{5em}l*{7}{c}}
\hline\hline
&\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}&\multicolumn{1}{c}{(3)}&\multicolumn{1}{c}{(4)}&\multicolumn{1}{c}{(5)}&\multicolumn{1}{c}{(6)}&\multicolumn{1}{c}{(7)}&\multicolumn{1}{c}{(8)}\\
&\multicolumn{1}{c}{Model 1}&\multicolumn{1}{c}{Model 2}&\multicolumn{1}{c}{Model 3}&\multicolumn{1}{c}{Model 4}&\multicolumn{1}{c}{Model 5}&\multicolumn{1}{c}{Model 6}&\multicolumn{1}{c}{Model 7}&\multicolumn{1}{c}{Model 8}\\
\hline
Future & -0.00346\sym{***}& -0.0139\sym{***}& -0.00426\sym{***}& -0.0133\sym{***}& & -0.00705\sym{***}& -0.0102\sym{***}& -0.0102\sym{***}\\
& (-3.69) & (-12.67) & (-4.55) & (-12.13) & & (-7.37) & (-8.61) & (-8.61) \\
[1em]
Favourite's previous games& 0.0129\sym{**} & 0.0235\sym{***}& 0.0148\sym{***}& 0.0234\sym{***}& & 0.0212\sym{***}& 0.0237\sym{***}& 0.0237\sym{***}\\
& (3.02) & (5.45) & (3.47) & (5.46) & & (4.85) & (5.39) & (5.39) \\
[1em]
Underdog's previous games& -0.0121\sym{*} & -0.0177\sym{***}& -0.0142\sym{**} & -0.0186\sym{***}& & -0.0219\sym{***}& -0.0230\sym{***}& -0.0230\sym{***}\\
& (-2.37) & (-3.47) & (-2.79) & (-3.66) & & (-4.44) & (-4.67) & (-4.67) \\
[1em]
Hetero-geneity& -0.00639\sym{***}& -0.00525\sym{***}& -0.00616\sym{***}& -0.00520\sym{***}& -0.00522\sym{***}& -0.00463\sym{***}& -0.00439\sym{***}& -0.00439\sym{***}\\
& (-32.66) & (-25.65) & (-30.74) & (-24.88) & (-15.42) & (-14.04) & (-13.40) & (-13.40) \\
[1em]
Spread & 0.0000402 & -0.00157 & -0.00109 & -0.00203 & -0.00107 & -0.00376 & -0.00364 & -0.00364 \\
& (0.03) & (-1.02) & (-0.70) & (-1.32) & (-1.43) & (-1.81) & (-1.78) & (-1.78) \\
\_cons & 11.33\sym{***}& 12.52\sym{***}& 9.548\sym{*} & 10.41\sym{*} & 11.35\sym{***}& 11.77\sym{***}& 12.14\sym{***}& 12.14\sym{***}\\
& (52.05) & (55.29) & (2.05) & (2.24) & (67.09) & (64.19) & (63.73) & (63.73) \\
\hline
\(N\) & 36194 & 36194 & 36194 & 36194 & 37060 & 36194 & 36194 & 36194 \\
\hline\hline
\multicolumn{9}{l}{\footnotesize \textit{t} statistics in parentheses}\\
\multicolumn{9}{l}{\footnotesize \sym{*} \(p<0.05\), \sym{**} \(p<0.01\), \sym{***} \(p<0.001\)}\\
\end{tabular}
\end{minipage}}
\end{table}
\end{document}
答案2
好的,我可以将其缩小到仅 50pt 宽。再多就需要进行深度手术了。我删除了很多垃圾,并用匕首和双匕首替换了多个星号,它们占用的空间要小得多,而且在脚注中更常见。我缩小了第一列并使其多行。我将数字列右对齐,以便数字看起来更好,并将脚注符号移动到每个数字旁边的单独列,并删除它们之间的空格。这表明您的真正问题是 Spread、Heterogeneity 和 Future 的数值对于纵向表格来说太长了,可能应该在横向完成。或者 (1) 缩小边距,使文本宽度变宽。默认的 LaTeX 类不适用于出版用途:它们只是草稿模式;或者 (2) 使用科学记数法(10 的幂),看看这是否会减小宽度。除了最琐碎的数据之外,软件生成的任何表格几乎总是错误的。
\documentclass{article}
\usepackage{array,ragged2e,multirow}
\begin{document}
\title{project1}
\author{sadas}
\newcommand{\p}[1]{\rlap{ #1}}
\newcommand{\vstrut}{\vrule height1.2em width0pt}
\date{January 2023}
\maketitle
\begin{table}[htbp]
\centering
\caption{Individual Effort}
\medskip\small
\tabcolsep1pt
\begin{tabular}{@{}>{\vstrut\RaggedRight}m{1.5cm}*{8}{>{\(}r<{\)}@{}l}@{}}
\hline\hline
&\multicolumn{1}{c}{(1)}&&\multicolumn{1}{c}{(2)}
&&\multicolumn{1}{c}{(3)}&&\multicolumn{1}{c}{(4)}
&&\multicolumn{1}{c}{(5)}&&\multicolumn{1}{c}{(6)}
&&\multicolumn{1}{c}{(7)}&&\multicolumn{1}{c}{(8)}&\\
&\mbox{Model 1}&&\mbox{Model 2}&&\mbox{Model 3}&&\mbox{Model 4}
&&\mbox{Model 5}&&\mbox{Model 6}&&\mbox{Model 7}&&\mbox{Model 8}&\\
\hline
\multirow{2}{=}{Future}
& -0.00346&\ddag
& -0.0139&\ddag
& -0.00426&\ddag
& -0.0133&\ddag
& &
& -0.00705&\ddag
& -0.0102&\ddag
& -0.0102&\ddag
\\
& (-3.69&)
& (-12.67&)
& (-4.55&)
& (-12.13&)
& &
& (-7.37&)
& (-8.61&)
& (-8.61&)
\\[1em]
\multirow{2}{=}[.5\baselineskip]{Favourite's previous games}
& 0.0129&\dag
& 0.0235&\ddag
& 0.0148&\ddag
& 0.0234&\ddag
& &
& 0.0212&\ddag
& 0.0237&\ddag
& 0.0237&\ddag
\\
& (3.02&) & (5.45&) & (3.47&) & (5.46&) & & & (4.85&) & (5.39&) & (5.39&) \\
[1em]
\multirow{2}{=}[.5\baselineskip]{Underdog's previous games}& -0.0121&* & -0.0177&\ddag& -0.0142&\dag & -0.0186&\ddag& & & -0.0219&\ddag& -0.0230&\ddag& -0.0230&\ddag\\
& (-2.37&) & (-3.47&) & (-2.79&) & (-3.66&) & & & (-4.44&) & (-4.67&) & (-4.67&) \\
[1em]
\multirow{2}{=}{Hetero\-geneity}& -0.00639&\ddag& -0.00525&\ddag& -0.00616&\ddag& -0.00520&\ddag& -0.00522&\ddag& -0.00463&\ddag& -0.00439&\ddag& -0.00439&\ddag\\
& (-32.66&) & (-25.65&) & (-30.74&) & (-24.88&) & (-15.42&) & (-14.04&) & (-13.40&) & (-13.40&) \\
[1em]
\multirow{2}{=}{Spread} & 0.0000402& & -0.00157& & -0.00109& & -0.00203& & -0.00107& & -0.00376& & -0.00364& & -0.00364& \\
& (0.03&) & (-1.02&) & (-0.70&) & (-1.32&) & (-1.43&) & (-1.81&) & (-1.78&) & (-1.78&) \\[1em]
\multirow{2}{=}{\texttt\_cons} & 11.33&\ddag& 12.52&\ddag& 9.548&* & 10.41&* & 11.35&\ddag& 11.77&\ddag& 12.14&\ddag& 12.14&\ddag\\
& (52.05&) & (55.29&) & (2.05&) & (2.24&) & (67.09&) & (64.19&) & (63.73&) & (63.73&) \\
\hline
\(N\) & 36194 && 36194 && 36194 && 36194 && 37060 && 36194 && 36194 && 36194 & \\
\hline\hline
\end{tabular}
\flushleft
{\footnotesize \textit{t} statistics in parentheses}\\
{\footnotesize * \(p<0.05\),\quad \dag\ \(p<0.01\),\quad \ddag\ \(p<0.001\)}\\
\end{table}
\end{document}
答案3
- 您的表格太宽,即使您使用较小的字体大小(例如
\footnotesize
),也可以适合纵向页面,同时在横向页面中也更美观(数字在小数点对齐)。 - 因此,我会执行以下操作:
- 通过使用
geometry
包增加文本块大小 - 在包
sidewaystable
环境中插入表rotating
- 通过使用包
S
的列siunitx
对齐除最后一行之外的所有数字 - 将第一列的单元格组织成两行单元格
- 对于表,使用包
longtblr
中定义的表tabullaray
- 通过使用
\documentclass{article}
\usepackage{geometry}
\usepackage{rotating}
\usepackage{tabularray}
\UseTblrLibrary{booktabs, siunitx}
\newcommand\TN[1]{\TblrNote{#1}}
\begin{document}
\begin{sidewaystable}
\small
\begin{talltblr}[
caption = {Individual Effort},
label = {tab:statistic},
note{} = {\textit{t} statistics in parentheses\\
\(^{*}\ p<0.05\), \(^{**}\ p<0.01\), \(^{***}\ p<0.001\)}
]{colsep = 1pt,
colspec = {@{} X[l] *{8}{Q[c, si={table-format={(}-2.5{$^{***}$},
input-open-uncertainty =,
input-close-uncertainty=,
table-align-text-after = false,
table-align-text-before = false}]}
@{}},
row{1,2,Z} = {guard, c},
cell{odd[1-X]}{1} = {r=2}{},
row{3-X}= {rowsep=-2pt},
row{odd[3-X]} = {abovesep=1ex},
}
\toprule
& \SetCell[c=8]{c} Model
& & & & & & & \\
\midrule
& 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 \\
\midrule
Future
& -0.00346\TN{***}
& -0.0139\TN{***}
& -0.00426\TN{***}
& -0.0133\TN{***}
& & -0.00705\TN{***}
& -0.0102\TN{***}
& -0.0102\TN{***} \\
& (-3.69)
& (-12.67)
& (-4.55)
& (-12.13)
& & (-7.37)
& (-8.61)
& (-8.61) \\
Favourite's previous games
& 0.0129\TN{**}
& 0.0235\TN{***}
& 0.0148\TN{***}
& 0.0234\TN{***}
& & 0.0212\TN{***}
& 0.0237\TN{***}
& 0.0237\TN{***} \\
& (3.02)
& (5.45)
& (3.47)
& (5.46)
& & (4.85)
& (5.39)
& (5.39) \\
Underdog's previous games
& -0.0121\TN{*}
& -0.0177\TN{***}
& -0.0142\TN{**}
& -0.0186\TN{***}
& & -0.0219\TN{***}
& -0.0230\TN{***}
& -0.0230\TN{***} \\
& (-2.37)
& (-3.47)
& (-2.79)
& (-3.66)
& & (-4.44)
& (-4.67)
& (-4.67) \\
Heterogeneity
& -0.00639\TN{***}
& -0.00525\TN{***}
& -0.00616\TN{***}
& -0.00520\TN{***}
& -0.00522\TN{***}
& -0.00463\TN{***}
& -0.00439\TN{***}
& -0.00439\TN{***} \\
& (-32.66)
& (-25.65)
& (-30.74)
& (-24.88)
& (-15.42)
& (-14.04)
& (-13.40)
& (-13.40) \\
Spread
& 0.00004%02
& -0.00157
& -0.00109
& -0.00203
& -0.00107
& -0.00376
& -0.00364
& -0.00364 \\
& (0.03)
& (-1.02)
& (-0.70)
& (-1.32)
& (-1.43)
& (-1.81)
& (-1.78)
& (-1.78) \\
\_cons
& 11.33\TN{***}
& 12.52\TN{***}
& 9.548\TN{*}
& 10.41\TN{*}
& 11.35\TN{***}
& 11.77\TN{***}
& 12.14\TN{***}
& 12.14\TN{***} \\
& (52.05)
& (55.29)
& (2.05)
& (2.24)
& (67.09)
& (64.19)
& (63.73)
& (63.73) \\
\midrule
\(N\)
& 36194
& 36194
& 36194
& 36194
& 37060
& 36194
& 36194
& 36194 \\
\bottomrule
\end{talltblr}
\end{sidewaystable}
\end{document}
(红线表示页面布局)