使用表格注释引用方程式

使用表格注释引用方程式

我正在尝试找到一种方法来引用我的方程式作为表格下的注释这里的代码

\documentclass{article}
\usepackage[margin=2.5cm,a4paper]{geometry} % set page parameters suitably
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage[skip=1ex]{caption}
\usepackage{natbib}
\usepackage{amsmath}
\usepackage{amsthm} 
\usepackage[protrusion=true,expansion=true]{microtype} 
\usepackage{multirow}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{enumerate}
\usepackage{placeins}
\usepackage{varioref}
\usepackage{float}
\usepackage{cuted}
\usepackage[english]{babel}
\usepackage[latin1]{inputenc}       
\usepackage[figurename=Fig.]{caption}
\usepackage{booktabs, makecell, multirow, threeparttable}
\usepackage{caption}
\usepackage{xparse}    
\usepackage{hyperref}
\usepackage[nameinlink,noabbrev]{cleveref} 
\usepackage{xstring}
\usepackage{xfrac}
\usepackage{nicefrac}
\usepackage{dcolumn}
\usepackage{booktabs}
\usepackage{relsize}
\usepackage{booktabs, makecell}
\usepackage[referable]{threeparttablex}
\usepackage{siunitx}
\usepackage[skip=1ex]{caption}
\usepackage{booktabs, makecell}
\usepackage[referable]{threeparttablex}
\usepackage{booktabs,dcolumn}
\usepackage{multirow, booktabs, makecell, caption}
\usepackage{threeparttable}
\usepackage{siunitx}

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \renewcommand{\theadfont}{\small\bfseries}
  \captionsetup{font=bf}
  \newcommand{\Risk}{\mathop{\textnormal{\slshape Risk}}\nolimits}
  \newcommand{\CEOPC}{\mathop{\textnormal{\slshape CEO\_PC}}\nolimits}
  \newcommand{\Boardind}{\mathop{\textnormal{\slshape Board\_ind}}\nolimits}
  \newcommand{\OP}{\mathop{\textnormal{\slshape OP}}\nolimits}
  \newcommand{\OF}{\mathop{\textnormal{\slshape OF}}\nolimits}
  \newcommand{\Zscore}{\mathop{\textnormal{\slshape Z\_Score}}\nolimits}
  \newcommand{\NPLs}{\mathop{\textnormal{\slshape NPLs}}\nolimits}
 \newcommand{\NPL}{\mathop{\textnormal{\slshape NPL}}\nolimits}
 \newcommand{\LnZ}{\mathop{\textnormal{\slshape Ln\_Z}}\nolimits}
 \newcommand{\LnZscore}{\mathop{\textnormal{\slshape LnZ\_score}}\nolimits}
\newcommand{\LTS}{\mathop{\textnormal{\slshape LTS}}\nolimits}
\newcommand{\EA}{\mathop{\textnormal{\slshape EA}}\nolimits}
\newcommand{\LT}{\mathop{\textnormal{\slshape LT}}\nolimits}
\newcommand{\PF}{\mathop{\textnormal{\slshape PF}}\nolimits}
\newcommand{\EF}{\mathop{\textnormal{\slshape EF}}\nolimits}
\newcommand{\LV}{\mathop{\textnormal{\slshape LV}}\nolimits}
\newcommand{\LGI}{\mathop{\textnormal{\slshape LGI}}\nolimits}
 \newcommand{\AGI}{\mathop{\textnormal{\slshape AGI}}\nolimits}
\newcommand{\DD}{\mathop{\textnormal{\slshape DD}}\nolimits}




 \begin{document}

\\ we use the following model

 \begin{equation}
   \Risk_{i,t} = c + &\alpha \Risk_{i,t-1} + \beta_{1}\CEOPC_{i,t} + \beta_{2}\Boardind_{i,t} + 
 \beta_{k}\Controls_{i,t}+\epsilon_{i,t}\label{eq:1}
  \end{equation}

