使用 \underset 后的对齐问题

使用 \underset 后的对齐问题

我用 \underset 编辑表格后,表格列看起来不太整齐。你能帮我看一下吗?提前谢谢!

梅威瑟:

 \documentclass[twocolumn]{article}

\usepackage[T1]{fontenc}
\usepackage{newtxtext}
\usepackage{amsmath,geometry,siunitx,booktabs, tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\newcommand\mC[1]{\multicolumn{1}{C@{}}{#1}} 
\sisetup{group-separator={,}, group-minimum-digits=4}
\usepackage[skip=1ex]{caption}
\captionsetup[table]{font=small, labelfont=bf, singlelinecheck=no}
\usepackage{makecell}
\renewcommand\theadfont{\normalsize}
\renewcommand\theadgape{}
\setcellgapes{2pt}
\usepackage{textcomp}
\usepackage{graphicx}
\raggedbottom
\usepackage{rotating}
\usepackage[referable]{threeparttablex}
\usepackage{upquote}
\usepackage{balance}
\usepackage{wasysym}
\usepackage{footmisc}
\usepackage{float}
\floatstyle{boxed} 
\restylefloat{figure}

%ZARKO:
\usepackage{geometry}
\usepackage[T1]{fontenc}
\usepackage{newtxtext}
\usepackage{textcomp}
\usepackage{booktabs, makecell, tabularx}
\renewcommand\theadfont{\normalsize}
\renewcommand\theadgape{}
\setcellgapes{2pt}
\usepackage{siunitx}
\sisetup{group-integer-digits,% in case of rounding decimals to three digits can be omitted
         group-separator={,},
         group-minimum-digits=4
         }
\usepackage[skip=1ex]{caption}
\captionsetup[table]{font=small, labelfont=bf, singlelinecheck=no}
%END ZARKO

\title{\LARGE \bf ECON 425 Term Paper}

\author{}

\begin{document}

\begin{table*}[!htbp]
\caption{Estimates of pay-performance sensitivity.}
\label{tab:table1}
OLS regressions of CEO salary and CEO total compensation on change in shareholder wealth. Standard errors in parentheses.

   \medskip
    \setlength\tabcolsep{4pt}
    \small
    \makegapedcells
\begin{tabularx}{\textwidth}{@{}L lll@{}}
    \toprule
\thead[l]{Dependent\\ variable}
            &  \thead[l]{CEO\\
                         salary\\
                         (eq. \ref{eqn:first})}


                                            & \thead[l]{CEO total\\
                                            compensation\\
                                            (eq. \ref{eqn:second})}

& \thead[l]{CEO salary \\ (not controlling \\for industry) (eq. \ref{eqn:third})}

\\

Return (\%)       &  $\underset{(0.083))}{-0.320}$        &   $\underset{(1.545)}{2.213}$        &  $\underset{(0.082)}{-0.303}$        
\\
Volume & $\underset{(0.000)}{0.002}$ & $\underset{(0.003)}{0.069}$ & $\underset{(0.000)}{0.002}$
\\    
Return*Volume   & $\underset{(0.000)}{0.000}$      &  $\underset{(0.000)}{0.000}$   &   $\underset{(0.000)}{0.000}$                          \\
Log (bonus)
                &  $\underset{(1.38)}{-5.269}$   & --- & $\underset{(1.365)}{-6.431}$          \\

Stock Awards    & $\underset{(0.000)}{0.036}$ & --- &  $\underset{(0.000)}{0.036}$                   \\
Option Awards    &  $\underset{(0.000)}{0.023}$        & --- &  $\underset{(0.001)}{0.027}$                      \\
Other Compensation & $\underset{(0.000)}{0.028}$ & --- & $\underset{(0.003)}{0.027}$
    \\
Age &  $\underset{(4.567)}{33.387}$ &  $\underset{(84.768)}{913.016}$ &  $\underset{(4.575)}{39.237}$
    \\
Age\textsuperscript{2} & $\underset{(0.039)}{-0.217}$ &  $\underset{(0.733)}{-7.435}$ &  $\underset{(0.039)}{-0.267}$
    \\
Male & $\underset{(18.079)}{-2.601}$ & $\underset{(337.631)}{-465.612}$ &  $\underset{(17.615)}{-31.349}$
    \\
Outdoors &  $\underset{(77.902)}{-173.761}$ & $\underset{(1453.675)}{-4268.128}$
    \\
Mining & $\underset{(26.792)}{-178.289}$ & $\underset{(499.369)}{-972.327}$
    \\
Utilities & $\underset{(34.906)}{-199.853}$  &  $\underset{(651.127)}{-4217.222 }$
    \\
Construction & $\underset{(33.259)}{-102.424}$ & $\underset{(620.558)}{-3572.244}$
    \\
Wholesale &  $\underset{(28.814)}{-193.954}$ &  $\underset{(537.382)}{-3827.542}$
    \\
Information &  $\underset{(24.494)}{-218.414}$ &  $\underset{(456.968)}{-618.642}$
    \\
Finance &  $\underset{(23.320)}{-160.005}$ & $\underset{(434.591)}{-3078.595 }$
    \\
Real estate &  $\underset{(25.248)}{-303.096}$ & $\underset{(470.966)}{-3410.482}$
    \\
Professional & $\underset{(27.486)}{-238.323}$ & $\underset{(512.813)}{-3776.246}$
    \\
Waste  & $\underset{(31.766)}{-186.965}$& $\underset{(592.813)}{-3365.898}$
    \\
Education & $\underset{(50.956)}{-287.113}$ & $\underset{(950.712)}{-5770.548}$
    \\
Healthcare & $\underset{(32.953)}{-153.385}$ & $\underset{(615.121)}{-2123.471}$
    \\
Arts & $\underset{(56.622)}{178.082}$ & $\underset{(1056.786)}{-2303.748}$
    \\
Food & $\underset{(31.091)}{-34.24}$ & $\underset{(579.849)}{-2656.446}$
    \\
Other & $\underset{(61.642)}{-109.691}$ & $\underset{(1150.511)}{-3786.196}$
    \\
Manufacturing & $\underset{(22.394)}{-193.729}$ & $\underset{(417.698)}{-2540.859}$
    \\
Transportation & $\underset{(29.509)}{-313.349}$ & $\underset{(551.778)}{-3678.069}$
    \\
Retail &  $\underset{(25.756)}{-80.145}$ & $\underset{(480.656)}{-2295.232}$
    \\
    \bottomrule
\end{tabularx}

\smallskip
$^{*}p<0.10$, $^{**}p<0.05$, $^{***}p<0.01$.
    \end{table*}

\end{document}

目前的情况如下:

在此处输入图片描述

ZARKO 的更新:

不适用于上标,参见 MWE:

\documentclass[twocolumn]{article}
\usepackage{geometry}
\usepackage[T1]{fontenc}
\usepackage{newtxtext}
\usepackage{textcomp}
%
\usepackage{amsmath}
\usepackage{wasysym}    % had to be after "amsmath"
%
\usepackage{rotating}
\usepackage{booktabs, makecell, tabularx}
\usepackage[referable]{threeparttablex}
\renewcommand\theadfont{\normalsize}
\renewcommand\theadgape{}
\setcellgapes{2pt}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\newcommand\mC[1]{\multicolumn{1}{C@{}}{#1}}
%
\usepackage{siunitx}
\sisetup{group-integer-digits,
         group-separator={,},
         group-minimum-digits=4
         }
%
\usepackage[skip=1ex]{caption}
\captionsetup[table]{font=small,
                     labelfont=bf,
                     singlelinecheck=no}
\usepackage{float}
\floatstyle{boxed}
\restylefloat{figure}
\usepackage{graphicx}
%
\usepackage{upquote}
\usepackage{balance}
\usepackage{footmisc}

\begin{document}
    \begin{table*}[htb]
    \sisetup{input-symbols={( - )},
             table-column-width=22ex
             }
    \renewcommand\arraystretch{0.9}
\caption{Estimates of pay-performance sensitivity.}
\label{tab:table1}
OLS regressions of CEO salary and CEO total compensation on change in shareholder wealth. Standard errors are in parentheses.

\begin{tabularx}{\linewidth}{L
                             S[table-format=-3.3]
                             S[table-format=-4.3]
                             S[table-format=-3.3]
                             }
    \toprule
\thead[l]{Dependent\\ variable}
    &  {\thead{CEO salary\\
                 (eq. \ref{eqn:first})}}
        & {\thead{CEO total\\
                     compensation\\
                     (eq. \ref{eqn:second})}}
            & {\thead{CEO salary\\
                         (not controlling\\
                         for industry) (eq. \ref{eqn:third})}}  \\
    \midrule
Return (\%)
    &   -0.320  &   2.213   &  -0.303                           \\
    &   (0.083) &  (1.545)  &  (0.082)                          \\
    \addlinespace
Volume
    &    0.002  &   0.069   &   0.002                           \\
    &   (0.000) &  (0.003)  &  (0.000)                          \\
    \addlinespace
Return*Volume
    &    0.000  &   0.000   &   0.000                           \\
    &   (0.000) &  (0.000)  &   (0.000)                         \\

    \addlinespace
    Log (bonus)
    &    ${-5.269\textsuperscript{***}}$   &      &   -6.431       \\
    &   (1.829) &    &   (1.798)  \\


    \bottomrule
\end{tabularx}

\smallskip
$^{*}p<0.10$, $^{**}p<0.05$, $^{***}p<0.01$.
    \end{table*}
\end{document}

答案1

  • 使用的\underset{...}{...}方法很有趣,但得到的结果却很丑陋
  • 最好将标准错误写入你的行(我只转换前三行,其余的我留给你)
  • 对于列类型,我建议使用 S包中的列siunitx

\documentclass[twocolumn]{article}
\usepackage{geometry}
\usepackage[T1]{fontenc}
\usepackage{newtxtext}
\usepackage{textcomp}
%
\usepackage{amsmath}
\usepackage{wasysym}    % had to be after "amsmath"
%
\usepackage{rotating}
\usepackage{booktabs, makecell, tabularx}
\usepackage[referable]{threeparttablex}
\renewcommand\theadfont{\normalsize}
\renewcommand\theadgape{}
\setcellgapes{2pt}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\newcommand\mC[1]{\multicolumn{1}{C@{}}{#1}}
%
\usepackage{siunitx}
\sisetup{group-integer-digits,
         group-separator={,},
         group-minimum-digits=4
         }
%
\usepackage[skip=1ex]{caption}
\captionsetup[table]{font=small,
                     labelfont=bf,
                     singlelinecheck=no}
\usepackage{float}
\floatstyle{boxed}
\restylefloat{figure}
\usepackage{graphicx}
%
\usepackage{upquote}
\usepackage{balance}
\usepackage{footmisc}

\begin{document}
    \begin{table*}[htb]
    \sisetup{input-symbols={( - )},
             table-column-width=22ex
             }
    \renewcommand\arraystretch{0.9}
\caption{Estimates of pay-performance sensitivity.}
\label{tab:table1}
OLS regressions of CEO salary and CEO total compensation on change in shareholder wealth. Standard errors are in parentheses.

\begin{tabularx}{\linewidth}{L
                             S[table-format=-3.3]
                             S[table-format=-4.3]
                             S[table-format=-3.3]
                             }
    \toprule
\thead[l]{Dependent\\ variable}
    &  {\thead{CEO salary\\
                 (eq. \ref{eqn:first})}}
        & {\thead{CEO total\\
                     compensation\\
                     (eq. \ref{eqn:second})}}
            & {\thead{CEO salary\\
                         (not controlling\\
                         for industry) (eq. \ref{eqn:third})}}  \\
    \midrule
Return (\%)
    &   -0.320  &   2.213   &  -0.303                           \\
    &   (0.083) &  (1.545)  &  (0.082)                          \\
    \addlinespace
Volume
    &    0.002  &   0.069   &   0.002                           \\
    &   (0.000) &  (0.003)  &  (0.000)                          \\
    \addlinespace
Return*Volume
    &    0.000  &   0.000   &   0.000                           \\
    &   (0.000) &  (0.000)  &   (0.000)                         \\
    \bottomrule
\end{tabularx}

\smallskip
$^{*}p<0.10$, $^{**}p<0.05$, $^{***}p<0.01$.
    \end{table*}
\end{document}

在此处输入图片描述

相关内容