表格行未对齐

表格行未对齐

我的桌子对齐完全乱了。你能帮忙吗?

此外,逗号和句号不是我所期望的那样。

梅威瑟:

\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}

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

\author{}

\begin{document}

\begin{table}
\setlength\tabcolsep{3pt}
\small
\caption{Comparing goodness of fit tests
for different specifications of pay-performance equation.} \label{tab:table}

\medskip
\begin{tabularx}{\columnwidth}{@{}
   l S[table-format=4.2] S[table-format=5.2]
   *{2}{S[table-format=6.2]} @{}}
\toprule
& \mC{eq. 1} & \mC{eq. 2} & \mC{eq. 3} \\
\midrule
R-sqaure    & {.255} & {.072} & {.231} \\
\addlinespace
Adj. R-square   & 0.254   & .070   & .2299    \\ 
F-statistic & 140.94$^{*}$   & 37.26$^{*}$     & 357.81    \\
Sample Size    & 11,536    &  11,529   & 11,950     \\
\bottomrule
\end{tabularx}
\smallskip
$^{*}$ Significant at the 1\% level.
\end{table}

\end{document}

在此处输入图片描述

非常感谢!

ZARKO 的更新:

当我复制并粘贴你的序言时,出现了错误。我慌乱中快速按下 command-z 撤消,并尝试将你的序言复制并粘贴到单独的部分,然后反向操作,删除重复的内容。这似乎有效,但如果你能查看它并在必要时再次清理它,那就太好了。顺便说一句,我不确定错误是什么。

我的新序言:

\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}

再次感谢!

答案1

让我将我的评论转换为答案:-)

  • 您要求各组之间用逗号分隔...
  • 如果你喜欢只对数字的整数部分进行分组,那么\sisetup使用group-integer-digits
  • 在这种情况下,将数字的小数部分四舍五入是合理的,例如四舍五入为三位数

主题:

  • 在下面的 mwe 中删除所有不相关的包
  • 剩下的包我根据其功能分组(编码、字体、表格、单元、标题)

母语:

\documentclass[twocolumn]{article}
\usepackage{geometry}
\usepackage[T1]{fontenc}
\usepackage{newtxtext}
\usepackage{textcomp}
\usepackage{booktabs, makecell, tabularx}
\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,% 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}

\begin{document}
    \begin{table}
\setlength\tabcolsep{3pt}
\small
\caption{Comparing goodness of fit tests
for different specifications of pay-performance equation.} \label{tab:table}

\medskip
\begin{tabularx}{\columnwidth}{@{}
        l
   *{3}{S[table-format=3.3,
          table-space-text-post=*,
          round-mode=places,
          round-precision=3]} @{}}
\toprule
                & \mC{eq. 1}    & \mC{eq. 2}    & \mC{eq. 3} \\
\midrule
R-sqaure        & .255          &  .072         & .231      \\
\addlinespace[2pt]
Adj. R-square   & 0.254         & .070          & .2299     \\
F-statistic     & 140.94$^{*}$  & 37.26$^{*}$   & 357.81    \\
Sample Size     & {11,536}      & {11,529}      & {11,950}  \\
\bottomrule
\end{tabularx}
\smallskip
$^{*}$ Significant at the 1\% level.
    \end{table}
\end{document}

在此处输入图片描述

附录: 我的 mwe 也适用于你的完整序言。在我的测试中,我将其重新组织为

\documentclass[twocolumn]{article}
\usepackage{geometry}
\usepackage[T1]{fontenc}
\usepackage{newtxtext}
\usepackage{textcomp}
\usepackage{wasysym}
%
\usepackage{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-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}

看看它是否完整以及是否适用于您的文档。

相关内容