我有以下代码。当我编译它时,最后两列太宽了。我尝试过 \makebox 并设置列宽,但这些都不起作用。可能是我使用的多列吗?下面是我现在得到的结果。我希望设置宽度相等的列并适合页面。你能帮我解决这个问题吗?非常感谢!
\begin{table}
\begin{adjustbox}{width=\textwidth}
\begin{tabular}{l*{6}{S[table-format=5.4,table-number-alignment=center]}}
\multicolumn{6}{c}{\textbf{TABLE 3}} \\
\multicolumn{6}{c}{\textit{Results of Regressions of CAR on Earnings Surprise Scaled by Price (ES) by Dispersion of Analyst Forecasts (DS) Grouping (ES = 0 observations included)}} \\
\multicolumn{6}{c}{$CAR=\beta\textsubscript{0}+\beta\textsubscript{1}ES+\varepsilon$}\\
\hline\hline
& & & & \multicolumn{2}{c}{Pred.Interval} \\
\cline{5-6}
±Range of & & & & \multicolumn{1}{c}{ES \textless\space 0} & \multicolumn{1}{c}{ES \textgreater\space 0} \\
ES & \textit{n} & $\beta$\textsubscript{0} & $\beta$\textsubscript{1} & UPI\textsubscript{.667} & LPI\textsubscript{.667} \\
\hline
Unrestricted & 14635 & 0.0114 & 0.0000 & 0.1678 & -0.0001 \\
.02 & 10010 & 0.0123 & 2.4056*** & 0.1371 & 0.0135 \\
\end{tabular}
\end{adjustbox}
\end{table}
答案1
避免缩放表格\begin{adjustbox}{width=\textwidth}
会产生不一致的字体大小。
删除multicolumn{6}
表格使用前的 and\caption{Results of Regres...}
答案2
一些建议,无特定顺序。
了解如何使用该
\caption
命令,以及如何使用该caption
包应用高级格式指令来影响字幕的外观。不要使用
adjustbox
(或者,就此而言,\scalebox
),除非您真的非常想生成字体大小极不一致(并且通常难以辨认)的表格。请花时间至少学习 TeX 数学模式和符号的基础知识。因此,请学习
\beta\textsubscript{0}+\beta\textsubscript{1}
可以更简洁地写成\beta_0+\beta_1
。请花一些时间来学习如何使用包装
S
的柱型机械siunitx
。考虑用宏替换
\hline
和提供的包:,,,和\cline
booktabs
\toprule
\midrule
\bottomrule
\cmidrule
所有这些想法都在下面的测试文档中实现。
\documentclass{article}
\usepackage{siunitx, % for S column type
caption, % advanced formatting of table and figure captions
booktabs} % for well-spaced horizontal rules
\newcommand\vn[1]{\mathrm{#1}} % variable names in math mode
\begin{document}
\addtocounter{table}{2} % just for this example
\begin{table}
\centering
%% Formatting instructions for caption:
\captionsetup{labelfont = bf,
textfont = it,
labelsep = newline,
justification = centering}
\caption{Results of regressions of $\vn{CAR}$ on earnings surprise
scaled by price $(\vn{ES})$ by dispersion of analyst forecasts
$(\vn{DS})$ Grouping. $\vn{ES} = 0$ observations included.}
\begin{tabular}{@{} l
S[table-format= 5.0,group-separator={,}]
S[table-format= 1.4]
S[table-format= 1.4{***}]
S[table-format= 1.4]
S[table-format=-1.4]
@{}}
\multicolumn{6}{c}{$\vn{CAR} = \beta_0 + \beta_1 \vn{ES} + \varepsilon$}\\
\toprule
& & & & \multicolumn{2}{c@{}}{Pred.\ Interval} \\
\cmidrule(l){5-6}
±Range of & & & & {$\vn{ES}<0$} & {$\vn{ES}>0$} \\
ES & {$n$} & {$\beta_0$} & {$\beta_1$} & {$\vn{UPI}_{0.667}$} & {$\vn{LPI}_{0.667}$} \\
\midrule
Unrestricted & 14635 & 0.0114 & 0.0000 & 0.1678 & -0.0001 \\
0.02 & 10010 & 0.0123 & 2.4056*** & 0.1371 & 0.0135 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}