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.
1 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}
-
Is there any way to make the
afterpage
solution work if there are other non-landscape floats defined on the same page? When I try it (with or withoutclearpage
), the other non-landscape floats on the same page, even those that are defined after the landscape float, appear before it in the output. Commented Oct 25, 2011 at 3:28 -
@MikeShulman: Using
\afterpage
thelandscape
is not a real float and the\clearpage
or may some command inside\begin{landscape}
is flushing all floats. You might try theflafter
package which forces floats to only appear after where they are defined in the text, never before. Commented Oct 25, 2011 at 7:11 -
2
-
afterpage
doesn't seem to work with thechapterfolder
package. It complains about a missing file if an\input
is wrapped inside the\afterpage
macro.– gozzilliCommented Mar 20, 2015 at 17:53
pdflscape
withlandscape
environment.