Longtable zum Arbeiten in einem zweispaltigen Dokument

Longtable zum Arbeiten in einem zweispaltigen Dokument

Ich habe eine lange Tabelle in meinem (zweispaltigen) Latex-Dokument. Aus diesem Grund verwende ich:

\usepackage{longtable}

damit ich die Tabelle auf zwei Seiten aufteilen kann. Das schien zu funktionieren, aber es scheint, dass die Tabelle versucht, in eine Spalte zu passen, anstatt sich über beide zu erstrecken. Dieses Problem hatte ich nicht, als ich tabellarisch verwendet habe.

Ich füge unten ein MWE ein, habe die Tabelle aber so gekürzt, dass sie nur wenige Zeilen enthält:

Bildbeschreibung hier eingeben

Alle Ideen wären toll.

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}

Antwort1

Verwenden Sie supertabularstattdessen:

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

Bildbeschreibung hier eingeben

Antwort2

Also musste ich anscheinend nur

\begin{longtable*}

Und

\end{longtable*}

anstatt

\begin{longtable}

Und

\end{longtable}

Jetzt funktioniert es!

verwandte Informationen