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