On Mon, Dec 15, 2025 at 01:04:22AM +0100, Patrice Dumas wrote:
> On Sun, Dec 14, 2025 at 09:35:55PM +0000, Dimitris Papavasiliou wrote:
> > Thank you for looking into this so quickly!  I tried installing
> > Texinfo from the master branch and processing my documentation with
> > it.  I can confirm the issues are gone with the following exceptions.
> > (I've adapted "sample.texi", and attached it again, along with a new
> > LaTex PDF.)
> > 
> > 2. While the appendix shows up correctly in the contents and headings
> > now, it is still typeset as "Chapter A" in references. See pg. 3.  (I
> > had spotted that before, but forgot to mention it; sorry for that.)
>  
> The above issue should be fixed by the latest commit.
> 
> > 1. It looks like the last page of the chapter preceding the appendix
> > now has an error in the heading.  It reads "Appendix" instead of
> > "Chapter".  See pg. 3.
> >
> > 3. Headings in the unnumbered chapters following the appendix, seem to
> > lag behind.  See pp. 7-8, 11-2.
> 
> Indeed, I see those two issues.  It is somewhat strange that the first
> one corresponds to headings anticipating, while the second one
> corresponds to headings lagging...

The first issue appears to be easily fixable by adding a single line
to the output file:

\newtitlemark{\Texinfoheadingchaptername}%

The existing output of "Chapter" or "Appendix" in the heading is completely
wrong: TeX often continues to process output for a following page before
the current page has been finalised, as it has not decided at which point
to break the page.  This means definitions for the following pages may
be active at the point in time the page is output, which is when the headings
are set.  The "marks" mechanism of TeX exists for exactly this problem.

You can see by adding a "\show\botmark" line somewhere in the file the
definitions that are placed in the "mark":

> \botmark=\botmark:
{\protect \@namedef {chaptertitle}{{An Appendix}}\protect \@namedef {thechapter
}{A}\protect \@namedef {ifthechapter}{\protect \ttl@naerror  {\ifthechapter}}\p
rotect \@namedef {sectiontitle}{}\protect \@namedef {thesection}{}\protect \@na
medef {ifthesection}{\protect \@secondoftwo }\protect \@namedef {ttl@running}{{
\ttl@enccode }}\protect \@namedef {Texinfoheadingchaptername}{Appendix}}{\prote
ct \@namedef {chaptertitle}{{An Appendix}}\protect \@namedef {thechapter}{A}\pr
otect \@namedef {ifthechapter}{\protect \ttl@naerror  {\ifthechapter}}\protect 
\@namedef {sectiontitle}{}\protect \@namedef {thesection}{}\protect \@namedef {
ifthesection}{\protect \@secondoftwo }\protect \@namedef {ttl@running}{{\ttl@en
ccode }}\protect \@namedef {Texinfoheadingchaptername}{Appendix}}\let \ttl@mb@w
arn \relax .

I haven't read the titleps documentation in any detail and am not familiar
with how the marks mechanism may differ in LaTeX and/or titleps from plain
TeX.  However, the main fact you need to understand is that the definitions in
a mark stay with the mark's location on a page.  This means these definitions
can be retrieved after a page breaking decision is made and the heading
line is output, even if subsequent redefinitions are made in marks on later
pages.

Reply via email to