# Sidewaysfigure can not place figure in the correct place

I am using the sidewaysfigure command to place a large figure in a landscape position. However, I am not able to place the figures between the texts. All figures are displaced to the end of the PDF document.

Here is the mini-example:

\documentclass{article}
\usepackage{rotating}
\usepackage{float}
\usepackage{lipsum}

\begin{document}

\section{lipsum1}

\lipsum[1-4]

\begin{sidewaysfigure}[ht]
\centering
\caption{A.}
\label{fig_A}
\end{sidewaysfigure}

\section{lipsum2}
\lipsum

\begin{sidewaysfigure}[ht]
\centering
\caption{B.}
\label{fig_B}
\end{sidewaysfigure}

\end{document}

• The placement directive [ht] has absolutely no effect: each sidewaysfigure environments is always placed on a page by itself. Your MWE is very short: one page of text and two pages of figures. Where would you expect LaTeX to place the figures (given that they must reside on a page by themselves)? – Mico Nov 19 '19 at 5:42
• You don't HAVE to use \sidewaysfigure. In fact, I would avoid it. See tex.stackexchange.com/questions/429987/… for example. – John Kormylo Nov 19 '19 at 17:19
• Actually, I am using \sidewaysfigure to rotate the caption as well as the figures. – Kernel Nov 19 '19 at 18:54

From the rotating documentation:

The package provides:

• two new environments, sidewaystable and sidewaysfigure, each of which produces a single page-size float with contents rotated ±90 degrees; ...

So sidewaysfigure always inserts a full-page figure at the next possible pagebreak. As such, position arguments like [ht] don't make any sense here. In fact, [ht] seems to break the default behaviour such that the figures appear at the end of the document, and not at the next pagebreak after the current section.

Compiling your MWE just without the two occurences of [ht] results in the expected behaviour: The first figure on page 2, the second figure as last page of the document.

\documentclass{article}
\usepackage{rotating}
\usepackage{float}
\usepackage{lipsum}

\begin{document}

\section{lipsum1}

\lipsum[1-4]

\begin{sidewaysfigure}
\centering
\caption{A.}
\label{fig_A}
\end{sidewaysfigure}

\section{lipsum2}
\lipsum

\begin{sidewaysfigure}
\centering

• Thanks a lot. I did not expect that the displacement option ht can do such weird behavior. – Kernel Nov 19 '19 at 18:51