Sync up with r21-2-27.
[chise/xemacs-chise.git] / info / texinfo.info-10
1 This is ../info/texinfo.info, produced by makeinfo version 4.0 from
2 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
376      \input texinfo   @c -*-texinfo-*-
377      @c %**start of header
378      @setfilename sample.info
379      @settitle Sample Document
380      @c %**end of header
381      
382      @setchapternewpage odd
383      
384      @ifinfo
385      This is a short example of a complete Texinfo file.
386      
387      Copyright 1990 Free Software Foundation, Inc.
388      @end ifinfo
389      
390      @titlepage
391      @sp 10
392      @comment The title is printed in a large font.
393      @center @titlefont{Sample Title}
394      
395      @c The following two commands start the copyright page.
396      @page
397      @vskip 0pt plus 1filll
398      Copyright @copyright{} 1990 Free Software Foundation, Inc.
399      @end titlepage
400      
401      @node    Top,       First Chapter,         , (dir)
402      @comment node-name, next,          previous, up
403      
404      @menu
405      * First Chapter::    The first chapter is the
406                           only chapter in this sample.
407      * Concept Index::    This index has two entries.
408      @end menu
409      
410      @node    First Chapter, Concept Index, Top,      Top
411      @comment node-name,     next,          previous, up
412      @chapter First Chapter
413      @cindex Sample index entry
414      
415      This is the contents of the first chapter.
416      @cindex Another sample index entry
417      
418      Here is a numbered list.
419      
420      @enumerate
421      @item
422      This is the first item.
423      
424      @item
425      This is the second item.
426      @end enumerate
427      
428      The @code{makeinfo} and @code{texinfo-format-buffer}
429      commands transform a Texinfo file such as this into
430      an Info file; and @TeX{} typesets it for a printed
431      manual.
432      
433      @node    Concept Index,    ,  First Chapter, Top
434      @comment node-name,    next,  previous,      up
435      @unnumbered Concept Index
436      
437      @printindex cp
438      
439      @contents
440      @bye
441
442 \1f
443 File: texinfo.info,  Node: Sample Permissions,  Next: Include Files,  Prev: Sample Texinfo File,  Up: Top
444
445 Sample Permissions
446 ******************
447
448   Texinfo files should contain sections that tell the readers that they
449 have the right to copy and distribute the Texinfo file, the Info file,
450 and the printed manual.
451
452   Also, if you are writing a manual about software, you should explain
453 that the software is free and either include the GNU General Public
454 License (GPL) or provide a reference to it.  *Note Distribution:
455 (xemacs)Distrib, for an example of the text that could be used in the
456 software "Distribution", "General Public License", and "NO WARRANTY"
457 sections of a document.  *Note Texinfo Copying Conditions: Copying, for
458 an example of a brief explanation of how the copying conditions provide
459 you with rights.
460
461 * Menu:
462
463 * Inserting Permissions::       How to put permissions in your document.
464 * ifinfo Permissions::          Sample `ifinfo' copying permissions.
465 * Titlepage Permissions::       Sample Titlepage copying permissions.
466
467 \1f
468 File: texinfo.info,  Node: Inserting Permissions,  Next: ifinfo Permissions,  Prev: Sample Permissions,  Up: Sample Permissions
469
470 Inserting Permissions
471 =====================
472
473   In a Texinfo file, the first `@ifinfo' section usually begins with a
474 line that says what the file documents.  This is what a person reading
475 the unprocessed Texinfo file or using the advanced Info command `g *'
476 sees first.  *note Advanced Info commands: (info)Expert, for more
477 information. (A reader using the regular Info commands usually starts
478 reading at the first node and skips this first section, which is not in
479 a node.)
480
481   In the `@ifinfo' section, the summary sentence is followed by a
482 copyright notice and then by the copying permission notice.  One of the
483 copying permission paragraphs is enclosed in `@ignore' and `@end
484 ignore' commands.  This paragraph states that the Texinfo file can be
485 processed through TeX and printed, provided the printed manual carries
486 the proper copying permission notice.  This paragraph is not made part
487 of the Info file since it is not relevant to the Info file; but it is a
488 mandatory part of the Texinfo file since it permits people to process
489 the Texinfo file in TeX and print the results.
490
491   In the printed manual, the Free Software Foundation copying permission
492 notice follows the copyright notice and publishing information and is
493 located within the region delineated by the `@titlepage' and `@end
494 titlepage' commands.  The copying permission notice is exactly the same
495 as the notice in the `@ifinfo' section except that the paragraph
496 enclosed in `@ignore' and `@end ignore' commands is not part of the
497 notice.
498
499   To make it simple to insert a permission notice into each section of
500 the Texinfo file, sample permission notices for each section are
501 reproduced in full below.
502
503   Note that you may need to specify the correct name of a section
504 mentioned in the permission notice.  For example, in `The GDB Manual',
505 the name of the section referring to the General Public License is
506 called the "GDB General Public License", but in the sample shown below,
507 that section is referred to generically as the "GNU General Public
508 License".  If the Texinfo file does not carry a copy of the General
509 Public License, leave out the reference to it, but be sure to include
510 the rest of the sentence.
511
512 \1f
513 File: texinfo.info,  Node: ifinfo Permissions,  Next: Titlepage Permissions,  Prev: Inserting Permissions,  Up: Sample Permissions
514
515 `ifinfo' Copying Permissions
516 ============================
517
518   In the `@ifinfo' section of a Texinfo file, the standard Free
519 Software Foundation permission notice reads as follows:
520
521      This file documents ...
522      
523      Copyright 1998 Free Software Foundation, Inc.
524      
525      Permission is granted to make and distribute verbatim
526      copies of this manual provided the copyright notice and
527      this permission notice are preserved on all copies.
528      
529      @ignore
530      Permission is granted to process this file through TeX
531      and print the results, provided the printed document
532      carries a copying permission notice identical to this
533      one except for the removal of this paragraph (this
534      paragraph not being relevant to the printed manual).
535      
536      @end ignore
537      Permission is granted to copy and distribute modified
538      versions of this manual under the conditions for
539      verbatim copying, provided also that the sections
540      entitled ``Copying'' and ``GNU General Public License''
541      are included exactly as in the original, and provided
542      that the entire resulting derived work is distributed
543      under the terms of a permission notice identical to this
544      one.
545      
546      Permission is granted to copy and distribute
547      translations of this manual into another language,
548      under the above conditions for modified versions,
549      except that this permission notice may be stated in a
550      translation approved by the Free Software Foundation.
551
552 \1f
553 File: texinfo.info,  Node: Titlepage Permissions,  Prev: ifinfo Permissions,  Up: Sample Permissions
554
555 Titlepage Copying Permissions
556 =============================
557
558   In the `@titlepage' section of a Texinfo file, the standard Free
559 Software Foundation copying permission notice follows the copyright
560 notice and publishing information.  The standard phrasing is as follows:
561
562      Permission is granted to make and distribute verbatim
563      copies of this manual provided the copyright notice and
564      this permission notice are preserved on all copies.
565      
566      Permission is granted to copy and distribute modified
567      versions of this manual under the conditions for
568      verbatim copying, provided also that the sections
569      entitled ``Copying'' and ``GNU General Public License''
570      are included exactly as in the original, and provided
571      that the entire resulting derived work is distributed
572      under the terms of a permission notice identical to this
573      one.
574      
575      Permission is granted to copy and distribute
576      translations of this manual into another language,
577      under the above conditions for modified versions,
578      except that this permission notice may be stated in a
579      translation approved by the Free Software Foundation.
580
581 \1f
582 File: texinfo.info,  Node: Include Files,  Next: Headings,  Prev: Sample Permissions,  Up: Top
583
584 Include Files
585 *************
586
587   When TeX or an Info formatting command sees an `@include' command in
588 a Texinfo file, it processes the contents of the file named by the
589 command and incorporates them into the DVI or Info file being created.
590 Index entries from the included file are incorporated into the indices
591 of the output file.
592
593   Include files let you keep a single large document as a collection of
594 conveniently small parts.
595
596 * Menu:
597
598 * Using Include Files::         How to use the `@include' command.
599 * texinfo-multiple-files-update::  How to create and update nodes and
600                                   menus when using included files.
601 * Include File Requirements::   What `texinfo-multiple-files-update' expects.
602 * Sample Include File::         A sample outer file with included files
603                                   within it; and a sample included file.
604 * Include Files Evolution::     How use of the `@include' command
605                                   has changed over time.
606
607 \1f
608 File: texinfo.info,  Node: Using Include Files,  Next: texinfo-multiple-files-update,  Prev: Include Files,  Up: Include Files
609
610 How to Use Include Files
611 ========================
612
613   To include another file within a Texinfo file, write the `@include'
614 command at the beginning of a line and follow it on the same line by
615 the name of a file to be included.  For example:
616
617      @include buffers.texi
618
619   An included file should simply be a segment of text that you expect to
620 be included as is into the overall or "outer" Texinfo file; it should
621 not contain the standard beginning and end parts of a Texinfo file.  In
622 particular, you should not start an included file with a line saying
623 `\input texinfo'; if you do, that phrase is inserted into the output
624 file as is.  Likewise, you should not end an included file with an
625 `@bye' command; nothing after `@bye' is formatted.
626
627   In the past, you were required to write an `@setfilename' line at the
628 beginning of an included file, but no longer.  Now, it does not matter
629 whether you write such a line.  If an `@setfilename' line exists in an
630 included file, it is ignored.
631
632   Conventionally, an included file begins with an `@node' line that is
633 followed by an `@chapter' line.  Each included file is one chapter.
634 This makes it easy to use the regular node and menu creating and
635 updating commands to create the node pointers and menus within the
636 included file.  However, the simple Emacs node and menu creating and
637 updating commands do not work with multiple Texinfo files.  Thus you
638 cannot use these commands to fill in the `Next', `Previous', and `Up'
639 pointers of the `@node' line that begins the included file.  Also, you
640 cannot use the regular commands to create a master menu for the whole
641 file.  Either you must insert the menus and the `Next', `Previous', and
642 `Up' pointers by hand, or you must use the GNU Emacs Texinfo mode
643 command, `texinfo-multiple-files-update', that is designed for
644 `@include' files.
645
646 \1f
647 File: texinfo.info,  Node: texinfo-multiple-files-update,  Next: Include File Requirements,  Prev: Using Include Files,  Up: Include Files
648
649 `texinfo-multiple-files-update'
650 ===============================
651
652   GNU Emacs Texinfo mode provides the `texinfo-multiple-files-update'
653 command.  This command creates or updates `Next', `Previous', and `Up'
654 pointers of included files as well as those in the outer or overall
655 Texinfo file, and it creates or updates a main menu in the outer file.
656 Depending whether you call it with optional arguments, the command
657 updates only the pointers in the first `@node' line of the included
658 files or all of them:
659
660 `M-x texinfo-multiple-files-update'
661      Called without any arguments:
662
663         - Create or update the `Next', `Previous', and `Up' pointers of
664           the first `@node' line in each file included in an outer or
665           overall Texinfo file.
666
667         - Create or update the `Top' level node pointers of the outer or
668           overall file.
669
670         - Create or update a main menu in the outer file.
671
672 `C-u M-x texinfo-multiple-files-update'
673      Called with `C-u' as a prefix argument:
674
675         - Create or update pointers in the first `@node' line in each
676           included file.
677
678         - Create or update the `Top' level node pointers of the outer
679           file.
680
681         - Create and insert a master menu in the outer file.  The
682           master menu is made from all the menus in all the included
683           files.
684
685 `C-u 8 M-x texinfo-multiple-files-update'
686      Called with a numeric prefix argument, such as `C-u 8':
687
688         - Create or update *all* the `Next', `Previous', and `Up'
689           pointers of all the included files.
690
691         - Create or update *all* the menus of all the included files.
692
693         - Create or update the `Top' level node pointers of the outer or
694           overall file.
695
696         - And then create a master menu in the outer file.  This is
697           similar to invoking `texinfo-master-menu' with an argument
698           when you are working with just one file.
699
700   Note the use of the prefix argument in interactive use: with a regular
701 prefix argument, just `C-u', the `texinfo-multiple-files-update'
702 command inserts a master menu; with a numeric prefix argument, such as
703 `C-u 8', the command updates *every* pointer and menu in *all* the
704 files and then inserts a master menu.
705
706 \1f
707 File: texinfo.info,  Node: Include File Requirements,  Next: Sample Include File,  Prev: texinfo-multiple-files-update,  Up: Include Files
708
709 Include File Requirements
710 =========================
711
712   If you plan to use the `texinfo-multiple-files-update' command, the
713 outer Texinfo file that lists included files within it should contain
714 nothing but the beginning and end parts of a Texinfo file, and a number
715 of `@include' commands listing the included files.  It should not even
716 include indices, which should be listed in an included file of their
717 own.
718
719   Moreover, each of the included files must contain exactly one highest
720 level node (conventionally, `@chapter' or equivalent), and this node
721 must be the first node in the included file.  Furthermore, each of
722 these highest level nodes in each included file must be at the same
723 hierarchical level in the file structure.  Usually, each is an
724 `@chapter', an `@appendix', or an `@unnumbered' node.  Thus, normally,
725 each included file contains one, and only one, chapter or
726 equivalent-level node.
727
728   The outer file should contain only _one_ node, the `Top' node.  It
729 should _not_ contain any nodes besides the single `Top' node.  The
730 `texinfo-multiple-files-update' command will not process them.
731
732 \1f
733 File: texinfo.info,  Node: Sample Include File,  Next: Include Files Evolution,  Prev: Include File Requirements,  Up: Include Files
734
735 Sample File with `@include'
736 ===========================
737
738   Here is an example of a complete outer Texinfo file with `@include'
739 files within it before running `texinfo-multiple-files-update', which
740 would insert a main or master menu:
741
742      \input texinfo @c -*-texinfo-*-
743      @setfilename  include-example.info
744      @settitle Include Example
745      
746      @setchapternewpage odd
747      @titlepage
748      @sp 12
749      @center @titlefont{Include Example}
750      @sp 2
751      @center by Whom Ever
752      
753      @page
754      @vskip 0pt plus 1filll
755      Copyright @copyright{} 1998 Free Software Foundation, Inc.
756      @end titlepage
757      
758      @ifinfo
759      @node Top, First, , (dir)
760      @top Master Menu
761      @end ifinfo
762      
763      @include foo.texinfo
764      @include bar.texinfo
765      @include concept-index.texinfo
766      
767      @summarycontents
768      @contents
769      
770      @bye
771
772   An included file, such as `foo.texinfo', might look like this:
773
774      @node First, Second, , Top
775      @chapter First Chapter
776      
777      Contents of first chapter ...
778
779   The full contents of `concept-index.texinfo' might be as simple as
780 this:
781
782      @node Concept Index, , Second, Top
783      @unnumbered Concept Index
784      
785      @printindex cp
786
787   The outer Texinfo source file for `The XEmacs Lisp Reference Manual'
788 is named `elisp.texi'.  This outer file contains a master menu with 417
789 entries and a list of 41 `@include' files.
790
791 \1f
792 File: texinfo.info,  Node: Include Files Evolution,  Prev: Sample Include File,  Up: Include Files
793
794 Evolution of Include Files
795 ==========================
796
797   When Info was first created, it was customary to create many small
798 Info files on one subject.  Each Info file was formatted from its own
799 Texinfo source file.  This custom meant that Emacs did not need to make
800 a large buffer to hold the whole of a large Info file when someone
801 wanted information; instead, Emacs allocated just enough memory for the
802 small Info file that contained the particular information sought.  This
803 way, Emacs could avoid wasting memory.
804
805   References from one file to another were made by referring to the file
806 name as well as the node name. (*Note Referring to Other Info Files:
807 Other Info Files.  Also, see *Note `@xref' with Four and Five
808 Arguments: Four and Five Arguments.)
809
810   Include files were designed primarily as a way to create a single,
811 large printed manual out of several smaller Info files.  In a printed
812 manual, all the references were within the same document, so TeX could
813 automatically determine the references' page numbers.  The Info
814 formatting commands used include files only for creating joint indices;
815 each of the individual Texinfo files had to be formatted for Info
816 individually.  (Each, therefore, required its own `@setfilename' line.)
817
818   However, because large Info files are now split automatically, it is
819 no longer necessary to keep them small.
820
821   Nowadays, multiple Texinfo files are used mostly for large documents,
822 such as `The XEmacs Lisp Reference Manual', and for projects in which
823 several different people write different sections of a document
824 simultaneously.
825
826   In addition, the Info formatting commands have been extended to work
827 with the `@include' command so as to create a single large Info file
828 that is split into smaller files if necessary.  This means that you can
829 write menus and cross references without naming the different Texinfo
830 files.
831
832 \1f
833 File: texinfo.info,  Node: Headings,  Next: Catching Mistakes,  Prev: Include Files,  Up: Top
834
835 Page Headings
836 *************
837
838   Most printed manuals contain headings along the top of every page
839 except the title and copyright pages.  Some manuals also contain
840 footings.  (Headings and footings have no meaning to Info, which is not
841 paginated.)
842
843 * Menu:
844
845 * Headings Introduced::         Conventions for using page headings.
846 * Heading Format::              Standard page heading formats.
847 * Heading Choice::              How to specify the type of page heading.
848 * Custom Headings::             How to create your own headings and footings.
849
850 \1f
851 File: texinfo.info,  Node: Headings Introduced,  Next: Heading Format,  Prev: Headings,  Up: Headings
852
853 Headings Introduced
854 ===================
855
856   Texinfo provides standard page heading formats for manuals that are
857 printed on one side of each sheet of paper and for manuals that are
858 printed on both sides of the paper.  Typically, you will use these
859 formats, but you can specify your own format if you wish.
860
861   In addition, you can specify whether chapters should begin on a new
862 page, or merely continue the same page as the previous chapter; and if
863 chapters begin on new pages, you can specify whether they must be
864 odd-numbered pages.
865
866   By convention, a book is printed on both sides of each sheet of paper.
867 When you open a book, the right-hand page is odd-numbered, and chapters
868 begin on right-hand pages--a preceding left-hand page is left blank if
869 necessary.  Reports, however, are often printed on just one side of
870 paper, and chapters begin on a fresh page immediately following the end
871 of the preceding chapter.  In short or informal reports, chapters often
872 do not begin on a new page at all, but are separated from the preceding
873 text by a small amount of whitespace.
874
875   The `@setchapternewpage' command controls whether chapters begin on
876 new pages, and whether one of the standard heading formats is used.  In
877 addition, Texinfo has several heading and footing commands that you can
878 use to generate your own heading and footing formats.
879
880   In Texinfo, headings and footings are single lines at the tops and
881 bottoms of pages; you cannot create multiline headings or footings.
882 Each header or footer line is divided into three parts: a left part, a
883 middle part, and a right part.  Any part, or a whole line, may be left
884 blank.  Text for the left part of a header or footer line is set
885 flushleft; text for the middle part is centered; and, text for the
886 right part is set flushright.
887
888 \1f
889 File: texinfo.info,  Node: Heading Format,  Next: Heading Choice,  Prev: Headings Introduced,  Up: Headings
890
891 Standard Heading Formats
892 ========================
893
894   Texinfo provides two standard heading formats, one for manuals printed
895 on one side of each sheet of paper, and the other for manuals printed
896 on both sides of the paper.
897
898   By default, nothing is specified for the footing of a Texinfo file,
899 so the footing remains blank.
900
901   The standard format for single-sided printing consists of a header
902 line in which the left-hand part contains the name of the chapter, the
903 central part is blank, and the right-hand part contains the page number.
904
905   A single-sided page looks like this:
906
907         _______________________
908        |                       |
909        | chapter   page number |
910        |                       |
911        | Start of text ...     |
912        | ...                   |
913        |                       |
914
915   The standard format for two-sided printing depends on whether the page
916 number is even or odd.  By convention, even-numbered pages are on the
917 left- and odd-numbered pages are on the right.  (TeX will adjust the
918 widths of the left- and right-hand margins.  Usually, widths are
919 correct, but during double-sided printing, it is wise to check that
920 pages will bind properly--sometimes a printer will produce output in
921 which the even-numbered pages have a larger right-hand margin than the
922 odd-numbered pages.)
923
924   In the standard double-sided format, the left part of the left-hand
925 (even-numbered) page contains the page number, the central part is
926 blank, and the right part contains the title (specified by the
927 `@settitle' command).  The left part of the right-hand (odd-numbered)
928 page contains the name of the chapter, the central part is blank, and
929 the right part contains the page number.
930
931   Two pages, side by side as in an open book, look like this:
932
933         _______________________     _______________________
934        |                       |   |                       |
935        | page number     title |   | chapter   page number |
936        |                       |   |                       |
937        | Start of text ...     |   | More  text ...        |
938        | ...                   |   | ...                   |
939        |                       |   |                       |
940
941 The chapter name is preceded by the word "Chapter", the chapter number
942 and a colon.  This makes it easier to keep track of where you are in the
943 manual.
944
945 \1f
946 File: texinfo.info,  Node: Heading Choice,  Next: Custom Headings,  Prev: Heading Format,  Up: Headings
947
948 Specifying the Type of Heading
949 ==============================
950
951   TeX does not begin to generate page headings for a standard Texinfo
952 file until it reaches the `@end titlepage' command.  Thus, the title
953 and copyright pages are not numbered.  The `@end titlepage' command
954 causes TeX to begin to generate page headings according to a standard
955 format specified by the `@setchapternewpage' command that precedes the
956 `@titlepage' section.
957
958   There are four possibilities:
959
960 No `@setchapternewpage' command
961      Cause TeX to specify the single-sided heading format, with chapters
962      on new pages. This is the same as `@setchapternewpage on'.
963
964 `@setchapternewpage on'
965      Specify the single-sided heading format, with chapters on new
966      pages.
967
968 `@setchapternewpage off'
969      Cause TeX to start a new chapter on the same page as the last page
970      of the preceding chapter, after skipping some vertical whitespace.
971      Also cause TeX to typeset for single-sided printing.  (You can
972      override the headers format with the `@headings double' command;
973      see *Note The `@headings' Command: headings on off.)
974
975 `@setchapternewpage odd'
976      Specify the double-sided heading format, with chapters on new
977      pages.
978
979 Texinfo lacks an `@setchapternewpage even' command.
980
981 \1f
982 File: texinfo.info,  Node: Custom Headings,  Prev: Heading Choice,  Up: Headings
983
984 How to Make Your Own Headings
985 =============================
986
987   You can use the standard headings provided with Texinfo or specify
988 your own.  By default, Texinfo has no footers, so if you specify them,
989 the available page size for the main text will be slightly reduced.
990
991   Texinfo provides six commands for specifying headings and footings.
992 The `@everyheading' command and `@everyfooting' command generate page
993 headers and footers that are the same for both even- and odd-numbered
994 pages.  The `@evenheading' command and `@evenfooting' command generate
995 headers and footers for even-numbered (left-hand) pages; and the
996 `@oddheading' command and `@oddfooting' command generate headers and
997 footers for odd-numbered (right-hand) pages.
998
999   Write custom heading specifications in the Texinfo file immediately
1000 after the `@end titlepage' command.  Enclose your specifications
1001 between `@iftex' and `@end iftex' commands since the
1002 `texinfo-format-buffer' command may not recognize them.  Also, you must
1003 cancel the predefined heading commands with the `@headings off' command
1004 before defining your own specifications.
1005
1006   Here is how to tell TeX to place the chapter name at the left, the
1007 page number in the center, and the date at the right of every header
1008 for both even- and odd-numbered pages:
1009
1010      @iftex
1011      @headings off
1012      @everyheading @thischapter @| @thispage @| @today{}
1013      @end iftex
1014
1015 You need to divide the left part from the central part and the central
1016 part from the right part by inserting `@|' between parts.  Otherwise,
1017 the specification command will not be able to tell where the text for
1018 one part ends and the next part begins.
1019
1020   Each part can contain text or @-commands.  The text is printed as if
1021 the part were within an ordinary paragraph in the body of the page.
1022 The @-commands replace themselves with the page number, date, chapter
1023 name, or whatever.
1024
1025   Here are the six heading and footing commands:
1026
1027 `@everyheading LEFT @| CENTER @| RIGHT'
1028 `@everyfooting LEFT @| CENTER @| RIGHT'
1029      The `every' commands specify the format for both even- and
1030      odd-numbered pages.  These commands are for documents that are
1031      printed on one side of each sheet of paper, or for documents in
1032      which you want symmetrical headers or footers.
1033
1034 `@evenheading LEFT @| CENTER @| RIGHT'
1035 `@oddheading  LEFT @| CENTER @| RIGHT'
1036 `@evenfooting LEFT @| CENTER @| RIGHT'
1037 `@oddfooting  LEFT @| CENTER @| RIGHT'
1038      The `even' and `odd' commands specify the format for even-numbered
1039      pages and odd-numbered pages.  These commands are for books and
1040      manuals that are printed on both sides of each sheet of paper.
1041
1042   Use the `@this...' series of @-commands to provide the names of
1043 chapters and sections and the page number.  You can use the `@this...'
1044 commands in the left, center, or right portions of headers and footers,
1045 or anywhere else in a Texinfo file so long as they are between `@iftex'
1046 and `@end iftex' commands.
1047
1048   Here are the `@this...' commands:
1049
1050 `@thispage'
1051      Expands to the current page number.
1052
1053 `@thischaptername'
1054      Expands to the name of the current chapter.
1055
1056 `@thischapter'
1057      Expands to the number and name of the current chapter, in the
1058      format `Chapter 1: Title'.
1059
1060 `@thistitle'
1061      Expands to the name of the document, as specified by the
1062      `@settitle' command.
1063
1064 `@thisfile'
1065      For `@include' files only: expands to the name of the current
1066      `@include' file.  If the current Texinfo source file is not an
1067      `@include' file, this command has no effect.  This command does
1068      _not_ provide the name of the current Texinfo source file unless
1069      it is an `@include' file.  (*Note Include Files::, for more
1070      information about `@include' files.)
1071
1072 You can also use the `@today{}' command, which expands to the current
1073 date, in `1 Jan 1900' format.
1074
1075   Other @-commands and text are printed in a header or footer just as
1076 if they were in the body of a page.  It is useful to incorporate text,
1077 particularly when you are writing drafts:
1078
1079      @iftex
1080      @headings off
1081      @everyheading @emph{Draft!} @| @thispage @| @thischapter
1082      @everyfooting @| @| Version: 0.27: @today{}
1083      @end iftex
1084
1085   Beware of overlong titles: they may overlap another part of the
1086 header or footer and blot it out.
1087
1088 \1f
1089 File: texinfo.info,  Node: Catching Mistakes,  Next: Refilling Paragraphs,  Prev: Headings,  Up: Top
1090
1091 Formatting Mistakes
1092 *******************
1093
1094   Besides mistakes in the content of your documentation, there are two
1095 kinds of mistake you can make with Texinfo:  you can make mistakes with
1096 @-commands, and you can make mistakes with the structure of the nodes
1097 and chapters.
1098
1099   Emacs has two tools for catching the @-command mistakes and two for
1100 catching structuring mistakes.
1101
1102   For finding problems with @-commands, you can run TeX or a region
1103 formatting command on the region that has a problem; indeed, you can
1104 run these commands on each region as you write it.
1105
1106   For finding problems with the structure of nodes and chapters, you
1107 can use `C-c C-s' (`texinfo-show-structure') and the related `occur'
1108 command and you can use the `M-x Info-validate' command.
1109
1110 * Menu:
1111
1112 * makeinfo Preferred::          `makeinfo' finds errors.
1113 * Debugging with Info::         How to catch errors with Info formatting.
1114 * Debugging with TeX::          How to catch errors with TeX formatting.
1115 * Using texinfo-show-structure::  How to use `texinfo-show-structure'.
1116 * Using occur::                 How to list all lines containing a pattern.
1117 * Running Info-Validate::       How to find badly referenced nodes.
1118
1119 \1f
1120 File: texinfo.info,  Node: makeinfo Preferred,  Next: Debugging with Info,  Prev: Catching Mistakes,  Up: Catching Mistakes
1121
1122 `makeinfo' Find Errors
1123 ======================
1124
1125   The `makeinfo' program does an excellent job of catching errors and
1126 reporting them--far better than `texinfo-format-region' or
1127 `texinfo-format-buffer'.  In addition, the various functions for
1128 automatically creating and updating node pointers and menus remove many
1129 opportunities for human error.
1130
1131   If you can, use the updating commands to create and insert pointers
1132 and menus.  These prevent many errors.  Then use `makeinfo' (or its
1133 Texinfo mode manifestations, `makeinfo-region' and `makeinfo-buffer')
1134 to format your file and check for other errors.  This is the best way
1135 to work with Texinfo.  But if you cannot use `makeinfo', or your
1136 problem is very puzzling, then you may want to use the tools described
1137 in this appendix.
1138
1139 \1f
1140 File: texinfo.info,  Node: Debugging with Info,  Next: Debugging with TeX,  Prev: makeinfo Preferred,  Up: Catching Mistakes
1141
1142 Catching Errors with Info Formatting
1143 ====================================
1144
1145   After you have written part of a Texinfo file, you can use the
1146 `texinfo-format-region' or the `makeinfo-region' command to see whether
1147 the region formats properly.
1148
1149   Most likely, however, you are reading this section because for some
1150 reason you cannot use the `makeinfo-region' command; therefore, the
1151 rest of this section presumes that you are using
1152 `texinfo-format-region'.
1153
1154   If you have made a mistake with an @-command, `texinfo-format-region'
1155 will stop processing at or after the error and display an error
1156 message.  To see where in the buffer the error occurred, switch to the
1157 `*Info Region*' buffer; the cursor will be in a position that is after
1158 the location of the error.  Also, the text will not be formatted after
1159 the place where the error occurred (or more precisely, where it was
1160 detected).
1161
1162   For example, if you accidentally end a menu with the command `@end
1163 menus' with an `s' on the end, instead of with `@end menu', you will
1164 see an error message that says:
1165
1166      @end menus is not handled by texinfo
1167
1168 The cursor will stop at the point in the buffer where the error occurs,
1169 or not long after it.  The buffer will look like this:
1170
1171      ---------- Buffer: *Info Region* ----------
1172      * Menu:
1173      
1174      * Using texinfo-show-structure::  How to use
1175                                        `texinfo-show-structure'
1176                                        to catch mistakes.
1177      * Running Info-Validate::         How to check for
1178                                        unreferenced nodes.
1179      @end menus
1180      -!-
1181      ---------- Buffer: *Info Region* ----------
1182
1183   The `texinfo-format-region' command sometimes provides slightly odd
1184 error messages.  For example, the following cross reference fails to
1185 format:
1186
1187      (@xref{Catching Mistakes, for more info.)
1188
1189 In this case, `texinfo-format-region' detects the missing closing brace
1190 but displays a message that says `Unbalanced parentheses' rather than
1191 `Unbalanced braces'.  This is because the formatting command looks for
1192 mismatches between braces as if they were parentheses.
1193
1194   Sometimes `texinfo-format-region' fails to detect mistakes.  For
1195 example, in the following, the closing brace is swapped with the
1196 closing parenthesis:
1197
1198      (@xref{Catching Mistakes), for more info.}
1199
1200 Formatting produces:
1201      (*Note for more info.: Catching Mistakes)
1202
1203   The only way for you to detect this error is to realize that the
1204 reference should have looked like this:
1205
1206      (*Note Catching Mistakes::, for more info.)
1207
1208   Incidentally, if you are reading this node in Info and type `f <RET>'
1209 (`Info-follow-reference'), you will generate an error message that says:
1210
1211      No such node: "Catching Mistakes) The only way ...
1212
1213 This is because Info perceives the example of the error as the first
1214 cross reference in this node and if you type a <RET> immediately after
1215 typing the Info `f' command, Info will attempt to go to the referenced
1216 node.  If you type `f catch <TAB> <RET>', Info will complete the node
1217 name of the correctly written example and take you to the `Catching
1218 Mistakes' node.  (If you try this, you can return from the `Catching
1219 Mistakes' node by typing `l' (`Info-last').)
1220