Mar 31, 2012

Getting longtable to flow into columns

I have incredibly long tables in the dissertation. Some of them are rather narrow and I can see that they can easily fit into two columns in landscape format. But longtable does not behave well with the two column format. I can see that many people want this to happen but are not close to a solution. I wonder if David Carlisle over at tex.stackexchange might be able to help me with this...

Before I go and post there, these are some of the existing threads with partial or no solutions at stackexchange:\

  1. Long table in two columns asked Jul 19 '11 at 13:04 by Petter
  2. Long table in two columns asked Dec 2 '10 at 10:56 by donatello
  3. Long table in two columns asked Dec 24 '10 at 13:41 by Freddie Witherden
  4. Long table in multiple columns asked Mar 19 '11 at 19:52 by Alan Munn
  5. Long table in two columns asked Feb 27 at 13:17 by Frg

An option suggested was to use the supertabular environment, but pdflatex has gone into an infinite processing loop that I soon need to kill. :/ There are some more options that I need to try out.
  • Use the tabbing environment
  • Use nested tabulars
  • supertabular with multicol

Okay, trials are over. This is a dead cause. Multicolumn-headings, headers and footnotes do not behave in the two column hacks. Instead, I have opted to use the pdfpages package and insert the preformatted longtables. Which brings me to another confounding issue... I know I can get the captions to go into the List of Tables with the addtolist= option but how do I get the inserted PDF tables to have auto-captions like regular tables? David Carlisle to the rescue again!

\usepackage{capt-of} 
\captionof{table}{a table caption}

Capt-of is splendid little package that includes captions outside float environments. And a hack to center the contents of a cell within a longtable column defined to be right aligned:


\begin{longtable}{>{\raggedright}p{4.2cm}rrrrr} 
\multicolumn{1}{c}{\footnotesize Contentof2ndCell}

 And no, \centering does not work for some reason.

0 Comments:

Post a Comment