JezK
Edit File: Writing-a-Node.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <!-- Created by GNU Texinfo 6.8, https://www.gnu.org/software/texinfo/ --> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <!-- This manual is for GNU Texinfo (version 6.8, 8 June 2021), a documentation system that can produce both online information and a printed manual from a single source using semantic markup. Copyright (C) 1988, 1990-1993, 1995-1999, 2001-2021 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". --> <title>Writing a Node (GNU Texinfo 6.8)</title> <meta name="description" content="Writing a Node (GNU Texinfo 6.8)"> <meta name="keywords" content="Writing a Node (GNU Texinfo 6.8)"> <meta name="resource-type" content="document"> <meta name="distribution" content="global"> <meta name="Generator" content="texi2any"> <meta name="viewport" content="width=device-width,initial-scale=1"> <link href="index.html" rel="start" title="Top"> <link href="Command-and-Variable-Index.html" rel="index" title="Command and Variable Index"> <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents"> <link href="Nodes.html" rel="up" title="Nodes"> <link href="Node-Names.html" rel="next" title="Node Names"> <style type="text/css"> <!-- a.copiable-anchor {visibility: hidden; text-decoration: none; line-height: 0em} a.summary-letter {text-decoration: none} blockquote.indentedblock {margin-right: 0em} div.display {margin-left: 3.2em} div.example {margin-left: 3.2em} kbd {font-style: oblique} pre.display {font-family: inherit} pre.format {font-family: inherit} pre.menu-comment {font-family: serif} pre.menu-preformatted {font-family: serif} span.nolinebreak {white-space: nowrap} span.roman {font-family: initial; font-weight: normal} span.sansserif {font-family: sans-serif; font-weight: normal} span:hover a.copiable-anchor {visibility: visible} ul.no-bullet {list-style: none} --> </style> </head> <body lang="en"> <div class="section" id="Writing-a-Node"> <div class="header"> <p> Next: <a href="Node-Names.html" accesskey="n" rel="next">Choosing Node Names</a>, Up: <a href="Nodes.html" accesskey="u" rel="up">Nodes</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Command-and-Variable-Index.html" title="Index" rel="index">Index</a>]</p> </div> <hr> <span id="Writing-a-_0040node-Line"></span><h3 class="section">3.1 Writing a <code>@node</code> Line</h3> <span id="index-Writing-a-_0040node-line"></span> <span id="index-_0040node-line-writing"></span> <span id="index-Node-line-writing"></span> <span id="index-node"></span> <p>Write <code>@node</code> at the beginning of a line followed by the name of the node, like this: </p> <div class="example"> <pre class="example">@node <var>node-name</var> </pre></div> <p>After you have inserted a <code>@node</code> line, you should immediately write an @-command for the chapter or section and insert its name. </p> <p>You may optionally follow the node name argument to <code>@node</code> 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: </p> <div class="example"> <pre class="example">@node <var>node-name</var>, <var>next</var>, <var>previous</var>, <var>up</var> </pre></div> <p>The <var>node-name</var> 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: ‘<samp>@node mynode,,,uppernode</samp>’. Any spaces before or after each name on the <code>@node</code> line are ignored. However, if your Texinfo document is hierarchically organized, as virtually all are, we recommend leaving off all the pointers and letting <code>makeinfo</code> determine them. </p> <span id="index-Creating-pointers-with-makeinfo"></span> <span id="index-Pointer-creation-with-makeinfo"></span> <span id="index-Automatic-pointer-creation-with-makeinfo"></span> <span id="index-Implicit-pointer-creation-with-makeinfo"></span> <p>The <code>makeinfo</code> program automatically determines node pointers for a hierarchically organized document. For it do to do this, each <code>@node</code> command should be followed immediately by a sectioning command such as <code>@chapter</code> or <code>@section</code> (except that comment lines may intervene). Finally, you must follow the ‘Top’ <code>@node</code> line with a line beginning with <code>@top</code> to mark the top-level node in the file. See <a href="_0040top-Command.html">The <code>@top</code> Sectioning Command</a>. </p> <p>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. </p> <p>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. </p> <p>If you are using GNU Emacs, you can use the update node commands provided by Texinfo mode to insert the names of the pointers. (See <a href="Updating-Nodes-and-Menus.html">Updating Nodes and Menus</a>.) </p> <p>Alternatively, you can insert the ‘Next’, ‘Previous’, and ‘Up’ pointers yourself. If you do this, you may find it helpful to use the Texinfo mode keyboard command <kbd>C-c C-c n</kbd>. This command inserts ‘<samp>@node</samp>’ 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. </p> <p>If you wish, you can ignore <code>@node</code> lines altogether in your first draft and then use the <code>texinfo-insert-node-lines</code> command to create <code>@node</code> lines for you. However, we do not recommend this practice. It is better to name the node itself at the same time that you write a segment so you can easily make cross-references. Useful cross-references are an especially important feature of a good Texinfo manual. </p> </div> <hr> <div class="header"> <p> Next: <a href="Node-Names.html">Choosing Node Names</a>, Up: <a href="Nodes.html">Nodes</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Command-and-Variable-Index.html" title="Index" rel="index">Index</a>]</p> </div> </body> </html>