On Mon, Jul 20, 2026 at 02:19:17AM +0100, Gavin Smith wrote:
> Along with @menu, the other main defining aspect, in my opinion, of the
> clunk of the language is the frequent duplication of a node name in a
> sectioning command.  For example:
> 
>     @node Headers and Footers
>     @subsection Headers and Footers
> 
>          ‘insert_nodes_for_sectioning_commands’
>               Insert nodes for sectioning commands lacking a corresponding
>               node.
> 
> 
> I've come back to this issue, and have an idea for how the need for a
> @node line could be avoided in many cases.
> 
> My idea is that sectioning commands should create a so-called "shadow target"
> (that's my working name, although there may be a better name):
> 
>   * If a section name appears once, and there is no @node (or @anchor
>     or @namedanchor) using that name, then cross references to that
>     section name go to that section.
>   
>   * If a section name is used twice or more, then the shadow targets
>     created by those sections are disabled.  This prevents any ambiguity
>     about which section a cross reference should go to.
> 
>   * If @node (or @anchor etc.) is used with the same name as a sectioning
>     command, the @node (etc.) takes priority.
> 
> I believe this approach would be backwards-compatible with existing
> documents.

> Hopefully this would be a welcomed modification to the language.  Any
> comments?

This looks good to me.  Now that the @*heading are also associated to
nodes, I think that it would make sense to have the same for those
commands.  Sectioning @-commands that appear in contents could have
precedence over @*heading commands.


What about the other effect of @node, the delimitation of output units?
It is not relevant for Texinfo TeX, but the implementation in texi2any
would be quite different if it is like the
insert_nodes_for_sectioning_commands tree transformation, or selecting
some sectioning or @heading @-command as targets.


> (We could also consider allowing automatic anchors to index entries.
> (I did find an email about this - Robert Weiner, 2016-07-01 "Is it possible
> to make a Texinfo cross-reference to an index item?"  Quoted below in
> Annex B.)  This should probably be enabled explicitly with an option, 
> otherwise
> too many targets would be created.)
> 
> https://lists.gnu.org/archive/html/help-texinfo/2016-07/msg00000.html

I am less convinced about this need.  One can use a regular @anchor with
the same name as the index entry.  This adds information duplication,
but for a very specific need, which is fine.

-- 
Pat

Reply via email to