0

I'm dealing with rotated figures on my document. I have 2 alternatives:

  1. sidewaysfigurefrom the rotating package
  2. landscape environment from the pdflscape package

I prefer the sidewaysfigure because the figure floats better, however, I'd like to get the PDF as what landscape makes. I don't like to use landscape because I have to add \afterpage{...} to avoid undesirable white space in the document before the rotated page and sometimes, is not compatible with other packages.

Is there a way, using slidewaysfigure, to rotate the PDF the page with the figure?

\documentclass[12pt,a4paper]{article}
\usepackage{blindtext}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{pdflscape}
\usepackage{afterpage}
\usepackage{rotating}
\usepackage{graphics, graphicx}

\begin{document}

\blindtext\par%
%
\begin{sidewaysfigure}%<-- Perfect placement of the figure and text before and after
\centering
\includegraphics[width=0.7\linewidth]{example-image-a}
\caption{Figure a}
\label{Fig:a}
\end{sidewaysfigure}%
%
\Blindtext\par%
%
\begin{landscape}%<-- makes undesirable withe space before the rotated page
\begin{figure}[h]
\centering
\includegraphics[width=0.7\linewidth]{example-image-b}
\caption{Figure b}
\label{Fig:b}
\end{figure}
\end{landscape}%
%
\Blindtext\par%
%
\afterpage{%<-- undesirable use
\begin{landscape}
\begin{figure}[h]
\centering
\includegraphics[width=0.7\linewidth]{example-image-c}
\caption{Figure c}
\label{Fig:c}
\end{figure}
\end{landscape}%
}%
%
\blindtext
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.