25

I have some figures which I wish to display in landscape, with rotated captions.

I can achieve this fine using the sidewaysfigure environment from the rotating package.

I want to also ensure that the PDF document automatically displays in the right orientation for the reader.I can achieve this using the landscape environment from the pdflscape package.

I can't however seem to combine both of these for the effect I want. If I try encapsulating the sidewaysfigure in the landscape environment I get my graphic rotated 180 degrees (the page does display in the right orientation on screen however).

\afterpage{\begin{landscape}
\begin{sidewaysfigure}
    \centering
    \includegraphics{image}
    \caption{caption}
    \label{fig:label}
\end{sidewaysfigure}
\end{landscape}}

Doesn't work - figure displays incorrectly.

\begin{sidewaysfigure}
    \centering
    \includegraphics{image}
    \caption{caption}
    \label{fig:label}
\end{sidewaysfigure}

Figure displays correctly, but PDF document doesn't recognise that this page is landscape so displays automatically in portrait when viewed on-screen.

1
  • As of the documentation of the rotating package, the sidewaysfigure environment does already do the rotation depending on an even or odd page number. Maybe this feature was introduced later, but this package should be doing everything you want right now. Oct 7, 2021 at 11:41

3 Answers 3

24

Don't use sidewaysfigure within landscape - it will turn your figure twice. A regular figure should suffice:

\documentclass{article}
\usepackage{pdflscape}

\begin{document}

\begin{landscape}
 \begin{figure}
  \centering
  \includegraphics{image}
  \caption{caption}
  \label{fig:label}
 \end{figure}
\end{landscape}

\end{document}
2
  • Okay, I feel silly now. I thought I'd tried that. I needed to add some resizing options and play around. In the end [width=0.9\linewidth,keepaspectratio] worked for me. Thanks.
    – Jayden
    Feb 12, 2014 at 9:29
  • 2
    This solution will not float the landscape page, see tex.stackexchange.com/q/471472/36836 for a solution.
    – Daniel
    Apr 13, 2019 at 19:44
10

Although this question was seemingly answered (by @Bettina) over a year ago, I think that the complexity of the question and answer is misleading. There are two potential problems in the proposed solution:

  1. If the landscape page is placed amongst other floats, it doesn't behave nicely
  2. If the landscape page has other headers/footers, it doesn't behave nicely

I will link some helpful threads:

I think the following example illustrates how to put everything together. It works for my purposes, and the other floats around the document seem to flow properly. Now it uses the flafter package which forces floats to appear after their declaration in the text.

\documentclass{article}

\usepackage{pdflscape}
\usepackage{afterpage}
\usepackage{flafter}
\usepackage{fancyhdr}
\fancypagestyle{lscape}{% 
\fancyhf{} % clear all header and footer fields 
\fancyfoot[LE]{}
\fancyfoot[LO] {}
\renewcommand{\headrulewidth}{0pt} 
\renewcommand{\footrulewidth}{0pt}}

\begin{document}

\afterpage{
\clearpage% To flush out all floats, might not be what you want
\begin{landscape}
\thispagestyle{lscape}
\pagestyle{lscape}
\begin{figure}
\includegraphics{myfigure.pdf}
\caption{Test}
\end{figure}
\end{landscape}
}

\end{document}
0

I've had a similar problem, and found a fix.

Preamble of original file:

\documentclass[12pt]{amsart}
\usepackage{rotating}

Fix:

\RequirePackage{rotating}
\documentclass[12pt]{amsart}
%\usepackage{rotating}

So insert \RequirePackage{rotating} BEFORE \documentclass, and remove \usepackage{rotating}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .