On Sun, Jan 23, 2022 at 10:20:03AM -0800, Per Bothner wrote:
> 
> On 1/22/22 02:07, Gavin Smith wrote:
> > @chapter or @section without @node would become a lot like
> > @heading except perhaps there could also be an @anchor generated
> > for the chapter heading as well as appearing in the table of
> > contents.  There would have to be a check that the name of the
> > automatic @anchor didn't clash with any other @node or @anchor.
> 
> If the @section/whatever is immediately preceded by an @anchor,
> one can use the explicit anchor instead.  In a sense the @anchor
> functions like the @missing node command, except in terms of splitting.

I see that indeed, there is currently no good way to associate a
sectionning command with an anchor preceding it such that links appear
before the heading and not after, and still be considered to be with
this sectioning command and not the previous one.  Yet, I do not think
that associating an @anchor to the next sectioning command is correct to
do in every situations, as the @anchor could really be meant to be at
the end of the preceding section.

> I assume you would disallow sub-nodes: I.e. the next @node command would
> have to be followed by a sectioning comand at the same or higher level.

There are no such constraints.  Actually, there are two different and
(well) defined behaviours that consider either nodes or sectioning
commands as the determining document unit organization.  With USE_NODES
set to 1 nodes are determining for document unit split.  With USE_NODES
set to 0, sectioning commands are determining for document unit split.

A node is always associated to the following sectioning command if
there is such a sectioning command, and both are together on the same
document unit.  Besides, with USE_NODES=1, lone @node command starts a
new document unit and all the sectioning commands appearing after a node
and before the next node are in the node document unit.  With
USE_NODES=0, lone sectioning commands start a document unit, and all the
lone nodes following a sectioning commands and not before another
sectioning command are within the sectioning command document unit.

This allows to handle formats that are more in line with sectioning
commands organizations, book-like formats (DocBook, LaTeX), formats that
are more in line with @node organization (Info) and formats that can be
both (HTML).  For HTML, in the default case USE_NODES=1, in the
Texi2HTML style USE_NODES=0.

-- 
Pat

Reply via email to