[Tex/LaTex] Inconsistent rotations with \sidewaysfigure

double-sidedfloatsrotating

In my document I'm largely using \sidewaysfigure. However, this results pictures with inconsistent placement and direction of included pictures and captions. By inconsistent I mean that figures and captions are not rotated to one side always (eg, to the right). EG, on page 1 the caption is on the left side, and on page 2 on the right side.

MWE:

\documentclass[12pt]{book}
\usepackage{graphicx}
\usepackage{rotating} 
\usepackage{mwe} % just for dummy pictures

\begin{document}
\begin{sidewaysfigure} 
    \centering
    \includegraphics{example-image-a}
    \caption{Foo}
\end{sidewaysfigure}

\begin{sidewaysfigure} 
    \centering
    \includegraphics{example-image-b}
    \caption{Bar}
\end{sidewaysfigure}
\end{document}

output

I wonder if there is a simple option with \sidewaysfigure that would force the whole thing (pics and captions) to be rotated for 180 degrees.

Best Answer

The behaviour is perfectly consistent, in that the caption is always rotated toward the outer edge of the page. This is default if the twoside argument is given to the documentclass, which is default for the book class.

To override this, add either figuresleft or figuresleft as an (optional) argument to the rotating package, i.e.

\usepackage[figuresleft]{rotating}

as described in the manual, section 2.1:

If the twoside option has been given to the main document class (either explicitly, or implicitly as in the default for book class), the package will rotate sideways figures according to the page number (this requires at least two passes through LaTeX). If you want the twoside option, but want the figures always in one direction, use the figuresright or figuresleft options to the package.

Related Question