Skip to content

Commit

Permalink
fix typos; added another test for rollback
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankMittelbach committed Jan 31, 2025
1 parent bf36a3b commit f4d65a7
Show file tree
Hide file tree
Showing 7 changed files with 1,080 additions and 11 deletions.
2 changes: 1 addition & 1 deletion base/changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ 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
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]>
Expand Down
12 changes: 6 additions & 6 deletions base/doc/ltnews41.tex
Original file line number Diff line number Diff line change
Expand Up @@ -491,21 +491,21 @@ \subsection{Make \cs{label}, \cs{index}, and \cs{glossary} truely invisible in r

\subsection{Correct the float placement algorithm}

When floats are placed onto the current or next page, \LaTeX{} makes
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 necessary to place the float in a particular
area. This means it looks at the height of the float, but also at the
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 thespace still available on the page.
variable and compared to the space 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
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 made with a wrong (i.e., to high) value and as a
the comparison was being made with the wrong value (i.e., to high) and as a
result the test may have incorrectly concluded that a float doesn't
fit, even though in fact it did.

Expand Down
8 changes: 4 additions & 4 deletions base/ltoutput.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -3008,7 +3008,7 @@
\advance \@reqcolroom \ht\@currbox
% \end{macrocode}
% We save the current value of \cs{@reqcolroom} so that we can
% return to this value later, if a test fails that may have added
% return to this value later, in case a test fails that may have added
% something to it.
% \changes{v1.4n}{2025/01/29}{Save current value of \cs{@reqcolroom} (gh/1645)}
% \begin{macrocode}
Expand Down Expand Up @@ -4579,7 +4579,7 @@
%
%
% \begin{macro}{\saved@reqcolroom}
% Saved value of \cs{@reqcolroom}, neded when making several tests.
% Saved value of \cs{@reqcolroom}; this is needed when making several tests.
% \begin{macrocode}
%</2ekernel>
%<*2ekernel|latexrelease>
Expand Down Expand Up @@ -4841,8 +4841,8 @@
%<latexrelease|fltrace> {\@flcheckspace}{float placement calculation}%
\def \@flcheckspace #1#2{%
% \end{macrocode}
% When this test is executed the value of \cs{@reqcolroom} may be
% not longer correct due to a previous test that altered it. We
% When this test is executed, the value of \cs{@reqcolroom} may
% no longer be correct due to a previous test that altered it. We
% therefore reset it to a value saved earlier.
% \changes{v1.4n}{2025/01/29}{Reset current value of \cs{@reqcolroom} (gh/1645)}
% \begin{macrocode}
Expand Down
Loading

0 comments on commit f4d65a7

Please sign in to comment.