On Fri, Feb 14, 2025 at 02:05:23PM +0000, Werner LEMBERG wrote:
> >> > 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.
> 
> I guess this can be implemented in `texinfo.tex`, however, it doesn't
> fly with Info, AFAICS.

I can't see clearly why, it seems to me that it is the "default"
behaviour, since the association of the node to the following sectioning
command is less important in Info?  There should be a rule for automatic
directions (and menus), but it could be done (which is also why I said
that it would be better if the association was done during structuring).

> > 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).
> 
> Well, I think that your `@anchorlabel` suggestion is the way to go.
> Actually, I would prefer a shorter name, say, `@label`.  Then you can
> demote
> 
> ```
> @node Foo
> @subsection Foo doodle doo
> ```
> 
> to
> 
> ```
> @label Foo
> @subsubheading Foo doodle doo
> ```

I still can't see why
@node Foo
@subsubheading Foo doodle doo

would not work too.

> and `@xref` would work identically – such a `@label` command could
> even obey `@xrefautomaticsectiontitle`.  This would also leave the
> `@anchor` command unchanged.

-- 
Pat

Reply via email to