[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: `@need` badly influences top margin
From: |
Gavin Smith |
Subject: |
Re: `@need` badly influences top margin |
Date: |
Thu, 18 Aug 2022 18:57:19 +0100 |
On Thu, Aug 18, 2022 at 11:49:56AM +0000, Werner LEMBERG wrote:
>
> [texinfo.tex version 2022-08-13.17]
>
>
> Look at the two attached documents, with and without `@need`. If
> `@need` is used, the `@section foo` title starting a new page is moved
> down a little bit for no reason.
I managed to reproduce the extra space after @need at the top of the
page.
I found with @need, the section skip was being output. This showed up
with @tracingboxes as
..@glue 12.0 plus 3.0 minus 2.0
which is the same as \secheadingskip, but this was not present without @need.
When the \vtop appears at the beginning of the page, glue and penalties
are not discarded, as the \vtop is not a "discardable item".
One possible fix is to replace the \vtop with vertical glue:
diff --git a/doc/texinfo.tex b/doc/texinfo.tex
index c7ebff708f..29f2fbc3bf 100644
--- a/doc/texinfo.tex
+++ b/doc/texinfo.tex
@@ -729,7 +729,8 @@ where each line of input produces a line of output.}
% Do a \strut just to make the height of this box be normal, so the
% normal leading is inserted relative to the preceding line.
% And a page break here is fine.
- \vtop to #1\mil{\strut\vfil}%
+ %\vtop to #1\mil{\strut\vfil}%
+ \vskip #1\mil
%
% TeX does not even consider page breaks if a penalty added to the
% main vertical list is 10000 or more. But in order to see if the
This is one of the ways that the LaTeX needspace package does it
(https://ctan.org/pkg/needspace?lang=en).
However, more testing is required. If you're aware of places where
@need makes a difference, it would help if you could check them with
this change.
I don't completely understand what is going on with \strut here either.