[Tex/LaTex] How to wrap text around landscape page

landscapewrap

I have from time to time a landscape page. I would like that text around it just normally flows. So something how figure environment works. So that it is not really important where you exactly define the figure, LaTeX moves it around so that text nicely flows. With landscape it does not do that.

Best Answer

It depends a little on the kind of landscape page you want to create. The easiest way to do it is to put your landscape material into a caption-less [p] float (except it is a figure or table which should have a caption). Without the caption the float number isn't increased so it doesn't affect other, "real" floats.

You can create the landscape mode then by yourself by rotating the content. If this is a image use \includegraphics[angle=90,width=\textheight]{file}. For text you can use the following code or something similar. With this method the header and footer of the landscape page will not be different then on other pages. This might be want you want or not.

(The lipsum package and macros are just for adding a dummy text to show the result and are not required in the final document.)

\documentclass{article}

\usepackage{graphicx}
\usepackage{lipsum}% for dummy text

\begin{document}

\lipsum[1-10]

\begin{figure}[p]
   \rotatebox{90}{%
     \begin{minipage}{\textheight}%
         % your text
         \lipsum[1-5]
     \end{minipage}%
  }%
  % No caption, then the figure number is not changed
\end{figure}

\lipsum[1-10]
\end{document}

If the minipage contains any special things like verbatim material you need to use either \Rotatebox from the realboxes package or the adjustbox macro or environment from the adjustbox package to do the rotation (and even the minipage:
\begin{adjustbox}{minipage=\textheight,angle=90} ... \end{adjustbox})


Or you can use the afterpage package and macro to place the landscape content onto the next page. This doesn't allow for verbatim content but for the use of pdflscape which rotates the pages also inside the PDF viewer:

\documentclass{article}

\usepackage{lipsum}% for dummy text
\usepackage{afterpage}
\usepackage{pdflscape}

\begin{document}

\lipsum[1-10]

\afterpage{%
  \clearpage% To flush out all floats, might not be what you want
  \begin{landscape}
  \lipsum[1-5]
  % must not include verbatim content
  \end{landscape}
}

\lipsum[1-10]
\end{document}
Related Question