On Sun, Sep 26, 2021 at 05:56:57AM +0000, Werner LEMBERG wrote: > As the attached output shows, the formatting is quite bad, and I think > it is a bug that the last line of the verbatim environment is split > off and positioned on the next page – at least I can't see a reason > for this bizarre behaviour.
I agree. I put @tracingpages on and got the following in the log file for a test file:- > \box255= @vbox(643.2+0.0)x433.62, glue set 153.47632fill .@glue(@topskip) 29.30833 .@hbox(6.69167+0.0)x433.62, glue set 393.21507fil ..@glue(@leftskip) 28.90755 ..@hbox(0.0+0.0)x0.0 ..@texttt 1 ..@texttt 4 ..@hbox(0.0+0.0)x0.0 ..@penalty 10000 ..@glue(@parfillskip) 0.0 plus 1.0fil ..@glue(@rightskip) 0.0 .@penalty 10000 .@glue 6.0 plus 2.0 minus 2.0 .@penalty 10000 .@glue 3.0 plus 2.0 minus 1.0 .@penalty 10000 .@glue(@parskip) 3.0 plus 2.0 minus 1.0 .@glue(@lineskip) 1.09993 .@hbox(434.62375+0.0)x433.62, glue set 283.0575fil ..@pdfrefximage(434.62375+0.0)x150.5625 ..@penalty 10000 ..@glue(@parfillskip) 0.0 plus 1.0fil ..@glue(@rightskip) 0.0 .@glue 6.0 plus 2.0 minus 2.0 .@glue 0.0 plus 1.0fill This is for the second page. I believe it was the @penalty 10000 after the first @hbox that suppressed the page break. I believe this came from the definition of @image. I also found the same problem with @example and I expect other display environments would have been affected too. I've attempted to fix it with the following change (commit a9aacb0b39): ff --git a/doc/texinfo.tex b/doc/texinfo.tex index fdd4fbe498..f941c04bef 100644 --- a/doc/texinfo.tex +++ b/doc/texinfo.tex @@ -9403,7 +9403,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% \fi\fi % \ifimagevmode - \nobreak\medskip + \medskip % Usually we'll have text after the image which will insert % \parskip glue, so insert it here too to equalize the space % above and below. It would be helpful if you could test it as TeX's page breaking can be difficult to understand.