3.1 Writing a @node Line

Write @node at the beginning of a line followed by the name of the node, like this:

@node node-name

After you have inserted a @node line, you should immediately write the @-command for the associated chapter or section (if any) and insert its name.

You may optionally follow the node name argument to @node with up to three optional arguments on the rest of the same line, separating the arguments with commas. These are the names of the ‘Next’, ‘Previous’, and ‘Up’ pointers, in that order. Hence, the template for a fully-written-out node line with ‘Next’, ‘Previous’, and ‘Up’ pointers looks like this:

@node node-name, next, previous, up

The node-name argument must be present, but the others are optional. If you wish to specify some but not others, just insert commas as needed, as in: ‘@node mynode,,,uppernode’. Any spaces before or after each name on the @node line are ignored. However, if your Texinfo document is hierarchically organized, as virtually all are, we recommend leaving off all the pointers and letting texi2any determine them.

The texi2any program automatically determines node pointers for a hierarchically organized document. For it to do this, each @node command should be followed immediately by a sectioning command such as @chapter or @section (except that comment lines may intervene). Finally, you must follow the ‘Top’ @node line with a line beginning with @top to mark the top-level node in the file. See The @top Sectioning Command.

Even when you explicitly specify all pointers, you cannot write the nodes in the Texinfo source file in an arbitrary order. You must write the nodes in the order you wish them to appear in the output. For Info format one can imagine that the order may not matter, but it matters for the other formats.

In most cases, you will want to take advantage of the pointer creation feature, and not redundantly specify node pointers that the programs can determine. However, Texinfo documents are not required to be organized hierarchically or in fact to contain sectioning commands at all (for example, if you never intend the document to be printed), so node pointers may still be specified explicitly, in full generality.

If you are using GNU Emacs, and want explicit pointers, you can use the update node commands provided by Texinfo mode to insert the names of the pointers. (See Updating Nodes and Menus.)

Alternatively, you can insert the ‘Next’, ‘Previous’, and ‘Up’ pointers yourself. If you do this in Emacs, you may find it helpful to use the Texinfo mode keyboard command C-c C-c n. This command inserts ‘@node’ and a comment line listing the names of the pointers in their proper order. The comment line helps you keep track of which arguments are for which pointers.