> Date: Wed, 29 Jan 2025 21:50:48 +0000 (UTC)
> From: Werner LEMBERG <w...@gnu.org>
> 
> Right now, if `@xrefautomaticsectiontitle` is active and I have
> 
> ```
> @node A
> @chapter A
> 
> ... many pages ...
> 
> @anchor{This is a meaningful anchor label}
> ```
> 
> and I reference this with
> 
> ```
> @xref{This is a meaningful anchor label}
> ```
> 
> (i.e., an `@xref` command that doesn't explicitly set the printed
> label with its third argument) I see 'This is a meaningful anchor
> label' in both the HTML and Info output, but I get 'A' in the
> produced PDF.

You get "A, page NNN", where NNN is the page of the anchor, right?  So
why is "A" a problem?  The chapter name actually appears in the
document, whereas the anchor label does not.

> IMHO, this is counterproductive behaviour because `@anchor` is often
> not associated with a heading, and it can easily happen that the label
> comes many pages after the last `@node`.

You assume that the text of the anchor's label is significant.  But it
isn't (or shouldn't), at least not in the printed output.  You have
the 4th argument of @xref to achieve what you want, if you really want
that, and that argument allows you to specify _any_ text as the label
for the cross-reference, regardless of whether it is or isn't the
label of the anchor or the name of a node/chapter.

IOW, if you want meaningful names for references, use the 3rd and 4th
arguments to @xref.

Reply via email to