Avoid bottom floats on pages with footnotes

Following an old discussion about relative positioning of bottom floats and footnotes ("bottom floats above or below footnotes?"), I'd like to avoid altogether bottom floats on pages that also have footnotes.

Is it possible? Very simple question for a maybe hard answer.

Thanks in advance for any clue.

• The hard par is getting bottom floats at all. One could modify \footnote to \setcounter{bottomnumber}{0} and \footnoterule to \setcounter{bottomnumber}{1} (default). Have to test it, of course. – John Kormylo Jun 11 '18 at 19:39
• Alas, you have to set bottomnumber on the previous page for it to work. It can still be done, but than means using the aux file and everypage. – John Kormylo Jun 12 '18 at 15:39
• @JohnKormylo My TeX knowledge is not sufficient to fully understand what you mean, can you explain it more extensively, maybe with an answer? – mmj Jun 12 '18 at 17:16
• @JohnKormylo better to use \suppressfloats[b] – David Carlisle Jun 12 '18 at 17:33

Based on the great answer from John Kormylo. This version is more robust: If the text with the footnote comes at the end of the page, John Kormylos version can break because a footnote after a pagebreak might suppress the float on the former page instead. This can be avoided by moving the code into the output routine:

\documentclass{book}
\usepackage[paperwidth=4.75in,paperheight=7.25in,
textwidth=4.5in,textheight=6.5in,
marginratio=1:1]{geometry}
\usepackage[latin,english]{babel}
\usepackage{graphicx}
\usepackage{booktabs,lipsum}

\toks0{\ifvoid\footins\else\suppressfloats[b]\fi}
\output\expandafter{\the\toks0\the\output}

\begin{document}

\selectlanguage{latin}
\chapter{Errora}

\begin{figure}[htbp]
\centering
\includegraphics[width=0.3\textwidth]{example-image}
\caption{Uno pictorum}
\end{figure}
\begin{table}[b]%[htbp] %uncomment to see difference
\centering
\begin{tabular}{cccc}
\toprule
Error &Errors &error &errors\\
\bottomrule
\end{tabular}
\caption{Test}
\end{table}
\lipsum[1-6]
\end{document}

• For beginners and readers in a hurry, to be clearer, in order to avoid bottom floats on pages with footnotes just add to the preamble the two lines \toks0{\ifvoid\footins\else\suppressfloats[b]\fi} and \output\expandafter{\the\toks0\the\output}. – mmj Jun 13 '18 at 14:18
• Unfortunately the snippet wasn't able to do its job for one of my documents, I'll post a MWE as soon as I can. – mmj Jun 30 '18 at 8:11

Tip of the hat to David Carlisle.

\documentclass{book}
\usepackage[paperwidth=4.75in,paperheight=7.25in,
textwidth=4.5in,textheight=6.5in,
marginratio=1:1]{geometry}
\usepackage[latin,english]{babel}
\usepackage{graphicx}
\usepackage{booktabs,lipsum}

\let\oldfootnote=\footnote
\def\footnote{\suppressfloats[b]\oldfootnote}

\begin{document}

\selectlanguage{latin}
\chapter{Errora}

Una imagine tabula, figura et \ae nigma.\footnote{translatio via google}.
\begin{figure}[htbp]
\centering
\includegraphics[width=0.3\textwidth]{example-image}
\caption{Uno pictorum}
\end{figure}
\begin{table}[b]%[htbp] %uncomment to see difference
\centering
\begin{tabular}{cccc}
\toprule
Error &Errors &error &errors\\
\bottomrule
\end{tabular}
\caption{Test}
\end{table}
\lipsum[1-6]
\end{document}

• So the two lines in the preamble \let\oldfootnote=\footnote and \def\footnote{\suppressfloats[b]\oldfootnote} did the trick. Great, thanks! – mmj Jun 12 '18 at 18:12
• Having verified that the other solution is more robust, for correctness towards future readers I have to accept the other answer, although your contribution, as Marcel Kruger also remarks, was crucial. Thanks again. – mmj Jun 13 '18 at 12:48
• @mmj - No problem. I tested it and it definitely works better. OTOH, I can't figure out how it works. I know \output is used to split paragraphs, add footnotes and floats, but \toks0? – John Kormylo Jun 15 '18 at 16:28