表格标题无法添加新行

表格标题无法添加新行

(以下)是我所拥有的,其中删除了一些数据。但是,当我查看 PDF 时,标题如下所示:

Table1::NGC 2264...

我希望它为:

 Table1
NGC 2264

(当然是居中)

我一直在寻找,但找不到任何可行的方法。我希望有人能告诉我该怎么做。在表格的第 2 页及以后,我的标题没有居中,而是左对齐。我也不知道该怎么办。

%%
%% Begining of file `table.tex'

\documentclass[10pt,fullpage]{aastex}
\usepackage{longtable}
\usepackage{pdflscape}
\begin{document}
\begin{landscape}
\centering%
\renewcommand{\arraystretch}{0.7}%

\begin{center}
\begin{longtable}{c c c c c c c c c c c}

%Header for the first page of the table...
\caption{NGC2264 Protostars}\\
\hline \hline \\ [-.8ex]
    Name & 
    RA & 
    DEC &                   
    Mean I1 & 
    Mean I2 & 
    Alpha K2 & 
    Class & 
    Alpha K8 & 
    Av & 
    Avg Av\\ [0.5ex] \hline
    \\ [-.8ex]
\endfirsthead

%Header for the rest of the table's pages...
\multicolumn{1}{c}{{\tablename} \thetable{} -- Continued} \\ [0.5ex]
    \hline \hline \\ [-.8ex]
    Name & 
    RA &
    DEC & 
    Mean I1 & 
    Mean I2 & 
    Alpha K2 & 
    Class & 
    Alpha K8 & 
    Av & 
    Avg Av\\ [-0.5ex] \hline
    \\ [-.8ex]
\endhead
\\\hline
\endfoot

%Begin data...
    Mon-000101 & 100.27242 & 9.608597 & 11.082 & 10.034 & 0.39  & I     & 0.39  & 31.1  & 31.1 \\
    Mon-000171 & 100.2923 & 9.52286 & 14.834 & 14.385 & 0.45  & I     & 0.45  & 33.7  & 33.7 \\
    Mon-000174 & 100.27621 & 9.563802 & 11.605 & 10.134 & 0.95  & I     & 1.29  & 30.8  & 30.8 \\
    Mon-000191 & 100.28709 & 9.495832 & 9.231 & 8.105 & 1     & I     & 1.01  & 0     & 0 \\
    Mon-000323 & 100.25761 & 9.576176 & 9.385 & 8.513 & 0.31  & I     & 0.04  & 16.8  & 16.8 \\
    Mon-000382 & 100.27496 & 9.569871 & 12.899 & -100  & 0.93  & I     & 0.93  & 33.8  & 33.8 \\
    Mon-000391 & 100.28869 & 9.50715 & 10.44 & 8.974 & 1.32  & I     & 2.45  & 0     & 0 \\
    Mon-000392 & 100.186 & 9.800595 & 7.598 & -100  & 0.55  & I     & 0.81  & 7.6   & 7.6 \\
    Mon-000399 & 100.25794 & 9.877631 & 12.732 & 12.579 & 0.94  & I     & -1.13 & 9.8   & 9.8 \\
    Mon-000402 & 100.27347 & 9.595702 & 11.707 & 10.519 & 0.58  & I     & 0.59  & 20.9  & 20.9 \\
    Mon-000411 & 100.23458 & 9.571638 & 12.752 & 11.39 & 0.43  & I     & -0.09 & 16.8  & 16.8 \\
    Mon-000454 & 100.26513 & 9.601277 & 11.146 & 10.662 & 1.25  & I     & 1.25  & 24.9  & 24.9 \\
    Mon-000466 & 100.31544 & 9.464637 & 11.265 & 9.906 & 0.69  & I     & 1.65  & 23.6  & 23.6 \\
    Mon-000495 & 100.28751 & 9.407105 & 10.69 & 9.637 & 0.42  & I     & 1.04  & 23.9  & 23.9 \\
    Mon-000569 & 100.3025 & 9.484669 & -100  & -100  & 0.7   & I     & 0.7   & 16.7  & 16.7 \\
    Mon-000704 & 100.28223 & 9.487126 & 12.963 & 12.146 & 0.6   & I     & 0.6   & 29.5  & 29.5 \\
    Mon-000708 & 100.26408 & 9.601333 & 11.185 & 10.86 & 1.11  & I     & 1.2   & 24.9  & 24.9 \\
    Mon-000741 & 100.26563 & 9.600305 & 11.315 & 10.747 & 0.58  & I     & 0.58  & 24.9  & 24.9 \\
    Mon-146053 & 100.23425 & 9.571719 & 12.765 & 11.39 & 1.11  & I     & 1.04  & 16.8  & 16.8 \\
    \hline
%End data.

\end{longtable}
\end{center}
\end{landscape}

\end{document}
%%
%% End of file `table.tex'.

