On Mon, Jul 20, 2026 at 07:39:35PM +0100, Gavin Smith wrote: > I am not keen on it for @*heading, as this is confusing the purpose > of these commands - primarily to print a heading. I know it does > do slightly more, in that a user can use a @node line followed by a > @heading line and the two will be associated, so the argument to @heading > could be used for cross-reference text if "@xrefautomaticsectiontitle on" > is given (in Texinfo 7.3, at least). > > As you explain it, as a language feature it doesn't seem like it would > conflict with anything. However, it would be more complexity to implement, > especially in texinfo.tex, and also makes the feature more complicated > for users to understand (as we would have three levels of priority, rather > than two). > > Can we just do it for sectioning commands to start with and see where that > takes us?
Ok, but we should keep a track of this, such that users relying on @heading know that it is different for heading and keep this in a TODO. > > 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. > > I'd imagine it would be governed by a variable like USE_NODES: we would > either split at explicit @node lines only, or at either a @node or sectioning > command without an associated @node line. > > My preference would be to make the latter the default, while allowing the > former to allow users to have fine-grained control over node splitting. > (See message from Per Bothner, 2021-10-09 "control over sectioning > and splitting" > <https://lists.gnu.org/archive/html/bug-texinfo/2021-10/msg00000.html>.) > The former would be closer to the current behaviour AFAIK. > > We could use USE_NODES for this purpose or another variable if USE_NODES > isn't quite right. You explained a possible use of USE_NODES in this > message: > > On Sun, Feb 16, 2025 at 02:53:05PM +0100, [email protected] wrote: > > > What would be the advantage to a user of setting USE_NODES=0? > > > > If there are lone nodes, they are associated to the preceding section. > > It allows to have HTML more book like, while Info could have more @node > > units. I am not sure that it is often used, but it was important enough > > as a difference that it was how texi2html was designed in th eearly 2000. I think that there are 3 relevant possibilities: 0) output units are split at sections, and lone nodes are associated to the section. A book-like setup, corresponding to USE_NODES=0. Sections have a "shadow" target possibly added. 1) output units are split at nodes, and lone sections do not have an associated node added (but they have a "shadow" target possibly added. This is the current situation with USE_NODES=1, and it allows to have a sectioning structure inside an output unit. Per uses this setup in one of his nodes. 2) output units are split at nodes, but lone sections have an associated node automatically added. Same as the tree transformation, and, if I understand well, what you would favor as the default. In this case, the value of USE_NODES does not make a difference and there is no need for separate shadow targets as added nodes fulfill that role. I do not think that a theoretical case based on 0 where nodes would have sectioning commands automatically added is relevant. 0, 1 and 2 are relevant for HTML, 1 and 2 are also relevant for Info. 2 would become the default. One possibility to be able to specify 0, 1 and 2 would be to change USE_NODES to have tree possible values, with the value 2 added. Strings could also be used, for example USE_NODE=no for 0, USE_NODE=nodes for 1 and USE_NODE=add for 2. Does it look right? -- Pat
