Featured Book

LaTeX Beginners Guide

Who is online

In total there are 18 users online :: 0 registered, 0 hidden and 18 guests (based on users active over the past 5 minutes)
Most users ever online was 1327 on Tue Nov 05, 2013 7:11 pm

Users browsing this forum: No registered users and 18 guests

Partner Sites

TeXwelt - Fragen und Antworten goLaTeX
TeXblog
TeXnicCenter
TeXample

table spanning two pages in portrait format

Add tags LaTeX specific issues not fitting into one of the other forums of this category.

table spanning two pages in portrait format

Postby greengrass on Sun Oct 26th, 2008

Is it possible to have a table span 2 pages in portrait format? i.e. if I have a table with 10 columns, can I have 5 columns on the left hand page and 5 columns on the right hand page, in a continuous fashion so that their row heights would match up?
Last edited by greengrass on Mon Oct 27th, 2008, edited 1 time in total.
greengrass
 
Posts: 12
Joined: Sun Oct 26th, 2008

Re: table spanning two pages in protrait format

Postby localghost on Sun Oct 26th, 2008

Have a look at the longtable package.


Best regards
Thorsten¹
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses
User avatar
localghost
Site Moderator
 
Posts: 9219
Joined: Fri Feb 2nd, 2007
Location: Braunschweig, Germany

Re: table spanning two pages in protrait format

Postby greengrass on Mon Oct 27th, 2008

I am actually using the longtable package, but I don't think it allows for a column-wise split across pages (I'll be really happy if it actually does as that's exactly what I need!!) As I understand, it allows a row-wise split, e.g. a table of 15 rows can have 10 rows on one page and the remaining 5 rows on the next, in either landscape or portrait.
greengrass
 
Posts: 12
Joined: Sun Oct 26th, 2008

Re: table spanning two pages in portrait format

Postby Juanjo on Tue Oct 28th, 2008

I've had an idea that perhaps may work. It is not an automatic, nor elegant solution, but, well, see if it may help. The idea basically consists in storing the whole table in a box and then printing it two times, cropping, in order, the right and the left parts with the help of Tikz/pgf:
Code: Select all  •  Open in writeLaTeX
\documentclass{article}

\usepackage{booktabs}
\usepackage{tikz}
\usepackage{caption}

\begin{document
}

% New box register where the whole table will be stored
\newsavebox{\MyBox}

% Store the table
\begin{lrbox}{\MyBox}
\Large
\begin{tabular}{ccccc}
   \toprule
   AAAAAAAAAA & BBBBBBBBBB & CCCCCCCCCC & DDDDDDDDDD & EEEEEEEEEE \\
   aaaaaaaaaa & bbbbbbbbbb & cccccccccc & dddddddddd & eeeeeeeeee \\
   AAAAAAAAAA & BBBBBBBBBB & CCCCCCCCCC & DDDDDDDDDD & EEEEEEEEEE \\
   aaaaaaaaaa & bbbbbbbbbb & cccccccccc & dddddddddd & eeeeeeeeee \\
   \midrule
   AAAAAAAAAA & BBBBBBBBBB & CCCCCCCCCC & DDDDDDDDDD & EEEEEEEEEE \\
   aaaaaaaaaa & bbbbbbbbbb & cccccccccc & dddddddddd & eeeeeeeeee \\
   AAAAAAAAAA & BBBBBBBBBB & CCCCCCCCCC & DDDDDDDDDD & EEEEEEEEEE \\
   aaaaaaaaaa & bbbbbbbbbb & cccccccccc & dddddddddd & eeeeeeeeee \\
   \midrule
   AAAAAAAAAA & BBBBBBBBBB & CCCCCCCCCC & DDDDDDDDDD & EEEEEEEEEE \\
   aaaaaaaaaa & bbbbbbbbbb & cccccccccc & dddddddddd & eeeeeeeeee \\
   AAAAAAAAAA & BBBBBBBBBB & CCCCCCCCCC & DDDDDDDDDD & EEEEEEEEEE \\
   aaaaaaaaaa & bbbbbbbbbb & cccccccccc & dddddddddd & eeeeeeeeee \\
   \bottomrule
\end{tabular}
\end{lrbox
}

% This shows the complete table, scaled down
\scalebox{0.6}{\usebox{\MyBox}}

% Coefficient between 0 and 1 which determines the ratio between
% the left and  right parts of the table
\newcommand{\Coefficient}{0.6}

% Left part
\begin{table}[p]
   \centering
   \begin{tikzpicture}
      \clip (0,-\dp\MyBox) rectangle (\Coefficient\wd\MyBox,\ht\MyBox);
      \pgftext[left,base]{\usebox{\MyBox}};
   \end{tikzpicture}
   \caption{An example of wide table}
\end{table
}

% Right part
\begin{table}
   \ContinuedFloat
   \centering
   \begin{tikzpicture}
      \clip (\Coefficient\wd\MyBox,-\dp\MyBox) rectangle (\wd\MyBox,\ht\MyBox);
      \pgftext[left,base]{\usebox{\MyBox}};
   \end{tikzpicture}
   \caption{An example of wide table (cont.)}
\end{table}

\end{document
}
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
User avatar
Juanjo
 
Posts: 656
Joined: Sat Jan 27th, 2007


Return to General

Who is online

Users browsing this forum: No registered users and 18 guests