[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: '@need' command buggy since 2022-08-21.14
From: |
Gavin Smith |
Subject: |
Re: '@need' command buggy since 2022-08-21.14 |
Date: |
Wed, 30 Nov 2022 11:11:36 +0000 |
On Tue, Nov 29, 2022 at 05:29:47PM +0100, Vincent Lefevre wrote:
> Consider the following testcase:
>
> \input texinfo @c -*-texinfo-*-
> @afourpaper
> @page
> A
> @sp 31
> B
> @need 800
> C
> @sp 17
> D
> @bye
>
> to be compiled with texi2pdf. As of texinfo.tex 2022-08-21.14[*],
> the output is incorrect: more than 3 inches remain after line B on
> the first page, but line C appears on a new page while "@need 800"
> requires only 8/10 inches.
I've had time to investigate this more. The reason that line C appears
on a new page is that if line C appeared at the previous page, then the
page contents would be too short. Apparently, a break after the @sp
is not considered. Then a break is considered after line D, and this
would lead the page to be too long. The only place the break can occur
is after the @need line, which allows space at the bottom of the page.
You can see this with the tweaked output:
\input texinfo
@afourpaper
@tracingpages=1
@page
A
@sp 31
B
@need 800
C@par
@penalty2
@sp 17
D@par
@penalty3
@bye
In the log file, we have:
%% goal height=717.2, max depth=4.0
% t=0.0 g=717.2 b=10000 p=0 c=100000#
% t=44.0 g=717.2 b=10000 p=0 c=100000#
% t=469.3999 plus 2.0 minus 1.0 g=717.2 b=10000 p=0 c=100000#
% t=469.3999 plus 60.21533 minus 1.0 g=717.2 b=6961 p=-100 c=6861#
% t=527.61523 plus 2.0 minus 1.0 g=717.2 b=10000 p=9999 c=100000
% t=469.3999 plus 2.0 minus 1.0 g=717.2 b=10000 p=0 c=100000
% t=485.5999 plus 4.0 minus 2.0 g=717.2 b=10000 p=2 c=100000
% t=726.19984 plus 6.0 minus 3.0 g=717.2 b=* p=3 c=*
[1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}]
The line with p=2 is breaking after line C, and the p=3 line is breaking
after line D. The 60.21533 is the .800 inches in points.
I believe the b=6861 is approximately
((717.2-469.3999)/60.21533)^3 * 100 (=6969.19000).
Hence, for the input you sent, the only way to get a line break before
the C would be to modify @sp to allow a break after it. If the
example above is changed to
\input texinfo
@afourpaper
@tracingpages=1
@page
A
@sp 31
B
@need 800
C@par
@penalty2
@sp 17
@penalty1
D@par
@penalty3
@bye
then the page break does occur before the C.
As you can tell, this is timeconsuming for me to investigate. I doubt
the case with @sp is very important. @sp is not used very much in manuals
and its purpose is not to help with page breaks.
Would you be able to construct a test case using just the content on
the two pages where the bad break occurs. Then we could investigate
why the page break is not taken at a point later than the @need line.