长脚注超出列宽

长脚注超出列宽

我是 LaTeX 新手,在格式化表格时遇到了问题。我想在表格下方添加一个长脚注,当它到达表格最后一列的边框时,立即开始新的一行。但是,当我添加脚注时,表格的最后一列会延伸到脚注所到之处。有谁能帮我吗?

这是我的完整代码:

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{booktabs}
\usepackage{array}
\usepackage{adjustbox}
\usepackage[margin=100pt]{geometry}
\usepackage{mathptmx}
\begin{document}
\begin{table}[!htbp]\centering
\renewcommand\thetable{2}
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\caption{ESG and corporate bond spreads\label{tab1}}
\begin{adjustbox}{max width=\linewidth}
\begin{tabular}{l*{5}{c}}
\toprule
                    &\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}&\multicolumn{1}{c}{(3)}&\multicolumn{1}{c}{(4)}&\multicolumn{1}{c}{(5)}\\
                    &\multicolumn{1}{c}{Panel OLS}&\multicolumn{1}{c}{Panel OLS}&\multicolumn{1}{c}{OLS}&\multicolumn{1}{c}{IV}&\multicolumn{1}{c}{Panel OLS}\\
\midrule
ESG score           &      -0.296\sym{***}&                     &      -0.389\sym{**} &     -0.0137         &     -0.0460         \\
                    &     (0.101)         &                     &     (0.197)         &     (0.227)         &    (0.0979)         \\
\addlinespace
Environment score   &                     &      0.0925         &                     &                     &                     \\
                    &                     &    (0.0731)         &                     &                     &                     \\
\addlinespace
Social score        &                     &      -0.332\sym{***}&                     &                     &                     \\
                    &                     &     (0.102)         &                     &                     &                     \\
\addlinespace
Governance score    &                     &     -0.0974         &                     &                     &                     \\
                    &                     &    (0.0675)         &                     &                     &                     \\
\addlinespace
Firm size           &       4.508\sym{**} &       3.667         &       8.245\sym{**} &       1.517         &      -1.274         \\
                    &     (2.287)         &     (2.270)         &     (3.700)         &     (2.928)         &     (2.852)         \\
\addlinespace
Capital intensity   &       0.226         &       0.155         &       0.141         &      -0.145         &       0.272\sym{**} \\
                    &     (0.176)         &     (0.188)         &     (0.168)         &     (0.109)         &     (0.129)         \\
\addlinespace
Market-to-book      &       0.103\sym{***}&       0.116\sym{***}&       0.166         &      0.0624         &      0.0506         \\
                    &    (0.0366)         &    (0.0366)         &     (0.149)         &    (0.0616)         &    (0.0347)         \\
\addlinespace
Leverage            &      -0.236         &      -0.195         &      -0.112         &       0.185         &      -0.337\sym{**} \\
                    &     (0.184)         &     (0.183)         &     (0.179)         &     (0.125)         &     (0.149)         \\
\addlinespace
ROA                 &      -0.924\sym{***}&      -0.862\sym{***}&      -0.534         &      -0.240         &      -0.165         \\
                    &     (0.308)         &     (0.299)         &     (0.511)         &     (0.261)         &     (0.212)         \\
\addlinespace
Interest coverage ratio&      -0.521         &      -0.561         &      -0.919\sym{*}  &      -0.237         &     -0.0974         \\
                    &     (0.431)         &     (0.441)         &     (0.479)         &     (0.270)         &     (0.210)         \\
\addlinespace
Callable(1=yes)     &       20.43\sym{***}&       19.69\sym{***}&       8.305         &       13.57\sym{*}  &       13.26\sym{***}\\
                    &     (6.391)         &     (6.583)         &     (10.64)         &     (7.356)         &     (4.364)         \\
\addlinespace
Green bond(1=yes)   &      -2.342         &      -2.322         &       4.679         &       4.291         &      -17.63\sym{***}\\
                    &     (11.20)         &     (10.67)         &     (17.82)         &     (13.12)         &     (4.702)         \\
\addlinespace
Rank                &      -7.580\sym{***}&      -7.650\sym{***}&      -10.41\sym{***}&      -11.76\sym{***}&       0.372         \\
                    &     (1.876)         &     (1.847)         &     (1.170)         &     (0.653)         &     (1.976)         \\
\addlinespace
Tenor(in years)     &       1.356\sym{***}&       1.359\sym{***}&       1.267\sym{***}&       1.600\sym{***}&       2.152\sym{***}\\
                    &     (0.279)         &     (0.275)         &     (0.488)         &     (0.286)         &     (0.197)         \\
