In a book, I have some figures, that are so big that they get their own [p] page. If possible (by restrictions of the next chapter for example or some other semantics), I would prefer having figures on even pages (on the left). I know I can force them to be there, but then I ignore all other rules related to figure positioning. Is there a way to make figure pages prefer even pages?
1 Answers
The following document would position floats on pages 2, 3, 5 and 7
but adding the definition shown makes it defer float page choices on odd pages so they get placed on pages 2, 4 and 6
\documentclass{article}
\let\eject\relax% just in this example
\makeatletter
\def@floatplacement{\global@topnum\c@topnumber
% Textpage bit, global:
\global@toproom \topfraction@colht
\global@botnum \c@bottomnumber
\global@botroom \bottomfraction@colht
\global@colnum \c@totalnumber
% Floatpage bit, local: don't let floats on to odd numbered p pages
@fpmin \ifodd\c@page\maxdimen\else\floatpagefraction@colht\fi
}
\makeatother
\begin{document}
\input{story}
\begin{figure}[p]
\centering
\write300{float on page \thepage}
\rule{3cm}{12cm}
\caption{a figure}
\end{figure}
\input{story}
\begin{figure}[p]
\centering
\write300{float on page \thepage}
\rule{3cm}{12cm}
\caption{a figure}
\end{figure}
\input{story}
\begin{figure}[p]
\centering
\write300{float on page \thepage}
\rule{3cm}{4cm}
\caption{a figure}
\end{figure}
\input{story}
\begin{figure}[p]
\centering
\write300{float on page \thepage}
\rule{3cm}{8cm}
\caption{a figure}
\end{figure}
\input{story}\input{story}
\begin{figure}[p]
\centering
\write300{float on page \thepage}
\rule{3cm}{4cm}
\caption{a figure}
\end{figure}
\begin{figure}[p]
\centering
\write300{float on page \thepage}
\rule{3cm}{4cm}
\caption{a figure}
\end{figure}
\input{story}\input{story}
\end{document}
- 757,742


pis used, so you could add a test at that point if page is even act as if the float is too large and defer it, but you can't say defer or not depending on anything on future pages. – David Carlisle Jan 15 '24 at 18:26