I am setting a figure in landscape and then two other figures in normal mode. However, the landscape figure goes between the normal figures and the numbering gets messed up, including in the table of contents. How do I avoid the numbers being in the wrong order?
Unfortunately, I was not able to create a minimal example where this happens. Here is the structure of what I am using:
\clearpage
\begin{landscape}
% figure 2
\end{landscape}
% figure 1
% figure 3
I'll tried with and without \clearpage before and after the landscape environment.
Edit:
Due to the comment by David, I saw that it is actually the following that causes the problem:
\afterpage{
\clearpage
\begin{landscape}
% figure 2
\end{landscape}
}
% figure 1
% figure 3
Edit 2:
Finally, a minimal example:
\documentclass{article}
\usepackage{blindtext}
\usepackage{afterpage}
\usepackage{pdflscape}
\usepackage{float}
\begin{document}
\listoffigures
\clearpage
\blindtext[4]
\afterpage{
\begin{landscape}
\begin{figure}
... figure contents ...
\caption{Figure 1}
\end{figure}
\end{landscape}
}
\begin{figure}
... figure contents ...
\caption{Figure 2}
\end{figure}
\begin{figure}[H]
... figure contents ...
\caption{Figure 3}
\end{figure}
\blindtext[4]
\end{document}
Note: Removing the [H] option of the third figure produces a whole page for just one small figure which isn't desired.
Edit 3:
Removing the [H] option does not change the order of figures either.
Edit 4:
For reference, here is what seems to be the result I was looking for: https://tex.stackexchange.com/a/472608/36836
\clearpagewon't do anything aslandscapedoes\clearpageitself but no floats should go out of sequence. Please show an example. – David Carlisle Jul 01 '18 at 19:47landscapeshould not make floats go out of sequence which might indicate that I have messed up my document in some other way. I cannot post my whole document here. But if I have managed to reproduce it in another example, I'll post it here... – Daniel Jul 02 '18 at 08:26\afterpage{...}surrounding thelandscapeenvironment (including the\clearpage!) - I guess to not cut off a page suddenly. Moving the\clearpagein front of the\afterpagecommand does the trick. Is this the way to go? – Daniel Jul 02 '18 at 09:15\afterpageis to move things out of sequence than yes it will move things out of sequence. Almost certainly not using\afterpageis the way to go but hard to say in general. – David Carlisle Jul 02 '18 at 10:00\afterpagewas to get the text before and after a landscape page to "float" nicely so to not get any larger vertical space. Do you know of a better alternative to this? – Daniel Jul 02 '18 at 11:58\clearpagebefore that you force a page break anyway, and do note the afterpage documentation for the general robustness of that package.,,, – David Carlisle Jul 02 '18 at 12:04\clearpagebefore\afterpagedoesn't make sense. So I removed it again. Figure 1 is output as the last figure before the page break to the landscape page, if that is what you meant. So, I guess I am stuck with manually labelling the figures if I want the landscape page to "float", right? – Daniel Jul 02 '18 at 12:31\begin{figure}[p]for figure 1 (you still haven't shown a usable example so it's hard to say what should and should not work) – David Carlisle Jul 02 '18 at 12:49