横向(sidewaystable)表格的行距太紧

横向(sidewaystable)表格的行距太紧

我将这张大表格插入到主要为纵向的文档中,行距为单倍。但是,表格中的行距似乎太紧了。请提供任何改进建议。

\documentclass[12pt]{article}
\usepackage[margin=1in]{geometry}
\renewcommand{\baselinestretch}{1}
\setlength{\parskip}{1em}
\usepackage[flushleft]{threeparttable}
\usepackage{rotating}
\usepackage{siunitx}
\usepackage{booktabs}
\usepackage{multicol}
\usepackage{blindtext}  

\begin{document}
\blindtext 
\clearpage
\thispagestyle{empty}
\begin{sidewaystable}
\centering
\caption{My caption} \label{tab1}
\sisetup{
input-symbols = (),
table-space-text-post = ***,
table-align-text-post = false,
group-digits = false} 
\renewcommand{\arraystretch}{0}
\setlength\tabcolsep{0pt} % default value: 6pt
\small
\begin{tabular*}{\textwidth}{lSSSSSSSSS}  \hline
  &  \multicolumn{3}{c}{2012--1972} & \multicolumn{3}{c}{2012--1987} & \multicolumn{3}{c}{2012--1996}  \\
 \cmidrule(l){2-4} \cmidrule(l){5-7} \cmidrule(l){8-10}
  &  \multicolumn{1}{c}{3-year} & \multicolumn{1}{c}{4-year} & \multicolumn{1}{c}{5-year} 
 &  \multicolumn{1}{c}{3-year} & \multicolumn{1}{c}{4-year} & \multicolumn{1}{c}{5-year} 
 &  \multicolumn{1}{c}{3-year} & \multicolumn{1}{c}{4-year} & \multicolumn{1}{c}{5-year} \\  
 &  \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}{(9)} \\  \hline
\multicolumn{10}{l}{Full sample}  \\
var1 & -0.043 & -0.021 & -0.164 & 0.168** & 0.194** & 0.015 & 0.248*** & 0.237*** & 0.024 \\
 & (0.073) & (0.083) & (0.105) & (0.067) & (0.082) & (0.105) & (0.077) & (0.087) & (0.096) \\
var2 & -0.034 & -0.024 & 0.021 & -0.047 & -0.037 & 0.018 & -0.012 & -0.035 & -0.025 \\
 & (0.042) & (0.040) & (0.046) & (0.043) & (0.045) & (0.045) & (0.044) & (0.046) & (0.045) \\
var3 & 0.047 & 0.067 & 0.023 & -0.009 & 0.012 & -0.026 & -0.069* & -0.041 & -0.121*** \\
 & (0.042) & (0.041) & (0.044) & (0.042) & (0.043) & (0.046) & (0.038) & (0.041) & (0.045) \\
var4 & 0.140*** & 0.133*** & 0.129*** & 0.071** & 0.065* & 0.064* & 0.054* & 0.043 & 0.037 \\
 & (0.032) & (0.033) & (0.035) & (0.032) & (0.034) & (0.036) & (0.032) & (0.034) & (0.037) \\
var5 & 0.337*** & 0.397*** & 0.354*** & 0.183*** & 0.220*** & 0.193*** & 0.079 & 0.060 & 0.036 \\
 & (0.051) & (0.051) & (0.051) & (0.056) & (0.059) & (0.059) & (0.114) & (0.125) & (0.120) \\
var6 & 0.455*** & 0.531*** & 0.443*** & 0.213*** & 0.276*** & 0.212*** & 0.083 & 0.176*** & 0.070 \\
 & (0.049) & (0.054) & (0.053) & (0.049) & (0.055) & (0.056) & (0.055) & (0.061) & (0.061) \\
var7 & 0.459*** & 0.487*** & 0.452*** & 0.228*** & 0.234*** & 0.228*** & 0.132* & 0.139* & 0.116 \\
 & (0.063) & (0.066) & (0.065) & (0.063) & (0.069) & (0.068) & (0.068) & (0.072) & (0.073) \\
N &  \multicolumn{1}{c}{308,082} & \multicolumn{1}{c}{235,540} & \multicolumn{1}{c}{190,320} 
 & \multicolumn{1}{c}{221,421} &  \multicolumn{1}{c}{169,576} & \multicolumn{1}{c}{140,797} 
 & \multicolumn{1}{c}{157,421} & \multicolumn{1}{c}{127,818} &  \multicolumn{1}{c}{100,076} \\ \hline