\addlinespace
Amount              &       1.237         &       0.480         &       5.942         &       1.454         &       1.084         \\
                    &     (3.109)         &     (3.086)         &     (6.669)         &     (3.123)         &     (2.592)         \\
\addlinespace
Year FE             &         Yes         &         Yes         &         Yes         &         Yes         &         Yes         \\
\addlinespace
Country FE          &         Yes         &         Yes         &         Yes         &         Yes         &         Yes         \\
\addlinespace
Asset-type FE       &         Yes         &         Yes         &         Yes         &         Yes         &         Yes         \\
\addlinespace
Firm FE             &          No         &          No         &          No         &          No         &         Yes         \\
\midrule
Observations        &        1284         &        1284         &         267         &         997         &        1261         \\
Adjusted \(R^{2}\)  &       0.592         &       0.595         &       0.584         &       0.662       &       0.779         \\
\bottomrule
\multicolumn{6}{l}{\footnotesize Standard errors in parentheses}\\
\multicolumn{6}{l}{\footnotesize In column 1 and 2, the full sample of firms with an ESG score is used. In column 3, the sample at origination is used. In column 4, the full sample is used in an IV regression. In column 5, the full sample is used in a regression including firm fixed effects}\\
\multicolumn{6}{l}{\footnotesize \sym{*} \(p<0.10\), \sym{**} \(p<0.05\), \sym{***} \(p<0.01\)}\\
\end{tabular}
\end{adjustbox}
\end{table}
\end{document}```

答案1

环境threeparttable识别三个正式组件:标题、tabular(或tabular*tabularxtabulary)环境和tablenotes环境。threeparttable机器将标题和tablesnotes材料的宽度限制为tabular环境的宽度。因此,我建议您将当前位于环境底部的三行移到tabulartablenotes环境中。

我还想建议您将 5 个数据列中的数字与各自的小数点对齐。这可以借助该dcolumn软件包来实现。请参阅下面的应用程序。

考虑到文本块的大小,\addlinespace每行后面都添加说明会使文本table太高。我建议您\addlinespace只在每四行后面插入说明。

哦,一定要把这些东西处理掉adjustbox。将表格材料adjustbox虚拟地放置在环境中担保表格中的字体大小与文档其余部分的字体大小将有很大的不一致。

在此处输入图片描述

\documentclass{article} % or some other suitable document class
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{booktabs}
\usepackage{array}
\usepackage[margin=100pt]{geometry}
\usepackage{mathptmx}
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}

%% New instructions:
\usepackage[flushleft]{threeparttable}
\usepackage{dcolumn}
\newcolumntype{d}[1]{D..{#1}}
\newcommand\mc[1]{\multicolumn{1}{c}{#1}}    % handy shortcut macros
\newcommand\mcc[1]{\multicolumn{1}{c@{}}{#1}}

\begin{document}
\setcounter{table}{1} % just for this example
\begin{table}[p] % place this float on a page by itself
\centering
\begin{threeparttable}
%% First formal component: the caption
\caption{ESG and corporate bond spreads}\label{tab1}
%% Second formal component: the 'tabular' environment
\begin{tabular}{@{}l *{5}{d{3.5}} @{}}
\toprule
&\mc{(1)}&\mc{(2)}&\mc{(3)}&\mc{(4)}&\mcc{(5)}\\
&\mc{Panel OLS}&\mc{Panel OLS}&\mc{OLS}&\mc{IV}&\mcc{Panel OLS}\\
\midrule
ESG score           & -0.296\sym{***}&                & -0.389\sym{**} &-0.0137         &-0.0460         \\
                    &(0.101)         &                &(0.197)         &(0.227)         &(0.0979)        \\
Environment score   &                & 0.0925         &                &                &                \\
                    &                &(0.0731)        &                &                &                \\
Social score        &                & -0.332\sym{***}&                &                &                \\
                    &                &(0.102)         &                &                &                \\
Governance score    &                &-0.0974         &                &                &                \\
                    &                &(0.0675)        &                &                &                \\
\addlinespace
Firm size           &  4.508\sym{**} &  3.667         &  8.245\sym{**} &  1.517         & -1.274         \\
                    &(2.287)         &(2.270)         &(3.700)         &(2.928)         &(2.852)         \\
Capital intensity   &  0.226         &  0.155         &  0.141         & -0.145         &  0.272\sym{**} \\
                    &(0.176)         &(0.188)         &(0.168)         &(0.109)         &(0.129)         \\
Market-to-book      &  0.103\sym{***}&  0.116\sym{***}&  0.166         & 0.0624         & 0.0506         \\
                    & (0.0366)       &(0.0366)        &(0.149)         &(0.0616)        &(0.0347)        \\
Leverage            & -0.236         & -0.195         & -0.112         &  0.185         & -0.337\sym{**} \\
                    &(0.184)         &(0.183)         &(0.179)         &(0.125)         &(0.149)         \\
\addlinespace
ROA                 & -0.924\sym{***}& -0.862\sym{***}& -0.534         & -0.240         & -0.165         \\
                    &(0.308)         &(0.299)         &(0.511)         &(0.261)         &(0.212)         \\
Interest coverage ratio& -0.521      & -0.561         & -0.919\sym{*}  & -0.237         &-0.0974         \\
                    &(0.431)         &(0.441)         &(0.479)         &(0.270)         &(0.210)         \\
Callable (1=yes)    &  20.43\sym{***}&  19.69\sym{***}&  8.305         &  13.57\sym{*}  &  13.26\sym{***}\\
                    &(6.391)         &(6.583)         &(10.64)         &(7.356)         &(4.364)         \\
Green bond (1=yes)  & -2.342         & -2.322         &  4.679         &  4.291         & -17.63\sym{***}\\
                    &(11.20)         &(10.67)         &(17.82)         &(13.12)         &(4.702)         \\
\addlinespace
Rank                & -7.580\sym{***}& -7.650\sym{***}& -10.41\sym{***}& -11.76\sym{***}&  0.372         \\
                    &(1.876)         &(1.847)         &(1.170)         &(0.653)         &(1.976)         \\
Tenor (in years)    &  1.356\sym{***}&  1.359\sym{***}&  1.267\sym{***}&  1.600\sym{***}&  2.152\sym{***}\\
                    &(0.279)         &(0.275)         &(0.488)         &(0.286)         &(0.197)         \\
Amount              &  1.237         &  0.480         &  5.942         &  1.454         &  1.084         \\
                    &(3.109)         &(3.086)         &(6.669)         &(3.123)         &(2.592)         \\
\addlinespace
Year FE             &\mc{Yes}        &\mc{Yes}        &\mc{Yes}        &\mc{Yes}        &\mcc{Yes}       \\
Country FE          &\mc{Yes}        &\mc{Yes}        &\mc{Yes}        &\mc{Yes}        &\mcc{Yes}       \\
Asset-type FE       &\mc{Yes}        &\mc{Yes}        &\mc{Yes}        &\mc{Yes}        &\mcc{Yes}       \\
Firm FE             & \mc{No}        & \mc{No}        & \mc{No}        & \mc{No}        &\mcc{Yes}       \\
\midrule
Observations        &\mc{1284}       &\mc{1284}       &\mc{267}        &\mc{997}        &\mcc{1261}      \\
Adjusted \(R^{2}\)  &\mc{0.592}      & \mc{0.595}     &\mc{0.584 }     &\mc{0.662}      &\mcc{0.779}     \\
\bottomrule
\end{tabular}

%% The third formal component: the 'tablenotes' environment
\smallskip\footnotesize
\begin{tablenotes}
\item[1]Standard errors in parentheses.
\item[2]In columns 1 and 2, the full sample of firms with an ESG score is used. In column 3, the sample at origination is used. In column 4, the full sample is used in an IV regression. In column 5, the full sample is used in a regression including firm fixed effects.
\item[3]Statistical significance indicators: $\sym{*}\ p<0.10,\ \sym{**}\ p<0.05,\ \sym{***}\ p<0.01$.
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}

答案2

这是否符合要求

在此处输入图片描述

\documentclass{article}
\usepackage{booktabs,caption}
\usepackage[flushleft]{threeparttable}
\begin{document}

\begin{table}
  \begin{threeparttable}
    \caption{Sample ANOVA table}
     \begin{tabular}{lllll}
        \toprule
        Stubhead & \( df \) & \( f \) & \( \eta \) & \( p \) \\
        \midrule
                 &     \multicolumn{4}{c}{Spanning text}     \\
        Row 1    & 1        & 0.67    & 0.55       & 0.41    \\
        Row 2    & 2        & 0.02    & 0.01       & 0.39    \\
        Row 3    & 3 \tnote{a}       & 0.15    & 0.33       & 0.34    \\
        Row 4    & 4        & 1.00    & 0.76       & 0.54    \\
        \bottomrule
     \end{tabular}
    \begin{tablenotes}
      \small
      \item [a]This is where authors provide additional information about
      the data, including whatever notes are needed.
    \end{tablenotes}
  \end{threeparttable}
\end{table}

\end{document}

相关内容