答案1

解决方案可以放在序言中:

\usepackage{caption}
\captionsetup{labelsep=newline}

但这 aastex是包不支持的文档类caption。但是,可以使用该style=base选项忽略兼容性检查,并祈祷不会出现副作用:

\usepackage[style=base]{caption}
\captionsetup{labelformat=simple,labelsep=newline}

但在这种情况下不起作用,因为\captionbox已经定义。因此,首先必须取消定义此命令:

\makeatletter
\let\captionbox\@undefined       
\makeatother
\usepackage[style=base]{caption}
\captionsetup{labelformat=simple,labelsep=newline}

仍然要祈祷它有副作用,但至少它能与你的 MWE 配合使用:

平均能量损失

答案2

的文件艾斯特包建议使用deluxetable环境。示例如下所示:

\documentclass[10pt,fullpage]{aastex}

\usepackage{longtable}
\usepackage[hmargin = 0.3in]{geometry}

\begin{document}
\begin{deluxetable}{cccccccccccccccc}
\tablecaption{NGC2264 Protostars}
\tablehead{
  \colhead{Name} &
  \colhead{RA} &
  \colhead{DEC} &
  \colhead{Mean I1} &
  \colhead{Mean I2} &
  \colhead{Alpha K2} &
  \colhead{Class} &
  \colhead{Alpha K8} &
  \colhead{Av} &
  \colhead{Avg Av}
}
\startdata
    Mon-000101 & 100.27242 & 9.608597 & 11.082 & 10.034 & 0.39  & I     & 0.39  & 31.1  & 31.1 \\
    Mon-000171 & 100.2923 & 9.52286 & 14.834 & 14.385 & 0.45  & I     & 0.45  & 33.7  & 33.7 \\
    Mon-000174 & 100.27621 & 9.563802 & 11.605 & 10.134 & 0.95  & I     & 1.29  & 30.8  & 30.8 \\
    Mon-000191 & 100.28709 & 9.495832 & 9.231 & 8.105 & 1     & I     & 1.01  & 0     & 0 \\
    Mon-000323 & 100.25761 & 9.576176 & 9.385 & 8.513 & 0.31  & I     & 0.04  & 16.8  & 16.8 \\
    Mon-000382 & 100.27496 & 9.569871 & 12.899 & -100  & 0.93  & I     & 0.93  & 33.8  & 33.8 \\
    Mon-000391 & 100.28869 & 9.50715 & 10.44 & 8.974 & 1.32  & I     & 2.45  & 0     & 0 \\
    Mon-000392 & 100.186 & 9.800595 & 7.598 & -100  & 0.55  & I     & 0.81  & 7.6   & 7.6 \\
    Mon-000399 & 100.25794 & 9.877631 & 12.732 & 12.579 & 0.94  & I     & -1.13 & 9.8   & 9.8 \\
    Mon-000402 & 100.27347 & 9.595702 & 11.707 & 10.519 & 0.58  & I     & 0.59  & 20.9  & 20.9 \\
    Mon-000411 & 100.23458 & 9.571638 & 12.752 & 11.39 & 0.43  & I     & -0.09 & 16.8  & 16.8 \\
    Mon-000454 & 100.26513 & 9.601277 & 11.146 & 10.662 & 1.25  & I     & 1.25  & 24.9  & 24.9 \\
    Mon-000466 & 100.31544 & 9.464637 & 11.265 & 9.906 & 0.69  & I     & 1.65  & 23.6  & 23.6 \\
    Mon-000495 & 100.28751 & 9.407105 & 10.69 & 9.637 & 0.42  & I     & 1.04  & 23.9  & 23.9 \\
    Mon-000569 & 100.3025 & 9.484669 & -100  & -100  & 0.7   & I     & 0.7   & 16.7  & 16.7 \\
    Mon-000704 & 100.28223 & 9.487126 & 12.963 & 12.146 & 0.6   & I     & 0.6   & 29.5  & 29.5 \\
    Mon-000708 & 100.26408 & 9.601333 & 11.185 & 10.86 & 1.11  & I     & 1.2   & 24.9  & 24.9 \\
    Mon-000741 & 100.26563 & 9.600305 & 11.315 & 10.747 & 0.58  & I     & 0.58  & 24.9  & 24.9 \\
    Mon-146053 & 100.23425 & 9.571719 & 12.765 & 11.39 & 1.11  & I     & 1.04  & 16.8  & 16.8 \\
\enddata
\end{deluxetable}
\end{document}

在此处输入图片描述

相关内容