Longtable para trabajar en documento de dos columnas.

Longtable para trabajar en documento de dos columnas.

Tengo una tabla larga en mi documento Latex (de dos columnas). Por esa razón, estoy usando:

\usepackage{longtable}

para poder dividir la tabla en dos páginas. Esto pareció funcionar, pero parece que la tabla intenta encajar en una columna en lugar de abarcar las dos. No tuve este problema cuando usé tabular.

Incluyo un MWE a continuación, pero he truncado la tabla para que solo tenga unas pocas filas:

ingrese la descripción de la imagen aquí

Cualquier idea sería genial.

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}

Respuesta1

Utilice supertabularen su lugar:

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

ingrese la descripción de la imagen aquí

Respuesta2

Entonces aparentemente solo necesitaba usar

\begin{longtable*}

y

\end{longtable*}

en lugar de

\begin{longtable}

y

\end{longtable}

¡Ahora funciona!

información relacionada