\\ \Cref{tab2} presents the regression results :

   \begin{table}[h]  
    \sisetup{table-format=-1.3, 
            table-number-alignment=center, 
             table-space-text-pre =(, 
             table-space-text-post=$^{***}$, 
            table-align-text-pre=false, 
           table-align-text-post=false}
    \centering          
   \caption{Risk}
   \label{tab2}
   \begin{threeparttable}
   \begin{tabular*}{\textwidth}{c@{\extracolsep{\fill}}*{2}{S}}
   \toprule
    \thead{Variable} & {\thead{\NPLs}} & {\thead{\LnZscore}} \\
   \midrule
  \multirow{2}[1]{*}{Constant} & -0.1064\tc{***} & 5.0727\tc{***} \\
  \multicolumn{1}{c}{}         & {(}-3.42{)} & {(}5.35{)} \\    
  \addlinespace
   \multirow{2}[0]{*}{$\NPL$_{i,t-1}$$} & 0.021\tc{***}   & \\
   \multicolumn{1}{c}{}              & {(}5.73{)}  & \\
   \addlinespace
   \multirow{2}[1]{*}{$\LnZ$_{it-1}$$} &     &  0.1452\tc{***} \\
   \multicolumn{1}{c}{}               &     & {(}5.83{)} \\
 \addlinespace
   \multirow{2}[1]{*}{$\CEOPC$_{it}$$} & 6.4521\tc{***}   & 0.0124 \\
    \multicolumn{1}{c}{}                 & {(}11.14{)} & {(}1.12{)} \\  
 \addlinespace
   \multirow{2}[1]{*}{$\Boardind$} & -0.1452\tc{**}    & -0.1245\tc{***}  \\
   \multicolumn{1}{c}{}             & {(}-2.11{)} & {(}-8.25{)} \\              
\addlinespace
\multirow{2}[1]{*}{$\OF$} & -0.0103\tc{***}  & 0.0345\tc{**} \\
\multicolumn{1}{c}{}         & {(}-2.45{)} & {(}2.33{)} \\              
  \addlinespace
  \multirow{2}[1]{*}{$\OP$} & -0.1445\tc{*}    & 0.1478\tc{*} \\
  \multicolumn{1}{c}{}         & {(}-1.91{)} & {(}1.90{)} \\            
  \addlinespace
   \multirow{2}[1]{*}{$\LTS$} & 0.1019\tc{**}    &-0.2645\tc{***} \\
   \multicolumn{1}{c}{}     & {(}2.45{)} & {(}-3.47{)} \\       
 \addlinespace
  \multirow{2}[1]{*}{$\EA$} & 0.2114 & 0.4789 \\
   \multicolumn{1}{c}{} & {(}1.03{)} & {(}0.10{)} \\                
 \addlinespace
  \multirow{2}[1]{*}{$\LT$} & -0.1478\tc{*} & -0.2010\\
   \multicolumn{1}{c}{} & {(}-0.45{)} & {(}-0.14{)} \\
 \addlinespace
  \multirow{2}[1]{*}{$\PF$} & -0.5240\tc{*} & -0.0520 \\
  \multicolumn{1}{c}{} & {(}-3.06{)} & {(}-1.24{)} \\                   
 \addlinespace
  \multirow{2}[1]{*}{$\EF$} & 0.0120 & -1.2322\tc{***} \\
   \multicolumn{1}{c}{} & {(}4.20{)} & {(}-2.20{)} \\
\addlinespace
  \multirow{2}[1]{*}{$\LV$} & -0.1478\tc{***} &  \\
  \multicolumn{1}{c}{} & {(}-11.02{)} &  \\ 
 \addlinespace
   \multirow{2}[1]{*}{$\LGI$} & 0.1247 &  \\
   \multicolumn{1}{c}{} & {(}0.2010{)} &  \\    
  \addlinespace
  \multirow{2}[1]{*}{$\AGI$} &  & 0.0012\tc{***} \\
  \multicolumn{1}{c}{} & & {(}0.1478{)} \\  
 \addlinespace
  \multirow{2}[1]{*}{$\DD$} &  & 0.14789 \\
  \multicolumn{1}{c}{} &  & {(}0.01236{)} \\    
  \midrule
    Year dummy & \multicolumn{2}{c}{Yes} \\
        \addlinespace
       \multirow{2}[1]{*}{R$^2$} &   -1.156 &  -2.452 \\
       \addlinespace
    \multirow{2}[1]{*}{Adjusted R$^2$} &   0.652 & 1.562 \\
    \addlinespace
    \multirow{2}[1]{*}{Sargan test} & 12.02\tc{***} &41.02\tc{***} \\
    \addlinespace
\bottomrule
\end{tabular*}
\begin{tablenotes}[para,flushleft]
\footnotesize\smallskip
   \item\hspace{-2.5pt}\noindent\textit{Note:} This table reports SGMM estimation results of $\label{eq:1}$ where non-performing loans to total loans (\NPL), and Z-score (\LnZ) are the endogenous variables for bank $i$ and year $t$. The $\NPL$_{i,t-1}$ and $\LnZ$_{it-1}$ are lagged dependent variables. $\OP$ and $\OF$ is the independent PRIVATE (DUMMY), FOREIGN (DUMMY), passive shareholding (\PF), minority active shareholding (\EF) and active shareholding (\LTS) are the main explanatory ownership variables. Bank size (\LTS), corporate governance (\EA), financial leverage (\LT) are bank level control variables; and growth of product (\LGI), rate of inflation (\AGI) are two macro-economic control variables. T-statistics are between parentheses; \enspace *** $p < 0.01$; \enspace ** $p < 0.05$;\enspace * $p < 0.10$. The Sargan test justifies the validity of the over identifying restrictions.
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}