\multicolumn{10}{l}{Sub sample}  \\
var1 & 0.233 & 0.067 & 0.225 & 0.604*** & 0.619*** & 0.725*** & 0.663*** & 0.674*** & 0.807*** \\
 & (0.142) & (0.176) & (0.181) & (0.109) & (0.147) & (0.150) & (0.128) & (0.132) & (0.149) \\
var2 & 0.067 & 0.034 & 0.142 & 0.036 & -0.034 & 0.130* & 0.075 & -0.012 & 0.057 \\
 & (0.065) & (0.061) & (0.087) & (0.066) & (0.061) & (0.071) & (0.064) & (0.051) & (0.066) \\
var3 & 0.109** & 0.118*** & 0.069 & 0.044 & 0.044 & 0.027 & -0.030 & -0.045 & -0.102** \\
 & (0.042) & (0.043) & (0.045) & (0.036) & (0.040) & (0.044) & (0.041) & (0.036) & (0.047) \\
var4 & 0.156*** & 0.147*** & 0.125*** & 0.062* & 0.057 & 0.042 & 0.030 & 0.020 & -0.001 \\
 & (0.037) & (0.036) & (0.036) & (0.035) & (0.036) & (0.037) & (0.037) & (0.035) & (0.038) \\
var5 & 0.420*** & 0.465*** & 0.427*** & 0.267*** & 0.307*** & 0.253*** & 0.586*** & 0.943*** & 0.786*** \\
 & (0.061) & (0.057) & (0.056) & (0.060) & (0.063) & (0.062) & (0.125) & (0.136) & (0.131) \\
var6 & 0.386*** & 0.462*** & 0.380*** & 0.193*** & 0.279*** & 0.180*** & -0.028 & 0.079 & -0.053 \\
 & (0.058) & (0.061) & (0.059) & (0.055) & (0.060) & (0.058) & (0.061) & (0.065) & (0.063) \\
var7 & 0.358*** & 0.403*** & 0.379*** & 0.199*** & 0.249*** & 0.203*** & -0.018 & 0.025 & -0.026 \\
 & (0.073) & (0.073) & (0.072) & (0.068) & (0.073) & (0.072) & (0.076) & (0.075) & (0.079) \\
 N &  \multicolumn{1}{c}{76,845} & \multicolumn{1}{c}{59,921} & \multicolumn{1}{c}{49,225} 
 & \multicolumn{1}{c}{55,100} &  \multicolumn{1}{c}{42,574} & \multicolumn{1}{c}{36,258} 
 & \multicolumn{1}{c}{39,969} & \multicolumn{1}{c}{32,768} &  \multicolumn{1}{c}{26,467} \\ \hline
\multicolumn{10}{l}{Note: Robust standard errors in parentheses; *** p$<$0.01, ** p$<$0.05, * p$<$0.1 } \\
\end{tabular*}
\end{sidewaystable}
\end{document}

答案1

该指令\renewcommand{\arraystretch}{0}是表格中行距非常紧的原因。即使您用包中合适的替代方案\renewcommand{\arraystretch}{0.83}替换所有指令,运行也应该足够了。\hlinebooktabs

我还会将 添加table-format=-1.3到参数列表中\sisetup

在此处输入图片描述

\documentclass[12pt]{article}
\usepackage[margin=1in,letterpaper]{geometry}
\usepackage{rotating,siunitx,booktabs}

\begin{document}
\begin{sidewaystable}
\caption{My caption\strut} \label{tab1}
\sisetup{%
    table-format=-1.3,  % <-- new
    input-symbols = (),
    table-space-text-post = ***,
    table-align-text-post = false,
    group-digits = false} 
\renewcommand{\arraystretch}{0.83}
\setlength\tabcolsep{0pt} % default value: 6pt
\small
\begin{tabular*}{\textwidth}{l @{\extracolsep{\fill}} *{9}{S} }  
\toprule
  & \multicolumn{3}{c}{1972--2012} 
  & \multicolumn{3}{c}{1987--2012} 
  & \multicolumn{3}{c}{1996--2012}  \\
 \cmidrule{2-4} \cmidrule{5-7} \cmidrule{8-10}
  & {3-year} & {4-year} & {5-year} 
  & {3-year} & {4-year} & {5-year} 
  & {3-year} & {4-year} & {5-year} \\
  & {(1)} & {(2)} & {(3)} & {(1)} & {(2)} & {(3)} & {(1)} & {(2)} & {(3)} \\
\midrule
\multicolumn{10}{l}{Full sample}  \\
var1 & -0.043 & -0.021 & -0.164 & 0.168** & 0.194** & 0.015 & 0.248*** & 0.237*** & 0.024 \\
     & (0.073) & (0.083) & (0.105) & (0.067) & (0.082) & (0.105) & (0.077) & (0.087) & (0.096) \\
