bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems with `@anchor` and `@xrefautomaticsectiontitle`


From: Gavin Smith
Subject: Re: Problems with `@anchor` and `@xrefautomaticsectiontitle`
Date: Sat, 20 Feb 2021 11:43:03 +0000

On Sat, Feb 20, 2021 at 7:03 AM Werner LEMBERG <wl@gnu.org> wrote:
>
>
> [texinfo 2020-11-25.18]
> [pdftex TeXLive 2020]
>
>
> This example
>
>   \input texinfo.tex
>
>   @xrefautomaticsectiontitle on
>
>   @node foo_bar
>   @subsection Foo_Bar
>
>   @page
>
>   @anchor{blubb}
>   Blubb
>
>   @page
>
>   @xref{blubb}
>
>   @bye
>
> exhibits a bug and a problem if converted to PDF, as can be seen in
> the attached image.
>
> The bug:
>   The `_` character in the section title is displayed as a dot accent
>   in the PDF output of the anchor reference.

I tracked it down to when the test.aux file is read, the _ in the
section title is given the "other" cat code. The following change to
\readdatafile appears to fix the case you sent:

diff --git a/doc/texinfo.tex b/doc/texinfo.tex
index 7267c85891..0b2b6f9a3b 100644
--- a/doc/texinfo.tex
+++ b/doc/texinfo.tex
@@ -9287,7 +9287,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
   \catcode`\[=\other
   \catcode`\]=\other
   \catcode`\"=\other
-  \catcode`\_=\other
+  \catcode`\_=\active
   \catcode`\|=\other
   \catcode`\<=\other
   \catcode`\>=\other

However, it's hard to know what other implications this change would
have. You have an odd case where you are using an underscore in Roman
type, which is why I expect this bug has not come up until now.
(@subsection @code{Foo_Bar} would be more usual.) I quickly tested
with > in a section name too and there was exactly the same problem.
What I will try and do now is go through the other special characters
and check if their cat codes can be changed to active too.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]