答案1

在下面的MWE中,我相对于原始代码做了以下更改:

  • 注释掉重复的包。请只加载一次包,避免冲突的包选项。我还正确地将其放在了hyperref序言的末尾。

  • 删除了等式中的和表外&的出现\\

  • tc根据评论和\Controls根据我的猜测添加了缺失的定义

  • 在需要的地方添加了数学模式,并删除了多余$

  • 删除了\multirow表格下部的命令以修复水平对齐

  • 更正了根据表格中的数字table-format的选项sisetup

  • 删除了多余的\multicolumn{1}{c}{}

  • $\label{eq:1}$将注释部分的错误内容替换为\cref{eq:1}

除了上述更改之外,我还建议对tabular表格使用简单的。强制表格宽度与文本宽度一样宽会引入大量空白,并使表格更难阅读。我还threeparttalbe用一个简单的替换了 的 tablenotes 环境,minipage以确保表格下方的注释部分与文本宽度一样宽:

在此处输入图片描述

\documentclass{article}
\usepackage[margin=2.5cm,a4paper]{geometry} % set page parameters suitably
%\usepackage{booktabs} %<-- removed. don't load packages more than once!
\usepackage{siunitx}
%\usepackage[skip=1ex]{caption} %<-- removed. don't load packages more than once!
\usepackage{natbib}
\usepackage{amsmath}
\usepackage{amsthm} 
\usepackage[protrusion=true,expansion=true]{microtype} 
%\usepackage{multirow} %<-- removed. don't load packages more than once!
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{enumerate}
\usepackage{placeins}
%\usepackage{varioref} % <--- moved to the end of the preamble. Mind the correct load order
\usepackage{float}
\usepackage{cuted}
\usepackage[english]{babel}
\usepackage[latin1]{inputenc}       
\usepackage[figurename=Fig.]{caption}
\usepackage{booktabs, makecell, multirow, threeparttable}
%\usepackage{caption} %<-- removed. don't load packages more than once!
\usepackage{xparse}    
%\usepackage{hyperref} % <--- moved to the end of the preamble. Mind the correct load order
%\usepackage[nameinlink,noabbrev]{cleveref} % <--- moved to the end of the preamble. Mind the correct load order
\usepackage{xstring}
\usepackage{xfrac}
\usepackage{nicefrac}
\usepackage{dcolumn}
%\usepackage{booktabs}%<-- removed. don't load packages more than once!
\usepackage{relsize}
%\usepackage{booktabs, makecell} %<-- removed. don't load packages more than once!
\usepackage[referable]{threeparttablex}
%\usepackage{siunitx} %<-- removed. don't load packages more than once!
%\usepackage[skip=1ex]{caption} %<-- removed. don't load packages more than once!
%\usepackage{booktabs, makecell} %<-- removed. don't load packages more than once!
%\usepackage[referable]{threeparttablex} %<-- removed. don't load packages more than once!
%\usepackage{booktabs,dcolumn} %<-- removed. don't load packages more than once!
%\usepackage{multirow, booktabs, makecell, caption} %<-- removed. don't load packages more than once!
%\usepackage{threeparttable} %<-- removed. don't load packages more than once!
%\usepackage{siunitx} %<-- removed. don't load packages more than once!