var2 & -0.034 & -0.024 & 0.021 & -0.047 & -0.037 & 0.018 & -0.012 & -0.035 & -0.025 \\
     & (0.042) & (0.040) & (0.046) & (0.043) & (0.045) & (0.045) & (0.044) & (0.046) & (0.045) \\
var3 & 0.047 & 0.067 & 0.023 & -0.009 & 0.012 & -0.026 & -0.069* & -0.041 & -0.121*** \\
     & (0.042) & (0.041) & (0.044) & (0.042) & (0.043) & (0.046) & (0.038) & (0.041) & (0.045) \\
var4 & 0.140*** & 0.133*** & 0.129*** & 0.071** & 0.065* & 0.064* & 0.054* & 0.043 & 0.037 \\
     & (0.032) & (0.033) & (0.035) & (0.032) & (0.034) & (0.036) & (0.032) & (0.034) & (0.037) \\
var5 & 0.337*** & 0.397*** & 0.354*** & 0.183*** & 0.220*** & 0.193*** & 0.079 & 0.060 & 0.036 \\
     & (0.051) & (0.051) & (0.051) & (0.056) & (0.059) & (0.059) & (0.114) & (0.125) & (0.120) \\
var6 & 0.455*** & 0.531*** & 0.443*** & 0.213*** & 0.276*** & 0.212*** & 0.083 & 0.176*** & 0.070 \\
     & (0.049) & (0.054) & (0.053) & (0.049) & (0.055) & (0.056) & (0.055) & (0.061) & (0.061) \\
var7 & 0.459*** & 0.487*** & 0.452*** & 0.228*** & 0.234*** & 0.228*** & 0.132* & 0.139* & 0.116 \\
     & (0.063) & (0.066) & (0.065) & (0.063) & (0.069) & (0.068) & (0.068) & (0.072) & (0.073) \\ 
\addlinespace
$N$  & {308,082} & {235,540} & {190,320} 
     & {221,421} & {169,576} & {140,797} 
     & {157,421} & {127,818} & {100,076} \\ 
\midrule
\multicolumn{10}{l}{Subsample}  \\
var1 & 0.233 & 0.067 & 0.225 & 0.604*** & 0.619*** & 0.725*** & 0.663*** & 0.674*** & 0.807*** \\
     & (0.142) & (0.176) & (0.181) & (0.109) & (0.147) & (0.150) & (0.128) & (0.132) & (0.149) \\
var2 & 0.067 & 0.034 & 0.142 & 0.036 & -0.034 & 0.130* & 0.075 & -0.012 & 0.057 \\
     & (0.065) & (0.061) & (0.087) & (0.066) & (0.061) & (0.071) & (0.064) & (0.051) & (0.066) \\
var3 & 0.109** & 0.118*** & 0.069 & 0.044 & 0.044 & 0.027 & -0.030 & -0.045 & -0.102** \\
     & (0.042) & (0.043) & (0.045) & (0.036) & (0.040) & (0.044) & (0.041) & (0.036) & (0.047) \\
var4 & 0.156*** & 0.147*** & 0.125*** & 0.062* & 0.057 & 0.042 & 0.030 & 0.020 & -0.001 \\
     & (0.037) & (0.036) & (0.036) & (0.035) & (0.036) & (0.037) & (0.037) & (0.035) & (0.038) \\
var5 & 0.420*** & 0.465*** & 0.427*** & 0.267*** & 0.307*** & 0.253*** & 0.586*** & 0.943*** & 0.786*** \\
     & (0.061) & (0.057) & (0.056) & (0.060) & (0.063) & (0.062) & (0.125) & (0.136) & (0.131) \\
var6 & 0.386*** & 0.462*** & 0.380*** & 0.193*** & 0.279*** & 0.180*** & -0.028 & 0.079 & -0.053 \\
     & (0.058) & (0.061) & (0.059) & (0.055) & (0.060) & (0.058) & (0.061) & (0.065) & (0.063) \\
var7 & 0.358*** & 0.403*** & 0.379*** & 0.199*** & 0.249*** & 0.203*** & -0.018 & 0.025 & -0.026 \\
     & (0.073) & (0.073) & (0.072) & (0.068) & (0.073) & (0.072) & (0.076) & (0.075) & (0.079) \\
\addlinespace
$N$  & {76,845} & {59,921} & {49,225} 
     & {55,100} & {42,574} & {36,258} 
     & {39,969} & {32,768} & {26,467} \\
\bottomrule
\end{tabular*}

\smallskip\footnotesize
Note: Robust standard errors in parentheses; *** $p<0.01$; ** $p<0.05$; * $p<0.1$.
\end{sidewaystable}
\end{document}

相关内容