On Sat, Dec 06, 2025 at 11:30:55PM +0100, Patrice Dumas wrote:
> On Sat, Dec 06, 2025 at 11:17:31PM +0100, Patrice Dumas wrote:
> > On Sat, Dec 06, 2025 at 06:59:42PM +0000, Gavin Smith wrote:
> >
> > > This is still not quite right, as the @* does not display quite correctly
> > > in the heading.
> >
> > I think that I fixed that by using \texorpdfstring as we already do for
> > other constructs to have something different in toc.
>
> Actually, what I did probably did not change anything for headings. But
> to me the heading looks right. There is no added end of line, but it
> does not seems to me to be a problem.
I'm testing with this input:
$ cat test-part.texi
\input texinfo
@contents
@everyheading @thispage @| @| @thispart
@node Top
@top
@part Part I@*One
@node C1
@chapter C1
@part Part II@*Two
@node C2
@chapter C2
@bye
----------------------------------
When I process this with 'texi2any --latex' the output (test-part.tex)
contains this:
\newpagestyle{custom}{%
\sethead[\thepage{}][][\Texinfoparttitle{}]%
{\thepage{}}{}{\Texinfoparttitle{}}%
}%
\pagestyle{custom}%
And \Texinfoparttitle contains the argument to @part:
\Texinfopart{{Part I\texorpdfstring{\leavevmode{}\\}{ }One}}
One page 6 of the output from running "pdflatex test-part.tex", you can
see the problem with the heading. The \\ inserts hfill glue or similar which
creates a huge space between "Part I" and "One". "Part I One" is supposed
to be aligned to the right of the page but there is so much space that
"Part I" ends up being centred.
I fixed this in texinfo.tex by using an \ifinner conditional:
% @* forces a line break.
% In internal horizontal or vertical mode, convert explicit line breaks
% from @* into spaces. For instance, if the user gives these in long
% section titles, this may occur in the table of contents, or the page
% heading line.
\def\*{%
\ifinner\unskip\space\ignorespaces
\else\unskip\hfil\break\hbox{}\ignorespaces\fi}
The same might work for LaTeX output.