Contents|Index|Previous

Defaulting the Prev, Next, and Up

If you write the @node commands in your Texinfo source file without Next, Prev, and Up pointers, Makeinfo will fill in the pointers from context (by reference to the menus in your source file). Although the definition of an info file allows a great deal of flexibility, there are some conventions that you are urged to follow. By letting Makeinfo default the Next, Prev, and Up pointers you can follow these conventions with a minimum of effort.

A common error occurs when adding a new node to a menu; often the nodes which are referenced in the menu do not point to each other in the same order as they appear in the menu.

Makeinfo node defaulting helps with this particular problem by not requiring any explicit information beyond adding the new node (so long as you do include it in a menu). The node to receive the defaulted pointers must be followed immediately by a sectioning command, such as @chapter or @section, and must appear in a menu that is one sectioning level or more above the sectioning level that this node is to have.

What follows is an example of how to use this feature.

    @setfilename default-nodes.info
    @node Top
    @chapter Introduction
    @menu
    * foo:: the foo node
    * bar:: the bar node
    @end menu
    @node foo
    @section foo
    this is the foo node.
    @node bar
    @section Bar
    This is the Bar node.
    @bye

The previous input produces the following output.

    Info file default-nodes.info, produced by Makeinfo, -*- Text -*-

    from input file default-nodes.texinfo.

    File: default-nodes.info, Node: Top

    Introduction ************
    * Menu:

    * foo:: the foo node
    * bar:: the bar node

    File: default-nodes.info, Node: foo, Next: bar, Up: Top
    foo
    ===

    this is the foo node.

    File: default-nodes.info, Node: bar, Prev: foo, Up: Top

    Bar
    ===

    This is the Bar node.