On Tue, Nov 10, 2026 at 05:47:33PM +0000, Gavin Smith wrote:
> On Tue, Nov 10, 2026 at 10:19:16AM +0100, Arash Esbati wrote:
> > The result (incl. the TOC page) is attached.  Note the placement of the
> > section "Variable Index" (page 5) and "Concept Index" (page 8).  Is this
> > on purpose, or can it be improved in some way?
> > 
> > TIA.  Best, Arash
> 
> Yes, that is a bug.
> 
> To explain for people who can't see these headings, the "Variable Index"
> heading is at the top of an empty page, with the actual entries of the index
> starting at the start of the next page.

I believe I have fixed this bug.  The page break is done explicitly
in \begindoublecolumns.  Here's how I checking the values used:

diff --git a/doc/texinfo.tex b/doc/texinfo.tex
index fce076ca74..cf83f8050c 100644
--- a/doc/texinfo.tex
+++ b/doc/texinfo.tex
@@ -6100,7 +6100,8 @@ might help (with 'rm \jobname.?? \jobname.??s')%
 
 \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
   % If not much space left on page, start a new page.
-  \ifdim\pagetotal>0.8\vsize\vfill\eject\fi
+  \message{---------start index at: \the\pagetotal / \the\vsize}
+  \ifdim\pagetotal>0.8\vsize\message{--------break }\vfill\eject\fi
   %
   % Grab any single-column material above us.
   \output = {%


This prints a message like:

---------start index at: 673.4825pt/ 643.2pt --------break

The problem is that the previous page wasn't quite full enough for the page
to be output.  TeX's "page builder" seems not to run again before the index
entries for the next index start, even though the additional sectioning
heading made the accumulated material for a page even longer.  

One solution appears to be to provide an extra breakpoint before the check
for how full the page is:

diff --git a/doc/texinfo.tex b/doc/texinfo.tex
index fce076ca74..6c71291159 100644
--- a/doc/texinfo.tex
+++ b/doc/texinfo.tex
@@ -6100,6 +6100,11 @@ might help (with 'rm \jobname.?? \jobname.??s')%
 
 \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
   % If not much space left on page, start a new page.
+  % The \penalty gives TeX a chance to break the page at an earlier
+  % breakpoint.  We may already be past a breakpoint where a page break
+  % would occur, and this prevents us from starting a new page when not
+  % necessary.
+  \penalty9999
   \ifdim\pagetotal>0.8\vsize\vfill\eject\fi
   %
   % Grab any single-column material above us.


> The "Concept Index" heading is at the very bottom of a page, underneath the
> entries of the previous index.  The entries for the concept index start on
> the next page after the heading.

I've fixed this issue as well.  Both issues are fixed as of texinfo.tex version
2026-11-14.13 (git commit 9a630ba01a932b6a).

Index formatting and page breaking in general in TeX is very dependent on
the exact input used and so it is possible that there are other instances
of poor output.  I did look at the ensuing auctex.pdf and it all looked good
to me but please let us know if there are any more problems.




Reply via email to