home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / unix / info / texinfo.i09 (.txt) < prev    next >
GNU Info File  |  1993-06-12  |  52KB  |  917 lines

  1. This is Info file texinfo, produced by Makeinfo-1.47 from the input
  2. file texinfo2.tex.
  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 Free Software Foundation, Inc.
  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 Foundation.
  20. File: texinfo,  Node: Titlepage Permissions,  Prev: ifinfo Permissions,  Up: Sample Permissions
  21. Titlepage Copying Permissions
  22. =============================
  23.    In the `@titlepage' section of the Texinfo file, the standard Free
  24. Software Foundation copying permission notice follows the copyright
  25. notice and publishing information.  The standard phrasing is as follows:
  26.      Permission is granted to make and distribute verbatim
  27.      copies of this manual provided the copyright notice and
  28.      this permission notice are preserved on all copies.
  29.      
  30.      Permission is granted to copy and distribute modified
  31.      versions of this manual under the conditions for
  32.      verbatim copying, provided also that the sections
  33.      entitled ``Distribution'' and ``General Public License''
  34.      are included exactly as in the original, and provided
  35.      that the entire resulting derived work is distributed
  36.      under the terms of a permission notice identical to this
  37.      one.
  38.      
  39.      Permission is granted to copy and distribute
  40.      translations of this manual into another language, under
  41.      the above conditions for modified versions, except that
  42.      the sections entitled ``Distribution'' and ``General
  43.      Public License'' may be included in a translation
  44.      approved by the author instead of in the original
  45.      English.
  46. File: texinfo,  Node: Include Files,  Next: Headings,  Prev: Sample Permissions,  Up: Top
  47. Include Files
  48. *************
  49.    When TeX or an Info formatting command sees an `@include' command in
  50. a Texinfo file, it processes the contents of the file named by the
  51. command and incorporates them into the DVI or Info file being created. 
  52. Index entries from the included file are incorporated into the indices
  53. of the output file.
  54.    Include files let you keep a single large document as a collection of
  55. conveniently small parts.
  56. * Menu:
  57. * Using Include Files::         How to use the `@include' command.
  58. * texinfo-multiple-files-update::  How to create and update nodes and
  59.                                   menus when using included files.
  60. * Include File Requirements::   What `texinfo-multiple-files-update' expects.
  61. * Sample Include File::         A sample outer file with included files
  62.                                   within it; and a sample included file.
  63. * Include Files Evolution::     How use of the `@include' command
  64.                                   has changed over time.
  65. File: texinfo,  Node: Using Include Files,  Next: texinfo-multiple-files-update,  Up: Include Files
  66. How to Use Include Files
  67. ========================
  68.    To include another file within a Texinfo file, write the `@include'
  69. command at the beginning of a line and follow it on the same line by
  70. the name of a file to be included.  For example:
  71.      @include buffers.texi
  72.    An included file should simply be a segment of text that you expect
  73. to be included as is into the overall or "outer" Texinfo file; it
  74. should not contain the standard beginning and end parts of a Texinfo
  75. file.  In particular, you should not start an included file with a line
  76. saying `\input texinfo'; if you do, that phrase is inserted into the
  77. output file as is.  Likewise, you should not end an included file with
  78. an `@bye' command; that command will stop TeX processing immediately.
  79.    In the past, you were required to write an `@setfilename' line at the
  80. beginning of an included file, but no longer.  Now, it does not matter
  81. whether you write such a line.  If an `@setfilename' line exists in an
  82. included file, it is ignored.
  83.    Conventionally, an included file begins with an `@node' line that is
  84. followed by an `@chapter' line.  Each included file is one chapter. 
  85. This makes it easy to use the regular node and menu creating and
  86. updating commands to create the node pointers and menus within the
  87. included file.  However, the simple Emacs node and menu creating and
  88. updating commands do not work with multiple Texinfo files.  Thus you
  89. cannot use these commands to fill in the `Next', `Previous', and `Up'
  90. pointers of the `@node' line that begins the included file.  Also, you
  91. cannot use the regular commands to create a master menu for the whole
  92. file.  Either you must insert the menus and the `Next', `Previous', and
  93. `Up' pointers by hand, or you must use the GNU Emacs Texinfo mode
  94. command, `texinfo-multiple-files-update', that is designed for
  95. `@include' files.
  96. File: texinfo,  Node: texinfo-multiple-files-update,  Next: Include File Requirements,  Prev: Using Include Files,  Up: Include Files
  97. `texinfo-multiple-files-update'
  98. ===============================
  99.    GNU Emacs Texinfo mode provides the `texinfo-multiple-files-update'
  100. command.  This command creates or updates `Next', `Previous', and `Up'
  101. pointers of included files as well as those in the outer or overall
  102. Texinfo file, and it creates or updates a main menu in the outer file.
  103. Depending whether you call it with optional arguments, the command
  104. updates only the pointers in the first `@node' line of the included
  105. files or all of them:
  106. `M-x texinfo-multiple-files-update'
  107.      Called without any arguments:
  108.         - Create or update the `Next', `Previous', and `Up' pointers of
  109.           the first `@node' line in each file included in an outer or
  110.           overall Texinfo file.
  111.         - Create or update the `Top' level node pointers of the outer or
  112.           overall file.
  113.         - Create or update a main menu in the outer file.
  114. `C-u M-x texinfo-multiple-files-update'
  115.      Called with `C-u' as a prefix argument:
  116.         - Create or update pointers in the first `@node' line in each
  117.           included file.
  118.         - Create or update the `Top' level node pointers of the outer
  119.           file.
  120.         - Create and insert a master menu in the outer file.  The
  121.           master menu is made from all the menus in all the included
  122.           files.
  123. `C-u 8 M-x texinfo-multiple-files-update'
  124.      Called with a numeric prefix argument, such as `C-u 8':
  125.         - Create or update *all* the `Next', `Previous', and `Up'
  126.           pointers of all the included files.
  127.         - Create or update *all* the menus of all the included files.
  128.         - Create or update the `Top' level node pointers of the outer or
  129.           overall file.
  130.         - And then create a master menu in the outer file.  This is
  131.           similar to invoking `texinfo-master-menu' with an argument
  132.           when you are working with just one file.
  133. Note the use of the prefix argument in interactive use: with a regular
  134. prefix argument, just `C-u', the `texinfo-multiple-files-update'
  135. command inserts a master menu; with a numeric prefix argument, such as
  136. `C-u 8', the command updates *every* pointer and menu in *all* the
  137. files and then inserts a master menu.
  138. File: texinfo,  Node: Include File Requirements,  Next: Sample Include File,  Prev: texinfo-multiple-files-update,  Up: Include Files
  139. Include File Requirements
  140. =========================
  141.    If you plan to use the `texinfo-multiple-files-update' command, the
  142. outer Texinfo file that lists included files within it should contain
  143. nothing but the beginning and end parts of a Texinfo file, and a number
  144. of `@include' commands listing the included files.  It should not even
  145. include indices, which should be listed in an included file of their
  146.    Moreover, each of the included files must contain exactly one highest
  147. level node (conventionally, `@chapter' or equivalent), and this node
  148. must be the first node in the included file. Furthermore, each of these
  149. highest level nodes in each included file must be at the same
  150. hierarchical level in the file structure. Usually, each is an
  151. `@chapter', an `@appendix', or an `@unnumbered' node.  Thus, normally,
  152. each included file contains one, and only one, chapter or
  153. equivalent-level node.
  154.    The outer file should contain only *one* node, the `Top' node.  It
  155. should *not* contain any nodes besides the single `Top' node.  The
  156. `texinfo-multiple-files-update' command will not process them.
  157. File: texinfo,  Node: Sample Include File,  Next: Include Files Evolution,  Prev: Include File Requirements,  Up: Include Files
  158. Sample File with `@include'
  159. ===========================
  160.    Here is an example of a complete outer Texinfo file with `@include'
  161. files within it before running `texinfo-multiple-files-update', which
  162. would insert a main or master menu:
  163.      \input texinfo @c -*-texinfo-*-
  164.      @setfilename  include-example.info
  165.      @settitle Include Example
  166.      
  167.      @setchapternewpage odd
  168.      @titlepage
  169.      @sp 12
  170.      @center @titlefont{Include Example}
  171.      @sp 2
  172.      @center by Whom Ever
  173.      
  174.      @page
  175.      @vskip 0pt plus 1filll
  176.      Copyright @copyright{} 1990 Free Software Foundation, Inc.
  177.      @end titlepage
  178.      
  179.      @ifinfo
  180.      @node Top, First, (dir), (dir)
  181.      @top Master Menu
  182.      @end ifinfo
  183.      
  184.      @include foo.texinfo
  185.      @include bar.texinfo
  186.      @include concept-index.texinfo
  187.      
  188.      @summarycontents
  189.      @contents
  190.      
  191.      @bye
  192.    An included file, such as `foo.texinfo', might look like this:
  193.      @node First, Second, , Top
  194.      @chapter First Chapter
  195.      
  196.      Contents of first chapter ...
  197.    The full contents of `concept-index.texinfo' might be as simple as
  198. this:
  199.      @node Concept Index, , Second, Top
  200.      @unnumbered Concept Index
  201.      
  202.      @printindex cp
  203.    The outer Texinfo source file for `The GNU Emacs Lisp Reference
  204. Manual' is named `elisp.texi'.  This outer file contains a master menu
  205. with 417 entries and a list of 41 `@include' files.
  206. File: texinfo,  Node: Include Files Evolution,  Prev: Sample Include File,  Up: Include Files
  207. Evolution of Include Files
  208. ==========================
  209.    When Info was first created, it was customary to create many small
  210. Info files on one subject.  Each Info file was formatted from its own
  211. Texinfo source file.  This custom meant that Emacs did not need to make
  212. a large buffer to hold the whole of a large Info file when someone
  213. wanted information; instead, Emacs allocated just enough memory for the
  214. small Info file that contained the particular information sought.  This
  215. way, Emacs could avoid wasting memory.
  216.    References from one file to another were made by referring to the
  217. file name as well as the node name. (*Note Referring to Other Info
  218. Files: Other Info Files.  Also, see *Note  `@xref' with Four and Five
  219. Arguments: Four and Five Arguments.)
  220.    Include files were designed primarily as a way to create a single,
  221. large printed manual out of several smaller Info files.  In a printed
  222. manual, all the references were within the same document, so TeX could
  223. automatically determine the references' page numbers.  The Info
  224. formatting commands used include files only for creating joint indices;
  225. each of the individual Texinfo files had to be formatted for Info
  226. individually.  (Each, therefore, required its own `@setfilename' line.)
  227.    However, because large Info files are now split automatically, it is
  228. no longer necessary to keep them small.
  229.    Nowadays, multiple Texinfo files are used mostly for large documents,
  230. such as `The GNU Emacs Lisp Reference Manual', and for projects in
  231. which several different people write different sections of a document
  232. simultaneously.
  233.    In addition, the Info formatting commands have been extended to work
  234. with the `@include' command so as to create a single large Info file
  235. that is split into smaller files if necessary.  This means that you can
  236. write menus and cross references without naming the different Texinfo
  237. files.
  238. File: texinfo,  Node: Headings,  Next: Catching Mistakes,  Prev: Include Files,  Up: Top
  239. Page Headings
  240. *************
  241.    Most printed manuals contain headings along the top of every page
  242. except the title and copyright pages.  Some manuals also contain
  243. footings.  (Headings and footings have no meaning to Info, which is not
  244. paginated.)
  245. * Menu:
  246. * Headings Introduced::         Conventions for using page headings.
  247. * Heading Format::              Standard page heading formats.
  248. * Heading Choice::              How to specify the type of page heading.
  249. * Custom Headings::             How to create your own headings and footings.
  250. File: texinfo,  Node: Headings Introduced,  Next: Heading Format,  Up: Headings
  251. Headings Introduced
  252. ===================
  253.    Texinfo provides standard page heading formats for manuals that are
  254. printed on one side of each sheet of paper and for manuals that are
  255. printed on both sides of the paper.  Usually, you will use one or other
  256. of these formats, but you can specify your own format, if you wish.
  257.    In addition, you can specify whether chapters should begin on a new
  258. page, or merely continue the same page as the previous chapter; and if
  259. chapters begin on new pages, you can specify whether they must be
  260. odd-numbered pages.
  261.    By convention, a book is printed on both sides of each sheet of
  262. paper. When you open a book, the right-hand page is odd-numbered, and
  263. chapters begin on right-hand pages--a preceding left-hand page is left
  264. blank if necessary.  Reports, however, are often printed on just one
  265. side of paper, and chapters begin on a fresh page immediately following
  266. the end of the preceding chapter.  In short or informal reports,
  267. chapters often do not begin on a new page at all, but are separated
  268. from the preceding text by a small amount of whitespace.
  269.    The `@setchapternewpage' command controls whether chapters begin on
  270. new pages, and whether one of the standard heading formats is used. In
  271. addition, Texinfo has several heading and footing commands that you can
  272. use to generate your own heading and footing formats.
  273.    In Texinfo, headings and footings are single lines at the tops and
  274. bottoms of pages; you cannot create multiline headings or footings.
  275. Each header or footer line is divided into three parts: a left part, a
  276. middle part, and a right part.  Any part, or a whole line, may be left
  277. blank.  Text for the left part of a header or footer line is set
  278. flushleft; text for the middle part is centered; and, text for the
  279. right part is set flushright.
  280. File: texinfo,  Node: Heading Format,  Next: Heading Choice,  Prev: Headings Introduced,  Up: Headings
  281. Standard Heading Formats
  282. ========================
  283.    Texinfo provides two standard heading formats, one for manuals
  284. printed on one side of each sheet of paper, and the other for manuals
  285. printed on both sides of the paper.
  286.    By default, nothing is specified for the footing of a Texinfo file,
  287. so the footing remains blank.
  288.    The standard format for single-sided printing consists of a header
  289. line in which the left-hand part contains the name of the chapter, the
  290. central part is blank, and the right-hand part contains the page number.
  291.    The single-sided page looks like this:
  292.         _______________________
  293.        |                       |
  294.        | chapter   page number |
  295.        |                       |
  296.        | Start of text ...     |
  297.        | ...                   |
  298.        |                       |
  299.    The standard format for two-sided printing depends on whether the
  300. page number is even or odd.  By convention, even-numbered pages are on
  301. the left- and odd-numbered pages are on the right.  (TeX will adjust the
  302. widths of the left- and right-hand margins.  Usually, widths are
  303. correct, but during double-sided printing, it is wise to check that
  304. pages will bind properly--sometimes a printer will produce output in
  305. which the even-numbered pages have a larger right-hand margin than the
  306. odd-numbered pages.)
  307.    In the standard double-sided format, the left part of the left-hand
  308. (even-numbered) page contains the page number, the central part is
  309. blank, and the right part contains the title (specified by the
  310. `@settitle' command).  The left part of the right-hand (odd-numbered)
  311. page contains the name of the chapter, the central part is blank, and
  312. the right part contains the page number.
  313.    The two pages, side by side as in an open book, look like this:
  314.         _______________________     _______________________
  315.        |                       |   |                       |
  316.        | page number     title |   | chapter   page number |
  317.        |                       |   |                       |
  318.        | Start of text ...     |   | More  text ...        |
  319.        | ...                   |   | ...                   |
  320.        |                       |   |                       |
  321. The chapter name is preceded by the word `Chapter', the chapter number
  322. and a colon.  This makes it easier to keep track of where you are in
  323. the manual.
  324. File: texinfo,  Node: Heading Choice,  Next: Custom Headings,  Prev: Heading Format,  Up: Headings
  325. Specifying the Type of Heading
  326. ==============================
  327.    TeX does not begin to generate page headings for a standard Texinfo
  328. file until it reaches the `@end titlepage' command.  Thus, the title
  329. and copyright pages are not numbered.  The `@end titlepage' command
  330. causes TeX to begin to generate page headings according to a standard
  331. format specified by the `@setchapternewpage' command that precedes the
  332. `@titlepage' section.
  333.    There are four possibilities:
  334. No `@setchapternewpage' command
  335.      Cause TeX to specify the single-sided heading format, with chapters
  336.      on new pages. This is the same as `@setchapternewpage on'.
  337. `@setchapternewpage on'
  338.      Specify the single-sided heading format, with chapters on new
  339.      pages.
  340. `@setchapternewpage off'
  341.      Cause TeX to start a new chapter on the same page as the last page
  342.      of the preceding chapter, after skipping some vertical whitespace.
  343.       Also cause TeX to typeset for single-sided printing.  (You can
  344.      override the headers format with the `@headings double' command;
  345.      see *Note The `@headings' Command: headings on off.)
  346. `@setchapternewpage odd'
  347.      Specify the double-sided heading format, with chapters on new
  348.      pages.
  349. Texinfo lacks an `@setchapternewpage even' command.
  350. File: texinfo,  Node: Custom Headings,  Prev: Heading Choice,  Up: Headings
  351. How to Make Your Own Headings
  352. =============================
  353.    You can use the standard headings provided with Texinfo or specify
  354. your own.
  355.    Texinfo provides six commands for specifying headings and footings. 
  356. The `@everyheading' command and `@everyfooting' command generate page
  357. headers and footers that are the same for both even- and odd-numbered
  358. pages. The `@evenheading' command and `@evenfooting' command generate
  359. headers and footers for even-numbered (left-hand) pages; and the
  360. `@oddheading' command and `@oddfooting' command generate headers and
  361. footers for odd-numbered (right-hand) pages.
  362.    Write custom heading specifications in the Texinfo file immediately
  363. after the `@end titlepage' command.  Enclose your specifications
  364. between `@iftex' and `@end iftex' commands since the
  365. `texinfo-format-buffer' command may not recognize them.  Also, you must
  366. cancel the predefined heading commands with the `@headings off' command
  367. before defining your own specifications.
  368.    Here is how to tell TeX to place the chapter name at the left, the
  369. page number in the center, and the date at the right of every header
  370. for both even- and odd-numbered pages:
  371.      @iftex
  372.      @headings off
  373.      @everyheading @thischapter @| @thispage @| @today{}
  374.      @end iftex
  375. You need to divide the left part from the central part and the central
  376. part from the right had part by inserting `@|' between parts.
  377. Otherwise, the specification command will not be able to tell where the
  378. text for one part ends and the next part begins.
  379.    Each part can contain text or @-commands.  The text is printed as if
  380. the part were within an ordinary paragraph in the body of the page. 
  381. The @-commands replace themselves with the page number, date, chapter
  382. name, or whatever.
  383.    Here are the six heading and footing commands:
  384. `@everyheading LEFT @| CENTER @| RIGHT'
  385. `@everyfooting LEFT @| CENTER @| RIGHT'
  386.      The `every' commands specify the format for both even- and
  387.      odd-numbered pages.  These commands are for documents that are
  388.      printed on one side of each sheet of paper, or for documents in
  389.      which you want symmetrical headers or footers.
  390. `@evenheading LEFT @| CENTER @| RIGHT'
  391. `@oddheading  LEFT @| CENTER @| RIGHT'
  392. `@evenfooting LEFT @| CENTER @| RIGHT'
  393. `@oddfooting  LEFT @| CENTER @| RIGHT'
  394.      The `even' and `odd' commands specify the format for even-numbered
  395.      pages and odd-numbered pages.  These commands are for books and
  396.      manuals that are printed on both sides of each sheet of paper.
  397.    Use the `@this...' series of @-commands to provide the names of
  398. chapters and sections and the page number.  You can use the `@this...'
  399. commands in the left, center, or right portions of headers and footers,
  400. or anywhere else in a Texinfo file so long as they are between `@iftex'
  401. and `@end iftex' commands.
  402.    Here are the `@this...' commands:
  403. `@thispage'
  404.      Expands to the current page number.
  405. `@thischaptername'
  406.      Expands to the name of the current chapter.
  407. `@thischapter'
  408.      Expands to the number and name of the current chapter, in the
  409.      format `Chapter 1: Title'.
  410. `@thistitle'
  411.      Expands to the name of the document, as specified by the
  412.      `@settitle' command.
  413. `@thisfile'
  414.      For `@include' files only: expands to the name of the current
  415.      `@include' file.  If the current Texinfo source file is not an
  416.      `@include' file, this command has no effect.  This command does
  417.      *not* provide the name of the current Texinfo source file unless
  418.      it is an `@include' file.  (*Note Include Files::, for more
  419.      information about `@include' files.)
  420. You can also use the `@today{}' command, which expands to the current
  421. date, in `1 Jan 1900' format.
  422.    Other @-commands and text are printed in a header or footer just as
  423. if they were in the body of a page.  It is useful to incorporate text,
  424. particularly when you are writing drafts:
  425.      @iftex
  426.      @headings off
  427.      @everyheading @emph{Draft!} @| @thispage @| @thischapter
  428.      @everyfooting @| @| Version: 0.27: @today{}
  429.      @end iftex
  430.    Beware of overlong titles: they may overlap another part of the
  431. header or footer and blot it out.
  432. File: texinfo,  Node: Catching Mistakes,  Next: Refilling Paragraphs,  Prev: Headings,  Up: Top
  433. Formatting Mistakes
  434. *******************
  435.    Besides mistakes in the content of your documentation, there are two
  436. kinds of mistake you can make with Texinfo:  you can make mistakes with
  437. @-commands, and you can make mistakes with the structure of the nodes
  438. and chapters.
  439.    Emacs has two tools for catching the @-command mistakes and two for
  440. catching structuring mistakes.
  441.    For finding problems with @-commands, you can run TeX or a region
  442. formatting command on the region that has a problem; indeed, you can
  443. run these commands on each region as you write it.
  444.    For finding problems with the structure of nodes and chapters, you
  445. can use `C-c C-s' (`texinfo-show-structure') and the related `occur'
  446. command and you can use the `M-x Info-validate' command.
  447. * Menu:
  448. * makeinfo preferred::          `makeinfo' finds errors.
  449. * Debugging with Info::         How to catch errors with Info formatting.
  450. * Debugging with TeX::          How to catch errors with TeX formatting.
  451. * Using texinfo-show-structure::  How to use `texinfo-show-structure'.
  452. * Using occur::                 How to list all lines containing a pattern.
  453. * Running Info-Validate::       How to find badly referenced nodes.
  454. File: texinfo,  Node: makeinfo preferred,  Next: Debugging with Info,  Up: Catching Mistakes
  455. `makeinfo' Find Errors
  456. ======================
  457.    The `makeinfo' program does an excellent job of catching errors and
  458. reporting them--far better than `texinfo-format-region' or
  459. `texinfo-format-buffer'.  In addition, the various functions for
  460. automatically creating and updating node pointers and menus remove many
  461. opportunities for human error.
  462.    If you can, use the updating commands to create and insert pointers
  463. and menus.  These prevent many errors.  Then use `makeinfo' (or its
  464. Texinfo mode manifestations, `makeinfo-region' and `makeinfo-buffer')
  465. to format your file and check for other errors.  This is the best way
  466. to work with Texinfo.  But if you cannot use `makeinfo', or your
  467. problem is very puzzling, then you may want to use the tools described
  468. in this appendix.
  469. File: texinfo,  Node: Debugging with Info,  Next: Debugging with TeX,  Prev: makeinfo preferred,  Up: Catching Mistakes
  470. Catching Errors with Info Formatting
  471. ====================================
  472.    After you have written part of a Texinfo file, you can use the
  473. `texinfo-format-region' or the `makeinfo-region' command to see whether
  474. the region formats properly.
  475.    Most likely, however, you are reading this section because for some
  476. reason you cannot use the `makeinfo-region' command; therefore, the
  477. rest of this section presumes that you are using
  478. `texinfo-format-region'.
  479.    If you have made a mistake with an @-command,
  480. `texinfo-format-region' will stop processing at or after the error and
  481. display an error message.  To see where in the buffer the error
  482. occurred, switch to the `*Info Region*' buffer; the cursor will be in a
  483. position that is after the location of the error.  Also, the text will
  484. not be formatted after the place where the error occurred (or more
  485. precisely, where it was detected).
  486.    For example, if you accidentally end a menu with the command `@end
  487. menus' with an `s' on the end, instead of with `@end menu', you will
  488. see an error message that says:
  489.      @end menus is not handled by texinfo
  490. The cursor will stop at the point in the buffer where the error occurs,
  491. or not long after it.  The buffer will look like this:
  492.      ---------- Buffer: *Info Region* ----------
  493.      * Menu:
  494.      
  495.      * Using texinfo-show-structure::  How to use
  496.                                        `texinfo-show-structure'
  497.                                        to catch mistakes.
  498.      * Running Info-Validate::         How to check for
  499.                                        unreferenced nodes.
  500.      @end menus
  501.      -!-
  502.      ---------- Buffer: *Info Region* ----------
  503.    The `texinfo-format-region' command sometimes provides slightly odd
  504. error messages.  For example, the following cross reference fails to
  505. format:
  506.      (@xref{Catching Mistakes, for more info.)
  507. In this case, `texinfo-format-region' detects the missing closing brace
  508. but displays a message that says `Unbalanced parentheses' rather than
  509. `Unbalanced braces'.  This is because the formatting command looks for
  510. mismatches between braces as if they were parentheses.
  511.    Sometimes `texinfo-format-region' fails to detect mistakes.  For
  512. example, in the following, the closing brace is swapped with the
  513. closing parenthesis:
  514.      (@xref{Catching Mistakes), for more info.}
  515. Formatting produces:
  516.      (*Note for more info.: Catching Mistakes)
  517.    The only way for you to detect this error is to realize that the
  518. reference should have looked like this:
  519.      (*Note Catching Mistakes::, for more info.)
  520.    Incidentally, if you are reading this node in Info and type `f RET'
  521. (`Info-follow-reference'), you will generate an error message that says:
  522.      No such node: "Catching Mistakes) The only way ...
  523. This is because Info perceives the example of the error as the first
  524. cross reference in this node and if you type a RET immediately after
  525. typing the Info `f' command, Info will attempt to go to the referenced
  526. node.  If you type `f catch TAB RET', Info will complete the node name
  527. of the correctly written example and take you to the `Catching
  528. Mistakes' node.  (If you try this, you can return from the `Catching
  529. Mistakes' node by typing `l' (`Info-last').)
  530. File: texinfo,  Node: Debugging with TeX,  Next: Using texinfo-show-structure,  Prev: Debugging with Info,  Up: Catching Mistakes
  531. Catching Errors with TeX Formatting
  532. ===================================
  533.    You can also catch mistakes when you format a file with TeX.
  534.    Usually, you will want to do this after you have run
  535. `texinfo-format-buffer' (or, better, `makeinfo-buffer') on the same
  536. file, because `texinfo-format-buffer' sometimes displays error messages
  537. that make more sense than TeX.  (*Note Debugging with Info::, for more
  538. information.)
  539.    For example, TeX was run on a Texinfo file, part of which is shown
  540. here:
  541.      ---------- Buffer: texinfo.texi ----------
  542.      name of the texinfo file as an extension.  The
  543.      @samp{??} are `wildcards' that cause the shell to
  544.      substitute all the raw index files.  (@xref{sorting
  545.      indices, for more information about sorting
  546.      indices.)@refill
  547.      ---------- Buffer: texinfo.texi ----------
  548. (The cross reference lacks a closing brace.) TeX produced the following
  549. output, after which it stopped:
  550.      ---------- Buffer: *texinfo-tex-shell* ----------
  551.      Runaway argument?
  552.      {sorting indices, for more information about sorting
  553.      indices.) @refill @ETC.
  554.      ! Paragraph ended before @xref was complete.
  555.      <to be read again>
  556.                         @par
  557.      l.27
  558.      
  559.      ?
  560.      ---------- Buffer: *texinfo-tex-shell* ----------
  561.    In this case, TeX produced an accurate and understandable error
  562. message:
  563.      Paragraph ended before @xref was complete.
  564. `@par' is an internal TeX command of no relevance to Texinfo. `l.27'
  565. means that TeX detected the problem on line 27 of the Texinfo file. 
  566. The `?' is the prompt TeX uses in this circumstance.
  567.    Unfortunately, TeX is not always so helpful, and sometimes you must
  568. truly be a Sherlock Holmes to discover what went wrong.
  569.    In any case, if you run into a problem like this, you can do one of
  570. three things.
  571.   1. You can tell TeX to continue running and ignore just this error by
  572.      typing RET at the `?' prompt.
  573.   2. You can tell TeX to continue running and to ignore all errors as
  574.      best it can by typing `r RET' at the `?' prompt.
  575.      This is often the best thing to do.  However, beware: the one error
  576.      may produce a cascade of additional error messages as its
  577.      consequences are felt through the rest of the file.  (To stop TeX
  578.      when it is producing such an avalanche of error messages, type
  579.      `C-d' (or `C-c C-d', if you running a shell inside Emacs.))
  580.   3. You can tell TeX to stop this run by typing `x RET' at the `?'
  581.      prompt.
  582.    Please note that if you are running TeX inside Emacs, you need to
  583. switch to the shell buffer and line at which TeX offers the `?' prompt.
  584.    Sometimes TeX will format a file without producing error messages
  585. even though there is a problem.  This usually occurs if a command is
  586. not ended but TeX is able to continue processing anyhow.  For example,
  587. if you fail to end an itemized list with the `@end itemize' command,
  588. TeX will write a DVI file that you can print out.  The only error
  589. message that TeX will give you is the somewhat mysterious comment that
  590.      (@end occurred inside a group at level 1)
  591. However, if you print the DVI file, you will find that the text of the
  592. file that follows the itemized list is entirely indented as if it were
  593. part of the last item in the itemized list.  The error message is the
  594. way TeX says that it expected to find an `@end' command somewhere in
  595. the file; but that it could not determine where it was needed.
  596.    Another source of notoriously hard-to-find errors is a missing `@end
  597. group' command.  If you ever are stumped by incomprehensible errors,
  598. look for a missing `@end group' command first.
  599.    If the Texinfo file lacks header lines, TeX may stop in the
  600. beginning of its run and display output that looks like the following.
  601. The `*' indicates that TeX is waiting for input.
  602.      This is TeX, Version 2.0 for Berkeley UNIX
  603.      (preloaded format=plain-cm 87.10.25)
  604.      (test.texinfo [1])
  605.      *
  606. In this case, simply type `\end RET' after the asterisk.  Then write
  607. the header lines in the Texinfo file and run the TeX command again.
  608. (Note the use of the backslash, `\'.  TeX uses `\' instead of `@'; and
  609. in this circumstance, you are working directly with TeX not with
  610. Texinfo.)
  611. File: texinfo,  Node: Using texinfo-show-structure,  Next: Using occur,  Prev: Debugging with TeX,  Up: Catching Mistakes
  612. Using `texinfo-show-structure'
  613. ==============================
  614.    It is not always easy to keep track of the nodes, chapters,
  615. sections, and subsections of a Texinfo file.  This is especially true
  616. if you are revising or adding to a Texinfo file that someone else has
  617. written.
  618.    In GNU Emacs, in Texinfo mode, the `texinfo-show-structure' command
  619. lists all the lines that begin with the @-commands that specify the
  620. structure: `@chapter', `@section', `@appendix', and so on.  With an
  621. argument (`C-u' as prefix argument, if interactive), the command also
  622. shows the `@node' lines.  The `texinfo-show-structure' command is bound
  623. to `C-c C-s' in Texinfo mode, by default.
  624.    The lines are displayed in a buffer called the `*Occur*' buffer. For
  625. example, when `texinfo-show-structure' was run on an earlier version of
  626. this appendix, it produced the following:
  627.      Lines matching "^@\\(chapter \\|sect\\|sub\\|unnum\\|major\\|
  628.      heading \\|appendix\\)" in buffer texinfo.texi.
  629.        4:@appendix Formatting Mistakes
  630.       52:@appendixsec Catching Errors with Info Formatting
  631.      222:@appendixsec Catching Errors with @TeX{} Formatting
  632.      338:@appendixsec Using @code{texinfo-show-structure}
  633.      407:@appendixsubsec Using @code{occur}
  634.      444:@appendixsec Finding Badly Referenced Nodes
  635.      513:@appendixsubsec Running @code{Info-validate}
  636.      573:@appendixsubsec Splitting a File Manually
  637.    This says that lines 4, 52, and 222 of `texinfo.texi' begin with the
  638. `@appendix', `@appendixsec', and `@appendixsec' commands respectively. 
  639. If you move your cursor into the `*Occur*' window, you can position the
  640. cursor over one of the lines and use the `C-c C-c' command
  641. (`occur-mode-goto-occurrence'), to jump to the corresponding spot in
  642. the Texinfo file.  *Note Using Occur: (emacs)Other Repeating Search,
  643. for more information about `occur-mode-goto-occurrence'.
  644.    The first line in the `*Occur*' window describes the "regular
  645. expression" specified by TEXINFO-HEADING-PATTERN.  This regular
  646. expression is the pattern that `texinfo-show-structure' looks for.
  647. *Note Using Regular Expressions: (emacs)Regexps, for more information.
  648.    When you invoke the `texinfo-show-structure' command, Emacs will
  649. display the structure of the whole buffer.  If you want to see the
  650. structure of just a part of the buffer, of one chapter, for example,
  651. use the `C-x n' (`narrow-to-region') command to mark the region. 
  652. (*Note Narrowing: (emacs)Narrowing.)  This is how the example used
  653. above was generated.  (To see the whole buffer again, use `C-x w'
  654. (`widen').)
  655.    If you call `texinfo-show-structure' with a prefix argument by
  656. typing `C-u C-c C-s', it will list lines beginning with `@node' as well
  657. as the lines beginning with the @-sign commands for `@chapter',
  658. `@section', and the like.
  659.    You can remind yourself of the structure of a Texinfo file by
  660. looking at the list in the `*Occur*' window; and if you have mis-named
  661. a node or left out a section, you can correct the mistake.
  662. File: texinfo,  Node: Using occur,  Next: Running Info-Validate,  Prev: Using texinfo-show-structure,  Up: Catching Mistakes
  663. Using `occur'
  664. =============
  665.    Sometimes the `texinfo-show-structure' command produces too much
  666. information.  Perhaps you want to remind yourself of the overall
  667. structure of a Texinfo file, and are overwhelmed by the detailed list
  668. produced by `texinfo-show-structure'.  In this case, you can use the
  669. `occur' command directly.  To do this, type
  670.      `M-x occur'
  671. and then, when prompted, type a "regexp", a regular expression for the
  672. pattern you want to match.  (*Note Regular Expressions: (
  673. emacs)Regexps.)  The `occur' command works from the current location of
  674. the cursor in the buffer to the end of the buffer.  If you want to run
  675. `occur' on the whole buffer, place the cursor at the beginning of the
  676. buffer.
  677.    For example, to see all the lines that contain the word `@chapter'
  678. in them, just type `@chapter'.  This will produce a list of the
  679. chapters.  It will also list all the sentences with `@chapter' in the
  680. middle of the line.
  681.    If you want to see only those lines that start with the word
  682. `@chapter', type `^@chapter' when prompted by `occur'.  If you want to
  683. see all the lines that end with a word or phrase, end the last word
  684. with a `$'; for example, `catching mistakes$'.  This can be helpful
  685. when you want to see all the nodes that are part of the same chapter or
  686. section and therefore have the same `Up' pointer.
  687.    *Note Using Occur: (emacs)Other Repeating Search, for more
  688. information.
  689. File: texinfo,  Node: Running Info-Validate,  Prev: Using occur,  Up: Catching Mistakes
  690. Finding Badly Referenced Nodes
  691. ==============================
  692.    You can use the `Info-validate' command to check whether any of the
  693. `Next', `Previous', `Up' or other node pointers fail to point to a
  694. node.  This command checks that every node pointer points to an
  695. existing node.  The `Info-validate' command works only on Info files,
  696. not on Texinfo files.
  697.    The `makeinfo' program validates pointers automatically, so you do
  698. not need to use the `Info-validate' command if you are using
  699. `makeinfo'.  You only may need to use `Info-validate' if you are unable
  700. to run `makeinfo' and instead must create an Info file using
  701. `texinfo-format-region' or `texinfo-format-buffer', or if you write an
  702. Info file from scratch.
  703. * Menu:
  704. * Using Info-validate::         How to run `Info-validate'.
  705. * Unsplit::                     How to create an unsplit file.
  706. * Tagifying::                   How to tagify a file.
  707. * Splitting::                   How to split a file manually.
  708. File: texinfo,  Node: Using Info-validate,  Next: Unsplit,  Up: Running Info-Validate
  709. Running `Info-validate'
  710. -----------------------
  711.    To use `Info-validate', visit the Info file you wish to check and
  712. type:
  713.      M-x Info-validate
  714. (Note that the `Info-validate' command requires an upper case `I'.  You
  715. may also need to create a tag table before running `Info-validate'. 
  716. *Note Tagifying::.)
  717.    If your file is valid, you will receive a message that says "File
  718. appears valid".  However, if you have a pointer that does not point to
  719. a node, error messages will be displayed in a buffer called `*problems
  720. in info file*'.
  721.    For example, `Info-validate' was run on a test file that contained
  722. only the first node of this manual.  One of the messages said:
  723.      In node "Overview", invalid Next: Texinfo Mode
  724. This meant that the node called `Overview' had a `Next' pointer that
  725. did not point to anything (which was true in this case, since the test
  726. file had only one node in it).
  727.    Now suppose we add a node named `Texinfo Mode' to our test case but
  728. we do not specify a `Previous' for this node.  Then we will get the
  729. following error message:
  730.      In node "Texinfo Mode", should have Previous: Overview
  731. This is because every `Next' pointer should be matched by a `Previous'
  732. (in the node where the `Next' points) which points back.
  733.    `Info-validate' also checks that all menu entries and cross
  734. references point to actual nodes.
  735.    Note that `Info-validate' requires a tag table and does not work
  736. with files that have been split.  (The `texinfo-format-buffer' command
  737. automatically splits files larger than 100,000 bytes.)  In order to use
  738. `Info-validate' on a large file, you must run `texinfo-format-buffer'
  739. with an argument so that it does not split the Info file; and you must
  740. create a tag table for the unsplit file.
  741. File: texinfo,  Node: Unsplit,  Next: Tagifying,  Prev: Using Info-validate,  Up: Running Info-Validate
  742. Creating an Unsplit File
  743. ------------------------
  744.    You can run `Info-validate' only on a single Info file that has a
  745. tag table.  The command will not work on the indirect subfiles that are
  746. generated when a master file is split.  If you have a large file
  747. (longer than 70,000 bytes or so), you need to run the
  748. `texinfo-format-buffer' or `makeinfo-buffer' command in such a way that
  749. it does not create indirect subfiles.  You will also need to create a
  750. tag table for the Info file.  After you have done this, you can run
  751. `Info-validate' and look for badly referenced nodes.
  752.    The first step is to create an unsplit Info file.  To prevent
  753. `texinfo-format-buffer' from splitting a Texinfo file into smaller Info
  754. files, give a prefix to the `M-x texinfo-format-buffer' command:
  755.      C-u  M-x texinfo-format-buffer
  756. or else
  757.      C-u C-c C-e C-b
  758. When you do this, Texinfo will not split the file and will not create a
  759. tag table for it.
  760. File: texinfo,  Node: Tagifying,  Next: Splitting,  Prev: Unsplit,  Up: Running Info-Validate
  761. Tagifying a File
  762. ----------------
  763.    After creating an unsplit Info file, you must create a tag table for
  764. it.  Visit the Info file you wish to tagify and type:
  765.      M-x Info-tagify
  766. (Note the upper case I in `Info-tagify'.)  This creates an Info file
  767. with a tag table that you can validate.
  768.    The third step is to validate the Info file:
  769.      M-x Info-validate
  770. (Note the upper case I in `Info-validate'.) In brief, the steps are:
  771.      C-u M-x texinfo-format-buffer
  772.      M-x Info-tagify
  773.      M-x Info-validate
  774.    After you have validated the node structure, you can rerun
  775. `texinfo-format-buffer' in the normal way so it will construct a tag
  776. table and split the file automatically, or you can make the tag table
  777. and split the file manually.
  778. File: texinfo,  Node: Splitting,  Prev: Tagifying,  Up: Running Info-Validate
  779. Splitting a File Manually
  780. -------------------------
  781.    You should split a large file or else let the
  782. `texinfo-format-buffer' or `makeinfo-buffer' command do it for you
  783. automatically.  (Generally you will let one of the formatting commands
  784. do this job for you.  *Note Create an Info File::.)
  785.    The split-off files are called the indirect subfiles.
  786.    Info files are split to save memory.  With smaller files, Emacs does
  787. not have make such a large buffer to hold the information.
  788.    If an Info file has more than 30 nodes, you should also make a tag
  789. table for it. *Note Using Info-validate::, for information about
  790. creating a tag table.  (Again, tag tables are usually created
  791. automatically by the formatting command; you only need to create a tag
  792. table yourself if you are doing the job manually.  Most likely, you
  793. will do this for a large, unsplit file on which you have run
  794. `Info-validate'.)
  795.    Visit the Info file you wish to tagify and split and type the two
  796. commands:
  797.      M-x Info-tagify
  798.      M-x Info-split
  799. (Note that the `I' in `Info' is upper case.)
  800.    When you use the `Info-split' command, the buffer is modified into a
  801. (small) Info file which lists the indirect subfiles.  This file should
  802. be saved in place of the original visited file.  The indirect subfiles
  803. are written in the same directory the original file is in, with names
  804. generated by appending `-' and a number to the original file name.
  805.    The primary file still functions as an Info file, but it contains
  806. just the tag table and a directory of subfiles.
  807. File: texinfo,  Node: Refilling Paragraphs,  Next: Command Syntax,  Prev: Catching Mistakes,  Up: Top
  808. Refilling Paragraphs
  809. ********************
  810.    The `@refill' command refills and, optionally, indents the first
  811. line of a paragraph.(1) The `@refill' command is no longer important,
  812. but we describe it here because you once needed it.  You will see it in
  813. many old Texinfo files.
  814.    Without refilling, paragraphs containing long @-constructs may look
  815. bad after formatting because the formatter removes @-commands and
  816. shortens some lines more than others.  In the past, neither the
  817. `texinfo-format-region' command nor the `texinfo-format-buffer' command
  818. refilled paragraphs automatically.  The `@refill' command had to be
  819. written at the end of every paragraph to cause these formatters to fill
  820. them.  (Both TeX and `makeinfo' have always refilled paragraphs
  821. automatically.)  Now, all the Info formatters automatically fill and
  822. indent those paragraphs that need to be filled and indented.
  823.    The `@refill' command causes `texinfo-format-region' and
  824. `texinfo-format-buffer' to refill a paragraph in the Info file *after*
  825. all the other processing has been done.  For this reason, you can not
  826. use `@refill' with a paragraph containing either `@*' or `@w{ ... }'
  827. since the refilling action will override those two commands.
  828.    The `texinfo-format-region' and `texinfo-format-buffer' commands now
  829. automatically append `@refill' to the end of each paragraph that should
  830. be filled.  They do not append `@refill' to the ends of paragraphs that
  831. contain `@*' or `@w{ ...}' and therefore do not refill or indent them.
  832.    ---------- Footnotes ----------
  833.    (1)  Perhaps the command should have been called the
  834. `@refillandindent' command, but `@refill' is shorter and the name was
  835. chosen before indenting was possible.
  836. File: texinfo,  Node: Command Syntax,  Next: Obtaining TeX,  Prev: Refilling Paragraphs,  Up: Top
  837. @-Command Syntax
  838. ****************
  839.    The character `@' is used to start special Texinfo commands. (It has
  840. the same meaning that `\' has in PlainTeX.)  Texinfo has four types of
  841. @-command:
  842. 1. Non-alphabetic commands.
  843.      These commands consist of an @ followed by a punctuation mark or
  844.      other character that is not part of the alphabet.  Non-alphabetic
  845.      commands are almost always part of the text within a paragraph,
  846.      and never take any argument.  The two characters (@ and the other
  847.      one) are complete in themselves; none is followed by braces.  The
  848.      non-alphabetic commands are: `@.', `@:', `@*', `@@', `@{', and
  849.      `@}'.
  850. 2. Alphabetic commands that do not require arguments.
  851.      These commands start with @ followed by a word followed by left-
  852.      and right-hand braces.  These commands insert special symbols in
  853.      the document; they do not require arguments.  For example,
  854.      `@dots{}' => `...', `@equiv{}' => `==', `@TeX{}' => `TeX', and
  855.      `@bullet{}' => `*'.
  856. 3. Alphabetic commands that require arguments within braces.
  857.      These commands start with @ followed by a letter or a word,
  858.      followed by an argument within braces.  For example, the command
  859.      `@dfn' indicates the introductory or defining use of a term; it is
  860.      used as follows: `In Texinfo, @@-commands are @dfn{mark-up}
  861.      commands.'
  862. 4. Alphabetic commands that occupy an entire line.
  863.      These commands occupy an entire line.  The line starts with @,
  864.      followed by the name of the command (a word); for example,
  865.      `@center' or `@cindex'.  If no argument is needed, the word is
  866.      followed by the end of the line.  If there is an argument, it is
  867.      separated from the command name by a space.  Braces are not used.
  868.    Thus, the alphabetic commands fall into classes that have different
  869. argument syntaxes.  You cannot tell to which class a command belongs by
  870. the appearance of its name, but you can tell by the command's meaning:
  871. if the command stands for a glyph, it is in class 2 and does not
  872. require an argument; if it makes sense to use the command together with
  873. other text as part of a paragraph, the command is in class 3 and must
  874. be followed by an argument in braces; otherwise, it is in class 4 and
  875. uses the rest of the line as its argument.
  876.    The purpose of having a different syntax for commands of classes 3
  877. and 4 is to make Texinfo files easier to read, and also to help the GNU
  878. Emacs paragraph and filling commands work properly.  There is only one
  879. exception to this rule: the command `@refill', which is always used at
  880. the end of a paragraph immediately following the final period or other
  881. punctuation character.  `@refill' takes no argument and does *not*
  882. require braces.  `@refill' never confuses the Emacs paragraph commands
  883. because it cannot appear at the beginning of a line.
  884. File: texinfo,  Node: Obtaining TeX,  Next: New Features,  Prev: Command Syntax,  Up: Top
  885. How to Obtain TeX
  886. *****************
  887.    TeX is freely redistributable.  You can obtain TeX for Unix systems
  888. from the University of Washington for a distribution fee.
  889.    To order a full distribution, send $200.00 for a 1/2-inch 9-track
  890. 1600 bpi (`tar' or `cpio') tape reel, or $210.00 for a 1/4-inch 4-track
  891. QIC-24 (`tar' or `cpio') cartridge, to:
  892.      Northwest Computing Support Center
  893.      DR-10, Thomson Hall 35
  894.      University of Washington
  895.      Seattle, Washington 98195
  896. Please make checks payable to the University of Washington.
  897.    Prepaid orders are preferred but purchase orders are acceptable;
  898. however, purchase orders carry an extra charge of $10.00, to pay for
  899. processing.
  900.    Overseas sites: please add to the base cost $20.00 for shipment via
  901. air parcel post, or $30.00 for shipment via courier.
  902.    Please check with the Northwest Computing Support Center at the
  903. University of Washington for current prices and formats:
  904.      telephone:  (206) 543-6259
  905.      email:      elisabet@max.u.washington.edu
  906. File: texinfo,  Node: New Features,  Next: Command and Variable Index,  Prev: Obtaining TeX,  Up: Top
  907. Second Edition Features
  908. ***********************
  909.    The second edition of the Texinfo manual describes more than 20 new
  910. Texinfo mode commands and more than 50 previously undocumented Texinfo
  911. @-commands.  This edition is more than twice the length of the first
  912. edition.
  913.    Here is a brief description of the new commands.
  914. * Menu:
  915. * New Texinfo Mode Commands::   The updating commands are especially useful.
  916. * New Commands::                Many newly described @-commands.
  917.