On Sun, Mar 02, 2025 at 09:30:57AM +0000, Gavin Smith wrote: > On Sun, Mar 02, 2025 at 01:00:30AM +0100, Patrice Dumas wrote: > > On Sat, Mar 01, 2025 at 10:05:49PM +0000, Gavin Smith wrote: > > > 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 > > > > > > 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. > > > > Following right after or following in the file? > > Well, it does work if there is any section or heading command before the > next node: > > > \input texinfo > @node Node 1 > > aaa > > @section Section > > bbb > > @node Node 2 > > @xref{Node 1}. > @bye > > > The @xref produces "See Section0.1 [Node 1]". > > But the link in the PDF actually goes to the @section in the PDF (after > the aaa), not the @node. > > If the @section line is not there at all, it is not possible to reference > "Node 1". > > So a lone @node is not really supported in texinfo.tex.
With the change, what was before a lone node may become a node with heading, even if the @heading command is 'far away'. If the user wants the node to remain a lone node, it seems to me that there is a need for something like @xrefname. The node will not actually remain a lone node, but it will not be associated with the @heading, and we could consider that an empty @xrefname is explicitly allowed and allows to have a lone node, even if with a following @heading, as it was before. > > > > > > 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. > > > > Unless I am missing something, I think that this needs to be implemented > > in HTML together with the change in @heading you just implemented, so for > > consistency should be in texinfo.tex too? > > @xrefname was an idea we were discussing but I wasn't sure if it needed > further discussion. > > Are any other changes needed for texinfo.tex for heading commands?