Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Is there a recommended method for incorporating multi-page tables into twocolumn documents? It's clear that the longtable package isn't set up to deal with documents of more than one column.

Is there an alternative package that will deal better with the twocolumn format?

Alternatively, what's the best way of putting longtable (or equivalent) into a twocolumn document as a single column float? Is there something similar to table* and figure*, but for longtable?

share|improve this question
    
Thanks! I've gotten supertabular to generate tables now, but have not yet figured out how force it to be single-column (similar to figure*), which I am now realizing is really necessary given my table width. Any advice on how to do this? –  Alex T. Dec 30 '11 at 20:35
    
I'm not sure that I understand. Will tabularx handle page breaks? –  Alex T. Dec 30 '11 at 21:14
add comment

1 Answer 1

How float environments are handled in LaTeX can you read in the answer of Frank Mittelbach: How to influence the position of float environments like figure and table in LaTeX? To answer your question we must collect some facts:

  1. Floating environments doesn't allow any page breaks.
  2. longtable or supertabular aren't floating environments and can't be used inside them.
  3. Only the package tabularx and ltxtable (combination of longtable and tabularx) can handel a given width.
  4. You can't simple interrupt the twocolumn mode.
  5. When a document is set in twocolumn, yet you can switch inside the document between onecolumn and twocolumn

Based of this fact and your request I suggest a combination of the package multicol and ltxtable

The package multicol provided the environment multicols.

\documentclass[twocolumn,demo]{article}
\usepackage{graphicx,lipsum}
\usepackage{multicol}
\usepackage{longtable,ltxtable,booktabs}
\usepackage{forloop}
\newcounter{count}
\setcounter{count}{1}

\usepackage{filecontents}
\begin{filecontents}{myltxtable.tex}
\renewcommand\arraystretch{3.5}
\begin{longtable}{X}
\caption{caption}\\\endfirsthead
\toprule
foo\\bar\\foo\\bar\\
foo\\bar\\foo\\bar\\
foo\\bar\\foo\\bar\\
foo\\bar\\foo\\bar\\
foo\\bar\\foo\\bar\\
\bottomrule
\end{longtable}
\end{filecontents}

\begin{document}
\section{foo}
\lipsum[1]
\clearpage
\onecolumn
\begin{multicols}{2}[\section{begin multicols}]
\lipsum\lipsum[2]
\end{multicols}
\LTXtable{\textwidth}{myltxtable.tex}
\twocolumn
\lipsum
\end{document} 

ORIG

I hope I understand you correct. Some time ago I wrote a small post about the package supertabular on the FAQ Dante (in German) which is able to handle two column.

One important fact is that supertabular calculates the width of the rows c, l and r on every new page again.

Here a small example:

\documentclass[twocolumn]{article}
\usepackage{forloop,supertabular}
\newcounter{count}
\setcounter{count}{1}
\begin{document}
\begin{center}
\tablefirsthead{erster Tabellenkopf\\}
\tablehead{Tabellenkopf\\}
\tabletail{Fortsetzung n\"achste Seite\\}
\tablelasttail{letze Seite\\}
\tablecaption{supertabular-Tabelle}
\begin{supertabular}{c}
\whiledo{\value{count} < 100}{\stepcounter{count}
   \arabic{count} \\}
\end{supertabular}
\end{center}
\end{document} 
share|improve this answer
    
Thanks again! Please see my comment above asking how to make the float single column. –  Alex T. Dec 30 '11 at 20:38
    
@AlexT.: I edited my post. –  Marco Daniel Dec 30 '11 at 21:54
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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