# How to wrap text around a landscape table over multiple pages? \sidewaystable or \landscape + \longtable

I am trying to create a landscape table that breaks over multiple pages. I have successfully done this with the following:

\begin{landscape}
\begin{longtabu} to \textwidth{some columns}
\caption[my caption]{my caption}
table code here
\end{longtabu}
\end{landscape}


This does almost everything I want. I insert this code in my desired section of my document.

The problem is that the text breaks for the landscpae environment. I have a paragraph at the top of the page and then because I inserted my table code after this paragraph, the rest of the page is blank, and then on the next pages is my landscape table. I want the text to go until the end of its page and then the landscape environment to run its thing for my table.

The text will wrap if the \begin{landscape} is changed to \begin{sidewaystable}. However, sidewaystable will not break over multiple pages; it does not allow a longtable or longtabu to work.

So sideways table won't allow a longtable and landscape won't allow text wrapping.

I've searched around on here and on Google but most of the solutions are suggesting to use either sidewaystable or landscape. However, none of the solutions really address my specific problem.

Does anyone have any suggestions how to proceed?

I wish I could show an image but I'm not allowed to post one as a new user.

-
To show an image just upload it as normal but remove the ! from the markup. someone with edit privilege will fix it up so that the image shows. –  David Carlisle Jul 21 '12 at 15:14
add comment

## 1 Answer

If you are feeling brave you can use the afterpage package and go

\afterpage{\begin{landscape}.....\end{landscape}}


If the table is big (or it has any verbatim material) it is better to put it in a separate file mytable.tex and then just have

 \afterpage{\input{mytable}}


this isn't a real float but it does delay starting the table until the next page break.

-
Simple. Works. This is perfect. Thanks David! –  jnam27 Jul 21 '12 at 15:36
add comment