[Tex/LaTex] Longtable to work in two column document

longtable

I have a long table in my (two column) Latex document. For that reason, I am using:

\usepackage{longtable}

so that I can split the table over two pages. This seemed to work, but it seems that the table is trying to fit into 1 column instead of spanning the two. I didn't have this problem when I used tabular.

I include a MWE below, but I have truncated the table to only have a few rows:

enter image description here

Any ideas would be great.

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}

Best Answer

Use supertabular instead:

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

enter image description here

Related Question