9

I can create tables over both columns in two-column mode using table* with tabular and multi-page tables using longtable or supertabular but I am not able to combine both.

\documentclass[twocolumn]{article}
\usepackage{supertabular}
\usepackage{longtable}

\begin{document}
\begin{supertabular*}{\linewidth}{llllll}
column1 &column2    &column3    &column4    &column5    &column6\\                                                                                                                            
\end{supertabular*}
\end{document}
  • longtable does not work in two-column mode at all ("longtable not in 1-column mode")
  • supertabular* compiles (using \begin{supertabular*}{\linewidth}{...}, as recommended in another Question) but keeps to use one column anyways and overlaps if that space is not sufficient (see MWE above)
  • Perhaps switching to one column, using longtable/supertabular, and then switching to two columns again? Package multicol allows you to change the number of columns in the middle of the document. – JLDiaz Jul 22 '15 at 10:19
  • P.S.: When having a caption at the top, latex creates a full page for the caption only and starts the table itself only on the next page. How can I prevent that? – Konrad Höffner Aug 11 '15 at 9:26
4

Instead of using the supertabular package, which is known to have certain weaknesses, I suggest you use the xtab pacakge and its xtabular and xtabular* environments.

I gather you want the long table is also quite wide and thus needs to span both columns. To obtain this behavior, you need to issue the instruction \onecolumn before \begin{xtabular*}{\textwidth}...}, and you need to issue the instruction \twocolumn after \end{xtabular*}. In order to avoid getting a wretched-looking mid-page page break when LaTeX encounters the \onecolumn directive, I suggest you also load the afterpage package and encase the entire xtabular*-related stuff in an \afterpage{...} instruction. For instance:

\documentclass[twocolumn]{article}
\usepackage{xtab,afterpage}
\usepackage{lipsum}  % for filler text

\begin{document}
\lipsum[1-5]  % filler text

--- here's the call to start an xtabular* environment. 
Execution is deferred until the start of the next page ---

\afterpage{\onecolumn
\begin{xtabular*}{\textwidth}{l@{\extracolsep{\fill}}lllll}
\hline
column1 &column2    &column3    &column4    &column5    &column6\\
%....
column1 &column2    &column3    &column4    &column5    &column6\\
\hline
\end{xtabular*}
\twocolumn
} % end of scope of "\afterpage" directive

\lipsum[6-10] % more filler text
\end{document}

Depending on the length of the table, there may still be some empty space at the bottom of the last page of the table; however, that's usually much less severe a problem than having a bad page immediately before the start of the table.

  • Thanks, this works great so far! But how do I add caption and label? When I put it in a table, it doesn't span multiple pages anymore. – Konrad Höffner Jul 23 '15 at 8:35
  • 2
    @KonradHöffner - For sure, do not place an xtabular environment inside a table environment. Please consult the user guide of the xtab package on how to use macros such as \topcaption, \tablefirsthead, etc. – Mico Jul 23 '15 at 8:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.