Graphics, Figures & TablesPage breaking and landscape longtables

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Matt
Posts: 2
Joined: Fri May 27, 2011 12:25 pm

Page breaking and landscape longtables

Post by Matt »

Hello

I would like a particular behaviour in my document and I can't find anything about how to achieve it.

I have a couple of longtables in my document, which are wide enough to require empty landscape pages. I put them in with the code below. I would like the pages this produces to slot nicely into the document. I envision latex finishing the page on which I first reference the table, then slotting in my landscape pages with the long tables on them, then continuing with the rest of the document.

I don't believe that longtables can be put into floats if they require more than one page. So at the moment I just move the longtable around to a reasonable place in each draft, however this always leaves a blank space after the final paragraph on the page before the table when \clearpage is encountered.

Is it even possible to manage what I want? I'd be grateful for any suggestions.
  • \pagestyle{empty}
    \newgeometry{left=1cm,right=1cm,top=1.5cm,bottom=1cm,ignoreall=TRUE,noheadfoot=TRUE,nomarginpar=TRUE}\clearpage
    \begin{landscape}
    \input{./Tables/myTable.tex}
    \end{landscape}
    \restoregeometry
    \pagestyle{fancy}
Where myTable looks like
  • \small
    \begin{longtable}{rcccrrrrrrrrclp{7cm}}
    \caption[A caption]{A longer caption} \label{tbl:lable} \\
    \toprule
    %%%The first header \\*
    \midrule
    %
    \endfirsthead
    \hline\endfoot
    \endlastfoot
    \toprule
    %%% Further page header
    \midrule
    \endhead
    %
    %A very long, quite wide table
    %
    \bottomrule
    \end{longtable}%
    \normalsize

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

Matt
Posts: 2
Joined: Fri May 27, 2011 12:25 pm

Page breaking and landscape longtables

Post by Matt »

I have an answer:

Use the afterpage package to start the landscape environment after the end of the current page.

Code: Select all

\afterpage{
\pagestyle{empty}
\begin{landscape}
\input{./Tables/myLongTable.tex}
\end{landscape}
\pagestyle{fancy}
}
I'd like to adjust the page margins using the geometry package so the long table is centred and also wider, but I can find no way to restore the original page settings on the page immediately following the landscape pages.
Post Reply