On Thu, Feb 13, 2025 at 12:53:44PM +0000, Werner LEMBERG wrote:
> 
> >> * For translators, having the same anchor name as in the original
> >>   document helps a lot in translation.  And vice versa, it helps
> >>   maintainers who don't speak the particular language to still do
> >>   various maintenance tasks easier.
> > 
> > I do not think that this is such a good reason to change the @anchor
> > command, [...]
> 
> Thanks for your suggestions, but this uglifies everything a lot.  I
> think that we look at `@anchor` from two different points of view.
> For the LilyPond documentation, this command is not used to mark
> arbitrary spots for cross-referencing but to allow references to
> sections that don't use `@node`.  For this reason, making the
> behaviour of `@anchor` & `@xref` as similar as `@node` & `@xref` would
> be very benificial.
> 
> > But do you really want to get the old sectioning name back for printed
> > output?
> 
> Yes, because using `@anchor` would be the result of demoting, say,
> `@subsection` to `@subsubheading`.

It seems to me that this specific use case would benefit even more from
another options, which would be to have @node associated to the next
@*heading command if there is nothing formatted between the @node and
@*heading.  This is what is already done for HTML:

    . if a @node is not associated with a sectioning command but is 
      followed by a heading command not usually associated to nodes
      such as @heading and this command appears before other formatted 
      content, the heading command is assumed to supply the node heading.
      you can customize this with USE_NEXT_HEADING_FOR_LONE_NODE.

I have no idea if this is feasible in Texinfo TeX, though.

(Also in texi2any, it may have been better to do the association during
structuring and not during conversion, but this could still be modified
later on.)

Another option would be to add an @-commands without numbering that do not
appear in table of contents but still delimitates a section and is
associated to a @node.  Maybe like \paragraph in LaTex (though it seems
to appear in the table of contents), or @topic if it can be used at any
level and could also be interpreted as a unit of documentation not part
of any particular narrative flow (as in DocBook 5.2).

-- 
Pat

Reply via email to