Is it possible to always have a certain type of float, i.e. in my case figures or tables, come first when they end up on a float page? I don't want to change the order in the source.
1 Answer
This actually sorts the list before attempting to make the float page which could potentially have an effect on later pages as any held over tables would be tried before held over figures, but anyway it works on the one test document I tried it with.
It keeps the order of each type of float put pulls any tables out and puts them at the head of the float list.
\documentclass{article}
\makeatletter
\def\@gettable#1{%
\count@\count#1%
\divide\count@\@xxxii
\ifnum\count@=\ftype@table\relax
\@cons\@tablelist#1%
\else
\@cons\@nottablelist#1%
\fi
}
\def \@tryfcolumn #1{%
\global \@fcolmadefalse
\ifx #1\@empty
\else
\xdef\@trylist{#1}%
\global \let \@failedlist \@empty
\begingroup
\let\@tablelist\@empty
\let\@nottablelist\@empty
\let\@elt\@gettable
\@trylist
\let\@elt\relax
\xdef\@trylist{\@tablelist\@nottablelist}%
\let \@elt \@xtryfc \@trylist
\endgroup
\if@fcolmade
\@vtryfc #1%
\fi
\fi
}
\makeatother
\begin{document}
\begin{table}[p]\centering
TTTa
\caption{ttt}
\end{table}
\begin{figure}[p]\centering
FFFa
\caption{fff}
\end{figure}
\begin{table}[p]\centering
TTTb
\caption{ttt}
\end{table}
\begin{figure}[p]\centering
FFFa
\caption{fff}
\end{figure}
\end{document}