home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / gnu / texinfo-3.1-bin.lha / info / texi.info-9 (.txt) < prev   
GNU Info File  |  1994-02-24  |  47KB  |  925 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: Tips,  Next: Sample Texinfo File,  Prev: Command List,  Up: Top
  21. Tips and Hints
  22. **************
  23.    Here are some tips for writing Texinfo documentation:
  24.    * Write in the present tense, not in the past or the future.
  25.    * Write actively!  For example, write "We recommend that ..." rather
  26.      than "It is recommended that ...".
  27.    * Use 70 or 72 as your fill column.  Longer lines are hard to read.
  28.    * Include a copyright notice and copying permissions.
  29. Index, index, index!
  30. ....................
  31.    Write many index entries, in different ways.  Readers like indices;
  32. they are helpful and convenient.
  33.    Although it is easiest to write index entries as you write the body
  34. of the text, some people prefer to write entries afterwards.  In either
  35. case, write an entry before the paragraph to which it applies.  This
  36. way, an index entry points to the first page of a paragraph that is
  37. split across pages.
  38.    Here are more hints we have found valuable:
  39.    * Write each index entry differently, so each entry refers to a
  40.      different place in the document.  The index of an Info file lists
  41.      only one location for each entry.
  42.    * Write index entries only where a topic is discussed significantly.
  43.      For example, it is not useful to index "debugging information" in
  44.      a chapter on reporting bugs.  Someone who wants to know about
  45.      debugging information will certainly not find it in that chapter.
  46.    * Consistently capitalize the first word of every index entry, or
  47.      else use lower case.  According to convention, you should
  48.      capitalize the first word of an index entry.  However, this
  49.      practice may make an index look crowded.  Some writers prefer
  50.      lower case.  Regardless of which you prefer, choose one style and
  51.      stick to it.  Mixing the two styles looks bad.
  52.    * Always capitalize or use upper case for those words in an index for
  53.      which this is proper, such as names of countries or acronyms.
  54.    * Write the indexing commands that refer to a whole section
  55.      immediately after the section command, and write the indexing
  56.      commands that refer to the paragraph before the paragraph.
  57.      In the example that follows, a blank line comes after the index
  58.      entry for "Leaping":
  59.           @section The Dog and the Fox
  60.           @cindex Jumping, in general
  61.           @cindex Leaping
  62.           
  63.           @cindex Dog, lazy, jumped over
  64.           @cindex Lazy dog jumped over
  65.           @cindex Fox, jumps over dog
  66.           @cindex Quick fox jumps over dog
  67.           The quick brown fox jumps over the lazy dog.
  68.      (Note that the example shows entries for the same concept that are
  69.      written in different ways--`Lazy dog', and `Dog, lazy'--so readers
  70.      can look up the concept in different ways.)
  71. Blank lines
  72. ...........
  73.    * Insert a blank line between a sectioning command and the first
  74.      following sentence or paragraph, or between the indexing commands
  75.      associated with the sectioning command and the first following
  76.      sentence or paragraph, as shown in the tip on indexing.
  77.      Otherwise, a formatter may fold title and paragraph together.
  78.    * Always insert a blank line before an `@table' command and after an
  79.      `@end table' command; but never insert a blank line after an
  80.      `@table' command or before an `@end table' command.
  81.      For example,
  82.           Types of fox:
  83.           
  84.           @table @samp
  85.           @item Quick
  86.           Jump over lazy dogs.
  87.           
  88.           @item Brown
  89.           Also jump over lazy dogs.
  90.           @end table
  91.           @noindent
  92.           On the other hand, ...
  93.      Insert blank lines before and after `@itemize' ... `@end itemize'
  94.      and `@enumerate' ... `@end enumerate' in the same way.
  95. Complete phrases
  96. ................
  97.    Complete phrases are easier to read than ...
  98.    * Write entries in an itemized list as complete sentences; or at
  99.      least, as complete phrases.  Incomplete expressions ... awkward
  100.      ... like this.
  101.    * Write the prefatory sentence or phrase for a multi-item list or
  102.      table as a complete expression.  Do not write "You can set:";
  103.      instead, write "You can set these variables:".  The former
  104.      expression sounds cut off.
  105. Editions, dates and versions
  106. ............................
  107.    Write the edition and version numbers and date in three places in
  108. every manual:
  109.   1. In the first `@ifinfo' section, for people reading the Texinfo
  110.      file.
  111.   2. In the `@titlepage' section, for people reading the printed manual.
  112.   3. In the `Top' node, for people reading the Info file.
  113. Also, it helps to write a note before the first `@ifinfo' section to
  114. explain what you are doing.
  115. For example:
  116.      @c ===> NOTE! <==
  117.      @c Specify the edition and version numbers and date
  118.      @c in *three* places:
  119.      @c   1. First ifinfo section  2. title page  3. top node
  120.      @c To find the locations, search for !!set
  121.      
  122.      @ifinfo
  123.      @c !!set edition, date, version
  124.      This is Edition 4.03, January 1992,
  125.      of the @cite{GDB Manual} for GDB Version 4.3.
  126.      ...
  127. --or use `@set' and `@value' (*note `@value' Example: value Example.).
  128. Definition Commands
  129. ...................
  130.    Definition commands are `@deffn', `@defun', `@defmac', and the like,
  131. and enable you to write descriptions in a uniform format.
  132.    * Write just one definition command for each entity you define with a
  133.      definition command.  The automatic indexing feature creates an
  134.      index entry that leads the reader to the definition.
  135.    * Use `@table' ... `@end table' in an appendix that contains a
  136.      summary of functions, not `@deffn' or other definition commands.
  137. Capitalization
  138. ..............
  139.    * Capitalize `Texinfo'; it is a name.  Do not write the `x' or `i'
  140.      in upper case.
  141.    * Capitalize `Info'; it is a name.
  142.    * Write TeX using the `@TeX{}' command.  Note the uppercase `T' and
  143.      `X'.  This command causes the formatters to typeset the name
  144.      according to the wishes of Donald Knuth, who wrote TeX.
  145. Spaces
  146. ......
  147.    Do not use spaces to format a Texinfo file, except inside of
  148. `@example' ... `@end example' and similar commands.
  149.    For example, TeX fills the following:
  150.          @kbd{C-x v}
  151.          @kbd{M-x vc-next-action}
  152.             Perform the next logical operation
  153.             on the version-controlled file
  154.             corresponding to the current buffer.
  155. so it looks like this:
  156.      `C-x v' `M-x vc-next-action' Perform the next logical operation on
  157.      the version-controlled file corresponding to the current buffer.
  158. In this case, the text should be formatted with `@table', `@item', and
  159. `@itemx', to create a table.
  160. @code, @samp, @var, and `---'
  161. .............................
  162.    * Use `@code' around Lisp symbols, including command names.  For
  163.      example,
  164.           The main function is @code{vc-next-action}, ...
  165.    * Avoid putting letters such as `s' immediately after an `@code'.
  166.      Such letters look bad.
  167.    * Use `@var' around meta-variables.  Do not write angle brackets
  168.      around them.
  169.    * Use three hyphens in a row, `---', to indicate a long dash.  TeX
  170.      typesets these as a long dash and the Info formatters reduce three
  171.      hyphens to two.
  172. Periods Outside of Quotes
  173. .........................
  174.    Place periods and other punctuation marks *outside* of quotations,
  175. unless the punctuation is part of the quotation.  This practice goes
  176. against convention, but enables the reader to distinguish between the
  177. contents of the quotation and the whole passage.
  178.    For example, you should write the following sentence with the period
  179. outside the end quotation marks:
  180.      Evidently, `au' is an abbreviation for ``author''.
  181. since `au' does *not* serve as an  abbreviation for `author.' (with a
  182. period following the word).
  183. Introducing New Terms
  184. .....................
  185.    * Introduce new terms so that a user who does not know them can
  186.      understand them from context; or write a definition for the term.
  187.      For example, in the following, the terms "check in", "register" and
  188.      "delta" are all appearing for the first time; the example sentence
  189.      should be rewritten so they are understandable.
  190.           The major function assists you in checking in a file to your
  191.           version control system and registering successive sets of
  192.           changes to it as deltas.
  193.    * Use the `@dfn' command around a word being introduced, to indicate
  194.      that the user should not expect to know the meaning already, and
  195.      should expect to learn the meaning from this passage.
  196. @pxref
  197. ......
  198.    Absolutely never use `@pxref' except in the special context for
  199. which it is designed: inside parentheses, with the closing parenthesis
  200. following immediately after the closing brace.  One formatter
  201. automatically inserts closing punctuation and the other does not.  This
  202. means that the output looks right both in printed output and in an Info
  203. file, but only when the command is used inside parentheses.
  204. Invoking from a Shell
  205. .....................
  206.    You can invoke programs such as Emacs, GCC, and GAWK from a shell.
  207. The documentation for each program should contain a section that
  208. describes this.  Unfortunately, if the node names and titles for these
  209. sections are all different, readers find it hard to search for the
  210. section.
  211.    Name such sections with a phrase beginning with the word
  212. `Invoking ...', as in `Invoking Emacs'; this way users can find the
  213. section easily.
  214. ANSI C Syntax
  215. .............
  216.    When you use `@example' to describe a C function's calling
  217. conventions, use the ANSI C syntax, like this:
  218.      void dld_init (char *@var{path});
  219. And in the subsequent discussion, refer to the argument values by
  220. writing the same argument names, again highlighted with `@var'.
  221.    Avoid the obsolete style that looks like this:
  222.      #include <dld.h>
  223.      
  224.      dld_init (path)
  225.      char *path;
  226.    Also, it is best to avoid writing `#include' above the declaration
  227. just to indicate that the function is declared in a header file.  The
  228. practice may give the misimpression that the `#include' belongs near
  229. the declaration of the function.  Either state explicitly which header
  230. file holds the declaration or, better yet, name the header file used
  231. for a group of functions at the beginning of the section that describes
  232. the functions.
  233. Bad Examples
  234. ............
  235.    Here are several examples of bad writing to avoid:
  236.    In this example, say, " ... you must `@dfn'{check in} the new
  237. version."  That flows better.
  238.      When you are done editing the file, you must perform a
  239.      `@dfn'{check in}.
  240.    In the following example, say, "... makes a unified interface such
  241. as VC mode possible."
  242.      SCCS, RCS and other version-control systems all perform similar
  243.      functions in broadly similar ways (it is this resemblance which
  244.      makes a unified control mode like this possible).
  245.    And in this example, you should specify what `it' refers to:
  246.      If you are working with other people, it assists in coordinating
  247.      everyone's changes so they do not step on each other.
  248. And Finally ...
  249. ...............
  250.    * Pronounce TeX as if the `X' were a Greek `chi', as the last sound
  251.      in the name `Bach'.  But pronounce Texinfo as in `speck':
  252.      `teckinfo'.
  253.    * Write notes for yourself at the very end of a Texinfo file after
  254.      the `@bye'.  None of the formatters process text after the `@bye';
  255.      it is as if the text were within `@ignore' ...  `@end ignore'.
  256. File: texi.info,  Node: Sample Texinfo File,  Next: Sample Permissions,  Prev: Tips,  Up: Top
  257. A Sample Texinfo File
  258. *********************
  259.    Here is a complete, short sample Texinfo file, without any
  260. commentary.  You can see this file, with comments, in the first chapter.
  261. *Note A Short Sample Texinfo File: Short Sample.
  262.      \input texinfo   @c -*-texinfo-*-
  263.      @c %**start of header
  264.      @setfilename sample.info
  265.      @settitle Sample Document
  266.      @c %**end of header
  267.      
  268.      @setchapternewpage odd
  269.      
  270.      @ifinfo
  271.      This is a short example of a complete Texinfo file.
  272.      
  273.      Copyright 1990 Free Software Foundation, Inc.
  274.      @end ifinfo
  275.      
  276.      @titlepage
  277.      @sp 10
  278.      @comment The title is printed in a large font.
  279.      @center @titlefont{Sample Title}
  280.      
  281.      @c The following two commands start the copyright page.
  282.      @page
  283.      @vskip 0pt plus 1filll
  284.      Copyright @copyright{} 1990 Free Software Foundation, Inc.
  285.      @end titlepage
  286.      
  287.      @node    Top,       First Chapter, (dir),    (dir)
  288.      @comment node-name, next,          previous, up
  289.      
  290.      @menu
  291.      * First Chapter::    The first chapter is the
  292.                           only chapter in this sample.
  293.      * Concept Index::    This index has two entries.
  294.      @end menu
  295.      
  296.      @node    First Chapter, Concept Index, Top,      Top
  297.      @comment node-name,     next,          previous, up
  298.      @chapter First Chapter
  299.      @cindex Sample index entry
  300.      
  301.      This is the contents of the first chapter.
  302.      @cindex Another sample index entry
  303.      
  304.      Here is a numbered list.
  305.      
  306.      @enumerate
  307.      @item
  308.      This is the first item.
  309.      
  310.      @item
  311.      This is the second item.
  312.      @end enumerate
  313.      
  314.      The @code{makeinfo} and @code{texinfo-format-buffer}
  315.      commands transform a Texinfo file such as this into
  316.      an Info file; and @TeX{} typesets it for a printed
  317.      manual.
  318.      
  319.      @node    Concept Index,    ,  First Chapter, Top
  320.      @comment node-name,    next,  previous,      up
  321.      @unnumbered Concept Index
  322.      
  323.      @printindex cp
  324.      
  325.      @contents
  326.      @bye
  327. File: texi.info,  Node: Sample Permissions,  Next: Include Files,  Prev: Sample Texinfo File,  Up: Top
  328. Sample Permissions
  329. ******************
  330.    Texinfo files should contain sections that tell the readers that they
  331. have the right to copy and distribute the Texinfo file, the Info file,
  332. and the printed manual.
  333.    Also, if you are writing a manual about software, you should explain
  334. that the software is free and either include the GNU General Public
  335. License (GPL) or provide a reference to it.  *Note Distribution:
  336. (emacs)Distrib, for an example of the text that could be used in the
  337. software "Distribution", "General Public License", and "NO WARRANTY"
  338. sections of a document.  *Note Texinfo Copying Conditions: Copying, for
  339. an example of a brief explanation of how the copying conditions provide
  340. you with rights.
  341. * Menu:
  342. * Inserting Permissions::       How to put permissions in your document.
  343. * ifinfo Permissions::          Sample `ifinfo' copying permissions.
  344. * Titlepage Permissions::       Sample Titlepage copying permissions.
  345. File: texi.info,  Node: Inserting Permissions,  Next: ifinfo Permissions,  Up: Sample Permissions
  346. Inserting Permissions
  347. =====================
  348.    In a Texinfo file, the first `@ifinfo' section usually begins with a
  349. line that says what the file documents.  This is what a person reading
  350. the unprocessed Texinfo file or using the advanced Info command `g *'
  351. sees first.  *note Advanced Info commands: (info)Expert, for more
  352. information. (A reader using the regular Info commands usually starts
  353. reading at the first node and skips this first section, which is not in
  354. a node.)
  355.    In the `@ifinfo' section, the summary sentence is followed by a
  356. copyright notice and then by the copying permission notice.  One of the
  357. copying permission paragraphs is enclosed in `@ignore' and `@end
  358. ignore' commands.  This paragraph states that the Texinfo file can be
  359. processed through TeX and printed, provided the printed manual carries
  360. the proper copying permission notice.  This paragraph is not made part
  361. of the Info file since it is not relevant to the Info file; but it is a
  362. mandatory part of the Texinfo file since it permits people to process
  363. the Texinfo file in TeX and print the results.
  364.    In the printed manual, the Free Software Foundation copying
  365. permission notice follows the copyright notice and publishing
  366. information and is located within the region delineated by the
  367. `@titlepage' and `@end titlepage' commands.  The copying permission
  368. notice is exactly the same as the notice in the `@ifinfo' section
  369. except that the paragraph enclosed in `@ignore' and `@end ignore'
  370. commands is not part of the notice.
  371.    To make it simple to insert a permission notice into each section of
  372. the Texinfo file, sample permission notices for each section are
  373. reproduced in full below.
  374.    Note that you may need to specify the correct name of a section
  375. mentioned in the permission notice.  For example, in `The GDB Manual',
  376. the name of the section referring to the General Public License is
  377. called the "GDB General Public License", but in the sample shown below,
  378. that section is referred to generically as the "GNU General Public
  379. License".  If the Texinfo file does not carry a copy of the General
  380. Public License, leave out the reference to it, but be sure to include
  381. the rest of the sentence.
  382. File: texi.info,  Node: ifinfo Permissions,  Next: Titlepage Permissions,  Prev: Inserting Permissions,  Up: Sample Permissions
  383. `ifinfo' Copying Permissions
  384. ============================
  385.    In the `@ifinfo' section of a Texinfo file, the standard Free
  386. Software Foundation permission notice reads as follows:
  387.      This file documents ...
  388.      
  389.      Copyright 1992 Free Software Foundation, Inc.
  390.      
  391.      Permission is granted to make and distribute verbatim
  392.      copies of this manual provided the copyright notice and
  393.      this permission notice are preserved on all copies.
  394.      
  395.      @ignore
  396.      Permission is granted to process this file through TeX
  397.      and print the results, provided the printed document
  398.      carries a copying permission notice identical to this
  399.      one except for the removal of this paragraph (this
  400.      paragraph not being relevant to the printed manual).
  401.      
  402.      @end ignore
  403.      Permission is granted to copy and distribute modified
  404.      versions of this manual under the conditions for
  405.      verbatim copying, provided also that the sections
  406.      entitled ``Copying'' and ``GNU General Public License''
  407.      are included exactly as in the original, and provided
  408.      that the entire resulting derived work is distributed
  409.      under the terms of a permission notice identical to this
  410.      one.
  411.      
  412.      Permission is granted to copy and distribute
  413.      translations of this manual into another language,
  414.      under the above conditions for modified versions,
  415.      except that this permission notice may be stated in a
  416.      translation approved by the Free Software Foundation.
  417. File: texi.info,  Node: Titlepage Permissions,  Prev: ifinfo Permissions,  Up: Sample Permissions
  418. Titlepage Copying Permissions
  419. =============================
  420.    In the `@titlepage' section of a Texinfo file, the standard Free
  421. Software Foundation copying permission notice follows the copyright
  422. notice and publishing information.  The standard phrasing is as follows:
  423.      Permission is granted to make and distribute verbatim
  424.      copies of this manual provided the copyright notice and
  425.      this permission notice are preserved on all copies.
  426.      
  427.      Permission is granted to copy and distribute modified
  428.      versions of this manual under the conditions for
  429.      verbatim copying, provided also that the sections
  430.      entitled ``Copying'' and ``GNU General Public License''
  431.      are included exactly as in the original, and provided
  432.      that the entire resulting derived work is distributed
  433.      under the terms of a permission notice identical to this
  434.      one.
  435.      
  436.      Permission is granted to copy and distribute
  437.      translations of this manual into another language,
  438.      under the above conditions for modified versions,
  439.      except that this permission notice may be stated in a
  440.      translation approved by the Free Software Foundation.
  441. File: texi.info,  Node: Include Files,  Next: Headings,  Prev: Sample Permissions,  Up: Top
  442. Include Files
  443. *************
  444.    When TeX or an Info formatting command sees an `@include' command in
  445. a Texinfo file, it processes the contents of the file named by the
  446. command and incorporates them into the DVI or Info file being created.
  447. Index entries from the included file are incorporated into the indices
  448. of the output file.
  449.    Include files let you keep a single large document as a collection of
  450. conveniently small parts.
  451. * Menu:
  452. * Using Include Files::         How to use the `@include' command.
  453. * texinfo-multiple-files-update::  How to create and update nodes and
  454.                                   menus when using included files.
  455. * Include File Requirements::   What `texinfo-multiple-files-update' expects.
  456. * Sample Include File::         A sample outer file with included files
  457.                                   within it; and a sample included file.
  458. * Include Files Evolution::     How use of the `@include' command
  459.                                   has changed over time.
  460. File: texi.info,  Node: Using Include Files,  Next: texinfo-multiple-files-update,  Up: Include Files
  461. How to Use Include Files
  462. ========================
  463.    To include another file within a Texinfo file, write the `@include'
  464. command at the beginning of a line and follow it on the same line by
  465. the name of a file to be included.  For example:
  466.      @include buffers.texi
  467.    An included file should simply be a segment of text that you expect
  468. to be included as is into the overall or "outer" Texinfo file; it
  469. should not contain the standard beginning and end parts of a Texinfo
  470. file.  In particular, you should not start an included file with a line
  471. saying `\input texinfo'; if you do, that phrase is inserted into the
  472. output file as is.  Likewise, you should not end an included file with
  473. an `@bye' command; nothing after `@bye' is formatted.
  474.    In the past, you were required to write an `@setfilename' line at the
  475. beginning of an included file, but no longer.  Now, it does not matter
  476. whether you write such a line.  If an `@setfilename' line exists in an
  477. included file, it is ignored.
  478.    Conventionally, an included file begins with an `@node' line that is
  479. followed by an `@chapter' line.  Each included file is one chapter.
  480. This makes it easy to use the regular node and menu creating and
  481. updating commands to create the node pointers and menus within the
  482. included file.  However, the simple Emacs node and menu creating and
  483. updating commands do not work with multiple Texinfo files.  Thus you
  484. cannot use these commands to fill in the `Next', `Previous', and `Up'
  485. pointers of the `@node' line that begins the included file.  Also, you
  486. cannot use the regular commands to create a master menu for the whole
  487. file.  Either you must insert the menus and the `Next', `Previous', and
  488. `Up' pointers by hand, or you must use the GNU Emacs Texinfo mode
  489. command, `texinfo-multiple-files-update', that is designed for
  490. `@include' files.
  491. File: texi.info,  Node: texinfo-multiple-files-update,  Next: Include File Requirements,  Prev: Using Include Files,  Up: Include Files
  492. `texinfo-multiple-files-update'
  493. ===============================
  494.    GNU Emacs Texinfo mode provides a command to handle included files
  495. called `texinfo-multiple-files-update'.  This command creates or
  496. updates `Next', `Previous', and `Up' pointers of included files as well
  497. as those in the outer or overall Texinfo file, and it creates or
  498. updates a main menu in the outer file.  Depending whether you call it
  499. with optional arguments, the command updates only the pointers in the
  500. first `@node' line of the included files or all of them:
  501. `M-x texinfo-multiple-files-update'
  502.      Called without any arguments:
  503.         - Create or update the `Next', `Previous', and `Up' pointers of
  504.           the first `@node' line in each file included in an outer or
  505.           overall Texinfo file.
  506.         - Create or update the `Top' level node pointers of the outer or
  507.           overall file.
  508.         - Create or update a main menu in the outer file.
  509. `C-u M-x texinfo-multiple-files-update'
  510.      Called with `C-u' as a prefix argument:
  511.         - Create or update pointers in the first `@node' line in each
  512.           included file.
  513.         - Create or update the `Top' level node pointers of the outer
  514.           file.
  515.         - Create and insert a master menu in the outer file.  The
  516.           master menu is made from all the menus in all the included
  517.           files.
  518. `C-u 8 M-x texinfo-multiple-files-update'
  519.      Called with a numeric prefix argument, such as `C-u 8':
  520.         - Create or update *all* the `Next', `Previous', and `Up'
  521.           pointers of all the included files.
  522.         - Create or update *all* the menus of all the included files.
  523.         - Create or update the `Top' level node pointers of the outer or
  524.           overall file.
  525.         - And then create a master menu in the outer file.  This is
  526.           similar to invoking `texinfo-master-menu' with an argument
  527.           when you are working with just one file.
  528.    Note the use of the prefix argument in interactive use: with a
  529. regular prefix argument, just `C-u', the
  530. `texinfo-multiple-files-update' command inserts a master menu; with a
  531. numeric prefix argument, such as `C-u 8', the command updates *every*
  532. pointer and menu in *all* the files and then inserts a master menu.
  533. File: texi.info,  Node: Include File Requirements,  Next: Sample Include File,  Prev: texinfo-multiple-files-update,  Up: Include Files
  534. Include File Requirements
  535. =========================
  536.    If you plan to use the `texinfo-multiple-files-update' command, the
  537. outer Texinfo file that lists included files within it should contain
  538. nothing but the beginning and end parts of a Texinfo file, and a number
  539. of `@include' commands listing the included files.  It should not even
  540. include indices, which should be listed in an included file of their
  541.    Moreover, each of the included files must contain exactly one highest
  542. level node (conventionally, `@chapter' or equivalent), and this node
  543. must be the first node in the included file.  Furthermore, each of
  544. these highest level nodes in each included file must be at the same
  545. hierarchical level in the file structure.  Usually, each is an
  546. `@chapter', an `@appendix', or an `@unnumbered' node.  Thus, normally,
  547. each included file contains one, and only one, chapter or
  548. equivalent-level node.
  549.    The outer file should contain only *one* node, the `Top' node.  It
  550. should *not* contain any nodes besides the single `Top' node.  The
  551. `texinfo-multiple-files-update' command will not process them.
  552. File: texi.info,  Node: Sample Include File,  Next: Include Files Evolution,  Prev: Include File Requirements,  Up: Include Files
  553. Sample File with `@include'
  554. ===========================
  555.    Here is an example of a complete outer Texinfo file with `@include'
  556. files within it before running `texinfo-multiple-files-update', which
  557. would insert a main or master menu:
  558.      \input texinfo @c -*-texinfo-*-
  559.      @setfilename  include-example.info
  560.      @settitle Include Example
  561.      
  562.      @setchapternewpage odd
  563.      @titlepage
  564.      @sp 12
  565.      @center @titlefont{Include Example}
  566.      @sp 2
  567.      @center by Whom Ever
  568.      
  569.      @page
  570.      @vskip 0pt plus 1filll
  571.      Copyright @copyright{} 1990 Free Software Foundation, Inc.
  572.      @end titlepage
  573.      
  574.      @ifinfo
  575.      @node Top, First, (dir), (dir)
  576.      @top Master Menu
  577.      @end ifinfo
  578.      
  579.      @include foo.texinfo
  580.      @include bar.texinfo
  581.      @include concept-index.texinfo
  582.      
  583.      @summarycontents
  584.      @contents
  585.      
  586.      @bye
  587.    An included file, such as `foo.texinfo', might look like this:
  588.      @node First, Second, , Top
  589.      @chapter First Chapter
  590.      
  591.      Contents of first chapter ...
  592.    The full contents of `concept-index.texinfo' might be as simple as
  593. this:
  594.      @node Concept Index, , Second, Top
  595.      @unnumbered Concept Index
  596.      
  597.      @printindex cp
  598.    The outer Texinfo source file for `The GNU Emacs Lisp Reference
  599. Manual' is named `elisp.texi'.  This outer file contains a master menu
  600. with 417 entries and a list of 41 `@include' files.
  601. File: texi.info,  Node: Include Files Evolution,  Prev: Sample Include File,  Up: Include Files
  602. Evolution of Include Files
  603. ==========================
  604.    When Info was first created, it was customary to create many small
  605. Info files on one subject.  Each Info file was formatted from its own
  606. Texinfo source file.  This custom meant that Emacs did not need to make
  607. a large buffer to hold the whole of a large Info file when someone
  608. wanted information; instead, Emacs allocated just enough memory for the
  609. small Info file that contained the particular information sought.  This
  610. way, Emacs could avoid wasting memory.
  611.    References from one file to another were made by referring to the
  612. file name as well as the node name. (*Note Referring to Other Info
  613. Files: Other Info Files.  Also, see *Note `@xref' with Four and Five
  614. Arguments: Four and Five Arguments.)
  615.    Include files were designed primarily as a way to create a single,
  616. large printed manual out of several smaller Info files.  In a printed
  617. manual, all the references were within the same document, so TeX could
  618. automatically determine the references' page numbers.  The Info
  619. formatting commands used include files only for creating joint indices;
  620. each of the individual Texinfo files had to be formatted for Info
  621. individually.  (Each, therefore, required its own `@setfilename' line.)
  622.    However, because large Info files are now split automatically, it is
  623. no longer necessary to keep them small.
  624.    Nowadays, multiple Texinfo files are used mostly for large documents,
  625. such as `The GNU Emacs Lisp Reference Manual', and for projects in
  626. which several different people write different sections of a document
  627. simultaneously.
  628.    In addition, the Info formatting commands have been extended to work
  629. with the `@include' command so as to create a single large Info file
  630. that is split into smaller files if necessary.  This means that you can
  631. write menus and cross references without naming the different Texinfo
  632. files.
  633. File: texi.info,  Node: Headings,  Next: Catching Mistakes,  Prev: Include Files,  Up: Top
  634. Page Headings
  635. *************
  636.    Most printed manuals contain headings along the top of every page
  637. except the title and copyright pages.  Some manuals also contain
  638. footings.  (Headings and footings have no meaning to Info, which is not
  639. paginated.)
  640. * Menu:
  641. * Headings Introduced::         Conventions for using page headings.
  642. * Heading Format::              Standard page heading formats.
  643. * Heading Choice::              How to specify the type of page heading.
  644. * Custom Headings::             How to create your own headings and footings.
  645. File: texi.info,  Node: Headings Introduced,  Next: Heading Format,  Up: Headings
  646. Headings Introduced
  647. ===================
  648.    Texinfo provides standard page heading formats for manuals that are
  649. printed on one side of each sheet of paper and for manuals that are
  650. printed on both sides of the paper.  Usually, you will use one or other
  651. of these formats, but you can specify your own format, if you wish.
  652.    In addition, you can specify whether chapters should begin on a new
  653. page, or merely continue the same page as the previous chapter; and if
  654. chapters begin on new pages, you can specify whether they must be
  655. odd-numbered pages.
  656.    By convention, a book is printed on both sides of each sheet of
  657. paper.  When you open a book, the right-hand page is odd-numbered, and
  658. chapters begin on right-hand pages--a preceding left-hand page is left
  659. blank if necessary.  Reports, however, are often printed on just one
  660. side of paper, and chapters begin on a fresh page immediately following
  661. the end of the preceding chapter.  In short or informal reports,
  662. chapters often do not begin on a new page at all, but are separated
  663. from the preceding text by a small amount of whitespace.
  664.    The `@setchapternewpage' command controls whether chapters begin on
  665. new pages, and whether one of the standard heading formats is used.  In
  666. addition, Texinfo has several heading and footing commands that you can
  667. use to generate your own heading and footing formats.
  668.    In Texinfo, headings and footings are single lines at the tops and
  669. bottoms of pages; you cannot create multiline headings or footings.
  670. Each header or footer line is divided into three parts: a left part, a
  671. middle part, and a right part.  Any part, or a whole line, may be left
  672. blank.  Text for the left part of a header or footer line is set
  673. flushleft; text for the middle part is centered; and, text for the
  674. right part is set flushright.
  675. File: texi.info,  Node: Heading Format,  Next: Heading Choice,  Prev: Headings Introduced,  Up: Headings
  676. Standard Heading Formats
  677. ========================
  678.    Texinfo provides two standard heading formats, one for manuals
  679. printed on one side of each sheet of paper, and the other for manuals
  680. printed on both sides of the paper.
  681.    By default, nothing is specified for the footing of a Texinfo file,
  682. so the footing remains blank.
  683.    The standard format for single-sided printing consists of a header
  684. line in which the left-hand part contains the name of the chapter, the
  685. central part is blank, and the right-hand part contains the page number.
  686.    A single-sided page looks like this:
  687.         _______________________
  688.        |                       |
  689.        | chapter   page number |
  690.        |                       |
  691.        | Start of text ...     |
  692.        | ...                   |
  693.        |                       |
  694.    The standard format for two-sided printing depends on whether the
  695. page number is even or odd.  By convention, even-numbered pages are on
  696. the left- and odd-numbered pages are on the right.  (TeX will adjust the
  697. widths of the left- and right-hand margins.  Usually, widths are
  698. correct, but during double-sided printing, it is wise to check that
  699. pages will bind properly--sometimes a printer will produce output in
  700. which the even-numbered pages have a larger right-hand margin than the
  701. odd-numbered pages.)
  702.    In the standard double-sided format, the left part of the left-hand
  703. (even-numbered) page contains the page number, the central part is
  704. blank, and the right part contains the title (specified by the
  705. `@settitle' command).  The left part of the right-hand (odd-numbered)
  706. page contains the name of the chapter, the central part is blank, and
  707. the right part contains the page number.
  708.    Two pages, side by side as in an open book, look like this:
  709.         _______________________     _______________________
  710.        |                       |   |                       |
  711.        | page number     title |   | chapter   page number |
  712.        |                       |   |                       |
  713.        | Start of text ...     |   | More  text ...        |
  714.        | ...                   |   | ...                   |
  715.        |                       |   |                       |
  716. The chapter name is preceded by the word `Chapter', the chapter number
  717. and a colon.  This makes it easier to keep track of where you are in
  718. the manual.
  719. File: texi.info,  Node: Heading Choice,  Next: Custom Headings,  Prev: Heading Format,  Up: Headings
  720. Specifying the Type of Heading
  721. ==============================
  722.    TeX does not begin to generate page headings for a standard Texinfo
  723. file until it reaches the `@end titlepage' command.  Thus, the title
  724. and copyright pages are not numbered.  The `@end titlepage' command
  725. causes TeX to begin to generate page headings according to a standard
  726. format specified by the `@setchapternewpage' command that precedes the
  727. `@titlepage' section.
  728.    There are four possibilities:
  729. No `@setchapternewpage' command
  730.      Cause TeX to specify the single-sided heading format, with chapters
  731.      on new pages. This is the same as `@setchapternewpage on'.
  732. `@setchapternewpage on'
  733.      Specify the single-sided heading format, with chapters on new
  734.      pages.
  735. `@setchapternewpage off'
  736.      Cause TeX to start a new chapter on the same page as the last page
  737.      of the preceding chapter, after skipping some vertical whitespace.
  738.      Also cause TeX to typeset for single-sided printing.  (You can
  739.      override the headers format with the `@headings double' command;
  740.      see *Note The `@headings' Command: headings on off.)
  741. `@setchapternewpage odd'
  742.      Specify the double-sided heading format, with chapters on new
  743.      pages.
  744. Texinfo lacks an `@setchapternewpage even' command.
  745. File: texi.info,  Node: Custom Headings,  Prev: Heading Choice,  Up: Headings
  746. How to Make Your Own Headings
  747. =============================
  748.    You can use the standard headings provided with Texinfo or specify
  749. your own.
  750.    Texinfo provides six commands for specifying headings and footings.
  751. The `@everyheading' command and `@everyfooting' command generate page
  752. headers and footers that are the same for both even- and odd-numbered
  753. pages.  The `@evenheading' command and `@evenfooting' command generate
  754. headers and footers for even-numbered (left-hand) pages; and the
  755. `@oddheading' command and `@oddfooting' command generate headers and
  756. footers for odd-numbered (right-hand) pages.
  757.    Write custom heading specifications in the Texinfo file immediately
  758. after the `@end titlepage' command.  Enclose your specifications
  759. between `@iftex' and `@end iftex' commands since the
  760. `texinfo-format-buffer' command may not recognize them.  Also, you must
  761. cancel the predefined heading commands with the `@headings off' command
  762. before defining your own specifications.
  763.    Here is how to tell TeX to place the chapter name at the left, the
  764. page number in the center, and the date at the right of every header
  765. for both even- and odd-numbered pages:
  766.      @iftex
  767.      @headings off
  768.      @everyheading @thischapter @| @thispage @| @today{}
  769.      @end iftex
  770. You need to divide the left part from the central part and the central
  771. part from the right had part by inserting `@|' between parts.
  772. Otherwise, the specification command will not be able to tell where the
  773. text for one part ends and the next part begins.
  774.    Each part can contain text or @-commands.  The text is printed as if
  775. the part were within an ordinary paragraph in the body of the page.
  776. The @-commands replace themselves with the page number, date, chapter
  777. name, or whatever.
  778.    Here are the six heading and footing commands:
  779. `@everyheading LEFT @| CENTER @| RIGHT'
  780. `@everyfooting LEFT @| CENTER @| RIGHT'
  781.      The `every' commands specify the format for both even- and
  782.      odd-numbered pages.  These commands are for documents that are
  783.      printed on one side of each sheet of paper, or for documents in
  784.      which you want symmetrical headers or footers.
  785. `@evenheading LEFT @| CENTER @| RIGHT'
  786. `@oddheading  LEFT @| CENTER @| RIGHT'
  787. `@evenfooting LEFT @| CENTER @| RIGHT'
  788. `@oddfooting  LEFT @| CENTER @| RIGHT'
  789.      The `even' and `odd' commands specify the format for even-numbered
  790.      pages and odd-numbered pages.  These commands are for books and
  791.      manuals that are printed on both sides of each sheet of paper.
  792.    Use the `@this...' series of @-commands to provide the names of
  793. chapters and sections and the page number.  You can use the `@this...'
  794. commands in the left, center, or right portions of headers and footers,
  795. or anywhere else in a Texinfo file so long as they are between `@iftex'
  796. and `@end iftex' commands.
  797.    Here are the `@this...' commands:
  798. `@thispage'
  799.      Expands to the current page number.
  800. `@thischaptername'
  801.      Expands to the name of the current chapter.
  802. `@thischapter'
  803.      Expands to the number and name of the current chapter, in the
  804.      format `Chapter 1: Title'.
  805. `@thistitle'
  806.      Expands to the name of the document, as specified by the
  807.      `@settitle' command.
  808. `@thisfile'
  809.      For `@include' files only: expands to the name of the current
  810.      `@include' file.  If the current Texinfo source file is not an
  811.      `@include' file, this command has no effect.  This command does
  812.      *not* provide the name of the current Texinfo source file unless
  813.      it is an `@include' file.  (*Note Include Files::, for more
  814.      information about `@include' files.)
  815. You can also use the `@today{}' command, which expands to the current
  816. date, in `1 Jan 1900' format.
  817.    Other @-commands and text are printed in a header or footer just as
  818. if they were in the body of a page.  It is useful to incorporate text,
  819. particularly when you are writing drafts:
  820.      @iftex
  821.      @headings off
  822.      @everyheading @emph{Draft!} @| @thispage @| @thischapter
  823.      @everyfooting @| @| Version: 0.27: @today{}
  824.      @end iftex
  825.    Beware of overlong titles: they may overlap another part of the
  826. header or footer and blot it out.
  827. File: texi.info,  Node: Catching Mistakes,  Next: Refilling Paragraphs,  Prev: Headings,  Up: Top
  828. Formatting Mistakes
  829. *******************
  830.    Besides mistakes in the content of your documentation, there are two
  831. kinds of mistake you can make with Texinfo:  you can make mistakes with
  832. @-commands, and you can make mistakes with the structure of the nodes
  833. and chapters.
  834.    Emacs has two tools for catching the @-command mistakes and two for
  835. catching structuring mistakes.
  836.    For finding problems with @-commands, you can run TeX or a region
  837. formatting command on the region that has a problem; indeed, you can
  838. run these commands on each region as you write it.
  839.    For finding problems with the structure of nodes and chapters, you
  840. can use `C-c C-s' (`texinfo-show-structure') and the related `occur'
  841. command and you can use the `M-x Info-validate' command.
  842. * Menu:
  843. * makeinfo preferred::          `makeinfo' finds errors.
  844. * Debugging with Info::         How to catch errors with Info formatting.
  845. * Debugging with TeX::          How to catch errors with TeX formatting.
  846. * Using texinfo-show-structure::  How to use `texinfo-show-structure'.
  847. * Using occur::                 How to list all lines containing a pattern.
  848. * Running Info-Validate::       How to find badly referenced nodes.
  849. File: texi.info,  Node: makeinfo preferred,  Next: Debugging with Info,  Up: Catching Mistakes
  850. `makeinfo' Find Errors
  851. ======================
  852.    The `makeinfo' program does an excellent job of catching errors and
  853. reporting them--far better than either the `texinfo-format-region' or
  854. the `texinfo-format-buffer' command.  In addition, the various
  855. functions for automatically creating and updating node pointers and
  856. menus remove many opportunities for human error.
  857.    If you can, use the updating commands to create and insert pointers
  858. and menus.  These prevent many errors.  Then use `makeinfo' (or its
  859. Texinfo mode manifestations, `makeinfo-region' and `makeinfo-buffer')
  860. to format your file and check for other errors.  This is the best way
  861. to work with Texinfo.  But if you cannot use `makeinfo', or your
  862. problem is very puzzling, then you may want to use the tools described
  863. in this appendix.
  864. File: texi.info,  Node: Debugging with Info,  Next: Debugging with TeX,  Prev: makeinfo preferred,  Up: Catching Mistakes
  865. Catching Errors with Info Formatting
  866. ====================================
  867.    After you have written part of a Texinfo file, you can use the
  868. `texinfo-format-region' or the `makeinfo-region' command to see whether
  869. the region formats properly.
  870.    Most likely, however, you are reading this section because for some
  871. reason you cannot use the `makeinfo-region' command; therefore, the
  872. rest of this section presumes that you are using
  873. `texinfo-format-region'.
  874.    If you make a mistake with an @-command, `texinfo-format-region'
  875. will stop processing at or after the error and display an error
  876. message.  To see where in the buffer the error occurred, switch to the
  877. `*Info Region*' buffer; the cursor will be in a position that is after
  878. the location of the error.  Also, the text will not be formatted after
  879. the place where the error occurred (or more precisely, where it was
  880. detected).
  881.    For example, if you accidentally end a menu with the command `@end
  882. menus' with an `s' on the end, instead of with `@end menu', you will
  883. see an error message that says:
  884.      @end menus is not handled by texinfo
  885. The cursor will stop at the point in the buffer where the error occurs,
  886. or not long after it.  The buffer will look like this:
  887.      ---------- Buffer: *Info Region* ----------
  888.      * Menu:
  889.      
  890.      * Using texinfo-show-structure::  How to use
  891.                                        `texinfo-show-structure'
  892.                                        to catch mistakes.
  893.      * Running Info-Validate::         How to check for
  894.                                        unreferenced nodes.
  895.      @end menus
  896.      -!-
  897.      ---------- Buffer: *Info Region* ----------
  898.    The `texinfo-format-region' command sometimes provides slightly odd
  899. error messages.  For example, the following cross reference fails to
  900. format:
  901.      (@xref{Catching Mistakes, for more info.)
  902. In this case, `texinfo-format-region' detects the missing closing brace
  903. but displays a message that says `Unbalanced parentheses' rather than
  904. `Unbalanced braces'.  This is because the formatting command looks for
  905. mismatches between braces as if they were parentheses.
  906.    Sometimes `texinfo-format-region' fails to detect mistakes.  For
  907. example, in the following, the closing brace is swapped with the
  908. closing parenthesis:
  909.      (@xref{Catching Mistakes), for more info.}
  910. Formatting produces:
  911.      (*Note for more info.: Catching Mistakes)
  912.    The only way for you to detect this error is to realize that the
  913. reference should have looked like this:
  914.      (*Note Catching Mistakes::, for more info.)
  915.    Incidentally, if you are reading this node in Info and type `f RET'
  916. (`Info-follow-reference'), you will generate an error message that says:
  917.      No such node: "Catching Mistakes) The only way ...
  918. This is because Info perceives the example of the error as the first
  919. cross reference in this node and if you type a RET immediately after
  920. typing the Info `f' command, Info will attempt to go to the referenced
  921. node.  If you type `f catch TAB RET', Info will complete the node name
  922. of the correctly written example and take you to the `Catching
  923. Mistakes' node.  (If you try this, you can return from the `Catching
  924. Mistakes' node by typing `l' (`Info-last').)
  925.