0

I'm using the pdflscape package to create a document with several sections that need to be in landscape. I am seeing strange behavior with figure floats.

I would like to use htp for figure positioning, but I'm noticing that:

  1. At a certain size (I'm guessing where the float algorithm chooses p), the float gets rotated in a strange location when it probably should fit fine in the page.

    enter image description here

  2. If we force t!, the float seems to fit fine, but gets placed on its own page at the end of the section (like I would expect p to do).

    enter image description here

I want the appearance of #2 (landscaped image), but in the location of #1 (on the next page in the text). Is this possible?

Example code:

\documentclass{article}

\usepackage{graphicx} \usepackage{blindtext} \usepackage{pdflscape}

\begin{document}

\section{Initial content}

\blindtext[2]

\begin{landscape}

\section{Landscape content}

\begin{figure}[htp] \centering \includegraphics[scale=0.9]{example-image} \caption{The Universe} \end{figure}

\blindtext[5]

\begin{figure}[htp] \centering \includegraphics[scale=1.3]{example-image} \caption{The Universe} \end{figure}

\blindtext[4]

\begin{figure}[t!] \centering \includegraphics[scale=1.3]{example-image} \caption{The Universe} \end{figure}

\blindtext[4]

\blindtext[4]

\end{landscape}

\end{document}

  • 2
    you should better use example-image instead of your picture as it sizes change if you embed it like this. – Ulrike Fischer Apr 05 '21 at 17:35
  • Can you clarify? I included the example image at the bottom of my post. Are you saying Stack Exchange resizes it? – Neal Kruis Apr 05 '21 at 17:47
  • well download the image and try yourself: if is much too large. – Ulrike Fischer Apr 05 '21 at 17:50
  • I really have no idea what you're getting at. I downloaded the file and it is the exact same image I am using in my example (except that SE renames it). The original file came from Overleaf. You can see the example here: https://www.overleaf.com/read/jzbqywccfcdj – Neal Kruis Apr 05 '21 at 18:30
  • really? that is curious, I get an image that is much too large. I had to use a scale factor from around 1 to get it on the page. In any case: [ht!] should work if the image is small enough, you can also set locally \textfloatsep= 0pt to avoid that it is added to the float size. – Ulrike Fischer Apr 05 '21 at 18:41
  • 1
    It is still easier for people to test if you use example-image (and adjust the scaling if necessary so the problem shows) – David Carlisle Apr 05 '21 at 21:43
  • Ahh...now I understand what you're getting at. Until you formatted "example-image", I thought you were talking vaguely about an example image (e.g., the one I provided). I didn't know this feature existed. Apologies for my lack of awareness. I've updated my example image to be "example-image". Here's a helpful link in case anyone else has the same confusion: https://tex.stackexchange.com/a/231741/25541 – Neal Kruis Apr 05 '21 at 22:00
  • I realized that my question was already answered here: https://tex.stackexchange.com/a/127546/25541. I flagged my questions as a duplicate. – Neal Kruis Apr 08 '21 at 22:55

0 Answers0