On Wed, Oct 07, 2026 at 01:42:14PM +0200, Hilmar Preusse wrote:
> Hello,
> 
> this is https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1149404
> 
> The following .texi file fails to compile using the texinfo.tex
> file from the TeXInfo git repository:
> 
> \input texinfo @c -*-texinfo-*-
> @setfilename blitz.info
> @section Laplacian (@math{@nabla ^2}) operators
> @bye
> 
> As this worked in the past I would for now assume, that it is a valid
> TeXinfo file.

I've attempted a fix for this particular manual in commit a6b8cc724e1a3b11f,
texinfo.tex version 2026-10-07.17.

First, I don't understand how this texinfo.tex is actually the one being
used.  I checked at https://ftp.gnu.org/gnu/texinfo/texinfo.tex and the
currently uploaded version is version "2026-06-01.16", which is from
before the date where you found the problem started (July 23rd).  I can
only guess that the Automake developers pulled in the version from the Texinfo
git repository to use.  I don't upload every texinfo.tex revision made in
git to ftp.gnu.org, exactly for this kind of scenario: some changes are
riskier than others.  The only versions of texinfo.tex recommended for
general use are either those in an official Texinfo release, or those uploaded
to ftp.gnu.org.  (Testing is always welcome, though.)

@nabla is not actually a Texinfo command.  texi2any produces an error with this
file:
test.texi:4: unknown command `nabla'

I found the full file online(*) and it has a conditional macro definition
of @nabla so the full original file may actually work with texi2any:

    @c kludge workaround from Karl Berry for math in @subsection
    @ifnottex
    @macro nabla
    \\nabla
    @end macro
    @macro times
    \\times
    @end macro
    @macro cdot
    \\cdot
    @end macro
    @end ifnottex

(*) https://github.com/blitzpp/blitz/blob/main/doc/blitz.texi

This seems to be a situation where hacks have been piled upon hacks, reducing
the flexibility to solve other problems.

The change to texinfo.tex that broke this file was to make @section
(and other sectioning commands) behave in a way that was more similar
to @node.  The problem is that @nabla is not defined in texinfo.tex and
not recognised as a command that can appear in node names (generally
most inline Texinfo commands are recognised).  \nabla is defined in
plain.tex (the source code for the Plain TeX format, which is read before
texinfo.tex), and is defined with \mathchardef.

We construct control sequences with \csname to store data about possible
reference targets, previously nodes and anchors, and since this change,
section headings as well.  A control sequence name cannot contain another
control sequence, leading to the TeX error:

! Missing @endcsname inserted.

There's no quick easy way of making all the sequences defined with
\mathchardef expand to a list of character tokens, as far as I know.

The best solution I can think of is to explicitly provide expansions,
in texinfo.tex, for the \mathchardef sequences that this manual in
particular uses, for use in target names:

ndex 317e58e061..6f07770893 100644
--- a/doc/texinfo.tex
+++ b/doc/texinfo.tex
@@ -9594,6 +9594,12 @@ might help (with 'rm \jobname.?? \jobname.??s')%
   \indexnofonts
   \turnoffactive
   \def\value##1{##1}%
+  \mathchardefdummies
+}
+\def\mathchardefdummies{%
+  \definedummyword\nabla
+  \definedummyword\times
+  \definedummyword\cdot
 }
 
 % Set #2 to xref string #1

Hopefully this kind of construct is fairly rare and we won't need to add
such lines for all 170-odd \mathchardefs defined in plain.tex (you can see
them by running "kpsewhich plain | grep mathchardef").

The obvious way to fix this would be change "@nabla" to "\nabla" in
the source file:

@section Laplacian (@math{\nabla ^2}) operators

Unfortunately, this does not work: \nabla prints as "\nabla", not as the
upside-down triangle symbol.  This is presumably what led to using @nabla
in the section title in the first place.

Even if we could make this work in texinfo.tex (maybe using the
\scantokens extension of e-Tex), it would not be an immediate fix for the
current problem, as it wouldn't work with old versions of texinfo.tex,
so authors would not have a good reason to change their Texinfo files.
But it would avoid this problem in the first place.

Using the UTF-8 character does actually work:

@section Laplacian (@math{∇^2}) operators

But I can understand if people don't want to change to use the UTF-8
sequence in their input file.


> According to my checks the issue oocurs since the
> commit:
> 
> commit 2b21b8a3044333a0dcb381b49c7cd35bf4f83f93
> Author: Gavin Smith <[email protected]>
> Date:   Thu Jul 23 20:12:25 2026 +0100
> 
>     Shadow targets for texinfo.tex
> 
>     * doc/texinfo.tex (\donoderef): If no preceding @node, use the
>     section text itself as the target name, passed to new macro
>     \setrefshadow.
>     (\setrefshadow): Output @xrshad line to .aux file for shadow target,
>     and run \pdfdest in PDF output.
>     (\setref, \dosetref): Split out \dosetref.
> <snip>
> 
> I'm not subscribed to the listt, please keep me in Cc in case of
> questions.
> 
> Many thanks,
>   Hilmar



Reply via email to