关于我之前的问题创建具有多行和多列的表格@zarko 提供的答案不能满足我的要求。我用它作为我的表格的基本形式新代码,但我的努力并没有产生我期望的结果。下面的代码给出:
documentclass[final,1p,times,authoryear]{elsarticle}
\usepackage{booktabs, makecell, tabularx}
\renewcommand\theadfont{\bfseries}
\renewcommand\theadgape{}
\usepackage{siunitx}%
\usepackage{adjustbox}
\begin{document}
\begin{table}[h]
\centering
\caption{Augmented Dickey Fuller and KPSS Test Statistics for (Transformed) Sectoral Indices (y)}
\label{tab:statistics}
%\renewcommand{\arraystretch}{1.2}
%\sisetup{input-symbols={( - )},
%table-space-text-pre={(},
%table-space-text-post ={)},
%}
\begin{adjustbox}{max width=\textwidth}
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}
l
*{2}{S[table-format=-1.3]
@{\hspace{-1.2em}}
S[table-format=1.2]}
}
\toprule
\thead[l]{\\Banking-industry specific variables}
& \multicolumn{2}{c}{\thead{Levin, Lin and\\ Chu (LLC)}}
& \multicolumn{2}{c}{\thead{ADF-Fisher\\ chi-square}} \\
\cmidrule(r){1-1}\cmidrule(r){2-3}\cmidrule{4-5}
Log of Loans-to-Assets &-2.14 & &151.23& \\
&\textit{(0.05)}& &\textit{(0.02)}\\
Log of Credit quality &-0.486 & & 144.11& \\
&\textit{(0.04)}& &\textit{(0.01)}\\
Log of Diversification &2.441 & &112.23& \\
&\textit{(0.02)}& &\textit{(0.04)}\\
Log of Return on Assets &-3.235 & & 1.140& \\
&\textit{(0.01)}& &\textit{(0.03)}\\
\midrule
\textbf{Macroeconomic variables}
& & &
\multicolumn{2}{c}{\thead{Fisher-ADF}} \\
\midrule
Real GDP growth & & & -1.66 & \\
&&&\textit{(0.048)}\\
$\Delta$ infl (inflation) & & & -4.62 & \\
&&&\textit{(0.145)}\\
$\Delta$ Ur (unemployment rate) & & & -1.45 & \\
&&&\textit{(0.014)}\\
Exchange rate & & & -0.76 & \\
&&&\textit{(0.042)}\\
\midrule
\textbf{Household-level indicators}
& & &
\multicolumn{2}{c}{\thead{Fisher-ADF}} \\
\midrule
Income & & & 1.30 & \\
&&&\textit{(0.001)}\\
Family size & & & -1.07 & \\
&&&\textit{(0.007)}\\
Age & & & -3.02 & \\
&&&\textit{(0.002)}\\
Education & & & -1.91 & \\
&&&\textit{(0.000)}\\
\bottomrule
\end{tabular*}
\end{adjustbox}
\end{table}
\end{document}
答案1
一些评论和意见:
没有必要
adjustbox
。保持列结构简单:一列用于标签,两列用于数据。
对于当前的排版需求来说,使用该
siunitx
包及其S
列类型可能有点过头了。所需的只是该dcolumn
包。拜托少点视觉效果——没必要大胆的和斜体, 真的。
\documentclass[1p,times]{elsarticle}
\usepackage{booktabs,dcolumn}
\newcolumntype{d}[1]{D..{#1}}
\newcommand\mc[1]{\multicolumn{1}{c}{#1}}
\begin{document}
\begin{table}[h]
\caption{Augmented Dickey Fuller and KPSS Test Statistics for (Transformed) Sectoral Indices (y)}
\label{tab:statistics}
\setlength\tabcolsep{0pt} % make LaTeX do all the work
\smallskip
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}} l d{2.3} d{3.3} }
\toprule
Banking-industry specific variables
& \mc{Levin, Lin and Chu (LLC)}
& \mc{ADF-Fisher chi-square} \\
\cmidrule{1-1}\cmidrule{2-2}\cmidrule{3-3}
Log of Loans-to-Assets &-2.14 & 151.23 \\
&(0.05) & (0.02) \\
Log of Credit quality &-0.486 & 144.11 \\
&(0.04) & (0.01) \\
Log of Diversification &2.441 & 112.23 \\
&(0.02) & (0.04) \\
Log of Return on Assets &-3.235 & 1.140 \\
&(0.01) & (0.03) \\
\addlinespace
Macroeconomic variables &&\mc{Fisher-ADF} \\
\cmidrule{1-1}\cmidrule{3-3}
Real GDP growth && -1.66 \\
&& (0.048) \\
$\Delta$ infl (inflation) && -4.62 \\
&& (0.145)\\
$\Delta$ Ur (unemployment rate) && -1.45 \\
&& (0.014) \\
Exchange rate && -0.76 \\
&& (0.042) \\
\addlinespace
Household-level indicators&& \mc{Fisher-ADF} \\
\cmidrule{1-1}\cmidrule{3-3}
Income && 1.30 \\
&& (0.001) \\
Family size &&-1.07 \\
&& (0.007) \\
Age &&-3.02 \\
&& (0.002) \\
Education &&-1.91 \\
&& (0.000) \\
\bottomrule
\end{tabular*}
\end{table}
\end{document}