A slightly more complete version to the accepted answer would be to create an environment that turns the page back to portrait:
\newenvironment{rotatepage}%
{\clearpage\pagebreak[4]\global\pdfpageattr\expandafter{\the\pdfpageattr/Rotate 90}}%
{\clearpage\pagebreak[4]\global\pdfpageattr\expandafter{\the\pdfpageattr/Rotate 0}}%
And then \begin{rotatepage} <the content on this page is turned 90°> \end{rotatepage}
.
But we can extend this further. We might want to use the features provided by the rotating
package. And we might use documents that use different margins for odd and even pages. Then an automated solution that turns the page by 90° or 270° respectively would be nice. An example using KOMA script:
\documentclass[twoside]{scrreprt}
\usepackage{scrextend,rotating}
\makeatletter
\newenvironment{rotatepage}
{%
\if@twoside%
\ifthispageodd{\pagebreak[4]\global\pdfpageattr\expandafter{\the\pdfpageattr/Rotate 90}}{%
\pagebreak[4]\global\pdfpageattr\expandafter{\the\pdfpageattr/Rotate 270}}%
\else%
\pagebreak[4]\global\pdfpageattr\expandafter{\the\pdfpageattr/Rotate 90}%
\fi%
}%
{\pagebreak[4]\global\pdfpageattr\expandafter{\the\pdfpageattr/Rotate 0}}%
\makeatother
And then \begin{rotatepage}\begin{sidewaystable} <the content on this page is turned 90°> \end{sidewaystable}\end{rotatepage}
Finally, we can combine rotatepage
and the environments provided by the rotating
package. If we want to turn pages automatically that use sidewaytable
, we can hook the rotatepage
environment into sidewaytable
with etoolbox
. In addition to the code above we would need:
\BeforeBeginEnvironment{sidewaystable}{\begin{rotatepage}}
\AfterEndEnvironment{sidewaystable}{\end{rotatepage}}
Of course, similar adjustments could be made for sidewaysfigure
etc.
table
orfigure
, or does the landscape page form part of the regular text flow, but you just want it rotated?