Longtable 在兩個文件中運作

Longtable 在兩個文件中運作

我的(兩列)Latex 文件中有一張長表。因此,我正在使用:

\usepackage{longtable}

這樣我就可以把表格分成兩頁。這似乎有效,但表格似乎試圖適應一列而不是跨越兩列。我用table的時候就沒有這個問題。

我在下麵包含了一個 MWE,但我已將表截斷為只有幾行:

在此輸入影像描述

任何想法都會很棒。

微量元素:

\documentclass{emulateapj}                                                                  
%% \documentclass[twocolumn]{aastex6}                                                                              
\newcommand{\vdag}{(v)^\dagger}
\newcommand\aastex{AAS\TeX}
\newcommand\latex{La\TeX}
\usepackage{amsmath,mathtools,etoolbox}
\usepackage{longtable}
\usepackage{float}
\usepackage{tabularx,colortbl}
\usepackage{adjustbox}\usepackage{mathtools}
\usepackage{array}
\usepackage{makecell}
\usepackage{stackengine}
\setstackEOL{\cr} %EOL is abbreviation for ``end of line.''                                                        
\usepackage[table]{xcolor}

\begin{document}
\begin{longtable}{ccccccccccccc}
\hline
\hline
\thead{Name} && \thead{col2} && \thead{col3} && \thead{col4} && \thead{col5} && \thead{col6} \\
\hline
\rowcolor{gray!50}
ROW 1 && 1400 && 8.83 && 281.00 && 0.95 && 8.68 \\
ROW 2 && 2030 && 3.61 && 6.15 && 0.09 && 3.66 \\
ROW 3 && 1500 && 2.37 && 5.47 && 0.19 && 2.35 \\
ROW 4 && 820 && 1.44 && 4.59 && 0.09 && 1.43 \\
\rowcolor{gray!50}
ROW 5 && 820 && 5.46 && 34.23 && 2.56 && 3.87 \\
ROW 6 && 1500 && 5.16 && 12.00 && 1.12 && 4.86 \\
ROW 7 && 1400 && 4.93 && 22.66 && 1.84 && 3.96 \\
ROW 8 && 2030 && 2.82 && 14.01 && 1.29 && 2.25 \\
\hline
\caption{Caption.}
\label{var_table}
\end{longtable}

\end{document}

答案1

改用supertabular

\documentclass[twocolumn,landscape]{scrartcl}
\usepackage{geometry}
\usepackage{supertabular}                                             
\usepackage[table]{xcolor} 
\begin{document}

\bottomcaption{Caption.\label{var_table}}
\tablefirsthead{%
    \hline
    \hline
        Name && col2 && col3 && col4 && col5 && col6 \\\hline}
\begin{supertabular}{ccccccccccccc}
    \rowcolor{gray!50}
    ROW 1 && 1400 && 8.83 && 281.00 && 0.95 && 8.68 \\
    ROW 2 && 2030 && 3.61 && 6.15 && 0.09 && 3.66 \\
    ROW 3 && 1500 && 2.37 && 5.47 && 0.19 && 2.35 \\
    ROW 4 && 820 && 1.44 && 4.59 && 0.09 && 1.43 \\
    \rowcolor{gray!50}
    ROW 5 && 820 && 5.46 && 34.23 && 2.56 && 3.87 \\
    ROW 6 && 1500 && 5.16 && 12.00 && 1.12 && 4.86 \\
    ROW 7 && 1400 && 4.93 && 22.66 && 1.84 && 3.96 \\
    ROW 8 && 2030 && 2.82 && 14.01 && 1.29 && 2.25 \\
    \hline
    \rowcolor{gray!50}
    ROW 1 && 1400 && 8.83 && 281.00 && 0.95 && 8.68 \\
    ROW 2 && 2030 && 3.61 && 6.15 && 0.09 && 3.66 \\
    ROW 3 && 1500 && 2.37 && 5.47 && 0.19 && 2.35 \\
    ROW 4 && 820 && 1.44 && 4.59 && 0.09 && 1.43 \\
    \rowcolor{gray!50}
    ROW 5 && 820 && 5.46 && 34.23 && 2.56 && 3.87 \\
    ROW 6 && 1500 && 5.16 && 12.00 && 1.12 && 4.86 \\
    ROW 7 && 1400 && 4.93 && 22.66 && 1.84 && 3.96 \\
    ROW 8 && 2030 && 2.82 && 14.01 && 1.29 && 2.25 \\
    \hline  \rowcolor{gray!50}
    ROW 1 && 1400 && 8.83 && 281.00 && 0.95 && 8.68 \\
    ROW 2 && 2030 && 3.61 && 6.15 && 0.09 && 3.66 \\
    ROW 3 && 1500 && 2.37 && 5.47 && 0.19 && 2.35 \\
    ROW 4 && 820 && 1.44 && 4.59 && 0.09 && 1.43 \\
    \rowcolor{gray!50}
    ROW 5 && 820 && 5.46 && 34.23 && 2.56 && 3.87 \\
    ROW 6 && 1500 && 5.16 && 12.00 && 1.12 && 4.86 \\
    ROW 7 && 1400 && 4.93 && 22.66 && 1.84 && 3.96 \\
    ROW 8 && 2030 && 2.82 && 14.01 && 1.29 && 2.25 \\
    \hline
    ROW 1 && 1400 && 8.83 && 281.00 && 0.95 && 8.68 \\
    ROW 2 && 2030 && 3.61 && 6.15 && 0.09 && 3.66 \\
    ROW 3 && 1500 && 2.37 && 5.47 && 0.19 && 2.35 \\
    ROW 4 && 820 && 1.44 && 4.59 && 0.09 && 1.43 \\
    \rowcolor{gray!50}
    ROW 5 && 820 && 5.46 && 34.23 && 2.56 && 3.87 \\
    ROW 6 && 1500 && 5.16 && 12.00 && 1.12 && 4.86 \\
    ROW 7 && 1400 && 4.93 && 22.66 && 1.84 && 3.96 \\
    ROW 8 && 2030 && 2.82 && 14.01 && 1.29 && 2.25 \\
    \hline
\end{supertabular}

\end{document}

在此輸入影像描述

答案2

所以顯然我只需要使用

\begin{longtable*}

\end{longtable*}

代替

\begin{longtable}

\end{longtable}

現在可以了!

相關內容