Skip to content

Commit

Permalink
Float placement bug (#1646)
Browse files Browse the repository at this point in the history
* fix for #1645 (WIP)

* update some tlgs

* more tlgs

* grummel

* changelog, internal rename, ltnews41

* small editorial changes

* typo

* fix typos; added another test for rollback

* add another test and correct previous one

* overlooked one suggestion
  • Loading branch information
FrankMittelbach authored Jan 31, 2025
1 parent 03bc77f commit e4a1e65
Show file tree
Hide file tree
Showing 62 changed files with 2,385 additions and 12 deletions.
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

0 comments on commit e4a1e65

Please sign in to comment.