On Fri, Feb 14, 2025 at 06:40:31PM +0100, Patrice Dumas wrote:
> Hello,
> 
> This comes from the thread on anchors, but I start a new thread to avoid
> mixing the two issues.
> 
> I propose that, if USE_NEXT_HEADING_FOR_LONE_NODE is set, the @*heading
> appearing after a @node be treated as much as possible like a sectioning
> command.
> 
> This means that
> * if xrefautomaticsectiontitle is on, it is used in @xref and HTML
>   headers similarly to sectioning commands

I've committed changes to texinfo.tex so that @node/@heading provides
a name for cross-references to the @node if xrefautomaticsectiontitle is
on.  So something like the following uses the argument from the
@heading in the cross-reference label:

----------------------------------
\input texinfo

@xrefautomaticsectiontitle on

@node First cap
@chapter First cap

@node Bar
@section Bar

@xref{Foo}.

@xref{Baz}.

@node Foo
@section Foo Section

This is the first section.

@node Baz
@heading Baz Node
 
Unstructured node.

@bye
----------------------------------

Before this, it would use the previous @section as a label,
producing "See [Foo Section]" rather than "See [Baz Node]".

I see no harm in making this conditional on xrefautomaticsectiontitle,
without any further options being added.

Note that a bare @node line does not work as a cross-reference target in
texinfo.tex without a section or heading command following it.

The @xrefname command we were discussing before would be easy to implement,
so you could write instead:

@node Baz
@xrefname Baz Node

This would work exactly the same, except no heading would be printed.
I'm not sure if I should implement this in texinfo.tex now, though.
 

Reply via email to