\usepackage{varioref}
\usepackage{hyperref} 
\usepackage[nameinlink,noabbrev]{cleveref}

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\theadfont}{\small\bfseries}
\captionsetup{font=bf}


\newcommand{\Risk}{\mathop{\textnormal{\slshape Risk}}\nolimits}
\newcommand{\CEOPC}{\mathop{\textnormal{\slshape CEO\_PC}}\nolimits}
\newcommand{\Boardind}{\mathop{\textnormal{\slshape Board\_ind}}\nolimits}
\newcommand{\OP}{\mathop{\textnormal{\slshape OP}}\nolimits}
\newcommand{\OF}{\mathop{\textnormal{\slshape OF}}\nolimits}
\newcommand{\Zscore}{\mathop{\textnormal{\slshape Z\_Score}}\nolimits}
\newcommand{\NPLs}{\mathop{\textnormal{\slshape NPLs}}\nolimits}
\newcommand{\NPL}{\mathop{\textnormal{\slshape NPL}}\nolimits}
\newcommand{\LnZ}{\mathop{\textnormal{\slshape Ln\_Z}}\nolimits}
\newcommand{\LnZscore}{\mathop{\textnormal{\slshape LnZ\_score}}\nolimits}
\newcommand{\LTS}{\mathop{\textnormal{\slshape LTS}}\nolimits}
\newcommand{\EA}{\mathop{\textnormal{\slshape EA}}\nolimits}
\newcommand{\LT}{\mathop{\textnormal{\slshape LT}}\nolimits}
\newcommand{\PF}{\mathop{\textnormal{\slshape PF}}\nolimits}
\newcommand{\EF}{\mathop{\textnormal{\slshape EF}}\nolimits}
\newcommand{\LV}{\mathop{\textnormal{\slshape LV}}\nolimits}
\newcommand{\LGI}{\mathop{\textnormal{\slshape LGI}}\nolimits}
\newcommand{\AGI}{\mathop{\textnormal{\slshape AGI}}\nolimits}
\newcommand{\DD}{\mathop{\textnormal{\slshape DD}}\nolimits}

