5

One of the figures, e.g. Figure 3, in my document takes up a whole page so is located on the following page to where it is referenced. This leaves a large blank space on the page before and so I am trying to continue the document before the Figure 3 on the next page. However, I have another Figure, Figure 4, following on shortly after. If I try to place this on the page before the full page image, it is re labelled as Figure 3. Is there a way to keep this as Figure 4 even though it will be shown in the document before Figure 3?

ERW
  • 269
  • Not really no. They are placed via a queue, thus first in first out. You might want to move the floats around in the source code to change the order. – daleif May 11 '15 at 12:20
  • 2
    Wouldn't it be confusing to have Figure 4 before Figure 3? ;-) –  May 11 '15 at 12:21
  • The figures have numbers so that it's easy to find them, so having them in another order would just be confusing. If you have to do either, I would say it's better to refer to Figure 4 before you refer to Figure 3. – pst May 11 '15 at 12:32
  • 1
    Maybe it's me, but can't you just switch the captions? Or must the big image be called Figure 3 at all costs? :D – Alenanno May 11 '15 at 12:46
  • why are you getting "a large blank space on the page before"? the whole point of the figure mechanism is that latex adjusts the position of figures to avoid exactly that happening. Is there some markup you are not telling us about? Please show a sample document (as in Werner's example) that shows the problem. – David Carlisle May 11 '15 at 13:46

1 Answers1

1

Of course you can, if you manipulate the counters:

enter image description here

\documentclass{article}
\usepackage{afterpage,graphicx,lipsum,float}
\newsavebox{\pagefigure}
\begin{document}
\lipsum[1]
\afterpage{%
  \vspace*{\fill}
  \begin{figure}[H]
    \centering
    \includegraphics[width=.8\linewidth,height=.7\textheight]{example-image-a}
    \caption{Another figure}
    \addtocounter{figure}{2}% "A figure appears after this one"
  \end{figure}
  \vfill
  \clearpage
}
\begin{figure}[htb]
  \stepcounter{figure}% "A figure appears before this one"
  \centering
  \includegraphics[width=.5\linewidth]{example-image-b}
  \caption{An image}
  \addtocounter{figure}{-2}% Revert to tradition figure sequence
\end{figure}
\lipsum[2-5]
\end{document}

The above technique requires you to know the figure order and therefore the counter sequence; something that goes against "leaving things to (La)TeX".

A better approach would be to retain the figure numbering by use \afterpage without the counter adjustments, as suggested in Clearpage without pagebreak?.

Werner
  • 603,163