LaTeX forum ⇒ Generaltable spanning two pages in portrait format

LaTeX specific issues not fitting into one of the other forums of this category.
greengrass
Posts: 12
Joined: Sun Oct 26, 2008 1:22 am

table spanning two pages in portrait format

Postby greengrass » Sun Oct 26, 2008 1:31 am

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 27, 2008 1:12 am, edited 1 time in total.

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany

Postby localghost » Sun Oct 26, 2008 10:19 am

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

Link:
BBcode:
HTML:
Hide post links
Show post links

greengrass
Posts: 12
Joined: Sun Oct 26, 2008 1:22 am

Postby greengrass » Mon Oct 27, 2008 1:01 am

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.

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
Juanjo
Posts: 656
Joined: Sat Jan 27, 2007 12:46 am

Postby Juanjo » Tue Oct 28, 2008 2:21 am

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:
  1. \documentclass{article}
  2.  
  3. \usepackage{booktabs}
  4. \usepackage{tikz}
  5. \usepackage{caption}
  6.  
  7. \begin{document}
  8.  
  9. % New box register where the whole table will be stored
  10. \newsavebox{\MyBox}
  11.  
  12. % Store the table
  13. \begin{lrbox}{\MyBox}
  14. \Large
  15. \begin{tabular}{ccccc}
  16. \toprule
  17. AAAAAAAAAA & BBBBBBBBBB & CCCCCCCCCC & DDDDDDDDDD & EEEEEEEEEE \\
  18. aaaaaaaaaa & bbbbbbbbbb & cccccccccc & dddddddddd & eeeeeeeeee \\
  19. AAAAAAAAAA & BBBBBBBBBB & CCCCCCCCCC & DDDDDDDDDD & EEEEEEEEEE \\
  20. aaaaaaaaaa & bbbbbbbbbb & cccccccccc & dddddddddd & eeeeeeeeee \\
  21. \midrule
  22. AAAAAAAAAA & BBBBBBBBBB & CCCCCCCCCC & DDDDDDDDDD & EEEEEEEEEE \\
  23. aaaaaaaaaa & bbbbbbbbbb & cccccccccc & dddddddddd & eeeeeeeeee \\
  24. AAAAAAAAAA & BBBBBBBBBB & CCCCCCCCCC & DDDDDDDDDD & EEEEEEEEEE \\
  25. aaaaaaaaaa & bbbbbbbbbb & cccccccccc & dddddddddd & eeeeeeeeee \\
  26. \midrule
  27. AAAAAAAAAA & BBBBBBBBBB & CCCCCCCCCC & DDDDDDDDDD & EEEEEEEEEE \\
  28. aaaaaaaaaa & bbbbbbbbbb & cccccccccc & dddddddddd & eeeeeeeeee \\
  29. AAAAAAAAAA & BBBBBBBBBB & CCCCCCCCCC & DDDDDDDDDD & EEEEEEEEEE \\
  30. aaaaaaaaaa & bbbbbbbbbb & cccccccccc & dddddddddd & eeeeeeeeee \\
  31. \bottomrule
  32. \end{tabular}
  33. \end{lrbox}
  34.  
  35. % This shows the complete table, scaled down
  36. \scalebox{0.6}{\usebox{\MyBox}}
  37.  
  38. % Coefficient between 0 and 1 which determines the ratio between
  39. % the left and right parts of the table
  40. \newcommand{\Coefficient}{0.6}
  41.  
  42. % Left part
  43. \begin{table}[p]
  44. \centering
  45. \begin{tikzpicture}
  46. \clip (0,-\dp\MyBox) rectangle (\Coefficient\wd\MyBox,\ht\MyBox);
  47. \pgftext[left,base]{\usebox{\MyBox}};
  48. \end{tikzpicture}
  49. \caption{An example of wide table}
  50. \end{table}
  51.  
  52. % Right part
  53. \begin{table}
  54. \ContinuedFloat
  55. \centering
  56. \begin{tikzpicture}
  57. \clip (\Coefficient\wd\MyBox,-\dp\MyBox) rectangle (\wd\MyBox,\ht\MyBox);
  58. \pgftext[left,base]{\usebox{\MyBox}};
  59. \end{tikzpicture}
  60. \caption{An example of wide table (cont.)}
  61. \end{table}
  62.  
  63. \end{document}
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.

Link:
BBcode:
HTML:
Hide post links
Show post links


Return to “General”

Who is online

Users browsing this forum: Yahoo [Bot] and 4 guests