Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Float placement bug #1646

Merged
merged 11 commits into from
Jan 31, 2025
6 changes: 6 additions & 0 deletions base/changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ to completeness or accuracy and it contains some references to files that are
not part of the distribution.
================================================================================

2025-01-29 Frank Mittelbach <[email protected]>

* ltoutput.dtx (subsubsection{Float control}):
When floats are to be placed and a test fails, \@reqcolroom needs
to be reset to the value prior to the failed test (gh/1645)}

2025-01-23 Frank Mittelbach <[email protected]>

* ltoutput.dtx (subsection{Floats}):
Expand Down
23 changes: 23 additions & 0 deletions base/doc/ltnews41.tex
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,29 @@ \subsection{Make \cs{label}, \cs{index}, and \cs{glossary} truely invisible in r
%
\githubissue{1638}

\subsection{Correct the float placement algorithm}

When floats are added to the current or next page, \LaTeX{} makes
several tests to find an area that can receive the float. One of these
tests calculates how much space is already used on the page and how
much additional space is needed to place the float in a particular
area. This means that it looks not only at the height of the float but also at the
values from \cs{intextsep} (for \texttt{h} floats) or
\cs{textfloatsep} and \texttt{floatsep} (for \texttt{t} and \texttt{b}
floats). The resulting space requirement is then stored in an internal
variable and compared to the space still available on the page.

If the test fails, the algorithm tries the next area. Unfortunately,
it was reusing the value in that internal variable as the starting point
for the next test without removing the added space for the float
separation (\cs{intextsep}, \cs{floatsep}, or \cs{textfloatsep}). Thus
the comparison was being made with the wrong value (i.e., to high); therefore the test
may have incorrectly concluded that a float doesn't
fit, even though in fact it did.

This has now been corrected.
%
\githubissue{1645}


\section{Documentation}
Expand Down
Loading