Rotate a single page to landscape in LaTeX (pdflscape)
Put the content into the landscape environment of the pdflscape package. It is set on pages of its own, turned by 90 degrees, and a PDF viewer shows these pages already turned.
Preamble
The snippets on this page need these lines before \begin{document}:
\usepackage{pdflscape}Turn one part of the document
The environment starts a new page, sets its content with the long side of the paper as the line width, and starts a new page again at the end. Long content continues on more landscape pages.
Text on an upright page.
\begin{landscape}
This text runs along the long side of the paper.
\end{landscape}
Text on an upright page again.A wide table on a landscape page
A table or figure float inside the environment is placed on the landscape pages and keeps its caption and number.
\begin{landscape}
\begin{table}
\centering
\caption{Monthly values}
\begin{tabular}{lrrrrrrrrrrrr}
\hline
& Jan & Feb & Mar & Apr & May & Jun & Jul & Aug & Sep & Oct & Nov & Dec \\
\hline
2023 & 120 & 135 & 150 & 148 & 160 & 171 & 180 & 176 & 165 & 150 & 140 & 131 \\
2024 & 125 & 139 & 158 & 151 & 166 & 178 & 189 & 181 & 170 & 157 & 144 & 136 \\
\hline
\end{tabular}
\end{table}
\end{landscape}pdflscape or lscape
Both packages provide the same landscape environment and print the same page. lscape only turns the content, so on screen you read it with your head tilted. pdflscape also marks the page as rotated in the PDF file.
Pitfalls
- Only the text area is turned. The header and the page number stay where they are on an upright page, so on screen they appear at the side.
- Because of the page break before and after the environment, the page before it can end half empty.
- To turn only one table or figure and let LaTeX fill the rest of the pages, use
sidewaystableorsidewaysfigurefrom therotatingpackage, see Rotate a table in LaTeX.
Compiled with pdfLaTeX from TeX Live 2023.
Related pages
- Package
pdflscape - Package
rotating - How-to Rotate a table in LaTeX
- How-to Set paper size and orientation in LaTeX
- How-to Fit a table that is too wide in LaTeX