home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / gnu / texinfo-3.1-bin.lha / info / texi.info-3 (.txt) < prev    next >
GNU Info File  |  1994-02-24  |  50KB  |  936 lines

  1. This is Info file texi.info, produced by Makeinfo-1.55 from the input
  2. file texi.texi.
  3.    This file documents Texinfo, a documentation system that uses a
  4. single source file to produce both on-line information and a printed
  5. manual.
  6.    Copyright (C) 1988, 1990, 1991, 1992, 1993 Free Software Foundation,
  7.    This is the second edition of the Texinfo documentation,
  8. and is consistent with version 2 of `texinfo.tex'.
  9.    Permission is granted to make and distribute verbatim copies of this
  10. manual provided the copyright notice and this permission notice are
  11. preserved on all copies.
  12.    Permission is granted to copy and distribute modified versions of
  13. this manual under the conditions for verbatim copying, provided that
  14. the entire resulting derived work is distributed under the terms of a
  15. permission notice identical to this one.
  16.    Permission is granted to copy and distribute translations of this
  17. manual into another language, under the above conditions for modified
  18. versions, except that this permission notice may be stated in a
  19. translation approved by the Free Software Foundation.
  20. File: texi.info,  Node: titlepage,  Next: titlefont center sp,  Up: Titlepage & Copyright Page
  21. `@titlepage'
  22. ------------
  23.    Start the material for the title page and following copyright page
  24. with `@titlepage' on a line by itself and end it with `@end titlepage'
  25. on a line by itself.
  26.    The `@end titlepage' command starts a new page and turns on page
  27. numbering. (*Note Page Headings: Headings, for details about how to
  28. generate of page headings.)  All the material that you want to appear
  29. on unnumbered pages should be put between the `@titlepage' and `@end
  30. titlepage' commands.  By using the `@page' command you can force a page
  31. break within the region delineated by the `@titlepage' and `@end
  32. titlepage' commands and thereby create more than one unnumbered page.
  33. This is how the copyright page is produced.  (The `@titlepage' command
  34. might perhaps have been better named the `@titleandadditionalpages'
  35. command, but that would have been rather long!)
  36.    When you write a manual about a computer program, you should write
  37. the version of the program to which the manual applies on the title
  38. page.  If the manual changes more frequently than the program or is
  39. independent of it, you should also include an edition number(1) for the
  40. manual.  This helps readers keep track of which manual is for which
  41. version of the program.  (The `Top' node should also contain this
  42. information; see *Note `@top': makeinfo top.)
  43.    Texinfo provides two methods for creating a title page.  One method
  44. uses the `@titlefont', `@sp', and `@center' commands to generate a
  45. title page in which the words on the page are centered.
  46.    The second method uses the `@title', `@subtitle', and `@author'
  47. commands to create a title page with black rules under the title and
  48. author lines and the subtitle text set flush to the right hand side of
  49. the page.  With this method, you do not specify any of the actual
  50. formatting of the title page.  You specify the text you want, and
  51. Texinfo does the formatting.  You may use either method.
  52.    ---------- Footnotes ----------
  53.    (1)  We have found that it is helpful to refer to versions of
  54. manuals as `editions' and versions of programs as `versions';
  55. otherwise, we find we are liable to confuse each other in conversation
  56. by referring to both the documentation and the software with the same
  57. words.
  58. File: texi.info,  Node: titlefont center sp,  Next: title subtitle author,  Prev: titlepage,  Up: Titlepage & Copyright Page
  59. `@titlefont', `@center', and `@sp'
  60. ----------------------------------
  61.    You can use the `@titlefont', `@sp', and `@center' commands to
  62. create a title page for a printed document.  (This is the first of the
  63. two methods for creating a title page in Texinfo.)
  64.    Use the `@titlefont' command to select a large font suitable for the
  65. title itself.
  66.    For example:
  67.      @titlefont{Texinfo}
  68.    Use the `@center' command at the beginning of a line to center the
  69. remaining text on that line.  Thus,
  70.      @center @titlefont{Texinfo}
  71. centers the title, which in this example is "Texinfo" printed in the
  72. title font.
  73.    Use the `@sp' command to insert vertical space.  For example:
  74.      @sp 2
  75. This inserts two blank lines on the printed page.  (*Note `@sp': sp,
  76. for more information about the `@sp' command.)
  77.    A template for this method looks like this:
  78.      @titlepage
  79.      @sp 10
  80.      @center @titlefont{NAME-OF-MANUAL-WHEN-PRINTED}
  81.      @sp 2
  82.      @center SUBTITLE-IF-ANY
  83.      @sp 2
  84.      @center AUTHOR
  85.      ...
  86.      @end titlepage
  87.    The spacing of the example fits an 8 1/2 by 11 inch manual.
  88. File: texi.info,  Node: title subtitle author,  Next: Copyright & Permissions,  Prev: titlefont center sp,  Up: Titlepage & Copyright Page
  89. `@title', `@subtitle', and `@author'
  90. ------------------------------------
  91.    You can use the `@title', `@subtitle', and `@author' commands to
  92. create a title page in which the vertical and horizontal spacing is
  93. done for you automatically.  This contrasts with the method described in
  94. the previous section, in which the `@sp' command is needed to adjust
  95. vertical spacing.
  96.    Write the `@title', `@subtitle', or `@author' commands at the
  97. beginning of a line followed by the title, subtitle, or author.
  98.    The `@title' command produces a line in which the title is set flush
  99. to the left-hand side of the page in a larger than normal font.  The
  100. title is underlined with a black rule.
  101.    The `@subtitle' command sets subtitles in a normal-sized font flush
  102. to the right-hand side of the page.
  103.    The `@author' command sets the names of the author or authors in a
  104. middle-sized font flush to the left-hand side of the page on a line
  105. near the bottom of the title page.  The names are underlined with a
  106. black rule that is thinner than the rule that underlines the title.
  107. (The black rule only occurs if the `@author' command line is followed
  108. by an `@page' command line.)
  109.    There are two ways to use the `@author' command: you can write the
  110. name or names on the remaining part of the line that starts with an
  111. `@author' command:
  112.      @author by Jane Smith and John Doe
  113. or you can write the names one above each other by using two (or more)
  114. `@author' commands:
  115.      @author Jane Smith
  116.      @author John Doe
  117. (Only the bottom name is underlined with a black rule.)
  118.    A template for this method looks like this:
  119.      @titlepage
  120.      @title NAME-OF-MANUAL-WHEN-PRINTED
  121.      @subtitle SUBTITLE-IF-ANY
  122.      @subtitle SECOND-SUBTITLE
  123.      @author AUTHOR
  124.      @page
  125.      ...
  126.      @end titlepage
  127. Contrast this form with the form of a title page written using the
  128. `@sp', `@center', and `@titlefont' commands:
  129.      @titlepage
  130.      @sp 10
  131.      @center @titlefont{Name of Manual When Printed}
  132.      @sp 2
  133.      @center Subtitle, If Any
  134.      @sp 1
  135.      @center Second subtitle
  136.      @sp 2
  137.      @center Author
  138.      @page
  139.      ...
  140.      @end titlepage
  141. File: texi.info,  Node: Copyright & Permissions,  Next: end titlepage,  Prev: title subtitle author,  Up: Titlepage & Copyright Page
  142. Copyright Page and Permissions
  143. ------------------------------
  144.    By international treaty, the copyright notice for a book should be
  145. either on the title page or on the back of the title page.  The
  146. copyright notice should include the year followed by the name of the
  147. organization or person who owns the copyright.
  148.    When the copyright notice is on the back of the title page, that page
  149. is customarily not numbered.  Therefore, in Texinfo, the information on
  150. the copyright page should be within `@titlepage' and `@end titlepage'
  151. commands.
  152.    Use the `@page' command to cause a page break.  To push the
  153. copyright notice and the other text on the copyright page towards the
  154. bottom of the page, you can write a somewhat mysterious line after the
  155. `@page' command that reads like this:
  156.      @vskip 0pt plus 1filll
  157. This is a TeX command that is not supported by the Info formatting
  158. commands.  The `@vskip' command inserts whitespace.  The `0pt plus
  159. 1filll' means to put in zero points of mandatory whitespace, and as
  160. much optional whitespace as needed to push the following text to the
  161. bottom of the page.  Note the use of three `l's in the word `filll';
  162. this is the correct usage in TeX.
  163.    In a printed manual, the `@copyright{}' command generates a `c'
  164. inside a circle.  (In Info, it generates `(C)'.)  The copyright notice
  165. itself has the following legally defined sequence:
  166.      Copyright (C) YEAR COPYRIGHT-OWNER
  167.    It is customary to put information on how to get a manual after the
  168. copyright notice, followed by the copying permissions for the manual.
  169.    Note that permissions must be given here as well as in the summary
  170. segment within `@ifinfo' and `@end ifinfo' that immediately follows the
  171. header since this text appears only in the printed manual and the
  172. `ifinfo' text appears only in the Info file.
  173.    *Note Sample Permissions::, for the standard text.
  174. File: texi.info,  Node: end titlepage,  Next: headings on off,  Prev: Copyright & Permissions,  Up: Titlepage & Copyright Page
  175. Heading Generation
  176. ------------------
  177.    An `@end titlepage' command on a line by itself not only marks the
  178. end of the title and copyright pages, but also causes TeX to start
  179. generating page headings and page numbers.
  180.    To repeat what is said elsewhere,  Texinfo has two standard page
  181. heading formats, one for documents which are printed on one side of
  182. each sheet of paper (single-sided printing), and the other for
  183. documents which are printed on both sides of each sheet (double-sided
  184. printing).  (*Note `@setchapternewpage': setchapternewpage.) You can
  185. specify these formats in different ways:
  186.    * The conventional way is to write an `@setchapternewpage' command
  187.      before the title page commands, and then have the `@end titlepage'
  188.      command start generating page headings in the manner desired.
  189.      (*Note `@setchapternewpage': setchapternewpage.)
  190.    * Alternatively, you can use the `@headings' command to prevent page
  191.      headings from being generated or to start them for either single or
  192.      double-sided printing.  (Write an `@headings' command immediately
  193.      after the `@end titlepage' command.  *Note The `@headings'
  194.      Command: headings on off, for more information.)
  195.    * Or, you may specify your own page heading and footing format.
  196.      *Note Page Headings: Headings, for detailed information about page
  197.      headings and footings.
  198.    Most documents are formatted with the standard single-sided or
  199. double-sided format, using `@setchapternewpage odd' for double-sided
  200. printing and no `@setchapternewpage' command for single-sided printing.
  201. File: texi.info,  Node: headings on off,  Prev: end titlepage,  Up: Titlepage & Copyright Page
  202. The `@headings' Command
  203. -----------------------
  204.    The `@headings' command is rarely used.  It specifies what kind of
  205. page headings and footings to print on each page.  Usually, this is
  206. controlled by the `@setchapternewpage' command.  You need the
  207. `@headings' command only if the `@setchapternewpage' command does not
  208. do what you want, or if you want to turn off pre-defined page headings
  209. prior to defining your own.  Write an `@headings' command immediately
  210. after the `@end titlepage' command.
  211.    There are four ways to use the `@headings' command:
  212. `@headings off'
  213.      Turn off printing of page headings.
  214. `@headings single'
  215.      Turn on page headings appropriate for single-sided printing.
  216. `@headings double'
  217. `@headings on'
  218.      Turn on page headings appropriate for double-sided printing.  The
  219.      two commands, `@headings on' and `@headings double', are
  220.      synonymous.
  221.    For example, suppose you write `@setchapternewpage off' before the
  222. `@titlepage' command to tell TeX to start a new chapter on the same
  223. page as the end of the last chapter.  This command also causes TeX to
  224. typeset page headers for single-sided printing.  To cause TeX to
  225. typeset for double sided printing, write `@headings double' after the
  226. `@end titlepage' command.
  227.    You can stop TeX from generating any page headings at all by writing
  228. `@headings off' on a line of its own immediately after the line
  229. containing the `@end titlepage' command, like this:
  230.      @end titlepage
  231.      @headings off
  232. The `@headings off' command overrides the `@end titlepage' command,
  233. which would otherwise cause TeX to print page headings.
  234.    You can also specify your own style of page heading and footing.
  235. *Note Page Headings: Headings, for more information.
  236. File: texi.info,  Node: The Top Node,  Next: Software Copying Permissions,  Prev: Titlepage & Copyright Page,  Up: Beginning a File
  237. The `Top' Node and Master Menu
  238. ==============================
  239.    The `Top' node is the node from which you enter an Info file.
  240.    A `Top' node should contain a brief description of the Info file and
  241. an extensive, master menu for the whole Info file.  This helps the
  242. reader understand what the Info file is about.  Also, you should write
  243. the version number of the program to which the Info file applies; or,
  244. at least, the edition number.
  245.    The contents of the `Top' node should appear only in the Info file;
  246. none of it should appear in printed output, so enclose it between
  247. `@ifinfo' and `@end ifinfo' commands.  (TeX does not print either an
  248. `@node' line or a menu; they appear only in Info; strictly speaking,
  249. you are not required to enclose these parts between `@ifinfo' and `@end
  250. ifinfo', but it is simplest to do so.  *Note Conditionally Visible
  251. Text: Conditionals.)
  252. * Menu:
  253. * Title of Top Node::           Sketch what the file is about.
  254. * Master Menu Parts::           A master menu has three or more parts.
  255. File: texi.info,  Node: Title of Top Node,  Next: Master Menu Parts,  Up: The Top Node
  256. `Top' Node Title
  257. ----------------
  258.    Sometimes, you will want to place an `@top' sectioning command line
  259. containing the title of the document immediately after the `@node Top'
  260. line (*note The `@top' Sectioning Command: makeinfo top command., for
  261. more information).
  262.    For example, the beginning of the Top node of this manual contains an
  263. `@top' sectioning command, a short description, and edition and version
  264. information.  It looks like this:
  265.      ...
  266.      @end titlepage
  267.      
  268.      @ifinfo
  269.      @node Top, Copying, (dir), (dir)
  270.      @top Texinfo
  271.      
  272.      Texinfo is a documentation system...
  273.      
  274.      This is edition...
  275.      ...
  276.      @end ifinfo
  277.      
  278.      @menu
  279.      * Copying::                 Texinfo is freely
  280.                                    redistributable.
  281.      * Overview::                What is Texinfo?
  282.      ...
  283.      @end menu
  284.    In a `Top' node, the `Previous', and `Up' nodes usually refer to the
  285. top level directory of the whole Info system, which is called `(dir)'.
  286. The `Next' node refers to the first node that follows the main or master
  287. menu, which is usually the copying permissions, introduction, or first
  288. chapter.
  289. File: texi.info,  Node: Master Menu Parts,  Prev: Title of Top Node,  Up: The Top Node
  290. Parts of a Master Menu
  291. ----------------------
  292.    A "master menu" is a detailed main menu listing all the nodes in a
  293. file.
  294.    A master menu is enclosed in `@menu' and `@end menu' commands and
  295. does not appear in the printed document.
  296.    Generally, a master menu is divided into parts.
  297.    * The first part contains the major nodes in the Texinfo file: the
  298.      nodes for the chapters, chapter-like sections, and the appendices.
  299.    * The second part contains nodes for the indices.
  300.    * The third and subsequent parts contain a listing of the other,
  301.      lower level nodes, often ordered by chapter.  This way, rather
  302.      than go through an intermediary menu, an inquirer can go directly
  303.      to a particular node when searching for specific information.
  304.      These menu items are not required; add them if you think they are a
  305.      convenience.
  306.    Each section in the menu can be introduced by a descriptive line.  So
  307. long as the line does not begin with an asterisk, it will not be
  308. treated as a menu entry.  (*Note Writing a Menu::, for more
  309. information.)
  310.    For example, the master menu for this manual looks like the following
  311. (but has many more entries):
  312.      @menu
  313.      * Copying::             Texinfo is freely
  314.                                redistributable.
  315.      * Overview::            What is Texinfo?
  316.      * Texinfo Mode::        Special features in GNU Emacs.
  317.      ...
  318.      ...
  319.      * Command and Variable Index::
  320.                              An entry for each @-command.
  321.      * Concept Index::       An entry for each concept.
  322.      
  323.       --- The Detailed Node Listing ---
  324.      
  325.      Overview of Texinfo
  326.      
  327.      * Info Files::          What is an Info file?
  328.      * Printed Manuals::     Characteristics of
  329.                                a printed manual.
  330.      ...
  331.      ...
  332.      
  333.      Using Texinfo Mode
  334.      
  335.      * Info on a Region::    Formatting part of a file
  336.                                for Info.
  337.      ...
  338.      ...
  339.      @end menu
  340. File: texi.info,  Node: Software Copying Permissions,  Prev: The Top Node,  Up: Beginning a File
  341. Software Copying Permissions
  342. ============================
  343.    If the Texinfo file has a section containing the "General Public
  344. License" and the distribution information and a warranty disclaimer for
  345. the software that is documented, this section usually follows the `Top'
  346. node.  The General Public License is very important to Project GNU
  347. software.  It ensures that you and others will continue to have a right
  348. to use and share the software.
  349.    The copying and distribution information and the disclaimer are
  350. followed by an introduction or else by the first chapter of the manual.
  351.    Although an introduction is not a required part of a Texinfo file, it
  352. is very helpful.  Ideally, it should state clearly and concisely what
  353. the file is about and who would be interested in reading it.  In
  354. general, an introduction would follow the licensing and distribution
  355. information, although sometimes people put it earlier in the document.
  356. Usually, an introduction is put in an `@unnumbered' section.  (*Note
  357. The `@unnumbered' and `@appendix' Commands: unnumbered & appendix.)
  358. File: texi.info,  Node: Ending a File,  Next: Structuring,  Prev: Beginning a File,  Up: Top
  359. Ending a Texinfo File
  360. *********************
  361.    The end of a Texinfo file should include the commands that create
  362. indices and generate detailed and summary tables of contents.  And it
  363. must include the `@bye' command that marks the last line processed by
  364.    For example:
  365.      @node    Concept Index,     , Variables Index, Top
  366.      @c        node-name,    next, previous,        up
  367.      @unnumbered Concept Index
  368.      
  369.      @printindex cp
  370.      
  371.      @contents
  372.      @bye
  373. * Menu:
  374. * Printing Indices & Menus::    How to print an index in hardcopy and
  375.                                   generate index menus in Info.
  376. * Contents::                    How to create a table of contents.
  377. * File End::                    How to mark the end of a file.
  378. File: texi.info,  Node: Printing Indices & Menus,  Next: Contents,  Up: Ending a File
  379. Index Menus and Printing an Index
  380. =================================
  381.    To print an index means to include it as part of a manual or Info
  382. file.  This does not happen automatically just because you use
  383. `@cindex' or other index-entry generating commands in the Texinfo file;
  384. those just cause the raw data for the index to be accumulated.  To
  385. generate an index, you must include the `@printindex' command at the
  386. place in the document where you want the index to appear.  Also, as
  387. part of the process of creating a printed manual, you must run a
  388. program called `texindex' (*note Format/Print Hardcopy::.) to sort the
  389. raw data to produce a sorted index file.  The sorted index file is what
  390. is actually used to print the index.
  391.    Texinfo offers six different types of predefined index: the concept
  392. index, the function index, the variables index, the keystroke index, the
  393. program index, and the data type index (*note Predefined Indices::.).
  394. Each index type has a two-letter name: `cp', `fn', `vr', `ky', `pg',
  395. and `tp'.  You may merge indices, or put them into separate sections
  396. (*note Combining Indices::.); or you may define your own indices (*note
  397. Defining New Indices: New Indices.).
  398.    The `@printindex' command takes a two-letter index name, reads the
  399. corresponding sorted index file and formats it appropriately into an
  400. index.
  401.    The `@printindex' command does not generate a chapter heading for
  402. the index.  Consequently, you should precede the `@printindex' command
  403. with a suitable section or chapter command (usually `@unnumbered') to
  404. supply the chapter heading and put the index into the table of
  405. contents.  Precede the `@unnumbered' command with an `@node' line.
  406.    For example:
  407.      @node Variable Index, Concept Index, Function Index, Top
  408.      @comment    node-name,         next,       previous, up
  409.      @unnumbered Variable Index
  410.      
  411.      @printindex vr
  412.      @node     Concept Index,     , Variable Index, Top
  413.      @comment      node-name, next,       previous, up
  414.      @unnumbered Concept Index
  415.      
  416.      @printindex cp
  417.      @summarycontents
  418.      @contents
  419.      @bye
  420. (Readers often prefer that the concept index come last in a book, since
  421. that makes it easiest to find.)
  422. File: texi.info,  Node: Contents,  Next: File End,  Prev: Printing Indices & Menus,  Up: Ending a File
  423. Generating a Table of Contents
  424. ==============================
  425.    The `@chapter', `@section', and other structuring commands supply
  426. the information to make up a table of contents, but they do not cause
  427. an actual table to appear in the manual.  To do this, you must use the
  428. `@contents' and `@summarycontents' commands:
  429. `@contents'
  430.      Generate a table of contents in a printed manual, including all
  431.      chapters, sections, subsections, etc., as well as appendices and
  432.      unnumbered chapters.  (Headings generated by the `@heading' series
  433.      of commands do not appear in the table of contents.)  The
  434.      `@contents' command should be written on a line by itself.
  435. `@shortcontents'
  436. `@summarycontents'
  437.      (`@summarycontents' is a synonym for `@shortcontents'; the two
  438.      commands are exactly the same.)
  439.      Generate a short or summary table of contents that lists only the
  440.      chapters (and appendices and unnumbered chapters).  Omit sections,
  441.      subsections and subsubsections.  Only a long manual needs a short
  442.      table of contents in addition to the full table of contents.
  443.      Write the `@shortcontents' command on a line by itself right
  444.      *before* the `@contents' command.
  445.    The table of contents commands automatically generate a chapter-like
  446. heading at the top of the first table of contents page.  Write the table
  447. of contents commands at the very end of a Texinfo file, just before the
  448. `@bye' command, following any index sections--anything in the Texinfo
  449. file after the table of contents commands will be omitted from the
  450. table of contents.
  451.    When you print a manual with a table of contents, the table of
  452. contents are printed last and numbered with roman numerals.  You need
  453. to place those pages in their proper place, after the title page,
  454. yourself.  (This is the only collating you need to do for a printed
  455. manual.  The table of contents is printed last because it is generated
  456. after the rest of the manual is typeset.)
  457.    Here is an example of where to write table of contents commands:
  458.      INDICES...
  459.      @shortcontents
  460.      @contents
  461.      @bye
  462.    Since an Info file uses menus instead of tables of contents, the Info
  463. formatting commands ignore the `@contents' and `@shortcontents'
  464. commands.
  465. File: texi.info,  Node: File End,  Prev: Contents,  Up: Ending a File
  466. `@bye' File Ending
  467. ==================
  468.    An `@bye' command terminates TeX or Info formatting.  None of the
  469. formatting commands see any of the file following `@bye'.  The `@bye'
  470. command should be on a line by itself.
  471.    If you wish, you may follow the `@bye' line with notes. These notes
  472. will not be formatted and will not appear in either Info or a printed
  473. manual; it is as if text after `@bye' were within `@ignore' ... `@end
  474. ignore'.  Also, you may follow the `@bye' line with a local variables
  475. list.  *Note Using Local Variables and the Compile Command:
  476. Compile-Command, for more information.
  477. File: texi.info,  Node: Structuring,  Next: Nodes,  Prev: Ending a File,  Up: Top
  478. Chapter Structuring
  479. *******************
  480.    The "chapter structuring" commands divide a document into a
  481. hierarchy of chapters, sections, subsections, and subsubsections.
  482. These commands generate large headings; they also provide information
  483. for the table of contents of a printed manual (*note Generating a Table
  484. of Contents: Contents.).
  485.    The chapter structuring commands do not create an Info node
  486. structure, so normally you should put an `@node' command immediately
  487. before each chapter structuring command (*note Nodes::.).  The only
  488. time you are likely to use the chapter structuring commands without
  489. using the node structuring commands is if you are writing a document
  490. that contains no cross references and will never be transformed into
  491. Info format.
  492.    It is unlikely that you will ever write a Texinfo file that is
  493. intended only as an Info file and not as a printable document.  If you
  494. do, you might still use chapter structuring commands to create a
  495. heading at the top of each node--but you don't need to.
  496. * Menu:
  497. * Tree Structuring::            A manual is like an upside down tree ...
  498. * Structuring Command Types::   How to divide a manual into parts.
  499. * makeinfo top::                The `@top' command, part of the `Top' node.
  500. * chapter::
  501. * unnumbered & appendix::
  502. * majorheading & chapheading::
  503. * section::
  504. * unnumberedsec appendixsec heading::
  505. * subsection::
  506. * unnumberedsubsec appendixsubsec subheading::
  507. * subsubsection::               Commands for the lowest level sections.
  508. File: texi.info,  Node: Tree Structuring,  Next: Structuring Command Types,  Up: Structuring
  509. Tree Structure of Sections
  510. ==========================
  511.    A Texinfo file is usually structured like a book with chapters,
  512. sections, subsections, and the like.  This structure can be visualized
  513. as a tree (or rather as an upside-down tree) with the root at the top
  514. and the levels corresponding to chapters, sections, subsection, and
  515. subsubsections.
  516.    Here is a diagram that shows a Texinfo file with three chapters,
  517. each of which has two sections.
  518.                                Top
  519.                                 |
  520.               -------------------------------------
  521.              |                  |                  |
  522.           Chapter 1          Chapter 2          Chapter 3
  523.              |                  |                  |
  524.           --------           --------           --------
  525.          |        |         |        |         |        |
  526.       Section  Section   Section  Section   Section  Section
  527.         1.1      1.2       2.1      2.2       3.1      3.2
  528.    In a Texinfo file that has this structure, the beginning of Chapter 2
  529. looks like this:
  530.      @node    Chapter 2,  Chapter 3, Chapter 1, top
  531.      @chapter Chapter 2
  532.    The chapter structuring commands are described in the sections that
  533. follow; the `@node' and `@menu' commands are described in following
  534. chapters. (*Note Nodes::, and see *Note Menus::.)
  535. File: texi.info,  Node: Structuring Command Types,  Next: makeinfo top,  Prev: Tree Structuring,  Up: Structuring
  536. Types of Structuring Command
  537. ============================
  538.    The chapter structuring commands fall into four groups or series,
  539. each of which contains structuring commands corresponding to the
  540. hierarchical levels of chapters, sections, subsections, and
  541. subsubsections.
  542.    The four groups are the `@chapter' series, the `@unnumbered' series,
  543. the `@appendix' series, and the `@heading' series.
  544.    Each command produces titles that have a different appearance on the
  545. printed page or Info file; only some of the commands produce titles
  546. that are listed in the table of contents of a printed book or manual.
  547.    * The `@chapter' and `@appendix' series of commands produce numbered
  548.      or lettered entries both in the body of a printed work and in its
  549.      table of contents.
  550.    * The `@unnumbered' series of commands produce unnumbered entries
  551.      both in the body of a printed work and in its table of contents.
  552.      The `@top' command, which has a special use, is a member of this
  553.      series (*note `@top': makeinfo top.).
  554.    * The `@heading' series of commands produce unnumbered headings that
  555.      do not appear in a table of contents.  The heading commands never
  556.      start a new page.
  557.    * The `@majorheading' command produces results similar to using the
  558.      `@chapheading' command but generates a larger vertical whitespace
  559.      before the heading.
  560.    * When an `@setchapternewpage' command says to do so, the
  561.      `@chapter', `@unnumbered', and `@appendix' commands start new
  562.      pages in the printed manual; the `@heading' commands do not.
  563.    Here are the four groups of chapter structuring commands:
  564.                                                             No new pages
  565.      Numbered       Unnumbered       Lettered and numbered  Unnumbered
  566.      In contents    In contents          In contents        Not in contents
  567.      
  568.                     @top                                    @majorheading
  569.      @chapter       @unnumbered          @appendix          @chapheading
  570.      @section       @unnumberedsec       @appendixsec       @heading
  571.      @subsection    @unnumberedsubsec    @appendixsubsec    @subheading
  572.      @subsubsection @unnumberedsubsubsec @appendixsubsubsec @subsubheading
  573. File: texi.info,  Node: makeinfo top,  Next: chapter,  Prev: Structuring Command Types,  Up: Structuring
  574. `@top'
  575. ======
  576.    The `@top' command is a special sectioning command that you use only
  577. after an `@node Top' line at the beginning of a Texinfo file.  The
  578. `@top' command tells the `makeinfo' formatter which node is the `Top'
  579. node.  It has the same typesetting effect as `@unnumbered' (*note
  580. `@unnumbered': (`@appendix')unnumbered & appendix.).  For detailed
  581. information, see *Note The `@top' Command: makeinfo top command.
  582. File: texi.info,  Node: chapter,  Next: unnumbered & appendix,  Prev: makeinfo top,  Up: Structuring
  583. `@chapter'
  584. ==========
  585.    `@chapter' identifies a chapter in the document.  Write the command
  586. at the beginning of a line and follow it on the same line by the title
  587. of the chapter.
  588.    For example, this chapter in this manual is entitled "Chapter
  589. Structuring"; the `@chapter' line looks like this:
  590.      @chapter Chapter Structuring
  591.    In TeX, the `@chapter' command creates a chapter in the document,
  592. specifying the chapter title.  The chapter is numbered automatically.
  593.    In Info, the `@chapter' command causes the title to appear on a line
  594. by itself, with a line of asterisks inserted underneath.  Thus, in
  595. Info, the above example produces the following output:
  596.      Chapter Structuring
  597.      *******************
  598. File: texi.info,  Node: unnumbered & appendix,  Next: majorheading & chapheading,  Prev: chapter,  Up: Structuring
  599. `@unnumbered', `@appendix'
  600. ==========================
  601.    Use the `@unnumbered' command to create a chapter that appears in a
  602. printed manual without chapter numbers of any kind.  Use the
  603. `@appendix' command to create an appendix in a printed manual that is
  604. labelled by letter instead of by number.
  605.    For Info file output, the `@unnumbered' and `@appendix' commands are
  606. equivalent to `@chapter': the title is printed on a line by itself with
  607. a line of asterisks underneath.  (*Note `@chapter': chapter.)
  608.    To create an appendix or an unnumbered chapter, write an `@appendix'
  609. or `@unnumbered' command at the beginning of a line and follow it on
  610. the same line by the title, as you would if you were creating a chapter.
  611. File: texi.info,  Node: majorheading & chapheading,  Next: section,  Prev: unnumbered & appendix,  Up: Structuring
  612. `@majorheading', `@chapheading'
  613. ===============================
  614.    The `@majorheading' and `@chapheading' commands put chapter-like
  615. headings in the body of a document.
  616.    However, neither command causes TeX to produce a numbered heading or
  617. an entry in the table of contents; and neither command causes TeX to
  618. start a new page in a printed manual.
  619.    In TeX, an `@majorheading' command generates a larger vertical
  620. whitespace before the heading than an `@chapheading' command but is
  621. otherwise the same.
  622.    In Info, the `@majorheading' and `@chapheading' commands are
  623. equivalent to `@chapter': the title is printed on a line by itself with
  624. a line of asterisks underneath.  (*Note `@chapter': chapter.)
  625. File: texi.info,  Node: section,  Next: unnumberedsec appendixsec heading,  Prev: majorheading & chapheading,  Up: Structuring
  626. `@section'
  627. ==========
  628.    In a printed manual, an `@section' command identifies a numbered
  629. section within a chapter.  The section title appears in the table of
  630. contents.  In Info, an `@section' command provides a title for a
  631. segment of text, underlined with `='.
  632.    This section is headed with an `@section' command and looks like
  633. this in the Texinfo file:
  634.      @section @code{@@section}
  635.    To create a section, write the `@section' command at the beginning
  636. of a line and follow it on the same line by the section title.
  637.    Thus,
  638.      @section This is a section
  639. produces
  640.      This is a section
  641.      =================
  642. in Info.
  643. File: texi.info,  Node: unnumberedsec appendixsec heading,  Next: subsection,  Prev: section,  Up: Structuring
  644. `@unnumberedsec', `@appendixsec', `@heading'
  645. ============================================
  646.    The `@unnumberedsec', `@appendixsec', and `@heading' commands are,
  647. respectively, the unnumbered, appendix-like, and heading-like
  648. equivalents of the `@section' command.  (*Note `@section': section.)
  649. `@unnumberedsec'
  650.      The `@unnumberedsec' command may be used within an unnumbered
  651.      chapter or within a regular chapter or appendix to provide an
  652.      unnumbered section.
  653. `@appendixsec'
  654. `@appendixsection'
  655.      `@appendixsection' is a longer spelling of the `@appendixsec'
  656.      command; the two are synonymous.
  657.      Conventionally, the `@appendixsec' or `@appendixsection' command
  658.      is used only within appendices.
  659. `@heading'
  660.      You may use the `@heading' command anywhere you wish for a
  661.      section-style heading that will not appear in the table of
  662.      contents.
  663. File: texi.info,  Node: subsection,  Next: unnumberedsubsec appendixsubsec subheading,  Prev: unnumberedsec appendixsec heading,  Up: Structuring
  664. The `@subsection' Command
  665. =========================
  666.    Subsections are to sections as sections are to chapters.  (*Note
  667. `@section': section.)  In Info, subsection titles are underlined with
  668. `-'.  For example,
  669.      @subsection This is a subsection
  670. produces
  671.      This is a subsection
  672.      --------------------
  673.    In a printed manual, subsections are listed in the table of contents
  674. and are numbered three levels deep.
  675. File: texi.info,  Node: unnumberedsubsec appendixsubsec subheading,  Next: subsubsection,  Prev: subsection,  Up: Structuring
  676. The `@subsection'-like Commands
  677. ===============================
  678.    The `@unnumberedsubsec', `@appendixsubsec', and `@subheading'
  679. commands are, respectively, the unnumbered, appendix-like, and
  680. heading-like equivalents of the `@subsection' command.  (*Note
  681. `@subsection': subsection.)
  682.    In Info, the `@subsection'-like commands generate a title underlined
  683. with hyphens.  In a printed manual, an `@subheading' command produces a
  684. heading like that of a subsection except that it is not numbered and
  685. does not appear in the table of contents.  Similarly, an
  686. `@unnumberedsubsec' command produces an unnumbered heading like that of
  687. a subsection and an `@appendixsubsec' command produces a
  688. subsection-like heading labelled with a letter and numbers; both of
  689. these commands produce headings that appear in the table of contents.
  690. File: texi.info,  Node: subsubsection,  Prev: unnumberedsubsec appendixsubsec subheading,  Up: Structuring
  691. The `subsub' Commands
  692. =====================
  693.    The fourth and lowest level sectioning commands in Texinfo are the
  694. `subsub' commands.  They are:
  695. `@subsubsection'
  696.      Subsubsections are to subsections as subsections are to sections.
  697.      (*Note `@subsection': subsection.)  In a printed manual,
  698.      subsubsection titles appear in the table of contents and are
  699.      numbered four levels deep.
  700. `@unnumberedsubsubsec'
  701.      Unnumbered subsubsection titles appear in the table of contents of
  702.      a printed manual, but lack numbers.  Otherwise, unnumbered
  703.      subsubsections are the same as subsubsections.  In Info, unnumbered
  704.      subsubsections look exactly like ordinary subsubsections.
  705. `@appendixsubsubsec'
  706.      Conventionally, appendix commands are used only for appendices and
  707.      are lettered and numbered appropriately in a printed manual.  They
  708.      also appear in the table of contents.  In Info, appendix
  709.      subsubsections look exactly like ordinary subsubsections.
  710. `@subsubheading'
  711.      The `@subsubheading' command may be used anywhere that you need a
  712.      small heading that will not appear in the table of contents.  In
  713.      Info, subsubheadings look exactly like ordinary subsubsection
  714.      headings.
  715.    In Info,  `subsub' titles are underlined with periods.  For example,
  716.      @subsubsection This is a subsubsection
  717. produces
  718.      This is a subsubsection
  719.      .......................
  720. File: texi.info,  Node: Nodes,  Next: Menus,  Prev: Structuring,  Up: Top
  721. Nodes
  722. *****
  723.    "Nodes" are the primary segments of a Texinfo file.  They do not
  724. themselves impose a hierarchic or any other kind of structure on a file.
  725. Nodes contain "node pointers" that name other nodes, and can contain
  726. "menus" which are lists of nodes.  In Info, the movement commands can
  727. carry you to a pointed-to node or to a node listed in a menu.  Node
  728. pointers and menus provide structure for Info files just as chapters,
  729. sections, subsections, and the like, provide structure for printed
  730. books.
  731. * Menu:
  732. * Two Paths::                   Different commands to structure
  733.                                   Info output and printed output.
  734. * Node Menu Illustration::      A diagram, and sample nodes and menus.
  735. * node::                        How to write a node, in detail.
  736. * makeinfo Pointer Creation::   How to create node pointers with `makeinfo'.
  737. File: texi.info,  Node: Two Paths,  Next: Node Menu Illustration,  Up: Nodes
  738. Two Paths
  739. =========
  740.    The node and menu commands and the chapter structuring commands are
  741. independent of each other:
  742.    * In Info, node and menu commands provide structure.  The chapter
  743.      structuring commands generate headings with different kinds of
  744.      underlining--asterisks for chapters, hyphens for sections, and so
  745.      on; they do nothing else.
  746.    * In TeX, the chapter structuring commands generate chapter and
  747.      section numbers and tables of contents.  The node and menu
  748.      commands provide information for cross references; they do nothing
  749.      else.
  750.    You can use node pointers and menus to structure an Info file any way
  751. you want; and you can write a Texinfo file so that its Info output has a
  752. different structure than its printed output.  However, most Texinfo
  753. files are written such that the structure for the Info output
  754. corresponds to the structure for the printed output.  It is not
  755. convenient to do otherwise.
  756.    Generally, printed output is structured in a tree-like hierarchy in
  757. which the chapters are the major limbs from which the sections branch
  758. out.  Similarly, node pointers and menus are organized to create a
  759. matching structure in the Info output.
  760. File: texi.info,  Node: Node Menu Illustration,  Next: node,  Prev: Two Paths,  Up: Nodes
  761. Node and Menu Illustration
  762. ==========================
  763.    Here is a copy of the diagram shown earlier that illustrates a
  764. Texinfo file with three chapters, each of which contains two sections.
  765.    Note that the "root" is at the top of the diagram and the "leaves"
  766. are at the bottom.  This is how such a diagram is drawn conventionally;
  767. it illustrates an upside-down tree.  For this reason, the root node is
  768. called the `Top' node, and `Up' node pointers carry you closer to the
  769. root.
  770.                                Top
  771.                                 |
  772.               -------------------------------------
  773.              |                  |                  |
  774.           Chapter 1          Chapter 2          Chapter 3
  775.              |                  |                  |
  776.           --------           --------           --------
  777.          |        |         |        |         |        |
  778.       Section  Section   Section  Section   Section  Section
  779.         1.1      1.2       2.1      2.2       3.1      3.2
  780.    Write the beginning of the node for Chapter 2 like this:
  781.      @node     Chapter 2,  Chapter 3, Chapter 1, top
  782.      @comment  node-name,  next,      previous,  up
  783. This `@node' line says that the name of this node is "Chapter 2", the
  784. name of the `Next' node is "Chapter 3", the name of the `Previous' node
  785. is "Chapter 1", and the name of the `Up' node is "Top".
  786.      *Please Note:* `Next' refers to the next node at the same
  787.      hierarchical level in the manual, not necessarily to the next node
  788.      within the Texinfo file.  In the Texinfo file, the subsequent node
  789.      may be at a lower level--a section-level node may follow a
  790.      chapter-level node, and a subsection-level node may follow a
  791.      section-level node.  `Next' and `Previous' refer to nodes at the
  792.      *same* hierarchical level.  (The `Top' node contains the exception
  793.      to this rule.  Since the `Top' node is the only node at that
  794.      level, `Next' refers to the first following node, which is almost
  795.      always a chapter or chapter-level node.)
  796.    To go to Sections 2.1 and 2.2 using Info, you need a menu inside
  797. Chapter 2.  (*Note Menus::.)  You would write the menu just before the
  798. beginning of Section 2.1, like this:
  799.          @menu
  800.          * Sect. 2.1::    Description of this section.
  801.          * Sect. 2.2::
  802.          @end menu
  803.    Write the node for Sect. 2.1 like this:
  804.          @node     Sect. 2.1, Sect. 2.2, Chapter 2, Chapter 2
  805.          @comment  node-name, next,      previous,  up
  806.    In Info format, the `Next' and `Previous' pointers of a node usually
  807. lead to other nodes at the same level--from chapter to chapter or from
  808. section to section (sometimes, as shown, the `Previous' pointer points
  809. up); an `Up' pointer usually leads to a node at the level above (closer
  810. to the `Top' node); and a `Menu' leads to nodes at a level below (closer
  811. to `leaves').  (A cross reference can point to a node at any level; see
  812. *Note Cross References::.)
  813.    Usually, an `@node' command and a chapter structuring command are
  814. used in sequence, along with indexing commands.  (You may follow the
  815. `@node' line with a comment line that reminds you which pointer is
  816. which.)
  817.    Here is the beginning of the chapter in this manual called "Ending a
  818. Texinfo File".  This shows an `@node' line followed by a comment line,
  819. an `@chapter' line, and then by indexing lines.
  820.      @node    Ending a File, Structuring, Beginning a File, Top
  821.      @comment node-name,     next,        previous,         up
  822.      @chapter Ending a Texinfo File
  823.      @cindex Ending a Texinfo file
  824.      @cindex Texinfo file ending
  825.      @cindex File ending
  826. File: texi.info,  Node: node,  Next: makeinfo Pointer Creation,  Prev: Node Menu Illustration,  Up: Nodes
  827. The `@node' Command
  828. ===================
  829.    A "node" is a segment of text that begins at an `@node' command and
  830. continues until the next `@node' command.  The definition of node is
  831. different from that for chapter or section.  A chapter may contain
  832. sections and a section may contain subsections; but a node cannot
  833. contain subnodes; the text of a node continues only until the next
  834. `@node' command in the file.  A node usually contains only one chapter
  835. structuring command, the one that follows the `@node' line.  On the
  836. other hand, in printed output nodes are used only for cross references,
  837. so a chapter or section may contain any number of nodes.  Indeed, a
  838. chapter usually contains several nodes, one for each section,
  839. subsection, and subsubsection.
  840.    To create a node, write an `@node' command at the beginning of a
  841. line, and follow it with four arguments, separated by commas, on the
  842. rest of the same line.  These arguments are the name of the node, and
  843. the names of the `Next', `Previous', and `Up' pointers, in that order.
  844. You may insert spaces before each pointer if you wish; the spaces are
  845. ignored.  You must write the name of the node, and the names of the
  846. `Next', `Previous', and `Up' pointers, all on the same line.  Otherwise,
  847. the formatters fail.  (*note info: (info)Top, for more information
  848. about nodes in Info.)
  849.    Usually, you write one of the chapter-structuring command lines
  850. immediately after an `@node' line--for example, an `@section' or
  851. `@subsection' line.  (*Note Types of Structuring Command: Structuring
  852. Command Types.)
  853.      *Please note:* The GNU Emacs Texinfo mode updating commands work
  854.      only with Texinfo files in which `@node' lines are followed by
  855.      chapter structuring lines.  *Note Updating Requirements::.
  856.    TeX uses `@node' lines to identify the names to use for cross
  857. references.  For this reason, you must write `@node' lines in a Texinfo
  858. file that you intend to format for printing, even if you do not intend
  859. to format it for Info.  (Cross references, such as the one at the end
  860. of this sentence, are made with `@xref' and its related commands; see
  861. *Note Cross References::.)
  862. * Menu:
  863. * Node Names::                  How to choose node and pointer names.
  864. * Writing a Node::              How to write an `@node' line.
  865. * Node Line Tips::              Keep names short.
  866. * Node Line Requirements::      Keep names unique, without @-commands.
  867. * First Node::                  How to write a `Top' node.
  868. * makeinfo top command::        How to use the `@top' command.
  869. * Top Node Summary::            Write a brief description for readers.
  870. File: texi.info,  Node: Node Names,  Next: Writing a Node,  Up: node
  871. Choosing Node and Pointer Names
  872. -------------------------------
  873.    The name of a node identifies the node.  The pointers enable you to
  874. reach other nodes and consist of the names of those nodes.
  875.    Normally, a node's `Up' pointer contains the name of the node whose
  876. menu mentions that node.  The node's `Next' pointer contains the name
  877. of the node that follows that node in that menu and its `Previous'
  878. pointer contains the name of the node that precedes it in that menu.
  879. When a node's `Previous' node is the same as its `Up' node, both node
  880. pointers name the same node.
  881.    Usually, the first node of a Texinfo file is the `Top' node, and its
  882. `Up' and `Previous' pointers point to the `dir' file, which contains
  883. the main menu for all of Info.
  884.    The `Top' node itself contains the main or master menu for the
  885. manual.  Also, it is helpful to include a brief description of the
  886. manual in the `Top' node.  *Note First Node::, for information on how
  887. to write the first node of a Texinfo file.
  888. File: texi.info,  Node: Writing a Node,  Next: Node Line Tips,  Prev: Node Names,  Up: node
  889. How to Write an `@node' Line
  890. ----------------------------
  891.    The easiest way to write an `@node' line is to write `@node' at the
  892. beginning of a line and then the name of the node, like this:
  893.      @node NODE-NAME
  894.    If you are using GNU Emacs, you can use the update node commands
  895. provided by Texinfo mode to insert the names of the pointers; or you
  896. can leave the pointers out of the Texinfo file and let `makeinfo'
  897. insert node pointers into the Info file it creates.  (*Note Texinfo
  898. Mode::, and *Note makeinfo Pointer Creation::.)
  899.    Alternatively, you can insert the `Next', `Previous', and `Up'
  900. pointers yourself.  If you do this, you may find it helpful to use the
  901. Texinfo mode keyboard command `C-c C-c n'.  This command inserts
  902. `@node' and a comment line listing the names of the pointers in their
  903. proper order.  The comment line helps you keep track of which arguments
  904. are for which pointers.  This comment line is especially useful if you
  905. are not familiar with Texinfo.
  906.    The template for a node line with `Next', `Previous', and `Up'
  907. pointers looks like this:
  908.      @node NODE-NAME, NEXT, PREVIOUS, UP
  909.    If you wish, you can ignore `@node' lines altogether in your first
  910. draft and then use the `texinfo-insert-node-lines' command to create
  911. `@node' lines for you.  However, we do not recommend this practice.  It
  912. is better to name the node itself at the same time that you write a
  913. segment so you can easily make cross references.  A large number of
  914. cross references are an especially important feature of a good Info
  915. file.
  916.    After you have inserted an `@node' line, you should immediately
  917. write an @-command for the chapter or section and insert its name.
  918. Next (and this is important!), put in several index entries.  Usually,
  919. you will find at least two and often as many as four or five ways of
  920. referring to the node in the index.  Use them all.  This will make it
  921. much easier for people to find the node.
  922. File: texi.info,  Node: Node Line Tips,  Next: Node Line Requirements,  Prev: Writing a Node,  Up: node
  923. `@node' Line Tips
  924. -----------------
  925.    Here are three suggestions:
  926.    * Try to pick node names that are informative but short.
  927.      In the Info file, the file name, node name, and pointer names are
  928.      all inserted on one line, which may run into the right edge of the
  929.      window.  (This does not cause a problem with Info, but is ugly.)
  930.    * Try to pick node names that differ from each other near the
  931.      beginnings of their names.  This way, it is easy to use automatic
  932.      name completion in Info.
  933.    * By convention, node names are capitalized just as they would be for
  934.      section or chapter titles--initial and significant words are
  935.      capitalized; others are not.
  936.