26

Unfortunately my table is too wide to use longtable.

In sideways it fits on width.

Unfortunately it's too long to fit on one page.

Is there something like sidewayslongtable, a way to combine sideways with longtable ?

P.S. I use pdflatex. 'pdflscapes' (and 'lcapes') are almost perfect except one thing: they do not only rotate content of page (like sideways) but also page itself. I would like to rich result, as proposed 'pdflscapes'+'longtable' but without pages being rotated.

4
  • 1
    This is a duplicate of Table and Multipage.
    – Alan Munn
    Commented Feb 11, 2012 at 19:34
  • 4
    Is it, really? What he wants is a sideway (rotated) table continuing from one page to another, not a large table split on two pages (and possibly continuing on two other pages). Commented Feb 11, 2012 at 20:05
  • o far, I've split it manually. But I am looking forward more automatic solutions for future tables. I used to generate reports automatically, so automatic solution for splitting tables would be great addition. Commented Feb 11, 2012 at 20:14
  • 1
    @Jean-ChristopheDubacq I think you're right.
    – Alan Munn
    Commented Feb 11, 2012 at 20:14

3 Answers 3

18

Expanding on David's answer, you can use the lscape (or pdflscape) package to put a longtable into a series of landscape pages.

If you use the lscape package, the content of pages is rotated; if you use the pdflscape package, the physical pages in the PDF are also rotated.

Here's a schematic example:

\documentclass{article}
\usepackage{pdflscape} % or {lscape}
\usepackage{longtable}
\begin{document}
\begin{landscape}
\begin{longtable}
...
\end{longtable}
\end{landscape}
\end{document}

Crucially you can't use the table environment here, but the longtable package provides a \caption command to add captions to the table and the TOC for these sorts of tables.

8
  • 3
    Longtable has it's own caption command that should work here Commented Feb 11, 2012 at 20:27
  • It's almost was I am looking for, without one detail : not only contents is rotated, those pages are rotated! I am looking for solution, which will rotate contents (like sideways not pages it-self). Even thou, it's very interesting to now about such option :). Commented Feb 11, 2012 at 20:33
  • The lscape pacckage rotates just the content, I think. The pdflscape package just adds the extra functionality of rotating the physical pages.
    – Alan Munn
    Commented Feb 11, 2012 at 20:35
  • 1
    The rotation of the pages is only a matter of your PDF reader, as far as the headers and footes are where you want to have them (which is, I suppose, on the sorter sides).
    – yo'
    Commented Feb 11, 2012 at 20:37
  • @DavidCarlisle Thanks. I forgot about that. I've updated the answer.
    – Alan Munn
    Commented Feb 11, 2012 at 20:37
8

I think you are looking for the lscape package.

4
  • 3
    This is a funny forum here: quite often, somebody with deep knowledge of TeX & Friends puts the whole thing on the right track. And others refine the answer to make it easier to use those wonderfull packages. Maybe this is an upside of (La-, Con-, Lua-)TeX which is not reckognized often enough: we depend on cooperation.
    – Keks Dose
    Commented Feb 11, 2012 at 21:41
  • 1
    Actually I have problems with 'lscapes' (it "eats" pages, leaving only last in document), but it is not a problem, cause pdflscapes work. There is different problem : both packages rotates not only content, but pages as well. Is there a way to achieve the same effect as pdflscape, but without rotating pages (just content, like sideways does) ? Commented Feb 12, 2012 at 12:29
  • 1
    I don't know what you mean by rotating pages not content. lscape just rotates the page body leaving the page header and footer in their original portrait orientation. (For reading on screen the pdf viewer may rotate the page so the main content is more readable but tjis shouldn;t affect printing. Commented Feb 12, 2012 at 13:01
  • 2
    lscape is a supported part of the latex distribution, so if you can make a miminmal example where it goes wrong please run latex latexbug and follow the instructions to send in a bug report (category graphics) and I'll see what I can do. Commented Feb 12, 2012 at 14:34
1

If you use pdflatex (not latex), it is possible to change the papersize midway of a document (I hacked geometry.sty, which you are surely using already, just to do that). My solution is not compatible with many output hacks (afterpage, for example; I am not sure how floats would work, too). If this fits your use case (i.e. you are not stuck with dvi or postscript because of PStricks, for example), just leave a comment for more details (basically, you need to redefine margins and paper size). This way, you have pages in landscape mode in the middle of your document. This is one solution, I am sure there are others.

2
  • Do I understand correctly, you mean changing size for whole document ? I would need to put this table inside of a book, so I can not change geometry for whole document. Commented Feb 11, 2012 at 20:17
  • The only thing that comes to my mind, you might think about is : generating pages with table separately on "landscape" pages, next - includepdf . It's interesting workaround :). However, lest look for most integrated solution. Commented Feb 11, 2012 at 20:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .