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 an 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 placed onto 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 necessary to place the float in a particular
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

necessary ==> needed

area. This means it looks 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 thespace still available on the page.

If the test fails, the algorithm tries the next area. Unfortunately,
it reused the value in that internal variable as the starting point
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it reused ==> it was reusing

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really? I think 'it reused' feels OK

Copy link
Contributor

@car222222 car222222 Jan 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or "it had been" even!

And maybe need to expand what "it" is here?
Thus:

Unfortunately, this will result in the reuse of the value . . .

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new suggestion doesn't convey what I intended to say. was reusing is fine if you want that, but I'm not going to explain "it" :-)

for the next test without removing the added space for the float
separation (\cs{intextsep}, \cs{floatsep}, or \cs{textfloatsep}). Thus
the comparison was made with a wrong (i.e., to high) value and as a
result 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