\newcommand{\Controls}{\mathop{\textnormal{\slshape Controls}}\nolimits}
\usepackage{xcolor}
\newcommand\tc[1]{\textcolor{blue}{#1}}

\begin{document}

we use the following model

\begin{equation}
   \Risk_{i,t} = c + \alpha \Risk_{i,t-1} + \beta_{1}\CEOPC_{i,t} + \beta_{2}\Boardind_{i,t} + 
 \beta_{k}\Controls_{i,t}+\epsilon_{i,t}\label{eq:1}
\end{equation}

\Cref{tab2} presents the regression results :

\begin{table}[ht]  
\sisetup{table-format=-2.5,  % corrected values with respect to the numbers in your table
         table-number-alignment=center, 
         table-space-text-pre =(, 
         table-space-text-post=$^{***}$, 
         table-align-text-pre=false, 
         table-align-text-post=false}
\centering          
\caption{Risk}
\label{tab2}
\begin{tabular}{l*{2}{S}}
\toprule
\thead{Variable} & {\thead{$\NPLs$}} & {\thead{$\LnZscore$}} \\
\midrule
\multirow{2}[1]{*}{Constant}       & -0.1064\tc{***} & 5.0727\tc{***} \\
                                   & {(}-3.42{)}     & {(}5.35{)} \\    
\addlinespace
\multirow{2}[0]{*}{$\NPL_{i,t-1}$} & 0.021\tc{***}   & \\
                                   & {(}5.73{)}      & \\
\addlinespace
\multirow{2}[1]{*}{$\LnZ_{it-1}$}  &                 &  0.1452\tc{***} \\
                                   &                 & {(}5.83{)} \\
\addlinespace
\multirow{2}[1]{*}{$\CEOPC_{it}$}  & 6.4521\tc{***}  & 0.0124 \\
                                   & {(}11.14{)}     & {(}1.12{)} \\  
\addlinespace 
\multirow{2}[1]{*}{$\Boardind$}    & -0.1452\tc{**}  & -0.1245\tc{***}  \\
                                   & {(}-2.11{)}     & {(}-8.25{)} \\              
\addlinespace
\multirow{2}[1]{*}{$\OF$}          & -0.0103\tc{***} & 0.0345\tc{**} \\
                                   & {(}-2.45{)}     & {(}2.33{)} \\              
\addlinespace
\multirow{2}[1]{*}{$\OP$}          & -0.1445\tc{*}   & 0.1478\tc{*} \\
                                   & {(}-1.91{)}     & {(}1.90{)} \\            
\addlinespace
\multirow{2}[1]{*}{$\LTS$}         & 0.1019\tc{**}   &-0.2645\tc{***} \\
                                   & {(}2.45{)}      & {(}-3.47{)} \\       
\addlinespace
\multirow{2}[1]{*}{$\EA$}          & 0.2114          & 0.4789 \\
                                   & {(}1.03{)}      & {(}0.10{)} \\                
\addlinespace
\multirow{2}[1]{*}{$\LT$}          & -0.1478\tc{*}   & -0.2010\\
                                   & {(}-0.45{)}     & {(}-0.14{)} \\
\addlinespace
\multirow{2}[1]{*}{$\PF$}          & -0.5240\tc{*}   & -0.0520 \\
                                   & {(}-3.06{)}     & {(}-1.24{)} \\                   
\addlinespace
\multirow{2}[1]{*}{$\EF$}          & 0.0120          & -1.2322\tc{***} \\
                                   & {(}4.20{)}      & {(}-2.20{)} \\
\addlinespace
\multirow{2}[1]{*}{$\LV$}          & -0.1478\tc{***} &  \\
                                   & {(}-11.02{)}    &  \\ 
\addlinespace
\multirow{2}[1]{*}{$\LGI$}         & 0.1247          &  \\
                                   & {(}0.2010{)}    &  \\    
\addlinespace
\multirow{2}[1]{*}{$\AGI$}         &                 & 0.0012\tc{***} \\
                                   &                 & {(}0.1478{)} \\  
\addlinespace
\multirow{2}[1]{*}{$\DD$}          &                 & 0.14789 \\
                                   &                 & {(}0.01236{)} \\    
\midrule
Year dummy                         & \multicolumn{2}{c}{Yes} \\
R$^2$                              &   -1.156        &  -2.452 \\
Adjusted R$^2$                     &   0.652         & 1.562 \\
Sargan test                        & 12.02\tc{***}   & 41.02\tc{***} \\
\bottomrule
\end{tabular}
\smallskip

\begin{minipage}{\textwidth}
\small
\textit{Note:} This table reports SGMM estimation results of \cref{eq:1} where non-performing loans to total loans ($\NPL$), and Z-score ($\LnZ$) are the endogenous variables for bank $i$ and year $t$. The $\NPL_{i,t-1}$ and $\LnZ_{it-1}$ are lagged dependent variables. $\OP$ and $\OF$ is the independent PRIVATE (DUMMY), FOREIGN (DUMMY), passive shareholding ($\PF$), minority active shareholding ($\EF$) and active shareholding ($\LTS$) are the main explanatory ownership variables. Bank size ($\LTS$), corporate governance ($\EA$), financial leverage ($\LT$) are bank level control variables; and growth of product ($\LGI$), rate of inflation ($\AGI$) are two macro-economic control variables. T-statistics are between parentheses; \enspace *** $p < 0.01$; \enspace ** $p < 0.05$;\enspace * $p < 0.10$. The Sargan test justifies the validity of the over identifying restrictions.
 \end{minipage}
\end{table}
\end{document}

相关内容