OSDN Git Service

Makefile for i?86-pc-msdosdjgpp
[pf3gnuchains/gcc-fork.git] / texinfo / texinfo.texi
1 \input texinfo.tex    @c -*-texinfo-*-
2 @comment %**start of header
3 @setfilename texinfo
4 @settitle Texinfo @value{edition}
5 @c Define a new index for options.
6 @defcodeindex op
7 @c Put everything except function (command, in this case) names in one
8 index (arbitrarily chosen to be the concept index).
9 @syncodeindex op cp
10 @syncodeindex vr cp
11 @syncodeindex pg cp
12 @footnotestyle separate
13 @paragraphindent 2
14 @finalout
15 @comment %**end of header
16 @comment $Id: texinfo.texi,v 1.2 1998/03/24 17:58:30 law Exp $
17
18 @c Before release, run C-u C-c C-u C-a (texinfo-all-menus-update with a
19 @c prefix arg).  This updates the node pointers, which texinfmt.el needs.
20
21 @dircategory Texinfo documentation system
22 @direntry
23 * Texinfo: (texinfo).           The GNU documentation format.
24 * install-info: (texinfo)Invoking install-info. Updating info/dir entries.
25 * texi2dvi: (texinfo)Format with texi2dvi.      Printing Texinfo documentation.
26 * texindex: (texinfo)Format with tex/texindex.  Sorting Texinfo index files.
27 @end direntry
28
29 @c Set smallbook if printing in smallbook format so the example of the
30 @c smallbook font is actually written using smallbook; in bigbook, a kludge
31 @c is used for TeX output.
32 @smallbook
33 @set smallbook
34 @c @@clear smallbook
35
36 @set edition 2.23
37 @set update-month October 1996
38 @set update-date 1 @value{update-month}
39
40 @c Currently undocumented command, 5 December 1993:
41 @c
42 @c nwnode          (Same as node, but no warnings; for `makeinfo'.)
43
44 @ifinfo
45 This file documents Texinfo, a documentation system that can produce
46 both on-line information and a printed manual from a single source file.
47
48 Copyright (C) 1988, 90, 91, 92, 93, 95, 1996 Free Software Foundation, Inc.
49
50 This is the second edition of the Texinfo documentation,@*
51 and is consistent with version 2 of @file{texinfo.tex}.
52
53 Permission is granted to make and distribute verbatim copies of
54 this manual provided the copyright notice and this permission notice
55 are preserved on all copies.
56
57 @ignore
58 Permission is granted to process this file through TeX and print the
59 results, provided the printed document carries copying permission
60 notice identical to this one except for the removal of this paragraph
61 (this paragraph not being relevant to the printed manual).
62
63 @end ignore
64 Permission is granted to copy and distribute modified versions of this
65 manual under the conditions for verbatim copying, provided that the entire
66 resulting derived work is distributed under the terms of a permission
67 notice identical to this one.
68
69 Permission is granted to copy and distribute translations of this manual
70 into another language, under the above conditions for modified versions,
71 except that this permission notice may be stated in a translation approved
72 by the Free Software Foundation.
73 @end ifinfo
74
75 @setchapternewpage odd
76
77 @shorttitlepage Texinfo
78
79 @titlepage
80 @c use the new format for titles
81 @title Texinfo
82 @subtitle The GNU Documentation Format
83 @subtitle Edition @value{edition}, for Texinfo Version Three
84 @subtitle @value{update-month}
85
86 @author Robert J.@: Chassell
87 @author Richard M.@: Stallman
88
89 @c Include the Distribution inside the titlepage so
90 @c that headings are turned off.
91
92 @page
93 @vskip 0pt plus 1filll
94 Copyright @copyright{} 1988, 1990, 1991, 1992, 1993, 1995, 1996 Free Software Foundation, Inc.
95
96 @sp 2
97 This is the second edition of the Texinfo documentation,@*
98 and is consistent with version 2 of @file{texinfo.tex}.
99 @sp 2
100
101 Published by the Free Software Foundation @*
102 59 Temple Place Suite 330, @*
103 Boston, MA 02111-1307 USA @*
104 Printed copies are available for $15 each.@*
105 ISBN 1-882114-64-7
106 @c ISBN 1-882114-63-9 is for edition 2.20 of 28 February 1995
107 @c ISBN 1-882114-64-7 is for edition 2.23 of 1 October 1996.
108
109 Permission is granted to make and distribute verbatim copies of
110 this manual provided the copyright notice and this permission notice
111 are preserved on all copies.
112
113 Permission is granted to copy and distribute modified versions of this
114 manual under the conditions for verbatim copying, provided that the entire
115 resulting derived work is distributed under the terms of a permission
116 notice identical to this one.
117
118 Permission is granted to copy and distribute translations of this manual
119 into another language, under the above conditions for modified versions,
120 except that this permission notice may be stated in a translation approved
121 by the Free Software Foundation.
122 @sp 2
123 Cover art by Etienne Suvasa.
124 @end titlepage
125
126 @ifinfo
127 @node Top, Copying, (dir), (dir)
128 @top Texinfo
129
130 Texinfo is a documentation system that uses a single source file to
131 produce both on-line information and printed output.@refill
132
133 The first part of this master menu lists the major nodes in this Info
134 document, including the @@-command and concept indices.  The rest of
135 the menu lists all the lower level nodes in the document.@refill
136
137 This is Edition @value{edition} of the Texinfo documentation,
138 @w{@value{update-date},} for Texinfo Version Three.
139 @end ifinfo
140
141 @c Here is a spare copy of the chapter menu entry descriptions,
142 @c in case they are accidently deleted
143 @ignore
144 Your rights.
145 Texinfo in brief.
146 How to use Texinfo mode.
147 What is at the beginning of a Texinfo file?
148 What is at the end of a Texinfo file?
149 How to create chapters, sections, subsections,
150   appendices, and other parts.
151 How to provide structure for a document.
152 How to write nodes.
153 How to write menus.
154 How to write cross references.
155 How to mark words and phrases as code,
156   keyboard input, meta-syntactic
157   variables, and the like.
158 How to write quotations, examples, etc.
159 How to write lists and tables.
160 How to create indices.
161 How to insert @@-signs, braces, etc.
162 How to indicate results of evaluation,
163   expansion of macros, errors, etc.
164 How to force and prevent line and page breaks.
165 How to describe functions and the like in a uniform manner.
166 How to write footnotes.
167 How to specify text for either @TeX{} or Info.
168 How to print hardcopy.
169 How to create an Info file.
170 How to install an Info file
171 A list of all the Texinfo @@-commands.
172 Hints on how to write a Texinfo document.
173 A sample Texinfo file to look at.
174 Tell readers they have the right to copy
175   and distribute.
176 How to incorporate other Texinfo files.
177 How to write page headings and footings.
178 How to find formatting mistakes.
179 All about paragraph refilling.
180 A description of @@-Command syntax.
181 Texinfo second edition features.
182 A menu containing commands and variables.
183 A menu covering many topics.
184 @end ignore
185
186 @menu
187 * Copying::                     Your rights.
188 * Overview::                    Texinfo in brief.
189 * Texinfo Mode::                How to use Texinfo mode.
190 * Beginning a File::            What is at the beginning of a Texinfo file?
191 * Ending a File::               What is at the end of a Texinfo file?
192 * Structuring::                 How to create chapters, sections, subsections,
193                                   appendices, and other parts.
194 * Nodes::                       How to write nodes.
195 * Menus::                       How to write menus.
196 * Cross References::            How to write cross references.
197 * Marking Text::                How to mark words and phrases as code,
198                                   keyboard input, meta-syntactic
199                                   variables, and the like.
200 * Quotations and Examples::     How to write quotations, examples, etc.
201 * Lists and Tables::            How to write lists and tables.
202 * Indices::                     How to create indices.
203 * Insertions::                  How to insert @@-signs, braces, etc.
204 * Glyphs::                      How to indicate results of evaluation,
205                                   expansion of macros, errors, etc.
206 * Breaks::                      How to force and prevent line and page breaks.
207 * Definition Commands::         How to describe functions and the like
208                                   in a uniform manner.
209 * Footnotes::                   How to write footnotes.
210 * Conditionals::                How to specify text for either @TeX{} or Info.
211 * Macros::                      Defining new Texinfo commands.
212 * Format/Print Hardcopy::       How to convert a Texinfo file to a file
213                                   for printing and how to print that file.
214 * Create an Info File::         Convert a Texinfo file into an Info file.
215 * Install an Info File::        Make an Info file accessible to users.
216 * Command List::                All the Texinfo @@-commands.
217 * Tips::                        Hints on how to write a Texinfo document.
218 * Sample Texinfo File::         A sample Texinfo file to look at.
219 * Sample Permissions::          Tell readers they have the right to copy
220                                   and distribute.
221 * Include Files::               How to incorporate other Texinfo files.
222 * Headings::                    How to write page headings and footings.
223 * Catching Mistakes::           How to find formatting mistakes.
224 * Refilling Paragraphs::        All about paragraph refilling.
225 * Command Syntax::              A description of @@-Command syntax.
226 * Obtaining TeX::               How to Obtain @TeX{}.
227 * New Features::                Texinfo second edition features.
228 * Command and Variable Index::  A menu containing commands and variables.
229 * Concept Index::               A menu covering many topics.
230
231 @detailmenu
232
233  --- The Detailed Node Listing ---
234
235 Overview of Texinfo
236
237 * Using Texinfo::               Create a conventional printed book
238                                   or an Info file.
239 * Info Files::                  What is an Info file?
240 * Printed Books::               Characteristics of a printed book or manual.
241 * Formatting Commands::         @@-commands are used for formatting.
242 * Conventions::                 General rules for writing a Texinfo file.
243 * Comments::                    How to write comments and mark regions that
244                                   the formatting commands will ignore.
245 * Minimum::                     What a Texinfo file must have.
246 * Six Parts::                   Usually, a Texinfo file has six parts.
247 * Short Sample::                A short sample Texinfo file.
248 * Acknowledgements::            
249
250 Using Texinfo Mode
251
252 * Texinfo Mode Overview::       How Texinfo mode can help you.
253 * Emacs Editing::               Texinfo mode adds to GNU Emacs' general
254                                   purpose editing features.
255 * Inserting::                   How to insert frequently used @@-commands.
256 * Showing the Structure::       How to show the structure of a file.
257 * Updating Nodes and Menus::    How to update or create new nodes and menus.
258 * Info Formatting::             How to format for Info.
259 * Printing::                    How to format and print part or all of a file.
260 * Texinfo Mode Summary::        Summary of all the Texinfo mode commands.
261
262 Updating Nodes and Menus
263
264 * Updating Commands::           Five major updating commands.
265 * Updating Requirements::       How to structure a Texinfo file for
266                                   using the updating command.
267 * Other Updating Commands::     How to indent descriptions, insert
268                                   missing nodes lines, and update
269                                   nodes in sequence.
270
271 Beginning a Texinfo File
272
273 * Four Parts::                  Four parts begin a Texinfo file.
274 * Sample Beginning::            Here is a sample beginning for a Texinfo file.
275 * Header::                      The very beginning of a Texinfo file.
276 * Info Summary and Permissions::  Summary and copying permissions for Info.
277 * Titlepage & Copyright Page::  Creating the title and copyright pages.
278 * The Top Node::                Creating the `Top' node and master menu.
279 * Software Copying Permissions::  Ensure that you and others continue to
280                                   have the right to use and share software.
281
282 The Texinfo File Header
283
284 * First Line::                  The first line of a Texinfo file.
285 * Start of Header::             Formatting a region requires this.
286 * setfilename::                 Tell Info the name of the Info file.
287 * settitle::                    Create a title for the printed work.
288 * setchapternewpage::           Start chapters on right-hand pages.
289 * paragraphindent::             An option to specify paragraph indentation.
290 * End of Header::               Formatting a region requires this.
291
292 The Title and Copyright Pages
293
294 * titlepage::                   Create a title for the printed document.
295 * titlefont center sp::         The @code{@@titlefont}, @code{@@center},
296                                   and @code{@@sp} commands.
297 * title subtitle author::       The @code{@@title}, @code{@@subtitle},
298                                   and @code{@@author} commands.
299 * Copyright & Permissions::     How to write the copyright notice and
300                                   include copying permissions.
301 * end titlepage::               Turn on page headings after the title and
302                                   copyright pages.
303 * headings on off::             An option for turning headings on and off
304                                   and double or single sided printing.
305
306 The `Top' Node and Master Menu
307
308 * Title of Top Node::           Sketch what the file is about.
309 * Master Menu Parts::           A master menu has three or more parts.
310
311 Ending a Texinfo File
312
313 * Printing Indices & Menus::    How to print an index in hardcopy and
314                                   generate index menus in Info.
315 * Contents::                    How to create a table of contents.
316 * File End::                    How to mark the end of a file.
317
318 Chapter Structuring
319
320 * Tree Structuring::            A manual is like an upside down tree @dots{}
321 * Structuring Command Types::   How to divide a manual into parts.
322 * makeinfo top::                The @code{@@top} command, part of the `Top' node.
323 * chapter::                     
324 * unnumbered & appendix::       
325 * majorheading & chapheading::  
326 * section::                     
327 * unnumberedsec appendixsec heading::  
328 * subsection::                  
329 * unnumberedsubsec appendixsubsec subheading::  
330 * subsubsection::               Commands for the lowest level sections.
331 * Raise/lower sections::        How to change commands' hierarchical level.
332
333 Nodes
334
335 * Two Paths::                   Different commands to structure
336                                   Info output and printed output.
337 * Node Menu Illustration::      A diagram, and sample nodes and menus.
338 * node::                        How to write a node, in detail.
339 * makeinfo Pointer Creation::   How to create node pointers with @code{makeinfo}.
340
341 The @code{@@node} Command
342
343 * Node Names::                  How to choose node and pointer names.
344 * Writing a Node::              How to write an @code{@@node} line.
345 * Node Line Tips::              Keep names short.
346 * Node Line Requirements::      Keep names unique, without @@-commands.
347 * First Node::                  How to write a `Top' node.
348 * makeinfo top command::        How to use the @code{@@top} command.
349 * Top Node Summary::            Write a brief description for readers.
350
351 Menus
352
353 * Menu Location::               Put a menu in a short node.
354 * Writing a Menu::              What is a menu?
355 * Menu Parts::                  A menu entry has three parts.
356 * Less Cluttered Menu Entry::   Two part menu entry.
357 * Menu Example::                Two and three part menu entries.
358 * Other Info Files::            How to refer to a different Info file.
359
360 Cross References
361
362 * References::                  What cross references are for.
363 * Cross Reference Commands::    A summary of the different commands.
364 * Cross Reference Parts::       A cross reference has several parts.
365 * xref::                        Begin a reference with `See' @dots{}
366 * Top Node Naming::             How to refer to the beginning of another file.
367 * ref::                         A reference for the last part of a sentence.
368 * pxref::                       How to write a parenthetical cross reference.
369 * inforef::                     How to refer to an Info-only file.
370
371 @code{@@xref}
372
373 * Reference Syntax::            What a reference looks like and requires.
374 * One Argument::                @code{@@xref} with one argument.
375 * Two Arguments::               @code{@@xref} with two arguments.
376 * Three Arguments::             @code{@@xref} with three arguments.
377 * Four and Five Arguments::     @code{@@xref} with four and five arguments.
378
379 Marking Words and Phrases
380
381 * Indicating::                  How to indicate definitions, files, etc.
382 * Emphasis::                    How to emphasize text.
383
384 Indicating Definitions, Commands, etc.
385
386 * Useful Highlighting::         Highlighting provides useful information.
387 * code::                        How to indicate code.
388 * kbd::                         How to show keyboard input.
389 * key::                         How to specify keys.
390 * samp::                        How to show a literal sequence of characters.
391 * var::                         How to indicate a metasyntactic variable.
392 * file::                        How to indicate the name of a file.
393 * dfn::                         How to specify a definition.
394 * cite::                        How to refer to a book that is not in Info.
395 * url::                         How to indicate a world wide web reference.
396 * email::                       How to indicate an electronic mail address.
397
398 Emphasizing Text
399
400 * emph & strong::               How to emphasize text in Texinfo.
401 * Smallcaps::                   How to use the small caps font.
402 * Fonts::                       Various font commands for printed output.
403 * Customized Highlighting::     How to define highlighting commands.
404
405 Quotations and Examples
406
407 * Block Enclosing Commands::    Use different constructs for
408                                   different purposes.
409 * quotation::                   How to write a quotation.
410 * example::                     How to write an example in a fixed-width font.
411 * noindent::                    How to prevent paragraph indentation.
412 * Lisp Example::                How to illustrate Lisp code.
413 * smallexample & smalllisp::    Forms for the @code{@@smallbook} option.
414 * display::                     How to write an example in the current font.
415 * format::                      How to write an example that does not narrow
416                                   the margins.
417 * exdent::                      How to undo the indentation of a line.
418 * flushleft & flushright::      How to push text flushleft or flushright.
419 * cartouche::                   How to draw cartouches around examples.
420
421 Making Lists and Tables
422
423 * Introducing Lists::           Texinfo formats lists for you.
424 * itemize::                     How to construct a simple list.
425 * enumerate::                   How to construct a numbered list.
426 * Two-column Tables::           How to construct a two-column table.
427 * Multi-column Tables::         How to construct generalized tables.
428
429 Making a Two-column Table
430
431 * table::                       How to construct a two-column table.
432 * ftable vtable::               How to construct a two-column table
433                                   with automatic indexing.
434 * itemx::                       How to put more entries in the first column.
435
436 Multi-column Tables
437
438 * Multitable Column Widths::    Defining multitable column widths.
439 * Multitable Rows::             Defining multitable rows, with examples.
440
441 Creating Indices
442
443 * Index Entries::               Choose different words for index entries.
444 * Predefined Indices::          Use different indices for different kinds
445                                   of entry.
446 * Indexing Commands::           How to make an index entry.
447 * Combining Indices::           How to combine indices.
448 * New Indices::                 How to define your own indices.
449
450 Combining Indices
451
452 * syncodeindex::                How to merge two indices, using @code{@@code}
453                                   font for the merged-from index.
454 * synindex::                    How to merge two indices, using the
455                                   default font of the merged-to index.
456
457 Special Insertions
458
459 * Braces Atsigns::              How to insert braces, @samp{@@}.
460 * Inserting Space::             How to insert the right amount of space
461                                   within a sentence.
462 * Inserting Accents::           How to insert accents and special characters.
463 * Dots Bullets::                How to insert dots and bullets.
464 * TeX and copyright::           How to insert the @TeX{} logo
465                                   and the copyright symbol.
466 * pounds::                      How to insert the pounds currency symbol.
467 * minus::                       How to insert a minus sign.
468 * math::                        How to format a mathematical expression.
469
470 Inserting @@ and Braces
471
472 * Inserting An Atsign::         How to insert @samp{@@}.
473 * Inserting Braces::            How to insert @samp{@{} and @samp{@}}.
474
475 Inserting Space
476
477 * Not Ending a Sentence::       Sometimes a . doesn't end a sentence.
478 * Ending a Sentence::           Sometimes it does.
479 * Multiple Spaces::             Inserting multiple spaces.
480 * dmn::                         How to format a dimension.
481
482 Inserting Ellipsis, Dots, and Bullets
483
484 * dots::                        How to insert dots @dots{}
485 * bullet::                      How to insert a bullet.
486
487 Inserting @TeX{} and the Copyright Symbol
488
489 * tex::                         How to insert the @TeX{} logo.
490 * copyright symbol::            How to use @code{@@copyright}@{@}.
491
492 Glyphs for Examples
493
494 * Glyphs Summary::              
495 * result::                      How to show the result of expression.
496 * expansion::                   How to indicate an expansion.
497 * Print Glyph::                 How to indicate printed output.
498 * Error Glyph::                 How to indicate an error message.
499 * Equivalence::                 How to indicate equivalence.
500 * Point Glyph::                 How to indicate the location of point.
501
502 Making and Preventing Breaks
503
504 * Break Commands::              Cause and prevent splits.
505 * Line Breaks::                 How to force a single line to use two lines.
506 * - and hyphenation::           How to tell TeX about hyphenation points.
507 * w::                           How to prevent unwanted line breaks.
508 * sp::                          How to insert blank lines.
509 * page::                        How to force the start of a new page.
510 * group::                       How to prevent unwanted page breaks.
511 * need::                        Another way to prevent unwanted page breaks.
512
513 Definition Commands
514
515 * Def Cmd Template::            How to structure a description using a
516                                   definition command.
517 * Optional Arguments::          How to handle optional and repeated arguments.
518 * deffnx::                      How to group two or more `first' lines.
519 * Def Cmds in Detail::          All the definition commands.
520 * Def Cmd Conventions::         Conventions for writing definitions.
521 * Sample Function Definition::  
522
523 The Definition Commands
524
525 * Functions Commands::          Commands for functions and similar entities.
526 * Variables Commands::          Commands for variables and similar entities.
527 * Typed Functions::             Commands for functions in typed languages.
528 * Typed Variables::             Commands for variables in typed languages.
529 * Abstract Objects::            Commands for object-oriented programming.
530 * Data Types::                  The definition command for data types.
531
532 Footnotes
533
534 * Footnote Commands::           How to write a footnote in Texinfo.
535 * Footnote Styles::             Controlling how footnotes appear in Info.
536
537 Conditionally Visible Text
538
539 * Conditional Commands::        How to specify text for HTML, Info, or @TeX{}.
540 * Using Ordinary TeX Commands::  You can use any and all @TeX{} commands.
541 * set clear value::             How to designate which text to format (for
542                                   both Info and @TeX{}); and how to set a
543                                   flag to a string that you can insert.
544
545 @code{@@set}, @code{@@clear}, and @code{@@value}
546
547 * ifset ifclear::               Format a region if a flag is set.
548 * value::                       Replace a flag with a string.
549 * value Example::               An easy way to update edition information.
550
551 Macros: Defining New Texinfo Commands
552
553 * Defining Macros::             Both defining and undefining new commands.
554 * Invoking Macros::             Using a macro, once you've defined it.
555
556 Format and Print Hardcopy
557
558 * Use TeX::                     Use @TeX{} to format for hardcopy.
559 * Format with tex/texindex::    How to format in a shell.
560 * Format with texi2dvi::        A simpler way to use the shell.
561 * Print with lpr::              How to print.
562 * Within Emacs::                How to format and print from an Emacs shell.
563 * Texinfo Mode Printing::       How to format and print in Texinfo mode.
564 * Compile-Command::             How to print using Emacs's compile command.
565 * Requirements Summary::        @TeX{} formatting requirements summary.
566 * Preparing for TeX::           What you need to do to use @TeX{}.
567 * Overfull hboxes::             What are and what to do with overfull hboxes.
568 * smallbook::                   How to print small format books and manuals.
569 * A4 Paper::                    How to print on European A4 paper.
570 * Cropmarks and Magnification::  How to print marks to indicate the size
571                                 of pages and how to print scaled up output.
572
573 Creating an Info File
574
575 * makeinfo advantages::         @code{makeinfo} provides better error checking.
576 * Invoking makeinfo::           How to run @code{makeinfo} from a shell.
577 * makeinfo options::            Specify fill-column and other options.
578 * Pointer Validation::          How to check that pointers point somewhere.
579 * makeinfo in Emacs::           How to run @code{makeinfo} from Emacs.
580 * texinfo-format commands::     Two Info formatting commands written
581                                   in Emacs Lisp are an alternative
582                                   to @code{makeinfo}.
583 * Batch Formatting::            How to format for Info in Emacs Batch mode.
584 * Tag and Split Files::         How tagged and split files help Info
585                                   to run better.
586
587 Installing an Info File
588
589 * Directory file::              The top level menu for all Info files.
590 * New Info File::               Listing a new info file.
591 * Other Info Directories::      How to specify Info files that are
592                                   located in other directories.
593 * Installing Dir Entries::      How to specify what menu entry to add
594                                   to the Info directory.
595 * Invoking install-info::       @code{install-info} options.
596
597 Sample Permissions
598
599 * Inserting Permissions::       How to put permissions in your document.
600 * ifinfo Permissions::          Sample @samp{ifinfo} copying permissions.
601 * Titlepage Permissions::       Sample Titlepage copying permissions.
602
603 Include Files
604
605 * Using Include Files::         How to use the @code{@@include} command.
606 * texinfo-multiple-files-update::  How to create and update nodes and
607                                   menus when using included files.
608 * Include File Requirements::   What @code{texinfo-multiple-files-update} expects.
609 * Sample Include File::         A sample outer file with included files
610                                   within it; and a sample included file.
611 * Include Files Evolution::     How use of the @code{@@include} command
612                                   has changed over time.
613
614 Page Headings
615
616 * Headings Introduced::         Conventions for using page headings.
617 * Heading Format::              Standard page heading formats.
618 * Heading Choice::              How to specify the type of page heading.
619 * Custom Headings::             How to create your own headings and footings.
620
621 Formatting Mistakes
622
623 * makeinfo preferred::          @code{makeinfo} finds errors.
624 * Debugging with Info::         How to catch errors with Info formatting.
625 * Debugging with TeX::          How to catch errors with @TeX{} formatting.
626 * Using texinfo-show-structure::  How to use @code{texinfo-show-structure}.
627 * Using occur::                 How to list all lines containing a pattern.
628 * Running Info-Validate::       How to find badly referenced nodes.
629
630 Finding Badly Referenced Nodes
631
632 * Using Info-validate::         How to run @code{Info-validate}.
633 * Unsplit::                     How to create an unsplit file.
634 * Tagifying::                   How to tagify a file.
635 * Splitting::                   How to split a file manually.
636
637 Second Edition Features
638
639 * New Texinfo Mode Commands::   The updating commands are especially useful.
640 * New Commands::                Many newly described @@-commands.
641 @end detailmenu
642 @end menu
643
644 @node Copying, Overview, Top, Top
645 @comment  node-name, next, previous,  up
646 @unnumbered Texinfo Copying Conditions
647 @cindex Copying conditions
648 @cindex Conditions for copying Texinfo
649
650 The programs currently being distributed that relate to Texinfo include
651 portions of GNU Emacs, plus other separate programs (including
652 @code{makeinfo}, @code{info}, @code{texindex}, and @file{texinfo.tex}).
653 These programs are @dfn{free}; this means that everyone is free to use
654 them and free to redistribute them on a free basis.  The Texinfo-related
655 programs are not in the public domain; they are copyrighted and there
656 are restrictions on their distribution, but these restrictions are
657 designed to permit everything that a good cooperating citizen would want
658 to do.  What is not allowed is to try to prevent others from further
659 sharing any version of these programs that they might get from
660 you.@refill
661
662   Specifically, we want to make sure that you have the right to give
663 away copies of the programs that relate to Texinfo, that you receive
664 source code or else can get it if you want it, that you can change these
665 programs or use pieces of them in new free programs, and that you know
666 you can do these things.@refill
667
668   To make sure that everyone has such rights, we have to forbid you to
669 deprive anyone else of these rights.  For example, if you distribute
670 copies of the Texinfo related programs, you must give the recipients all
671 the rights that you have.  You must make sure that they, too, receive or
672 can get the source code.  And you must tell them their rights.@refill
673
674   Also, for our own protection, we must make certain that everyone finds
675 out that there is no warranty for the programs that relate to Texinfo.
676 If these programs are modified by someone else and passed on, we want
677 their recipients to know that what they have is not what we distributed,
678 so that any problems introduced by others will not reflect on our
679 reputation.@refill
680
681   The precise conditions of the licenses for the programs currently
682 being distributed that relate to Texinfo are found in the General Public
683 Licenses that accompany them.@refill
684
685 @node Overview, Texinfo Mode, Copying, Top
686 @comment  node-name,  next,  previous,  up
687 @chapter Overview of Texinfo
688 @cindex Overview of Texinfo
689 @cindex Texinfo overview
690
691 @dfn{Texinfo}@footnote{Note that the first syllable of ``Texinfo'' is
692 pronounced like ``speck'', not ``hex''.  This odd pronunciation is
693 derived from, but is not the same as, the pronunciation of @TeX{}.  In
694 the word @TeX{}, the @samp{X} is actually the Greek letter ``chi''
695 rather than the English letter ``ex''.  Pronounce @TeX{} as if the
696 @samp{X} were the last sound in the name `Bach'; but pronounce Texinfo
697 as if the @samp{x} were a `k'.  Spell ``Texinfo'' with a capital ``T''
698 and write the other letters in lower case.}
699 is a documentation system that uses a single source file to produce both
700 on-line information and printed output.  This means that instead of
701 writing two different documents, one for the on-line help or other on-line
702 information and the other for a typeset manual or other printed work, you
703 need write only one document.  When the work is revised, you need revise
704 only one document.  (You can read the on-line information, known as an
705 @dfn{Info file}, with an Info documentation-reading program.)@refill
706
707 @menu
708 * Using Texinfo::               Create a conventional printed book
709                                   or an Info file.
710 * Info Files::                  What is an Info file?
711 * Printed Books::               Characteristics of a printed book or manual.
712 * Formatting Commands::         @@-commands are used for formatting.
713 * Conventions::                 General rules for writing a Texinfo file.
714 * Comments::                    How to write comments and mark regions that
715                                   the formatting commands will ignore.
716 * Minimum::                     What a Texinfo file must have.
717 * Six Parts::                   Usually, a Texinfo file has six parts.
718 * Short Sample::                A short sample Texinfo file.
719 * Acknowledgements::            
720 @end menu
721
722 @node Using Texinfo, Info Files, Overview, Overview
723 @ifinfo
724 @heading Using Texinfo
725 @end ifinfo
726
727 Using Texinfo, you can create a printed document with the normal
728 features of a book, including chapters, sections, cross references,
729 and indices.  From the same Texinfo source file, you can create a
730 menu-driven, on-line Info file with nodes, menus, cross references,
731 and indices.  You can, if you wish, make the chapters and sections of
732 the printed document correspond to the nodes of the on-line
733 information; and you use the same cross references and indices for
734 both the Info file and the printed work.  @cite{The GNU
735 Emacs Manual} is a good example of a Texinfo file, as is this manual.@refill
736
737 To make a printed document, you process a Texinfo source file with the
738 @TeX{} typesetting program.  This creates a @sc{dvi} file that you can
739 typeset and print as a book or report.  (Note that the Texinfo language
740 is completely different from @TeX{}'s usual language, plain @TeX{}.)  If
741 you do not have @TeX{}, but do have @code{troff} or @code{nroff}, you
742 can use the @code{texi2roff} program instead.@refill
743
744 To make an Info file, you process a Texinfo source file with the
745 @code{makeinfo} utility or Emacs's @code{texinfo-format-buffer} command;
746 this creates an Info file that you can install on-line.@refill
747
748 @TeX{} and @code{texi2roff} work with many types of printer; similarly,
749 Info works with almost every type of computer terminal.  This power
750 makes Texinfo a general purpose system, but brings with it a constraint,
751 which is that a Texinfo file may contain only the customary
752 ``typewriter'' characters (letters, numbers, spaces, and punctuation
753 marks) but no special graphics.@refill
754
755 A Texinfo file is a plain @sc{ascii} file containing text and
756 @dfn{@@-commands} (words preceded by an @samp{@@}) that tell the
757 typesetting and formatting programs what to do.  You may edit a
758 Texinfo file with any text editor; but it is especially convenient to
759 use GNU Emacs since that editor has a special mode, called Texinfo
760 mode, that provides various Texinfo-related features.  (@xref{Texinfo
761 Mode}.)@refill
762
763 Before writing a Texinfo source file, you should become familiar with
764 the Info documentation reading program and learn about nodes,
765 menus, cross references, and the rest.  (@inforef{Top, info, info},
766 for more information.)@refill
767
768 You can use Texinfo to create both on-line help and printed manuals;
769 moreover, Texinfo is freely redistributable.  For these reasons, Texinfo
770 is the format in which documentation for GNU utilities and libraries is
771 written.@refill
772
773 @node Info Files, Printed Books, Using Texinfo, Overview
774 @comment  node-name,  next,  previous,  up
775 @section Info files
776 @cindex Info files
777
778 An Info file is a Texinfo file formatted so that the Info documentation
779 reading program can operate on it.  (@code{makeinfo}
780 and @code{texinfo-format-buffer} are two commands that convert a Texinfo file
781 into an Info file.)@refill
782
783 Info files are divided into pieces called @dfn{nodes}, each of which
784 contains the discussion of one topic.  Each node has a name, and
785 contains both text for the user to read and pointers to other nodes,
786 which are identified by their names.  The Info program displays one node
787 at a time, and provides commands with which the user can move to other
788 related nodes.@refill
789
790 @ifinfo
791 @inforef{Top, info, info}, for more information about using Info.@refill
792 @end ifinfo
793
794 Each node of an Info file may have any number of child nodes that
795 describe subtopics of the node's topic.  The names of child
796 nodes are listed in a @dfn{menu} within the parent node; this
797 allows you to use certain Info commands to move to one of the child
798 nodes.  Generally, an Info file is organized like a book.  If a node
799 is at the logical level of a chapter, its child nodes are at the level
800 of sections; likewise, the child nodes of sections are at the level
801 of subsections.@refill
802
803 All the children of any one parent are linked together in a
804 bidirectional chain of `Next' and `Previous' pointers.  The `Next'
805 pointer provides a link to the next section, and the `Previous' pointer
806 provides a link to the previous section.  This means that all the nodes
807 that are at the level of sections within a chapter are linked together.
808 Normally the order in this chain is the same as the order of the
809 children in the parent's menu.  Each child node records the parent node
810 name as its `Up' pointer.  The last child has no `Next' pointer, and the
811 first child has the parent both as its `Previous' and as its `Up'
812 pointer.@footnote{In some documents, the first child has no `Previous'
813 pointer.  Occasionally, the last child has the node name of the next
814 following higher level node as its `Next' pointer.}@refill
815
816 The book-like structuring of an Info file into nodes that correspond
817 to chapters, sections, and the like is a matter of convention, not a
818 requirement.  The `Up', `Previous', and `Next' pointers of a node can
819 point to any other nodes, and a menu can contain any other nodes.
820 Thus, the node structure can be any directed graph.  But it is usually
821 more comprehensible to follow a structure that corresponds to the
822 structure of chapters and sections in a printed book or report.@refill
823
824 In addition to menus and to `Next', `Previous', and `Up' pointers, Info
825 provides pointers of another kind, called references, that can be
826 sprinkled throughout the text.  This is usually the best way to
827 represent links that do not fit a hierarchical structure.@refill
828
829 Usually, you will design a document so that its nodes match the
830 structure of chapters and sections in the printed output.  But there
831 are times when this is not right for the material being discussed.
832 Therefore, Texinfo uses separate commands to specify the node
833 structure for the Info file and the section structure for the printed
834 output.@refill
835
836 Generally, you enter an Info file through a node that by convention is
837 called @samp{Top}.  This node normally contains just a brief summary
838 of the file's purpose, and a large menu through which the rest of the
839 file is reached.  From this node, you can either traverse the file
840 systematically by going from node to node, or you can go to a specific
841 node listed in the main menu, or you can search the index menus and
842 then go directly to the node that has the information you want.@refill
843 @c !!! With the standalone Info system you may go to specific nodes
844 @c directly..
845
846 If you want to read through an Info file in sequence, as if it were a
847 printed manual, you can get the whole file with the advanced Info
848 command @kbd{g* @key{RET}}.  (@inforef{Expert, Advanced Info commands,
849 info}.)@refill
850
851 @c !!! dir file may be located in one of many places:
852 @c     /usr/local/emacs/info            mentioned in info.c DEFAULT_INFOPATH
853 @c     /usr/local/lib/emacs/info        mentioned in info.c DEFAULT_INFOPATH
854 @c     /usr/gnu/info                    mentioned in info.c DEFAULT_INFOPATH
855 @c     /usr/local/info
856 @c     /usr/local/lib/info
857 The @file{dir} file in the @file{info} directory serves as the
858 departure point for the whole Info system.  From it, you can reach the
859 `Top' nodes of each of the documents in a complete Info system.@refill
860
861 @node Printed Books, Formatting Commands, Info Files, Overview
862 @comment  node-name,  next,  previous,  up
863 @section Printed Books
864 @cindex Printed book and manual characteristics
865 @cindex Manual characteristics, printed
866 @cindex Book characteristics, printed
867 @cindex Texinfo printed book characteristics
868 @cindex Characteristics, printed books or manuals
869
870 @cindex Knuth, Donald
871 A Texinfo file can be formatted and typeset as a printed book or manual.
872 To do this, you need @TeX{}, a powerful, sophisticated typesetting
873 program written by Donald Knuth.@footnote{You can also use the
874 @code{texi2roff} program if you do not have @TeX{}; since Texinfo is
875 designed for use with @TeX{}, @code{texi2roff} is not described here.
876 @code{texi2roff} is part of the standard GNU distribution.}@refill
877
878 A Texinfo-based book is similar to any other typeset, printed work: it
879 can have a title page, copyright page, table of contents, and preface,
880 as well as chapters, numbered or unnumbered sections and subsections,
881 page headers, cross references, footnotes, and indices.@refill
882
883 You can use Texinfo to write a book without ever having the intention
884 of converting it into on-line information.  You can use Texinfo for
885 writing a printed novel, and even to write a printed memo, although
886 this latter application is not recommended since electronic mail is so
887 much easier.@refill
888
889 @TeX{} is a general purpose typesetting program.  Texinfo provides a
890 file called @file{texinfo.tex} that contains information (definitions or
891 @dfn{macros}) that @TeX{} uses when it typesets a Texinfo file.
892 (@file{texinfo.tex} tells @TeX{} how to convert the Texinfo @@-commands
893 to @TeX{} commands, which @TeX{} can then process to create the typeset
894 document.)  @file{texinfo.tex} contains the specifications for printing
895 a document.@refill
896
897 Most often, documents are printed on 8.5 inch by 11 inch
898 pages (216@dmn{mm} by 280@dmn{mm}; this is the default size), but you
899 can also print for 7 inch by 9.25 inch pages (178@dmn{mm} by
900 235@dmn{mm}; the @code{@@smallbook} size) or on European A4 size paper
901 (@code{@@afourpaper}).  (@xref{smallbook, , Printing ``Small'' Books}.
902 Also, see @ref{A4 Paper, ,Printing on A4 Paper}.)@refill
903
904 By changing the parameters in @file{texinfo.tex}, you can change the
905 size of the printed document.  In addition, you can change the style in
906 which the printed document is formatted; for example, you can change the
907 sizes and fonts used, the amount of indentation for each paragraph, the
908 degree to which words are hyphenated, and the like.  By changing the
909 specifications, you can make a book look dignified, old and serious, or
910 light-hearted, young and cheery.@refill
911
912 @TeX{} is freely distributable.  It is written in a dialect of Pascal
913 called WEB and can be compiled either in Pascal or (by using a
914 conversion program that comes with the @TeX{} distribution) in C.
915 (@xref{TeX Mode, ,@TeX{} Mode, emacs, The GNU Emacs Manual}, for information
916 about @TeX{}.)@refill
917
918 @TeX{} is very powerful and has a great many features.  Because a
919 Texinfo file must be able to present information both on a
920 character-only terminal in Info form and in a typeset book, the
921 formatting commands that Texinfo supports are necessarily
922 limited.@refill
923
924 @xref{Obtaining TeX, , How to Obtain @TeX{}}.
925
926
927 @node Formatting Commands, Conventions, Printed Books, Overview
928 @comment  node-name,  next,  previous,  up
929 @section @@-commands
930 @cindex @@-commands
931 @cindex Formatting commands
932
933 In a Texinfo file, the commands that tell @TeX{} how to typeset the
934 printed manual and tell @code{makeinfo} and
935 @code{texinfo-format-buffer} how to create an Info file are preceded
936 by @samp{@@}; they are called @dfn{@@-commands}.  For example,
937 @code{@@node} is the command to indicate a node and @code{@@chapter}
938 is the command to indicate the start of a chapter.@refill
939
940 @quotation
941 @strong{Please note:} All the @@-commands, with the exception of the
942 @code{@@TeX@{@}} command, must be written entirely in lower
943 case.@refill
944 @end quotation
945
946 The Texinfo @@-commands are a strictly limited set of constructs.  The
947 strict limits make it possible for Texinfo files to be understood both
948 by @TeX{} and by the code that converts them into Info files.  You can
949 display Info files on any terminal that displays alphabetic and
950 numeric characters.  Similarly, you can print the output generated by
951 @TeX{} on a wide variety of printers.@refill
952
953 Depending on what they do or what arguments@footnote{The word
954 @dfn{argument} comes from the way it is used in mathematics and does
955 not refer to a disputation between two people; it refers to the
956 information presented to the command.  According to the @cite{Oxford
957 English Dictionary}, the word derives from the Latin for @dfn{to make
958 clear, prove}; thus it came to mean `the evidence offered as proof',
959 which is to say, `the information offered', which led to its
960 mathematical meaning.  In its other thread of derivation, the word
961 came to mean `to assert in a manner against which others may make
962 counter assertions', which led to the meaning of `argument' as a
963 disputation.} they take, you need to write @@-commands on lines of
964 their own or as part of sentences:@refill
965
966 @itemize @bullet
967 @item
968 Write a command such as @code{@@noindent} at the beginning of a line as
969 the only text on the line.  (@code{@@noindent} prevents the beginning of
970 the next line from being indented as the beginning of a
971 paragraph.)@refill
972
973 @item
974 Write a command such as @code{@@chapter} at the beginning of a line
975 followed by the command's arguments, in this case the chapter title, on
976 the rest of the line.  (@code{@@chapter} creates chapter titles.)@refill
977
978 @item
979 Write a command such as @code{@@dots@{@}} wherever you wish but usually
980 within a sentence. (@code{@@dots@{@}} creates dots @dots{})@refill
981
982 @item
983 Write a command such as @code{@@code@{@var{sample-code}@}} wherever you
984 wish (but usually within a sentence) with its argument,
985 @var{sample-code} in this example, between the braces.  (@code{@@code}
986 marks text as being code.)@refill
987
988 @item
989 Write a command such as @code{@@example} at the beginning of a line of
990 its own; write the body-text on following lines; and write the matching
991 @code{@@end} command, @code{@@end example} in this case, at the
992 beginning of a line of its own after the body-text. (@code{@@example}
993 @dots{} @code{@@end example} indents and typesets body-text as an
994 example.)@refill
995 @end itemize
996
997 @noindent
998 @cindex Braces, when to use
999 As a general rule, a command requires braces if it mingles among other
1000 text; but it does not need braces if it starts a line of its own.  The
1001 non-alphabetic commands, such as @code{@@:}, are exceptions to the rule;
1002 they do not need braces.@refill
1003
1004 As you gain experience with Texinfo, you will rapidly learn how to
1005 write the different commands: the different ways to write commands
1006 make it easier to write and read Texinfo files than if all commands
1007 followed exactly the same syntax.  (For details about @@-command
1008 syntax, see @ref{Command Syntax, , @@-Command Syntax}.)@refill
1009
1010 @node Conventions, Comments, Formatting Commands, Overview
1011 @comment  node-name,  next,  previous,  up
1012 @section General Syntactic Conventions
1013 @cindex General syntactic conventions
1014 @cindex Syntactic conventions
1015 @cindex Conventions, syntactic
1016
1017 All printable @sc{ascii} characters except @samp{@@}, @samp{@{} and
1018 @samp{@}} can appear in a Texinfo file and stand for themselves.
1019 @samp{@@} is the escape character which introduces commands.
1020 @samp{@{} and @samp{@}} should be used only to surround arguments to
1021 certain commands.  To put one of these special characters into the
1022 document, put an @samp{@@} character in front of it, like this:
1023 @samp{@@@@}, @samp{@@@{}, and @samp{@@@}}.@refill
1024
1025 @ifinfo
1026 It is customary in @TeX{} to use doubled single-quote characters to
1027 begin and end quotations: ` ` and ' ' (but without a space between the
1028 two single-quote characters).  This convention should be followed in
1029 Texinfo files.  @TeX{} converts doubled single-quote characters to
1030 left- and right-hand doubled quotation marks and Info converts doubled
1031 single-quote characters to @sc{ascii} double-quotes: ` ` and ' ' to " .@refill
1032 @end ifinfo
1033 @iftex
1034 It is customary in @TeX{} to use doubled single-quote characters to
1035 begin and end quotations: @w{@tt{ `` }} and @w{@tt{ '' }}.  This
1036 convention should be followed in Texinfo files.  @TeX{} converts
1037 doubled single-quote characters to left- and right-hand doubled
1038 quotation marks, ``like this'', and Info converts doubled single-quote
1039 characters to @sc{ascii} double-quotes: @w{@tt{ `` }} and
1040 @w{@tt{ '' }} to @w{@tt{ " }}.@refill
1041 @end iftex
1042
1043 Use three hyphens in a row, @samp{---}, for a dash---like this.  In
1044 @TeX{}, a single or even a double hyphen produces a printed dash that
1045 is shorter than the usual typeset dash. Info reduces three hyphens to two for
1046 display on the screen.@refill
1047
1048 To prevent a paragraph from being indented in the printed manual, put
1049 the command @code{@@noindent} on a line by itself before the
1050 paragraph.@refill
1051
1052 If you mark off a region of the Texinfo file with the @code{@@iftex}
1053 and @w{@code{@@end iftex}} commands, that region will appear only in
1054 the printed copy; in that region, you can use certain commands
1055 borrowed from plain @TeX{} that you cannot use in Info.  Likewise, if
1056 you mark off a region with the @code{@@ifinfo} and @code{@@end ifinfo}
1057 commands, that region will appear only in the Info file; in that
1058 region, you can use Info commands that you cannot use in @TeX{}.
1059 Similarly for @code{@@ifhtml} and @code{@@end ifhtml}.
1060 @xref{Conditionals}.
1061
1062 @cindex Tabs; don't use!
1063 @quotation
1064 @strong{Caution:} Do not use tabs in a Texinfo file!  @TeX{} uses
1065 variable-width fonts, which means that it cannot predefine a tab to work
1066 in all circumstances.  Consequently, @TeX{} treats tabs like single
1067 spaces, and that is not what they look like.@refill
1068
1069 @noindent
1070 To avoid this problem, Texinfo mode causes GNU Emacs to insert multiple
1071 spaces when you press the @key{TAB} key.@refill
1072
1073 @noindent
1074 Also, you can run @code{untabify} in Emacs to convert tabs in a region
1075 to multiple spaces.@refill
1076 @end quotation
1077
1078 @node Comments, Minimum, Conventions, Overview
1079 @comment  node-name,  next,  previous,  up
1080 @section Comments
1081
1082 You can write comments in a Texinfo file that will not appear in
1083 either the Info file or the printed manual by using the
1084 @code{@@comment} command (which may be abbreviated to @code{@@c}).
1085 Such comments are for the person who reads the Texinfo file.  All the
1086 text on a line that follows either @code{@@comment} or @code{@@c} is a
1087 comment; the rest of the line does not appear in either the Info file
1088 or the printed manual. (Often, you can write the @code{@@comment} or
1089 @code{@@c} in the middle of a line, and only the text that follows after
1090 the @code{@@comment} or @code{@@c} command does not appear; but some
1091 commands, such as @code{@@settitle} and @code{@@setfilename}, work on a
1092 whole line.  You cannot use @code{@@comment} or @code{@@c} in a line
1093 beginning with such a command.)@refill
1094 @cindex Comments
1095 @findex comment
1096 @findex c @r{(comment)}
1097
1098 You can write long stretches of text that will not appear in either
1099 the Info file or the printed manual by using the @code{@@ignore} and
1100 @code{@@end ignore} commands.  Write each of these commands on a line
1101 of its own, starting each command at the beginning of the line.  Text
1102 between these two commands does not appear in the processed output.
1103 You can use @code{@@ignore} and @code{@@end ignore} for writing
1104 comments.  Often, @code{@@ignore} and @code{@@end ignore} is used
1105 to enclose a part of the copying permissions that applies to the
1106 Texinfo source file of a document, but not to the Info or printed
1107 version of the document.@refill
1108 @cindex Ignored text
1109 @cindex Unprocessed text
1110 @findex ignore
1111 @c !!! Perhaps include this comment about ignore and ifset:
1112 @ignore
1113 Text enclosed by @code{@@ignore} or by failing @code{@@ifset} or
1114 @code{@@ifclear} conditions is ignored in the sense that it will not
1115 contribute to the formatted output.  However, TeX and makeinfo must
1116 still parse the ignored text, in order to understand when to
1117 @emph{stop} ignoring text from the source file; that means that you
1118 will still get error messages if you have invalid Texinfo markup
1119 within ignored text.
1120 @end ignore
1121
1122 @node Minimum, Six Parts, Comments, Overview
1123 @comment  node-name,  next,  previous,  up
1124 @section What a Texinfo File Must Have
1125 @cindex Minimal Texinfo file (requirements)
1126 @cindex Must have in Texinfo file
1127 @cindex Required in Texinfo file
1128 @cindex Texinfo file minimum
1129
1130 By convention, the names of Texinfo files end with one of the
1131 extensions @file{.texinfo}, @file{.texi}, or @file{.tex}.  The longer
1132 extension is preferred since it describes more clearly to a human
1133 reader the nature of the file.  The shorter extensions are for
1134 operating systems that cannot handle long file names.@refill
1135
1136 In order to be made into a printed manual and an Info file, a Texinfo
1137 file @strong{must} begin with lines like this:@refill
1138
1139 @example
1140 @group
1141 \input texinfo
1142 @@setfilename @var{info-file-name}
1143 @@settitle @var{name-of-manual}
1144 @end group
1145 @end example
1146
1147 @noindent
1148 The contents of the file follow this beginning, and then you @strong{must} end
1149 a Texinfo file with a line like this:@refill
1150
1151 @example
1152 @@bye
1153 @end example
1154
1155 @findex input @r{(@TeX{} command)}
1156 @noindent
1157 The @samp{\input texinfo} line tells @TeX{} to use the
1158 @file{texinfo.tex} file, which tells @TeX{} how to translate the Texinfo
1159 @@-commands into @TeX{} typesetting commands.  (Note the use of the
1160 backslash, @samp{\}; this is correct for @TeX{}.)  The
1161 @samp{@@setfilename} line provides a name for the Info file and tells
1162 @TeX{} to open auxiliary files.  The @samp{@@settitle} line specifies a
1163 title for the page headers (or footers) of the printed manual.@refill
1164
1165 The @code{@@bye} line at the end of the file on a line of its own tells
1166 the formatters that the file is ended and to stop formatting.@refill
1167
1168 Usually, you will not use quite such a spare format, but will include
1169 mode setting and start-of-header and end-of-header lines at the
1170 beginning of a Texinfo file, like this:@refill
1171
1172 @example
1173 @group
1174 \input texinfo   @@c -*-texinfo-*-
1175 @@c %**start of header
1176 @@setfilename @var{info-file-name}
1177 @@settitle @var{name-of-manual}
1178 @@c %**end of header
1179 @end group
1180 @end example
1181
1182 @noindent
1183 In the first line, @samp{-*-texinfo-*-} causes Emacs to switch into
1184 Texinfo mode when you edit the file.
1185
1186 The @code{@@c} lines which surround the @samp{@@setfilename} and
1187 @samp{@@settitle} lines are optional, but you need them in order to
1188 run @TeX{} or Info on just part of the file.  (@xref{Start of Header},
1189 for more information.)@refill
1190
1191 Furthermore, you will usually provide a Texinfo file with a title
1192 page, indices, and the like.  But the minimum, which can be useful
1193 for short documents, is just the three lines at the beginning and the
1194 one line at the end.@refill
1195
1196 @node Six Parts, Short Sample, Minimum, Overview
1197 @comment  node-name,  next,  previous,  up
1198 @section Six Parts of a Texinfo File
1199
1200 Generally, a Texinfo file contains more than the minimal
1201 beginning and end---it usually contains six parts:@refill
1202
1203 @table @r
1204 @item 1. Header
1205 The @dfn{Header} names the file, tells @TeX{} which definitions' file to
1206 use, and performs other ``housekeeping'' tasks.@refill
1207
1208 @item 2. Summary Description and Copyright
1209 The @dfn{Summary Description and Copyright} segment describes the document
1210 and contains the copyright notice and copying permissions for the Info
1211 file.  The segment must be enclosed between @code{@@ifinfo} and
1212 @code{@@end ifinfo} commands so that the formatters place it only in the Info
1213 file.@refill
1214
1215 @item 3. Title and Copyright
1216 The @dfn{Title and Copyright} segment contains the title and copyright pages
1217 and copying permissions for the printed manual.  The segment must be
1218 enclosed between @code{@@titlepage} and @code{@@end titlepage} commands.
1219 The title and copyright page appear only in the printed @w{manual}.@refill
1220
1221 @item 4. `Top' Node and Master Menu
1222 The @dfn{Master Menu} contains a complete menu of all the nodes in the whole
1223 Info file.  It appears only in the Info file, in the `Top' node.@refill
1224
1225 @item 5. Body
1226 The @dfn{Body} of the document may be structured like a traditional book or
1227 encyclopedia or it may be free form.@refill
1228
1229 @item 6. End
1230 The @dfn{End} contains commands for printing indices and generating
1231 the table of contents, and the @code{@@bye} command on a line of its
1232 own.@refill
1233 @end table
1234
1235 @node Short Sample, Acknowledgements, Six Parts, Overview
1236 @comment  node-name,  next,  previous,  up
1237 @section A Short Sample Texinfo File
1238 @cindex Sample Texinfo file
1239
1240 Here is a complete but very short Texinfo file, in 6 parts.  The first
1241 three parts of the file, from @samp{\input texinfo} through to
1242 @samp{@@end titlepage}, look more intimidating than they are.  Most of
1243 the material is standard boilerplate; when you write a manual, simply
1244 insert the names for your own manual in this segment. (@xref{Beginning a
1245 File}.)@refill
1246
1247 @noindent
1248 In the following, the sample text is @emph{indented}; comments on it are
1249 not.  The complete file, without any comments, is shown in
1250 @ref{Sample Texinfo File}.
1251
1252 @subheading Part 1: Header
1253
1254 @noindent
1255 The header does not appear in either the Info file or the@*
1256 printed output.  It sets various parameters, including the@*
1257 name of the Info file and the title used in the header.
1258
1259 @example
1260 @group
1261 \input texinfo   @@c -*-texinfo-*-
1262 @@c %**start of header
1263 @@setfilename sample.info
1264 @@settitle Sample Document
1265 @@c %**end of header
1266
1267 @@setchapternewpage odd
1268 @end group
1269 @end example
1270
1271 @subheading Part 2: Summary Description and Copyright
1272
1273 @noindent
1274 The summary description and copyright segment does not@*
1275 appear in the printed document.
1276
1277 @example
1278 @group
1279 @@ifinfo
1280 This is a short example of a complete Texinfo file.
1281
1282 Copyright @@copyright@{@} 1990 Free Software Foundation, Inc.
1283 @@end ifinfo
1284 @end group
1285 @end example
1286
1287 @subheading Part 3: Titlepage and Copyright
1288
1289 @noindent
1290 The titlepage segment does not appear in the Info file.
1291
1292 @example
1293 @group
1294 @@titlepage
1295 @@sp 10
1296 @@comment The title is printed in a large font.
1297 @@center @@titlefont@{Sample Title@}
1298 @end group
1299
1300 @group
1301 @@c The following two commands start the copyright page.
1302 @@page
1303 @@vskip 0pt plus 1filll
1304 Copyright @@copyright@{@} 1990 Free Software Foundation, Inc.
1305 @@end titlepage
1306 @end group
1307 @end example
1308
1309 @subheading Part 4: `Top' Node and Master Menu
1310
1311 @noindent
1312 The `Top' node contains the master menu for the Info file.@*
1313 Since a printed manual uses a table of contents rather than@*
1314 a menu, the master menu appears only in the Info file.
1315
1316 @example
1317 @group
1318 @@node    Top,       First Chapter, (dir),    (dir)
1319 @@comment node-name, next,          previous, up
1320 @end group
1321 @end example
1322
1323 @example
1324 @group
1325 @@menu
1326 * First Chapter::    The first chapter is the
1327                      only chapter in this sample.
1328 * Concept Index::    This index has two entries.
1329 @@end menu
1330 @end group
1331 @end example
1332
1333 @subheading Part 5:  The Body of the Document
1334
1335 @noindent
1336 The body segment contains all the text of the document, but not the
1337 indices or table of contents.  This example illustrates a node and a
1338 chapter containing an enumerated list.@refill
1339
1340 @example
1341 @group
1342 @@node    First Chapter, Concept Index, Top,      Top
1343 @@comment node-name,     next,          previous, up
1344 @@chapter First Chapter
1345 @@cindex Sample index entry
1346 @end group
1347
1348 @group
1349 This is the contents of the first chapter.
1350 @@cindex Another sample index entry
1351 @end group
1352
1353 @group
1354 Here is a numbered list.
1355
1356 @@enumerate
1357 @@item
1358 This is the first item.
1359
1360 @@item
1361 This is the second item.
1362 @@end enumerate
1363 @end group
1364
1365 @group
1366 The @@code@{makeinfo@} and @@code@{texinfo-format-buffer@}
1367 commands transform a Texinfo file such as this into
1368 an Info file; and @@TeX@{@} typesets it for a printed
1369 manual.
1370 @end group
1371 @end example
1372
1373 @subheading Part 6: The End of the Document
1374
1375 @noindent
1376 The end segment contains commands both for generating an index in a node
1377 and unnumbered chapter of its own and for generating the table of
1378 contents; and it contains the @code{@@bye} command that marks the end of
1379 the document.@refill
1380
1381 @example
1382 @group
1383 @@node    Concept Index,    ,  First Chapter, Top
1384 @@comment node-name,    next,  previous,      up
1385 @@unnumbered Concept Index
1386 @end group
1387
1388 @group
1389 @@printindex cp
1390
1391 @@contents
1392 @@bye
1393 @end group
1394 @end example
1395
1396 @subheading The Results
1397
1398 Here is what the contents of the first chapter of the sample look like:
1399
1400 @sp 1
1401 @need 700
1402 @quotation
1403 This is the contents of the first chapter.
1404
1405 Here is a numbered list.
1406
1407 @enumerate
1408 @item
1409 This is the first item.
1410
1411 @item
1412 This is the second item.
1413 @end enumerate
1414
1415 The @code{makeinfo} and @code{texinfo-format-buffer}
1416 commands transform a Texinfo file such as this into
1417 an Info file; and @TeX{} typesets it for a printed
1418 manual.
1419 @end quotation
1420
1421 @node Acknowledgements, , Short Sample, Overview
1422 @comment  node-name,  next,  previous,  up
1423 @section Acknowledgements
1424
1425 @cindex Stallman, Richard M.
1426 @cindex Chassell, Robert J.
1427 @cindex Berry, Karl
1428 Richard M.@: Stallman wrote Edition 1.0 of this manual.  @w{Robert J.@:
1429 Chassell} revised and extended it, starting with Edition 1.1.  Karl
1430 Berry made updates for the Texinfo 3.8 and subsequent releases, starting
1431 with Edition 2.22.
1432
1433 @cindex Pinard, Fran@,{c}ois
1434 @cindex Zuhn, David D.
1435 @cindex Weisshaus, Melissa
1436 Our thanks go out to all who helped improve this work, particularly to
1437 Fran@,{c}ois Pinard and @w{David D.@: Zuhn}, who tirelessly recorded and
1438 reported mistakes and obscurities; our special thanks go to Melissa
1439 Weisshaus for her frequent and often tedious reviews of nearly similar
1440 editions.  Our mistakes are our own.
1441
1442 Please send suggestions and corrections to:
1443
1444 @example
1445 @group
1446 @r{Internet address:}
1447     bug-texinfo@@prep.ai.mit.edu
1448 @end group
1449 @end example
1450
1451 @noindent
1452 Please include the manual's edition number and update date in your messages.
1453
1454 @node Texinfo Mode, Beginning a File, Overview, Top
1455 @comment  node-name,  next,  previous,  up
1456 @chapter Using Texinfo Mode
1457 @cindex Texinfo mode
1458 @cindex Mode, using Texinfo
1459 @cindex GNU Emacs
1460 @cindex Emacs
1461
1462 You may edit a Texinfo file with any text editor you choose.  A Texinfo
1463 file is no different from any other @sc{ascii} file.  However, GNU Emacs
1464 comes with a special mode, called Texinfo
1465 mode, that provides  Emacs commands and tools to help ease your work.@refill
1466
1467 This chapter describes features of GNU Emacs' Texinfo mode but not any
1468 features of the Texinfo formatting language.  If you are reading this
1469 manual straight through from the beginning, you may want to skim through
1470 this chapter briefly and come back to it after reading succeeding
1471 chapters which describe the Texinfo formatting language in
1472 detail.@refill
1473
1474 @menu
1475 * Texinfo Mode Overview::       How Texinfo mode can help you.
1476 * Emacs Editing::               Texinfo mode adds to GNU Emacs' general
1477                                   purpose editing features.
1478 * Inserting::                   How to insert frequently used @@-commands.
1479 * Showing the Structure::       How to show the structure of a file.
1480 * Updating Nodes and Menus::    How to update or create new nodes and menus.
1481 * Info Formatting::             How to format for Info.
1482 * Printing::                    How to format and print part or all of a file.
1483 * Texinfo Mode Summary::        Summary of all the Texinfo mode commands.
1484 @end menu
1485
1486 @node Texinfo Mode Overview, Emacs Editing, Texinfo Mode, Texinfo Mode
1487 @ifinfo
1488 @heading Texinfo Mode Overview
1489 @end ifinfo
1490
1491 Texinfo mode provides special features for working with Texinfo
1492 files:@refill
1493
1494 @itemize @bullet
1495 @item
1496 Insert frequently used @@-commands. @refill
1497
1498 @item
1499 Automatically create @code{@@node} lines.
1500
1501 @item
1502 Show the structure of a Texinfo source file.@refill
1503
1504 @item
1505 Automatically create or update the `Next',@*
1506 `Previous', and `Up' pointers of a node.
1507
1508 @item
1509 Automatically create or update menus.@refill
1510
1511 @item
1512 Automatically create a master menu.@refill
1513
1514 @item
1515 Format a part or all of a file for Info.@refill
1516
1517 @item
1518 Typeset and print part or all of a file.@refill
1519 @end itemize
1520
1521 Perhaps the two most helpful features are those for inserting frequently
1522 used @@-commands and for creating node pointers and menus.@refill
1523
1524 @node Emacs Editing, Inserting, Texinfo Mode Overview, Texinfo Mode
1525 @section The Usual GNU Emacs Editing Commands
1526
1527 In most cases, the usual Text mode commands work the same in Texinfo
1528 mode as they do in Text mode.  Texinfo mode adds new editing commands
1529 and tools to GNU Emacs' general purpose editing features.  The major
1530 difference concerns filling.  In Texinfo mode, the paragraph
1531 separation variable and syntax table are redefined so that Texinfo
1532 commands that should be on lines of their own are not inadvertently
1533 included in paragraphs.  Thus, the @kbd{M-q} (@code{fill-paragraph})
1534 command will refill a paragraph but not mix an indexing command on a
1535 line adjacent to it into the paragraph.@refill
1536
1537 In addition, Texinfo mode sets the @code{page-delimiter} variable to
1538 the value of @code{texinfo-chapter-level-regexp}; by default, this is
1539 a regular expression matching the commands for chapters and their
1540 equivalents, such as appendices.  With this value for the page
1541 delimiter, you can jump from chapter title to chapter title with the
1542 @kbd{C-x ]} (@code{forward-page}) and @kbd{C-x [}
1543 (@code{backward-page}) commands and narrow to a chapter with the
1544 @kbd{C-x p} (@code{narrow-to-page}) command.  (@xref{Pages, , ,emacs,
1545 The GNU Emacs Manual}, for details about the page commands.)@refill
1546
1547 You may name a Texinfo file however you wish, but the convention is to
1548 end a Texinfo file name with one of the three extensions
1549 @file{.texinfo}, @file{.texi}, or @file{.tex}.  A longer extension is
1550 preferred, since it is explicit, but a shorter extension may be
1551 necessary for operating systems that limit the length of file names.
1552 GNU Emacs automatically enters Texinfo mode when you visit a file with
1553 a @file{.texinfo} or  @file{.texi}
1554 extension.  Also, Emacs switches to Texinfo mode
1555 when you visit a
1556 file that has @samp{-*-texinfo-*-} in its first line.  If ever you are
1557 in another mode and wish to switch to Texinfo mode, type @code{M-x
1558 texinfo-mode}.@refill
1559
1560 Like all other Emacs features, you can customize or enhance Texinfo
1561 mode as you wish.  In particular, the keybindings are very easy to
1562 change.  The keybindings described here are the default or standard
1563 ones.@refill
1564
1565 @node Inserting, Showing the Structure, Emacs Editing, Texinfo Mode
1566 @comment  node-name,  next,  previous,  up
1567 @section Inserting Frequently Used Commands
1568 @cindex Inserting frequently used commands
1569 @cindex Frequently used commands, inserting
1570 @cindex Commands, inserting them
1571
1572 Texinfo mode provides commands to insert various frequently used
1573 @@-commands into the buffer.  You can use these commands to save
1574 keystrokes.@refill
1575
1576 The insert commands are invoked by typing @kbd{C-c} twice and then the
1577 first letter of the @@-command:@refill
1578
1579 @table @kbd
1580 @item  C-c C-c c
1581 @itemx M-x texinfo-insert-@@code
1582 @findex texinfo-insert-@@code
1583 Insert @code{@@code@{@}} and put the
1584 cursor between the braces.@refill
1585
1586 @item  C-c C-c d
1587 @itemx M-x texinfo-insert-@@dfn
1588 @findex texinfo-insert-@@dfn
1589 Insert @code{@@dfn@{@}} and put the
1590 cursor between the braces.@refill
1591
1592 @item  C-c C-c e
1593 @itemx M-x texinfo-insert-@@end
1594 @findex texinfo-insert-@@end
1595 Insert @code{@@end} and attempt to insert the correct following word,
1596 such as @samp{example} or @samp{table}.  (This command does not handle
1597 nested lists correctly, but inserts the word appropriate to the
1598 immediately preceding list.)@refill
1599
1600 @item  C-c C-c i
1601 @itemx M-x texinfo-insert-@@item
1602 @findex texinfo-insert-@@item
1603 Insert @code{@@item} and put the
1604 cursor at the beginning of the next line.@refill
1605
1606 @item  C-c C-c k
1607 @itemx M-x texinfo-insert-@@kbd
1608 @findex texinfo-insert-@@kbd
1609 Insert @code{@@kbd@{@}} and put the
1610 cursor between the braces.@refill
1611
1612 @item  C-c C-c n
1613 @itemx M-x texinfo-insert-@@node
1614 @findex texinfo-insert-@@node
1615 Insert @code{@@node} and a comment line
1616 listing the sequence for the `Next',
1617 `Previous', and `Up' nodes.
1618 Leave point after the @code{@@node}.@refill
1619
1620 @item  C-c C-c o
1621 @itemx M-x texinfo-insert-@@noindent
1622 @findex texinfo-insert-@@noindent
1623 Insert @code{@@noindent} and put the
1624 cursor at the beginning of the next line.@refill
1625
1626 @item  C-c C-c s
1627 @itemx M-x texinfo-insert-@@samp
1628 @findex texinfo-insert-@@samp
1629 Insert @code{@@samp@{@}} and put the
1630 cursor between the braces.@refill
1631
1632 @item  C-c C-c t
1633 @itemx M-x texinfo-insert-@@table
1634 @findex texinfo-insert-@@table
1635 Insert @code{@@table} followed by a @key{SPC}
1636 and leave the cursor after the @key{SPC}.@refill
1637
1638 @item  C-c C-c v
1639 @itemx M-x texinfo-insert-@@var
1640 @findex texinfo-insert-@@var
1641 Insert @code{@@var@{@}} and put the
1642 cursor between the braces.@refill
1643
1644 @item  C-c C-c x
1645 @itemx M-x texinfo-insert-@@example
1646 @findex texinfo-insert-@@example
1647 Insert @code{@@example} and put the
1648 cursor at the beginning of the next line.@refill
1649
1650 @c M-@{  was the binding for texinfo-insert-braces;
1651 @c in Emacs 19, backward-paragraph will take this binding.
1652 @item C-c C-c @{
1653 @itemx M-x texinfo-insert-braces
1654 @findex texinfo-insert-braces
1655 Insert @code{@{@}} and put the cursor between the braces.@refill
1656
1657 @item C-c C-c @}
1658 @itemx C-c C-c ]
1659 @itemx M-x up-list
1660 @findex up-list
1661 Move from between a pair of braces forward past the closing brace.
1662 Typing @kbd{C-c C-c ]} is easier than typing @kbd{C-c C-c @}}, which
1663 is, however, more mnemonic; hence the two keybindings.  (Also, you can
1664 move out from between braces by typing @kbd{C-f}.)@refill
1665 @end table
1666
1667 To put a command such as @w{@code{@@code@{@dots{}@}}} around an
1668 @emph{existing} word, position the cursor in front of the word and type
1669 @kbd{C-u 1 C-c C-c c}.  This makes it easy to edit existing plain text.
1670 The value of the prefix argument tells Emacs how many words following
1671 point to include between braces---1 for one word, 2 for two words, and
1672 so on.  Use a negative argument to enclose the previous word or words.
1673 If you do not specify a prefix argument, Emacs inserts the @@-command
1674 string and positions the cursor between the braces.  This feature works
1675 only for those @@-commands that operate on a word or words within one
1676 line, such as @code{@@kbd} and @code{@@var}.@refill
1677
1678 This set of insert commands was created after analyzing the frequency
1679 with which different @@-commands are used in the @cite{GNU Emacs
1680 Manual} and the @cite{GDB Manual}.  If you wish to add your own insert
1681 commands, you can bind a keyboard macro to a key, use abbreviations,
1682 or extend the code in @file{texinfo.el}.@refill
1683
1684 @findex texinfo-start-menu-description
1685 @cindex Menu description, start
1686 @cindex Description for menu, start
1687 @kbd{C-c C-c C-d} (@code{texinfo-start-menu-description}) is an insert
1688 command that works differently from the other insert commands.  It
1689 inserts a node's section or chapter title in the space for the
1690 description in a menu entry line.  (A menu entry has three parts, the
1691 entry name, the node name, and the description.  Only the node name is
1692 required, but a description helps explain what the node is about.
1693 @xref{Menu Parts, , The Parts of a Menu}.)@refill
1694
1695 To use @code{texinfo-start-menu-description}, position point in a menu
1696 entry line and type @kbd{C-c C-c C-d}.  The command looks for and copies
1697 the title that goes with the node name, and inserts the title as a
1698 description; it positions point at beginning of the inserted text so you
1699 can edit it.  The function does not insert the title if the menu entry
1700 line already contains a description.@refill
1701
1702 This command is only an aid to writing descriptions; it does not do the
1703 whole job.  You must edit the inserted text since a title tends to use
1704 the same words as a node name but a useful description uses different
1705 words.@refill
1706
1707 @node Showing the Structure, Updating Nodes and Menus, Inserting, Texinfo Mode
1708 @comment  node-name,  next,  previous,  up
1709 @section Showing the Section Structure of a File
1710 @cindex Showing the section structure of a file
1711 @cindex Section structure of a file, showing it
1712 @cindex Structure of a file, showing it
1713 @cindex Outline of file structure, showing it
1714 @cindex Contents-like outline of file structure
1715 @cindex File section structure, showing it
1716 @cindex Texinfo file section structure, showing it
1717
1718 You can show the section structure of a Texinfo file by using the
1719 @kbd{C-c C-s} command (@code{texinfo-show-structure}).  This command
1720 shows the section structure of a Texinfo file by listing the lines
1721 that begin with the @@-commands for @code{@@chapter},
1722 @code{@@section}, and the like.  It constructs what amounts
1723 to a table of contents.  These lines are displayed in another buffer
1724 called the @samp{*Occur*} buffer.  In that buffer, you can position
1725 the cursor over one of the lines and use the @kbd{C-c C-c} command
1726 (@code{occur-mode-goto-occurrence}), to jump to the corresponding spot
1727 in the Texinfo file.@refill
1728
1729 @table @kbd
1730 @item  C-c C-s
1731 @itemx M-x texinfo-show-structure
1732 @findex texinfo-show-structure
1733 Show the @code{@@chapter}, @code{@@section}, and such lines of a
1734 Texinfo file.@refill
1735
1736 @item  C-c C-c
1737 @itemx M-x occur-mode-goto-occurrence
1738 @findex occur-mode-goto-occurrence
1739 Go to the line in the Texinfo file corresponding to the line under the
1740 cursor in the @file{*Occur*} buffer.@refill
1741 @end table
1742
1743 If you call @code{texinfo-show-structure} with a prefix argument by
1744 typing @w{@kbd{C-u C-c C-s}}, it will list not only those lines with the
1745 @@-commands for @code{@@chapter}, @code{@@section}, and the like,
1746 but also the @code{@@node} lines.  (This is how the
1747 @code{texinfo-show-structure} command worked without an argument in
1748 the first version of Texinfo.  It was changed because @code{@@node}
1749 lines clutter up the @samp{*Occur*} buffer and are usually not
1750 needed.)  You can use @code{texinfo-show-structure} with a prefix
1751 argument to check whether the `Next', `Previous', and `Up' pointers of
1752 an @code{@@node} line are correct.@refill
1753
1754 Often, when you are working on a manual, you will be interested only
1755 in the structure of the current chapter.  In this case, you can mark
1756 off the region of the buffer that you are interested in by using the
1757 @kbd{C-x n n} (@code{narrow-to-region}) command and
1758 @code{texinfo-show-structure} will work on only that region.  To see
1759 the whole buffer again, use @w{@kbd{C-x n w}} (@code{widen}).
1760 (@xref{Narrowing, , , emacs, The GNU Emacs Manual}, for more
1761 information about the narrowing commands.)@refill
1762
1763 @vindex page-delimiter
1764 @cindex Page delimiter in Texinfo mode
1765 In addition to providing the @code{texinfo-show-structure} command,
1766 Texinfo mode sets the value of the page delimiter variable to match
1767 the chapter-level @@-commands.  This enables you to use the @kbd{C-x
1768 ]} (@code{forward-page}) and @kbd{C-x [} (@code{backward-page})
1769 commands to move forward and backward by chapter, and to use the
1770 @kbd{C-x p} (@code{narrow-to-page}) command to narrow to a chapter.
1771 @xref{Pages, , , emacs, The GNU Emacs Manual}, for more information
1772 about the page commands.@refill
1773
1774 @node Updating Nodes and Menus, Info Formatting, Showing the Structure, Texinfo Mode
1775 @comment  node-name,  next,  previous,  up
1776 @section Updating Nodes and Menus
1777 @cindex Updating nodes and menus
1778 @cindex Create nodes, menus automatically
1779 @cindex Insert nodes, menus automatically
1780 @cindex Automatically insert nodes, menus
1781
1782 Texinfo mode provides commands for automatically creating or updating
1783 menus and node pointers.  The commands are called ``update'' commands
1784 because their most frequent use is for updating a Texinfo file after
1785 you have worked on it; but you can use them to insert the `Next',
1786 `Previous', and `Up' pointers into an @code{@@node} line that has none and to
1787 create menus in a file that has none.@refill
1788
1789 If you do not use the updating commands, you need to write menus and
1790 node pointers by hand, which is a tedious task.@refill
1791
1792 @menu
1793 * Updating Commands::           Five major updating commands.
1794 * Updating Requirements::       How to structure a Texinfo file for
1795                                   using the updating command.
1796 * Other Updating Commands::     How to indent descriptions, insert
1797                                   missing nodes lines, and update
1798                                   nodes in sequence.
1799 @end menu
1800
1801 @node Updating Commands, Updating Requirements, Updating Nodes and Menus, Updating Nodes and Menus
1802 @ifinfo
1803 @subheading The Updating Commands
1804 @end ifinfo
1805
1806 You can use the updating commands@refill
1807
1808 @itemize @bullet
1809 @item
1810 to insert or update the `Next', `Previous', and `Up' pointers of a
1811 node,@refill
1812
1813 @item
1814 to insert or update the menu for a section, and@refill
1815
1816 @item
1817 to create a master menu for a Texinfo source file.@refill
1818 @end itemize
1819
1820 You can also use the commands to update all the nodes and menus in a
1821 region or in a whole Texinfo file.@refill
1822
1823 The updating commands work only with conventional Texinfo files, which
1824 are structured hierarchically like books.  In such files, a structuring
1825 command line must follow closely after each @code{@@node} line, except
1826 for the `Top' @code{@@node} line.  (A @dfn{structuring command line} is
1827 a line beginning with @code{@@chapter}, @code{@@section}, or other
1828 similar command.)
1829
1830 You can write the structuring command line on the line that follows
1831 immediately after an @code{@@node} line or else on the line that
1832 follows after a single @code{@@comment} line or a single
1833 @code{@@ifinfo} line.  You cannot interpose more than one line between
1834 the @code{@@node} line and the structuring command line; and you may
1835 interpose only an @code{@@comment} line or an @code{@@ifinfo} line.
1836
1837 Commands which work on a whole buffer require that the `Top' node be
1838 followed by a node with an @code{@@chapter} or equivalent-level command.
1839 Note that the menu updating commands will not create a main or master
1840 menu for a Texinfo file that has only @code{@@chapter}-level nodes!  The
1841 menu updating commands only create menus @emph{within} nodes for lower level
1842 nodes.  To create a menu of chapters, you must provide a `Top'
1843 node.@refill
1844
1845 The menu updating commands remove menu entries that refer to other Info
1846 files since they do not refer to nodes within the current buffer.  This
1847 is a deficiency.  Rather than use menu entries, you can use cross
1848 references to refer to other Info files.  None of the updating commands
1849 affect cross references.@refill
1850
1851 Texinfo mode has five updating commands that are used most often: two
1852 are for updating the node pointers or menu of a single node (or a
1853 region); two are for updating every node pointer and menu in a file;
1854 and one, the @code{texinfo-master-menu} command, is for creating a
1855 master menu for a complete file, and optionally, for updating every
1856 node and menu in the whole Texinfo file.@refill
1857
1858 The @code{texinfo-master-menu} command is the primary command:@refill
1859
1860 @table @kbd
1861 @item C-c C-u m
1862 @itemx M-x texinfo-master-menu
1863 @findex texinfo-master-menu
1864 Create or update a master menu that includes all the other menus
1865 (incorporating the descriptions from pre-existing menus, if
1866 any).@refill
1867
1868 With an argument (prefix argument, @kbd{C-u,} if interactive), first create or
1869 update all the nodes and all the regular menus in the buffer before
1870 constructing the master menu.  (@xref{The Top Node, , The Top Node and
1871 Master Menu}, for more about a master menu.)@refill
1872
1873 For @code{texinfo-master-menu} to work, the Texinfo file must have a
1874 `Top' node and at least one subsequent node.@refill
1875
1876 After extensively editing a Texinfo file, you can type the following:
1877
1878 @example
1879 C-u M-x texinfo-master-menu
1880 @exdent or
1881 C-u C-c C-u m
1882 @end example
1883
1884 @noindent
1885 This updates all the nodes and menus completely and all at once.@refill
1886 @end table
1887
1888 The other major updating commands do smaller jobs and are designed for
1889 the person  who updates nodes and menus as he or she writes a Texinfo
1890 file.@refill
1891
1892 @need 1000
1893 The commands are:@refill
1894
1895 @table @kbd
1896 @item C-c C-u C-n
1897 @itemx M-x texinfo-update-node
1898 @findex texinfo-update-node
1899 Insert the `Next', `Previous', and `Up' pointers for the node that point is
1900 within (i.e., for the @code{@@node} line preceding point).  If the
1901 @code{@@node} line has pre-existing `Next', `Previous', or `Up'
1902 pointers in it, the old pointers are removed and new ones inserted.
1903 With an argument (prefix argument, @kbd{C-u}, if interactive), this command
1904 updates all @code{@@node} lines in the region (which is the text
1905 between point and mark).@refill
1906
1907 @item C-c C-u C-m
1908 @itemx M-x texinfo-make-menu
1909 @findex texinfo-make-menu
1910 Create or update the menu in the node that point is within.
1911 With an argument (@kbd{C-u} as prefix argument, if
1912 interactive), the command makes or updates menus for the
1913 nodes which are either within or a part of the
1914 region.@refill
1915
1916 Whenever @code{texinfo-make-menu} updates an existing menu, the
1917 descriptions from that menu are incorporated into the new menu.  This
1918 is done by copying descriptions from the existing menu to the entries
1919 in the new menu that have the same node names.  If the node names are
1920 different, the descriptions are not copied to the new menu.@refill
1921
1922 @item C-c C-u C-e
1923 @itemx M-x texinfo-every-node-update
1924 @findex texinfo-every-node-update
1925 Insert or update the `Next', `Previous', and `Up' pointers for every
1926 node in the buffer.@refill
1927
1928 @item C-c C-u C-a
1929 @itemx M-x texinfo-all-menus-update
1930 @findex texinfo-all-menus-update
1931 Create or update all the menus in the buffer.  With an argument
1932 (@kbd{C-u} as prefix argument, if interactive), first insert
1933 or update all the node
1934 pointers before working on the menus.@refill
1935
1936 If a master menu exists, the @code{texinfo-all-menus-update} command
1937 updates it; but the command does not create a new master menu if none
1938 already exists.  (Use the @code{texinfo-master-menu} command for
1939 that.)@refill
1940
1941 When working on a document that does not merit a master menu, you can
1942 type the following:
1943
1944 @example
1945 C-u C-c C-u C-a
1946 @exdent or
1947 C-u M-x texinfo-all-menus-update
1948 @end example
1949
1950 @noindent
1951 This updates all the nodes and menus.@refill
1952 @end table
1953
1954 The @code{texinfo-column-for-description} variable specifies the
1955 column to which menu descriptions are indented.  By default, the value
1956 is 32 although it is often useful to reduce it to as low as 24.  You
1957 can set the variable with the @kbd{M-x edit-options} command
1958 (@pxref{Edit Options, , Editing Variable Values, emacs, The GNU Emacs
1959 Manual}) or with the @kbd{M-x set-variable} command (@pxref{Examining,
1960 , Examining and Setting Variables, emacs, The GNU Emacs
1961 Manual}).@refill
1962
1963 Also, the @code{texinfo-indent-menu-description} command may be used to
1964 indent existing menu descriptions to a specified column.  Finally, if
1965 you wish, you can use the @code{texinfo-insert-node-lines} command to
1966 insert missing @code{@@node} lines into a file.  (@xref{Other Updating
1967 Commands}, for more information.)@refill
1968
1969 @node Updating Requirements, Other Updating Commands, Updating Commands, Updating Nodes and Menus
1970 @comment  node-name,  next,  previous,  up
1971 @subsection Updating Requirements
1972 @cindex Updating requirements
1973 @cindex Requirements for updating commands
1974
1975 To use the updating commands, you must organize the Texinfo file
1976 hierarchically with chapters, sections, subsections, and the like.
1977 When you construct the hierarchy of the manual, do not `jump down'
1978 more than one level at a time: you can follow the `Top' node with a
1979 chapter, but not with a section; you can follow a chapter with a
1980 section, but not with a subsection.  However, you may `jump up' any
1981 number of levels at one time---for example, from a subsection to a
1982 chapter.@refill
1983
1984 Each @code{@@node} line, with the exception of the line for the `Top'
1985 node, must be followed by a line with a structuring command such as
1986 @code{@@chapter}, @code{@@section}, or
1987 @code{@@unnumberedsubsec}.@refill
1988
1989 Each @code{@@node} line/structuring-command line combination
1990 must look either like this:@refill
1991
1992 @example
1993 @group
1994 @@node     Comments,  Minimum, Conventions, Overview
1995 @@comment  node-name, next,    previous,    up
1996 @@section Comments
1997 @end group
1998 @end example
1999
2000 or like this (without the @code{@@comment} line):
2001
2002 @example
2003 @group
2004 @@node Comments, Minimum, Conventions, Overview
2005 @@section Comments
2006 @end group
2007 @end example
2008
2009 @noindent
2010 In this example, `Comments' is the name of both the node and the
2011 section.  The next node is called `Minimum' and the previous node is
2012 called `Conventions'.  The `Comments' section is within the `Overview'
2013 node, which is specified by the `Up' pointer.  (Instead of an
2014 @code{@@comment} line, you can write an @code{@@ifinfo} line.)@refill
2015
2016 If a file has a `Top' node, it must be called @samp{top} or @samp{Top}
2017 and be the first node in the file.@refill
2018
2019 The menu updating commands create a menu of sections within a chapter,
2020 a menu of subsections within a section, and so on.  This means that
2021 you must have a `Top' node if you want a menu of chapters.@refill
2022
2023 Incidentally, the @code{makeinfo} command will create an Info file for
2024 a hierarchically organized Texinfo file that lacks `Next', `Previous'
2025 and `Up' pointers.  Thus, if you can be sure that your Texinfo file
2026 will be formatted with @code{makeinfo}, you have no need for the
2027 `update node' commands.  (@xref{Create an Info File, , Creating an
2028 Info File}, for more information about @code{makeinfo}.)  However,
2029 both @code{makeinfo} and the @code{texinfo-format-@dots{}} commands
2030 require that you insert menus in the file.@refill
2031
2032 @node Other Updating Commands, , Updating Requirements, Updating Nodes and Menus
2033 @comment  node-name,  next,  previous,  up
2034 @subsection Other Updating Commands
2035
2036 In addition to the five major updating commands, Texinfo mode
2037 possesses several less frequently used updating commands:@refill
2038
2039 @table @kbd
2040 @item M-x texinfo-insert-node-lines
2041 @findex texinfo-insert-node-lines
2042 Insert @code{@@node} lines before the @code{@@chapter},
2043 @code{@@section}, and other sectioning commands wherever they are
2044 missing throughout a region in a Texinfo file.@refill
2045
2046 With an argument (@kbd{C-u} as prefix argument, if interactive), the
2047 @code{texinfo-insert-node-lines} command not only inserts
2048 @code{@@node} lines but also inserts the chapter or section titles as
2049 the names of the corresponding nodes.  In addition, it inserts the
2050 titles as node names in pre-existing @code{@@node} lines that lack
2051 names.  Since node names should be more concise than section or
2052 chapter titles, you must manually edit node names so inserted.@refill
2053
2054 For example, the following marks a whole buffer as a region and inserts
2055 @code{@@node} lines and titles throughout:@refill
2056
2057 @example
2058 C-x h C-u M-x texinfo-insert-node-lines
2059 @end example
2060
2061 (Note that this command inserts titles as node names in @code{@@node}
2062 lines; the @code{texinfo-start-menu-description} command
2063 (@pxref{Inserting, Inserting Frequently Used Commands}) inserts titles
2064 as descriptions in menu entries, a different action.  However, in both
2065 cases, you need to edit the inserted text.)@refill
2066
2067 @item M-x texinfo-multiple-files-update
2068 @findex texinfo-multiple-files-update @r{(in brief)}
2069 Update nodes and menus in a document built from several separate files.
2070 With @kbd{C-u} as a prefix argument, create and insert a master menu in
2071 the outer file.  With a numeric prefix argument, such as @kbd{C-u 2}, first
2072 update all the menus and all the `Next', `Previous', and `Up' pointers
2073 of all the included files before creating and inserting a master menu in
2074 the outer file.  The @code{texinfo-multiple-files-update} command is
2075 described in the appendix on @code{@@include} files.
2076 @ifinfo
2077 @xref{texinfo-multiple-files-update}.@refill
2078 @end ifinfo
2079 @iftex
2080 @xref{texinfo-multiple-files-update, ,
2081 @code{texinfo-multiple-files-update}}.@refill
2082 @end iftex
2083
2084 @item M-x texinfo-indent-menu-description
2085 @findex texinfo-indent-menu-description
2086 Indent every description in the menu following point to the specified
2087 column.  You can use this command to give yourself more space for
2088 descriptions.  With an argument (@kbd{C-u} as prefix argument, if
2089 interactive), the @code{texinfo-indent-menu-description} command indents
2090 every description in every menu in the region.  However, this command
2091 does not indent the second and subsequent lines of a multi-line
2092 description.@refill
2093
2094 @item M-x texinfo-sequential-node-update
2095 @findex texinfo-sequential-node-update
2096 Insert the names of the nodes immediately following and preceding the
2097 current node as the `Next' or `Previous' pointers regardless of those
2098 nodes' hierarchical level.  This means that the `Next' node of a
2099 subsection may well be the next chapter.  Sequentially ordered nodes are
2100 useful for novels and other documents that you read through
2101 sequentially.  (However, in Info, the @code{g* @key{RET}} command lets
2102 you look through the file sequentially, so sequentially ordered nodes
2103 are not strictly necessary.)  With an argument (prefix argument, if
2104 interactive), the @code{texinfo-sequential-node-update} command
2105 sequentially updates all the nodes in the region.@refill
2106 @end table
2107
2108 @node Info Formatting, Printing, Updating Nodes and Menus, Texinfo Mode
2109 @comment  node-name,  next,  previous,  up
2110 @section Formatting for Info
2111 @cindex Formatting for Info
2112 @cindex Running an Info formatter
2113 @cindex Info formatting
2114
2115 Texinfo mode provides several commands for formatting part or all of a
2116 Texinfo file for Info.  Often, when you are writing a document, you
2117 want to format only part of a file---that is, a region.@refill
2118
2119 You can use either the @code{texinfo-format-region} or the
2120 @code{makeinfo-region} command to format a region:@refill
2121
2122 @table @kbd
2123 @findex texinfo-format-region
2124 @item  C-c C-e C-r
2125 @itemx M-x texinfo-format-region
2126 @itemx C-c C-m C-r
2127 @itemx M-x makeinfo-region
2128 Format the current region for Info.@refill
2129 @end table
2130
2131 You can use either the @code{texinfo-format-buffer} or the
2132 @code{makeinfo-buffer} command to format a whole buffer:@refill
2133
2134 @table @kbd
2135 @findex texinfo-format-buffer
2136 @item  C-c C-e C-b
2137 @itemx M-x texinfo-format-buffer
2138 @itemx C-c C-m C-b
2139 @itemx M-x makeinfo-buffer
2140 Format the current buffer for Info.@refill
2141 @end table
2142
2143 @need 1000
2144 For example, after writing a Texinfo file, you can type the following:
2145
2146 @example
2147 C-u C-c C-u m
2148 @exdent or
2149 C-u M-x texinfo-master-menu
2150 @end example
2151
2152 @noindent
2153 This updates all the nodes and menus.  Then type the following to create
2154 an Info file:
2155
2156 @example
2157 C-c C-m C-b
2158 @exdent or
2159 M-x makeinfo-buffer
2160 @end example
2161
2162 For @TeX{} or the Info formatting commands to work, the file @emph{must}
2163 include a line that has @code{@@setfilename} in its header.@refill
2164
2165 @xref{Create an Info File}, for details about Info formatting.@refill
2166
2167 @node Printing, Texinfo Mode Summary, Info Formatting, Texinfo Mode
2168 @comment node-name,  next,  previous,  up
2169 @section Formatting and Printing
2170 @cindex Formatting for printing
2171 @cindex Printing a region or buffer
2172 @cindex Region formatting and printing
2173 @cindex Buffer formatting and printing
2174 @cindex Part of file formatting and printing
2175
2176 Typesetting and printing a Texinfo file is a multi-step process in which
2177 you first create a file for printing (called a @sc{dvi} file), and then
2178 print the file.  Optionally, you may also create indices.  To do this,
2179 you must run the @code{texindex} command after first running the
2180 @code{tex} typesetting command; and then you must run the @code{tex}
2181 command again.  Or else run the @code{texi2dvi} command which
2182 automatically creates indices as needed.@refill
2183
2184 Often, when you are writing a document, you want to typeset and print
2185 only part of a file to see what it will look like.  You can use the
2186 @code{texinfo-tex-region} and related commands for this purpose.  Use
2187 the @code{texinfo-tex-buffer} command to format all of a
2188 buffer.@refill
2189
2190 @table @kbd
2191 @item  C-c C-t C-b
2192 @itemx M-x texinfo-tex-buffer
2193 @findex texinfo-tex-buffer
2194 Run @code{texi2dvi} on the buffer.  In addition to running @TeX{} on the
2195 buffer, this command automatically creates or updates indices as
2196 needed.@refill
2197
2198 @item  C-c C-t C-r
2199 @itemx M-x texinfo-tex-region
2200 @findex texinfo-tex-region
2201 Run @TeX{} on the region.@refill
2202
2203 @item C-c C-t C-i
2204 @itemx M-x texinfo-texindex
2205 Run @code{texindex} to sort the indices of a Texinfo file formatted with
2206 @code{texinfo-tex-region}.  The @code{texinfo-tex-region} command does
2207 not run @code{texindex} automatically; it only runs the @code{tex}
2208 typesetting command.  You must run the @code{texinfo-tex-region} command
2209 a second time after sorting the raw index files with the @code{texindex}
2210 command.  (Usually, you do not format an index when you format a region,
2211 only when you format a buffer.  Now that the @code{texi2dvi} command
2212 exists, there is no little need for this command.)@refill
2213
2214 @item C-c C-t C-p
2215 @itemx M-x texinfo-tex-print
2216 @findex texinfo-tex-print
2217 Print the file (or the part of the file) previously formatted with
2218 @code{texinfo-tex-buffer} or @code{texinfo-tex-region}.@refill
2219 @end table
2220
2221 For @code{texinfo-tex-region} or @code{texinfo-tex-buffer} to work, the
2222 file @emph{must} start with a @samp{\input texinfo} line and must
2223 include an @code{@@settitle} line.  The file must end with @code{@@bye}
2224 on a line by itself.  (When you use @code{texinfo-tex-region}, you must
2225 surround the @code{@@settitle} line with start-of-header and
2226 end-of-header lines.)@refill
2227
2228 @xref{Format/Print Hardcopy}, for a description of the other @TeX{} related
2229 commands, such as @code{tex-show-print-queue}.@refill
2230
2231 @node Texinfo Mode Summary, , Printing, Texinfo Mode
2232 @comment  node-name,  next,  previous,  up
2233 @section Texinfo Mode Summary
2234
2235 In Texinfo mode, each set of commands has default keybindings that
2236 begin with the same keys.  All the commands that are custom-created
2237 for Texinfo mode begin with @kbd{C-c}.  The keys are somewhat
2238 mnemonic.@refill
2239
2240 @subheading Insert Commands
2241
2242 The insert commands are invoked by typing @kbd{C-c} twice and then the
2243 first letter of the @@-command to be inserted.  (It might make more
2244 sense mnemonically to use @kbd{C-c C-i}, for `custom insert', but
2245 @kbd{C-c C-c} is quick to type.)@refill
2246
2247 @example
2248 C-c C-c c       @r{Insert} @samp{@@code}.
2249 C-c C-c d       @r{Insert} @samp{@@dfn}.
2250 C-c C-c e       @r{Insert} @samp{@@end}.
2251 C-c C-c i       @r{Insert} @samp{@@item}.
2252 C-c C-c n       @r{Insert} @samp{@@node}.
2253 C-c C-c s       @r{Insert} @samp{@@samp}.
2254 C-c C-c v       @r{Insert} @samp{@@var}.
2255 C-c C-c @{       @r{Insert braces.}
2256 C-c C-c ]
2257 C-c C-c @}       @r{Move out of enclosing braces.}
2258
2259 @group
2260 C-c C-c C-d     @r{Insert a node's section title}
2261                 @r{in the space for the description}
2262                 @r{in a menu entry line.}
2263 @end group
2264 @end example
2265
2266 @subheading Show Structure
2267
2268 The @code{texinfo-show-structure} command is often used within a
2269 narrowed region.@refill
2270
2271 @example
2272 C-c C-s         @r{List all the headings.}
2273 @end example
2274
2275 @subheading The Master Update Command
2276
2277 The @code{texinfo-master-menu} command creates a master menu; and can
2278 be used to update every node and menu in a file as well.@refill
2279
2280 @example
2281 @group
2282 C-c C-u m
2283 M-x texinfo-master-menu
2284                 @r{Create or update a master menu.}
2285 @end group
2286
2287 @group
2288 C-u C-c C-u m   @r{With @kbd{C-u} as a prefix argument, first}
2289                 @r{create or update all nodes and regular}
2290                 @r{menus, and then create a master menu.}
2291 @end group
2292 @end example
2293
2294 @subheading Update Pointers
2295
2296 The update pointer commands are invoked by typing @kbd{C-c C-u} and
2297 then either @kbd{C-n} for @code{texinfo-update-node} or @kbd{C-e} for
2298 @code{texinfo-every-node-update}.@refill
2299
2300 @example
2301 C-c C-u C-n     @r{Update a node.}
2302 C-c C-u C-e     @r{Update every node in the buffer.}
2303 @end example
2304
2305 @subheading Update Menus
2306
2307 Invoke the  update menu commands by typing @kbd{C-c C-u}
2308 and then either @kbd{C-m} for @code{texinfo-make-menu} or
2309 @kbd{C-a} for @code{texinfo-all-menus-update}.  To update
2310 both nodes and menus at the same time, precede @kbd{C-c C-u
2311 C-a} with @kbd{C-u}.@refill
2312
2313 @example
2314 C-c C-u C-m     @r{Make or update a menu.}
2315
2316 @group
2317 C-c C-u C-a     @r{Make or update all}
2318                 @r{menus in a buffer.}
2319 @end group
2320
2321 @group
2322 C-u C-c C-u C-a @r{With @kbd{C-u} as a prefix argument,}
2323                 @r{first create or update all nodes and}
2324                 @r{then create or update all menus.}
2325 @end group
2326 @end example
2327
2328 @subheading Format for Info
2329
2330 The Info formatting commands that are written in Emacs Lisp are
2331 invoked by typing @kbd{C-c C-e} and then either @kbd{C-r} for a region
2332 or @kbd{C-b} for the whole buffer.@refill
2333
2334 The Info formatting commands that are written in C and based on the
2335 @code{makeinfo} program are invoked by typing @kbd{C-c C-m} and then
2336 either @kbd{C-r} for a region or @kbd{C-b} for the whole buffer.@refill
2337
2338 @need 800
2339 @noindent
2340 Use the @code{texinfo-format@dots{}} commands:
2341
2342 @example
2343 @group
2344 C-c C-e C-r     @r{Format the region.}
2345 C-c C-e C-b     @r{Format the buffer.}
2346 @end group
2347 @end example
2348
2349 @need 750
2350 @noindent
2351 Use @code{makeinfo}:
2352
2353 @example
2354 C-c C-m C-r     @r{Format the region.}
2355 C-c C-m C-b     @r{Format the buffer.}
2356 C-c C-m C-l     @r{Recenter the @code{makeinfo} output buffer.}
2357 C-c C-m C-k     @r{Kill the @code{makeinfo} formatting job.}
2358 @end example
2359
2360 @subheading Typeset and Print
2361
2362 The @TeX{} typesetting and printing commands are invoked by typing
2363 @kbd{C-c C-t} and then another control command: @kbd{C-r} for
2364 @code{texinfo-tex-region}, @kbd{C-b} for @code{texinfo-tex-buffer},
2365 and so on.@refill
2366
2367 @example
2368 C-c C-t C-r     @r{Run @TeX{} on the region.}
2369 C-c C-t C-b     @r{Run} @code{texi2dvi} @r{on the buffer.}
2370 C-c C-t C-i     @r{Run} @code{texindex}.
2371 C-c C-t C-p     @r{Print the @sc{dvi} file.}
2372 C-c C-t C-q     @r{Show the print queue.}
2373 C-c C-t C-d     @r{Delete a job from the print queue.}
2374 C-c C-t C-k     @r{Kill the current @TeX{} formatting job.}
2375 C-c C-t C-x     @r{Quit a currently stopped @TeX{} formatting job.}
2376 C-c C-t C-l     @r{Recenter the output buffer.}
2377 @end example
2378
2379 @subheading Other Updating Commands
2380
2381 The `other updating commands' do not have standard keybindings because
2382 they are rarely used.
2383
2384 @example
2385 @group
2386 M-x texinfo-insert-node-lines
2387                 @r{Insert missing @code{@@node} lines in region.}
2388                 @r{With @kbd{C-u} as a prefix argument,}
2389                 @r{use section titles as node names.}
2390 @end group
2391
2392 @group
2393 M-x texinfo-multiple-files-update
2394                 @r{Update a multi-file document.}
2395                 @r{With @kbd{C-u 2} as a prefix argument,}
2396                 @r{create or update all nodes and menus}
2397                 @r{in all included files first.}
2398 @end group
2399
2400 @group
2401 M-x texinfo-indent-menu-description
2402                 @r{Indent descriptions.}
2403 @end group
2404
2405 @group
2406 M-x texinfo-sequential-node-update
2407                 @r{Insert node pointers in strict sequence.}
2408 @end group
2409 @end example
2410
2411 @node Beginning a File, Ending a File, Texinfo Mode, Top
2412 @comment  node-name,  next,  previous,  up
2413 @chapter Beginning a Texinfo File
2414 @cindex Beginning a Texinfo file
2415 @cindex Texinfo file beginning
2416 @cindex File beginning
2417
2418 Certain pieces of information must be provided at the beginning of a
2419 Texinfo file, such as the name of the file and the title of the
2420 document.@refill
2421
2422 @menu
2423 * Four Parts::                  Four parts begin a Texinfo file.
2424 * Sample Beginning::            Here is a sample beginning for a Texinfo file.
2425 * Header::                      The very beginning of a Texinfo file.
2426 * Info Summary and Permissions::  Summary and copying permissions for Info.
2427 * Titlepage & Copyright Page::  Creating the title and copyright pages.
2428 * The Top Node::                Creating the `Top' node and master menu.
2429 * Software Copying Permissions::  Ensure that you and others continue to
2430                                   have the right to use and share software.
2431 @end menu
2432
2433 @node Four Parts, Sample Beginning, Beginning a File, Beginning a File
2434 @ifinfo
2435 @heading Four Parts Begin a File
2436 @end ifinfo
2437
2438 Generally, the beginning of a Texinfo file has four parts:@refill
2439
2440 @enumerate
2441 @item
2442 The header, delimited by special comment lines, that includes the
2443 commands for naming the Texinfo file and telling @TeX{} what
2444 definitions' file to use when processing the Texinfo file.@refill
2445
2446 @item
2447 A short statement of what the file is about, with a copyright notice
2448 and copying permissions.  This is enclosed in @code{@@ifinfo} and
2449 @code{@@end ifinfo} commands so that the formatters place it only
2450 in the Info file.@refill
2451
2452 @item
2453 A title page and copyright page, with a copyright notice and copying
2454 permissions.  This is enclosed between @code{@@titlepage} and
2455 @code{@@end titlepage} commands.  The title and copyright page appear
2456 only in the printed @w{manual}.@refill
2457
2458 @item
2459 The `Top' node that contains a menu for the whole Info file.  The
2460 contents of this node appear only in the Info file.@refill
2461 @end enumerate
2462
2463 Also, optionally, you may include the copying conditions for a program
2464 and a warranty disclaimer.  The copying section will be followed by an
2465 introduction or else by the first chapter of the manual.@refill
2466
2467 Since the copyright notice and copying permissions for the Texinfo
2468 document (in contrast to the copying permissions for a program) are in
2469 parts that appear only in the Info file or only in the printed manual,
2470 this information must be given twice.@refill
2471
2472 @node Sample Beginning, Header, Four Parts, Beginning a File
2473 @comment  node-name,  next,  previous,  up
2474 @section Sample Texinfo File Beginning
2475
2476 The following sample shows what is needed.@refill
2477
2478 @example
2479 \input texinfo   @@c -*-texinfo-*-
2480 @@c %**start of header
2481 @@setfilename @var{name-of-info-file}
2482 @@settitle @var{name-of-manual}
2483 @@setchapternewpage odd
2484 @@c %**end of header
2485
2486 @@ifinfo
2487 This file documents @dots{}
2488
2489 Copyright @var{year} @var{copyright-owner}
2490
2491 @group
2492 Permission is granted to @dots{}
2493 @@end ifinfo
2494 @end group
2495
2496 @group
2497 @@c  This title page illustrates only one of the
2498 @@c  two methods of forming a title page.
2499 @end group
2500
2501 @group
2502 @@titlepage
2503 @@title @var{name-of-manual-when-printed}
2504 @@subtitle @var{subtitle-if-any}
2505 @@subtitle @var{second-subtitle}
2506 @@author @var{author}
2507 @end group
2508
2509 @group
2510 @@c  The following two commands
2511 @@c  start the copyright page.
2512 @@page
2513 @@vskip 0pt plus 1filll
2514 Copyright @@copyright@{@} @var{year} @var{copyright-owner}
2515 @end group
2516
2517 Published by @dots{}
2518
2519 Permission is granted to @dots{}
2520 @@end titlepage
2521
2522 @@node Top, Overview, (dir), (dir)
2523
2524 @@ifinfo
2525 This document describes @dots{}
2526
2527 This document applies to version @dots{}
2528 of the program named @dots{}
2529 @@end ifinfo
2530
2531 @group
2532 @@menu
2533 * Copying::          Your rights and freedoms.
2534 * First Chapter::    Getting started @dots{}
2535 * Second Chapter::              @dots{}
2536   @dots{}
2537   @dots{}
2538 @@end menu
2539 @end group
2540
2541 @group
2542 @@node    First Chapter, Second Chapter, top,      top
2543 @@comment node-name,     next,           previous, up
2544 @@chapter First Chapter
2545 @@cindex Index entry for First Chapter
2546 @end group
2547 @end example
2548
2549 @node Header, Info Summary and Permissions, Sample Beginning, Beginning a File
2550 @comment  node-name,  next,  previous,  up
2551 @section The Texinfo File Header
2552 @cindex Header for Texinfo files
2553 @cindex Texinfo file header
2554
2555 Texinfo files start with at least three lines that provide Info and
2556 @TeX{} with necessary information.  These are the @code{\input
2557 texinfo} line, the @code{@@settitle} line, and the
2558 @code{@@setfilename} line.  If you want to run @TeX{} on just a part
2559 of the Texinfo File, you must write the @code{@@settitle}
2560 and @code{@@setfilename} lines between start-of-header and end-of-header
2561 lines.@refill
2562
2563 Thus, the beginning of a Texinfo file looks like this:
2564
2565 @example
2566 @group
2567 \input texinfo   @@c -*-texinfo-*-
2568 @@setfilename sample.info
2569 @@settitle Sample Document
2570 @end group
2571 @end example
2572
2573 @noindent
2574 or else like this:
2575
2576 @example
2577 @group
2578 \input texinfo   @@c -*-texinfo-*-
2579 @@c %**start of header
2580 @@setfilename sample.info
2581 @@settitle Sample Document
2582 @@c %**end of header
2583 @end group
2584 @end example
2585
2586 @menu
2587 * First Line::                  The first line of a Texinfo file.
2588 * Start of Header::             Formatting a region requires this.
2589 * setfilename::                 Tell Info the name of the Info file.
2590 * settitle::                    Create a title for the printed work.
2591 * setchapternewpage::           Start chapters on right-hand pages.
2592 * paragraphindent::             An option to specify paragraph indentation.
2593 * End of Header::               Formatting a region requires this.
2594 @end menu
2595
2596 @node First Line, Start of Header, Header, Header
2597 @comment  node-name,  next,  previous,  up
2598 @subsection The First Line of a Texinfo File
2599 @cindex First line of a Texinfo file
2600 @cindex Beginning line of a Texinfo file
2601 @cindex Header of a Texinfo file
2602
2603 Every Texinfo file that is to be the top-level input to @TeX{} must begin
2604 with a line that looks like this:@refill
2605
2606 @example
2607 \input texinfo   @@c -*-texinfo-*-
2608 @end example
2609
2610 @noindent
2611 This line serves two functions:
2612
2613 @enumerate
2614 @item
2615 When the file is processed by @TeX{}, the @code{\input texinfo} command
2616 tells @TeX{} to load the macros needed for processing a Texinfo file.
2617 These are in a file called @file{texinfo.tex}, which is usually located
2618 in the @file{/usr/lib/tex/macros} directory.  @TeX{} uses the backslash,
2619 @samp{\}, to mark the beginning of a command, just as Texinfo uses
2620 @code{@@}.  The @file{texinfo.tex} file causes the switch from @samp{\}
2621 to @samp{@@}; before the switch occurs, @TeX{} requires @samp{\}, which
2622 is why it appears at the beginning of the file.@refill
2623
2624 @item
2625 When the file is edited in GNU Emacs, the @samp{-*-texinfo-*-} mode
2626 specification tells Emacs to use Texinfo mode.@refill
2627 @end enumerate
2628
2629 @node Start of Header, setfilename, First Line, Header
2630 @comment  node-name,  next,  previous,  up
2631 @subsection Start of Header
2632 @cindex Start of header line
2633
2634 Write a start-of-header line on the second line of a Texinfo file.
2635 Follow the start-of-header line with @code{@@setfilename} and
2636 @code{@@settitle} lines and, optionally, with other command lines, such
2637 as @code{@@smallbook} or @code{@@footnotestyle}; and then by an
2638 end-of-header line (@pxref{End of Header}).@refill
2639
2640 With these lines, you can format part of a Texinfo file for Info or
2641 typeset part for printing.@refill
2642
2643 A start-of-header line looks like this:@refill
2644
2645 @example
2646 @@c %**start of header
2647 @end example
2648
2649 The odd string of characters, @samp{%**}, is to ensure that no other
2650 comment is accidentally taken for a start-of-header line.@refill
2651
2652 @node setfilename, settitle, Start of Header, Header
2653 @comment  node-name,  next,  previous,  up
2654 @subsection @code{@@setfilename}
2655 @cindex Info file requires @code{@@setfilename}
2656 @findex setfilename
2657
2658 In order to serve as the primary input file for either @code{makeinfo}
2659 or @TeX{}, a Texinfo file must contain a line that looks like this:
2660
2661 @example
2662 @@setfilename @var{info-file-name}
2663 @end example
2664
2665 Write the @code{@@setfilename} command at the beginning of a line and
2666 follow it on the same line by the Info file name.  Do not write
2667 anything else on the line; anything on the line after the command is
2668 considered part of the file name, including a comment.@refill
2669
2670 The @code{@@setfilename} line specifies the name of the Info file to be
2671 generated.  This name should be different from the name of the Texinfo
2672 file.  There are two conventions for choosing the name: you can either
2673 remove the @samp{.tex} extension from the input file name, or replace it
2674 with the @samp{.info} extension.
2675
2676 Some operating systems cannot handle long file names.  You can run into
2677 a problem even when the file name you specify is itself short enough.
2678 This occurs because the Info formatters split a long Info file into
2679 short indirect subfiles, and name them by appending `-1', `-2', @dots{},
2680 `-10', `-11', and so on, to the original file name.  (@xref{Tag and
2681 Split Files, , Tag Files and Split Files}.)  The subfile name
2682 @file{texinfo.info-10}, for example, is too long for some systems; so
2683 the Info file name for this document is @file{texinfo} rather than
2684 @file{texinfo.info}.@refill
2685
2686 The Info formatting commands ignore everything written before the
2687 @code{@@setfilename} line, which is why the very first line of
2688 the file (the @code{\input} line) does not need to be commented out.
2689
2690 The @code{@@setfilename} line produces no output when you typeset a
2691 printed manual, but is does an essential job: it opens the index,
2692 cross-reference, and other auxiliary files used by Texinfo.
2693
2694 @node settitle, setchapternewpage, setfilename, Header
2695 @comment  node-name,  next,  previous,  up
2696 @subsection @code{@@settitle}
2697 @findex settitle
2698
2699 In order to be made into a printed manual, a Texinfo file must contain
2700 a line that looks like this:@refill
2701
2702 @example
2703 @@settitle @var{title}
2704 @end example
2705
2706 Write the @code{@@settitle} command at the beginning of a line and
2707 follow it on the same line by the title.  This tells @TeX{} the title
2708 to use in a header or footer.  Do not write anything else on the line;
2709 anything on the line after the command is considered part of the
2710 title, including a comment.@refill
2711
2712 Conventionally, when @TeX{} formats a Texinfo file for double-sided
2713 output, the title is printed in the left-hand (even-numbered) page
2714 headings and the current chapter title is printed in the right-hand
2715 (odd-numbered) page headings.  (@TeX{} learns the title of each chapter
2716 from each @code{@@chapter} command.)  Page footers are not
2717 printed.@refill
2718
2719 Even if you are printing in a single-sided style, @TeX{} looks for an
2720 @code{@@settitle} command line, in case you include the manual title
2721 in the heading. @refill
2722
2723 The @code{@@settitle} command should precede everything that generates
2724 actual output in @TeX{}.@refill
2725
2726 Although the title in the @code{@@settitle} command is usually the
2727 same as the title on the title page, it does not affect the title as
2728 it appears on the title page.  Thus, the two do not need not match
2729 exactly;  and the title in the @code{@@settitle} command can be a
2730 shortened or expanded version of the title as it appears on the title
2731 page. (@xref{titlepage, , @code{@@titlepage}}.)@refill
2732
2733 @TeX{} prints page headings only for that text that comes after the
2734 @code{@@end titlepage} command in the Texinfo file, or that comes
2735 after an @code{@@headings} command that turns on headings.
2736 (@xref{headings on off, , The @code{@@headings} Command}, for more
2737 information.)@refill
2738
2739 You may, if you wish, create your own, customized headings and
2740 footings.  @xref{Headings, , Page Headings}, for a detailed discussion
2741 of this process.@refill
2742
2743 @node setchapternewpage, paragraphindent, settitle, Header
2744 @comment  node-name,  next,  previous,  up
2745 @subsection @code{@@setchapternewpage}
2746 @cindex Starting chapters
2747 @cindex Pages, starting odd
2748 @findex setchapternewpage
2749
2750 In a book or a manual, text is usually printed on both sides of the
2751 paper, chapters start on right-hand pages, and right-hand pages have
2752 odd numbers.  But in short reports, text often is printed only on one
2753 side of the paper.  Also in short reports, chapters sometimes do not
2754 start on new pages, but are printed on the same page as the end of the
2755 preceding chapter, after a small amount of vertical whitespace.@refill
2756
2757 You can use the @code{@@setchapternewpage} command with various
2758 arguments to specify how @TeX{} should start chapters and whether it
2759 should typeset pages for printing on one or both sides of the paper
2760 (single-sided or double-sided printing).@refill
2761
2762 Write the @code{@@setchapternewpage} command at the beginning of a
2763 line followed by its argument.@refill
2764
2765 For example, you would write the following to cause each chapter to
2766 start on a fresh odd-numbered page:@refill
2767
2768 @example
2769 @@setchapternewpage odd
2770 @end example
2771
2772 You can specify one of three alternatives with the
2773 @code{@@setchapternewpage} command:@refill
2774
2775 @table @asis
2776 @ignore
2777 @item No @code{@@setchapternewpage} command
2778 If the Texinfo file does not contain an @code{@@setchapternewpage}
2779 command before the @code{@@titlepage} command, @TeX{} automatically
2780 begins chapters on new pages and prints headings in the standard
2781 format for single-sided printing.  This is the conventional format for
2782 single-sided printing.@refill
2783
2784 The result is exactly the same as when you write
2785 @code{@@setchapternewpage on}.@refill
2786 @end ignore
2787 @item @code{@@setchapternewpage off}
2788 Cause @TeX{} to typeset a new chapter on the same page as the last
2789 chapter, after skipping some vertical whitespace.  Also, cause @TeX{} to
2790 format page headers for single-sided printing. (You can override the
2791 headers format with the @code{@@headings double} command; see
2792 @ref{headings on off, , The @code{@@headings} Command}.)@refill
2793
2794 @item @code{@@setchapternewpage on}
2795 Cause @TeX{} to start new chapters on new pages and to typeset page
2796 headers for single-sided printing.  This is the form most often
2797 used for short reports.@refill
2798
2799 This alternative is the default.@refill
2800
2801 @item @code{@@setchapternewpage odd}
2802 Cause @TeX{} to start new chapters on new, odd-numbered pages
2803 (right-handed pages) and to typeset for double-sided printing.  This is
2804 the form most often used for books and manuals.@refill
2805 @end table
2806
2807 @noindent
2808 Texinfo does not have an @code{@@setchapternewpage even} command.@refill
2809
2810 @noindent
2811 (You can countermand or modify an @code{@@setchapternewpage} command
2812 with an @code{@@headings} command.  @xref{headings on off, , The
2813 @code{@@headings} Command}.)@refill
2814
2815 At the beginning of a manual or book, pages are not numbered---for
2816 example, the title and copyright pages of a book are not numbered.
2817 By convention, table of contents pages are numbered with roman
2818 numerals and not in sequence with the rest of the document.@refill
2819
2820 Since an Info file does not have pages, the @code{@@setchapternewpage}
2821 command has no effect on it.@refill
2822
2823 Usually, you do not write an @code{@@setchapternewpage} command for
2824 single-sided printing, but accept the default which is to typeset for
2825 single-sided printing and to start new chapters on new pages.  Usually,
2826 you write an @code{@@setchapternewpage odd} command for double-sided
2827 printing.@refill
2828
2829 @node paragraphindent, End of Header, setchapternewpage, Header
2830 @comment  node-name,  next,  previous,  up
2831 @subsection Paragraph Indenting
2832 @cindex Indenting paragraphs
2833 @cindex Paragraph indentation
2834 @findex paragraphindent
2835
2836 The Info formatting commands may insert spaces at the beginning of the
2837 first line of each paragraph, thereby indenting that paragraph.  You
2838 can use the @code{@@paragraphindent} command to specify the
2839 indentation.  Write an @code{@@paragraphindent} command at the
2840 beginning of a line followed by either @samp{asis} or a number.  The
2841 template is:@refill
2842
2843 @example
2844 @@paragraphindent @var{indent}
2845 @end example
2846
2847 The Info formatting commands indent according to the value of
2848 @var{indent}:@refill
2849
2850 @itemize @bullet
2851 @item
2852 If the value of @var{indent} is @samp{asis}, the Info formatting
2853 commands do not change the existing indentation.@refill
2854
2855 @item
2856 If the value of @var{indent} is 0, the Info formatting commands delete
2857 existing indentation.@refill
2858
2859 @item
2860 If the value of @var{indent} is greater than 0, the Info formatting
2861 commands indent the paragraph by that number of spaces.@refill
2862 @end itemize
2863
2864 The default value of @var{indent} is @samp{asis}.@refill
2865
2866 Write the @code{@@paragraphindent} command before or shortly after the
2867 end-of-header line at the beginning of a Texinfo file.  (If you write
2868 the command between the start-of-header and end-of-header lines, the
2869 region formatting commands indent paragraphs as specified.)@refill
2870
2871 A peculiarity of the @code{texinfo-format-buffer} and
2872 @code{texinfo-format-region} commands is that they do not indent (nor
2873 fill) paragraphs that contain @code{@@w} or @code{@@*} commands.
2874 @xref{Refilling Paragraphs}, for a detailed description of what goes
2875 on.@refill
2876
2877 @node End of Header, , paragraphindent, Header
2878 @comment  node-name,  next,  previous,  up
2879 @subsection End of Header
2880 @cindex End of header line
2881
2882 Follow the header lines with an @w{end-of-header} line.
2883 An end-of-header line looks like this:@refill
2884
2885 @example
2886 @@c %**end of header
2887 @end example
2888
2889 If you include the @code{@@setchapternewpage} command between the
2890 start-of-header and end-of-header lines, @TeX{} will typeset a region as
2891 that command specifies.  Similarly, if you include an @code{@@smallbook}
2892 command between the start-of-header and end-of-header lines, @TeX{} will
2893 typeset a region in the ``small'' book format.@refill
2894
2895 @ifinfo
2896 The reason for the odd string of characters (@samp{%**}) is so that the
2897 @code{texinfo-tex-region} command does not accidentally find
2898 something that it should not when it is looking for the header.@refill
2899
2900 The start-of-header line and the end-of-header line are Texinfo mode
2901 variables that you can change.@refill
2902 @end ifinfo
2903
2904 @iftex
2905 @xref{Start of Header}.
2906 @end iftex
2907
2908 @node Info Summary and Permissions, Titlepage & Copyright Page, Header, Beginning a File
2909 @comment  node-name,  next,  previous,  up
2910 @section Summary and Copying Permissions for Info
2911
2912 The title page and the copyright page appear only in the printed copy of
2913 the manual; therefore, the same information must be inserted in a
2914 section that appears only in the Info file.  This section usually
2915 contains a brief description of the contents of the Info file, a
2916 copyright notice, and copying permissions.@refill
2917
2918 The copyright notice should read:@refill
2919
2920 @example
2921 Copyright @var{year} @var{copyright-owner}
2922 @end example
2923
2924 @noindent
2925 and be put on a line by itself.@refill
2926
2927 Standard text for the copyright permissions is contained in an appendix
2928 to this manual; see @ref{ifinfo Permissions, , @samp{ifinfo} Copying
2929 Permissions}, for the complete text.@refill
2930
2931 The permissions text appears in an Info file @emph{before} the first
2932 node.  This mean that a reader does @emph{not} see this text when
2933 reading the file using Info, except when using the advanced Info command
2934 @kbd{g *}.
2935
2936 @node Titlepage & Copyright Page, The Top Node, Info Summary and Permissions, Beginning a File
2937 @comment  node-name,  next,  previous,  up
2938 @section The Title and Copyright Pages
2939
2940 A manual's name and author are usually printed on a title page.
2941 Sometimes copyright information is printed on the title page as well;
2942 more often, copyright information is printed on the back of the title
2943 page.
2944
2945 The title and copyright pages appear in the printed manual, but not in the
2946 Info file.  Because of this, it is possible to use several slightly
2947 obscure @TeX{} typesetting commands that cannot be used in an Info file.
2948 In addition, this part of the beginning of a Texinfo file contains the text
2949 of the copying permissions that will appear in the printed manual.@refill
2950
2951 @xref{Titlepage Permissions, , Titlepage Copying Permissions}, for the
2952 standard text for the copyright permissions.@refill
2953
2954 @menu
2955 * titlepage::                   Create a title for the printed document.
2956 * titlefont center sp::         The @code{@@titlefont}, @code{@@center},
2957                                   and @code{@@sp} commands.
2958 * title subtitle author::       The @code{@@title}, @code{@@subtitle},
2959                                   and @code{@@author} commands.
2960 * Copyright & Permissions::     How to write the copyright notice and
2961                                   include copying permissions.
2962 * end titlepage::               Turn on page headings after the title and
2963                                   copyright pages.
2964 * headings on off::             An option for turning headings on and off
2965                                   and double or single sided printing.
2966 @end menu
2967
2968 @node titlepage, titlefont center sp, Titlepage & Copyright Page, Titlepage & Copyright Page
2969 @comment  node-name,  next,  previous,  up
2970 @subsection @code{@@titlepage}
2971 @cindex Title page
2972 @findex titlepage
2973
2974 Start the material for the title page and following copyright page
2975 with @code{@@titlepage} on a line by itself and end it with
2976 @code{@@end titlepage} on a line by itself.@refill
2977
2978 The @code{@@end titlepage} command starts a new page and turns on page
2979 numbering.  (@xref{Headings, , Page Headings}, for details about how to
2980 generate page headings.)  All the material that you want to
2981 appear on unnumbered pages should be put between the
2982 @code{@@titlepage} and @code{@@end titlepage} commands.  By using the
2983 @code{@@page} command you can force a page break within the region
2984 delineated by the @code{@@titlepage} and @code{@@end titlepage}
2985 commands and thereby create more than one unnumbered page.  This is
2986 how the copyright page is produced.  (The @code{@@titlepage} command
2987 might perhaps have been better named the
2988 @code{@@titleandadditionalpages} command, but that would have been
2989 rather long!)@refill
2990
2991 @c !!! append refill to footnote when makeinfo can handle it.
2992 When you write a manual about a computer program, you should write the
2993 version of the program to which the manual applies on the title
2994 page.  If the manual changes more frequently than the program or is
2995 independent of it, you should also include an edition
2996 number@footnote{We have found that it is helpful to refer to versions
2997 of manuals as `editions' and versions of programs as `versions';
2998 otherwise, we find we are liable to confuse each other in conversation
2999 by referring to both the documentation and the software with the same
3000 words.} for the manual.  This helps readers keep track of which manual
3001 is for which version of the program.  (The `Top' node
3002 should also contain this information; see @ref{makeinfo top, ,
3003 @code{@@top}}.)@refill
3004
3005 Texinfo provides two main methods for creating a title page.  One method
3006 uses the @code{@@titlefont}, @code{@@sp}, and @code{@@center} commands
3007 to generate a title page in which the words on the page are
3008 centered.@refill
3009
3010 The second method uses the @code{@@title}, @code{@@subtitle}, and
3011 @code{@@author} commands to create a title page with black rules under
3012 the title and author lines and the subtitle text set flush to the
3013 right hand side of the page.  With this method, you do not specify any
3014 of the actual formatting of the title page.  You specify the text
3015 you want, and Texinfo does the formatting.  You may use either
3016 method.@refill
3017
3018 @findex shorttitlepage
3019 For extremely simple applications, Texinfo also provides a command
3020 @code{@@shorttitlepage} which takes a single argument as the title.
3021 The argument is typeset on a page by itself and followed by a blank
3022 page.
3023
3024
3025 @node titlefont center sp, title subtitle author, titlepage, Titlepage & Copyright Page
3026 @comment  node-name,  next,  previous,  up
3027 @subsection @code{@@titlefont}, @code{@@center}, and @code{@@sp}
3028 @findex titlefont
3029 @findex center
3030 @findex sp @r{(titlepage line spacing)}
3031
3032 You can use the @code{@@titlefont}, @code{@@sp}, and @code{@@center}
3033 commands to create a title page for a printed document.  (This is the
3034 first of the two methods for creating a title page in Texinfo.)@refill
3035
3036 Use the @code{@@titlefont} command to select a large font suitable for
3037 the title itself.@refill
3038
3039 @need 700
3040 For example:
3041
3042 @example
3043 @@titlefont@{Texinfo@}
3044 @end example
3045
3046 Use the @code{@@center} command at the beginning of a line to center
3047 the remaining text on that line.  Thus,@refill
3048
3049 @example
3050 @@center @@titlefont@{Texinfo@}
3051 @end example
3052
3053 @noindent
3054 centers the title, which in this example is ``Texinfo'' printed
3055 in the title font.@refill
3056
3057 Use the @code{@@sp} command to insert vertical space.  For example:@refill
3058
3059 @example
3060 @@sp 2
3061 @end example
3062
3063 @noindent
3064 This inserts two blank lines on the printed page.  (@xref{sp, ,
3065 @code{@@sp}}, for more information about the @code{@@sp}
3066 command.)@refill
3067
3068 A template for this method looks like this:@refill
3069
3070 @example
3071 @group
3072 @@titlepage
3073 @@sp 10
3074 @@center @@titlefont@{@var{name-of-manual-when-printed}@}
3075 @@sp 2
3076 @@center @var{subtitle-if-any}
3077 @@sp 2
3078 @@center @var{author}
3079 @dots{}
3080 @@end titlepage
3081 @end group
3082 @end example
3083
3084 The spacing of the example fits an 8 1/2 by 11 inch manual.@refill
3085
3086 @node title subtitle author, Copyright & Permissions, titlefont center sp, Titlepage & Copyright Page
3087 @comment  node-name,  next,  previous,  up
3088 @subsection @code{@@title}, @code{@@subtitle}, and @code{@@author}
3089 @findex title
3090 @findex subtitle
3091 @findex author
3092
3093 You can use the @code{@@title}, @code{@@subtitle}, and @code{@@author}
3094 commands to create a title page in which the vertical and horizontal
3095 spacing is done for you automatically.  This contrasts with the method
3096 described in
3097 the previous section, in which the @code{@@sp} command is needed to
3098 adjust vertical spacing.@refill
3099
3100 Write the @code{@@title}, @code{@@subtitle}, or @code{@@author}
3101 commands at the beginning of a line followed by the title, subtitle,
3102 or author.@refill
3103
3104 The @code{@@title} command produces a line in which the title is set
3105 flush to the left-hand side of the page in a larger than normal font.
3106 The title is underlined with a black rule.@refill
3107
3108 The @code{@@subtitle} command sets subtitles in a normal-sized font
3109 flush to the right-hand side of the page.@refill
3110
3111 The @code{@@author} command sets the names of the author or authors in
3112 a middle-sized font flush to the left-hand side of the page on a line
3113 near the bottom of the title page.  The names are underlined with a
3114 black rule that is thinner than the rule that underlines the title.
3115 (The black rule only occurs if the @code{@@author} command line is
3116 followed by an @code{@@page} command line.)@refill
3117
3118 There are two ways to use the @code{@@author} command: you can write
3119 the name or names on the remaining part of the line that starts with
3120 an @code{@@author} command:@refill
3121
3122 @example
3123 @@author by Jane Smith and John Doe
3124 @end example
3125
3126 @noindent
3127 or you can write the names one above each other by using two (or more)
3128 @code{@@author} commands:@refill
3129
3130 @example
3131 @group
3132 @@author Jane Smith
3133 @@author John Doe
3134 @end group
3135 @end example
3136
3137 @noindent
3138 (Only the bottom name is underlined with a black rule.)@refill
3139
3140 @need 950
3141 A template for this method looks like this:@refill
3142
3143 @example
3144 @group
3145 @@titlepage
3146 @@title @var{name-of-manual-when-printed}
3147 @@subtitle @var{subtitle-if-any}
3148 @@subtitle @var{second-subtitle}
3149 @@author @var{author}
3150 @@page
3151 @dots{}
3152 @@end titlepage
3153 @end group
3154 @end example
3155
3156 @ifinfo
3157 @noindent
3158 Contrast this form with the form of a title page written using the
3159 @code{@@sp}, @code{@@center}, and @code{@@titlefont} commands:@refill
3160
3161 @example
3162 @@titlepage
3163 @@sp 10
3164 @@center @@titlefont@{Name of Manual When Printed@}
3165 @@sp 2
3166 @@center Subtitle, If Any
3167 @@sp 1
3168 @@center Second subtitle
3169 @@sp 2
3170 @@center Author
3171 @@page
3172 @dots{}
3173 @@end titlepage
3174 @end example
3175 @end ifinfo
3176
3177 @node Copyright & Permissions, end titlepage, title subtitle author, Titlepage & Copyright Page
3178 @comment  node-name,  next,  previous,  up
3179 @subsection Copyright Page and Permissions
3180 @cindex Copyright page
3181 @cindex Printed permissions
3182 @cindex Permissions, printed
3183
3184 By international treaty, the copyright notice for a book should be
3185 either on the title page or on the back of the title page.  The
3186 copyright notice should include the year followed by the name of the
3187 organization or person who owns the copyright.@refill
3188
3189 When the copyright notice is on the back of the title page, that page
3190 is customarily not numbered.  Therefore, in Texinfo, the information
3191 on the copyright page should be within @code{@@titlepage} and
3192 @code{@@end titlepage} commands.@refill
3193
3194 @findex vskip
3195 @findex filll
3196 @cindex Vertical whitespace (@samp{vskip})
3197 Use the @code{@@page} command to cause a page break.  To push the
3198 copyright notice and the other text on the copyright page towards the
3199 bottom of the page, you can write a somewhat mysterious line after the
3200 @code{@@page} command that reads like this:@refill
3201
3202 @example
3203 @@vskip 0pt plus 1filll
3204 @end example
3205
3206 @noindent
3207 This is a @TeX{} command that is not supported by the Info formatting
3208 commands.  The @code{@@vskip} command inserts whitespace.  The
3209 @samp{0pt plus 1filll} means to put in zero points of mandatory whitespace,
3210 and as much optional whitespace as needed to push the
3211 following text to the bottom of the page.  Note the use of three
3212 @samp{l}s in the word @samp{filll}; this is the correct usage in
3213 @TeX{}.@refill
3214
3215 @findex copyright
3216 In a printed manual, the @code{@@copyright@{@}} command generates a
3217 @samp{c} inside a circle.  (In Info, it generates @samp{(C)}.)  The
3218 copyright notice itself has the following legally defined sequence:@refill
3219
3220 @example
3221 Copyright @copyright{} @var{year} @var{copyright-owner}
3222 @end example
3223
3224 It is customary to put information on how to get a manual after the
3225 copyright notice, followed by the copying permissions for the
3226 manual.@refill
3227
3228 Note that permissions must be given here as well as in the summary
3229 segment within @code{@@ifinfo} and @code{@@end ifinfo} that
3230 immediately follows the header since this text appears only in the
3231 printed manual and the @samp{ifinfo} text appears only in the Info
3232 file.@refill
3233
3234 @xref{Sample Permissions}, for the standard text.@refill
3235
3236 @node end titlepage, headings on off, Copyright & Permissions, Titlepage & Copyright Page
3237 @comment  node-name,  next,  previous,  up
3238 @subsection Heading Generation
3239 @findex end titlepage
3240 @cindex Headings, page, begin to appear
3241 @cindex Titlepage end starts headings
3242 @cindex End titlepage starts headings
3243
3244 An @code{@@end titlepage} command on a line by itself not only marks
3245 the end of the title and copyright pages, but also causes @TeX{} to start
3246 generating page headings and page numbers.
3247
3248 To repeat what is said elsewhere,  Texinfo has two standard page heading
3249 formats, one for documents which are printed on one side of each sheet of paper
3250 (single-sided printing), and the other for documents which are printed on both
3251 sides of each sheet (double-sided printing).
3252 (@xref{setchapternewpage, ,@code{@@setchapternewpage}}.)
3253 You can specify these formats in different ways:@refill
3254
3255 @itemize @bullet
3256 @item
3257 The conventional way is to write an @code{@@setchapternewpage} command
3258 before the title page commands, and then have the @code{@@end
3259 titlepage} command start generating page headings in the manner desired.
3260 (@xref{setchapternewpage, , @code{@@setchapternewpage}}.)@refill
3261
3262 @item
3263 Alternatively, you can use the @code{@@headings} command to prevent page
3264 headings from being generated or to start them for either single or
3265 double-sided printing.  (Write an @code{@@headings} command immediately
3266 after the @code{@@end titlepage} command.  @xref{headings on off, , The
3267 @code{@@headings} Command}, for more information.)@refill
3268
3269 @item
3270 Or, you may specify your own page heading and footing format.
3271 @xref{Headings, , Page Headings}, for detailed
3272 information about page headings and footings.@refill
3273 @end itemize
3274
3275 Most documents are formatted with the standard single-sided or
3276 double-sided format, using @code{@@setchapternewpage odd} for
3277 double-sided printing and no @code{@@setchapternewpage} command for
3278 single-sided printing.@refill
3279
3280 @node headings on off, , end titlepage, Titlepage & Copyright Page
3281 @comment  node-name,  next,  previous,  up
3282 @subsection The @code{@@headings} Command
3283 @findex headings
3284
3285 The @code{@@headings} command is rarely used.  It specifies what kind of
3286 page headings and footings to print on each page.  Usually, this is
3287 controlled by the @code{@@setchapternewpage} command.  You need the
3288 @code{@@headings} command only if the @code{@@setchapternewpage} command
3289 does not do what you want, or if you want to turn off pre-defined page
3290 headings prior to defining your own.  Write an @code{@@headings} command
3291 immediately after the @code{@@end titlepage} command.@refill
3292
3293 You can use @code{@@headings} as follows:@refill
3294
3295 @table @code
3296 @item @@headings off
3297 Turn off printing of page headings.@refill
3298
3299 @item @@headings single
3300 Turn on page headings appropriate for single-sided printing.
3301 @refill
3302
3303 @item @@headings double
3304 Turn on page headings appropriate for double-sided printing.  The two
3305 commands, @code{@@headings on} and @code{@@headings double}, are
3306 synonymous.@refill
3307
3308 @item @@headings singleafter
3309 @itemx @@headings doubleafter
3310 Turn on @code{single} or @code{double} headings, respectively, after the
3311 current page is output.
3312
3313 @item @@headings on
3314 Turn on page headings: @code{single} if @samp{@@setchapternewpage
3315 on}, @code{double} otherwise.
3316 @end table
3317
3318 For example, suppose you write @code{@@setchapternewpage off} before the
3319 @code{@@titlepage} command to tell @TeX{} to start a new chapter on the
3320 same page as the end of the last chapter.  This command also causes
3321 @TeX{} to typeset page headers for single-sided printing.  To cause
3322 @TeX{} to typeset for double sided printing, write @code{@@headings
3323 double} after the @code{@@end titlepage} command.
3324
3325 You can stop @TeX{} from generating any page headings at all by
3326 writing @code{@@headings off} on a line of its own immediately after the
3327 line containing the @code{@@end titlepage} command, like this:@refill
3328
3329 @example
3330 @@end titlepage
3331 @@headings off
3332 @end example
3333
3334 @noindent
3335 The @code{@@headings off} command overrides the @code{@@end titlepage}
3336 command, which would otherwise cause @TeX{} to print page
3337 headings.@refill
3338
3339 You can also specify your own style of page heading and footing.
3340 @xref{Headings, , Page Headings}, for more information.@refill
3341
3342 @node The Top Node, Software Copying Permissions, Titlepage & Copyright Page, Beginning a File
3343 @comment  node-name,  next,  previous,  up
3344 @section The `Top' Node and Master Menu
3345 @cindex @samp{@r{Top}} node
3346 @cindex Master menu
3347 @cindex Node, `Top'
3348
3349 The `Top' node is the node from which you enter an Info file.@refill
3350
3351 A `Top' node should contain a brief description of the Info file and an
3352 extensive, master menu for the whole Info file.
3353 This helps the reader understand what the Info file is
3354 about.  Also, you should write the version number of the program to
3355 which the Info file applies; or, at least, the edition number.@refill
3356
3357 The contents of the `Top' node should appear only in the Info file; none
3358 of it should appear in printed output, so enclose it between
3359 @code{@@ifinfo} and @code{@@end ifinfo} commands.  (@TeX{} does not
3360 print either an @code{@@node} line or a menu; they appear only in Info;
3361 strictly speaking, you are not required to enclose these parts between
3362 @code{@@ifinfo} and @code{@@end ifinfo}, but it is simplest to do so.
3363 @xref{Conditionals, , Conditionally Visible Text}.)@refill
3364
3365 @menu
3366 * Title of Top Node::           Sketch what the file is about.
3367 * Master Menu Parts::           A master menu has three or more parts.
3368 @end menu
3369
3370 @node Title of Top Node, Master Menu Parts, The Top Node, The Top Node
3371 @ifinfo
3372 @subheading `Top' Node Title
3373 @end ifinfo
3374
3375 Sometimes, you will want to place an @code{@@top} sectioning command
3376 line containing the title of the document immediately after the
3377 @code{@@node Top} line (@pxref{makeinfo top command, , The @code{@@top}
3378 Sectioning Command}, for more information).@refill
3379
3380 For example, the beginning of the Top node of this manual contains an
3381 @code{@@top} sectioning command, a short description, and edition and
3382 version information.  It looks like this:@refill
3383
3384 @example
3385 @group
3386 @dots{}
3387 @@end titlepage
3388
3389 @@ifinfo
3390 @@node Top, Copying, (dir), (dir)
3391 @@top Texinfo
3392
3393 Texinfo is a documentation system@dots{}
3394 @end group
3395
3396 @group
3397 This is edition@dots{}
3398 @dots{}
3399 @@end ifinfo
3400 @end group
3401
3402 @group
3403 @@menu
3404 * Copying::                 Texinfo is freely
3405                               redistributable.
3406 * Overview::                What is Texinfo?
3407 @dots{}
3408 @end group
3409 @@end menu
3410 @end example
3411
3412 In a `Top' node, the `Previous', and `Up' nodes usually refer to the top
3413 level directory of the whole Info system, which is called @samp{(dir)}.
3414 The `Next' node refers to the first node that follows the main or master
3415 menu, which is usually the copying permissions, introduction, or first
3416 chapter.@refill
3417
3418 @node Master Menu Parts, , Title of Top Node, The Top Node
3419 @subsection Parts of a Master Menu
3420 @cindex Master menu parts
3421 @cindex Parts of a master menu
3422
3423 A @dfn{master menu} is a detailed main menu listing all the nodes in a
3424 file.
3425
3426 A master menu is enclosed in @code{@@menu} and @code{@@end menu}
3427 commands and does not appear in the printed document.@refill
3428
3429 Generally, a master menu is divided into parts.@refill
3430
3431 @itemize @bullet
3432 @item
3433 The first part contains the major nodes in the Texinfo file: the nodes
3434 for the chapters, chapter-like sections, and the appendices.@refill
3435
3436 @item
3437 The second part contains nodes for the indices.@refill
3438
3439 @item
3440 The third and subsequent parts contain a listing of the other, lower
3441 level nodes, often ordered by chapter.  This way, rather than go
3442 through an intermediary menu, an inquirer can go directly to a
3443 particular node when searching for specific information.  These menu
3444 items are not required; add them if you think they are a
3445 convenience.  If you do use them, put @code{@@detailmenu} before the
3446 first one, and @code{@@end detailmenu} after the last; otherwise,
3447 @code{makeinfo} will get confused.
3448 @end itemize
3449
3450 Each section in the menu can be introduced by a descriptive line.  So
3451 long as the line does not begin with an asterisk, it will not be
3452 treated as a menu entry.  (@xref{Writing a Menu}, for more
3453 information.)@refill
3454
3455 For example, the master menu for this manual looks like the following
3456 (but has many more entries):@refill
3457
3458 @example
3459 @group
3460 @@menu
3461 * Copying::             Texinfo is freely
3462                           redistributable.
3463 * Overview::            What is Texinfo?
3464 * Texinfo Mode::        Special features in GNU Emacs.
3465 @dots{}
3466 @dots{}
3467 @end group
3468 @group
3469 * Command and Variable Index::
3470                         An entry for each @@-command.
3471 * Concept Index::       An entry for each concept.
3472 @end group
3473
3474 @group
3475 @@detailmenu
3476  --- The Detailed Node Listing ---
3477
3478 Overview of Texinfo
3479
3480 * Info Files::          What is an Info file?
3481 * Printed Manuals::     Characteristics of
3482                           a printed manual.
3483 @dots{}
3484 @dots{}
3485 @end group
3486
3487 @group
3488 Using Texinfo Mode
3489
3490 * Info on a Region::    Formatting part of a file
3491                           for Info.
3492 @dots{}
3493 @dots{}
3494 @@end detailmenu
3495 @@end menu
3496 @end group
3497 @end example
3498
3499 @node Software Copying Permissions, , The Top Node, Beginning a File
3500 @comment  node-name,  next,  previous,  up
3501 @section Software Copying Permissions
3502 @cindex Software copying permissions
3503 @cindex Copying software
3504 @cindex Distribution
3505 @cindex License agreement
3506
3507 If the Texinfo file has a section containing the ``General Public
3508 License'' and the distribution information and a warranty disclaimer
3509 for the software that is documented, this section usually follows the
3510 `Top' node.  The General Public License is very important to Project
3511 GNU software.  It ensures that you and others will continue to have a
3512 right to use and share the software.@refill
3513
3514 The copying and distribution information and the disclaimer are
3515 followed by an introduction or else by the first chapter of the
3516 manual.@refill
3517
3518 @cindex Introduction, as part of file
3519 Although an introduction is not a required part of a Texinfo file, it
3520 is very helpful.  Ideally, it should state clearly and concisely what
3521 the file is about and who would be interested in reading it.  In
3522 general, an introduction would follow the licensing and distribution
3523 information, although sometimes people put it earlier in the document.
3524 Usually, an introduction is put in an @code{@@unnumbered} section.
3525 (@xref{unnumbered & appendix, , The @code{@@unnumbered} and
3526 @code{@@appendix} Commands}.)@refill
3527
3528 @node Ending a File, Structuring, Beginning a File, Top
3529 @comment  node-name,  next,  previous,  up
3530 @chapter Ending a Texinfo File
3531 @cindex Ending a Texinfo file
3532 @cindex Texinfo file ending
3533 @cindex File ending
3534 @findex bye
3535
3536 The end of a Texinfo file should include the commands that create
3537 indices and generate detailed and summary tables of contents.
3538 And it must include the @code{@@bye} command that marks the last line
3539 processed by @TeX{}.@refill
3540
3541 @need 700
3542 For example:
3543
3544 @example
3545 @@node    Concept Index,     , Variables Index, Top
3546 @@c        node-name,    next, previous,        up
3547 @@unnumbered Concept Index
3548
3549 @@printindex cp
3550
3551 @@contents
3552 @@bye
3553 @end example
3554
3555 @menu
3556 * Printing Indices & Menus::    How to print an index in hardcopy and
3557                                   generate index menus in Info.
3558 * Contents::                    How to create a table of contents.
3559 * File End::                    How to mark the end of a file.
3560 @end menu
3561
3562 @node Printing Indices & Menus, Contents, Ending a File, Ending a File
3563 @comment  node-name,  next,  previous,  up
3564 @section Index Menus and Printing an Index
3565 @findex printindex
3566 @cindex Printing an index
3567 @cindex Indices, printing and menus
3568 @cindex Generating menus with indices
3569 @cindex Menus generated with indices
3570
3571 To print an index means to include it as part of a manual or Info
3572 file.  This does not happen automatically just because you use
3573 @code{@@cindex} or other index-entry generating commands in the
3574 Texinfo file; those just cause the raw data for the index to be
3575 accumulated.  To generate an index, you must include the
3576 @code{@@printindex} command at the place in the document where you
3577 want the index to appear.  Also, as part of the process of creating a
3578 printed manual, you must run a program called @code{texindex}
3579 (@pxref{Format/Print Hardcopy}) to sort the raw data to produce a sorted
3580 index file.  The sorted index file is what is actually used to
3581 print the index.@refill
3582
3583 Texinfo offers six different types of predefined index: the concept
3584 index, the function index, the variables index, the keystroke index, the
3585 program index, and the data type index (@pxref{Predefined Indices}).  Each
3586 index type has a two-letter name: @samp{cp}, @samp{fn}, @samp{vr},
3587 @samp{ky}, @samp{pg}, and @samp{tp}.  You may merge indices, or put them
3588 into separate sections (@pxref{Combining Indices}); or you may define
3589 your own indices (@pxref{New Indices, , Defining New Indices}).@refill
3590
3591 The @code{@@printindex} command takes a two-letter index name, reads
3592 the corresponding sorted index file and formats it appropriately into
3593 an index.@refill
3594
3595 @ignore
3596 The two-letter index names are:
3597
3598 @table @samp
3599 @item cp
3600 concept index
3601 @item fn
3602 function index
3603 @item vr
3604 variable index
3605 @item ky
3606 key index
3607 @item pg
3608 program index
3609 @item tp
3610 data type index
3611 @end table
3612 @end ignore
3613 The @code{@@printindex} command does not generate a chapter heading
3614 for the index.  Consequently, you should precede the
3615 @code{@@printindex} command with a suitable section or chapter command
3616 (usually @code{@@unnumbered}) to supply the chapter heading and put
3617 the index into the table of contents.  Precede the @code{@@unnumbered}
3618 command with an @code{@@node} line.@refill
3619
3620 @need 1200
3621 For example:
3622
3623 @smallexample
3624 @group
3625 @@node Variable Index, Concept Index, Function Index, Top
3626 @@comment    node-name,         next,       previous, up
3627 @@unnumbered Variable Index
3628
3629 @@printindex vr
3630 @end group
3631
3632 @group
3633 @@node     Concept Index,     , Variable Index, Top
3634 @@comment      node-name, next,       previous, up
3635 @@unnumbered Concept Index
3636
3637 @@printindex cp
3638 @end group
3639
3640 @group
3641 @@summarycontents
3642 @@contents
3643 @@bye
3644 @end group
3645 @end smallexample
3646
3647 @noindent
3648 (Readers often prefer that the concept index come last in a book,
3649 since that makes it easiest to find.)@refill
3650
3651 @ignore
3652 In @TeX{}, the @code{@@printindex} command needs a sorted index file
3653 to work from.  @TeX{} does not know how to do sorting; this is a
3654 deficiency.  @TeX{} writes output files of raw index data; use the
3655 @code{texindex} program to convert these files to sorted index files.
3656 (@xref{Format/Print Hardcopy}, for more information.)@refill
3657 @end ignore
3658 @node Contents, File End, Printing Indices & Menus, Ending a File
3659 @comment  node-name,  next,  previous,  up
3660 @section Generating a Table of Contents
3661 @cindex Table of contents
3662 @cindex Contents, Table of
3663 @findex contents
3664 @findex summarycontents
3665 @findex shortcontents
3666
3667 The @code{@@chapter}, @code{@@section}, and other structuring commands
3668 supply the information to make up a table of contents, but they do not
3669 cause an actual table to appear in the manual.  To do this, you must
3670 use the @code{@@contents} and @code{@@summarycontents}
3671 commands:@refill
3672
3673 @table @code
3674 @item @@contents
3675 Generate a table of contents in a printed manual, including all
3676 chapters, sections, subsections, etc., as well as appendices and
3677 unnumbered chapters.  (Headings generated by the @code{@@heading}
3678 series of commands do not appear in the table of contents.)  The
3679 @code{@@contents} command should be written on a line by
3680 itself.@refill
3681
3682 @item @@shortcontents
3683 @itemx @@summarycontents
3684 (@code{@@summarycontents} is a synonym for @code{@@shortcontents}; the
3685 two commands are exactly the same.)@refill
3686
3687 Generate a short or summary table of contents that lists only the
3688 chapters (and appendices and unnumbered chapters).  Omit sections, subsections
3689 and subsubsections.  Only a long manual needs a short table
3690 of contents in addition to the full table of contents.@refill
3691
3692 Write the @code{@@shortcontents} command on a line by itself right
3693 @emph{before} the @code{@@contents} command.@refill
3694 @end table
3695
3696 The table of contents commands automatically generate a chapter-like
3697 heading at the top of the first table of contents page.  Write the table
3698 of contents commands at the very end of a Texinfo file, just before the
3699 @code{@@bye} command, following any index sections---anything in the
3700 Texinfo file after the table of contents commands will be omitted from
3701 the table of contents.@refill
3702
3703 When you print a manual with a table of contents, the table of
3704 contents are printed last and numbered with roman numerals.  You need
3705 to place those pages in their proper place, after the title page,
3706 yourself.  (This is the only collating you need to do for a printed
3707 manual.  The table of contents is printed last because it is generated
3708 after the rest of the manual is typeset.)@refill
3709
3710 @need 700
3711 Here is an example of where to write table of contents commands:@refill
3712
3713 @example
3714 @group
3715 @var{indices}@dots{}
3716 @@shortcontents
3717 @@contents
3718 @@bye
3719 @end group
3720 @end example
3721
3722 Since an Info file uses menus instead of tables of contents, the Info
3723 formatting commands ignore the @code{@@contents} and
3724 @code{@@shortcontents} commands.@refill
3725
3726 @node File End, , Contents, Ending a File
3727 @comment  node-name,  next,  previous,  up
3728 @section @code{@@bye} File Ending
3729 @findex bye
3730
3731 An @code{@@bye} command terminates @TeX{} or Info formatting.  None of
3732 the formatting commands see any of the file following @code{@@bye}.
3733 The @code{@@bye} command should be on a line by itself.@refill
3734
3735 If you wish, you may follow the @code{@@bye} line with notes. These notes
3736 will not be formatted and will not appear in either Info or a printed
3737 manual; it is as if text after @code{@@bye} were within @code{@@ignore}
3738 @dots{} @code{@@end ignore}.  Also, you may follow the @code{@@bye} line
3739 with a local variables list.  @xref{Compile-Command, , Using Local
3740 Variables and the Compile Command}, for more information.@refill
3741
3742 @node Structuring, Nodes, Ending a File, Top
3743 @comment  node-name,  next,  previous,  up
3744 @chapter Chapter Structuring
3745 @cindex Chapter structuring
3746 @cindex Structuring of chapters
3747
3748 The @dfn{chapter structuring} commands divide a document into a hierarchy of
3749 chapters, sections, subsections, and subsubsections.  These commands
3750 generate large headings; they also provide information for the table
3751 of contents of a printed manual (@pxref{Contents, , Generating a Table
3752 of Contents}).@refill
3753
3754 The chapter structuring commands do not create an Info node structure,
3755 so normally you should put an @code{@@node} command immediately before
3756 each chapter structuring command (@pxref{Nodes}).  The only time you
3757 are likely to use the chapter structuring commands without using the
3758 node structuring commands is if you are writing a document that
3759 contains no cross references and will never be transformed into Info
3760 format.@refill
3761
3762 It is unlikely that you will ever write a Texinfo file that is
3763 intended only as an Info file and not as a printable document.  If you
3764 do, you might still use chapter structuring commands to create a
3765 heading at the top of each node---but you don't need to.@refill
3766
3767 @menu
3768 * Tree Structuring::            A manual is like an upside down tree @dots{}
3769 * Structuring Command Types::   How to divide a manual into parts.
3770 * makeinfo top::                The @code{@@top} command, part of the `Top' node.
3771 * chapter::                     
3772 * unnumbered & appendix::       
3773 * majorheading & chapheading::  
3774 * section::                     
3775 * unnumberedsec appendixsec heading::  
3776 * subsection::                  
3777 * unnumberedsubsec appendixsubsec subheading::  
3778 * subsubsection::               Commands for the lowest level sections.
3779 * Raise/lower sections::        How to change commands' hierarchical level.
3780 @end menu
3781
3782 @node Tree Structuring, Structuring Command Types, Structuring, Structuring
3783 @comment  node-name,  next,  previous,  up
3784 @section Tree Structure of Sections
3785 @cindex Tree structuring
3786
3787 A Texinfo file is usually structured like a book with chapters,
3788 sections, subsections, and the like.  This structure can be visualized
3789 as a tree (or rather as an upside-down tree) with the root at the top
3790 and the levels corresponding to chapters, sections, subsection, and
3791 subsubsections.@refill
3792
3793 Here is a diagram that shows a Texinfo file with three chapters,
3794 each of which has two sections.@refill
3795
3796 @example
3797 @group
3798                           Top
3799                            |
3800          -------------------------------------
3801         |                  |                  |
3802      Chapter 1          Chapter 2          Chapter 3
3803         |                  |                  |
3804      --------           --------           --------
3805     |        |         |        |         |        |
3806  Section  Section   Section  Section   Section  Section
3807    1.1      1.2       2.1      2.2       3.1      3.2
3808
3809 @end group
3810 @end example
3811
3812 In a Texinfo file that has this structure, the beginning of Chapter 2
3813 looks like this:@refill
3814
3815 @example
3816 @group
3817 @@node    Chapter 2,  Chapter 3, Chapter 1, top
3818 @@chapter Chapter 2
3819 @end group
3820 @end example
3821
3822 The chapter structuring commands are described in the sections that
3823 follow; the @code{@@node} and @code{@@menu} commands are described in
3824 following chapters. (@xref{Nodes}, and see @ref{Menus}.)@refill
3825
3826 @node Structuring Command Types, makeinfo top, Tree Structuring, Structuring
3827 @comment  node-name,  next,  previous,  up
3828 @section Types of Structuring Command
3829
3830 The chapter structuring commands fall into four groups or series, each
3831 of which contains structuring commands corresponding to the
3832 hierarchical levels of chapters, sections, subsections, and
3833 subsubsections.@refill
3834
3835 The four groups are the @code{@@chapter} series, the
3836 @code{@@unnumbered} series, the @code{@@appendix} series, and the
3837 @code{@@heading} series.@refill
3838
3839 Each command produces titles that have a different appearance on the
3840 printed page or Info file; only some of the commands produce
3841 titles that are listed in the table of contents of a printed book or
3842 manual.@refill
3843
3844 @itemize @bullet
3845 @item
3846 The @code{@@chapter} and @code{@@appendix} series of commands produce
3847 numbered or lettered entries both in the body of a printed work and in
3848 its table of contents.@refill
3849
3850 @item
3851 The @code{@@unnumbered} series of commands produce unnumbered entries
3852 both in the body of a printed work and in its table of contents.  The
3853 @code{@@top} command, which has a special use, is a member of this
3854 series (@pxref{makeinfo top, , @code{@@top}}).@refill
3855
3856 @item
3857 The @code{@@heading} series of commands produce unnumbered headings
3858 that do not appear in a table of contents.  The heading commands never
3859 start a new page.@refill
3860
3861 @item
3862 The @code{@@majorheading} command produces results similar to using
3863 the @code{@@chapheading} command but generates a larger vertical
3864 whitespace before the heading.@refill
3865
3866 @item
3867 When an @code{@@setchapternewpage} command says to do so, the
3868 @code{@@chapter}, @code{@@unnumbered}, and @code{@@appendix} commands
3869 start new pages in the printed manual; the @code{@@heading} commands
3870 do not.@refill
3871 @end itemize
3872
3873 @need 1000
3874 Here are the four groups of chapter structuring commands:@refill
3875
3876 @c Slightly different formatting for regular sized books and smallbooks.
3877 @ifset smallbook
3878 @sp 1
3879 @tex
3880 {\let\rm=\indrm \let\tt=\indtt
3881 \halign{\hskip\itemindent#\hfil&  \hskip.5em#\hfil&  \hskip.5em#\hfil&
3882 \hskip.5em#\hfil\cr
3883
3884 & & &                                                \rm No new pages\cr
3885 \rm Numbered&    \rm Unnumbered&  \rm Lettered and numbered& \rm Unnumbered\cr
3886 \rm In contents&  \rm In contents&  \rm In contents&  \rm Not in contents\cr
3887
3888 & & & \cr
3889  &              \tt  @@top&            &               \tt @@majorheading\cr
3890 \tt @@chapter& \tt @@unnumbered&    \tt @@appendix&     \tt @@chapheading\cr
3891 \tt @@section&   \tt @@unnumberedsec&   \tt @@appendixsec&   \tt @@heading\cr
3892 \tt @@subsection&\tt @@unnumberedsubsec&\tt @@appendixsubsec&
3893 \tt @@subheading\cr
3894 \tt @@subsubsection& \tt @@unnumberedsubsubsec& \tt @@appendixsubsubsec&
3895 \tt @@subsubheading\cr}}
3896 @end tex
3897 @end ifset
3898 @ifclear smallbook
3899 @sp 1
3900 @tex
3901 \vbox{
3902 \halign{\hskip\itemindent\hskip.5em#\hfil&  \hskip.5em#\hfil&
3903 \hskip.5em#\hfil& \hskip.5em #\hfil\cr
3904
3905 & & & \cr
3906 & & &                                                \rm No new pages\cr
3907 \rm Numbered&    \rm Unnumbered&  \rm Lettered and numbered& \rm Unnumbered\cr
3908 \rm In contents&  \rm In contents&  \rm In contents&  \rm Not in contents\cr
3909
3910 & & & \cr
3911  &              \tt  @@top&            &               \tt @@majorheading\cr
3912 \tt @@chapter& \tt @@unnumbered&    \tt @@appendix&     \tt @@chapheading\cr
3913 \tt @@section&   \tt @@unnumberedsec&   \tt @@appendixsec&   \tt @@heading\cr
3914 \tt @@subsection&\tt @@unnumberedsubsec&\tt @@appendixsubsec&
3915 \tt @@subheading\cr
3916 \tt @@subsubsection& \tt @@unnumberedsubsubsec& \tt @@appendixsubsubsec&
3917 \tt @@subsubheading\cr}}
3918 @end tex
3919 @end ifclear
3920 @ifinfo
3921 @example
3922 @group
3923                                                        @r{No new pages}
3924 @r{Numbered}       @r{Unnumbered}       @r{Lettered and numbered}  @r{Unnumbered}
3925 @r{In contents}    @r{In contents}          @r{In contents}        @r{Not in contents}
3926
3927                @@top                                    @@majorheading
3928 @@chapter       @@unnumbered          @@appendix          @@chapheading
3929 @@section       @@unnumberedsec       @@appendixsec       @@heading
3930 @@subsection    @@unnumberedsubsec    @@appendixsubsec    @@subheading
3931 @@subsubsection @@unnumberedsubsubsec @@appendixsubsubsec @@subsubheading
3932 @end group
3933 @end example
3934 @end ifinfo
3935
3936 @c Cannot line up columns properly inside of an example because of roman
3937 @c proportional fonts.
3938 @ignore
3939 @ifset smallbook
3940 @iftex
3941 @smallexample
3942 @group
3943                                                        @r{No new pages}
3944 @r{Numbered}      @r{Unnumbered}       @r{Lettered and numbered}  @r{Unnumbered}
3945 @r{In contents}      @r{In contents}           @r{In contents}         @r{Not in contents}
3946
3947                @@top                                    @@majorheading
3948 @@chapter       @@unnumbered          @@appendix          @@chapheading
3949 @@section       @@unnumberedsec       @@appendixsec       @@heading
3950 @@subsection    @@unnumberedsubsec    @@appendixsubsec    @@subheading
3951 @@subsubsection @@unnumberedsubsubsec @@appendixsubsubsec @@subsubheading
3952 @end group
3953 @end smallexample
3954 @end iftex
3955 @end ifset
3956 @ifclear smallbook
3957 @iftex
3958 @smallexample
3959 @group
3960                                                       @r{No new pages}
3961 @r{Numbered}      @r{Unnumbered}       @r{Lettered and numbered}  @r{Unnumbered}
3962 @r{In contents}      @r{In contents}           @r{In contents}         @r{Not in contents}
3963
3964                @@top                                    @@majorheading
3965 @@chapter       @@unnumbered          @@appendix          @@chapheading
3966 @@section       @@unnumberedsec       @@appendixsec       @@heading
3967 @@subsection    @@unnumberedsubsec    @@appendixsubsec    @@subheading
3968 @@subsubsection @@unnumberedsubsubsec @@appendixsubsubsec @@subsubheading
3969 @end group
3970 @end smallexample
3971 @end iftex
3972 @end ignore
3973
3974 @node makeinfo top, chapter, Structuring Command Types, Structuring
3975 @comment  node-name,  next,  previous,  up
3976 @section @code{@@top}
3977
3978 The @code{@@top} command is a special sectioning command that you use
3979 only after an @code{@@node Top} line at the beginning of a Texinfo file.
3980 The @code{@@top} command tells the @code{makeinfo} formatter
3981 which node is the `Top'
3982 node.  It has the same typesetting effect as @code{@@unnumbered}
3983 (@pxref{unnumbered & appendix, , @code{@@unnumbered}, @code{@@appendix}}).
3984 For detailed information, see
3985 @ref{makeinfo top command, , The @code{@@top} Command}.@refill
3986
3987 @node chapter, unnumbered & appendix, makeinfo top, Structuring
3988 @comment  node-name,  next,  previous,  up
3989 @section @code{@@chapter}
3990 @findex chapter
3991
3992 @code{@@chapter} identifies a chapter in the document.  Write the
3993 command at the beginning of a line and follow it on the same line by
3994 the title of the chapter.@refill
3995
3996 For example, this chapter in this manual is entitled ``Chapter
3997 Structuring''; the @code{@@chapter} line looks like this:@refill
3998
3999 @example
4000 @@chapter Chapter Structuring
4001 @end example
4002
4003 In @TeX{}, the @code{@@chapter} command creates a chapter in the
4004 document, specifying the chapter title.  The chapter is numbered
4005 automatically.@refill
4006
4007 In Info, the @code{@@chapter} command causes the title to appear on a
4008 line by itself, with a line of asterisks inserted underneath.  Thus,
4009 in Info, the above example produces the following output:@refill
4010
4011 @example
4012 Chapter Structuring
4013 *******************
4014 @end example
4015
4016 @findex centerchap
4017 Texinfo also provides a command @code{@@centerchap}, which is analogous
4018 to @code{@@unnumbered}, but centers its argument in the printed output.
4019 This kind of stylistic choice is not usually offered by Texinfo.
4020 @c but the Hacker's Dictionary wanted it ...
4021
4022
4023 @node unnumbered & appendix, majorheading & chapheading, chapter, Structuring
4024 @comment  node-name,  next,  previous,  up
4025 @section @code{@@unnumbered}, @code{@@appendix}
4026 @findex unnumbered
4027 @findex appendix
4028
4029 Use the @code{@@unnumbered} command to create a chapter that appears
4030 in a printed manual without chapter numbers of any kind.  Use the
4031 @code{@@appendix} command to create an appendix in a printed manual
4032 that is labelled by letter instead of by number.@refill
4033
4034 For Info file output, the @code{@@unnumbered} and @code{@@appendix}
4035 commands are equivalent to @code{@@chapter}: the title is printed on a
4036 line by itself with a line of asterisks underneath.  (@xref{chapter, ,
4037 @code{@@chapter}}.)@refill
4038
4039 To create an appendix or an unnumbered chapter, write an
4040 @code{@@appendix} or @code{@@unnumbered} command at the beginning of a
4041 line and follow it on the same line by the title, as you would if you
4042 were creating a chapter.@refill
4043
4044
4045 @node majorheading & chapheading, section, unnumbered & appendix, Structuring
4046 @section @code{@@majorheading}, @code{@@chapheading}
4047 @findex majorheading
4048 @findex chapheading
4049
4050 The @code{@@majorheading} and @code{@@chapheading} commands put
4051 chapter-like headings in the body of a document.@refill
4052
4053 However, neither command causes @TeX{} to produce a numbered heading
4054 or an entry in the table of contents; and neither command causes
4055 @TeX{} to start a new page in a printed manual.@refill
4056
4057 In @TeX{}, an @code{@@majorheading} command generates a larger vertical
4058 whitespace before the heading than an @code{@@chapheading} command but
4059 is otherwise the same.@refill
4060
4061 In Info,
4062 the @code{@@majorheading} and
4063 @code{@@chapheading} commands are equivalent to
4064 @code{@@chapter}: the title is printed on a line by itself with a line
4065 of asterisks underneath.  (@xref{chapter, , @code{@@chapter}}.)@refill
4066
4067 @node section, unnumberedsec appendixsec heading, majorheading & chapheading, Structuring
4068 @comment  node-name,  next,  previous,  up
4069 @section @code{@@section}
4070 @findex section
4071
4072 In a printed manual, an @code{@@section} command identifies a
4073 numbered section within a chapter.  The section title appears in the
4074 table of contents.  In Info, an @code{@@section} command provides a
4075 title for a segment of text, underlined with @samp{=}.@refill
4076
4077 This section is headed with an @code{@@section} command and looks like
4078 this in the Texinfo file:@refill
4079
4080 @example
4081 @@section @@code@{@@@@section@}
4082 @end example
4083
4084 To create a section, write the @code{@@section} command at the
4085 beginning of a line and follow it on the same line by the section
4086 title.@refill
4087
4088 Thus,
4089
4090 @example
4091 @@section This is a section
4092 @end example
4093
4094 @noindent
4095 produces
4096
4097 @example
4098 @group
4099 This is a section
4100 =================
4101 @end group
4102 @end example
4103
4104 @noindent
4105 in Info.
4106
4107 @node unnumberedsec appendixsec heading, subsection, section, Structuring
4108 @comment  node-name,  next,  previous,  up
4109 @section @code{@@unnumberedsec}, @code{@@appendixsec}, @code{@@heading}
4110 @findex unnumberedsec
4111 @findex appendixsec
4112 @findex heading
4113
4114 The @code{@@unnumberedsec}, @code{@@appendixsec}, and @code{@@heading}
4115 commands are, respectively, the unnumbered, appendix-like, and
4116 heading-like equivalents of the @code{@@section} command.
4117 (@xref{section, , @code{@@section}}.)@refill
4118
4119 @table @code
4120 @item @@unnumberedsec
4121 The @code{@@unnumberedsec} command may be used within an
4122 unnumbered chapter or within a regular chapter or appendix to
4123 provide an unnumbered section.@refill
4124
4125 @item @@appendixsec
4126 @itemx @@appendixsection
4127 @code{@@appendixsection} is a longer spelling of the
4128 @code{@@appendixsec} command; the two are synonymous.@refill
4129 @findex appendixsection
4130
4131 Conventionally, the @code{@@appendixsec} or @code{@@appendixsection}
4132 command is used only within appendices.@refill
4133
4134 @item @@heading
4135 You may use the @code{@@heading} command anywhere you wish for a
4136 section-style heading that will not appear in the table of contents.@refill
4137 @end table
4138
4139 @node subsection, unnumberedsubsec appendixsubsec subheading, unnumberedsec appendixsec heading, Structuring
4140 @comment  node-name,  next,  previous,  up
4141 @section The @code{@@subsection} Command
4142 @findex subsection
4143
4144 Subsections are to sections as sections are to chapters.
4145 (@xref{section, , @code{@@section}}.)  In Info, subsection titles are
4146 underlined with @samp{-}.  For example,@refill
4147
4148 @example
4149 @@subsection This is a subsection
4150 @end example
4151
4152 @noindent
4153 produces
4154
4155 @example
4156 @group
4157 This is a subsection
4158 --------------------
4159 @end group
4160 @end example
4161
4162 In a printed manual, subsections are listed in the table of contents
4163 and are numbered three levels deep.@refill
4164
4165 @node unnumberedsubsec appendixsubsec subheading, subsubsection, subsection, Structuring
4166 @comment  node-name,  next,  previous,  up
4167 @section The @code{@@subsection}-like Commands
4168 @cindex Subsection-like commands
4169 @findex unnumberedsubsec
4170 @findex appendixsubsec
4171 @findex subheading
4172
4173 The @code{@@unnumberedsubsec}, @code{@@appendixsubsec}, and
4174 @code{@@subheading} commands are, respectively, the unnumbered,
4175 appendix-like, and heading-like equivalents of the @code{@@subsection}
4176 command.  (@xref{subsection, , @code{@@subsection}}.)@refill
4177
4178 In Info, the @code{@@subsection}-like commands generate a title
4179 underlined with hyphens.  In a printed manual, an @code{@@subheading}
4180 command produces a heading like that of a subsection except that it is
4181 not numbered and does not appear in the table of contents.  Similarly,
4182 an @code{@@unnumberedsubsec} command produces an unnumbered heading like
4183 that of a subsection and an @code{@@appendixsubsec} command produces a
4184 subsection-like heading labelled with a letter and numbers; both of
4185 these commands produce headings that appear in the table of
4186 contents.@refill
4187
4188 @node subsubsection, Raise/lower sections, unnumberedsubsec appendixsubsec subheading, Structuring
4189 @comment  node-name,  next,  previous,  up
4190 @section The `subsub' Commands
4191 @cindex Subsub commands
4192 @findex subsubsection
4193 @findex unnumberedsubsubsec
4194 @findex appendixsubsubsec
4195 @findex subsubheading
4196
4197 The fourth and lowest level sectioning commands in Texinfo are the
4198 `subsub' commands.  They are:@refill
4199
4200 @table @code
4201 @item @@subsubsection
4202 Subsubsections are to subsections as subsections are to sections.
4203 (@xref{subsection, , @code{@@subsection}}.)  In a printed manual,
4204 subsubsection titles appear in the table of contents and are numbered
4205 four levels deep.@refill
4206
4207 @item @@unnumberedsubsubsec
4208 Unnumbered subsubsection titles appear in the table of contents of a
4209 printed manual, but lack numbers.  Otherwise, unnumbered
4210 subsubsections are the same as subsubsections.  In Info, unnumbered
4211 subsubsections look exactly like ordinary subsubsections.@refill
4212
4213 @item @@appendixsubsubsec
4214 Conventionally, appendix commands are used only for appendices and are
4215 lettered and numbered appropriately in a printed manual.  They also
4216 appear in the table of contents.  In Info, appendix subsubsections look
4217 exactly like ordinary subsubsections.@refill
4218
4219 @item @@subsubheading
4220 The @code{@@subsubheading} command may be used anywhere that you need
4221 a small heading that will not appear in the table of contents.  In
4222 Info, subsubheadings look exactly like ordinary subsubsection
4223 headings.@refill
4224 @end table
4225
4226 In Info,  `subsub' titles are underlined with periods.
4227 For example,@refill
4228
4229 @example
4230 @@subsubsection This is a subsubsection
4231 @end example
4232
4233 @noindent
4234 produces
4235
4236 @example
4237 @group
4238 This is a subsubsection
4239 .......................
4240 @end group
4241 @end example
4242
4243 @node Raise/lower sections, , subsubsection, Structuring
4244 @comment  node-name,  next,  previous,  up
4245 @section @code{@@raisesections} and @code{@@lowersections}
4246 @findex raisesections
4247 @findex lowersections
4248 @cindex Raising and lowering sections
4249 @cindex Sections, raising and lowering
4250
4251 The @code{@@raisesections} and @code{@@lowersections} commands raise and
4252 lower the hierarchical level of chapters, sections, subsections and the
4253 like.  The @code{@@raisesections} command changes sections to chapters,
4254 subsections to sections, and so on.  The @code{@@lowersections} command
4255 changes chapters to sections, sections to subsections, and so on.
4256
4257 An @code{@@lowersections} command is useful if you wish to include text
4258 that is written as an outer or standalone Texinfo file in another
4259 Texinfo file as an inner, included file.  If you write the command at
4260 the beginning of the file, all your @code{@@chapter} commands are
4261 formatted as if they were @code{@@section} commands, all your
4262 @code{@@section} command are formatted as if they were
4263 @code{@@subsection} commands, and so on.
4264
4265 @need 1000
4266 @code{@@raisesections} raises a command one level in the chapter
4267 structuring hierarchy:@refill
4268
4269 @example
4270 @group
4271   @r{Change}           @r{To}
4272
4273 @@subsection     @@section,
4274 @@section        @@chapter,
4275 @@heading        @@chapheading,
4276           @r{etc.}
4277 @end group
4278 @end example
4279
4280 @need 1000
4281 @code{@@lowersections} lowers a command one level in the chapter
4282 structuring hierarchy:@refill
4283
4284 @example
4285 @group
4286   @r{Change}           @r{To}
4287
4288 @@chapter        @@section,
4289 @@subsection     @@subsubsection,
4290 @@heading        @@subheading,
4291           @r{etc.}
4292 @end group
4293 @end example
4294
4295 An @code{@@raisesections} or @code{@@lowersections} command changes only
4296 those structuring commands that follow the command in the Texinfo file.
4297 Write an @code{@@raisesections} or @code{@@lowersections} command on a
4298 line of its own.
4299
4300 An @code{@@lowersections} command cancels an @code{@@raisesections}
4301 command, and vice versa.
4302
4303 Repeated use of the commands continue to raise or lower the hierarchical
4304 level a step at a time.
4305
4306 An attempt to raise above `chapters' reproduces chapter commands; an
4307 attempt to lower below `subsubsections' reproduces subsubsection
4308 commands.
4309
4310 @node Nodes, Menus, Structuring, Top
4311 @comment  node-name,  next,  previous,  up
4312 @chapter Nodes
4313
4314 @dfn{Nodes} are the primary segments of a Texinfo file.  They do not
4315 themselves impose a hierarchic or any other kind of structure on a file.
4316 Nodes contain @dfn{node pointers} that name other nodes, and can contain
4317 @dfn{menus} which are lists of nodes.  In Info, the movement commands
4318 can carry you to a pointed-to node or to a node listed in a menu.  Node
4319 pointers and menus provide structure for Info files just as chapters,
4320 sections, subsections, and the like, provide structure for printed
4321 books.@refill
4322
4323 @menu
4324 * Two Paths::                   Different commands to structure
4325                                   Info output and printed output.
4326 * Node Menu Illustration::      A diagram, and sample nodes and menus.
4327 * node::                        How to write a node, in detail.
4328 * makeinfo Pointer Creation::   How to create node pointers with @code{makeinfo}.
4329 @end menu
4330
4331 @node Two Paths, Node Menu Illustration, Nodes, Nodes
4332 @ifinfo
4333 @heading Two Paths
4334 @end ifinfo
4335
4336 The node and menu commands and the chapter structuring commands are
4337 independent of each other:
4338
4339 @itemize @bullet
4340 @item
4341 In Info, node and menu commands provide structure.  The chapter
4342 structuring commands generate headings with different kinds of
4343 underlining---asterisks for chapters, hyphens for sections, and so on;
4344 they do nothing else.@refill
4345
4346 @item
4347 In @TeX{}, the chapter structuring commands generate chapter and section
4348 numbers and tables of contents.  The node and menu commands provide
4349 information for cross references; they do nothing else.@refill
4350 @end itemize
4351
4352 You can use node pointers and menus to structure an Info file any way
4353 you want; and you can write a Texinfo file so that its Info output has a
4354 different structure than its printed output.  However, most Texinfo
4355 files are written such that the structure for the Info output
4356 corresponds to the structure for the printed output.  It is not
4357 convenient to do otherwise.@refill
4358
4359 Generally, printed output is structured in a tree-like hierarchy in
4360 which the chapters are the major limbs from which the sections branch
4361 out.  Similarly, node pointers and menus are organized to create a
4362 matching structure in the Info output.@refill
4363
4364 @node Node Menu Illustration, node, Two Paths, Nodes
4365 @comment  node-name,  next,  previous,  up
4366 @section Node and Menu Illustration
4367
4368 Here is a copy of the diagram shown earlier that illustrates a Texinfo
4369 file with three chapters, each of which contains two sections.@refill
4370
4371 Note that the ``root'' is at the top of the diagram and the ``leaves''
4372 are at the bottom.  This is how such a diagram is drawn conventionally;
4373 it illustrates an upside-down tree.  For this reason, the root node is
4374 called the `Top' node, and `Up' node pointers carry you closer to the
4375 root.@refill
4376
4377 @example
4378 @group
4379                           Top
4380                            |
4381          -------------------------------------
4382         |                  |                  |
4383      Chapter 1          Chapter 2          Chapter 3
4384         |                  |                  |
4385      --------           --------           --------
4386     |        |         |        |         |        |
4387  Section  Section   Section  Section   Section  Section
4388    1.1      1.2       2.1      2.2       3.1      3.2
4389
4390 @end group
4391 @end example
4392
4393 Write the beginning of the node for Chapter 2 like this:@refill
4394
4395 @example
4396 @group
4397 @@node     Chapter 2,  Chapter 3, Chapter 1, top
4398 @@comment  node-name,  next,      previous,  up
4399 @end group
4400 @end example
4401
4402 @noindent
4403 This @code{@@node} line says that the name of this node is ``Chapter 2'', the
4404 name of the `Next' node is ``Chapter 3'', the name of the `Previous'
4405 node is ``Chapter 1'', and the name of the `Up' node is ``Top''.
4406
4407 @quotation
4408 @strong{Please Note:} `Next' refers to the next node at the same
4409 hierarchical level in the manual, not necessarily to the next node
4410 within the Texinfo file.  In the Texinfo file, the subsequent node may
4411 be at a lower level---a section-level node may follow a chapter-level
4412 node, and a subsection-level node may follow a section-level node.
4413 `Next' and `Previous' refer to nodes at the @emph{same} hierarchical
4414 level.  (The `Top' node contains the exception to this rule.  Since the
4415 `Top' node is the only node at that level, `Next' refers to the first
4416 following node, which is almost always a chapter or chapter-level
4417 node.)@refill
4418 @end quotation
4419
4420 To go to Sections 2.1 and 2.2 using Info, you need a menu inside Chapter
4421 2.  (@xref{Menus}.)  You would write the menu just
4422 before the beginning of Section 2.1, like this:@refill
4423
4424 @example
4425 @group
4426     @@menu
4427     * Sect. 2.1::    Description of this section.
4428     * Sect. 2.2::
4429     @@end menu
4430 @end group
4431 @end example
4432
4433 Write the node for Sect. 2.1 like this:@refill
4434
4435 @example
4436 @group
4437     @@node     Sect. 2.1, Sect. 2.2, Chapter 2, Chapter 2
4438     @@comment  node-name, next,      previous,  up
4439 @end group
4440 @end example
4441
4442 In Info format, the `Next' and `Previous' pointers of a node usually
4443 lead to other nodes at the same level---from chapter to chapter or from
4444 section to section (sometimes, as shown, the `Previous' pointer points
4445 up); an `Up' pointer usually leads to a node at the level above (closer
4446 to the `Top' node); and a `Menu' leads to nodes at a level below (closer
4447 to `leaves').  (A cross reference can point to a node at any level;
4448 see @ref{Cross References}.)@refill
4449
4450 Usually, an @code{@@node} command and a chapter structuring command are
4451 used in sequence, along with indexing commands.  (You may follow the
4452 @code{@@node} line with a comment line that reminds you which pointer is
4453 which.)@refill
4454
4455 Here is the beginning of the chapter in this manual called ``Ending a
4456 Texinfo File''.  This shows an @code{@@node} line followed by a comment
4457 line, an @code{@@chapter} line, and then by indexing lines.@refill
4458
4459 @example
4460 @group
4461 @@node    Ending a File, Structuring, Beginning a File, Top
4462 @@comment node-name,     next,        previous,         up
4463 @@chapter Ending a Texinfo File
4464 @@cindex Ending a Texinfo file
4465 @@cindex Texinfo file ending
4466 @@cindex File ending
4467 @end group
4468 @end example
4469
4470 @node node, makeinfo Pointer Creation, Node Menu Illustration, Nodes
4471 @comment  node-name,  next,  previous,  up
4472 @section The @code{@@node} Command
4473
4474 @cindex Node, defined
4475 A @dfn{node} is a segment of text that begins at an @code{@@node}
4476 command and continues until the next @code{@@node} command.  The
4477 definition of node is different from that for chapter or section.  A
4478 chapter may contain sections and a section may contain subsections;
4479 but a node cannot contain subnodes; the text of a node continues only
4480 until the next @code{@@node} command in the file.  A node usually
4481 contains only one chapter structuring command, the one that follows
4482 the @code{@@node} line.  On the other hand, in printed output nodes
4483 are used only for cross references, so a chapter or section may
4484 contain any number of nodes.  Indeed, a chapter usually contains
4485 several nodes, one for each section, subsection, and
4486 subsubsection.@refill
4487
4488 To create a node, write an @code{@@node} command at the beginning of a
4489 line, and follow it with four arguments, separated by commas, on the
4490 rest of the same line.  These arguments are the name of the node, and
4491 the names of the `Next', `Previous', and `Up' pointers, in that order.
4492 You may insert spaces before each pointer if you wish; the spaces are
4493 ignored.  You must write the name of the node, and the names of the
4494 `Next', `Previous', and `Up' pointers, all on the same line.  Otherwise,
4495 the formatters fail.  (@inforef{Top, info, info}, for more information
4496 about nodes in Info.)@refill
4497
4498 Usually, you write one of the chapter-structuring command lines
4499 immediately after an @code{@@node} line---for example, an
4500 @code{@@section} or @code{@@subsection} line.  (@xref{Structuring
4501 Command Types, , Types of Structuring Command}.)@refill
4502
4503 @quotation
4504 @strong{Please note:} The GNU Emacs Texinfo mode updating commands work
4505 only with Texinfo files in which @code{@@node} lines are followed by chapter
4506 structuring lines.  @xref{Updating Requirements}.@refill
4507 @end quotation
4508
4509 @TeX{} uses @code{@@node} lines to identify the names to use for cross
4510 references.  For this reason, you must write @code{@@node} lines in a
4511 Texinfo file that you intend to format for printing, even if you do not
4512 intend to format it for Info.  (Cross references, such as the one at the
4513 end of this sentence, are made with @code{@@xref} and its related
4514 commands; see @ref{Cross References}.)@refill
4515
4516 @menu
4517 * Node Names::                  How to choose node and pointer names.
4518 * Writing a Node::              How to write an @code{@@node} line.
4519 * Node Line Tips::              Keep names short.
4520 * Node Line Requirements::      Keep names unique, without @@-commands.
4521 * First Node::                  How to write a `Top' node.
4522 * makeinfo top command::        How to use the @code{@@top} command.
4523 * Top Node Summary::            Write a brief description for readers.
4524 @end menu
4525
4526 @node Node Names, Writing a Node, node, node
4527 @ifinfo
4528 @subheading Choosing Node and Pointer Names
4529 @end ifinfo
4530
4531 The name of a node identifies the node.  The pointers enable
4532 you to reach other nodes and consist of the names of those nodes.@refill
4533
4534 Normally, a node's `Up' pointer contains the name of the node whose menu
4535 mentions that node.  The node's `Next' pointer contains the name of the
4536 node that follows that node in that menu and its `Previous' pointer
4537 contains the name of the node that precedes it in that menu.  When a
4538 node's `Previous' node is the same as its `Up' node, both node pointers
4539 name the same node.@refill
4540
4541 Usually, the first node of a Texinfo file is the `Top' node, and its
4542 `Up' and `Previous' pointers point to the @file{dir} file, which
4543 contains the main menu for all of Info.@refill
4544
4545 The `Top' node itself contains the main or master menu for the manual.
4546 Also, it is helpful to include a brief description of the manual in the
4547 `Top' node.  @xref{First Node}, for information on how to write the
4548 first node of a Texinfo file.@refill
4549
4550 @node Writing a Node, Node Line Tips, Node Names, node
4551 @comment  node-name,  next,  previous,  up
4552 @subsection How to Write an @code{@@node} Line
4553 @cindex Writing an @code{@@node} line
4554 @cindex @code{@@node} line writing
4555 @cindex Node line writing
4556
4557 The easiest way to write an @code{@@node} line is to write @code{@@node}
4558 at the beginning of a line and then the name of the node, like
4559 this:@refill
4560
4561 @example
4562 @@node @var{node-name}
4563 @end example
4564
4565 If you are using GNU Emacs, you can use the update node commands
4566 provided by Texinfo mode to insert the names of the pointers; or you
4567 can leave the pointers out of the Texinfo file and let @code{makeinfo}
4568 insert node pointers into the Info file it creates.  (@xref{Texinfo
4569 Mode}, and @ref{makeinfo Pointer Creation}.)@refill
4570
4571 Alternatively, you can insert the `Next', `Previous', and `Up'
4572 pointers yourself.  If you do this, you may find it helpful to use the
4573 Texinfo mode keyboard command @kbd{C-c C-c n}.  This command inserts
4574 @samp{@@node} and a comment line listing the names of the pointers in
4575 their proper order.  The comment line helps you keep track of which
4576 arguments are for which pointers.  This comment line is especially useful
4577 if you are not familiar with Texinfo.@refill
4578
4579 The template for a node line with `Next', `Previous', and `Up' pointers
4580 looks like this:@refill
4581
4582 @example
4583 @@node @var{node-name}, @var{next}, @var{previous}, @var{up}
4584 @end example
4585
4586 If you wish, you can ignore @code{@@node} lines altogether in your first
4587 draft and then use the @code{texinfo-insert-node-lines} command to
4588 create @code{@@node} lines for you.  However, we do not
4589 recommend this practice.  It is better to name the node itself
4590 at the same time that you
4591 write a segment so you can easily make cross references.  A large number
4592 of cross references are an especially important feature of a good Info
4593 file.@refill
4594
4595 After you have inserted an @code{@@node} line, you should immediately
4596 write an @@-command for the chapter or section and insert its name.
4597 Next (and this is important!), put in several index entries.  Usually,
4598 you will find at least two and often as many as four or five ways of
4599 referring to the node in the index.  Use them all.  This will make it
4600 much easier for people to find the node.@refill
4601
4602 @node Node Line Tips, Node Line Requirements, Writing a Node, node
4603 @comment  node-name,  next,  previous,  up
4604 @subsection @code{@@node} Line Tips
4605
4606 Here are three suggestions:
4607
4608 @itemize @bullet
4609 @item
4610 Try to pick node names that are informative but short.@refill
4611
4612 In the Info file, the file name, node name, and pointer names are all
4613 inserted on one line, which may run into the right edge of the window.
4614 (This does not cause a problem with Info, but is ugly.)@refill
4615
4616 @item
4617 Try to pick node names that differ from each other near the beginnings
4618 of their names.  This way, it is easy to use automatic name completion in
4619 Info.@refill
4620
4621 @item
4622 By convention, node names are capitalized just as they would be for
4623 section or chapter titles---initial and significant words are
4624 capitalized; others are not.@refill
4625 @end itemize
4626
4627 @node Node Line Requirements, First Node, Node Line Tips, node
4628 @comment  node-name,  next,  previous,  up
4629 @subsection @code{@@node} Line Requirements
4630
4631 @cindex Node line requirements
4632 Here are several requirements for @code{@@node} lines:
4633
4634 @itemize @bullet
4635 @cindex Unique nodename requirement
4636 @cindex Nodename must be unique
4637 @item
4638 All the node names for a single Info file must be unique.@refill
4639
4640 Duplicates confuse the Info movement commands.  This means, for
4641 example, that if you end every chapter with a summary, you must name
4642 each summary node differently.  You cannot just call each one
4643 ``Summary''.  You may, however, duplicate the titles of chapters, sections,
4644 and the like.  Thus you can end each chapter in a book with a section
4645 called ``Summary'', so long as the node names for those sections are all
4646 different.@refill
4647
4648 @item
4649 A pointer name must be the name of a node.@refill
4650
4651 The node to which a pointer points may come before or after the
4652 node containing the pointer.@refill
4653
4654 @cindex @@-command in nodename
4655 @cindex Nodename, cannot contain
4656 @item
4657 You cannot use any of the Texinfo @@-commands in a node name;
4658 @w{@@-commands} confuse Info.@refill
4659
4660 @need 750
4661 Thus, the beginning of the section called @code{@@chapter} looks like
4662 this:@refill
4663
4664 @smallexample
4665 @group
4666 @@node  chapter, unnumbered & appendix, makeinfo top, Structuring
4667 @@comment  node-name,  next,  previous,  up
4668 @@section @@code@{@@@@chapter@}
4669 @@findex chapter
4670 @end group
4671 @end smallexample
4672
4673 @cindex Comma in nodename
4674 @cindex Colon in nodename
4675 @cindex Apostrophe in nodename
4676 @item
4677 You cannot use commas, colons, or apostrophes within a node name; these
4678 confuse @TeX{} or the Info formatters.@refill
4679
4680 @need 700
4681 For example, the following is a section title:
4682
4683 @smallexample
4684 @@code@{@@@@unnumberedsec@}, @@code@{@@@@appendixsec@}, @@code@{@@@@heading@}
4685 @end smallexample
4686
4687 @noindent
4688 The corresponding node name is:
4689
4690 @smallexample
4691 unnumberedsec appendixsec heading
4692 @end smallexample
4693
4694 @cindex Case in nodename
4695 @item
4696 Case is significant.
4697 @end itemize
4698
4699 @node First Node, makeinfo top command, Node Line Requirements, node
4700 @comment  node-name,  next,  previous,  up
4701 @subsection The First Node
4702 @cindex @samp{@r{Top}} node is first
4703 @cindex First node
4704
4705 The first node of a Texinfo file is the `Top' node, except in an
4706 included file (@pxref{Include Files}).
4707
4708 The `Top' node (which must be named @samp{top} or @samp{Top}) should
4709 have as its `Up' and `Previous' nodes the name of a node in another
4710 file, where there is a menu that leads to this file.  Specify the file
4711 name in parentheses.  If the file is to be installed directly in the
4712 Info directory file, use @samp{(dir)} as the parent of the `Top' node;
4713 this is short for @samp{(dir)top}, and specifies the `Top' node in the
4714 @file{dir} file, which contains the main menu for Info.  For example,
4715 the @code{@@node Top} line of this manual looks like this:@refill
4716
4717 @example
4718 @@node Top, Overview, (dir), (dir)
4719 @end example
4720
4721 @noindent
4722 (You may use the Texinfo updating commands or the @code{makeinfo}
4723 utility to insert these `Next' and @samp{(dir)} pointers
4724 automatically.)@refill
4725
4726 @xref{Install an Info File}, for more information about installing
4727 an Info file in the @file{info} directory.@refill
4728
4729 The `Top' node contains the main or master menu for the document.
4730
4731 @node makeinfo top command, Top Node Summary, First Node, node
4732 @comment  node-name,  next,  previous,  up
4733 @subsection The @code{@@top} Sectioning Command
4734 @findex top @r{(@@-command)}
4735
4736 A special sectioning command, @code{@@top}, has been created for use
4737 with the @code{@@node Top} line.  The @code{@@top} sectioning command tells
4738 @code{makeinfo} that it marks the `Top' node in the file.  It provides
4739 the information that @code{makeinfo} needs to insert node
4740 pointers automatically.  Write the @code{@@top} command at the
4741 beginning of the line immediately following the @code{@@node Top}
4742 line.  Write the title on the remaining part of the same line as the
4743 @code{@@top} command.@refill
4744
4745 In Info, the @code{@@top} sectioning command causes the title to appear on a
4746 line by itself, with a line of asterisks inserted underneath.@refill
4747
4748 In @TeX{} and @code{texinfo-format-buffer}, the @code{@@top}
4749 sectioning command is merely a synonym for @code{@@unnumbered}.
4750 Neither of these formatters require an @code{@@top} command, and do
4751 nothing special with it.  You can use @code{@@chapter} or
4752 @code{@@unnumbered} after the @code{@@node Top} line when you use
4753 these formatters.  Also, you can use @code{@@chapter} or
4754 @code{@@unnumbered} when you use the Texinfo updating commands to
4755 create or update pointers and menus.@refill
4756
4757 @node Top Node Summary, , makeinfo top command, node
4758 @subsection The `Top' Node Summary
4759 @cindex @samp{@r{Top}} node summary
4760
4761 You can help readers by writing a summary in the `Top' node, after the
4762 @code{@@top} line, before the main or master menu.  The summary should
4763 briefly describe the document.  In Info, this summary will appear just
4764 before the master menu.  In a printed manual, this summary will appear
4765 on a page of its own.@refill
4766
4767 If you do not want the summary to appear on a page of its own in a
4768 printed manual, you can enclose the whole of the `Top' node, including
4769 the @code{@@node Top} line and the @code{@@top} sectioning command line
4770 or other sectioning command line between @code{@@ifinfo} and @code{@@end
4771 ifinfo}.  This prevents any of the text from appearing in the printed
4772 output. (@pxref{Conditionals, , Conditionally Visible Text}).  You can
4773 repeat the brief description from the `Top' node within @code{@@iftex}
4774 @dots{} @code{@@end iftex} at the beginning of the first chapter, for
4775 those who read the printed manual.  This saves paper and may look
4776 neater.@refill
4777
4778 You should write the version number of the program to which the manual
4779 applies in the summary.  This helps the reader keep track of which
4780 manual is for which version of the program.  If the manual changes more
4781 frequently than the program or is independent of it, you should also
4782 include an edition number for the manual.  (The title page should also
4783 contain this information: see @ref{titlepage, ,
4784 @code{@@titlepage}}.)@refill
4785
4786 @node makeinfo Pointer Creation, , node, Nodes
4787 @section Creating Pointers with @code{makeinfo}
4788 @cindex Creating pointers with @code{makeinfo}
4789 @cindex Pointer creation with @code{makeinfo}
4790 @cindex Automatic pointer creation with @code{makeinfo}
4791
4792 The @code{makeinfo} program has a feature for automatically creating
4793 node pointers for a hierarchically organized file that lacks
4794 them.@refill
4795
4796 When you take advantage of this feature, you do not need to write the
4797 `Next', `Previous', and `Up' pointers after the name of a node.
4798 However, you must write a sectioning command, such as @code{@@chapter}
4799 or @code{@@section}, on the line immediately following each truncated
4800 @code{@@node} line.  You cannot write a comment line after a node
4801 line; the section line must follow it immediately.@refill
4802
4803 In addition, you must follow the `Top' @code{@@node} line with a line beginning
4804 with @code{@@top} to mark the `Top' node in the file. @xref{makeinfo
4805 top, , @code{@@top}}.
4806
4807 Finally, you must write the name of each node (except for the `Top'
4808 node) in a menu that is one or more hierarchical levels above the
4809 node's hierarchical level.@refill
4810
4811 This node pointer insertion feature in @code{makeinfo} is an
4812 alternative to the menu and pointer creation and update commands in
4813 Texinfo mode.  (@xref{Updating Nodes and Menus}.)  It is especially
4814 helpful to people who do not use GNU Emacs for writing Texinfo
4815 documents.@refill
4816
4817 @node Menus, Cross References, Nodes, Top
4818 @comment  node-name,  next,  previous,          up
4819 @chapter Menus
4820 @cindex Menus
4821 @findex menu
4822
4823 @dfn{Menus} contain pointers to subordinate
4824 nodes.@footnote{Menus can carry you to any node, regardless
4825 of the hierarchical structure; even to nodes in a different
4826 Info file.  However, the GNU Emacs Texinfo mode updating
4827 commands work only to create menus of subordinate nodes.
4828 Conventionally, cross references are used to refer to other
4829 nodes.} In Info, you use menus to go to such nodes.  Menus
4830 have no effect in printed manuals and do not appear in
4831 them.@refill
4832
4833 By convention, a menu is put at the end of a node since a reader who
4834 uses the menu may not see text that follows it.@refill
4835
4836 @ifinfo
4837 A node that has a menu should @emph{not} contain much text.  If you
4838 have a lot of text and a menu, move most of the text into a new
4839 subnode---all but a few lines.@refill
4840 @end ifinfo
4841 @iftex
4842 @emph{A node that has a menu should not contain much text.} If you
4843 have a lot of text and a menu, move most of the text into a new
4844 subnode---all but a few lines.  Otherwise, a reader with a terminal
4845 that displays only a few lines may miss the menu and its associated
4846 text.  As a practical matter, you should locate a menu within 20 lines
4847 of the beginning of the node.@refill
4848 @end iftex
4849
4850 @menu
4851 * Menu Location::               Put a menu in a short node.
4852 * Writing a Menu::              What is a menu?
4853 * Menu Parts::                  A menu entry has three parts.
4854 * Less Cluttered Menu Entry::   Two part menu entry.
4855 * Menu Example::                Two and three part menu entries.
4856 * Other Info Files::            How to refer to a different Info file.
4857 @end menu
4858
4859 @node Menu Location, Writing a Menu, Menus, Menus
4860 @ifinfo
4861 @heading Menus Need Short Nodes
4862 @end ifinfo
4863 @cindex Menu location
4864 @cindex Location of menus
4865 @cindex Nodes for menus are short
4866 @cindex Short nodes for menus
4867
4868 @ifinfo
4869 A reader can easily see a menu that is close to the beginning of the
4870 node.  The node should be short.  As a practical matter, you should
4871 locate a menu within 20 lines of the beginning of the node.
4872 Otherwise, a reader with a terminal that displays only a few lines may
4873 miss the menu and its associated text.@refill
4874 @end ifinfo
4875
4876 The short text before a menu may look awkward in a printed manual.  To
4877 avoid this, you can write a menu near the beginning of its node and
4878 follow the menu by an @code{@@node} line, and then an @code{@@heading}
4879 line located within @code{@@ifinfo} and @code{@@end ifinfo}.  This way,
4880 the menu, @code{@@node} line, and title appear only in the Info file,
4881 not the printed document.@refill
4882
4883 For example, the preceding two paragraphs follow an Info-only menu,
4884 @code{@@node} line, and heading, and look like this:@refill
4885
4886 @example
4887 @group
4888 @@menu
4889 * Menu Location::             Put a menu in a short node.
4890 * Writing a Menu::            What is a menu?
4891 * Menu Parts::                A menu entry has three parts.
4892 * Less Cluttered Menu Entry:: Two part menu entry.
4893 * Menu Example::              Two and three part entries.
4894 * Other Info Files::          How to refer to a different
4895                                 Info file.
4896 @@end menu
4897
4898 @@node Menu Location, Writing a Menu, , Menus
4899 @@ifinfo
4900 @@heading Menus Need Short Nodes
4901 @@end ifinfo
4902 @end group
4903 @end example
4904
4905 The Texinfo file for this document contains more than a dozen
4906 examples of this procedure.  One is at the beginning of this chapter;
4907 another is at the beginning of the ``Cross References'' chapter.@refill
4908
4909 @node Writing a Menu, Menu Parts, Menu Location, Menus
4910 @section Writing a Menu
4911 @cindex Writing a menu
4912 @cindex Menu writing
4913
4914 A menu consists of an @code{@@menu} command on a line by
4915 itself followed by menu entry lines or menu comment lines
4916 and then by an @code{@@end menu} command on a line by
4917 itself.@refill
4918
4919 A menu looks like this:@refill
4920
4921 @example
4922 @group
4923 @@menu
4924 Larger Units of Text
4925
4926 * Files::                       All about handling files.
4927 * Multiples: Buffers.           Multiple buffers; editing
4928                                   several files at once.
4929 @@end menu
4930 @end group
4931 @end example
4932
4933 In a menu, every line that begins with an @w{@samp{* }} is a
4934 @dfn{menu entry}.  (Note the space after the asterisk.)  A
4935 line that does not start with an @w{@samp{* }} may also
4936 appear in a menu.  Such a line is not a menu entry but is a
4937 menu comment line that appears in the Info file.  In
4938 the example above, the line @samp{Larger Units of Text} is a
4939 menu comment line; the two lines starting with @w{@samp{* }}
4940 are menu entries.
4941
4942 @node Menu Parts, Less Cluttered Menu Entry, Writing a Menu, Menus
4943 @section The Parts of a Menu
4944 @cindex Parts of a menu
4945 @cindex Menu parts
4946 @cindex @code{@@menu} parts
4947
4948 A menu entry has three parts, only the second of which is
4949 required:@refill
4950
4951 @enumerate
4952 @item
4953 The menu entry name.
4954
4955 @item
4956 The name of the node (required).
4957
4958 @item
4959 A description of the item.
4960 @end enumerate
4961
4962 The template for a menu entry looks like this:@refill
4963
4964 @example
4965 * @var{menu-entry-name}: @var{node-name}.   @var{description}
4966 @end example
4967
4968 Follow the menu entry name with a single colon and follow the node name
4969 with tab, comma, period, or newline.@refill
4970
4971 In Info, a user selects a node with the @kbd{m} (@code{Info-menu})
4972 command.  The menu entry name is what the user types after the @kbd{m}
4973 command.@refill
4974
4975 The third part of a menu entry is a descriptive phrase or
4976 sentence.  Menu entry names and node names are often short; the
4977 description explains to the reader what the node is about.  The
4978 description, which is optional, can spread over two or more lines.  A
4979 useful description complements the node name rather than repeats
4980 it.@refill
4981
4982 @node Less Cluttered Menu Entry, Menu Example, Menu Parts, Menus
4983 @comment  node-name,  next,  previous,  up
4984 @section Less Cluttered Menu Entry
4985 @cindex Two part menu entry
4986 @cindex Double-colon menu entries
4987 @cindex Menu entries with two colons
4988 @cindex Less cluttered menu entry
4989 @cindex Uncluttered menu entry
4990
4991 When the menu entry name and node name are the same, you can write
4992 the name immediately after the asterisk and space at the beginning of
4993 the line and follow the name with two colons.@refill
4994
4995 @need 800
4996 For example, write
4997
4998 @example
4999 * Name::                                    @var{description}
5000 @end example
5001
5002 @need 800
5003 @noindent
5004 instead of
5005
5006 @example
5007 * Name: Name.                               @var{description}
5008 @end example
5009
5010 You should use the node name for the menu entry name whenever possible,
5011 since it reduces visual clutter in the menu.@refill
5012
5013 @node Menu Example, Other Info Files, Less Cluttered Menu Entry, Menus
5014 @comment  node-name,  next,  previous,  up
5015 @section A Menu Example
5016 @cindex Menu example
5017 @cindex Example menu
5018
5019 A menu looks like this in Texinfo:@refill
5020
5021 @example
5022 @group
5023 @@menu
5024 * menu entry name: Node name.   A short description.
5025 * Node name::                   This form is preferred.
5026 @@end menu
5027 @end group
5028 @end example
5029
5030 @need 800
5031 @noindent
5032 This produces:
5033
5034 @example
5035 @group
5036 * menu:
5037
5038 * menu entry name: Node name.   A short description.
5039 * Node name::                   This form is preferred.
5040 @end group
5041 @end example
5042
5043 @need 700
5044 Here is an example as you might see it in a Texinfo file:@refill
5045
5046 @example
5047 @group
5048 @@menu
5049 Larger Units of Text
5050
5051 * Files::                       All about handling files.
5052 * Multiples: Buffers.           Multiple buffers; editing
5053                                   several files at once.
5054 @@end menu
5055 @end group
5056 @end example
5057
5058 @need 800
5059 @noindent
5060 This produces:
5061
5062 @example
5063 @group
5064 * menu:
5065 Larger Units of Text
5066
5067 * Files::                       All about handling files.
5068 * Multiples: Buffers.           Multiple buffers; editing
5069                                   several files at once.
5070 @end group
5071 @end example
5072
5073 In this example, the menu has two entries.  @samp{Files} is both a menu
5074 entry name and the name of the node referred to by that name.
5075 @samp{Multiples} is the menu entry name; it refers to the node named
5076 @samp{Buffers}. The line @samp{Larger Units of Text} is a comment; it
5077 appears in the menu, but is not an entry.@refill
5078
5079 Since no file name is specified with either @samp{Files} or
5080 @samp{Buffers}, they must be the names of nodes in the same Info file
5081 (@pxref{Other Info Files, , Referring to Other Info Files}).@refill
5082
5083 @node Other Info Files, , Menu Example, Menus
5084 @comment  node-name,  next,  previous,  up
5085 @section Referring to Other Info Files
5086 @cindex Referring to other Info files
5087 @cindex Nodes in other Info files
5088 @cindex Other Info files' nodes
5089 @cindex Going to other Info files' nodes
5090 @cindex Info; other files' nodes
5091
5092 You can create a menu entry that enables a reader in Info to go to a
5093 node in another Info file by writing the file name in parentheses just
5094 before the node name.  In this case, you should use the three-part menu
5095 entry format, which saves the reader from having to type the file
5096 name.@refill
5097
5098 @need 800
5099 The format looks like this:@refill
5100
5101 @example
5102 @group
5103 @@menu
5104 * @var{first-entry-name}:(@var{filename})@var{nodename}.     @var{description}
5105 * @var{second-entry-name}:(@var{filename})@var{second-node}. @var{description}
5106 @@end menu
5107 @end group
5108 @end example
5109
5110 For example, to refer directly to the @samp{Outlining} and
5111 @samp{Rebinding} nodes in the @cite{Emacs Manual}, you would write a
5112 menu like this:@refill
5113
5114 @example
5115 @group
5116 @@menu
5117 * Outlining: (emacs)Outline Mode. The major mode for
5118                                   editing outlines.
5119 * Rebinding: (emacs)Rebinding.    How to redefine the
5120                                   meaning of a key.
5121 @@end menu
5122 @end group
5123 @end example
5124
5125 If you do not list the node name, but only name the file, then Info
5126 presumes that you are referring to the `Top' node.@refill
5127
5128 The @file{dir} file that contains the main menu for Info has menu
5129 entries that list only file names.  These take you directly to the `Top'
5130 nodes of each Info document.  (@xref{Install an Info File}.)@refill
5131
5132 @need 700
5133 For example:
5134
5135 @example
5136 @group
5137 * Info: (info).         Documentation browsing system.
5138 * Emacs: (emacs).       The extensible, self-documenting
5139                         text editor.
5140 @end group
5141 @end example
5142
5143 @noindent
5144 (The @file{dir} top level directory for the Info system is an Info file,
5145 not a Texinfo file, but a menu entry looks the same in both types of
5146 file.)@refill
5147
5148 Note that the GNU Emacs Texinfo mode menu updating commands only work
5149 with nodes within the current buffer, so you cannot use them to create
5150 menus that refer to other files.  You must write such menus by hand.@refill
5151
5152 @node Cross References, Marking Text, Menus, Top
5153 @comment  node-name,  next,  previous,  up
5154 @chapter Cross References
5155 @cindex Making cross references
5156 @cindex Cross references
5157 @cindex References
5158
5159 @dfn{Cross references} are used to refer the reader to other parts of the
5160 same or different Texinfo files.  In Texinfo, nodes are the
5161 places to which cross references can refer.@refill
5162
5163 @menu
5164 * References::                  What cross references are for.
5165 * Cross Reference Commands::    A summary of the different commands.
5166 * Cross Reference Parts::       A cross reference has several parts.
5167 * xref::                        Begin a reference with `See' @dots{}
5168 * Top Node Naming::             How to refer to the beginning of another file.
5169 * ref::                         A reference for the last part of a sentence.
5170 * pxref::                       How to write a parenthetical cross reference.
5171 * inforef::                     How to refer to an Info-only file.
5172 @end menu
5173
5174 @node References, Cross Reference Commands, Cross References, Cross References
5175 @ifinfo
5176 @heading What References Are For
5177 @end ifinfo
5178
5179 Often, but not always, a printed document should be designed so that
5180 it can be read sequentially.  People tire of flipping back and forth
5181 to find information that should be presented to them as they need
5182 it.@refill
5183
5184 However, in any document, some information will be too detailed for
5185 the current context, or incidental to it; use cross references to
5186 provide access to such information.  Also, an on-line help system or a
5187 reference manual is not like a novel; few read such documents in
5188 sequence from beginning to end.  Instead, people look up what they
5189 need.  For this reason, such creations should contain many cross
5190 references to help readers find other information that they may not
5191 have read.@refill
5192
5193 In a printed manual, a cross reference results in a page reference,
5194 unless it is to another manual altogether, in which case the cross
5195 reference names that manual.@refill
5196
5197 In Info, a cross reference results in an entry that you can follow using
5198 the Info @samp{f} command.  (@inforef{Help-Adv, Some advanced Info
5199 commands, info}.)@refill
5200
5201 The various cross reference commands use nodes to define cross
5202 reference locations.  This is evident in Info, in which a cross
5203 reference takes you to the specified node.  @TeX{} also uses nodes to
5204 define cross reference locations, but the action is less obvious.  When
5205 @TeX{} generates a @sc{dvi} file, it records nodes' page numbers and
5206 uses the page numbers in making references.  Thus, if you are writing
5207 a manual that will only be printed, and will not be used on-line, you
5208 must nonetheless write @code{@@node} lines to name the places to which
5209 you make cross references.@refill
5210
5211 @need 800
5212 @node Cross Reference Commands, Cross Reference Parts, References, Cross References
5213 @comment  node-name,  next,  previous,  up
5214 @section Different Cross Reference Commands
5215 @cindex Different cross reference commands
5216
5217 There are four different cross reference commands:@refill
5218
5219 @table @code
5220 @item @@xref
5221 Used to start a sentence in the printed manual saying @w{`See @dots{}'}
5222 or an Info cross-reference saying @samp{*Note @var{name}: @var{node}.}.
5223
5224 @item @@ref
5225 Used within or, more often, at the end of a sentence; same as
5226 @code{@@xref} for Info; produces just the reference in the printed
5227 manual without a preceding `See'.@refill
5228
5229 @item @@pxref
5230 Used within parentheses to make a reference that suits both an Info
5231 file and a printed book.  Starts with a lower case `see' within the
5232 printed manual. (@samp{p} is for `parenthesis'.)@refill
5233
5234 @item @@inforef
5235 Used to make a reference to an Info file for which there is no printed
5236 manual.@refill
5237 @end table
5238
5239 @noindent
5240 (The @code{@@cite} command is used to make references to books and
5241 manuals for which there is no corresponding Info file and, therefore,
5242 no node to which to point.   @xref{cite, , @code{@@cite}}.)@refill
5243
5244 @node Cross Reference Parts, xref, Cross Reference Commands, Cross References
5245 @comment  node-name,  next,  previous,  up
5246 @section Parts of a Cross Reference
5247 @cindex Cross reference parts
5248 @cindex Parts of a cross reference
5249
5250 A cross reference command requires only one argument, which is the
5251 name of the node to which it refers.  But a cross reference command
5252 may contain up to four additional arguments.  By using these
5253 arguments, you can provide a cross reference name for Info, a topic
5254 description or section title for the printed output, the name of a
5255 different Info file, and the name of a different printed
5256 manual.@refill
5257
5258 Here is a simple cross reference example:@refill
5259
5260 @example
5261 @@xref@{Node name@}.
5262 @end example
5263
5264 @noindent
5265 which produces
5266
5267 @example
5268 *Note Node name::.
5269 @end example
5270
5271 @noindent
5272 and
5273
5274 @quotation
5275 See Section @var{nnn} [Node name], page @var{ppp}.
5276 @end quotation
5277
5278 @need 700
5279 Here is an example of a full five-part cross reference:@refill
5280
5281 @example
5282 @group
5283 @@xref@{Node name, Cross Reference Name, Particular Topic,
5284 info-file-name, A Printed Manual@}, for details.
5285 @end group
5286 @end example
5287
5288 @noindent
5289 which produces
5290
5291 @example
5292 *Note Cross Reference Name: (info-file-name)Node name,
5293 for details.
5294 @end example
5295
5296 @noindent
5297 in Info and
5298
5299 @quotation
5300 See section ``Particular Topic'' in @i{A Printed Manual}, for details.
5301 @end quotation
5302
5303 @noindent
5304 in a printed book.
5305
5306 The five possible arguments for a cross reference are:@refill
5307
5308 @enumerate
5309 @item
5310 The node name (required).  This is the node to which the
5311 cross reference takes you.  In a printed document, the location of the
5312 node provides the page reference only for references within the same
5313 document.@refill
5314
5315 @item
5316 The cross reference name for the Info reference, if it is to be different
5317 from the node name.  If you include this argument, it argument becomes
5318 the first part of the cross reference. It is usually omitted.@refill
5319
5320 @item
5321 A topic description or section name.  Often, this is the title of the
5322 section.  This is used as the name of the reference in the printed
5323 manual.  If omitted, the node name is used.@refill
5324
5325 @item
5326 The name of the Info file in which the reference is located, if it is
5327 different from the current file.@refill
5328
5329 @item
5330 The name of a printed manual from a different Texinfo file.@refill
5331 @end enumerate
5332
5333 The template for a full five argument cross reference looks like
5334 this:@refill
5335
5336 @example
5337 @group
5338 @@xref@{@var{node-name}, @var{cross-reference-name}, @var{title-or-topic},
5339 @var{info-file-name}, @var{printed-manual-title}@}.
5340 @end group
5341 @end example
5342
5343 Cross references with one, two, three, four, and five arguments are
5344 described separately following the description of @code{@@xref}.@refill
5345
5346 Write a node name in a cross reference in exactly the same way as in
5347 the @code{@@node} line, including the same capitalization; otherwise, the
5348 formatters may not find the reference.@refill
5349
5350 You can write cross reference commands within a paragraph, but note
5351 how Info and @TeX{} format the output of each of the various commands:
5352 write @code{@@xref} at the beginning of a sentence; write
5353 @code{@@pxref} only within parentheses, and so on.@refill
5354
5355 @node xref, Top Node Naming, Cross Reference Parts, Cross References
5356 @comment  node-name,  next,  previous,  up
5357 @section @code{@@xref}
5358 @findex xref
5359 @cindex Cross references using @code{@@xref}
5360 @cindex References using @code{@@xref}
5361
5362 The @code{@@xref} command generates a cross reference for the
5363 beginning of a sentence.  The Info formatting commands convert it into
5364 an Info cross reference, which the Info @samp{f} command can use to
5365 bring you directly to another node.  The @TeX{} typesetting commands
5366 convert it into a page reference, or a reference to another book or
5367 manual.@refill
5368
5369 @menu
5370 * Reference Syntax::            What a reference looks like and requires.
5371 * One Argument::                @code{@@xref} with one argument.
5372 * Two Arguments::               @code{@@xref} with two arguments.
5373 * Three Arguments::             @code{@@xref} with three arguments.
5374 * Four and Five Arguments::     @code{@@xref} with four and five arguments.
5375 @end menu
5376
5377 @node Reference Syntax, One Argument, xref, xref
5378 @ifinfo
5379 @subheading What a Reference Looks Like and Requires
5380 @end ifinfo
5381
5382 Most often, an Info cross reference looks like this:@refill
5383
5384 @example
5385 *Note @var{node-name}::.
5386 @end example
5387
5388 @noindent
5389 or like this
5390
5391 @example
5392 *Note @var{cross-reference-name}: @var{node-name}.
5393 @end example
5394
5395 @noindent
5396 In @TeX{}, a cross reference looks like this:
5397
5398 @example
5399 See Section @var{section-number} [@var{node-name}], page @var{page}.
5400 @end example
5401
5402 @noindent
5403 or like this
5404
5405 @example
5406 See Section @var{section-number} [@var{title-or-topic}], page @var{page}.
5407 @end example
5408
5409 The @code{@@xref} command does not generate a period or comma to end
5410 the cross reference in either the Info file or the printed output.
5411 You must write that period or comma yourself; otherwise, Info will not
5412 recognize the end of the reference.  (The @code{@@pxref} command works
5413 differently.  @xref{pxref, , @code{@@pxref}}.)@refill
5414
5415 @quotation
5416 @strong{Please note:} A period or comma @strong{must} follow the closing
5417 brace of an @code{@@xref}.  It is required to terminate the cross
5418 reference.  This period or comma will appear in the output, both in
5419 the Info file and in the printed manual.@refill
5420 @end quotation
5421
5422 @code{@@xref} must refer to an Info node by name.  Use @code{@@node}
5423 to define the node (@pxref{Writing a Node}).@refill
5424
5425 @code{@@xref} is followed by several arguments inside braces, separated by
5426 commas.  Whitespace before and after these commas is ignored.@refill
5427
5428 A cross reference requires only the name of a node; but it may contain
5429 up to four additional arguments.  Each of these variations produces a
5430 cross reference that looks somewhat different.@refill
5431
5432 @quotation
5433 @strong{Please note:} Commas separate arguments in a cross reference;
5434 avoid including them in the title or other part lest the formatters
5435 mistake them for separators.@refill
5436 @end quotation
5437
5438 @node One Argument, Two Arguments, Reference Syntax, xref
5439 @subsection @code{@@xref} with One Argument
5440
5441 The simplest form of @code{@@xref} takes one argument, the name of
5442 another node in the same Info file.    The Info formatters produce
5443 output that the Info readers can use to jump to the reference; @TeX{}
5444 produces output that specifies the page and section number for you.@refill
5445
5446 @need 700
5447 @noindent
5448 For example,
5449
5450 @example
5451 @@xref@{Tropical Storms@}.
5452 @end example
5453
5454 @noindent
5455 produces
5456
5457 @example
5458 *Note Tropical Storms::.
5459 @end example
5460
5461 @noindent
5462 and
5463
5464 @quotation
5465 See Section 3.1 [Tropical Storms], page 24.
5466 @end quotation
5467
5468 @noindent
5469 (Note that in the preceding example the closing brace is followed by a
5470 period.)@refill
5471
5472 You can write a clause after the cross reference, like this:@refill
5473
5474 @example
5475 @@xref@{Tropical Storms@}, for more info.
5476 @end example
5477
5478 @noindent
5479 which produces
5480
5481 @example
5482 *Note Tropical Storms::, for more info.
5483 @end example
5484
5485 @quotation
5486 See Section 3.1 [Tropical Storms], page 24, for more info.
5487 @end quotation
5488
5489 @noindent
5490 (Note that in the preceding example the closing brace is followed by a
5491 comma, and then by the clause, which is followed by a period.)@refill
5492
5493 @node Two Arguments, Three Arguments, One Argument, xref
5494 @subsection @code{@@xref} with Two Arguments
5495
5496 With two arguments, the second is used as the name of the Info cross
5497 reference, while the first is still the name of the node to which the
5498 cross reference points.@refill
5499
5500 @need 750
5501 @noindent
5502 The template is like this:
5503
5504 @example
5505 @@xref@{@var{node-name}, @var{cross-reference-name}@}.
5506 @end example
5507
5508 @need 700
5509 @noindent
5510 For example,
5511
5512 @example
5513 @@xref@{Electrical Effects, Lightning@}.
5514 @end example
5515
5516 @noindent
5517 produces:
5518
5519 @example
5520 *Note Lightning: Electrical Effects.
5521 @end example
5522
5523 @noindent
5524 and
5525
5526 @quotation
5527 See Section 5.2 [Electrical Effects], page 57.
5528 @end quotation
5529
5530 @noindent
5531 (Note that in the preceding example the closing brace is followed by a
5532 period; and that the node name is printed, not the cross reference name.)@refill
5533
5534 You can write a clause after the cross reference, like this:@refill
5535
5536 @example
5537 @@xref@{Electrical Effects, Lightning@}, for more info.
5538 @end example
5539
5540 @noindent
5541 which produces
5542 @example
5543 *Note Lightning: Electrical Effects, for more info.
5544 @end example
5545
5546 @noindent
5547 and
5548
5549 @quotation
5550 See Section 5.2 [Electrical Effects], page 57, for more info.
5551 @end quotation
5552
5553 @noindent
5554 (Note that in the preceding example the closing brace is followed by a
5555 comma, and then by the clause, which is followed by a period.)@refill
5556
5557 @node Three Arguments, Four and Five Arguments, Two Arguments, xref
5558 @subsection @code{@@xref} with Three Arguments
5559
5560 A third argument replaces the node name in the @TeX{} output.  The third
5561 argument should be the name of the section in the printed output, or
5562 else state the topic discussed by that section.  Often, you will want to
5563 use initial upper case letters so it will be easier to read when the
5564 reference is printed.  Use a third argument when the node name is
5565 unsuitable because of syntax or meaning.@refill
5566
5567 Remember to avoid placing a comma within the title or topic section of
5568 a cross reference, or within any other section.  The formatters divide
5569 cross references into arguments according to the commas; a comma
5570 within a title or other section will divide it into two arguments.  In
5571 a reference, you need to write a title such as ``Clouds, Mist, and
5572 Fog'' without the commas.@refill
5573
5574 Also, remember to write a comma or period after the closing brace of a
5575 @code{@@xref} to terminate the cross reference.  In the following
5576 examples, a clause follows a terminating comma.@refill
5577
5578
5579 @need 750
5580 @noindent
5581 The template is like this:
5582
5583 @example
5584 @group
5585 @@xref@{@var{node-name}, @var{cross-reference-name}, @var{title-or-topic}@}.
5586 @end group
5587 @end example
5588
5589 @need 700
5590 @noindent
5591 For example,
5592
5593 @example
5594 @group
5595 @@xref@{Electrical Effects, Lightning, Thunder and Lightning@},
5596 for details.
5597 @end group
5598 @end example
5599
5600 @noindent
5601 produces
5602
5603 @example
5604 *Note Lightning: Electrical Effects, for details.
5605 @end example
5606
5607 @noindent
5608 and
5609
5610 @quotation
5611 See Section 5.2 [Thunder and Lightning], page 57, for details.
5612 @end quotation
5613
5614 If a third argument is given and the second one is empty, then the
5615 third argument serves both.  (Note how two commas, side by side, mark
5616 the empty second argument.)@refill
5617
5618 @example
5619 @group
5620 @@xref@{Electrical Effects, , Thunder and Lightning@},
5621 for details.
5622 @end group
5623 @end example
5624
5625 @noindent
5626 produces
5627
5628 @example
5629 *Note Thunder and Lightning: Electrical Effects, for details.
5630 @end example
5631
5632 @noindent
5633 and
5634
5635 @quotation
5636 See Section 5.2 [Thunder and Lightning], page 57, for details.
5637 @end quotation
5638
5639 As a practical matter, it is often best to write cross references with
5640 just the first argument if the node name and the section title are the
5641 same, and with the first and third arguments if the node name and title
5642 are different.@refill
5643
5644 Here are several examples from @cite{The GAWK Manual}:@refill
5645
5646 @smallexample
5647 @@xref@{Sample Program@}.
5648 @@xref@{Glossary@}.
5649 @@xref@{Case-sensitivity, ,Case-sensitivity in Matching@}.
5650 @@xref@{Close Output, , Closing Output Files and Pipes@},
5651    for more information.
5652 @@xref@{Regexp, , Regular Expressions as Patterns@}.
5653 @end smallexample
5654
5655 @node Four and Five Arguments, , Three Arguments, xref
5656 @subsection @code{@@xref} with Four and Five Arguments
5657
5658 In a cross reference, a fourth argument specifies the name of another
5659 Info file, different from the file in which the reference appears, and
5660 a fifth argument specifies its title as a printed manual.@refill
5661
5662 Remember that a comma or period must follow the closing brace of an
5663 @code{@@xref} command to terminate the cross reference.  In the
5664 following examples, a clause follows a terminating comma.@refill
5665
5666 @need 800
5667 @noindent
5668 The template is:
5669
5670 @example
5671 @group
5672 @@xref@{@var{node-name}, @var{cross-reference-name}, @var{title-or-topic},
5673 @var{info-file-name}, @var{printed-manual-title}@}.
5674 @end group
5675 @end example
5676
5677 @need 700
5678 @noindent
5679 For example,
5680
5681 @example
5682 @@xref@{Electrical Effects, Lightning, Thunder and Lightning,
5683 weather, An Introduction to Meteorology@}, for details.
5684 @end example
5685
5686 @noindent
5687 produces
5688
5689 @example
5690 *Note Lightning: (weather)Electrical Effects, for details.
5691 @end example
5692
5693 @noindent
5694 The name of the Info file is enclosed in parentheses and precedes
5695 the name of the node.
5696
5697 @noindent
5698 In a printed manual, the reference looks like this:@refill
5699
5700 @quotation
5701 See section ``Thunder and Lightning'' in @i{An Introduction to
5702 Meteorology}, for details.
5703 @end quotation
5704
5705 @noindent
5706 The title of the printed manual is typeset in italics; and the
5707 reference lacks a page number since @TeX{} cannot know to which page a
5708 reference refers when that reference is to another manual.@refill
5709
5710 Often, you will leave out the second argument when you use the long
5711 version of @code{@@xref}.  In this case, the third argument, the topic
5712 description, will be used as the cross reference name in Info.@refill
5713
5714 @noindent
5715 The template looks like this:
5716
5717 @example
5718 @@xref@{@var{node-name}, , @var{title-or-topic}, @var{info-file-name},
5719 @var{printed-manual-title}@}, for details.
5720 @end example
5721
5722 @noindent
5723 which produces
5724
5725 @example
5726 *Note @var{title-or-topic}: (@var{info-file-name})@var{node-name}, for details.
5727 @end example
5728
5729 @noindent
5730 and
5731
5732 @quotation
5733 See section @var{title-or-topic} in @var{printed-manual-title}, for details.
5734 @end quotation
5735
5736 @need 700
5737 @noindent
5738 For example,
5739
5740 @example
5741 @@xref@{Electrical Effects, , Thunder and Lightning,
5742 weather, An Introduction to Meteorology@}, for details.
5743 @end example
5744
5745 @noindent
5746 produces
5747
5748 @example
5749 @group
5750 *Note Thunder and Lightning: (weather)Electrical Effects,
5751 for details.
5752 @end group
5753 @end example
5754
5755 @noindent
5756 and
5757
5758 @quotation
5759 See section ``Thunder and Lightning'' in @i{An Introduction to
5760 Meteorology}, for details.
5761 @end quotation
5762
5763 On rare occasions, you may want to refer to another Info file that
5764 is within a single printed manual---when multiple Texinfo files are
5765 incorporated into the same @TeX{} run but make separate Info files.
5766 In this case, you need to specify only the fourth argument, and not
5767 the fifth.@refill
5768
5769 @node Top Node Naming, ref, xref, Cross References
5770 @section Naming a `Top' Node
5771 @cindex Naming a `Top' Node in references
5772 @cindex @samp{@r{Top}} node naming for references
5773
5774 In a cross reference, you must always name a node.  This means that in
5775 order to refer to a whole manual, you must identify the `Top' node by
5776 writing it as the first argument to the @code{@@xref} command.  (This
5777 is different from the way you write a menu entry; see @ref{Other Info
5778 Files, , Referring to Other Info Files}.)  At the same time, to
5779 provide a meaningful section topic or title in the printed cross
5780 reference (instead of the word `Top'), you must write an appropriate
5781 entry for the third argument to the @code{@@xref} command.
5782 @refill
5783
5784 @noindent
5785 Thus, to make a cross reference to @cite{The GNU Make Manual},
5786 write:@refill
5787
5788 @example
5789 @@xref@{Top, , Overview, make, The GNU Make Manual@}.
5790 @end example
5791
5792 @noindent
5793 which produces
5794
5795 @example
5796 *Note Overview: (make)Top.
5797 @end example
5798
5799 @noindent
5800 and
5801
5802 @quotation
5803 See section ``Overview'' in @i{The GNU Make Manual}.
5804 @end quotation
5805
5806 @noindent
5807 In this example, @samp{Top} is the name of the first node, and
5808 @samp{Overview} is the name of the first section of the manual.@refill
5809 @node ref, pxref, Top Node Naming, Cross References
5810 @comment  node-name,  next,  previous,  up
5811 @section @code{@@ref}
5812 @cindex Cross references using @code{@@ref}
5813 @cindex References using @code{@@ref}
5814 @findex ref
5815
5816 @code{@@ref} is nearly the same as @code{@@xref} except that it does
5817 not generate a `See' in the printed output, just the reference itself.
5818 This makes it useful as the last part of a sentence.@refill
5819
5820 @need 700
5821 @noindent
5822 For example,
5823
5824 @example
5825 For more information, see @@ref@{Hurricanes@}.
5826 @end example
5827
5828 @noindent
5829 produces
5830
5831 @example
5832 For more information, see *Note Hurricanes.
5833 @end example
5834
5835 @noindent
5836 and
5837
5838 @quotation
5839 For more information, see Section 8.2 [Hurricanes], page 123.
5840 @end quotation
5841
5842 The @code{@@ref} command sometimes leads writers to express themselves
5843 in a manner that is suitable for a printed manual but looks awkward
5844 in the Info format.  Bear in mind that your audience will be using
5845 both the printed and the Info format.@refill
5846
5847 @need 800
5848 @noindent
5849 For example,
5850
5851 @example
5852 @group
5853 Sea surges are described in @@ref@{Hurricanes@}.
5854 @end group
5855 @end example
5856
5857 @need 800
5858 @noindent
5859 produces
5860
5861 @quotation
5862 Sea surges are described in Section 6.7 [Hurricanes], page 72.
5863 @end quotation
5864
5865 @need 800
5866 @noindent
5867 in a printed document, and the following in Info:
5868
5869 @example
5870 Sea surges are described in *Note Hurricanes::.
5871 @end example
5872
5873 @quotation
5874 @strong{Caution:} You @emph{must} write a period or comma immediately
5875 after an @code{@@ref} command with two or more arguments.  Otherwise,
5876 Info will not find the end of the cross reference entry and its
5877 attempt to follow the cross reference will fail.  As a general rule,
5878 you should write a period or comma after every @code{@@ref} command.
5879 This looks best in both the printed and the Info output.@refill
5880 @end quotation
5881
5882 @node pxref, inforef, ref, Cross References
5883 @comment  node-name,  next,  previous,  up
5884 @section @code{@@pxref}
5885 @cindex Cross references using @code{@@pxref}
5886 @cindex References using @code{@@pxref}
5887 @findex pxref
5888
5889 The parenthetical reference command, @code{@@pxref}, is nearly the
5890 same as @code{@@xref}, but you use it @emph{only} inside parentheses
5891 and you do @emph{not} type a comma or period after the command's
5892 closing brace.  The command differs from @code{@@xref} in two
5893 ways:@refill
5894
5895 @enumerate
5896 @item
5897 @TeX{} typesets the reference for the printed manual with a lower case
5898 `see' rather than an upper case `See'.@refill
5899
5900 @item
5901 The Info formatting commands automatically end the reference with a
5902 closing colon or period.@refill
5903 @end enumerate
5904
5905 Because one type of formatting automatically inserts closing
5906 punctuation and the other does not, you should use @code{@@pxref}
5907 @emph{only} inside parentheses as part of another sentence.  Also, you
5908 yourself should not insert punctuation after the reference, as you do
5909 with @code{@@xref}.@refill
5910
5911 @code{@@pxref} is designed so that the output looks right and works
5912 right between parentheses both in printed output and in an Info file.
5913 In a printed manual, a closing comma or period should not follow a
5914 cross reference within parentheses; such punctuation is wrong.  But in
5915 an Info file, suitable closing punctuation must follow the cross
5916 reference so Info can recognize its end.  @code{@@pxref} spares you
5917 the need to use complicated methods to put a terminator into one form
5918 of the output and not the other.@refill
5919
5920 @noindent
5921 With one argument, a parenthetical cross reference looks like
5922 this:@refill
5923
5924 @example
5925 @dots{} storms cause flooding (@@pxref@{Hurricanes@}) @dots{}
5926 @end example
5927
5928 @need 800
5929 @noindent
5930 which produces
5931
5932 @example
5933 @group
5934 @dots{} storms cause flooding (*Note Hurricanes::) @dots{}
5935 @end group
5936 @end example
5937
5938 @noindent
5939 and
5940
5941 @quotation
5942 @dots{} storms cause flooding (see Section 6.7 [Hurricanes], page 72) @dots{}
5943 @end quotation
5944
5945 With two arguments, a parenthetical cross reference has this
5946 template:@refill
5947
5948 @example
5949 @dots{} (@@pxref@{@var{node-name}, @var{cross-reference-name}@}) @dots{}
5950 @end example
5951
5952 @noindent
5953 which produces
5954
5955 @example
5956 @dots{} (*Note @var{cross-reference-name}: @var{node-name}.) @dots{}
5957 @end example
5958
5959 @noindent
5960 and
5961
5962 @need 1500
5963 @quotation
5964 @dots{} (see Section @var{nnn} [@var{node-name}], page @var{ppp}) @dots{}
5965 @end quotation
5966
5967 @code{@@pxref} can be used with up to five arguments just like
5968 @code{@@xref} (@pxref{xref, , @code{@@xref}}).@refill
5969
5970 @quotation
5971 @strong{Please note:} Use @code{@@pxref} only as a parenthetical
5972 reference.  Do not try to use @code{@@pxref} as a clause in a sentence.
5973 It will look bad in either the Info file, the printed output, or
5974 both.@refill
5975
5976 Also, parenthetical cross references look best at the ends of sentences.
5977 Although you may write them in the middle of a sentence, that location
5978 breaks up the flow of text.@refill
5979 @end quotation
5980
5981 @node inforef, , pxref, Cross References
5982 @comment  node-name,  next,  previous,  up
5983 @section @code{@@inforef}
5984 @cindex Cross references using @code{@@inforef}
5985 @cindex References using @code{@@inforef}
5986 @findex inforef
5987
5988 @code{@@inforef} is used for cross references to Info files for which
5989 there are no printed manuals.  Even in a printed manual,
5990 @code{@@inforef} generates a reference directing the user to look in
5991 an Info file.@refill
5992
5993 The command takes either two or three arguments, in the following
5994 order:@refill
5995
5996 @enumerate
5997 @item
5998 The node name.
5999
6000 @item
6001 The cross reference name (optional).
6002
6003 @item
6004 The Info file name.
6005 @end enumerate
6006
6007 @noindent
6008 Separate the arguments with commas, as with @code{@@xref}.  Also, you
6009 must terminate the reference with a comma or period after the
6010 @samp{@}}, as you do with @code{@@xref}.@refill
6011
6012 @noindent
6013 The template is:
6014
6015 @example
6016 @@inforef@{@var{node-name}, @var{cross-reference-name}, @var{info-file-name}@},
6017 @end example
6018
6019 @need 800
6020 @noindent
6021 Thus,
6022
6023 @example
6024 @group
6025 @@inforef@{Expert, Advanced Info commands, info@},
6026 for more information.
6027 @end group
6028 @end example
6029
6030 @need 800
6031 @noindent
6032 produces
6033
6034 @example
6035 @group
6036 *Note Advanced Info commands: (info)Expert,
6037 for more information.
6038 @end group
6039 @end example
6040
6041 @need 800
6042 @noindent
6043 and
6044
6045 @quotation
6046 See Info file @file{info}, node @samp{Expert}, for more information.
6047 @end quotation
6048
6049 @need 800
6050 @noindent
6051 Similarly,
6052
6053 @example
6054 @group
6055 @@inforef@{Expert, , info@}, for more information.
6056 @end group
6057 @end example
6058
6059 @need 800
6060 @noindent
6061 produces
6062
6063 @example
6064 *Note (info)Expert::, for more information.
6065 @end example
6066
6067 @need 800
6068 @noindent
6069 and
6070
6071 @quotation
6072 See Info file @file{info}, node @samp{Expert}, for more information.
6073 @end quotation
6074
6075 The converse of @code{@@inforef} is @code{@@cite}, which is used to
6076 refer to printed works for which no Info form exists.  @xref{cite, ,
6077 @code{@@cite}}.@refill
6078
6079 @node Marking Text, Quotations and Examples, Cross References, Top
6080 @comment  node-name,  next,  previous,  up
6081 @chapter Marking Words and Phrases
6082 @cindex Paragraph, marking text within
6083 @cindex Marking words and phrases
6084 @cindex Words and phrases, marking them
6085 @cindex Marking text within a paragraph
6086
6087 In Texinfo, you can mark words and phrases in a variety of ways.
6088 The Texinfo formatters use this information to determine how to
6089 highlight the text.
6090 You can specify, for example, whether a word or phrase is a
6091 defining occurrence, a metasyntactic variable, or a symbol used in a
6092 program.  Also, you can emphasize text.@refill
6093
6094 @menu
6095 * Indicating::                  How to indicate definitions, files, etc.
6096 * Emphasis::                    How to emphasize text.
6097 @end menu
6098
6099 @node Indicating, Emphasis, Marking Text, Marking Text
6100 @comment  node-name,  next,  previous,  up
6101 @section Indicating Definitions, Commands, etc.
6102 @cindex Highlighting text
6103 @cindex Indicating commands, definitions, etc.
6104
6105 Texinfo has commands for indicating just what kind of object a piece of
6106 text refers to.  For example, metasyntactic variables are marked by
6107 @code{@@var}, and code by @code{@@code}.  Since the pieces of text are
6108 labelled by commands that tell what kind of object they are, it is easy
6109 to change the way the Texinfo formatters prepare such text.  (Texinfo is
6110 an @emph{intentional} formatting language rather than a @emph{typesetting}
6111 formatting language.)@refill
6112
6113 For example, in a printed manual,
6114 code is usually illustrated in a typewriter font;
6115 @code{@@code} tells @TeX{} to typeset this text in this font.  But it
6116 would be easy to change the way @TeX{} highlights code to use another
6117 font, and this change would not effect how keystroke examples are
6118 highlighted.  If straight typesetting commands were used in the body
6119 of the file and you wanted to make a change, you would need to check
6120 every single occurrence to make sure that you were changing code and
6121 not something else that should not be changed.@refill
6122
6123 @menu
6124 * Useful Highlighting::         Highlighting provides useful information.
6125 * code::                        How to indicate code.
6126 * kbd::                         How to show keyboard input.
6127 * key::                         How to specify keys.
6128 * samp::                        How to show a literal sequence of characters.
6129 * var::                         How to indicate a metasyntactic variable.
6130 * file::                        How to indicate the name of a file.
6131 * dfn::                         How to specify a definition.
6132 * cite::                        How to refer to a book that is not in Info.
6133 * url::                         How to indicate a world wide web reference.
6134 * email::                       How to indicate an electronic mail address.
6135 @end menu
6136
6137 @node Useful Highlighting, code, Indicating, Indicating
6138 @ifinfo
6139 @subheading Highlighting Commands are Useful
6140 @end ifinfo
6141
6142 The highlighting commands can be used to generate useful information
6143 from the file, such as lists of functions or file names.  It is
6144 possible, for example, to write a program in Emacs Lisp (or a keyboard
6145 macro) to insert an index entry after every paragraph that contains
6146 words or phrases marked by a specified command.  You could do this to
6147 construct an index of functions if you had not already made the
6148 entries.@refill
6149
6150 The commands serve a variety of purposes:@refill
6151
6152 @table @code
6153 @item @@code@{@var{sample-code}@}
6154 Indicate text that is a literal example of a piece of a program.@refill
6155
6156 @item @@kbd@{@var{keyboard-characters}@}
6157 Indicate keyboard input.@refill
6158
6159 @item @@key@{@var{key-name}@}
6160 Indicate the conventional name for a key on a keyboard.@refill
6161
6162 @item @@samp@{@var{text}@}
6163 Indicate text that is a literal example of a sequence of characters.@refill
6164
6165 @item @@var@{@var{metasyntactic-variable}@}
6166 Indicate a metasyntactic variable.@refill
6167
6168 @item @@url@{@var{uniform-resource-locator}@}
6169 Indicate a uniform resource locator for the World Wide Web.
6170
6171 @item @@file@{@var{file-name}@}
6172 Indicate the name of a file.@refill
6173
6174 @item @@email@{@var{email-address}@}
6175 Indicate an electronic mail address.
6176
6177 @item @@dfn@{@var{term}@}
6178 Indicate the introductory or defining use of a term.@refill
6179
6180 @item @@cite@{@var{reference}@}
6181 Indicate the name of a book.@refill
6182
6183 @ignore
6184 @item @@ctrl@{@var{ctrl-char}@}
6185 Use for an @sc{ascii} control character.@refill
6186 @end ignore
6187 @end table
6188
6189 @node code, kbd, Useful Highlighting, Indicating
6190 @comment  node-name,  next,  previous,  up
6191 @subsection @code{@@code}@{@var{sample-code}@}
6192 @findex code
6193
6194 Use the @code{@@code} command to indicate text that is a piece of a
6195 program and which consists of entire syntactic tokens.  Enclose the
6196 text in braces.@refill
6197
6198 Thus, you should use @code{@@code} for an expression in a program, for
6199 the name of a variable or function used in a program, or for a
6200 keyword.  Also, you should use @code{@@code} for the name of a
6201 program, such as @code{diff}, that is a name used in the machine. (You
6202 should write the name of a program in the ordinary text font if you
6203 regard it as a new English word, such as `Emacs' or `Bison'.)@refill
6204
6205 Use @code{@@code} for environment variables such as @code{TEXINPUTS},
6206 and other variables.@refill
6207
6208 Use @code{@@code} for command names in command languages that
6209 resemble programming languages, such as Texinfo or the shell.
6210 For example, @code{@@code} and @code{@@samp} are produced by writing
6211 @samp{@@code@{@@@@code@}} and @samp{@@code@{@@@@samp@}} in the Texinfo
6212 source, respectively.@refill
6213
6214 Note, however, that you should not use @code{@@code} for shell options
6215 such as @samp{-c} when such options stand alone. (Use @code{@@samp}.)
6216 Also, an entire shell command often looks better if written using
6217 @code{@@samp} rather than @code{@@code}.  In this case, the rule is to
6218 choose the more pleasing format.@refill
6219
6220 It is incorrect to alter the case of a word inside an @code{@@code}
6221 command when it appears at the beginning of a sentence.  Most computer
6222 languages are case sensitive.  In C, for example, @code{Printf} is
6223 different from the identifier @code{printf}, and most likely is a
6224 misspelling of it.  Even in languages which are not case sensitive, it
6225 is confusing to a human reader to see identifiers spelled in different
6226 ways.  Pick one spelling and always use that.  If you do not want to
6227 start a sentence with a command written all in lower case, you should
6228 rearrange the sentence.@refill
6229
6230 Do not use the @code{@@code} command for a string of characters shorter
6231 than a syntactic token.  If you are writing about @samp{TEXINPU}, which
6232 is just a part of the name for the @code{TEXINPUTS} environment
6233 variable, you should use @code{@@samp}.@refill
6234
6235 In particular, you should not use the @code{@@code} command when writing
6236 about the characters used in a token; do not, for example, use
6237 @code{@@code} when you are explaining what letters or printable symbols
6238 can be used in the names of functions.  (Use @code{@@samp}.)  Also, you
6239 should not use @code{@@code} to mark text that is considered input to
6240 programs unless the input is written in a language that is like a
6241 programming language.  For example, you should not use @code{@@code} for
6242 the keystroke commands of GNU Emacs (use @code{@@kbd} instead) although
6243 you may use @code{@@code} for the names of the Emacs Lisp functions that
6244 the keystroke commands invoke.@refill
6245
6246 In the printed manual, @code{@@code} causes @TeX{} to typeset the
6247 argument in a typewriter face.  In the Info file, it causes the Info
6248 formatting commands to use single quotation marks around the text.
6249
6250 @need 700
6251 For example,
6252
6253 @example
6254 Use @@code@{diff@} to compare two files.
6255 @end example
6256
6257 @noindent
6258 produces this in the printed manual:@refill
6259
6260 @quotation
6261 Use @code{diff} to compare two files.
6262 @end quotation
6263 @iftex
6264
6265 @noindent
6266 and this in the Info file:@refill
6267
6268 @example
6269 Use `diff' to compare two files.
6270 @end example
6271 @end iftex
6272
6273 @node kbd, key, code, Indicating
6274 @comment  node-name,  next,  previous,  up
6275 @subsection @code{@@kbd}@{@var{keyboard-characters}@}
6276 @findex kbd
6277
6278 Use the @code{@@kbd} command for characters of input to be typed by
6279 users.  For example, to refer to the characters @kbd{M-a},
6280 write@refill
6281
6282 @example
6283 @@kbd@{M-a@}
6284 @end example
6285
6286 @noindent
6287 and to refer to the characters @kbd{M-x shell}, write@refill
6288
6289 @example
6290 @@kbd@{M-x shell@}
6291 @end example
6292
6293 The @code{@@kbd} command has the same effect as @code{@@code} in Info,
6294 but may produce a different font in a printed manual.@refill
6295
6296 You can embed another @@-command inside the braces of an @code{@@kbd}
6297 command.  Here, for example, is the way to describe a command that
6298 would be described more verbosely as ``press an @samp{r} and then
6299 press the @key{RET} key'':@refill
6300
6301 @example
6302 @@kbd@{r @@key@{RET@}@}
6303 @end example
6304
6305 @noindent
6306 This produces: @kbd{r @key{RET}}
6307
6308 You also use the @code{@@kbd} command if you are spelling out the letters
6309 you type; for example:@refill
6310
6311 @example
6312 To give the @@code@{logout@} command,
6313 type the characters @@kbd@{l o g o u t @@key@{RET@}@}.
6314 @end example
6315
6316 @noindent
6317 This produces:
6318
6319 @quotation
6320 To give the @code{logout} command,
6321 type the characters @kbd{l o g o u t @key{RET}}.
6322 @end quotation
6323
6324 (Also, this example shows that you can add spaces for clarity.  If you
6325 really want to mention a space character as one of the characters of
6326 input, write @kbd{@@key@{SPC@}} for it.)@refill
6327
6328 @node key, samp, kbd, Indicating
6329 @comment  node-name,  next,  previous,  up
6330 @subsection @code{@@key}@{@var{key-name}@}
6331 @findex key
6332
6333 Use the @code{@@key} command for the conventional name for a key on a
6334 keyboard, as in:@refill
6335
6336 @example
6337 @@key@{RET@}
6338 @end example
6339
6340 You can use the @code{@@key} command within the argument of an
6341 @code{@@kbd} command when the sequence of characters to be typed
6342 includes one or more keys that are described by name.@refill
6343
6344 @need 700
6345 For example, to produce @kbd{C-x @key{ESC}} you would type:@refill
6346
6347 @example
6348 @@kbd@{C-x @@key@{ESC@}@}
6349 @end example
6350
6351 Here is a list of the recommended names for keys:
6352 @cindex Recommended names for keys
6353 @cindex Keys, recommended names
6354 @cindex Names recommended for keys
6355 @cindex Abbreviations for keys
6356
6357 @quotation
6358 @table @t
6359 @item SPC
6360 Space
6361 @item RET
6362 Return
6363 @item LFD
6364 Linefeed (however, since most keyboards nowadays do not have a Linefeed key,
6365 it might be better to call this character @kbd{C-j}.
6366 @item TAB
6367 Tab
6368 @item BS
6369 Backspace
6370 @item ESC
6371 Escape
6372 @item DEL
6373 Delete
6374 @item SHIFT
6375 Shift
6376 @item CTRL
6377 Control
6378 @item META
6379 Meta
6380 @end table
6381 @end quotation
6382
6383 @cindex META key
6384 There are subtleties to handling words like `meta' or `ctrl' that are
6385 names of shift keys.  When mentioning a character in which the shift key
6386 is used, such as @kbd{Meta-a}, use the @code{@@kbd} command alone; do
6387 not use the @code{@@key} command; but when you are referring to the
6388 shift key in isolation, use the @code{@@key} command.  For example,
6389 write @samp{@@kbd@{Meta-a@}} to produce @kbd{Meta-a} and
6390 @samp{@@key@{META@}} to produce @key{META}.
6391
6392 @c I don't think this is a good explanation.
6393 @c I think it will puzzle readers more than it clarifies matters.  -- rms.
6394 @c In other words, use @code{@@kbd} for what you do, and use @code{@@key}
6395 @c for what you talk about: ``Press @code{@@kbd@{M-a@}} to move point to
6396 @c the beginning of the sentence.  The @code{@@key@{META@}} key is often in
6397 @c the lower left of the keyboard.''@refill
6398
6399 @node samp, var, key, Indicating
6400 @comment  node-name,  next,  previous,  up
6401 @subsection @code{@@samp}@{@var{text}@}
6402 @findex samp
6403
6404 Use the @code{@@samp} command to indicate text that is a literal example
6405 or `sample' of a sequence of characters in a file, string, pattern, etc.
6406 Enclose the text in braces.  The argument appears within single
6407 quotation marks in both the Info file and the printed manual; in
6408 addition, it is printed in a fixed-width font.@refill
6409
6410 @example
6411 To match @@samp@{foo@} at the end of the line,
6412 use the regexp @@samp@{foo$@}.
6413 @end example
6414
6415 @noindent
6416 produces
6417
6418 @quotation
6419 To match @samp{foo} at the end of the line, use the regexp
6420 @samp{foo$}.@refill
6421 @end quotation
6422
6423 Any time you are referring to single characters, you should use
6424 @code{@@samp} unless @code{@@kbd} is more appropriate.  Use
6425 @code{@@samp} for the names of command-line options.  Also, you may use
6426 @code{@@samp} for entire statements in C and for entire shell
6427 commands---in this case, @code{@@samp} often looks better than
6428 @code{@@code}.  Basically, @code{@@samp} is a catchall for whatever is
6429 not covered by @code{@@code}, @code{@@kbd}, or @code{@@key}.@refill
6430
6431 Only include punctuation marks within braces if they are part of the
6432 string you are specifying.  Write punctuation marks outside the braces
6433 if those punctuation marks are part of the English text that surrounds
6434 the string.  In the following sentence, for example, the commas and
6435 period are outside of the braces:@refill
6436
6437 @example
6438 @group
6439 In English, the vowels are @@samp@{a@}, @@samp@{e@},
6440 @@samp@{i@}, @@samp@{o@}, @@samp@{u@}, and sometimes
6441 @@samp@{y@}.
6442 @end group
6443 @end example
6444
6445 @noindent
6446 This produces:
6447
6448 @quotation
6449 In English, the vowels are @samp{a}, @samp{e},
6450 @samp{i}, @samp{o}, @samp{u},  and sometimes
6451 @samp{y}.
6452 @end quotation
6453
6454 @node var, file, samp, Indicating
6455 @comment  node-name,  next,  previous,  up
6456 @subsection @code{@@var}@{@var{metasyntactic-variable}@}
6457 @findex var
6458
6459 Use the @code{@@var} command to indicate metasyntactic variables.  A
6460 @dfn{metasyntactic variable} is something that stands for another piece of
6461 text.  For example, you should use a metasyntactic variable in the
6462 documentation of a function to describe the arguments that are passed
6463 to that function.@refill
6464
6465 Do not use @code{@@var} for the names of particular variables in
6466 programming languages.  These are specific names from a program, so
6467 @code{@@code} is correct for them.  For example, the Lisp variable
6468 @code{texinfo-tex-command} is not a metasyntactic variable; it is
6469 properly formatted using @code{@@code}.@refill
6470
6471 The effect of @code{@@var} in the Info file is to change the case of
6472 the argument to all upper case; in the printed manual, to italicize it.
6473
6474 @need 700
6475 For example,
6476
6477 @example
6478 To delete file @@var@{filename@},
6479 type @@code@{rm @@var@{filename@}@}.
6480 @end example
6481
6482 @noindent
6483 produces
6484
6485 @quotation
6486 To delete file @var{filename}, type @code{rm @var{filename}}.
6487 @end quotation
6488
6489 @noindent
6490 (Note that @code{@@var} may appear inside @code{@@code},
6491 @code{@@samp}, @code{@@file}, etc.)@refill
6492
6493 Write a metasyntactic variable all in lower case without spaces, and
6494 use hyphens to make it more readable.  Thus, the Texinfo source for
6495 the illustration of how to begin a Texinfo manual looks like
6496 this:@refill
6497
6498 @example
6499 @group
6500 \input texinfo
6501 @@@@setfilename @@var@{info-file-name@}
6502 @@@@settitle @@var@{name-of-manual@}
6503 @end group
6504 @end example
6505
6506 @noindent
6507 This produces:
6508
6509 @example
6510 @group
6511 \input texinfo
6512 @@setfilename @var{info-file-name}
6513 @@settitle @var{name-of-manual}
6514 @end group
6515 @end example
6516
6517 In some documentation styles, metasyntactic variables are shown with
6518 angle brackets, for example:@refill
6519
6520 @example
6521 @dots{}, type rm <filename>
6522 @end example
6523
6524 @noindent
6525 However, that is not the style that Texinfo uses.  (You can, of
6526 course, modify the sources to @TeX{} and the Info formatting commands
6527 to output the @code{<@dots{}>} format if you wish.)@refill
6528
6529 @node file, dfn, var, Indicating
6530 @comment  node-name,  next,  previous,  up
6531 @subsection @code{@@file}@{@var{file-name}@}
6532 @findex file
6533
6534 Use the @code{@@file} command to indicate text that is the name of a
6535 file, buffer, or directory, or is the name of a node in Info.  You can
6536 also use the command for file name suffixes.  Do not use @code{@@file}
6537 for symbols in a programming language; use @code{@@code}.
6538
6539 Currently, @code{@@file} is equivalent to @code{@@samp} in its effects.
6540 For example,@refill
6541
6542 @example
6543 The @@file@{.el@} files are in
6544 the @@file@{/usr/local/emacs/lisp@} directory.
6545 @end example
6546
6547 @noindent
6548 produces
6549
6550 @quotation
6551 The @file{.el} files are in
6552 the @file{/usr/local/emacs/lisp} directory.
6553 @end quotation
6554
6555 @node dfn, cite, file, Indicating
6556 @comment  node-name,  next,  previous,  up
6557 @subsection @code{@@dfn}@{@var{term}@}
6558 @findex dfn
6559
6560 Use the @code{@@dfn} command to identify the introductory or defining
6561 use of a technical term.  Use the command only in passages whose
6562 purpose is to introduce a term which will be used again or which the
6563 reader ought to know.  Mere passing mention of a term for the first
6564 time does not deserve @code{@@dfn}.  The command generates italics in
6565 the printed manual, and double quotation marks in the Info file.  For
6566 example:@refill
6567
6568 @example
6569 Getting rid of a file is called @@dfn@{deleting@} it.
6570 @end example
6571
6572 @noindent
6573 produces
6574
6575 @quotation
6576 Getting rid of a file is called @dfn{deleting} it.
6577 @end quotation
6578
6579 As a general rule, a sentence containing the defining occurrence of a
6580 term should be a definition of the term.  The sentence does not need
6581 to say explicitly that it is a definition, but it should contain the
6582 information of a definition---it should make the meaning clear.
6583
6584 @node cite, url, dfn, Indicating
6585 @comment  node-name,  next,  previous,  up
6586 @subsection @code{@@cite}@{@var{reference}@}
6587 @findex cite
6588
6589 Use the @code{@@cite} command for the name of a book that lacks a
6590 companion Info file. The command produces italics in the printed
6591 manual, and quotation marks in the Info file.@refill
6592
6593 (If a book is written in Texinfo, it is better to use a cross reference
6594 command since a reader can easily follow such a reference in Info.
6595 @xref{xref, , @code{@@xref}}.)@refill
6596
6597 @ignore
6598 @c node ctrl, , cite, Indicating
6599 @comment  node-name,  next,  previous,  up
6600 @c subsection @code{@@ctrl}@{@var{ctrl-char}@}
6601 @findex ctrl
6602
6603 The @code{@@ctrl} command is seldom used.  It describes an @sc{ascii}
6604 control character by inserting the actual character into the Info
6605 file.
6606
6607 Usually, in Texinfo, you talk what you type as keyboard entry by
6608 describing it with @code{@@kbd}: thus, @samp{@@kbd@{C-a@}} for
6609 @kbd{C-a}.  Use @code{@@kbd} in this way when talking about a control
6610 character that is typed on the keyboard by the user.  When talking
6611 about a control character appearing in a file or a string, do not use
6612 @code{@@kbd} since the control character is not typed.  Also, do not
6613 use @samp{C-} but spell out @code{control-}, as in @samp{control-a},
6614 to make it easier for a reader to understand.@refill
6615
6616 @code{@@ctrl} is an idea from the beginnings of Texinfo which may not
6617 really fit in to the scheme of things.  But there may be times when
6618 you want to use the command.  The pattern is
6619 @code{@@ctrl@{@var{ch}@}}, where @var{ch} is an @sc{ascii} character
6620 whose control-equivalent is wanted.  For example, to specify
6621 @samp{control-f}, you would enter@refill
6622
6623 @example
6624 @@ctrl@{f@}
6625 @end example
6626
6627 @noindent
6628 produces
6629
6630 @quotation
6631 @ctrl{f}
6632 @end quotation
6633
6634 In the Info file, this generates the specified control character, output
6635 literally into the file.  This is done so a user can copy the specified
6636 control character (along with whatever else he or she wants) into another
6637 Emacs buffer and use it.  Since the `control-h',`control-i', and
6638 `control-j' characters are formatting characters, they should not be
6639 indicated with @code{@@ctrl}.@refill
6640
6641 In a printed manual, @code{@@ctrl} generates text to describe or
6642 identify that control character: an uparrow followed by the character
6643 @var{ch}.@refill
6644 @end ignore
6645
6646 @node url, email, cite, Indicating
6647 @subsection @code{@@url}@{@var{uniform-resource-locator}@}
6648 @findex url
6649
6650 Use the @code{@@url} command to indicate a uniform resource locator on
6651 the World Wide Web.  For example:
6652
6653 @c Two lines because one is too long for smallbook format.
6654 @example
6655 The official GNU ftp site is
6656 @@url@{ftp://ftp.gnu.ai.mit.edu/pub/gnu@}.
6657 @end example
6658
6659 In Info and @TeX{}, this acts like @code{@@samp}.  When
6660 Texinfo is converted to HTML, this produces a link you can follow.
6661
6662 @node email, , url, Indicating
6663 @subsection @code{@@email}@{@var{email-address}@}
6664 @findex email
6665
6666 Use the @code{@@email} command to indicate an electronic mail address.
6667 For example:
6668
6669 @example
6670 Send bug reports to @email{bug-texinfo@@prep.ai.mit.edu}.
6671 @end example
6672
6673 In Info and @TeX{}, this acts like @code{@@samp}.  When we have support
6674 for conversion of Texinfo to HTML, this will produce a link you can
6675 follow to bring up a mail composition window initialized with
6676 @var{email-address}.
6677
6678 @node Emphasis, , Indicating, Marking Text
6679 @comment node-name,  next,  previous,  up
6680 @section Emphasizing Text
6681 @cindex Emphasizing text
6682
6683 Usually, Texinfo changes the font to mark words in the text according to
6684 what category the words belong to; an example is the @code{@@code} command.
6685 Most often, this is the best way to mark words.
6686 However, sometimes you will want to emphasize text without indicating a
6687 category.  Texinfo has two commands to do this.  Also, Texinfo has
6688 several commands that specify the font in which @TeX{} will typeset
6689 text.  These commands have no affect on Info and only one of them,
6690 the @code{@@r} command, has any regular use.@refill
6691
6692 @menu
6693 * emph & strong::               How to emphasize text in Texinfo.
6694 * Smallcaps::                   How to use the small caps font.
6695 * Fonts::                       Various font commands for printed output.
6696 * Customized Highlighting::     How to define highlighting commands.
6697 @end menu
6698
6699 @node emph & strong, Smallcaps, Emphasis, Emphasis
6700 @comment  node-name,  next,  previous,  up
6701 @subsection @code{@@emph}@{@var{text}@} and @code{@@strong}@{@var{text}@}
6702 @cindex Emphasizing text, font for
6703 @findex emph
6704 @findex strong
6705
6706 The @code{@@emph} and @code{@@strong} commands are for emphasis;
6707 @code{@@strong} is stronger.  In printed output, @code{@@emph}
6708 produces @emph{italics} and @code{@@strong} produces
6709 @strong{bold}.@refill
6710
6711 @need 800
6712 For example,
6713
6714 @example
6715 @group
6716 @@quotation
6717 @@strong@{Caution:@} @@code@{rm * .[^.]*@} removes @@emph@{all@}
6718 files in the directory.
6719 @@end quotation
6720 @end group
6721 @end example
6722
6723 @iftex
6724 @noindent
6725 produces the following in printed output:
6726
6727 @quotation
6728 @strong{Caution}: @code{rm * .[^.]*} removes @emph{all}
6729 files in the directory.
6730 @end quotation
6731
6732 @noindent
6733 and the following in Info:
6734 @end iftex
6735 @ifinfo
6736 @noindent
6737 produces:
6738 @end ifinfo
6739
6740 @example
6741      *Caution*: `rm * .[^.]*' removes *all*
6742      files in the directory.
6743 @end example
6744
6745 The @code{@@strong} command is seldom used except to mark what is, in
6746 effect, a typographical element, such as the word `Caution' in the
6747 preceding example.
6748
6749 In the Info file, both @code{@@emph} and @code{@@strong} put asterisks
6750 around the text.@refill
6751
6752 @quotation
6753 @strong{Caution:} Do not use @code{@@emph} or @code{@@strong} with the
6754 word @samp{Note}; Info will mistake the combination for a cross
6755 reference.  Use a phrase such as @strong{Please note} or
6756 @strong{Caution} instead.@refill
6757 @end quotation
6758
6759 @node Smallcaps, Fonts, emph & strong, Emphasis
6760 @subsection @code{@@sc}@{@var{text}@}: The Small Caps Font
6761 @cindex Small caps font
6762 @findex sc @r{(small caps font)}
6763
6764 @iftex
6765 Use the @samp{@@sc} command to set text in the printed output in @sc{a
6766 small caps font} and set text in the Info file in upper case letters.@refill
6767 @end iftex
6768 @ifinfo
6769 Use the @samp{@@sc} command to set text in the printed output in a
6770 small caps font and set text in the Info file in upper case letters.@refill
6771 @end ifinfo
6772
6773 Write the text between braces in lower case, like this:@refill
6774
6775 @example
6776 The @@sc@{acm@} and @@sc@{ieee@} are technical societies.
6777 @end example
6778
6779 @noindent
6780 This produces:
6781
6782 @display
6783 The @sc{acm} and @sc{ieee} are technical societies.
6784 @end display
6785
6786 @TeX{} typesets the small caps font in a manner that prevents the
6787 letters from `jumping out at you on the page'.  This makes small caps
6788 text easier to read than text in all upper case.  The Info formatting
6789 commands set all small caps text in upper case.@refill
6790
6791 @ifinfo
6792 If the text between the braces of an @code{@@sc} command is upper case,
6793 @TeX{} typesets in full-size capitals.  Use full-size capitals
6794 sparingly.@refill
6795 @end ifinfo
6796 @iftex
6797 If the text between the braces of an @code{@@sc} command is upper case,
6798 @TeX{} typesets in @sc{FULL-SIZE CAPITALS}.  Use full-size capitals
6799 sparingly.@refill
6800 @end iftex
6801
6802 You may also use the small caps font for a jargon word such as
6803 @sc{ato} (a @sc{nasa} word meaning `abort to orbit').@refill
6804
6805 There are subtleties to using the small caps font with a jargon word
6806 such as @sc{cdr}, a word used in Lisp programming.  In this case, you
6807 should use the small caps font when the word refers to the second and
6808 subsequent elements of a list (the @sc{cdr} of the list), but you
6809 should use @samp{@@code} when the word refers to the Lisp function of
6810 the same spelling.@refill
6811
6812 @node Fonts, Customized Highlighting, Smallcaps, Emphasis
6813 @comment node-name,  next,  previous,  up
6814 @subsection Fonts for Printing, Not Info
6815 @cindex Fonts for printing, not for Info
6816 @findex i @r{(italic font)}
6817 @findex b @r{(bold font)}
6818 @findex t @r{(typewriter font)}
6819 @findex r @r{(Roman font)}
6820
6821 Texinfo provides four font commands that specify font changes in the
6822 printed manual but have no effect in the Info file.  @code{@@i}
6823 requests @i{italic} font (in some versions of @TeX{}, a slanted font
6824 is used), @code{@@b} requests @b{bold} face, @code{@@t} requests the
6825 @t{fixed-width}, typewriter-style font used by @code{@@code}, and @code{@@r} requests a
6826 @r{roman} font, which is the usual font in which text is printed.  All
6827 four commands apply to an argument that follows, surrounded by
6828 braces.@refill
6829
6830 Only the @code{@@r} command has much use: in example programs, you
6831 can use the @code{@@r} command to convert code comments from the
6832 fixed-width font to a roman font.  This looks better in printed
6833 output.@refill
6834
6835 @need 700
6836 For example,
6837
6838 @example
6839 @group
6840 @@lisp
6841 (+ 2 2)    ; @@r@{Add two plus two.@}
6842 @@end lisp
6843 @end group
6844 @end example
6845
6846 @noindent
6847 produces
6848
6849 @lisp
6850 (+ 2 2)    ; @r{Add two plus two.}
6851 @end lisp
6852
6853 If possible, you should avoid using the other three font commands.  If
6854 you need to use one, it probably indicates a gap in the Texinfo
6855 language.@refill
6856
6857 @node Customized Highlighting, , Fonts, Emphasis
6858 @comment node-name,  next,  previous,  up
6859 @subsection Customized Highlighting
6860 @cindex Highlighting, customized
6861 @cindex Customized highlighting
6862
6863 @c I think this whole section is obsolete with the advent of macros
6864 @c --karl, 15sep96.
6865 You can use regular @TeX{} commands inside of @code{@@iftex} @dots{}
6866 @code{@@end iftex} to create your own customized highlighting commands
6867 for Texinfo.  The easiest way to do this is to equate your customized
6868 commands with pre-existing commands, such as those for italics.  Such
6869 new commands work only with @TeX{}.@refill
6870
6871 @findex definfoenclose
6872 @cindex Enclosure command for Info
6873 You can use the @code{@@definfoenclose} command inside of
6874 @code{@@ifinfo} @dots{} @code{@@end ifinfo} to define commands for Info
6875 with the same names as new commands for @TeX{}.
6876 @code{@@definfoenclose} creates new commands for Info that mark text by
6877 enclosing it in strings that precede and follow the text.
6878 @footnote{Currently, @code{@@definfoenclose} works only with
6879 @code{texinfo-format-buffer} and @code{texinfo-format-region}, not with
6880 @code{makeinfo}.}@refill
6881
6882 Here is how to create a new @@-command called @code{@@phoo} that causes
6883 @TeX{} to typeset its argument in italics and causes Info to display the
6884 argument between @samp{//} and @samp{\\}.@refill
6885
6886 @need 1300
6887 For @TeX{}, write the following to equate the @code{@@phoo} command with
6888 the existing @code{@@i} italics command:@refill
6889
6890 @example
6891 @group
6892 @@iftex
6893 @@global@@let@@phoo=@@i
6894 @@end iftex
6895 @end group
6896 @end example
6897
6898 @noindent
6899 This defines @code{@@phoo} as a command that causes @TeX{} to typeset
6900 the argument to @code{@@phoo} in italics.  @code{@@global@@let} tells
6901 @TeX{} to equate the next argument with the argument that follows the
6902 equals sign.
6903
6904 @need 1300
6905 For Info, write the following to tell the Info formatters to enclose the
6906 argument between @samp{//} and @samp{\\}:
6907
6908 @example
6909 @group
6910 @@ifinfo
6911 @@definfoenclose phoo, //, \\
6912 @@end ifinfo
6913 @end group
6914 @end example
6915
6916 @noindent
6917 Write the @code{@@definfoenclose} command on a line and follow it with
6918 three arguments separated by commas (commas are used as separators in an
6919 @code{@@node} line in the same way).@refill
6920
6921 @itemize @bullet
6922 @item
6923 The first argument to @code{@@definfoenclose} is the @@-command name
6924 @strong{without} the @samp{@@};
6925
6926 @item
6927 the second argument is the Info start delimiter string; and,
6928
6929 @item
6930 the third argument is the Info end delimiter string.
6931 @end itemize
6932
6933 @noindent
6934 The latter two arguments enclose the highlighted text in the Info file.
6935 A delimiter string may contain spaces.  Neither the start nor end
6936 delimiter is required.  However, if you do not provide a start
6937 delimiter, you must follow the command name with two commas in a row;
6938 otherwise, the Info formatting commands will misinterpret the end
6939 delimiter string as a start delimiter string.@refill
6940
6941 After you have defined @code{@@phoo} both for @TeX{} and for Info, you
6942 can then write @code{@@phoo@{bar@}} to see @samp{//bar\\}
6943 in Info and see
6944 @ifinfo
6945 @samp{bar} in italics in printed output.
6946 @end ifinfo
6947 @iftex
6948 @i{bar} in italics in printed output.
6949 @end iftex
6950
6951 Note that each definition applies to its own formatter: one for @TeX{},
6952 the other for Info.
6953
6954 @need 1200
6955 Here is another example:
6956
6957 @example
6958 @group
6959 @@ifinfo
6960 @@definfoenclose headword, , :
6961 @@end ifinfo
6962 @@iftex
6963 @@global@@let@@headword=@@b
6964 @@end iftex
6965 @end group
6966 @end example
6967
6968 @noindent
6969 This defines @code{@@headword} as an Info formatting command that
6970 inserts nothing before and a colon after the argument and as a @TeX{}
6971 formatting command to typeset its argument in bold.
6972
6973 @node Quotations and Examples, Lists and Tables, Marking Text, Top
6974 @comment  node-name,  next,  previous,  up
6975 @chapter Quotations and Examples
6976
6977 Quotations and examples are blocks of text consisting of one or more
6978 whole paragraphs that are set off from the bulk of the text and
6979 treated differently.  They are usually indented.@refill
6980
6981 In Texinfo, you always begin a quotation or example by writing an
6982 @@-command at the beginning of a line by itself, and end it by writing
6983 an @code{@@end} command that is also at the beginning of a line by
6984 itself.  For instance, you begin an example by writing @code{@@example}
6985 by itself at the beginning of a line and end the example by writing
6986 @code{@@end example} on a line by itself, at the beginning of that
6987 line.@refill
6988 @findex end
6989
6990 @menu
6991 * Block Enclosing Commands::    Use different constructs for
6992                                   different purposes.
6993 * quotation::                   How to write a quotation.
6994 * example::                     How to write an example in a fixed-width font.
6995 * noindent::                    How to prevent paragraph indentation.
6996 * Lisp Example::                How to illustrate Lisp code.
6997 * smallexample & smalllisp::    Forms for the @code{@@smallbook} option.
6998 * display::                     How to write an example in the current font.
6999 * format::                      How to write an example that does not narrow
7000                                   the margins.
7001 * exdent::                      How to undo the indentation of a line.
7002 * flushleft & flushright::      How to push text flushleft or flushright.
7003 * cartouche::                   How to draw cartouches around examples.
7004 @end menu
7005
7006 @node Block Enclosing Commands, quotation, Quotations and Examples, Quotations and Examples
7007 @section The Block Enclosing Commands
7008
7009 Here are commands for quotations and examples:@refill
7010
7011 @table @code
7012 @item @@quotation
7013 Indicate text that is quoted. The text is filled, indented, and
7014 printed in a roman font by default.@refill
7015
7016 @item @@example
7017 Illustrate code, commands, and the like. The text is printed
7018 in a fixed-width font, and indented but not filled.@refill
7019
7020 @item @@lisp
7021 Illustrate Lisp code. The text is printed in a fixed-width font,
7022 and indented but not filled.@refill
7023
7024 @item @@smallexample
7025 Illustrate code, commands, and the like.  Similar to
7026 @code{@@example}, except that in @TeX{} this command typesets text in
7027 a smaller font for the smaller @code{@@smallbook} format than for the
7028 8.5 by 11 inch format.@refill
7029
7030 @item @@smalllisp
7031 Illustrate Lisp code.  Similar to @code{@@lisp}, except that
7032 in @TeX{} this command typesets text in a smaller font for the smaller
7033 @code{@@smallbook} format than for the 8.5 by 11 inch format.@refill
7034
7035 @item @@display
7036 Display illustrative text.  The text is indented but not filled, and
7037 no font is specified (so, by default, the font is roman).@refill
7038
7039 @item @@format
7040 Print illustrative text.  The text is not indented and not filled
7041 and no font is specified (so, by default, the font is roman).@refill
7042 @end table
7043
7044 The @code{@@exdent} command is used within the above constructs to
7045 undo the indentation of a line.
7046
7047 The @code{@@flushleft} and @code{@@flushright} commands are used to line
7048 up the left or right margins of unfilled text.@refill
7049
7050 The @code{@@noindent} command may be used after one of the above
7051 constructs to prevent the following text from being indented as a new
7052 paragraph.@refill
7053
7054 You can use the @code{@@cartouche} command within one of the above
7055 constructs to highlight the example or quotation by drawing a box with
7056 rounded corners around it.  (The @code{@@cartouche} command affects
7057 only the printed manual; it has no effect in the Info file; see
7058 @ref{cartouche, , Drawing Cartouches Around Examples}.)@refill
7059
7060 @node quotation, example, Block Enclosing Commands, Quotations and Examples
7061 @comment  node-name,  next,  previous,  up
7062 @section @code{@@quotation}
7063 @cindex Quotations
7064 @findex quotation
7065
7066 The text of a quotation is
7067 processed normally except that:@refill
7068
7069 @itemize @bullet
7070 @item
7071 the margins are closer to the center of the page, so the whole of the
7072 quotation is indented;@refill
7073
7074 @item
7075 the first lines of paragraphs are indented no more than other
7076 lines;@refill
7077
7078 @item
7079 in the printed output, interparagraph spacing is reduced.@refill
7080 @end itemize
7081
7082 @quotation
7083 This is an example of text written between an @code{@@quotation}
7084 command and an @code{@@end quotation} command.  An @code{@@quotation}
7085 command is most often used to indicate text that is excerpted from
7086 another (real or hypothetical) printed work.@refill
7087 @end quotation
7088
7089 Write an @code{@@quotation} command as text on a line by itself.  This
7090 line will disappear from the output.  Mark the end of the quotation
7091 with a line beginning with and containing only @code{@@end quotation}.
7092 The @code{@@end quotation} line will likewise disappear from the
7093 output.  Thus, the following,@refill
7094
7095 @example
7096 @@quotation
7097 This is
7098 a foo.
7099 @@end quotation
7100 @end example
7101
7102 @noindent
7103 produces
7104
7105 @quotation
7106 This is a foo.
7107 @end quotation
7108
7109 @node example, noindent, quotation, Quotations and Examples
7110 @comment  node-name,  next,  previous,  up
7111 @section @code{@@example}
7112 @cindex Examples, formatting them
7113 @cindex Formatting examples
7114 @findex example
7115
7116 The @code{@@example} command is used to indicate an example that is
7117 not part of the running text, such as computer input or output.@refill
7118
7119 @example
7120 @group
7121 This is an example of text written between an
7122 @code{@@example} command
7123 and an @code{@@end example} command.
7124 The text is indented but not filled.
7125 @end group
7126
7127 @group
7128 In the printed manual, the text is typeset in a
7129 fixed-width font, and extra spaces and blank lines are
7130 significant.  In the Info file, an analogous result is
7131 obtained by indenting each line with five spaces.
7132 @end group
7133 @end example
7134
7135 Write an @code{@@example} command at the beginning of a line by itself.
7136 This line will disappear from the output.  Mark the end of the example
7137 with an @code{@@end example} command, also written at the beginning of a
7138 line by itself.  The @code{@@end example} will disappear from the
7139 output.@refill
7140
7141 @need 700
7142 For example,
7143
7144 @example
7145 @@example
7146 mv foo bar
7147 @@end example
7148 @end example
7149
7150 @noindent
7151 produces
7152
7153 @example
7154 mv foo bar
7155 @end example
7156
7157 Since the lines containing @code{@@example} and @code{@@end example}
7158 will disappear, you should put a blank line before the
7159 @code{@@example} and another blank line after the @code{@@end
7160 example}.  (Remember that blank lines between the beginning
7161 @code{@@example} and the ending @code{@@end example} will appear in
7162 the output.)@refill
7163
7164 @quotation
7165 @strong{Caution:} Do not use tabs in the lines of an example (or anywhere
7166 else in Texinfo, for that matter)!  @TeX{} treats tabs as single
7167 spaces, and that is not what they look like.  This is a problem with
7168 @TeX{}.  (If necessary, in Emacs, you can use @kbd{M-x untabify} to
7169 convert tabs in a region to multiple spaces.)@refill
7170 @end quotation
7171
7172 Examples are often, logically speaking, ``in the middle'' of a
7173 paragraph, and the text continues after an example should not be
7174 indented.  The @code{@@noindent} command prevents a piece of text from
7175 being indented as if it were a new paragraph.
7176 @ifinfo
7177 (@xref{noindent}.)
7178 @end ifinfo
7179
7180 (The @code{@@code} command is used for examples of code that are
7181 embedded within sentences, not set off from preceding and following
7182 text.  @xref{code, , @code{@@code}}.)
7183
7184 @node noindent, Lisp Example, example, Quotations and Examples
7185 @comment  node-name,  next,  previous,  up
7186 @section @code{@@noindent}
7187 @findex noindent
7188
7189 An example or other inclusion can break a paragraph into segments.
7190 Ordinarily, the formatters indent text that follows an example as a new
7191 paragraph.  However, you can prevent this by writing @code{@@noindent}
7192 at the beginning of a line by itself preceding the continuation
7193 text.@refill
7194
7195 @need 1500
7196 For example:
7197
7198 @example
7199 @group
7200 @@example
7201 This is an example
7202 @@end example
7203
7204 @@noindent
7205 This line is not indented.  As you can see, the
7206 beginning of the line is fully flush left with the line
7207 that follows after it.  (This whole example is between
7208 @@code@{@@@@display@} and @@code@{@@@@end display@}.)
7209 @end group
7210 @end example
7211
7212 @noindent
7213 produces
7214
7215 @display
7216 @example
7217 This is an example
7218 @end example
7219 @tex
7220 % Remove extra vskip; this is a kludge to counter the effect of display
7221 \vskip-3.5\baselineskip
7222 @end tex
7223
7224 @noindent
7225 This line is not indented.  As you can see, the
7226 beginning of the line is fully flush left with the line
7227 that follows after it.  (This whole example is between
7228 @code{@@display} and @code{@@end display}.)
7229 @end display
7230
7231 To adjust the number of blank lines properly in the Info file output,
7232 remember that the line containing @code{@@noindent} does not generate a
7233 blank line, and neither does the @code{@@end example} line.@refill
7234
7235 In the Texinfo source file for this manual, each line that says
7236 `produces' is preceded by a line containing @code{@@noindent}.@refill
7237
7238 Do not put braces after an @code{@@noindent} command; they are not
7239 necessary, since @code{@@noindent} is a command used outside of
7240 paragraphs (@pxref{Command Syntax}).@refill
7241
7242 @node Lisp Example, smallexample & smalllisp, noindent, Quotations and Examples
7243 @comment  node-name,  next,  previous,  up
7244 @section @code{@@lisp}
7245 @cindex Lisp example
7246 @findex lisp
7247
7248 The @code{@@lisp} command is used for Lisp code.  It is synonymous
7249 with the @code{@@example} command.
7250
7251 @lisp
7252 This is an example of text written between an
7253 @code{@@lisp} command and an @code{@@end lisp} command.
7254 @end lisp
7255
7256 Use @code{@@lisp} instead of @code{@@example} so as to preserve
7257 information regarding the nature of the example.  This is useful, for
7258 example, if you write a function that evaluates only and all the Lisp
7259 code in a Texinfo file.  Then you can use the Texinfo file as a Lisp
7260 library.@footnote{It would be straightforward to extend Texinfo to
7261 work in a similar fashion for C, @sc{fortran}, or other languages.}@refill
7262
7263 Mark the end of @code{@@lisp} with @code{@@end lisp} on a line by
7264 itself.@refill
7265
7266 @node smallexample & smalllisp, display, Lisp Example, Quotations and Examples
7267 @comment  node-name,  next,  previous,  up
7268 @section @code{@@smallexample} and @code{@@smalllisp}
7269 @cindex Small book example
7270 @cindex Example for a small book
7271 @cindex Lisp example for a small book
7272 @findex smallexample
7273 @findex smalllisp
7274
7275 In addition to the regular @code{@@example} and @code{@@lisp} commands,
7276 Texinfo has two other ``example-style'' commands.  These are the
7277 @code{@@smallexample} and @code{@@smalllisp} commands.  Both these
7278 commands are designed for use with the @code{@@smallbook} command that
7279 causes @TeX{} to produce a printed manual in a 7 by 9.25 inch format
7280 rather than the regular 8.5 by 11 inch format.@refill
7281
7282 In @TeX{}, the @code{@@smallexample} and @code{@@smalllisp} commands
7283 typeset text in a smaller font for the smaller @code{@@smallbook}
7284 format than for the 8.5 by 11 inch format.  Consequently, many examples
7285 containing long lines fit in a narrower, @code{@@smallbook} page
7286 without needing to be shortened.  Both commands typeset in the normal
7287 font size when you format for the 8.5 by 11 inch size; indeed,
7288 in this situation, the @code{@@smallexample} and @code{@@smalllisp}
7289 commands are defined to be the @code{@@example} and @code{@@lisp}
7290 commands.@refill
7291
7292 In Info, the @code{@@smallexample} and @code{@@smalllisp} commands are
7293 equivalent to the @code{@@example} and @code{@@lisp} commands, and work
7294 exactly the same.@refill
7295
7296 Mark the end of @code{@@smallexample} or @code{@@smalllisp} with
7297 @code{@@end smallexample} or @code{@@end smalllisp},
7298 respectively.@refill
7299
7300 @iftex
7301 Here is an example written in the small font used by the
7302 @code{@@smallexample} and @code{@@smalllisp} commands:
7303
7304 @ifclear smallbook
7305 @display
7306 @tex
7307 % Remove extra vskip; this is a kludge to counter the effect of display
7308 \vskip-3\baselineskip
7309 {\ninett
7310 \dots{} to make sure that you have the freedom to
7311 distribute copies of free software (and charge for
7312 this service if you wish), that you receive source
7313 code or can get it if you want it, that you can
7314 change the software or use pieces of it in new free
7315 programs; and that you know you can do these things.}
7316 @end tex
7317 @end display
7318 @end ifclear
7319 @end iftex
7320 @ifset smallbook
7321 @iftex
7322 @smallexample
7323 This is an example of text written between @code{@@smallexample} and
7324 @code{@@end smallexample}.  In Info and in an 8.5 by 11 inch manual,
7325 this text appears in its normal size; but in a 7 by 9.25 inch manual,
7326 this text appears in a smaller font.
7327 @end smallexample
7328 @end iftex
7329 @end ifset
7330 @ifinfo
7331 @smallexample
7332 This is an example of text written between @code{@@smallexample} and
7333 @code{@@end smallexample}.  In Info and in an 8.5 by 11 inch manual,
7334 this text appears in its normal size; but in a 7 by 9.25 inch manual,
7335 this text appears in a smaller font.
7336 @end smallexample
7337 @end ifinfo
7338
7339 The @code{@@smallexample} and @code{@@smalllisp} commands make it
7340 easier to prepare smaller format manuals without forcing you to edit
7341 examples by hand to fit them onto narrower pages.@refill
7342
7343 As a general rule, a printed document looks better if you write all the
7344 examples in a chapter consistently in @code{@@example} or in
7345 @code{@@smallexample}.  Only occasionally should you mix the two
7346 formats.@refill
7347
7348 @xref{smallbook, , Printing ``Small'' Books}, for more information
7349 about the @code{@@smallbook} command.@refill
7350
7351 @node display, format, smallexample & smalllisp, Quotations and Examples
7352 @comment  node-name,  next,  previous,  up
7353 @section @code{@@display}
7354 @cindex Display formatting
7355 @findex display
7356
7357 The @code{@@display} command begins a kind of example.  It is like the
7358 @code{@@example} command
7359 except that, in
7360 a printed manual, @code{@@display} does not select the fixed-width
7361 font.  In fact, it does not specify the font at all, so that the text
7362 appears in the same font it would have appeared in without the
7363 @code{@@display} command.@refill
7364
7365 @display
7366 This is an example of text written between an @code{@@display} command
7367 and an @code{@@end display} command.  The @code{@@display} command
7368 indents the text, but does not fill it.
7369 @end display
7370
7371 @node format, exdent, display, Quotations and Examples
7372 @comment  node-name,  next,  previous,  up
7373 @section @code{@@format}
7374 @findex format
7375
7376 The @code{@@format} command is similar to @code{@@example} except
7377 that, in the printed manual, @code{@@format} does not select the
7378 fixed-width font and does not narrow the margins.@refill
7379
7380 @format
7381 This is an example of text written between an @code{@@format} command
7382 and an @code{@@end format} command.  As you can see
7383 from this example,
7384 the @code{@@format} command does not fill the text.
7385 @end format
7386
7387 @node exdent, flushleft & flushright, format, Quotations and Examples
7388 @section @code{@@exdent}: Undoing a Line's Indentation
7389 @cindex Indentation undoing
7390 @findex exdent
7391
7392 The @code{@@exdent} command removes any indentation a line might have.
7393 The command is written at the beginning of a line and applies only to
7394 the text that follows the command that is on the same line.  Do not use
7395 braces around the text.  In a printed manual, the text on an
7396 @code{@@exdent} line is printed in the roman font.@refill
7397
7398 @code{@@exdent} is usually used within examples.  Thus,@refill
7399
7400 @example
7401 @group
7402 @@example
7403 This line follows an @@@@example command.
7404 @@exdent This line is exdented.
7405 This line follows the exdented line.
7406 The @@@@end example comes on the next line.
7407 @@end group
7408 @end group
7409 @end example
7410
7411 @noindent
7412 produces
7413
7414 @example
7415 @group
7416 This line follows an @@example command.
7417 @exdent This line is exdented.
7418 This line follows the exdented line.
7419 The @@end example comes on the next line.
7420 @end group
7421 @end example
7422
7423 In practice, the @code{@@exdent} command is rarely used.
7424 Usually, you un-indent text by ending the example and
7425 returning the page to its normal width.@refill
7426
7427 @node flushleft & flushright, cartouche, exdent, Quotations and Examples
7428 @section @code{@@flushleft} and @code{@@flushright}
7429 @findex flushleft
7430 @findex flushright
7431
7432 The @code{@@flushleft} and @code{@@flushright} commands line up the
7433 ends of lines on the left and right margins of a page,
7434 but do not fill the text.  The commands are written on lines of their
7435 own, without braces.  The @code{@@flushleft} and @code{@@flushright}
7436 commands are ended by @code{@@end flushleft} and @code{@@end
7437 flushright} commands on lines of their own.@refill
7438
7439 @need 1500
7440 For example,
7441
7442 @example
7443 @group
7444 @@flushleft
7445 This text is
7446 written flushleft.
7447 @@end flushleft
7448 @end group
7449 @end example
7450
7451 @noindent
7452 produces
7453
7454 @quotation
7455 @flushleft
7456 This text is
7457 written flushleft.
7458 @end flushleft
7459 @end quotation
7460
7461
7462 Flushright produces the type of indentation often used in the return
7463 address of letters.@refill
7464
7465 @need 1500
7466 @noindent
7467 For example,
7468
7469 @example
7470 @group
7471 @@flushright
7472 Here is an example of text written
7473 flushright.  The @@code@{@@flushright@} command
7474 right justifies every line but leaves the
7475 left end ragged.
7476 @@end flushright
7477 @end group
7478 @end example
7479
7480 @noindent
7481 produces
7482
7483 @flushright
7484 Here is an example of text written
7485 flushright.  The @code{@@flushright} command
7486 right justifies every line but leaves the
7487 left end ragged.
7488 @end flushright
7489
7490 @node cartouche, , flushleft & flushright, Quotations and Examples
7491 @section Drawing Cartouches Around Examples
7492 @findex cartouche
7493 @cindex Box with rounded corners
7494
7495 In a printed manual, the @code{@@cartouche} command draws a box with
7496 rounded corners around its contents.  You can use this command to
7497 further highlight an example or quotation.  For instance, you could
7498 write a manual in which one type of example is surrounded by a cartouche
7499 for emphasis.@refill
7500
7501 The @code{@@cartouche} command affects only the printed manual; it has
7502 no effect in the Info file.@refill
7503
7504 @need 1500
7505 For example,
7506
7507 @example
7508 @group
7509 @@example
7510 @@cartouche
7511 % pwd
7512 /usr/local/lib/emacs/info
7513 @@end cartouche
7514 @@end example
7515 @end group
7516 @end example
7517
7518 @noindent
7519 surrounds the two-line example with a box with rounded corners, in the
7520 printed manual.
7521
7522 @iftex
7523 In a printed manual, the example looks like this:@refill
7524
7525 @example
7526 @group
7527 @cartouche
7528 % pwd
7529 /usr/local/lib/emacs/info
7530 @end cartouche
7531 @end group
7532 @end example
7533 @end iftex
7534
7535 @node Lists and Tables, Indices, Quotations and Examples, Top
7536 @comment  node-name,  next,  previous,  up
7537 @chapter Making Lists and Tables
7538 @cindex Making lists and tables
7539 @cindex Lists and tables, making them
7540 @cindex Tables and lists, making them
7541
7542 Texinfo has several ways of making lists and two-column tables.  Lists can
7543 be bulleted or numbered, while two-column tables can highlight the items in
7544 the first column.@refill
7545
7546 @menu
7547 * Introducing Lists::           Texinfo formats lists for you.
7548 * itemize::                     How to construct a simple list.
7549 * enumerate::                   How to construct a numbered list.
7550 * Two-column Tables::           How to construct a two-column table.
7551 * Multi-column Tables::         How to construct generalized tables.
7552 @end menu
7553
7554 @ifinfo
7555 @node Introducing Lists, itemize, Lists and Tables, Lists and Tables
7556 @heading Introducing Lists
7557 @end ifinfo
7558
7559 Texinfo automatically indents the text in lists or tables, and numbers
7560 an enumerated list.  This last feature is useful if you modify the
7561 list, since you do not need to renumber it yourself.@refill
7562
7563 Numbered lists and tables begin with the appropriate @@-command at the
7564 beginning of a line, and end with the corresponding @code{@@end}
7565 command on a line by itself.  The table and itemized-list commands
7566 also require that you write formatting information on the same line as
7567 the beginning @@-command.@refill
7568
7569 Begin an enumerated list, for example, with an @code{@@enumerate}
7570 command and end the list with an @code{@@end enumerate} command.
7571 Begin an itemized list with an @code{@@itemize} command, followed on
7572 the same line by a formatting command such as @code{@@bullet}, and end
7573 the list with an @code{@@end itemize} command.@refill
7574 @findex end
7575
7576 Precede each element of a list with an @code{@@item} or @code{@@itemx}
7577 command.@refill
7578
7579 @sp 1
7580 @noindent
7581 Here is an itemized list of the different kinds of table and lists:@refill
7582
7583 @itemize @bullet
7584 @item
7585 Itemized lists with and without bullets.
7586
7587 @item
7588 Enumerated lists, using numbers or letters.
7589
7590 @item
7591 Two-column tables with highlighting.
7592 @end itemize
7593
7594 @sp 1
7595 @noindent
7596 Here is an enumerated list with the same items:@refill
7597
7598 @enumerate
7599 @item
7600 Itemized lists with and without bullets.
7601
7602 @item
7603 Enumerated lists, using numbers or letters.
7604
7605 @item
7606 Two-column tables with highlighting.
7607 @end enumerate
7608
7609 @sp 1
7610 @noindent
7611 And here is a two-column table with the same items and their
7612 @w{@@-commands}:@refill
7613
7614 @table @code
7615 @item @@itemize
7616 Itemized lists with and without bullets.
7617
7618 @item @@enumerate
7619 Enumerated lists, using numbers or letters.
7620
7621 @item @@table
7622 @itemx @@ftable
7623 @itemx @@vtable
7624 Two-column tables with indexing.
7625 @end table
7626
7627 @node itemize, enumerate, Introducing Lists, Lists and Tables
7628 @comment  node-name,  next,  previous,  up
7629 @section Making an Itemized List
7630 @cindex Itemization
7631 @findex itemize
7632
7633 The @code{@@itemize} command produces sequences of indented
7634 paragraphs, with a bullet or other mark inside the left margin
7635 at the beginning of each paragraph for which such a mark is desired.@refill
7636
7637 Begin an itemized list by writing @code{@@itemize} at the beginning of
7638 a line.  Follow the command, on the same line, with a character or a
7639 Texinfo command that generates a mark.  Usually, you will write
7640 @code{@@bullet} after @code{@@itemize}, but you can use
7641 @code{@@minus}, or any character or any special symbol that results in
7642 a single character in the Info file.  (When you write @code{@@bullet}
7643 or @code{@@minus} after an @code{@@itemize} command, you may omit the
7644 @samp{@{@}}.)@refill
7645
7646 Write the text of the indented paragraphs themselves after the
7647 @code{@@itemize}, up to another line that says @code{@@end
7648 itemize}.@refill
7649
7650 Before each paragraph for which a mark in the margin is desired, write
7651 a line that says just @code{@@item}.  Do not write any other text on this
7652 line.@refill
7653 @findex item
7654
7655 Usually, you should put a blank line before an @code{@@item}.  This
7656 puts a blank line in the Info file. (@TeX{} inserts the proper
7657 interline whitespace in either case.)  Except when the entries are
7658 very brief, these blank lines make the list look better.@refill
7659
7660 Here is an example of the use of @code{@@itemize}, followed by the
7661 output it produces.  Note that @code{@@bullet} produces an @samp{*} in
7662 Info and a round dot in @TeX{}.@refill
7663
7664 @example
7665 @group
7666 @@itemize @@bullet
7667 @@item
7668 Some text for foo.
7669
7670 @@item
7671 Some text
7672 for bar.
7673 @@end itemize
7674 @end group
7675 @end example
7676
7677 @noindent
7678 This produces:
7679
7680 @quotation
7681 @itemize @bullet
7682 @item
7683 Some text for foo.
7684
7685 @item
7686 Some text
7687 for bar.
7688 @end itemize
7689 @end quotation
7690
7691 Itemized lists may be embedded within other itemized lists.  Here is a
7692 list marked with dashes embedded in a list marked with bullets:@refill
7693
7694 @example
7695 @group
7696 @@itemize @@bullet
7697 @@item
7698 First item.
7699
7700 @@itemize @@minus
7701 @@item
7702 Inner item.
7703
7704 @@item
7705 Second inner item.
7706 @@end itemize
7707
7708 @@item
7709 Second outer item.
7710 @@end itemize
7711 @end group
7712 @end example
7713
7714 @noindent
7715 This produces:
7716
7717 @quotation
7718 @itemize @bullet
7719 @item
7720 First item.
7721
7722 @itemize @minus
7723 @item
7724 Inner item.
7725
7726 @item
7727 Second inner item.
7728 @end itemize
7729
7730 @item
7731 Second outer item.
7732 @end itemize
7733 @end quotation
7734
7735 @node enumerate, Two-column Tables, itemize, Lists and Tables
7736 @comment  node-name,  next,  previous,  up
7737 @section Making a Numbered or Lettered List
7738 @cindex Enumeration
7739 @findex enumerate
7740
7741 @code{@@enumerate} is like @code{@@itemize} except that the marks in
7742 the left margin contain successive integers or letters.
7743 (@xref{itemize, , @code{@@itemize}}.)@refill
7744
7745 Write the @code{@@enumerate} command at the beginning of a line.
7746 The command does not require an argument, but accepts either a number or
7747 a letter as an option.
7748 Without an argument, @code{@@enumerate} starts the list
7749 with the number 1.  With a numeric argument, such as 3,
7750 the command starts the list with that number.
7751 With an upper or lower case letter, such as @kbd{a} or @kbd{A},
7752 the command starts the list with that letter.@refill
7753
7754 Write the text of the enumerated list in the same way you write an
7755 itemized list: put @code{@@item} on a line of its own before the start of
7756 each paragraph that you want enumerated.  Do not write any other text on
7757 the line beginning with @code{@@item}.@refill
7758
7759 You should put a blank line between entries in the list.
7760 This generally makes it easier to read the Info file.@refill
7761
7762 @need 1500
7763 Here is an example of @code{@@enumerate} without an argument:@refill
7764
7765 @example
7766 @group
7767 @@enumerate
7768 @@item
7769 Underlying causes.
7770
7771 @@item
7772 Proximate causes.
7773 @@end enumerate
7774 @end group
7775 @end example
7776
7777 @noindent
7778 This produces:
7779
7780 @enumerate
7781 @item
7782 Underlying causes.
7783
7784 @item
7785 Proximate causes.
7786 @end enumerate
7787 @sp 1
7788 Here is an example with an argument of @kbd{3}:@refill
7789 @sp 1
7790 @example
7791 @group
7792 @@enumerate 3
7793 @@item
7794 Predisposing causes.
7795
7796 @@item
7797 Precipitating causes.
7798
7799 @@item
7800 Perpetuating causes.
7801 @@end enumerate
7802 @end group
7803 @end example
7804
7805 @noindent
7806 This produces:
7807
7808 @enumerate 3
7809 @item
7810 Predisposing causes.
7811
7812 @item
7813 Precipitating causes.
7814
7815 @item
7816 Perpetuating causes.
7817 @end enumerate
7818 @sp 1
7819 Here is a brief summary of the alternatives.  The summary is constructed
7820 using @code{@@enumerate} with an argument of @kbd{a}.@refill
7821 @sp 1
7822 @enumerate a
7823 @item
7824 @code{@@enumerate}
7825
7826 Without an argument, produce a numbered list, starting with the number
7827 1.@refill
7828
7829 @item
7830 @code{@@enumerate @var{positive-integer}}
7831
7832 With a (positive) numeric argument, start a numbered list with that
7833 number.  You can use this to continue a list that you interrupted with
7834 other text.@refill
7835
7836 @item
7837 @code{@@enumerate @var{upper-case-letter}}
7838
7839 With an upper case letter as argument, start a list
7840 in which each item is marked
7841 by a letter, beginning with that upper case letter.@refill
7842
7843 @item
7844 @code{@@enumerate @var{lower-case-letter}}
7845
7846 With a lower case letter as argument, start a list
7847 in which each item is marked by
7848 a letter, beginning with that lower case letter.@refill
7849 @end enumerate
7850
7851 You can also nest enumerated lists, as in an outline.@refill
7852
7853 @node Two-column Tables, Multi-column Tables, enumerate, Lists and Tables
7854 @section Making a Two-column Table
7855 @cindex Tables, making two-column
7856 @findex table
7857
7858 @code{@@table} is similar to @code{@@itemize}, but the command allows
7859 you to specify a name or heading line for each item.  (@xref{itemize,
7860 , @code{@@itemize}}.)  The @code{@@table} command is used to produce
7861 two-column tables, and is especially useful for glossaries and
7862 explanatory exhibits.@refill
7863
7864 @menu
7865 * table::                       How to construct a two-column table.
7866 * ftable vtable::               How to construct a two-column table
7867                                   with automatic indexing.
7868 * itemx::                       How to put more entries in the first column.
7869 @end menu
7870
7871 @ifinfo
7872 @node table, ftable vtable, Two-column Tables, Two-column Tables
7873 @subheading Using the @code{@@table} Command
7874
7875 Use the @code{@@table} command to produce two-column tables.@refill
7876 @end ifinfo
7877
7878 Write the @code{@@table} command at the beginning of a line and follow
7879 it on the same line with an argument that is a Texinfo command such as
7880 @code{@@code}, @code{@@samp}, @code{@@var}, or @code{@@kbd}.
7881 Although these commands are usually followed by arguments in braces,
7882 in this case you use the command name without an argument because
7883 @code{@@item} will supply the argument.  This command will be applied
7884 to the text that goes into the first column of each item and
7885 determines how it will be highlighted.  For example, @code{@@samp}
7886 will cause the text in the first column to be highlighted with an
7887 @code{@@samp} command.@refill
7888
7889 You may also choose to use the @code{@@asis} command as an argument to
7890 @code{@@table}.  @code{@@asis} is a command that does nothing; if you use this
7891 command after @code{@@table}, @TeX{} and the Info formatting commands
7892 output the first column entries without added highlighting (`as
7893 is').@refill
7894
7895 (The @code{@@table} command may work with other commands besides those
7896 listed here.  However, you can only use commands
7897 that normally take arguments in braces.)@refill
7898
7899 Begin each table entry with an @code{@@item} command at the beginning
7900 of a line.  Write the first column text on the same line as the
7901 @code{@@item} command.  Write the second column text on the line
7902 following the @code{@@item} line and on subsequent lines.  (You do not
7903 need to type anything for an empty second column entry.)  You may
7904 write as many lines of supporting text as you wish, even several
7905 paragraphs.  But only text on the same line as the @code{@@item} will
7906 be placed in the first column.@refill
7907 @findex item
7908
7909 Normally, you should put a blank line before an @code{@@item} line.
7910 This puts a blank like in the Info file.  Except when the entries are
7911 very brief, a blank line looks better.@refill
7912
7913 @need 1500
7914 The following table, for example, highlights the text in the first
7915 column with an @code{@@samp} command:@refill
7916
7917 @example
7918 @group
7919 @@table @@samp
7920 @@item foo
7921 This is the text for
7922 @@samp@{foo@}.
7923
7924 @@item bar
7925 Text for @@samp@{bar@}.
7926 @@end table
7927 @end group
7928 @end example
7929
7930 @noindent
7931 This produces:
7932
7933 @table @samp
7934 @item foo
7935 This is the text for
7936 @samp{foo}.
7937 @item bar
7938 Text for @samp{bar}.
7939 @end table
7940
7941 If you want to list two or more named items with a single block of
7942 text, use the @code{@@itemx} command.  (@xref{itemx, ,
7943 @code{@@itemx}}.)@refill
7944
7945 @node ftable vtable, itemx, table, Two-column Tables
7946 @comment  node-name,  next,  previous,  up
7947 @subsection @code{@@ftable} and @code{@@vtable}
7948 @cindex Tables with indexes
7949 @cindex Indexing table entries automatically
7950 @findex ftable
7951 @findex vtable
7952
7953 The @code{@@ftable} and @code{@@vtable} commands are the same as the
7954 @code{@@table} command except that @code{@@ftable} automatically enters
7955 each of the items in the first column of the table into the index of
7956 functions and @code{@@vtable} automatically enters each of the items in
7957 the first column of the table into the index of variables.  This
7958 simplifies the task of creating indices.  Only the items on the same
7959 line as the @code{@@item} commands are indexed, and they are indexed in
7960 exactly the form that they appear on that line.  @xref{Indices, ,
7961 Creating Indices}, for more information about indices.@refill
7962
7963 Begin a two-column table using @code{@@ftable} or @code{@@vtable} by
7964 writing the @@-command at the beginning of a line, followed on the same
7965 line by an argument that is a Texinfo command such as @code{@@code},
7966 exactly as you would for an @code{@@table} command; and end the table
7967 with an @code{@@end ftable} or @code{@@end vtable} command on a line by
7968 itself.
7969
7970 See the example for @code{@@table} in the previous section.
7971
7972 @node itemx, , ftable vtable, Two-column Tables
7973 @comment  node-name,  next,  previous,  up
7974 @subsection @code{@@itemx}
7975 @cindex Two named items for @code{@@table}
7976 @findex itemx
7977
7978 Use the @code{@@itemx} command inside a table when you have two or
7979 more first column entries for the same item, each of which should
7980 appear on a line of its own.  Use @code{@@itemx} for all but the first
7981 entry.  The @code{@@itemx} command works exactly like @code{@@item}
7982 except that it does not generate extra vertical space above the first
7983 column text.@refill
7984
7985 @need 1000
7986 For example,
7987
7988 @example
7989 @group
7990 @@table @@code
7991 @@item upcase
7992 @@itemx downcase
7993 These two functions accept a character or a string as
7994 argument, and return the corresponding upper case (lower
7995 case) character or string.
7996 @@end table
7997 @end group
7998 @end example
7999
8000 @noindent
8001 This produces:
8002
8003 @table @code
8004 @item upcase
8005 @itemx downcase
8006 These two functions accept a character or a string as
8007 argument, and return the corresponding upper case (lower
8008 case) character or string.@refill
8009 @end table
8010
8011 @noindent
8012 (Note also that this example illustrates multi-line supporting text in
8013 a two-column table.)@refill
8014
8015
8016 @node Multi-column Tables, , Two-column Tables, Lists and Tables
8017 @section Multi-column Tables
8018 @cindex Tables, making multi-column
8019 @findex multitable
8020
8021 @code{@@multitable} allows you to construct tables with any number of
8022 columns, with each column having any width you like.
8023
8024 You define the column widths on the @code{@@multitable} line itself, and
8025 write each row of the actual table following an @code{@@item} command,
8026 with columns separated by an @code{@@tab} command.  Finally, @code{@@end
8027 multitable} completes the table.  Details in the sections below.
8028
8029 @menu
8030 * Multitable Column Widths::    Defining multitable column widths.
8031 * Multitable Rows::             Defining multitable rows, with examples.
8032 @end menu
8033
8034 @node Multitable Column Widths, Multitable Rows, Multi-column Tables, Multi-column Tables
8035 @subsection Multitable Column Widths
8036 @cindex Multitable column widths
8037 @cindex Column widths, defining for multitables
8038 @cindex Widths, defining multitable column
8039
8040 You can define the column widths for a multitable in two ways: as
8041 fractions of the line length; or with a prototype row.  Mixing the two
8042 methods is not supported.  In either case, the widths are defined
8043 entirely on the same line as the @code{@@multitable} command.
8044
8045 @enumerate
8046 @item
8047 @findex columnfractions
8048 @cindex Line length, column widths as fraction of
8049 To specify column widths as fractions of the line length, write
8050 @code{@@columnfractions} and the decimal numbers (presumably less than
8051 1) after the @code{@@multitable} command, as in:
8052
8053 @example
8054 @@multitable @@columnfractions .33 .33 .33
8055 @end example
8056
8057 @noindent The fractions need not add up exactly to 1.0, as these do
8058 not.  This allows you to produce tables that do not need the full line
8059 length.
8060
8061 @item
8062 @cindex Prototype row, column widths defined by
8063 To specify a prototype row, write the longest entry for each column
8064 enclosed in braces after the @code{@@multitable} command.  For example:
8065
8066 @example
8067 @@multitable @{some text for column one@} @{for column two@}
8068 @end example
8069
8070 @noindent
8071 The first column will then have the width of the typeset `some text for
8072 column one', and the second column the width of `for column two'.
8073
8074 The prototype entries need not appear in the table itself.
8075
8076 Although we used simple text in this example, the prototype entries can
8077 contain Texinfo commands; markup commands such as @code{@@code} are
8078 particularly likely to be useful.
8079
8080 @end enumerate
8081
8082
8083 @node Multitable Rows, , Multitable Column Widths, Multi-column Tables
8084 @subsection Multitable Rows
8085 @cindex Multitable rows
8086 @cindex Rows, of a multitable
8087
8088 @findex item
8089 @cindex tab
8090 After the @code{@@multitable} command defining the column widths (see
8091 the previous section), you begin each row in the body of a multitable
8092 with @code{@@item}, and separate the column entries with @code{@@tab}.
8093 Line breaks are not special within the table body, and you may break
8094 input lines in your source file as necessary.
8095
8096 Here is a complete example of a multi-column table (the text is from
8097 the GNU Emacs manual):
8098
8099 @example
8100 @@multitable @@columnfractions .15 .45 .4
8101 @@item Key @@tab Command @@tab Description
8102 @@item C-x 2
8103 @@tab @@code@{split-window-vertically@}
8104 @@tab Split the selected window into two windows,
8105 with one above the other.
8106 @@item C-x 3
8107 @@tab @@code@{split-window-horizontally@}
8108 @@tab Split the selected window into two windows
8109 positioned side by side.
8110 @@item C-Mouse-2
8111 @@tab
8112 @@tab In the mode line or scroll bar of a window,
8113 split that window.
8114 @@end multitable
8115 @end example
8116
8117 @noindent produces:
8118
8119 @multitable @columnfractions .15 .45 .4
8120 @item Key @tab Command @tab Description
8121 @item C-x 2
8122 @tab @code{split-window-vertically}
8123 @tab Split the selected window into two windows,
8124 with one above the other.
8125 @item C-x 3
8126 @tab @code{split-window-horizontally}
8127 @tab Split the selected window into two windows
8128 positioned side by side.
8129 @item C-Mouse-2
8130 @tab
8131 @tab In the mode line or scroll bar of a window,
8132 split that window.
8133 @end multitable
8134
8135
8136 @node Indices, Insertions, Lists and Tables, Top
8137 @comment node-name,  next,  previous,  up
8138 @chapter Creating Indices
8139 @cindex Indices
8140 @cindex Creating indices
8141
8142 Using Texinfo, you can generate indices without having to sort and
8143 collate entries manually.  In an index, the entries are listed in
8144 alphabetical order, together with information on how to find the
8145 discussion of each entry.  In a printed manual, this information
8146 consists of page numbers.  In an Info file, this information is a menu
8147 entry leading to the first node referenced.@refill
8148
8149 Texinfo provides several predefined kinds of index: an index
8150 for functions, an index for variables, an index for concepts, and so
8151 on.  You can combine indices or use them for other than their
8152 canonical purpose.  If you wish, you can define your own indices.@refill
8153
8154 @menu
8155 * Index Entries::               Choose different words for index entries.
8156 * Predefined Indices::          Use different indices for different kinds
8157                                   of entry.
8158 * Indexing Commands::           How to make an index entry.
8159 * Combining Indices::           How to combine indices.
8160 * New Indices::                 How to define your own indices.
8161 @end menu
8162
8163 @node Index Entries, Predefined Indices, Indices, Indices
8164 @comment  node-name,  next,  previous,  up
8165 @section Making Index Entries
8166 @cindex Index entries, making
8167 @cindex Entries, making index
8168
8169 When you are making index entries, it is good practice to think of the
8170 different ways people may look for something.  Different people
8171 @emph{do not} think of the same words when they look something up.  A
8172 helpful index will have items indexed under all the different words
8173 that people may use.  For example, one reader may think it obvious that
8174 the two-letter names for indices should be listed under ``Indices,
8175 two-letter names'', since the word ``Index'' is the general concept.
8176 But another reader may remember the specific concept of two-letter
8177 names and search for the entry listed as ``Two letter names for
8178 indices''.  A good index will have both entries and will help both
8179 readers.@refill
8180
8181 Like typesetting, the construction of an index is a highly skilled,
8182 professional art, the subtleties of which are not appreciated until you
8183 need to do it yourself.@refill
8184
8185 @xref{Printing Indices & Menus}, for information about printing an index
8186 at the end of a book or creating an index menu in an Info file.@refill
8187
8188 @node Predefined Indices, Indexing Commands, Index Entries, Indices
8189 @comment  node-name,  next,  previous,  up
8190 @section Predefined Indices
8191
8192 Texinfo provides six predefined indices:@refill
8193
8194 @itemize @bullet
8195 @item
8196 A @dfn{concept index} listing concepts that are discussed.@refill
8197
8198 @item
8199 A @dfn{function index} listing functions (such as entry points of
8200 libraries).@refill
8201
8202 @item
8203 A @dfn{variables index} listing variables (such as global variables
8204 of libraries).@refill
8205
8206 @item
8207 A @dfn{keystroke index} listing keyboard commands.@refill
8208
8209 @item
8210 A @dfn{program index} listing names of programs.@refill
8211
8212 @item
8213 A @dfn{data type index} listing data types (such as structures defined in
8214 header files).@refill
8215 @end itemize
8216
8217 @noindent
8218 Not every manual needs all of these, and most manuals use two or three
8219 of them.  This manual has two indices: a
8220 concept index and an @@-command index (that is actually the function
8221 index but is called a command index in the chapter heading).  Two or
8222 more indices can be combined into one using the @code{@@synindex} or
8223 @code{@@syncodeindex} commands.  @xref{Combining Indices}.@refill
8224
8225 @node Indexing Commands, Combining Indices, Predefined Indices, Indices
8226 @comment  node-name,  next,  previous,  up
8227 @section Defining the Entries of an Index
8228 @cindex Defining indexing entries
8229 @cindex Index entries
8230 @cindex Entries for an index
8231 @cindex Specifying index entries
8232 @cindex Creating index entries
8233
8234 The data to make an index come from many individual indexing commands
8235 scattered throughout the Texinfo source file.  Each command says to add
8236 one entry to a particular index; after formatting, the index will give
8237 the current page number or node name as the reference.@refill
8238
8239 An index entry consists of an indexing command at the beginning of a
8240 line followed, on the rest of the line, by the entry.@refill
8241
8242 For example, this section begins with the following five entries for
8243 the concept index:@refill
8244
8245 @example
8246 @@cindex Defining indexing entries
8247 @@cindex Index entries
8248 @@cindex Entries for an index
8249 @@cindex Specifying index entries
8250 @@cindex Creating index entries
8251 @end example
8252
8253 Each predefined index has its own indexing command---@code{@@cindex}
8254 for the concept index, @code{@@findex} for the function index, and so
8255 on.@refill
8256
8257 @cindex Writing index entries
8258 @cindex Index entry writing
8259 Concept index entries consist of text.  The best way to write an index
8260 is to choose entries that are terse yet clear.  If you can do this,
8261 the index often looks better if the entries are not capitalized, but
8262 written just as they would appear in the middle of a sentence.
8263 (Capitalize proper names and acronyms that always call for upper case
8264 letters.)  This is the case convention we use in most GNU manuals'
8265 indices.
8266
8267 If you don't see how to make an entry terse yet clear, make it longer
8268 and clear---not terse and confusing.  If many of the entries are several
8269 words long, the index may look better if you use a different convention:
8270 to capitalize the first word of each entry.  But do not capitalize a
8271 case-sensitive name such as a C or Lisp function name or a shell
8272 command; that would be a spelling error.
8273
8274 Whichever case convention you use, please use it consistently!
8275
8276 @ignore
8277 Concept index entries consist of English text.  The usual convention
8278 is to capitalize the first word of each such index entry, unless that
8279 word is the name of a function, variable, or other such entity that
8280 should not be capitalized.  However, if your concept index entries are
8281 consistently short (one or two words each) it may look better for each
8282 regular entry to start with a lower case letter, aside from proper
8283 names and acronyms that always call for upper case letters.  Whichever
8284 convention you adapt, please be consistent!
8285 @end ignore
8286
8287 Entries in indices other than the concept index are symbol names in
8288 programming languages, or program names; these names are usually
8289 case-sensitive, so use upper and lower case as required for them.
8290
8291 By default, entries for a concept index are printed in a small roman
8292 font and entries for the other indices are printed in a small
8293 @code{@@code} font.  You may change the way part of an entry is
8294 printed with the usual Texinfo commands, such as @code{@@file} for
8295 file names and @code{@@emph} for emphasis (@pxref{Marking
8296 Text}).@refill
8297 @cindex Index font types
8298
8299 @cindex Predefined indexing commands
8300 @cindex Indexing commands, predefined
8301 The six indexing commands for predefined indices are:
8302
8303 @table @code
8304 @item @@cindex @var{concept}
8305 @findex cindex
8306 Make an entry in the concept index for @var{concept}.@refill
8307
8308 @item @@findex @var{function}
8309 @findex findex
8310 Make an entry in the function index for @var{function}.@refill
8311
8312 @item @@vindex @var{variable}
8313 @findex vindex
8314 Make an entry in the variable index for @var{variable}.@refill
8315
8316 @item @@kindex @var{keystroke}
8317 @findex kindex
8318 Make an entry in the key index for @var{keystroke}.@refill
8319
8320 @item @@pindex @var{program}
8321 @findex pindex
8322 Make an entry in the program index for @var{program}.@refill
8323
8324 @item @@tindex @var{data type}
8325 @findex tindex
8326 Make an entry in the data type index for @var{data type}.@refill
8327 @end table
8328
8329 @quotation
8330 @strong{Caution:} Do not use a colon in an index entry.  In Info, a
8331 colon separates the menu entry name from the node name.  An extra
8332 colon confuses Info.
8333 @xref{Menu Parts, , The Parts of a Menu},
8334 for more information about the structure of a menu entry.@refill
8335 @end quotation
8336
8337 If you write several identical index entries in different places in a
8338 Texinfo file, the index in the printed manual will list all the pages to
8339 which those entries refer.  However, the index in the Info file will
8340 list @strong{only} the node that references the @strong{first} of those
8341 index entries.  Therefore, it is best to write indices in which each
8342 entry refers to only one place in the Texinfo file.  Fortunately, this
8343 constraint is a feature rather than a loss since it means that the index
8344 will be easy to use.  Otherwise, you could create an index that lists
8345 several pages for one entry and your reader would not know to which page
8346 to turn.  If you have two identical entries for one topic, change the
8347 topics slightly, or qualify them to indicate the difference.@refill
8348
8349 You are not actually required to use the predefined indices for their
8350 canonical purposes.  For example, suppose you wish to index some C
8351 preprocessor macros.  You could put them in the function index along
8352 with actual functions, just by writing @code{@@findex} commands for
8353 them; then, when you print the ``Function Index'' as an unnumbered
8354 chapter, you could give it the title `Function and Macro Index' and
8355 all will be consistent for the reader.  Or you could put the macros in
8356 with the data types by writing @code{@@tindex} commands for them, and
8357 give that index a suitable title so the reader will understand.
8358 (@xref{Printing Indices & Menus}.)@refill
8359
8360 @node Combining Indices, New Indices, Indexing Commands, Indices
8361 @comment node-name,  next,  previous,  up
8362 @section Combining Indices
8363 @cindex Combining indices
8364 @cindex Indices, combining them
8365
8366 Sometimes you will want to combine two disparate indices such as functions
8367 and concepts, perhaps because you have few enough of one of them that
8368 a separate index for them would look silly.@refill
8369
8370 You could put functions into the concept index by writing
8371 @code{@@cindex} commands for them instead of @code{@@findex} commands,
8372 and produce a consistent manual by printing the concept index with the
8373 title `Function and Concept Index' and not printing the `Function
8374 Index' at all; but this is not a robust procedure.  It works only if
8375 your document is never included as part of another
8376 document that is designed to have a separate function index; if your
8377 document were to be included with such a document, the functions from
8378 your document and those from the other would not end up together.
8379 Also, to make your function names appear in the right font in the
8380 concept index, you would need to enclose every one of them between
8381 the braces of @code{@@code}.@refill
8382
8383 @menu
8384 * syncodeindex::                How to merge two indices, using @code{@@code}
8385                                   font for the merged-from index.
8386 * synindex::                    How to merge two indices, using the
8387                                   default font of the merged-to index.
8388 @end menu
8389
8390 @node syncodeindex, synindex, Combining Indices, Combining Indices
8391 @subsection @code{@@syncodeindex}
8392 @findex syncodeindex
8393
8394 When you want to combine functions and concepts into one index, you
8395 should index the functions with @code{@@findex} and index the concepts
8396 with @code{@@cindex}, and use the @code{@@syncodeindex} command to
8397 redirect the function index entries into the concept index.@refill
8398 @findex syncodeindex
8399
8400 The @code{@@syncodeindex} command takes two arguments; they are the name
8401 of the index to redirect, and the name of the index to redirect it to.
8402 The template looks like this:@refill
8403
8404 @example
8405 @@syncodeindex @var{from} @var{to}
8406 @end example
8407
8408 @cindex Predefined names for indices
8409 @cindex Two letter names for indices
8410 @cindex Indices, two letter names
8411 @cindex Names for indices
8412 For this purpose, the indices are given two-letter names:@refill
8413
8414 @table @samp
8415 @item cp
8416 concept index
8417 @item fn
8418 function index
8419 @item vr
8420 variable index
8421 @item ky
8422 key index
8423 @item pg
8424 program index
8425 @item tp
8426 data type index
8427 @end table
8428
8429 Write an @code{@@syncodeindex} command before or shortly after the
8430 end-of-header line at the beginning of a Texinfo file.  For example,
8431 to merge a function index with a concept index, write the
8432 following:@refill
8433
8434 @example
8435 @@syncodeindex fn cp
8436 @end example
8437
8438 @noindent
8439 This will cause all entries designated for the function index to merge
8440 in with the concept index instead.@refill
8441
8442 To merge both a variables index and a function index into a concept
8443 index, write the following:@refill
8444
8445 @example
8446 @group
8447 @@syncodeindex vr cp
8448 @@syncodeindex fn cp
8449 @end group
8450 @end example
8451
8452 @cindex Fonts for indices
8453 The @code{@@syncodeindex} command puts all the entries from the `from'
8454 index (the redirected index) into the @code{@@code} font, overriding
8455 whatever default font is used by the index to which the entries are
8456 now directed.  This way, if you direct function names from a function
8457 index into a concept index, all the function names are printed in the
8458 @code{@@code} font as you would expect.@refill
8459
8460 @node synindex, , syncodeindex, Combining Indices
8461 @subsection @code{@@synindex}
8462 @findex synindex
8463
8464 The @code{@@synindex} command is nearly the same as the
8465 @code{@@syncodeindex} command, except that it does not put the
8466 `from' index  entries into the @code{@@code} font; rather it puts
8467 them in the roman font.  Thus, you use @code{@@synindex} when you
8468 merge a concept index into a function index.@refill
8469
8470 @xref{Printing Indices & Menus}, for information about printing an index
8471 at the end of a book or creating an index menu in an Info file.@refill
8472
8473 @node New Indices, , Combining Indices, Indices
8474 @section Defining New Indices
8475 @cindex Defining new indices
8476 @cindex Indices, defining new
8477 @cindex New index defining
8478 @findex defindex
8479 @findex defcodeindex
8480
8481 In addition to the predefined indices, you may use the
8482 @code{@@defindex} and @code{@@defcodeindex} commands to define new
8483 indices.  These commands create new indexing @@-commands with which
8484 you mark index entries.  The @code{@@defindex }command is used like
8485 this:@refill
8486
8487 @example
8488 @@defindex @var{name}
8489 @end example
8490
8491 The name of an index should be a two letter word, such as @samp{au}.
8492 For example:@refill
8493
8494 @example
8495 @@defindex au
8496 @end example
8497
8498 This defines a new index, called the @samp{au} index.  At the same
8499 time, it creates a new indexing command, @code{@@auindex}, that you
8500 can use to make index entries.  Use the new indexing command just as
8501 you would use a predefined indexing command.@refill
8502
8503 For example, here is a section heading followed by a concept index
8504 entry and two @samp{au} index entries.@refill
8505
8506 @example
8507 @@section Cognitive Semantics
8508 @@cindex kinesthetic image schemas
8509 @@auindex Johnson, Mark
8510 @@auindex Lakoff, George
8511 @end example
8512
8513 @noindent
8514 (Evidently, @samp{au} serves here as an abbreviation for ``author''.)
8515 Texinfo constructs the new indexing command by concatenating the name
8516 of the index with @samp{index}; thus, defining an @samp{au} index
8517 leads to the automatic creation of an @code{@@auindex} command.@refill
8518
8519 Use the @code{@@printindex} command to print the index, as you do with
8520 the predefined indices.  For example:@refill
8521
8522 @example
8523 @group
8524 @@node Author Index, Subject Index, , Top
8525 @@unnumbered Author Index
8526
8527 @@printindex au
8528 @end group
8529 @end example
8530
8531 The @code{@@defcodeindex} is like the @code{@@defindex} command, except
8532 that, in the printed output, it prints entries in an @code{@@code} font
8533 instead of a roman font.  Thus, it parallels the @code{@@findex} command
8534 rather than the @code{@@cindex} command.@refill
8535
8536 You should define new indices within or right after the end-of-header
8537 line of a Texinfo file, before any @code{@@synindex} or
8538 @code{@@syncodeindex} commands (@pxref{Header}).@refill
8539
8540 @node Insertions, Glyphs, Indices, Top
8541 @comment  node-name,  next,  previous,  up
8542 @chapter Special Insertions
8543 @cindex Inserting special characters and symbols
8544 @cindex Special insertions
8545
8546 Texinfo provides several commands for formatting dimensions, for
8547 inserting single characters that have special meaning in Texinfo, such
8548 as braces, and for inserting special graphic symbols that do not
8549 correspond to characters, such as dots and bullets.@refill
8550
8551 @iftex
8552 These are:
8553
8554 @itemize @bullet
8555 @item
8556 Braces, @samp{@@} and periods.
8557
8558 @item
8559 Format a dimension, such as @samp{12@dmn{pt}}.
8560
8561 @item
8562 Dots and bullets.
8563
8564 @item
8565 The @TeX{} logo and the copyright symbol.
8566
8567 @item
8568 A minus sign.
8569 @end itemize
8570 @end iftex
8571
8572 @menu
8573 * Braces Atsigns::              How to insert braces, @samp{@@}.
8574 * Inserting Space::             How to insert the right amount of space
8575                                   within a sentence.
8576 * Inserting Accents::           How to insert accents and special characters.
8577 * Dots Bullets::                How to insert dots and bullets.
8578 * TeX and copyright::           How to insert the @TeX{} logo
8579                                   and the copyright symbol.
8580 * pounds::                      How to insert the pounds currency symbol.
8581 * minus::                       How to insert a minus sign.
8582 * math::                        How to format a mathematical expression.
8583 @end menu
8584
8585
8586 @node Braces Atsigns, Inserting Space, Insertions, Insertions
8587 @section Inserting @@ and Braces
8588 @cindex Inserting @@, braces
8589 @cindex Braces, inserting
8590 @cindex Special characters, commands to insert
8591 @cindex Commands to insert special characters
8592
8593 @samp{@@} and curly braces are special characters in Texinfo.  To insert
8594 these characters so they appear in text, you must put an @samp{@@} in
8595 front of these characters to prevent Texinfo from misinterpreting
8596 them.
8597
8598 Do not put braces after any of these commands; they are not
8599 necessary.
8600
8601 @menu
8602 * Inserting An Atsign::         How to insert @samp{@@}.
8603 * Inserting Braces::            How to insert @samp{@{} and @samp{@}}.
8604 @end menu
8605
8606 @node Inserting An Atsign, Inserting Braces, Braces Atsigns, Braces Atsigns
8607 @subsection Inserting @samp{@@} with @@@@
8608 @findex @@ @r{(single @samp{@@})}
8609
8610 @code{@@@@} stands for a single @samp{@@} in either printed or Info
8611 output.
8612
8613 Do not put braces after an @code{@@@@} command.
8614
8615 @node Inserting Braces, , Inserting An Atsign, Braces Atsigns
8616 @subsection Inserting @samp{@{} and @samp{@}}with @@@{ and @@@}
8617 @findex @{ @r{(single @samp{@{})}
8618 @findex @} @r{(single @samp{@}})}
8619
8620 @code{@@@{} stands for a single @samp{@{} in either printed or Info
8621 output.
8622
8623 @code{@@@}} stands for a single @samp{@}} in either printed or Info
8624 output.
8625
8626 Do not put braces after either an @code{@@@{} or an @code{@@@}}
8627 command.
8628
8629
8630 @node Inserting Space, Inserting Accents, Braces Atsigns, Insertions
8631 @section Inserting Space
8632
8633 @cindex Inserting space
8634 @cindex Spacing, inserting
8635 @cindex Whitespace, inserting
8636 The following sections describe commands that control spacing of various
8637 kinds within and after sentences.
8638
8639 @menu
8640 * Not Ending a Sentence::       Sometimes a . doesn't end a sentence.
8641 * Ending a Sentence::           Sometimes it does.
8642 * Multiple Spaces::             Inserting multiple spaces.
8643 * dmn::                         How to format a dimension.
8644 @end menu
8645
8646 @node Not Ending a Sentence, Ending a Sentence, Inserting Space, Inserting Space
8647 @subsection Not Ending a Sentence
8648
8649 @cindex Not ending a sentence
8650 @cindex Sentence non-ending punctuation
8651 @cindex Periods, inserting
8652 Depending on whether a period or exclamation point or question mark is
8653 inside or at the end of a sentence, less or more space is inserted after
8654 a period in a typeset manual.  Since it is not always possible for
8655 Texinfo to determine when a period ends a sentence and when it is used
8656 in an abbreviation, special commands are needed in some circumstances.
8657 (Usually, Texinfo can guess how to handle periods, so you do not need to
8658 use the special commands; you just enter a period as you would if you
8659 were using a typewriter, which means you put two spaces after the
8660 period, question mark, or exclamation mark that ends a sentence.)
8661
8662 @findex : @r{(suppress widening)}
8663 Use the @code{@@:}@: command after a period, question mark,
8664 exclamation mark, or colon that should not be followed by extra space.
8665 For example, use @code{@@:}@: after periods that end abbreviations
8666 which are not at the ends of sentences.  @code{@@:}@: has no effect on
8667 the Info file output.
8668
8669 @need 700
8670 For example,
8671
8672 @example
8673 The s.o.p.@@: has three parts @dots{}
8674 The s.o.p. has three parts @dots{}
8675 @end example
8676
8677 @noindent
8678 @ifinfo
8679 produces
8680 @end ifinfo
8681 @iftex
8682 produces the following.  If you look carefully at this printed output,
8683 you will see a little more whitespace after @samp{s.o.p.} in the second
8684 line.@refill
8685 @end iftex
8686
8687 @quotation
8688 The s.o.p.@: has three parts @dots{}@*
8689 The s.o.p. has three parts @dots{}
8690 @end quotation
8691
8692 @noindent
8693 @kbd{@@:} has no effect on the Info output.  (@samp{s.o.p.} is an
8694 abbreviation for ``Standard Operating Procedure''.)
8695
8696 Do not put braces after @code{@@:}.
8697
8698
8699 @node Ending a Sentence, Multiple Spaces, Not Ending a Sentence, Inserting Space
8700 @subsection Ending a Sentence
8701
8702 @cindex Ending a Sentence
8703 @cindex Sentence ending punctuation
8704
8705 @findex .  @r{(end of sentence)}
8706 @findex ! @r{(end of sentence)}
8707 @findex ? @r{(end of sentence)}
8708 Use @code{@@.}@: instead of a period, @code{@@!}@: instead of an
8709 exclamation point, and @code{@@?}@: instead of a question mark at the end
8710 of a sentence that ends with a single capital letter.  Otherwise, @TeX{}
8711 will think the letter is an abbreviation and will not insert the correct
8712 end-of-sentence spacing.  Here is an example:
8713
8714 @example
8715 Give it to M.I.B. and to M.E.W@@.  Also, give it to R.J.C@@.
8716 Give it to M.I.B. and to M.E.W.  Also, give it to R.J.C.
8717 @end example
8718
8719 @noindent
8720 @ifinfo
8721 produces
8722 @end ifinfo
8723 @iftex
8724 produces the following.  If you look carefully at this printed output,
8725 you will see a little more whitespace after the @samp{W} in the first
8726 line.
8727 @end iftex
8728
8729 @quotation
8730 Give it to M.I.B. and to M.E.W@.  Also, give it to R.J.C@.@*
8731 Give it to M.I.B. and to M.E.W.  Also, give it to R.J.C.
8732 @end quotation
8733
8734 In the Info file output, @code{@@.}@: is equivalent to a simple
8735 @samp{.}; likewise for @code{@@!}@: and @code{@@?}@:.
8736
8737 The meanings of @code{@@:} and @code{@@.}@: in Texinfo are designed to
8738 work well with the Emacs sentence motion commands (@pxref{Sentences,,,
8739 emacs, GNU Emacs}).  This made it necessary for them to be incompatible
8740 with some other formatting systems that use @@-commands.
8741
8742 Do not put braces after any of these commands.
8743
8744
8745 @node Multiple Spaces, dmn, Ending a Sentence, Inserting Space
8746 @subsection Multiple Spaces
8747
8748 @cindex Multiple spaces
8749 @cindex Whitespace, inserting
8750 @findex (space)
8751 @findex (tab)
8752 @findex (newline)
8753
8754 Ordinarily, @TeX{} collapses multiple whitespace characters (space, tab,
8755 and newline) into a single space.  (Info output, on the other hand,
8756 preserves whitespace as you type it, except for changing a newline into
8757 a space; this is why it is important to put two spaces at the end of
8758 sentences in Texinfo documents.)
8759
8760 Occasionally, you may want to actually insert several consecutive
8761 spaces, either for purposes of example (what your program does with
8762 multiple spaces as input), or merely for purposes of appearance in
8763 headings or lists.  Texinfo supports three commands: @code{@@ },
8764 @code{@@@kbd{TAB}}, and @code{@@@kbd{NL}}, all of which insert a single
8765 space into the output.  (Here, @kbd{TAB} and @kbd{NL} represent the tab
8766 character and end-of-line, i.e., when @samp{@@} is the last character on
8767 a line.)
8768
8769 For example,
8770 @example
8771 Spacey@@ @@ @@ @@
8772 example.
8773 @end example
8774
8775 @noindent produces
8776
8777 @example
8778 Spacey@ @ @ @
8779 example.
8780 @end example
8781
8782 Other possible uses of @code{@@ } have been subsumed by @code{@@multitable}
8783 (@pxref{Multi-column Tables}).
8784
8785 Do not follow any of these commands with braces.
8786
8787
8788 @node dmn, , Multiple Spaces, Inserting Space
8789 @subsection @code{@@dmn}@{@var{dimension}@}: Format a Dimension
8790 @cindex Thin space between number, dimension
8791 @cindex Dimension formatting
8792 @cindex Format a dimension
8793 @findex dmn
8794
8795 At times, you may want to write @samp{12@dmn{pt}} or
8796 @samp{8.5@dmn{in}} with little or no space between the number and the
8797 abbreviation for the dimension.  You can use the @code{@@dmn} command
8798 to do this.  On seeing the command, @TeX{} inserts just enough space
8799 for proper typesetting; the Info formatting commands insert no space
8800 at all, since the Info file does not require it.@refill
8801
8802 To use the @code{@@dmn} command, write the number and then follow it
8803 immediately, with no intervening space, by @code{@@dmn}, and then by
8804 the dimension within braces.@refill
8805
8806 @need 700
8807 @noindent
8808 For example,
8809
8810 @example
8811 A4 paper is 8.27@@dmn@{in@} wide.
8812 @end example
8813
8814 @noindent
8815 produces
8816
8817 @quotation
8818 A4 paper is 8.27@dmn{in} wide.
8819 @end quotation
8820
8821 Not everyone uses this style.  Instead of writing
8822 @w{@samp{8.27@@dmn@{in@}}} in the Texinfo file, you may write
8823 @w{@samp{8.27 in.}} or @w{@samp{8.27 inches}}.  (In these cases, the
8824 formatters may insert a line break between the number and the
8825 dimension.  Also, if you write a period after an abbreviation within a
8826 sentence, you should write @samp{@@:} after the period to prevent
8827 @TeX{} from inserting extra whitespace.  @xref{Inserting Space}.
8828
8829
8830 @node Inserting Accents, Dots Bullets, Inserting Space, Insertions
8831 @section Inserting Accents
8832
8833 @cindex Inserting accents
8834 @cindex Accents, inserting
8835 @cindex Floating accents, inserting
8836
8837 Here is a table with the commands Texinfo provides for inserting
8838 floating accents.  The commands with non-alphabetic names do not take
8839 braces around their argument (which is taken to be the next character).
8840 (Exception: @code{@@,} @emph{does} take braces around its argument.)
8841 This is so as to make the source as convenient to type and read as
8842 possible, since accented characters are very common in some languages.
8843
8844 @findex "
8845 @cindex Umlaut accent
8846 @findex '
8847 @cindex Acute accent
8848 @findex =
8849 @cindex Macron accent
8850 @findex ^
8851 @cindex Circumflex accent
8852 @findex `
8853 @cindex Grave accent
8854 @findex ~
8855 @cindex Tilde accent
8856 @findex ,
8857 @cindex Cedilla accent
8858 @findex dotaccent
8859 @cindex Dot accent
8860 @findex H
8861 @cindex Hungariam umlaut accent
8862 @findex ringaccent
8863 @cindex Ring accent
8864 @findex tieaccent
8865 @cindex Tie-after accent
8866 @findex u
8867 @cindex Breve accent
8868 @findex ubaraccent
8869 @cindex Underbar accent
8870 @findex udotaccent
8871 @cindex Underdot accent
8872 @findex v
8873 @cindex Check accent
8874 @multitable {@@questiondown@{@}} {Output} {macron/overbar accent}
8875 @item Command               @tab Output         @tab What
8876 @item @t{@@"o}              @tab @"o            @tab umlaut accent
8877 @item @t{@@'o}              @tab @'o            @tab acute accent
8878 @item @t{@@,@{c@}}          @tab @,{c}          @tab cedilla accent
8879 @item @t{@@=o}              @tab @=o            @tab macron/overbar accent
8880 @item @t{@@^o}              @tab @^o            @tab circumflex accent
8881 @item @t{@@`o}              @tab @`o            @tab grave accent
8882 @item @t{@@~o}              @tab @~o            @tab tilde accent
8883 @item @t{@@dotaccent@{o@}}  @tab @dotaccent{o}  @tab overdot accent
8884 @item @t{@@H@{o@}}          @tab @H{o}          @tab long Hungarian umlaut
8885 @item @t{@@ringaccent@{o@}} @tab @ringaccent{o} @tab ring accent
8886 @item @t{@@tieaccent@{oo@}} @tab @tieaccent{oo} @tab tie-after accent
8887 @item @t{@@u@{o@}}          @tab @u{o}          @tab breve accent
8888 @item @t{@@ubaraccent@{o@}} @tab @ubaraccent{o} @tab underbar accent
8889 @item @t{@@udotaccent@{o@}} @tab @udotaccent{o} @tab underdot accent
8890 @item @t{@@v@{o@}}          @tab @v{o}          @tab hacek or check accent
8891 @end multitable
8892
8893 This table lists the Texinfo commands for inserting other characters
8894 commonly used in languages other than English.
8895
8896 @findex questiondown
8897 @cindex @questiondown{}
8898 @findex exclamdown
8899 @cindex @exclamdown{}
8900 @findex aa
8901 @cindex @aa{}
8902 @findex AA
8903 @cindex @AA{}
8904 @findex ae
8905 @cindex @ae{}
8906 @findex AE
8907 @cindex @AE{}
8908 @findex dotless
8909 @cindex @dotless{i}
8910 @cindex @dotless{j}
8911 @cindex Dotless i, j
8912 @findex l
8913 @cindex @l{}
8914 @findex L
8915 @cindex @L{}
8916 @findex o
8917 @cindex @o{}
8918 @findex O
8919 @cindex @O{}
8920 @findex oe
8921 @cindex @oe{}
8922 @findex OE
8923 @cindex @OE{}
8924 @findex ss
8925 @cindex @ss{}
8926 @cindex Es-zet
8927 @cindex Sharp S
8928 @cindex German S
8929 @multitable {@@questiondown@{@}} {oe,OE} {es-zet or sharp S}
8930 @item @t{@@exclamdown@{@}}   @tab @exclamdown{}   @tab upside-down !
8931 @item @t{@@questiondown@{@}} @tab @questiondown{} @tab upside-down ?
8932 @item @t{@@aa@{@},@@AA@{@}}  @tab @aa{},@AA{}     @tab A,a with circle
8933 @item @t{@@ae@{@},@@AE@{@}}  @tab @ae{},@AE{}     @tab ae,AE ligatures
8934 @item @t{@@dotless@{i@}}     @tab @dotless{i}     @tab dotless i
8935 @item @t{@@dotless@{j@}}     @tab @dotless{j}     @tab dotless j
8936 @item @t{@@l@{@},@@L@{@}}    @tab @l{},@L{}       @tab suppressed-L,l
8937 @item @t{@@o@{@},@@O@{@}}    @tab @o{},@O{}       @tab O,o with slash
8938 @item @t{@@oe@{@},@@OE@{@}}  @tab @oe{},@OE{}     @tab OE,oe ligatures
8939 @item @t{@@ss@{@}}           @tab @ss{}           @tab es-zet or sharp S
8940 @end multitable
8941
8942
8943 @node Dots Bullets, TeX and copyright, Inserting Accents, Insertions
8944 @section Inserting Ellipsis, Dots, and Bullets
8945 @cindex Dots, inserting
8946 @cindex Bullets, inserting
8947 @cindex Ellipsis, inserting
8948 @cindex Inserting ellipsis
8949 @cindex Inserting dots
8950 @cindex Special typesetting commands
8951 @cindex Typesetting commands for dots, etc.
8952
8953 An @dfn{ellipsis} (a line of dots) is not typeset as a string of
8954 periods, so a special command is used for ellipsis in Texinfo.  The
8955 @code{@@bullet} command is special, too.  Each of these commands is
8956 followed by a pair of braces, @samp{@{@}}, without any whitespace
8957 between the name of the command and the braces.  (You need to use braces
8958 with these commands because you can use them next to other text; without
8959 the braces, the formatters would be confused.  @xref{Command Syntax, ,
8960 @@-Command Syntax}, for further information.)@refill
8961
8962 @menu
8963 * dots::                        How to insert dots @dots{}
8964 * bullet::                      How to insert a bullet.
8965 @end menu
8966
8967 @node dots, bullet, Dots Bullets, Dots Bullets
8968 @comment  node-name,  next,  previous,  up
8969 @subsection @code{@@dots}@{@}
8970 @findex dots
8971 @cindex Inserting dots
8972 @cindex Dots, inserting
8973
8974 Use the @code{@@dots@{@}} command to generate an ellipsis, which is
8975 three dots in a row, appropriately spaced, like this: `@dots{}'.  Do
8976 not simply write three periods in the input file; that would work for
8977 the Info file output, but would produce the wrong amount of space
8978 between the periods in the printed manual.
8979
8980 Similarly, the @code{@@enddots@{@}} command generates an
8981 end-of-sentence ellipsis (four dots) @enddots{}
8982
8983 @iftex
8984 Here is an ellipsis: @dots{}
8985 Here are three periods in a row: ...
8986
8987 In printed output, the three periods in a row are closer together than
8988 the dots in the ellipsis.
8989 @end iftex
8990
8991 @node bullet, , dots, Dots Bullets
8992 @comment  node-name,  next,  previous,  up
8993 @subsection @code{@@bullet}@{@}
8994 @findex bullet
8995
8996 Use the @code{@@bullet@{@}} command to generate a large round dot, or
8997 the closest possible thing to one.  In Info, an asterisk is used.@refill
8998
8999 Here is a bullet: @bullet{}
9000
9001 When you use @code{@@bullet} in @code{@@itemize}, you do not need to
9002 type the braces, because @code{@@itemize} supplies them.
9003 (@xref{itemize, , @code{@@itemize}}.)@refill
9004
9005 @node TeX and copyright, pounds, Dots Bullets, Insertions
9006 @comment  node-name,  next,  previous,  up
9007 @section Inserting @TeX{} and the Copyright Symbol
9008
9009 The logo `@TeX{}' is typeset in a special fashion and it needs an
9010 @@-command.  The copyright symbol, `@copyright{}', is also special.
9011 Each of these commands is followed by a pair of braces, @samp{@{@}},
9012 without any whitespace between the name of the command and the
9013 braces.@refill
9014
9015 @menu
9016 * tex::                         How to insert the @TeX{} logo.
9017 * copyright symbol::            How to use @code{@@copyright}@{@}.
9018 @end menu
9019
9020 @node tex, copyright symbol, TeX and copyright, TeX and copyright
9021 @comment  node-name,  next,  previous,  up
9022 @subsection @code{@@TeX}@{@}
9023 @findex tex (command)
9024
9025 Use the @code{@@TeX@{@}} command to generate `@TeX{}'.  In a printed
9026 manual, this is a special logo that is different from three ordinary
9027 letters.  In Info, it just looks like @samp{TeX}.  The
9028 @code{@@TeX@{@}} command is unique among Texinfo commands in that the
9029 @kbd{T} and the @kbd{X} are in upper case.@refill
9030
9031 @node copyright symbol, , tex, TeX and copyright
9032 @comment  node-name,  next,  previous,  up
9033 @subsection @code{@@copyright}@{@}
9034 @findex copyright
9035
9036 Use the @code{@@copyright@{@}} command to generate `@copyright{}'.  In
9037 a printed manual, this is a @samp{c} inside a circle, and in Info,
9038 this is @samp{(C)}.@refill
9039
9040 @node pounds, minus, TeX and copyright, Insertions
9041 @section @code{@@pounds}@{@}
9042 @findex pounds
9043
9044 Use the @code{@@pounds@{@}} command to generate `@pounds{}'.  In a
9045 printed manual, this is the symbol for the currency pounds sterling.
9046 In Info, it is a @samp{#}.  Other currency symbols are unfortunately not
9047 available.
9048
9049 @node minus, math, pounds, Insertions
9050 @section @code{@@minus}@{@}: Inserting a Minus Sign
9051 @findex minus
9052
9053 Use the @code{@@minus@{@}} command to generate a minus sign.  In a
9054 fixed-width font, this is a single hyphen, but in a proportional font,
9055 the symbol is the customary length for a minus sign---a little longer
9056 than a hyphen.@refill
9057
9058 You can compare the two forms:
9059
9060 @display
9061 @samp{@minus{}} is a minus sign generated with @samp{@@minus@{@}},
9062
9063 `-' is a hyphen generated with the character @samp{-}.
9064 @end display
9065
9066 @noindent
9067 In the fixed-width font used by Info, @code{@@minus@{@}} is the same
9068 as a hyphen.@refill
9069
9070 You should not use @code{@@minus@{@}} inside @code{@@code} or
9071 @code{@@example} because the width distinction is not made in the
9072 fixed-width font they use.@refill
9073
9074 When you use @code{@@minus} to specify the mark beginning each entry in
9075 an itemized list, you do not need to type the braces
9076 (@pxref{itemize, , @code{@@itemize}}.)@refill
9077
9078 @node math, , minus, Insertions
9079 @comment  node-name,  next,  previous,  up
9080 @section @code{@@math}: Inserting Mathematical Expressions
9081 @findex math
9082 @cindex Mathematical expressions
9083
9084 You can write a short mathematical expression with the @code{@@math}
9085 command.  Write the mathematical expression between braces, like this:
9086
9087 @example
9088 @@math@{(a + b)(a + b) = a^2 + 2ab + b^2@}
9089 @end example
9090
9091 @iftex
9092 @need 1000
9093 @noindent
9094 This produces the following in @TeX{}:
9095
9096 @display
9097 @math{(a + b)(a + b) = a^2 + 2ab + b^2}
9098 @end display
9099
9100 @noindent
9101 and the following in Info:
9102 @end iftex
9103 @ifinfo
9104 @noindent
9105 This produces the following in Info:
9106 @end ifinfo
9107
9108 @example
9109 (a + b)(a + b) = a^2 + 2ab + b^2
9110 @end example
9111
9112 The @code{@@math} command has no effect on the Info output.  Currently,
9113 it has limited effect on typeset output.  However, this may change since
9114 @TeX{} itself is designed for mathematical typesetting and does a
9115 splendid job.
9116
9117 Certainly, for complex mathematical expressions, you could use @TeX{}
9118 directly.  @xref{Using Ordinary TeX Commands, , Using Ordinary @TeX{}
9119 Commands}.  When you use @TeX{} directly, remember to write the
9120 mathematical expression between one or two @samp{$} (dollar-signs) as
9121 appropriate.
9122
9123 @node Glyphs, Breaks, Insertions, Top
9124 @comment  node-name,  next,  previous,  up
9125 @chapter Glyphs for Examples
9126 @cindex Glyphs
9127
9128 In Texinfo, code is often illustrated in examples that are delimited
9129 by @code{@@example} and @code{@@end example}, or by @code{@@lisp} and
9130 @code{@@end lisp}.  In such examples, you can indicate the results of
9131 evaluation or an expansion using @samp{@result{}} or
9132 @samp{@expansion{}}.  Likewise, there are commands to insert glyphs
9133 to indicate
9134 printed output, error messages, equivalence of expressions, and the
9135 location of point.@refill
9136
9137 The glyph-insertion commands do not need to be used within an example, but
9138 most often they are.  Every  glyph-insertion command is followed by a pair of
9139 left- and right-hand braces.@refill
9140
9141 @menu
9142 * Glyphs Summary::              
9143 * result::                      How to show the result of expression.
9144 * expansion::                   How to indicate an expansion.
9145 * Print Glyph::                 How to indicate printed output.
9146 * Error Glyph::                 How to indicate an error message.
9147 * Equivalence::                 How to indicate equivalence.
9148 * Point Glyph::                 How to indicate the location of point.
9149 @end menu
9150
9151 @node Glyphs Summary, result, Glyphs, Glyphs
9152 @ifinfo
9153 @heading Glyphs Summary
9154
9155 Here are the different glyph commands:@refill
9156 @end ifinfo
9157
9158 @table @asis
9159 @item @result{}
9160 @code{@@result@{@}} points to the result of an expression.@refill
9161
9162 @item @expansion{}
9163 @code{@@expansion@{@}} shows the results of a macro expansion.@refill
9164
9165 @item @print{}
9166 @code{@@print@{@}} indicates printed output.@refill
9167
9168 @item @error{}
9169 @code{@@error@{@}} indicates that the following text is an error
9170 message.@refill
9171
9172 @item @equiv{}
9173 @code{@@equiv@{@}} indicates the exact equivalence of two forms.@refill
9174
9175 @item @point{}
9176 @code{@@point@{@}} shows the location of point.@refill
9177 @end table
9178
9179 @node result, expansion, Glyphs Summary, Glyphs
9180 @section @result{}: Indicating Evaluation
9181 @cindex Result of an expression
9182 @cindex Indicating evaluation
9183 @cindex Evaluation glyph
9184 @cindex Value of an expression, indicating
9185
9186 Use the @code{@@result@{@}} command to indicate the result of
9187 evaluating an expression.@refill
9188
9189 @iftex
9190 The @code{@@result@{@}} command is displayed as @samp{=>} in Info and
9191 as @samp{@result{}} in the printed output.
9192 @end iftex
9193 @ifinfo
9194 The @code{@@result@{@}} command is displayed as @samp{@result{}} in Info
9195 and as a double stemmed arrow in the printed output.@refill
9196 @end ifinfo
9197
9198 Thus, the following,
9199
9200 @lisp
9201 (cdr '(1 2 3))
9202      @result{} (2 3)
9203 @end lisp
9204
9205 @noindent
9206 may be read as ``@code{(cdr '(1 2 3))} evaluates to @code{(2 3)}''.
9207
9208 @node expansion, Print Glyph, result, Glyphs
9209 @section @expansion{}: Indicating an Expansion
9210 @cindex Expansion, indicating it
9211
9212 When an expression is a macro call, it expands into a new expression.
9213 You can indicate the result of the expansion with the
9214 @code{@@expansion@{@}} command.@refill
9215
9216 @iftex
9217 The @code{@@expansion@{@}} command is displayed as @samp{==>} in Info and
9218 as @samp{@expansion{}} in the printed output.
9219 @end iftex
9220 @ifinfo
9221 The @code{@@expansion@{@}} command is displayed as @samp{@expansion{}}
9222 in Info and as a long arrow with a flat base in the printed output.@refill
9223 @end ifinfo
9224
9225 @need 700
9226 For example, the following
9227
9228 @example
9229 @group
9230 @@lisp
9231 (third '(a b c))
9232      @@expansion@{@} (car (cdr (cdr '(a b c))))
9233      @@result@{@} c
9234 @@end lisp
9235 @end group
9236 @end example
9237
9238 @noindent
9239 produces
9240
9241 @lisp
9242 @group
9243 (third '(a b c))
9244      @expansion{} (car (cdr (cdr '(a b c))))
9245      @result{} c
9246 @end group
9247 @end lisp
9248
9249 @noindent
9250 which may be read as:
9251
9252 @quotation
9253 @code{(third '(a b c))} expands to @code{(car (cdr (cdr '(a b c))))};
9254 the result of evaluating the expression is @code{c}.
9255 @end quotation
9256
9257 @noindent
9258 Often, as in this case, an example looks better if the
9259 @code{@@expansion@{@}} and @code{@@result@{@}} commands are indented
9260 five spaces.@refill
9261
9262 @node Print Glyph, Error Glyph, expansion, Glyphs
9263 @section @print{}: Indicating Printed Output
9264 @cindex Printed output, indicating it
9265
9266 Sometimes an expression will print output during its execution.  You
9267 can indicate the printed output with the @code{@@print@{@}} command.@refill
9268
9269 @iftex
9270 The @code{@@print@{@}} command is displayed as @samp{-|} in Info and
9271 as @samp{@print{}} in the printed output.
9272 @end iftex
9273 @ifinfo
9274 The @code{@@print@{@}} command is displayed as @samp{@print{}} in Info
9275 and similarly, as a horizontal dash butting against a vertical bar, in
9276 the printed output.@refill
9277 @end ifinfo
9278
9279 In the following example, the printed text is indicated with
9280 @samp{@print{}}, and the value of the expression follows on the
9281 last line.@refill
9282
9283 @lisp
9284 @group
9285 (progn (print 'foo) (print 'bar))
9286      @print{} foo
9287      @print{} bar
9288      @result{} bar
9289 @end group
9290 @end lisp
9291
9292 @noindent
9293 In a Texinfo source file, this example is written as follows:
9294
9295 @lisp
9296 @group
9297 @@lisp
9298 (progn (print 'foo) (print 'bar))
9299      @@print@{@} foo
9300      @@print@{@} bar
9301      @@result@{@} bar
9302 @@end lisp
9303 @end group
9304 @end lisp
9305
9306 @node Error Glyph, Equivalence, Print Glyph, Glyphs
9307 @section @error{}: Indicating an Error Message
9308 @cindex Error message, indicating it
9309
9310 A piece of code may cause an error when you evaluate it.  You can
9311 designate the error message with the @code{@@error@{@}} command.@refill
9312
9313 @iftex
9314 The @code{@@error@{@}} command is displayed as @samp{error-->} in Info
9315 and as @samp{@error{}} in the printed output.
9316 @end iftex
9317 @ifinfo
9318 The @code{@@error@{@}} command is displayed as @samp{@error{}} in Info
9319 and as the word `error' in a box in the printed output.@refill
9320 @end ifinfo
9321
9322 @need 700
9323 Thus,
9324
9325 @example
9326 @@lisp
9327 (+ 23 'x)
9328 @@error@{@} Wrong type argument: integer-or-marker-p, x
9329 @@end lisp
9330 @end example
9331
9332 @noindent
9333 produces
9334
9335 @lisp
9336 (+ 23 'x)
9337 @error{} Wrong type argument: integer-or-marker-p, x
9338 @end lisp
9339
9340 @noindent
9341 This indicates that the following error message is printed
9342 when you evaluate the expression:
9343
9344 @lisp
9345 Wrong type argument: integer-or-marker-p, x
9346 @end lisp
9347
9348 Note that @samp{@error{}} itself is not part of the error
9349 message.
9350
9351 @node Equivalence, Point Glyph, Error Glyph, Glyphs
9352 @section @equiv{}: Indicating Equivalence
9353 @cindex Equivalence, indicating it
9354
9355 Sometimes two expressions produce identical results.  You can indicate the
9356 exact equivalence of two forms with the @code{@@equiv@{@}} command.@refill
9357
9358 @iftex
9359 The @code{@@equiv@{@}} command is displayed as @samp{==} in Info and
9360 as @samp{@equiv{}} in the printed output.
9361 @end iftex
9362 @ifinfo
9363 The @code{@@equiv@{@}} command is displayed as @samp{@equiv{}} in Info
9364 and as a three parallel horizontal lines in the printed output.@refill
9365 @end ifinfo
9366
9367 Thus,
9368
9369 @example
9370 @@lisp
9371 (make-sparse-keymap) @@equiv@{@} (list 'keymap)
9372 @@end lisp
9373 @end example
9374
9375 @noindent
9376 produces
9377
9378 @lisp
9379 (make-sparse-keymap) @equiv{} (list 'keymap)
9380 @end lisp
9381
9382 @noindent
9383 This indicates that evaluating @code{(make-sparse-keymap)} produces
9384 identical results to evaluating @code{(list 'keymap)}.
9385
9386 @c Cannot write point command here because it causes trouble with TOC.
9387 @node Point Glyph, , Equivalence, Glyphs
9388 @section Indicating Point in a Buffer
9389 @cindex Point, indicating it in a buffer
9390
9391 Sometimes you need to show an example of text in an Emacs buffer.  In
9392 such examples, the convention is to include the entire contents of the
9393 buffer in question between two lines of dashes containing the buffer
9394 name.@refill
9395
9396 You can use the @samp{@@point@{@}} command to show the location of point
9397 in the text in the buffer.  (The symbol for point, of course, is not
9398 part of the text in the buffer; it indicates the place @emph{between}
9399 two characters where point is located.)@refill
9400
9401 @iftex
9402 The @code{@@point@{@}} command is displayed as @samp{-!-} in Info and
9403 as @samp{@point{}} in the printed output.
9404 @end iftex
9405 @ifinfo
9406 The @code{@@point@{@}} command is displayed as @samp{@point{}} in Info
9407 and as a small five pointed star in the printed output.@refill
9408 @end ifinfo
9409
9410 The following example shows the contents of buffer @file{foo} before
9411 and after evaluating a Lisp command to insert the word @code{changed}.@refill
9412
9413 @example
9414 @group
9415 ---------- Buffer: foo ----------
9416 This is the @point{}contents of foo.
9417 ---------- Buffer: foo ----------
9418
9419 @end group
9420 @end example
9421
9422 @example
9423 @group
9424 (insert "changed ")
9425      @result{} nil
9426 ---------- Buffer: foo ----------
9427 This is the changed @point{}contents of foo.
9428 ---------- Buffer: foo ----------
9429
9430 @end group
9431 @end example
9432
9433 In a Texinfo source file, the example is written like this:@refill
9434
9435 @example
9436 @@example
9437 ---------- Buffer: foo ----------
9438 This is the @@point@{@}contents of foo.
9439 ---------- Buffer: foo ----------
9440
9441 (insert "changed ")
9442      @@result@{@} nil
9443 ---------- Buffer: foo ----------
9444 This is the changed @@point@{@}contents of foo.
9445 ---------- Buffer: foo ----------
9446 @@end example
9447 @end example
9448
9449 @node Breaks, Definition Commands, Glyphs, Top
9450 @comment  node-name,  next,  previous,  up
9451 @chapter Making and Preventing Breaks
9452 @cindex Making line and page breaks
9453 @cindex Preventing line and page breaks
9454
9455 Usually, a Texinfo file is processed both by @TeX{} and by one of the
9456 Info formatting commands.  Line, paragraph, or page breaks sometimes
9457 occur in the `wrong' place in one or other form of output.  You must
9458 ensure that text looks right both in the printed manual and in the
9459 Info file.@refill
9460
9461 For example, in a printed manual, page breaks may occur awkwardly in
9462 the middle of an example; to prevent this, you can hold text together
9463 using a grouping command that keeps the text from being split across
9464 two pages.  Conversely, you may want to force a page break where none
9465 would occur normally.  Fortunately, problems like these do not often
9466 arise.  When they do, use the break, break prevention, or pagination
9467 commands.@refill
9468
9469 @menu
9470 * Break Commands::              Cause and prevent splits.
9471 * Line Breaks::                 How to force a single line to use two lines.
9472 * - and hyphenation::           How to tell TeX about hyphenation points.
9473 * w::                           How to prevent unwanted line breaks.
9474 * sp::                          How to insert blank lines.
9475 * page::                        How to force the start of a new page.
9476 * group::                       How to prevent unwanted page breaks.
9477 * need::                        Another way to prevent unwanted page breaks.
9478 @end menu
9479
9480 @ifinfo
9481 @node Break Commands, Line Breaks, Breaks, Breaks
9482 @heading The Break Commands
9483 @end ifinfo
9484 @iftex
9485 @sp 1
9486 @end iftex
9487
9488 The break commands create or allow line and paragraph breaks:@refill
9489
9490 @table @code
9491 @item @@*
9492 Force a line break.
9493
9494 @item @@sp @var{n}
9495 Skip @var{n} blank lines.@refill
9496
9497 @item @@-
9498 Insert a discretionary hyphen.
9499
9500 @item @@hyphenation@{@var{hy-phen-a-ted words}@}
9501 Define hyphen points in @var{hy-phen-a-ted words}.
9502 @end table
9503
9504 The line-break-prevention command holds text together all on one
9505 line:@refill
9506
9507 @table @code
9508 @item @@w@{@var{text}@}
9509 Prevent @var{text} from being split and hyphenated across two lines.@refill
9510 @end table
9511 @iftex
9512 @sp 1
9513 @end iftex
9514
9515 The pagination commands apply only to printed output, since Info
9516 files do not have pages.@refill
9517
9518 @table @code
9519 @item @@page
9520 Start a new page in the printed manual.@refill
9521
9522 @item @@group
9523 Hold text together that must appear on one printed page.@refill
9524
9525 @item @@need @var{mils}
9526 Start a new printed page if not enough space on this one.@refill
9527 @end table
9528
9529 @node Line Breaks, - and hyphenation, Break Commands, Breaks
9530 @comment  node-name,  next,  previous,  up
9531 @section @code{@@*}: Generate Line Breaks
9532 @findex * @r{(force line break)}
9533 @cindex Line breaks
9534 @cindex Breaks in a line
9535
9536 The @code{@@*} command forces a line break in both the printed manual and
9537 in Info.@refill
9538
9539 @need 700
9540 For example,
9541
9542 @example
9543 This line @@* is broken @@*in two places.
9544 @end example
9545
9546 @noindent
9547 produces
9548
9549 @example
9550 @group
9551 This line
9552  is broken
9553 in two places.
9554 @end group
9555 @end example
9556
9557 @noindent
9558 (Note that the space after the first @code{@@*} command is faithfully
9559 carried down to the next line.)@refill
9560
9561 @need 800
9562 The @code{@@*} command is often used in a file's copyright page:@refill
9563
9564 @example
9565 @group
9566 This is edition 2.0 of the Texinfo documentation,@@*
9567 and is for @dots{}
9568 @end group
9569 @end example
9570
9571 @noindent
9572 In this case, the @code{@@*} command keeps @TeX{} from stretching the
9573 line across the whole page in an ugly manner.@refill
9574
9575 @quotation
9576 @strong{Please note:} Do not write braces after an @code{@@*} command;
9577 they are not needed.@refill
9578
9579 Do not write an @code{@@refill} command at the end of a paragraph
9580 containing an @code{@@*} command; it will cause the paragraph to be
9581 refilled after the line break occurs, negating the effect of the line
9582 break.@refill
9583 @end quotation
9584
9585 @node - and hyphenation, w, Line Breaks, Breaks
9586 @section @code{@@-} and @code{@@hyphenation}: Helping @TeX{} hyphenate
9587
9588 @findex -
9589 @findex hyphenation
9590 @cindex Hyphenation, helping @TeX{} do
9591 @cindex Fine-tuning, and hyphenation
9592
9593 Although @TeX{}'s hyphenation algorithm is generally pretty good, it
9594 does miss useful hyphenation points from time to time.  (Or, far more
9595 rarely, insert an incorrect hyphenation.)  So, for documents with an
9596 unusual vocabulary or when fine-tuning for a printed edition, you may
9597 wish to help @TeX{} out.  Texinfo supports two commands for this:
9598
9599 @table @code
9600 @item @@-
9601 Insert a discretionary hyphen, i.e., a place where @TeX{} can (but does
9602 not have to) hyphenate.  This is especially useful when you notice
9603 an overfull hbox is due to @TeX{} missing a hyphenation (@pxref{Overfull
9604 hboxes}).  @TeX{} will not insert any hyphenation points in a word
9605 containing @code{@@-}.
9606
9607 @item @@hyphenation@{@var{hy-phen-a-ted words}@}
9608 Tell @TeX{} how to hyphenate @var{hy-phen-a-ted words}.  As shown, you
9609 put a @samp{-} at each hyphenation point.  For example:
9610 @example
9611 @@hyphenation@{man-u-script man-u-scripts@}
9612 @end example
9613 @noindent @TeX{} only uses the specified hyphenation points when the
9614 words match exactly, so give all necessary variants.
9615 @end table
9616
9617 Info output is not hyphenated, so these commands have no effect there.
9618
9619 @node w, sp, - and hyphenation, Breaks
9620 @comment  node-name,  next,  previous,  up
9621 @section @code{@@w}@{@var{text}@}: Prevent Line Breaks
9622 @findex w @r{(prevent line break)}
9623 @cindex Line breaks, preventing
9624 @cindex Hyphenation, preventing
9625
9626 @code{@@w@{@var{text}@}} outputs @var{text} and prohibits line breaks
9627 within @var{text}.@refill
9628
9629 You can use the @code{@@w} command to prevent @TeX{} from automatically
9630 hyphenating a long name or phrase that accidentally falls near the end
9631 of a line.@refill
9632
9633 @example
9634 You can copy GNU software from @@w@{@@file@{prep.ai.mit.edu@}@}.
9635 @end example
9636
9637 @noindent
9638 produces
9639
9640 @quotation
9641 You can copy GNU software from @w{@file{prep.ai.mit.edu}}.
9642 @end quotation
9643
9644 @quotation
9645 @strong{Caution:} Do not write an @code{@@refill} command at the end
9646 of a paragraph containing an @code{@@w} command; it will cause the
9647 paragraph to be refilled and may thereby negate the effect of the
9648 @code{@@w} command.@refill
9649 @end quotation
9650
9651 @node sp, page, w, Breaks
9652 @comment  node-name,  next,  previous,  up
9653 @section @code{@@sp} @var{n}: Insert Blank Lines
9654 @findex sp @r{(line spacing)}
9655 @cindex Spaces (blank lines)
9656 @cindex Blank lines
9657 @cindex Line spacing
9658
9659 A line beginning with and containing only @code{@@sp @var{n}}
9660 generates @var{n} blank lines of space in both the printed manual and
9661 the Info file.  @code{@@sp} also forces a paragraph break.  For
9662 example,@refill
9663
9664 @example
9665 @@sp 2
9666 @end example
9667
9668 @noindent
9669 generates two blank lines.
9670
9671 The @code{@@sp} command is most often used in the title page.@refill
9672
9673 @ignore
9674 @c node br, page, sp, Breaks
9675 @comment  node-name,  next,  previous,  up
9676 @c section @code{@@br}: Generate Paragraph Breaks
9677 @findex br @r{(paragraph breaks)}
9678 @cindex Paragraph breaks
9679 @cindex Breaks in a paragraph
9680
9681 The @code{@@br} command forces a paragraph break.  It inserts a blank
9682 line.  You can use the command within or at the end of a line.  If
9683 used within a line, the @code{@@br@{@}} command must be followed by
9684 left and right braces (as shown here) to mark the end of the
9685 command.@refill
9686
9687 @need 700
9688 For example,
9689
9690 @example
9691 @group
9692 This line @@br@{@}contains and is ended by paragraph breaks@@br
9693 and is followed by another line.
9694 @end group
9695 @end example
9696
9697 @noindent
9698 produces
9699
9700 @example
9701 @group
9702 This line
9703
9704 contains and is ended by paragraph breaks
9705
9706 and is followed by another line.
9707 @end group
9708 @end example
9709
9710 The @code{@@br} command is seldom used.
9711 @end ignore
9712
9713 @node page, group, sp, Breaks
9714 @comment  node-name,  next,  previous,  up
9715 @section @code{@@page}: Start a New Page
9716 @cindex Page breaks
9717 @findex page
9718
9719 A line containing only @code{@@page} starts a new page in a printed
9720 manual.  The command has no effect on Info files since they are not
9721 paginated.  An @code{@@page} command is often used in the @code{@@titlepage}
9722 section of a Texinfo file to start the copyright page.@refill
9723
9724 @node group, need, page, Breaks
9725 @comment  node-name,  next,  previous,  up
9726 @section @code{@@group}: Prevent Page Breaks
9727 @cindex Group (hold text together vertically)
9728 @cindex Holding text together vertically
9729 @cindex Vertically holding text together
9730 @findex group
9731
9732 The @code{@@group} command (on a line by itself) is used inside an
9733 @code{@@example} or similar construct to begin an unsplittable vertical
9734 group, which will appear entirely on one page in the printed output.
9735 The group is terminated by a line containing only @code{@@end group}.
9736 These two lines produce no output of their own, and in the Info file
9737 output they have no effect at all.@refill
9738
9739 @c Once said that these environments
9740 @c turn off vertical spacing between ``paragraphs''.
9741 @c Also, quotation used to work, but doesn't in texinfo-2.72
9742 Although @code{@@group} would make sense conceptually in a wide
9743 variety of contexts, its current implementation works reliably only
9744 within @code{@@example} and variants, and within @code{@@display},
9745 @code{@@format}, @code{@@flushleft} and @code{@@flushright}.
9746 @xref{Quotations and Examples}.  (What all these commands have in
9747 common is that each line of input produces a line of output.)  In
9748 other contexts, @code{@@group} can cause anomalous vertical
9749 spacing.@refill
9750
9751 @need 750
9752 This formatting requirement means that you should write:
9753
9754 @example
9755 @group
9756 @@example
9757 @@group
9758 @dots{}
9759 @@end group
9760 @@end example
9761 @end group
9762 @end example
9763
9764 @noindent
9765 with the @code{@@group} and @code{@@end group} commands inside the
9766 @code{@@example} and @code{@@end example} commands.
9767
9768 The @code{@@group} command is most often used to hold an example
9769 together on one page.  In this Texinfo manual, more than 100 examples
9770 contain text that is enclosed between @code{@@group} and @code{@@end
9771 group}.
9772
9773 If you forget to end a group, you may get strange and unfathomable
9774 error messages when you run @TeX{}.  This is because @TeX{} keeps
9775 trying to put the rest of the Texinfo file onto the one page and does
9776 not start to generate error messages until it has processed
9777 considerable text.  It is a good rule of thumb to look for a missing
9778 @code{@@end group} if you get incomprehensible error messages in
9779 @TeX{}.@refill
9780
9781 @node need, , group, Breaks
9782 @comment  node-name,  next,  previous,  up
9783 @section @code{@@need @var{mils}}: Prevent Page Breaks
9784 @cindex Need space at page bottom
9785 @findex need
9786
9787 A line containing only @code{@@need @var{n}} starts
9788 a new page in a printed manual if fewer than @var{n} mils (thousandths
9789 of an inch) remain on the current page.  Do not use
9790 braces around the argument @var{n}.  The @code{@@need} command has no
9791 effect on Info files since they are not paginated.@refill
9792
9793 @need 800
9794 This paragraph is preceded by an @code{@@need} command that tells
9795 @TeX{} to start a new page if fewer than 800 mils (eight-tenths
9796 inch) remain on the page.  It looks like this:@refill
9797
9798 @example
9799 @group
9800 @@need 800
9801 This paragraph is preceded by @dots{}
9802 @end group
9803 @end example
9804
9805 The @code{@@need} command is useful for preventing orphans (single
9806 lines at the bottoms of printed pages).@refill
9807
9808 @node Definition Commands, Footnotes, Breaks, Top
9809 @chapter Definition Commands
9810 @cindex Definition commands
9811
9812 The @code{@@deffn} command and the other @dfn{definition commands}
9813 enable you to describe functions, variables, macros, commands, user
9814 options, special forms and other such artifacts in a uniform
9815 format.@refill
9816
9817 In the Info file, a definition causes the entity
9818 category---`Function', `Variable', or whatever---to appear at the
9819 beginning of the first line of the definition, followed by the
9820 entity's name and arguments.  In the printed manual, the command
9821 causes @TeX{} to print the entity's name and its arguments on the left
9822 margin and print the category next to the right margin.  In both
9823 output formats, the body of the definition is indented.  Also, the
9824 name of the entity is entered into the appropriate index:
9825 @code{@@deffn} enters the name into the index of functions,
9826 @code{@@defvr} enters it into the index of variables, and so
9827 on.@refill
9828
9829 A manual need not and should not contain more than one definition for
9830 a given name.  An appendix containing a summary should use
9831 @code{@@table} rather than the definition commands.@refill
9832
9833 @menu
9834 * Def Cmd Template::            How to structure a description using a
9835                                   definition command.
9836 * Optional Arguments::          How to handle optional and repeated arguments.
9837 * deffnx::                      How to group two or more `first' lines.
9838 * Def Cmds in Detail::          All the definition commands.
9839 * Def Cmd Conventions::         Conventions for writing definitions.
9840 * Sample Function Definition::  
9841 @end menu
9842
9843 @node Def Cmd Template, Optional Arguments, Definition Commands, Definition Commands
9844 @section The Template for a Definition
9845 @cindex Definition template
9846 @cindex Template for a definition
9847
9848 The @code{@@deffn} command is used for definitions of entities that
9849 resemble functions.  To write a definition using the @code{@@deffn}
9850 command, write the @code{@@deffn} command at the beginning of a line
9851 and follow it on the same line by the category of the entity, the name
9852 of the entity itself, and its arguments (if any).  Then write the body
9853 of the definition on succeeding lines.  (You may embed examples in the
9854 body.)  Finally, end the definition with an @code{@@end deffn} command
9855 written on a line of its own.  (The other definition commands follow
9856 the same format.)@refill
9857
9858 The template for a definition looks like this:
9859
9860 @example
9861 @group
9862 @@deffn @var{category} @var{name} @var{arguments}@dots{}
9863 @var{body-of-definition}
9864 @@end deffn
9865 @end group
9866 @end example
9867
9868 @need 700
9869 @noindent
9870 For example,
9871
9872 @example
9873 @group
9874 @@deffn Command forward-word count
9875 This command moves point forward @@var@{count@} words
9876 (or backward if @@var@{count@} is negative). @dots{}
9877 @@end deffn
9878 @end group
9879 @end example
9880
9881 @noindent
9882 produces
9883
9884 @quotation
9885 @deffn Command forward-word count
9886 This function moves point forward @var{count} words
9887 (or backward if @var{count} is negative). @dots{}
9888 @end deffn
9889 @end quotation
9890
9891 Capitalize the category name like a title.  If the name of the
9892 category contains spaces, as in the phrase `Interactive Command',
9893 write braces around it.  For example:@refill
9894
9895 @example
9896 @group
9897 @@deffn @{Interactive Command@} isearch-forward
9898 @dots{}
9899 @@end deffn
9900 @end group
9901 @end example
9902
9903 @noindent
9904 Otherwise, the second word will be mistaken for the name of the
9905 entity.@refill
9906
9907 Some of the definition commands are more general than others.  The
9908 @code{@@deffn} command, for example, is the general definition command
9909 for functions and the like---for entities that may take arguments.  When
9910 you use this command, you specify the category to which the entity
9911 belongs.  The @code{@@deffn} command possesses three predefined,
9912 specialized variations, @code{@@defun}, @code{@@defmac}, and
9913 @code{@@defspec}, that specify the category for you: ``Function'',
9914 ``Macro'', and ``Special Form'' respectively.  The @code{@@defvr}
9915 command also is accompanied by several predefined, specialized
9916 variations for describing particular kinds of variables.@refill
9917
9918 The template for a specialized definition, such as @code{@@defun}, is
9919 similar to the template for a generalized definition, except that you
9920 do not need to specify the category:@refill
9921
9922 @example
9923 @group
9924 @@defun @var{name} @var{arguments}@dots{}
9925 @var{body-of-definition}
9926 @@end defun
9927 @end group
9928 @end example
9929
9930 @noindent
9931 Thus,
9932
9933 @example
9934 @group
9935 @@defun buffer-end flag
9936 This function returns @@code@{(point-min)@} if @@var@{flag@}
9937 is less than 1, @@code@{(point-max)@} otherwise.
9938 @dots{}
9939 @@end defun
9940 @end group
9941 @end example
9942
9943 @noindent
9944 produces
9945
9946 @quotation
9947 @defun buffer-end flag
9948 This function returns @code{(point-min)} if @var{flag} is less than 1,
9949 @code{(point-max)} otherwise.  @dots{}
9950 @end defun
9951 @end quotation
9952
9953 @noindent
9954 @xref{Sample Function Definition, Sample Function Definition, A Sample
9955 Function Definition}, for a more detailed example of a function
9956 definition, including the use of @code{@@example} inside the
9957 definition.@refill
9958
9959 The other specialized commands work like @code{@@defun}.@refill
9960
9961 @node Optional Arguments, deffnx, Def Cmd Template, Definition Commands
9962 @section Optional and Repeated Arguments
9963 @cindex Optional and repeated arguments
9964 @cindex Repeated and optional arguments
9965 @cindex Arguments, repeated and optional
9966 @cindex Syntax, optional & repeated arguments
9967 @cindex Meta-syntactic chars for arguments
9968
9969 Some entities take optional or repeated arguments, which may be
9970 specified by a distinctive glyph that uses square brackets and
9971 ellipses.  For @w{example}, a special form often breaks its argument list
9972 into separate arguments in more complicated ways than a
9973 straightforward function.@refill
9974
9975 @iftex
9976 An argument enclosed within square brackets is optional.
9977 Thus, the phrase
9978 @samp{@code{@r{[}@var{optional-arg}@r{]}}} means that
9979 @var{optional-arg} is optional.
9980 An argument followed by an ellipsis is optional
9981 and may be repeated more than once.
9982 @c This is consistent with Emacs Lisp Reference manual
9983 Thus, @samp{@var{repeated-args}@dots{}} stands for zero or more arguments.
9984 Parentheses are used when several arguments are grouped
9985 into additional levels of list structure in Lisp.
9986 @end iftex
9987 @c The following looks better in Info (no `r', `samp' and `code'):
9988 @ifinfo
9989 An argument enclosed within square brackets is optional.
9990 Thus, [@var{optional-arg}] means that @var{optional-arg} is optional.
9991 An argument followed by an ellipsis is optional
9992 and may be repeated more than once.
9993 @c This is consistent with Emacs Lisp Reference manual
9994 Thus, @var{repeated-args}@dots{} stands for zero or more arguments.
9995 Parentheses are used when several arguments are grouped
9996 into additional levels of list structure in Lisp.
9997 @end ifinfo
9998
9999 Here is the @code{@@defspec} line of an example of an imaginary
10000 special form:@refill
10001
10002 @quotation
10003 @defspec foobar (@var{var} [@var{from} @var{to} [@var{inc}]]) @var{body}@dots{}
10004 @end defspec
10005 @tex
10006 \vskip \parskip
10007 @end tex
10008 @end quotation
10009
10010 @noindent
10011 In this example, the arguments @var{from} and @var{to} are optional,
10012 but must both be present or both absent.  If they are present,
10013 @var{inc} may optionally be specified as well.  These arguments are
10014 grouped with the argument @var{var} into a list, to distinguish them
10015 from @var{body}, which includes all remaining elements of the
10016 form.@refill
10017
10018 In a Texinfo source file, this @code{@@defspec} line is written like
10019 this (except it would not be split over two lines, as it is in this
10020 example).@refill
10021
10022 @example
10023 @group
10024 @@defspec foobar (@@var@{var@} [@@var@{from@} @@var@{to@}
10025      [@@var@{inc@}]]) @@var@{body@}@@dots@{@}
10026 @end group
10027 @end example
10028
10029 @noindent
10030 The function is listed in the Command and Variable Index under
10031 @samp{foobar}.@refill
10032
10033 @node deffnx, Def Cmds in Detail, Optional Arguments, Definition Commands
10034 @section Two or More `First' Lines
10035 @cindex Two `First' Lines for @code{@@deffn}
10036 @cindex Grouping two definitions together
10037 @cindex Definitions grouped together
10038 @findex deffnx
10039
10040 To create two or more `first' or header lines for a definition, follow
10041 the first @code{@@deffn} line by a line beginning with @code{@@deffnx}.
10042 The @code{@@deffnx} command works exactly like @code{@@deffn}
10043 except that it does not generate extra vertical white space between it
10044 and the preceding line.@refill
10045
10046 @need 1000
10047 For example,
10048
10049 @example
10050 @group
10051 @@deffn @{Interactive Command@} isearch-forward
10052 @@deffnx @{Interactive Command@} isearch-backward
10053 These two search commands are similar except @dots{}
10054 @@end deffn
10055 @end group
10056 @end example
10057
10058 @noindent
10059 produces
10060
10061 @deffn {Interactive Command} isearch-forward
10062 @deffnx {Interactive Command} isearch-backward
10063 These two search commands are similar except @dots{}
10064 @end deffn
10065
10066 Each of the other definition commands has an `x' form: @code{@@defunx},
10067 @code{@@defvrx}, @code{@@deftypefunx}, etc.
10068
10069 The `x' forms work just like @code{@@itemx}; see @ref{itemx, , @code{@@itemx}}.
10070
10071 @node Def Cmds in Detail, Def Cmd Conventions, deffnx, Definition Commands
10072 @section The Definition Commands
10073
10074 Texinfo provides more than a dozen definition commands, all of which
10075 are described in this section.@refill
10076
10077 The definition commands automatically enter the name of the entity in
10078 the appropriate index: for example, @code{@@deffn}, @code{@@defun},
10079 and @code{@@defmac} enter function names in the index of functions;
10080 @code{@@defvr} and @code{@@defvar} enter variable names in the index
10081 of variables.@refill
10082
10083 Although the examples that follow mostly illustrate Lisp, the commands
10084 can be used for other programming languages.@refill
10085
10086 @menu
10087 * Functions Commands::          Commands for functions and similar entities.
10088 * Variables Commands::          Commands for variables and similar entities.
10089 * Typed Functions::             Commands for functions in typed languages.
10090 * Typed Variables::             Commands for variables in typed languages.
10091 * Abstract Objects::            Commands for object-oriented programming.
10092 * Data Types::                  The definition command for data types.
10093 @end menu
10094
10095 @node Functions Commands, Variables Commands, Def Cmds in Detail, Def Cmds in Detail
10096 @subsection Functions and Similar Entities
10097
10098 This section describes the commands for describing functions and similar
10099 entities:@refill
10100
10101 @table @code
10102 @findex deffn
10103 @item @@deffn @var{category} @var{name} @var{arguments}@dots{}
10104 The @code{@@deffn} command is the general definition command for
10105 functions, interactive commands, and similar entities that may take
10106 arguments.  You must choose a term to describe the category of entity
10107 being defined; for example, ``Function'' could be used if the entity is
10108 a function.  The @code{@@deffn} command is written at the beginning of a
10109 line and is followed on the same line by the category of entity being
10110 described, the name of this particular entity, and its arguments, if
10111 any.  Terminate the definition with @code{@@end deffn} on a line of its
10112 own.@refill
10113
10114 @need 750
10115 For example, here is a definition:
10116
10117 @example
10118 @group
10119 @@deffn Command forward-char nchars
10120 Move point forward @@var@{nchars@} characters.
10121 @@end deffn
10122 @end group
10123 @end example
10124
10125 @noindent
10126 This shows a rather terse definition for a ``command'' named
10127 @code{forward-char} with one argument, @var{nchars}.
10128
10129 @code{@@deffn} prints argument names such as @var{nchars} in italics or
10130 upper case, as if @code{@@var} had been used, because we think of these
10131 names as metasyntactic variables---they stand for the actual argument
10132 values.  Within the text of the description, write an argument name
10133 explicitly with @code{@@var} to refer to the value of the argument.  In
10134 the example above, we used @samp{@@var@{nchars@}} in this way.
10135
10136 The template for @code{@@deffn} is:
10137
10138 @example
10139 @group
10140 @@deffn @var{category} @var{name} @var{arguments}@dots{}
10141 @var{body-of-definition}
10142 @@end deffn
10143 @end group
10144 @end example
10145
10146 @findex defun
10147 @item @@defun @var{name} @var{arguments}@dots{}
10148 The @code{@@defun} command is the definition command for functions.
10149 @code{@@defun} is equivalent to @samp{@@deffn Function
10150 @dots{}}.@refill
10151
10152 @need 800
10153 @noindent
10154 For example,
10155
10156 @example
10157 @group
10158 @@defun set symbol new-value
10159 Change the value of the symbol @@var@{symbol@}
10160 to @@var@{new-value@}.
10161 @@end defun
10162 @end group
10163 @end example
10164
10165 @noindent
10166 shows a rather terse definition for a function @code{set} whose
10167 arguments are @var{symbol} and @var{new-value}.  The argument names on
10168 the @code{@@defun} line automatically appear in italics or upper case as
10169 if they were enclosed in @code{@@var}.  Terminate the definition with
10170 @code{@@end defun} on a line of its own.@refill
10171
10172 The template is:
10173
10174 @example
10175 @group
10176 @@defun @var{function-name} @var{arguments}@dots{}
10177 @var{body-of-definition}
10178 @@end defun
10179 @end group
10180 @end example
10181
10182 @code{@@defun} creates an entry in the index of functions.
10183
10184 @findex defmac
10185 @item @@defmac @var{name} @var{arguments}@dots{}
10186 The @code{@@defmac} command is the definition command for macros.
10187 @code{@@defmac} is equivalent to @samp{@@deffn Macro @dots{}} and
10188 works like @code{@@defun}.@refill
10189
10190 @findex defspec
10191 @item @@defspec @var{name} @var{arguments}@dots{}
10192 The @code{@@defspec} command is the definition command for special
10193 forms.  (In Lisp, a special form is an entity much like a function.)
10194 @code{@@defspec} is equivalent to @samp{@@deffn @{Special Form@}
10195 @dots{}} and works like @code{@@defun}.@refill
10196 @end table
10197
10198 @node Variables Commands, Typed Functions, Functions Commands, Def Cmds in Detail
10199 @subsection Variables and Similar Entities
10200
10201 Here are the commands for defining variables and similar
10202 entities:@refill
10203
10204 @table @code
10205 @findex defvr
10206 @item @@defvr @var{category} @var{name}
10207 The @code{@@defvr} command is a general definition command for
10208 something like a variable---an entity that records a value.  You must
10209 choose a term to describe the category of entity being defined; for
10210 example, ``Variable'' could be used if the entity is a variable.
10211 Write the @code{@@defvr} command at the beginning of a line and
10212 followed it on the same line by the category of the entity and the
10213 name of the entity.@refill
10214
10215 Capitalize the category name like a title.  If the name of the
10216 category contains spaces, as in the name `User Option', write braces
10217 around it.  Otherwise, the second word will be mistaken for the name
10218 of the entity, for example:
10219
10220 @example
10221 @group
10222 @@defvr @{User Option@} fill-column
10223 This buffer-local variable specifies
10224 the maximum width of filled lines.
10225 @dots{}
10226 @@end defvr
10227 @end group
10228 @end example
10229
10230 Terminate the definition with @code{@@end defvr} on a line of its
10231 own.@refill
10232
10233 The template is:
10234
10235 @example
10236 @group
10237 @@defvr @var{category} @var{name}
10238 @var{body-of-definition}
10239 @@end defvr
10240 @end group
10241 @end example
10242
10243 @code{@@defvr} creates an entry in the index of variables for @var{name}.
10244
10245 @findex defvar
10246 @item @@defvar @var{name}
10247 The @code{@@defvar} command is the definition command for variables.
10248 @code{@@defvar} is equivalent to @samp{@@defvr Variable
10249 @dots{}}.@refill
10250
10251 @need 750
10252 For example:
10253
10254 @example
10255 @group
10256 @@defvar kill-ring
10257 @dots{}
10258 @@end defvar
10259 @end group
10260 @end example
10261
10262 The template is:
10263
10264 @example
10265 @group
10266 @@defvar @var{name}
10267 @var{body-of-definition}
10268 @@end defvar
10269 @end group
10270 @end example
10271
10272 @code{@@defvar} creates an entry in the index of variables for
10273 @var{name}.@refill
10274
10275 @findex defopt
10276 @item @@defopt @var{name}
10277 The @code{@@defopt} command is the definition command for user
10278 options.  @code{@@defopt} is equivalent to @samp{@@defvr @{User
10279 Option@} @dots{}} and works like @code{@@defvar}.@refill
10280 @end table
10281
10282 @node Typed Functions, Typed Variables, Variables Commands, Def Cmds in Detail
10283 @subsection Functions in Typed Languages
10284
10285 The @code{@@deftypefn} command and its variations are for describing
10286 functions in C or any other language in which you must declare types
10287 of variables and functions.@refill
10288
10289 @table @code
10290 @findex deftypefn
10291 @item @@deftypefn @var{category} @var{data-type} @var{name} @var{arguments}@dots{}
10292 The @code{@@deftypefn} command is the general definition command for
10293 functions and similar entities that may take arguments and that are
10294 typed.  The @code{@@deftypefn} command is written at the beginning of
10295 a line and is followed on the same line by the category of entity
10296 being described, the type of the returned value, the name of this
10297 particular entity, and its arguments, if any.@refill
10298
10299 @need 800
10300 @noindent
10301 For example,
10302
10303 @example
10304 @group
10305 @@deftypefn @{Library Function@} int foobar
10306    (int @@var@{foo@}, float @@var@{bar@})
10307 @dots{}
10308 @@end deftypefn
10309 @end group
10310 @end example
10311
10312 @need 1000
10313 @noindent
10314 (where the text before the ``@dots{}'', shown above as two lines, would
10315 actually be a single line in a real Texinfo file) produces the following
10316 in Info:
10317
10318 @smallexample
10319 @group
10320 -- Library Function: int foobar (int FOO, float BAR)
10321 @dots{}
10322 @end group
10323 @end smallexample
10324 @iftex
10325
10326 In a printed manual, it produces:
10327
10328 @quotation
10329 @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
10330 @dots{}
10331 @end deftypefn
10332 @end quotation
10333 @end iftex
10334
10335 This means that @code{foobar} is a ``library function'' that returns an
10336 @code{int}, and its arguments are @var{foo} (an @code{int}) and
10337 @var{bar} (a @code{float}).@refill
10338
10339 The argument names that you write in @code{@@deftypefn} are not subject
10340 to an implicit @code{@@var}---since the actual names of the arguments in
10341 @code{@@deftypefn} are typically scattered among data type names and
10342 keywords, Texinfo cannot find them without help.  Instead, you must write
10343 @code{@@var} explicitly around the argument names.  In the example
10344 above, the argument names are @samp{foo} and @samp{bar}.@refill
10345
10346 The template for @code{@@deftypefn} is:@refill
10347
10348 @example
10349 @group
10350 @@deftypefn @var{category} @var{data-type} @var{name} @var{arguments} @dots{}
10351 @var{body-of-description}
10352 @@end deftypefn
10353 @end group
10354 @end example
10355
10356 @noindent
10357 Note that if the @var{category} or @var{data type} is more than one
10358 word then it must be enclosed in braces to make it a single argument.@refill
10359
10360 If you are describing a procedure in a language that has packages,
10361 such as Ada, you might consider using @code{@@deftypefn} in a manner
10362 somewhat contrary to the convention described in the preceding
10363 paragraphs.@refill
10364
10365 @need 800
10366 @noindent
10367 For example:
10368
10369 @example
10370 @group
10371 @@deftypefn stacks private push
10372         (@@var@{s@}:in out stack;
10373         @@var@{n@}:in integer)
10374 @dots{}
10375 @@end deftypefn
10376 @end group
10377 @end example
10378
10379 @noindent
10380 (The @code{@@deftypefn} arguments are shown split into three lines, but
10381 would be a single line in a real Texinfo file.)
10382
10383 In this instance, the procedure is classified as belonging to the
10384 package @code{stacks} rather than classified as a `procedure' and its
10385 data type is described as @code{private}.  (The name of the procedure
10386 is @code{push}, and its arguments are @var{s} and @var{n}.)@refill
10387
10388 @code{@@deftypefn} creates an entry in the index of functions for
10389 @var{name}.@refill
10390
10391 @findex deftypefun
10392 @item @@deftypefun @var{data-type} @var{name} @var{arguments}@dots{}
10393 The @code{@@deftypefun} command is the specialized definition command
10394 for functions in typed languages.  The command is equivalent to
10395 @samp{@@deftypefn Function @dots{}}.@refill
10396
10397 @need 800
10398 @noindent
10399 Thus,
10400
10401 @smallexample
10402 @group
10403 @@deftypefun int foobar (int @@var@{foo@}, float @@var@{bar@})
10404 @dots{}
10405 @@end deftypefun
10406 @end group
10407 @end smallexample
10408
10409 @noindent
10410 produces the following in Info:
10411
10412 @example
10413 @group
10414 -- Function: int foobar (int FOO, float BAR)
10415 @dots{}
10416 @end group
10417 @end example
10418 @iftex
10419
10420 @need 800
10421 @noindent
10422 and the following in a printed manual:
10423
10424 @quotation
10425 @deftypefun int foobar (int @var{foo}, float @var{bar})
10426 @dots{}
10427 @end deftypefun
10428 @end quotation
10429 @end iftex
10430
10431 @need 800
10432 The template is:
10433
10434 @example
10435 @group
10436 @@deftypefun @var{type} @var{name} @var{arguments}@dots{}
10437 @var{body-of-description}
10438 @@end deftypefun
10439 @end group
10440 @end example
10441
10442 @code{@@deftypefun} creates an entry in the index of functions for
10443 @var{name}.@refill
10444 @end table
10445
10446 @node Typed Variables, Abstract Objects, Typed Functions, Def Cmds in Detail
10447 @subsection Variables in Typed Languages
10448
10449 Variables in typed languages are handled in a manner similar to
10450 functions in typed languages.  @xref{Typed Functions}.  The general
10451 definition command @code{@@deftypevr} corresponds to
10452 @code{@@deftypefn} and the specialized definition command
10453 @code{@@deftypevar} corresponds to @code{@@deftypefun}.@refill
10454
10455 @table @code
10456 @findex deftypevr
10457 @item @@deftypevr @var{category} @var{data-type} @var{name}
10458 The @code{@@deftypevr} command is the general definition command for
10459 something like a variable in a typed language---an entity that records
10460 a value.  You must choose a term to describe the category of the
10461 entity being defined; for example, ``Variable'' could be used if the
10462 entity is a variable.@refill
10463
10464 The @code{@@deftypevr} command is written at the beginning of a line
10465 and is followed on the same line by the category of the entity
10466 being described, the data type, and the name of this particular
10467 entity.@refill
10468
10469 @need 800
10470 @noindent
10471 For example:
10472
10473 @example
10474 @group
10475 @@deftypevr @{Global Flag@} int enable
10476 @dots{}
10477 @@end deftypevr
10478 @end group
10479 @end example
10480
10481 @noindent
10482 produces the following in Info:
10483
10484 @example
10485 @group
10486 -- Global Flag: int enable
10487 @dots{}
10488 @end group
10489 @end example
10490 @iftex
10491
10492 @noindent
10493 and the following in a printed manual:
10494
10495 @quotation
10496 @deftypevr {Global Flag} int enable
10497 @dots{}
10498 @end deftypevr
10499 @end quotation
10500 @end iftex
10501
10502 @need 800
10503 The template is:
10504
10505 @example
10506 @@deftypevr @var{category} @var{data-type} @var{name}
10507 @var{body-of-description}
10508 @@end deftypevr
10509 @end example
10510
10511 @code{@@deftypevr} creates an entry in the index of variables for
10512 @var{name}.@refill
10513
10514 @findex deftypevar
10515 @item @@deftypevar @var{data-type} @var{name}
10516 The @code{@@deftypevar} command is the specialized definition command
10517 for variables in typed languages.  @code{@@deftypevar} is equivalent
10518 to @samp{@@deftypevr Variable @dots{}}.@refill
10519
10520 @need 800
10521 @noindent
10522 For example:
10523
10524 @example
10525 @group
10526 @@deftypevar int fubar
10527 @dots{}
10528 @@end deftypevar
10529 @end group
10530 @end example
10531
10532 @noindent
10533 produces the following in Info:
10534
10535 @example
10536 @group
10537 -- Variable: int fubar
10538 @dots{}
10539 @end group
10540 @end example
10541 @iftex
10542
10543 @need 800
10544 @noindent
10545 and the following in a printed manual:
10546
10547 @quotation
10548 @deftypevar int fubar
10549 @dots{}
10550 @end deftypevar
10551 @end quotation
10552 @end iftex
10553
10554 @need 800
10555 @noindent
10556 The template is:
10557
10558 @example
10559 @group
10560 @@deftypevar @var{data-type} @var{name}
10561 @var{body-of-description}
10562 @@end deftypevar
10563 @end group
10564 @end example
10565
10566 @code{@@deftypevar} creates an entry in the index of variables for
10567 @var{name}.@refill
10568 @end table
10569
10570 @node Abstract Objects, Data Types, Typed Variables, Def Cmds in Detail
10571 @subsection Object-Oriented Programming
10572
10573 Here are the commands for formatting descriptions about abstract
10574 objects, such as are used in object-oriented programming.  A class is
10575 a defined type of abstract object.  An instance of a class is a
10576 particular object that has the type of the class.  An instance
10577 variable is a variable that belongs to the class but for which each
10578 instance has its own value.@refill
10579
10580 In a definition, if the name of a class is truly a name defined in the
10581 programming system for a class, then you should write an @code{@@code}
10582 around it.  Otherwise, it is printed in the usual text font.@refill
10583
10584 @table @code
10585 @findex defcv
10586 @item @@defcv @var{category} @var{class} @var{name}
10587 The @code{@@defcv} command is the general definition command for
10588 variables associated with classes in object-oriented programming.  The
10589 @code{@@defcv} command is followed by three arguments: the category of
10590 thing being defined, the class to which it belongs, and its
10591 name.  Thus,@refill
10592
10593 @example
10594 @group
10595 @@defcv @{Class Option@} Window border-pattern
10596 @dots{}
10597 @@end defcv
10598 @end group
10599 @end example
10600
10601 @noindent
10602 illustrates how you would write the first line of a definition of the
10603 @code{border-pattern} class option of the class @code{Window}.@refill
10604
10605 The template is
10606
10607 @example
10608 @group
10609 @@defcv @var{category} @var{class} @var{name}
10610 @dots{}
10611 @@end defcv
10612 @end group
10613 @end example
10614
10615 @code{@@defcv} creates an entry in the index of variables.
10616
10617 @findex defivar
10618 @item @@defivar @var{class} @var{name}
10619 The @code{@@defivar} command is the definition command for instance
10620 variables in object-oriented programming.  @code{@@defivar} is
10621 equivalent to @samp{@@defcv @{Instance Variable@} @dots{}}@refill
10622
10623 The template is:
10624
10625 @example
10626 @group
10627 @@defivar @var{class} @var{instance-variable-name}
10628 @var{body-of-definition}
10629 @@end defivar
10630 @end group
10631 @end example
10632
10633 @code{@@defivar} creates an entry in the index of variables.
10634
10635 @findex defop
10636 @item @@defop @var{category} @var{class} @var{name} @var{arguments}@dots{}
10637 The @code{@@defop} command is the general definition command for
10638 entities that may resemble methods in object-oriented programming.
10639 These entities take arguments, as functions do, but are associated
10640 with particular classes of objects.@refill
10641
10642 For example, some systems have constructs called @dfn{wrappers} that
10643 are associated with classes as methods are, but that act more like
10644 macros than like functions.  You could use @code{@@defop Wrapper} to
10645 describe one of these.@refill
10646
10647 Sometimes it is useful to distinguish methods and @dfn{operations}.
10648 You can think of an operation as the specification for a method.
10649 Thus, a window system might specify that all window classes have a
10650 method named @code{expose}; we would say that this window system
10651 defines an @code{expose} operation on windows in general.  Typically,
10652 the operation has a name and also specifies the pattern of arguments;
10653 all methods that implement the operation must accept the same
10654 arguments, since applications that use the operation do so without
10655 knowing which method will implement it.@refill
10656
10657 Often it makes more sense to document operations than methods.  For
10658 example, window application developers need to know about the
10659 @code{expose} operation, but need not be concerned with whether a
10660 given class of windows has its own method to implement this operation.
10661 To describe this operation, you would write:@refill
10662
10663 @example
10664 @@defop Operation windows expose
10665 @end example
10666
10667 The @code{@@defop} command is written at the beginning of a line and
10668 is followed on the same line by the overall name of the category of
10669 operation, the name of the class of the operation, the name of the
10670 operation, and its arguments, if any.@refill
10671
10672 @need 800
10673 @noindent
10674 The template is:
10675
10676 @example
10677 @group
10678 @@defop @var{category} @var{class} @var{name} @var{arguments}@dots{}
10679 @var{body-of-definition}
10680 @@end defop
10681 @end group
10682 @end example
10683
10684 @code{@@defop} creates an entry, such as `@code{expose} on
10685 @code{windows}', in the index of functions.@refill
10686
10687 @findex defmethod
10688 @item @@defmethod @var{class} @var{name} @var{arguments}@dots{}
10689 The @code{@@defmethod} command is the definition command for methods
10690 in object-oriented programming.  A method is a kind of function that
10691 implements an operation for a particular class of objects and its
10692 subclasses.  In the Lisp Machine, methods actually were functions, but
10693 they were usually defined with @code{defmethod}.
10694
10695 @code{@@defmethod} is equivalent to @samp{@@defop Method @dots{}}.
10696 The command is written at the beginning of a line and is followed by
10697 the name of the class of the method, the name of the method, and its
10698 arguments, if any.@refill
10699
10700 @need 800
10701 @noindent
10702 For example,
10703
10704 @example
10705 @group
10706 @@defmethod @code{bar-class} bar-method argument
10707 @dots{}
10708 @@end defmethod
10709 @end group
10710 @end example
10711
10712 @noindent
10713 illustrates the definition for a method called @code{bar-method} of
10714 the class @code{bar-class}.  The method takes an argument.@refill
10715
10716 The template is:
10717
10718 @example
10719 @group
10720 @@defmethod @var{class} @var{method-name} @var{arguments}@dots{}
10721 @var{body-of-definition}
10722 @@end defmethod
10723 @end group
10724 @end example
10725
10726 @code{@@defmethod} creates an entry, such as `@code{bar-method} on
10727 @code{bar-class}', in the index of functions.@refill
10728 @end table
10729
10730 @node Data Types, , Abstract Objects, Def Cmds in Detail
10731 @subsection Data Types
10732
10733 Here is the command for data types:@refill
10734
10735 @table @code
10736 @findex deftp
10737 @item @@deftp @var{category} @var{name} @var{attributes}@dots{}
10738 The @code{@@deftp} command is the generic definition command for data
10739 types.  The command is written at the beginning of a line and is
10740 followed on the same line by the category, by the name of the type
10741 (which is a word like @code{int} or @code{float}), and then by names of
10742 attributes of objects of that type.  Thus, you could use this command
10743 for describing @code{int} or @code{float}, in which case you could use
10744 @code{data type} as the category.  (A data type is a category of
10745 certain objects for purposes of deciding which operations can be
10746 performed on them.)@refill
10747
10748 In Lisp, for example,  @dfn{pair} names a particular data
10749 type, and an object of that type has two slots called the
10750 @sc{car} and the @sc{cdr}.  Here is how you would write the first line
10751 of a definition of @code{pair}.@refill
10752
10753 @example
10754 @group
10755 @@deftp @{Data type@} pair car cdr
10756 @dots{}
10757 @@end deftp
10758 @end group
10759 @end example
10760
10761 @need 950
10762 The template is:
10763
10764 @example
10765 @group
10766 @@deftp @var{category} @var{name-of-type} @var{attributes}@dots{}
10767 @var{body-of-definition}
10768 @@end deftp
10769 @end group
10770 @end example
10771
10772 @code{@@deftp} creates an entry in the index of data types.
10773 @end table
10774
10775 @node Def Cmd Conventions, Sample Function Definition, Def Cmds in Detail, Definition Commands
10776 @section Conventions for Writing Definitions
10777 @cindex Definition conventions
10778 @cindex Conventions for writing definitions
10779
10780 When you write a definition using @code{@@deffn}, @code{@@defun}, or
10781 one of the other definition commands, please take care to use
10782 arguments that indicate the meaning, as with the @var{count} argument
10783 to the @code{forward-word} function.  Also, if the name of an argument
10784 contains the name of a type, such as @var{integer}, take care that the
10785 argument actually is of that type.@refill
10786
10787 @node Sample Function Definition, , Def Cmd Conventions, Definition Commands
10788 @section A Sample Function Definition
10789 @cindex Function definitions
10790 @cindex Command definitions
10791 @cindex Macro definitions
10792 @cindex Sample function definition
10793
10794 A function definition uses the @code{@@defun} and @code{@@end defun}
10795 commands.  The name of the function follows immediately after the
10796 @code{@@defun} command and it is followed, on the same line, by the
10797 parameter list.@refill
10798
10799 Here is a definition from @cite{The GNU Emacs Lisp Reference Manual}.
10800 (@xref{Calling Functions, , Calling Functions, elisp, The GNU Emacs
10801 Lisp Reference Manual}.)
10802
10803 @quotation
10804 @defun apply function &rest arguments
10805 @code{apply} calls @var{function} with @var{arguments}, just
10806 like @code{funcall} but with one difference: the last of
10807 @var{arguments} is a list of arguments to give to
10808 @var{function}, rather than a single argument.  We also say
10809 that this list is @dfn{appended} to the other arguments.
10810
10811 @code{apply} returns the result of calling @var{function}.
10812 As with @code{funcall}, @var{function} must either be a Lisp
10813 function or a primitive function; special forms and macros
10814 do not make sense in @code{apply}.
10815
10816 @example
10817 (setq f 'list)
10818      @result{} list
10819 (apply f 'x 'y 'z)
10820 @error{} Wrong type argument: listp, z
10821 (apply '+ 1 2 '(3 4))
10822      @result{} 10
10823 (apply '+ '(1 2 3 4))
10824      @result{} 10
10825
10826 (apply 'append '((a b c) nil (x y z) nil))
10827      @result{} (a b c x y z)
10828 @end example
10829
10830 An interesting example of using @code{apply} is found in the description
10831 of @code{mapcar}.@refill
10832 @end defun
10833 @end quotation
10834
10835 @need 1200
10836 In the Texinfo source file, this example looks like this:
10837
10838 @example
10839 @group
10840 @@defun apply function &rest arguments
10841
10842 @@code@{apply@} calls @@var@{function@} with
10843 @@var@{arguments@}, just like @@code@{funcall@} but with one
10844 difference: the last of @@var@{arguments@} is a list of
10845 arguments to give to @@var@{function@}, rather than a single
10846 argument.  We also say that this list is @@dfn@{appended@}
10847 to the other arguments.
10848 @end group
10849
10850 @group
10851 @@code@{apply@} returns the result of calling
10852 @@var@{function@}.  As with @@code@{funcall@},
10853 @@var@{function@} must either be a Lisp function or a
10854 primitive function; special forms and macros do not make
10855 sense in @@code@{apply@}.
10856 @end group
10857
10858 @group
10859 @@example
10860 (setq f 'list)
10861      @@result@{@} list
10862 (apply f 'x 'y 'z)
10863 @@error@{@} Wrong type argument: listp, z
10864 (apply '+ 1 2 '(3 4))
10865      @@result@{@} 10
10866 (apply '+ '(1 2 3 4))
10867      @@result@{@} 10
10868
10869 (apply 'append '((a b c) nil (x y z) nil))
10870      @@result@{@} (a b c x y z)
10871 @@end example
10872 @end group
10873
10874 @group
10875 An interesting example of using @@code@{apply@} is found
10876 in the description of @@code@{mapcar@}.@@refill
10877 @@end defun
10878 @end group
10879 @end example
10880
10881 @noindent
10882 In this manual, this function is listed in the Command and Variable
10883 Index under @code{apply}.@refill
10884
10885 Ordinary variables and user options are described using a format like
10886 that for functions except that variables do not take arguments.
10887
10888 @node Footnotes, Conditionals, Definition Commands, Top
10889 @comment  node-name,  next,  previous,  up
10890 @chapter Footnotes
10891 @cindex Footnotes
10892 @findex footnote
10893
10894 A @dfn{footnote} is for a reference that documents or elucidates the
10895 primary text.@footnote{A footnote should complement or expand upon
10896 the primary text, but a reader should not need to read a footnote to
10897 understand the primary text.  For a thorough discussion of footnotes,
10898 see @cite{The Chicago Manual of Style}, which is published by the
10899 University of Chicago Press.}@refill
10900
10901 @menu
10902 * Footnote Commands::           How to write a footnote in Texinfo.
10903 * Footnote Styles::             Controlling how footnotes appear in Info.
10904 @end menu
10905
10906 @node Footnote Commands, Footnote Styles, Footnotes, Footnotes
10907 @section Footnote Commands
10908
10909 In Texinfo, footnotes are created with the @code{@@footnote} command.
10910 This command is followed immediately by a left brace, then by the text
10911 of the footnote, and then by a terminating right brace.  The template
10912 is:
10913
10914 @example
10915 @@footnote@{@var{text}@}
10916 @end example
10917
10918 Footnotes may be of any length, but are usually short.@refill
10919
10920 For example, this clause is followed by a sample
10921 footnote@footnote{Here is the sample footnote.}; in the Texinfo
10922 source, it looks like this:@refill
10923
10924 @example
10925 @dots{}a sample footnote @@footnote@{Here is the sample
10926 footnote.@}; in the Texinfo source@dots{}
10927 @end example
10928
10929 @strong{Warning:} Don't use footnotes in the argument of the
10930 @code{@@item} command for a @code{@@table} table.  This doesn't work;
10931 because of limitations of @TeX{}, there is no way to fix it.  To avoid
10932 the problem, move the footnote into the body text of the table.
10933
10934 In a printed manual or book, the reference mark for a footnote is a
10935 small, superscripted number; the text of the footnote appears at the
10936 bottom of the page, below a horizontal line.@refill
10937
10938 In Info, the reference mark for a footnote is a pair of parentheses
10939 with the footnote number between them, like this: @samp{(1)}.@refill
10940
10941 @node Footnote Styles, , Footnote Commands, Footnotes
10942 @section Footnote Styles
10943
10944 Info has two footnote styles, which determine where the text of the
10945 footnote is located:@refill
10946
10947 @itemize @bullet
10948 @cindex @samp{@r{End}} node footnote style
10949 @item
10950 In the `End' node style, all the footnotes for a single node
10951 are placed at the end of that node.  The footnotes are separated from
10952 the rest of the node by a line of dashes with the word
10953 @samp{Footnotes} within it.  Each footnote begins with an
10954 @samp{(@var{n})} reference mark.@refill
10955
10956 @need 700
10957 @noindent
10958 Here is an example of a single footnote in the end of node style:@refill
10959
10960 @example
10961 @group
10962  --------- Footnotes ---------
10963
10964 (1)  Here is a sample footnote.
10965 @end group
10966 @end example
10967
10968 @cindex @samp{@r{Separate}} footnote style
10969 @item
10970 In the `Separate' node style, all the footnotes for a single
10971 node are placed in an automatically constructed node of
10972 their own.  In this style, a ``footnote reference'' follows
10973 each @samp{(@var{n})} reference mark in the body of the
10974 node.  The footnote reference is actually a cross reference
10975 which you use to reach the footnote node.@refill
10976
10977 The name of the node containing the footnotes is constructed
10978 by appending @w{@samp{-Footnotes}} to the name of the node
10979 that contains the footnotes. (Consequently, the footnotes'
10980 node for the @file{Footnotes} node is
10981 @w{@file{Footnotes-Footnotes}}!)  The footnotes' node has an
10982 `Up' node pointer that leads back to its parent node.@refill
10983
10984 @noindent
10985 Here is how the first footnote in this manual looks after being
10986 formatted for Info in the separate node style:@refill
10987
10988 @smallexample
10989 @group
10990 File: texinfo.info  Node: Overview-Footnotes, Up: Overview
10991
10992 (1) Note that the first syllable of "Texinfo" is
10993 pronounced like "speck", not "hex". @dots{}
10994 @end group
10995 @end smallexample
10996 @end itemize
10997
10998 A Texinfo file may be formatted into an Info file with either footnote
10999 style.@refill
11000
11001 @findex footnotestyle
11002 Use the @code{@@footnotestyle} command to specify an Info file's
11003 footnote style.  Write this command at the beginning of a line followed
11004 by an argument, either @samp{end} for the end node style or
11005 @samp{separate} for the separate node style.
11006
11007 @need 700
11008 For example,
11009
11010 @example
11011 @@footnotestyle end
11012 @end example
11013 @noindent
11014 or
11015 @example
11016 @@footnotestyle separate
11017 @end example
11018
11019 Write an @code{@@footnotestyle} command before or shortly after the
11020 end-of-header line at the beginning of a Texinfo file.  (If you
11021 include the @code{@@footnotestyle} command between the start-of-header
11022 and end-of-header lines, the region formatting commands will format
11023 footnotes as specified.)@refill
11024
11025 If you do not specify a footnote style, the formatting commands use
11026 their default style.  Currently, @code{texinfo-format-buffer} and
11027 @code{texinfo-format-region} use the `separate' style and
11028 @code{makeinfo} uses the `end' style.@refill
11029
11030 @c !!! note: makeinfo's --footnote-style option overrides footnotestyle
11031 @ignore
11032 If you use @code{makeinfo} to create the Info file, the
11033 @samp{--footnote-style} option determines which style is used,
11034 @samp{end} for the end of node style or @samp{separate} for the
11035 separate node style.  Thus, to format the Texinfo manual in the
11036 separate node style, you would use the following shell command:@refill
11037
11038 @example
11039 makeinfo --footnote-style=separate texinfo.texi
11040 @end example
11041
11042 @noindent
11043 To format the Texinfo manual in the end of node style, you would
11044 type:@refill
11045
11046 @example
11047 makeinfo --footnote-style=end texinfo.texi
11048 @end example
11049 @end ignore
11050 @ignore
11051 If you use @code{texinfo-format-buffer} or
11052 @code{texinfo-format-region} to create the Info file, the value of the
11053 @code{texinfo-footnote-style} variable controls the footnote style.
11054 It can be either @samp{"separate"} for the separate node style or
11055 @samp{"end"} for the end of node style.  (You can change the value of
11056 this variable with the @kbd{M-x edit-options} command (@pxref{Edit
11057 Options, , Editing Variable Values, emacs, The GNU Emacs Manual}), or
11058 with the @kbd{M-x set-variable} command (@pxref{Examining, , Examining
11059 and Setting Variables, emacs, The GNU Emacs Manual}).@refill
11060
11061 The @code{texinfo-footnote-style} variable also controls the style if
11062 you use the @kbd{M-x makeinfo-region} or @kbd{M-x makeinfo-buffer}
11063 command in Emacs.@refill
11064 @end ignore
11065 This chapter contains two footnotes.@refill
11066
11067 @node Conditionals, Macros, Footnotes, Top
11068 @comment  node-name,  next,  previous,  up
11069 @chapter Conditionally Visible Text
11070 @cindex Conditionally visible text
11071 @cindex Text, conditionally visible
11072 @cindex Visibility of conditional text
11073 @cindex If text conditionally visible
11074 @findex ifhtml
11075 @findex ifinfo
11076 @findex iftex
11077
11078 Sometimes it is good to use different text for a printed manual and
11079 its corresponding Info file.  In this case, you can use the
11080 @dfn{conditional commands} to specify which text is for the printed manual
11081 and which is for the Info file.@refill
11082
11083 @menu
11084 * Conditional Commands::        How to specify text for HTML, Info, or @TeX{}.
11085 * Using Ordinary TeX Commands::  You can use any and all @TeX{} commands.
11086 * set clear value::             How to designate which text to format (for
11087                                   both Info and @TeX{}); and how to set a
11088                                   flag to a string that you can insert.
11089 @end menu
11090
11091 @node Conditional Commands, Using Ordinary TeX Commands, Conditionals, Conditionals
11092 @ifinfo
11093 @heading Using @code{@@ifinfo} and @code{@@iftex}
11094 @end ifinfo
11095
11096 @code{@@ifinfo} begins segments of text that should be ignored
11097 by @TeX{} when it
11098 typesets the printed manual.  The segment of text appears only
11099 in the Info file.
11100 The @code{@@ifinfo} command should appear on a line by itself;  end
11101 the Info-only text with a line containing @code{@@end ifinfo} by
11102 itself.  At the beginning of a Texinfo file, the Info permissions are
11103 contained within a region marked by @code{@@ifinfo} and @code{@@end
11104 ifinfo}. (@xref{Info Summary and Permissions}.)@refill
11105
11106 The @code{@@iftex} and @code{@@end iftex} commands are similar to the
11107 @code{@@ifinfo} and @code{@@end ifinfo} commands, except that they
11108 specify text that will appear in the printed manual but not in the Info
11109 file.  Likewise for @code{@@ifhtml} and @code{@@end ifhtml}, which
11110 specify text to appear only in HTML output.@refill
11111
11112 @need 700
11113 For example,
11114
11115 @example
11116 @@iftex
11117 This text will appear only in the printed manual.
11118 @@end iftex
11119
11120 @@ifinfo
11121 However, this text will appear only in Info.
11122 @@end ifinfo
11123 @end example
11124
11125 @noindent
11126 The preceding example produces the following line:
11127
11128 @iftex
11129 This text will appear only in the printed manual.
11130 @end iftex
11131
11132 @ifinfo
11133 However, this text will appear only in Info.
11134 @end ifinfo
11135
11136 @noindent
11137 Note how you only see one of the two lines, depending on whether you
11138 are reading the Info version or the printed version of this
11139 manual.@refill
11140
11141 The @code{@@titlepage} command is a special variant of @code{@@iftex} that
11142 is used for making the title and copyright pages of the printed
11143 manual. (@xref{titlepage, , @code{@@titlepage}}.) @refill
11144
11145 @node Using Ordinary TeX Commands, set clear value, Conditional Commands, Conditionals
11146 @comment  node-name,  next,  previous,  up
11147 @section Using Ordinary @TeX{} Commands
11148 @cindex @TeX{} commands, using ordinary
11149 @cindex Ordinary @TeX{} commands, using
11150 @cindex Commands using ordinary @TeX{}
11151 @cindex plain @TeX{}
11152
11153 Inside a region delineated by @code{@@iftex} and @code{@@end iftex},
11154 you can embed some plain @TeX{} commands.  Info will ignore these
11155 commands since they are only in that part of the file which is seen by
11156 @TeX{}.  You can write the @TeX{} commands as you would write them in
11157 a normal @TeX{} file, except that you must replace the @samp{\} used
11158 by @TeX{} with an @samp{@@}.  For example, in the @code{@@titlepage}
11159 section of a Texinfo file, you can use the @TeX{} command
11160 @code{@@vskip} to format the copyright page.  (The @code{@@titlepage}
11161 command causes Info to ignore the region automatically, as it does
11162 with the @code{@@iftex} command.)@refill
11163
11164 However, many features of plain @TeX{} will not work, as they are
11165 overridden by features of Texinfo.
11166
11167 @findex tex
11168 You can enter plain @TeX{} completely, and use @samp{\} in the @TeX{}
11169 commands, by delineating a region with the @code{@@tex} and @code{@@end
11170 tex} commands.  (The @code{@@tex} command also causes Info to ignore the
11171 region, like the @code{@@iftex}
11172 command.)@refill
11173
11174 @cindex Mathematical expressions
11175 For example, here is a mathematical expression written in
11176 plain @TeX{}:@refill
11177
11178 @example
11179 @@tex
11180 $$ \chi^2 = \sum_@{i=1@}^N
11181           \left (y_i - (a + b x_i)
11182           \over \sigma_i\right)^2 $$
11183 @@end tex
11184 @end example
11185
11186 @noindent
11187 The output of this example will appear only in a printed manual.  If
11188 you are reading this in Info, you will not see anything after this
11189 paragraph.
11190 @iftex
11191 In a printed manual, the above expression looks like
11192 this:
11193 @end iftex
11194
11195 @tex
11196 $$ \chi^2 = \sum_{i=1}^N
11197           \left(y_i - (a + b x_i)
11198           \over \sigma_i\right)^2 $$
11199 @end tex
11200
11201 @node set clear value, , Using Ordinary TeX Commands, Conditionals
11202 @comment  node-name,  next,  previous,  up
11203 @section @code{@@set}, @code{@@clear}, and @code{@@value}
11204
11205 You can direct the Texinfo formatting commands to format or ignore parts
11206 of a Texinfo file with the @code{@@set}, @code{@@clear}, @code{@@ifset},
11207 and @code{@@ifclear} commands.@refill
11208
11209 In addition, you can use the @code{@@set @var{flag}} command to set the
11210 value of @var{flag} to a string of characters; and use
11211 @code{@@value@{@var{flag}@}} to insert that string.  You can use
11212 @code{@@set}, for example, to set a date and use @code{@@value} to
11213 insert the date in several places in the Texinfo file.@refill
11214
11215 @menu
11216 * ifset ifclear::               Format a region if a flag is set.
11217 * value::                       Replace a flag with a string.
11218 * value Example::               An easy way to update edition information.
11219 @end menu
11220
11221 @node ifset ifclear, value, set clear value, set clear value
11222 @subsection @code{@@ifset} and @code{@@ifclear}
11223
11224 @findex ifset
11225 When a @var{flag} is set, the Texinfo formatting commands format text
11226 between subsequent pairs of @code{@@ifset @var{flag}} and @code{@@end
11227 ifset} commands.  When the @var{flag} is cleared, the Texinfo formatting
11228 commands do @emph{not} format the text.
11229
11230 Use the @code{@@set @var{flag}} command to turn on, or @dfn{set}, a
11231 @var{flag}; a @dfn{flag} can be any single word.  The format for the
11232 command looks like this:@refill
11233 @findex set
11234
11235 @example
11236 @@set @var{flag}
11237 @end example
11238
11239 Write the conditionally formatted text between @code{@@ifset @var{flag}}
11240 and @code{@@end ifset} commands, like this:@refill
11241
11242 @example
11243 @group
11244 @@ifset @var{flag}
11245 @var{conditional-text}
11246 @@end ifset
11247 @end group
11248 @end example
11249
11250 For example, you can create one document that has two variants, such as
11251 a manual for a `large' and `small' model:@refill
11252
11253 @example
11254 You can use this machine to dig up shrubs
11255 without hurting them.
11256
11257 @@set large
11258
11259 @@ifset large
11260 It can also dig up fully grown trees.
11261 @@end ifset
11262
11263 Remember to replant promptly @dots{}
11264 @end example
11265
11266 @noindent
11267 In the example, the formatting commands will format the text between
11268 @code{@@ifset large} and @code{@@end ifset} because the @code{large}
11269 flag is set.@refill
11270
11271 @findex clear
11272 Use the @code{@@clear @var{flag}} command to turn off, or @dfn{clear},
11273 a flag.  Clearing a flag is the opposite of setting a flag.  The
11274 command looks like this:@refill
11275
11276 @example
11277 @@clear @var{flag}
11278 @end example
11279
11280 @noindent
11281 Write the command on a line of its own.
11282
11283 When @var{flag} is cleared, the Texinfo formatting commands do
11284 @emph{not} format the text between @code{@@ifset @var{flag}} and
11285 @code{@@end ifset}; that text is ignored and does not appear in either
11286 printed or Info output.@refill
11287
11288 For example, if you clear the flag of the preceding example by writing
11289 an @code{@@clear large} command after the @code{@@set large} command
11290 (but before the conditional text), then the Texinfo formatting commands
11291 ignore the text between the @code{@@ifset large} and @code{@@end ifset}
11292 commands.  In the formatted output, that text does not appear; in both
11293 printed and Info output, you see only the lines that say, ``You can use
11294 this machine to dig up shrubs without hurting them.  Remember to replant
11295 promptly @dots{}''.
11296
11297 @findex ifclear
11298 If a flag is cleared with an @code{@@clear @var{flag}} command, then
11299 the formatting commands format text between subsequent pairs of
11300 @code{@@ifclear} and @code{@@end ifclear} commands.  But if the flag
11301 is set with @code{@@set @var{flag}}, then the formatting commands do
11302 @emph{not} format text between an @code{@@ifclear} and an @code{@@end
11303 ifclear} command; rather, they ignore that text.  An @code{@@ifclear}
11304 command looks like this:@refill
11305
11306 @example
11307 @@ifclear @var{flag}
11308 @end example
11309
11310 @need 700
11311 In brief, the commands are:@refill
11312
11313 @table @code
11314 @item @@set @var{flag}
11315 Tell the Texinfo formatting commands that @var{flag} is set.@refill
11316
11317 @item @@clear @var{flag}
11318 Tell the Texinfo formatting commands that @var{flag} is cleared.@refill
11319
11320 @item @@ifset @var{flag}
11321 If @var{flag} is set, tell the Texinfo formatting commands to format
11322 the text up to the following @code{@@end ifset} command.@refill
11323
11324 If @var{flag} is cleared, tell the Texinfo formatting commands to
11325 ignore text up to the following @code{@@end ifset} command.@refill
11326
11327 @item @@ifclear @var{flag}
11328 If @var{flag} is set, tell the Texinfo formatting commands to ignore
11329 the text up to the following @code{@@end ifclear} command.@refill
11330
11331 If @var{flag} is cleared, tell the Texinfo formatting commands to
11332 format the text up to the following @code{@@end ifclear}
11333 command.@refill
11334 @end table
11335
11336 @node value, value Example, ifset ifclear, set clear value
11337 @subsection @code{@@value}
11338 @findex value
11339
11340 You can use the @code{@@set} command to specify a value for a flag,
11341 which is expanded by the @code{@@value} command.  The value is a string
11342 a characters.
11343
11344 Write the @code{@@set} command like this:
11345
11346 @example
11347 @@set foo This is a string.
11348 @end example
11349
11350 @noindent
11351 This sets the value of @code{foo} to ``This is a string.''
11352
11353 The Texinfo formatters replace an @code{@@value@{@var{flag}@}} command with
11354 the string to which @var{flag} is set.@refill
11355
11356 Thus, when @code{foo} is set as shown above, the Texinfo formatters convert
11357
11358 @example
11359 @group
11360 @@value@{foo@}
11361 @exdent @r{to}
11362 This is a string.
11363 @end group
11364 @end example
11365
11366 You can write an @code{@@value} command within a paragraph; but you
11367 must write an @code{@@set} command on a line of its own.
11368
11369 If you write the @code{@@set} command like this:
11370
11371 @example
11372 @@set foo
11373 @end example
11374
11375 @noindent
11376 without specifying a string, the value of @code{foo} is an empty string.
11377
11378 If you clear a previously set flag with an @code{@@clear @var{flag}}
11379 command, a subsequent @code{@@value@{flag@}} command is invalid and the
11380 string is replaced with an error message that says @samp{@{No value for
11381 "@var{flag}"@}}.
11382
11383 For example, if you set @code{foo} as follows:@refill
11384
11385 @example
11386 @@set how-much very, very, very
11387 @end example
11388
11389 @noindent
11390 then the formatters transform
11391
11392 @example
11393 @group
11394 It is a @@value@{how-much@} wet day.
11395 @exdent @r{into}
11396 It is a very, very, very wet day.
11397 @end group
11398 @end example
11399
11400 If you write
11401
11402 @example
11403 @@clear how-much
11404 @end example
11405
11406 @noindent
11407 then the formatters transform
11408
11409 @example
11410 @group
11411 It is a @@value@{how-much@} wet day.
11412 @exdent @r{into}
11413 It is a @{No value for "how-much"@} wet day.
11414 @end group
11415 @end example
11416
11417 @node value Example, , value, set clear value
11418 @subsection @code{@@value} Example
11419
11420 You can use the @code{@@value} command to limit the number of places you
11421 need to change when you record an update to a manual.
11422 Here is how it is done in @cite{The GNU Make Manual}:
11423
11424 @need 1000
11425 @noindent
11426 Set the flags:
11427
11428 @example
11429 @group
11430 @@set EDITION 0.35 Beta
11431 @@set VERSION 3.63 Beta
11432 @@set UPDATED 14 August 1992
11433 @@set UPDATE-MONTH August 1992
11434 @end group
11435 @end example
11436
11437 @need 750
11438 @noindent
11439 Write text for the first @code{@@ifinfo} section, for people reading the
11440 Texinfo file:
11441
11442 @example
11443 @group
11444 This is Edition @@value@{EDITION@},
11445 last updated @@value@{UPDATED@},
11446 of @@cite@{The GNU Make Manual@},
11447 for @@code@{make@}, Version @@value@{VERSION@}.
11448 @end group
11449 @end example
11450
11451 @need 1000
11452 @noindent
11453 Write text for the title page, for people reading the printed manual:
11454 @c List only the month and the year since that looks less fussy on a
11455 @c printed cover than a date that lists the day as well.
11456
11457 @example
11458 @group
11459 @@title GNU Make
11460 @@subtitle A Program for Directing Recompilation
11461 @@subtitle Edition @@value@{EDITION@}, @dots{}
11462 @@subtitle @@value@{UPDATE-MONTH@}
11463 @end group
11464 @end example
11465
11466 @noindent
11467 (On a printed cover, a date listing the month and the year looks less
11468 fussy than a date listing the day as well as the month and year.)
11469
11470 @need 750
11471 @noindent
11472 Write text for the Top node, for people reading the Info file:
11473
11474 @example
11475 @group
11476 This is Edition @@value@{EDITION@}
11477 of the @@cite@{GNU Make Manual@},
11478 last updated @@value@{UPDATED@}
11479 for @@code@{make@} Version @@value@{VERSION@}.
11480 @end group
11481 @end example
11482
11483 @need 950
11484 After you format the manual, the text in the first @code{@@ifinfo}
11485 section looks like this:
11486
11487 @example
11488 @group
11489 This is Edition 0.35 Beta, last updated 14 August 1992,
11490 of `The GNU Make Manual', for `make', Version 3.63 Beta.
11491 @end group
11492 @end example
11493
11494 When you update the manual, change only the values of the flags; you do
11495 not need to rewrite the three sections.
11496
11497
11498 @node Macros, Format/Print Hardcopy, Conditionals, Top
11499 @chapter Macros: Defining New Texinfo Commands
11500 @cindex Macros
11501 @cindex Defining new Texinfo commands
11502 @cindex New Texinfo commands, defining
11503 @cindex Texinfo commands, defining new
11504 @cindex User-defined Texinfo commands
11505
11506 A Texinfo @dfn{macro} allows you to define a new Texinfo command as any
11507 sequence of text and/or existing commands (including other macros).  The
11508 macro can have any number of @dfn{parameters}---text you supply each
11509 time you use the macro.  (This has nothing to do with the
11510 @code{@@defmac} command, which is for documenting macros in the subject
11511 of the manual; @pxref{Def Cmd Template}.)
11512
11513 @menu
11514 * Defining Macros::             Both defining and undefining new commands.
11515 * Invoking Macros::             Using a macro, once you've defined it.
11516 @end menu
11517
11518
11519 @node Defining Macros, Invoking Macros, Macros, Macros
11520 @section Defining Macros
11521 @cindex Defining macros
11522 @cindex Macro definitions
11523
11524 @findex macro
11525 You use the Texinfo @code{@@macro} command to define a macro.  For example:
11526
11527 @example
11528 @@macro @var{macro-name}@{@var{param1}, @var{param2}, @dots{}@}
11529 @var{text} @dots{} \@var{param1}\ @dots{}
11530 @@end macro
11531 @end example
11532
11533 The @dfn{parameters} @var{param1}, @var{param2}, @dots{} correspond to
11534 arguments supplied when the macro is subsequently used in the document
11535 (see the next section).
11536
11537 If a macro needs no parameters, you can define it either with an empty
11538 list (@samp{@@macro foo @{@}}) or with no braces at all (@samp{@@macro
11539 foo}).
11540
11541 @cindex Body of a macro
11542 @cindex Mutually recursive macros
11543 @cindex Recursion, mutual
11544 The definition or @dfn{body} of the macro can contain any Texinfo
11545 commands, including previously-defined macros.  (It is not possible to
11546 have mutually recursive Texinfo macros.)  In the body, instances of a
11547 parameter name surrounded by backslashes, as in @samp{\@var{param1}\} in
11548 the example above, are replaced by the corresponding argument from the
11549 macro invocation.
11550
11551 @findex unmacro
11552 @cindex Macros, undefining
11553 @cindex Undefining macros
11554 You can undefine a macro @var{foo} with @code{@@unmacro @var{foo}}.
11555 It is not an error to undefine a macro that is already undefined.
11556 For example:
11557
11558 @example
11559 @@unmacro foo
11560 @end example
11561
11562
11563 @node Invoking Macros, , Defining Macros, Macros
11564 @section Invoking Macros
11565 @cindex Invoking macros
11566 @cindex Macro invocation
11567
11568 After a macro is defined (see the previous section), you can use
11569 (@dfn{invoke}) it in your document like this:
11570
11571 @example
11572 @@@var{macro-name} @{@var{arg1}, @var{arg2}, @dots{}@}
11573 @end example
11574
11575 @noindent and the result will be just as if you typed the body of
11576 @var{macro-name} at that spot.  For example:
11577
11578 @example
11579 @@macro foo @{p, q@}
11580 Together: \p\ & \q\.
11581 @@end macro
11582 @@foo@{a, b@}
11583 @end example
11584
11585 @noindent produces:
11586
11587 @display
11588 Together: a & b.
11589 @end display
11590
11591 @cindex Backslash, and macros
11592 Thus, the arguments and parameters are separated by commas and delimited
11593 by braces; any whitespace after (but not before) a comma is ignored.  To
11594 insert a comma, brace, or backslash in an argument, prepend a backslash,
11595 as in
11596
11597 @example
11598 @@@var{macro-name} @{\\\@{\@}\,@}
11599 @end example
11600
11601 @noindent
11602 which will pass the (almost certainly error-producing) argument
11603 @samp{\@{@},} to @var{macro-name}.
11604
11605 If the macro is defined to take a single argument, and is invoked
11606 without any braces, the entire rest of the line after the macro name is
11607 supplied as the argument.  For example:
11608
11609 @example
11610 @@macro bar @{p@}
11611 Twice: \p\, \p\.
11612 @@end macro
11613 @@bar aah
11614 @end example
11615
11616 @noindent produces:
11617
11618 @display
11619 Twice: aah, aah.
11620 @end display
11621
11622
11623 @node Format/Print Hardcopy, Create an Info File, Macros, Top
11624 @comment  node-name,  next,  previous,  up
11625 @chapter Format and Print Hardcopy
11626 @cindex Format and print hardcopy
11627 @cindex Hardcopy, printing it
11628 @cindex Making a printed manual
11629 @cindex Sorting indices
11630 @cindex Indices, sorting
11631 @cindex @TeX{} index sorting
11632 @pindex texindex
11633
11634 There are three major shell commands for making a printed manual from a
11635 Texinfo file: one for converting the Texinfo file into a file that will be
11636 printed, a second for sorting indices, and a third for printing the
11637 formatted document.  When you use the shell commands, you can either
11638 work directly in the operating system shell or work within a shell
11639 inside GNU Emacs.@refill
11640
11641 If you are using GNU Emacs, you can use commands provided by Texinfo
11642 mode instead of shell commands.  In addition to the three commands to
11643 format a file, sort the indices, and print the result, Texinfo mode
11644 offers key bindings for commands to recenter the output buffer, show the
11645 print queue, and delete a job from the print queue.@refill
11646
11647 @menu
11648 * Use TeX::                     Use @TeX{} to format for hardcopy.
11649 * Format with tex/texindex::    How to format in a shell.
11650 * Format with texi2dvi::        A simpler way to use the shell.
11651 * Print with lpr::              How to print.
11652 * Within Emacs::                How to format and print from an Emacs shell.
11653 * Texinfo Mode Printing::       How to format and print in Texinfo mode.
11654 * Compile-Command::             How to print using Emacs's compile command.
11655 * Requirements Summary::        @TeX{} formatting requirements summary.
11656 * Preparing for TeX::           What you need to do to use @TeX{}.
11657 * Overfull hboxes::             What are and what to do with overfull hboxes.
11658 * smallbook::                   How to print small format books and manuals.
11659 * A4 Paper::                    How to print on European A4 paper.
11660 * Cropmarks and Magnification::  How to print marks to indicate the size
11661                                 of pages and how to print scaled up output.
11662 @end menu
11663
11664 @node Use TeX, Format with tex/texindex, Format/Print Hardcopy, Format/Print Hardcopy
11665 @ifinfo
11666 @heading Use @TeX{}
11667 @end ifinfo
11668
11669 The typesetting program called @TeX{} is used for formatting a Texinfo
11670 file.  @TeX{} is a very powerful typesetting program and, if used right,
11671 does an exceptionally good job.  @xref{Obtaining TeX, , How to Obtain
11672 @TeX{}}, for information on how to obtain @TeX{}.@refill
11673
11674 The @code{makeinfo}, @code{texinfo-format-region}, and
11675 @code{texinfo-format-buffer} commands read the very same @@-commands
11676 in the Texinfo file as does @TeX{}, but process them differently to
11677 make an Info file; see @ref{Create an Info File}.@refill
11678
11679 @node Format with tex/texindex, Format with texi2dvi, Use TeX, Format/Print Hardcopy
11680 @comment  node-name,  next,  previous,  up
11681 @section Format using @code{tex} and @code{texindex}
11682 @cindex Shell formatting with @code{tex} and @code{texindex}
11683 @cindex Formatting with @code{tex} and @code{texindex}
11684 @cindex DVI file
11685
11686 Format the Texinfo file with the shell command @code{tex} followed by
11687 the name of the Texinfo file.  This command produces a formatted
11688 @sc{dvi} file as well as several auxiliary files containing indices,
11689 cross references, etc.  The @sc{dvi} file (for @dfn{DeVice Independent}
11690 file) can be printed on a wide variety of printers.@refill
11691
11692 The @code{tex} formatting command itself does not sort the indices; it
11693 writes an output file of unsorted index data.  This is a misfeature of
11694 @TeX{}.  (The @code{texi2dvi} command automatically generates indices;
11695 see @ref{Format with texi2dvi, , Format using @code{texi2dvi}}.)  To
11696 generate a printed index after running the @code{tex} command, you first
11697 need a sorted index to work from.  The @code{texindex} command sorts
11698 indices.  (The source file @file{texindex.c} comes as part of the
11699 standard GNU distribution and is usually installed when Emacs is
11700 installed.)@refill
11701 @pindex texindex
11702 @ignore
11703 Usage: texindex [-k] [-T tempdir] infile [-o outfile] ...
11704
11705 Each infile arg can optionally be followed by a `-o outfile' arg;
11706 for each infile that is not followed by a -o arg, the infile name with
11707 `s' (for `sorted') appended is used for the outfile.
11708
11709 -T dir is the directory to put temp files in, instead of /tmp.
11710 -k means `keep tempfiles', for debugging.
11711 @end ignore
11712
11713 The @code{tex} formatting command outputs unsorted index files under
11714 names that obey a standard convention.  These names are the name of
11715 your main input file to the @code{tex} formatting command, with
11716 everything after the first period thrown away, and the two letter
11717 names of indices added at the end.  For example, the raw index output
11718 files for the input file @file{foo.texinfo} would be @file{foo.cp},
11719 @file{foo.vr}, @file{foo.fn}, @file{foo.tp}, @file{foo.pg} and
11720 @file{foo.ky}.  Those are exactly the arguments to give to
11721 @code{texindex}.@refill
11722
11723 @need 1000
11724 Or else, you can use @samp{??} as ``wild-cards'' and give the command in
11725 this form:@refill
11726
11727 @example
11728 texindex foo.??
11729 @end example
11730
11731 @noindent
11732 This command will run @code{texindex} on all the unsorted index files,
11733 including any that you have defined yourself using @code{@@defindex}
11734 or @code{@@defcodeindex}.  (You may execute @samp{texindex foo.??}
11735 even if there are similarly named files with two letter extensions
11736 that are not index files, such as @samp{foo.el}.  The @code{texindex}
11737 command reports but otherwise ignores such files.)@refill
11738
11739 For each file specified, @code{texindex} generates a sorted index file
11740 whose name is made by appending @samp{s} to the input file name.  The
11741 @code{@@printindex} command knows to look for a file of that name.
11742 @code{texindex} does not alter the raw index output file.@refill
11743
11744 After you have sorted the indices, you need to rerun the @code{tex}
11745 formatting command on the Texinfo file.  This regenerates a formatted
11746 @sc{dvi} file with up-to-date index entries.@footnote{If you use more
11747 than one index and have cross references to an index other than the
11748 first, you must run @code{tex} @emph{three times} to get correct output:
11749 once to generate raw index data; again (after @code{texindex}) to output
11750 the text of the indices and determine their true page numbers; and a
11751 third time to output correct page numbers in cross references to them.
11752 However, cross references to indices are rare.}@refill
11753
11754 To summarize, this is a three step process:
11755
11756 @enumerate
11757 @item
11758 Run the @code{tex} formatting command on the Texinfo file.  This
11759 generates the formatted @sc{dvi} file as well as the raw index files
11760 with two letter extensions.@refill
11761
11762 @item
11763 Run the shell command @code{texindex} on the raw index files to sort
11764 them.  This creates the corresponding sorted index files.@refill
11765
11766 @item
11767 Rerun the @code{tex} formatting command on the Texinfo file.  This
11768 regenerates a formatted @sc{dvi} file with the index entries in the
11769 correct order.  This second run also corrects the page numbers for
11770 the cross references.  (The tables of contents are always correct.)@refill
11771 @end enumerate
11772
11773 You need not run @code{texindex} each time after you run the
11774 @code{tex} formatting.  If you do not, on the next run, the @code{tex}
11775 formatting command will use whatever sorted index files happen to
11776 exist from the previous use of @code{texindex}.  This is usually
11777 @sc{ok} while you are debugging.@refill
11778
11779 @node Format with texi2dvi, Print with lpr, Format with tex/texindex, Format/Print Hardcopy
11780 @comment  node-name,  next,  previous,  up
11781 @section Format using @code{texi2dvi}
11782 @pindex texi2dvi @r{(shell script)}
11783
11784 The @code{texi2dvi} command is a shell script that automatically runs
11785 both @code{tex} and @code{texindex} as many times as necessary to
11786 produce a @sc{dvi} file with up-to-date, sorted indices.  It simplifies
11787 the @code{tex}---@code{texindex}---@code{tex} sequence described in the
11788 previous section.
11789
11790 @need 1000
11791 The syntax for @code{texi2dvi} is like this (where @samp{prompt$} is the
11792 shell prompt):@refill
11793
11794 @example
11795 prompt$ @kbd{texi2dvi @var{filename}@dots{}}
11796 @end example
11797
11798 @node Print with lpr, Within Emacs, Format with texi2dvi, Format/Print Hardcopy
11799 @comment  node-name,  next,  previous,  up
11800 @section Shell Print Using @code{lpr -d}
11801 @pindex lpr @r{(@sc{dvi} print command)}
11802
11803 You can print a @sc{dvi} file with the @sc{dvi} print command.  The
11804 precise printing command to use depends on your system; @samp{lpr -d} is
11805 common.  The @sc{dvi} print command may require a file name without any
11806 extension or with a @samp{.dvi} extension.@refill
11807
11808 @need 1200
11809 The following commands, for example, sort the indices, format, and
11810 print the @cite{Bison Manual} (where @samp{%} is the shell
11811 prompt):@refill
11812
11813 @example
11814 @group
11815 % tex bison.texinfo
11816 % texindex bison.??
11817 % tex bison.texinfo
11818 % lpr -d bison.dvi
11819 @end group
11820 @end example
11821
11822 @noindent
11823 (Remember that the shell commands may be different at your site; but
11824 these are commonly used versions.)@refill
11825
11826 @need 1000
11827 Using the @code{texi2dvi} shell script, you simply need type:@refill
11828
11829 @example
11830 @group
11831 % texi2dvi bison.texinfo
11832 % lpr -d bison.dvi
11833 @end group
11834 @end example
11835
11836 @node Within Emacs, Texinfo Mode Printing, Print with lpr, Format/Print Hardcopy
11837 @comment  node-name,  next,  previous,  up
11838 @section From an Emacs Shell @dots{}
11839 @cindex Print, format from Emacs shell
11840 @cindex Format, print from Emacs shell
11841 @cindex Shell, format, print from
11842 @cindex Emacs shell, format, print from
11843 @cindex GNU Emacs shell, format, print from
11844
11845 You can give formatting and printing commands from a shell within GNU
11846 Emacs.  To create a shell within Emacs, type @kbd{M-x shell}.  In this
11847 shell, you can format and print the document.  @xref{Format/Print
11848 Hardcopy, , Format and Print Hardcopy}, for details.@refill
11849
11850 You can switch to and from the shell buffer while @code{tex} is
11851 running and do other editing.  If you are formatting a long document
11852 on a slow machine, this can be very convenient.@refill
11853
11854 You can also use @code{texi2dvi} from an Emacs shell.  For example,
11855 here is how to use @code{texi2dvi} to format and print @cite{Using and
11856 Porting GNU CC} from a shell within Emacs (where @samp{%} is the shell
11857 prompt):@refill
11858
11859 @example
11860 @group
11861 % texi2dvi gcc.texinfo
11862 % lpr -d gcc.dvi
11863 @end group
11864 @end example
11865 @ifinfo
11866
11867 @xref{Texinfo Mode Printing}, for more information about formatting
11868 and printing in Texinfo mode.@refill
11869 @end ifinfo
11870
11871 @node Texinfo Mode Printing, Compile-Command, Within Emacs, Format/Print Hardcopy
11872 @section Formatting and Printing in Texinfo Mode
11873 @cindex Region printing in Texinfo mode
11874 @cindex Format and print in Texinfo mode
11875 @cindex Print and format in Texinfo mode
11876
11877 Texinfo mode provides several predefined key commands for @TeX{}
11878 formatting and printing.  These include commands for sorting indices,
11879 looking at the printer queue, killing the formatting job, and
11880 recentering the display of the buffer in which the operations
11881 occur.@refill
11882
11883 @table @kbd
11884 @item C-c C-t C-b
11885 @itemx M-x texinfo-tex-buffer
11886 Run @code{texi2dvi} on the current buffer.@refill
11887
11888 @item C-c C-t C-r
11889 @itemx M-x texinfo-tex-region
11890 Run @TeX{} on the current region.@refill
11891
11892 @item C-c C-t C-i
11893 @itemx M-x texinfo-texindex
11894 Sort the indices of a Texinfo file formatted with
11895 @code{texinfo-tex-region}.@refill
11896
11897 @item C-c C-t C-p
11898 @itemx M-x texinfo-tex-print
11899 Print a @sc{dvi} file that was made with @code{texinfo-tex-region} or
11900 @code{texinfo-tex-buffer}.@refill
11901
11902 @item C-c C-t C-q
11903 @itemx M-x tex-show-print-queue
11904 Show the print queue.@refill
11905
11906 @item C-c C-t C-d
11907 @itemx M-x texinfo-delete-from-print-queue
11908 Delete a job from the print queue; you will be prompted for the job
11909 number shown by a preceding @kbd{C-c C-t C-q} command
11910 (@code{texinfo-show-tex-print-queue}).@refill
11911
11912 @item C-c C-t C-k
11913 @itemx M-x tex-kill-job
11914 Kill the currently running @TeX{} job started by
11915 @code{texinfo-tex-region} or @code{texinfo-tex-buffer}, or any other
11916 process running in the Texinfo shell buffer.@refill
11917
11918 @item C-c C-t C-x
11919 @itemx M-x texinfo-quit-job
11920 Quit a @TeX{} formatting job that has stopped because of an error by
11921 sending an @key{x} to it.  When you do this, @TeX{} preserves a record
11922 of what it did in a @file{.log} file.@refill
11923
11924 @item C-c C-t C-l
11925 @itemx M-x tex-recenter-output-buffer
11926 Redisplay the shell buffer in which the @TeX{} printing and formatting
11927 commands are run to show its most recent output.@refill
11928 @end table
11929
11930 @need 1000
11931 Thus, the usual sequence of commands for formatting a buffer is as
11932 follows (with comments to the right):@refill
11933
11934 @example
11935 @group
11936 C-c C-t C-b             @r{Run @code{texi2dvi} on the buffer.}
11937 C-c C-t C-p             @r{Print the @sc{dvi} file.}
11938 C-c C-t C-q             @r{Display the printer queue.}
11939 @end group
11940 @end example
11941
11942 The Texinfo mode @TeX{} formatting commands start a subshell in Emacs
11943 called the @file{*tex-shell*}.  The @code{texinfo-tex-command},
11944 @code{texinfo-texindex-command}, and @code{tex-dvi-print-command}
11945 commands are all run in this shell.
11946
11947 You can watch the commands operate in the @samp{*tex-shell*} buffer,
11948 and you can switch to and from and use the @samp{*tex-shell*} buffer
11949 as you would any other shell buffer.@refill
11950
11951 @need 1500
11952 The formatting and print commands depend on the values of several variables.
11953 The default values are:@refill
11954
11955 @example
11956 @group
11957      @r{Variable}                              @r{Default value}
11958
11959 texinfo-texi2dvi-command                  "texi2dvi"
11960 texinfo-tex-command                       "tex"
11961 texinfo-texindex-command                  "texindex"
11962 texinfo-delete-from-print-queue-command   "lprm"
11963 texinfo-tex-trailer                       "@@bye"
11964 tex-start-of-header                       "%**start"
11965 tex-end-of-header                         "%**end"
11966 tex-dvi-print-command                     "lpr -d"
11967 tex-show-queue-command                    "lpq"
11968 @end group
11969 @end example
11970
11971 You can change the values of these variables with the @kbd{M-x
11972 edit-options} command (@pxref{Edit Options, , Editing Variable Values,
11973 emacs, The GNU Emacs Manual}), with the @kbd{M-x set-variable} command
11974 (@pxref{Examining, , Examining and Setting Variables, emacs, The GNU
11975 Emacs Manual}), or with your @file{.emacs} initialization file
11976 (@pxref{Init File, , , emacs, The GNU Emacs Manual}).@refill
11977
11978 @node Compile-Command, Requirements Summary, Texinfo Mode Printing, Format/Print Hardcopy
11979 @comment  node-name,  next,  previous,  up
11980 @section Using the Local Variables List
11981 @cindex Local variables
11982 @cindex Compile command for formatting
11983 @cindex Format with the compile command
11984
11985 Yet another way to apply the @TeX{} formatting command to a Texinfo file
11986 is to put that command in a @dfn{local variables list} at the end of the
11987 Texinfo file.  You can then specify the @code{tex} or @code{texi2dvi}
11988 commands as a @code{compile-command} and have Emacs run it by typing
11989 @kbd{M-x compile}.  This creates a special shell called the
11990 @file{*compilation*} buffer in which Emacs runs the compile command.
11991 For example, at the end of the @file{gdb.texinfo} file, after the
11992 @code{@@bye}, you could put the following:@refill
11993
11994 @example
11995 @group
11996 @@c Local Variables:
11997 @@c compile-command: "texi2dvi gdb.texinfo"
11998 @@c End:
11999 @end group
12000 @end example
12001
12002 @noindent
12003 This technique is most often used by programmers who also compile programs
12004 this way; see @ref{Compilation, , , emacs, The GNU Emacs Manual}.@refill
12005
12006 @node Requirements Summary, Preparing for TeX, Compile-Command, Format/Print Hardcopy
12007 @comment  node-name,  next,  previous,  up
12008 @section @TeX{} Formatting Requirements Summary
12009 @cindex Requirements for formatting
12010 @cindex Formatting requirements
12011
12012 Every Texinfo file that is to be input to @TeX{} must begin with a
12013 @code{\input} command and must contain an @code{@@setfilename} command and
12014 an @code{@@settitle} command:@refill
12015
12016 @example
12017 \input texinfo
12018 @@setfilename @var{arg-not-used-by-@TeX{}}
12019 @@settitle @var{name-of-manual}
12020 @end example
12021
12022 @noindent
12023 The first command instructs @TeX{} to load the macros it needs to
12024 process a Texinfo file, the second command opens auxiliary files, and
12025 the third specifies the title of printed manual.
12026
12027 @need 1000
12028 Every Texinfo file must end with a line that terminates @TeX{}
12029 processing and forces out unfinished pages:@refill
12030
12031 @example
12032 @@bye
12033 @end example
12034
12035 Strictly speaking, these four lines are all a Texinfo file needs for
12036 @TeX{}, besides the body.  (The @code{@@setfilename} line is the only
12037 line that a Texinfo file needs for Info formatting.)@refill
12038
12039 Usually, the file's first line contains an @samp{@@c -*-texinfo-*-}
12040 comment that causes Emacs to switch to Texinfo mode when you edit the
12041 file.  In addition, the beginning usually includes an
12042 @code{@@setchapternewpage} command, a title page, a copyright page, and
12043 permissions.  Besides an @code{@@bye}, the end of a file usually
12044 includes indices and a table of contents.@refill
12045
12046 @iftex
12047 For more information, see
12048 @ref{setchapternewpage, , @code{@@setchapternewpage}},
12049 @ref{Headings, ,Page Headings},
12050 @ref{Titlepage & Copyright Page},
12051 @ref{Printing Indices & Menus}, and
12052 @ref{Contents}.
12053 @end iftex
12054 @noindent
12055 @ifinfo
12056 For more information, see@*
12057 @ref{setchapternewpage, , @code{@@setchapternewpage}},@*
12058 @ref{Headings, ,Page Headings},@*
12059 @ref{Titlepage & Copyright Page},@*
12060 @ref{Printing Indices & Menus}, and@*
12061 @ref{Contents}.
12062 @end ifinfo
12063
12064 @node Preparing for TeX, Overfull hboxes, Requirements Summary, Format/Print Hardcopy
12065 @comment  node-name,  next,  previous,  up
12066 @section Preparing to Use @TeX{}
12067 @cindex Preparing to use @TeX{}
12068 @cindex @TeX{} input initialization
12069 @cindex @code{TEXINPUTS} environment variable
12070 @vindex TEXINPUTS
12071 @cindex @b{.profile} initialization file
12072 @cindex @b{.cshrc} initialization file
12073 @cindex Initialization file for @TeX{} input
12074
12075 @TeX{} needs to know where to find the @file{texinfo.tex} file
12076 that you have told it to input with the @samp{\input texinfo} command
12077 at the beginning of the first line.  The @file{texinfo.tex} file tells
12078 @TeX{} how to handle @@-commands.  (@file{texinfo.tex} is
12079 included in the standard GNU distributions.)@refill
12080
12081 Usually, the @file{texinfo.tex} file is put in the default directory
12082 that contains @TeX{} macros (the @file{/usr/lib/tex/macros}
12083 directory) when GNU Emacs or other GNU software is installed.
12084 In this case, @TeX{} will
12085 find the file and you do not need to do anything special.
12086 Alternatively, you can put @file{texinfo.tex} in the directory in
12087 which the Texinfo source file is located, and @TeX{} will find it
12088 there.@refill
12089
12090 However, you may want to specify the location of the @code{\input} file
12091 yourself.  One way to do this is to write the complete path for the file
12092 after the @code{\input} command.  Another way is to set the
12093 @code{TEXINPUTS} environment variable in your @file{.cshrc} or
12094 @file{.profile} file.  The @code{TEXINPUTS} environment variable will tell
12095 @TeX{} where to find the @file{texinfo.tex} file and any other file that
12096 you might want @TeX{} to use.@refill
12097
12098 Whether you use a @file{.cshrc} or @file{.profile} file depends on
12099 whether you use @code{csh}, @code{sh}, or @code{bash} for your shell
12100 command interpreter.  When you use @code{csh}, it looks to the
12101 @file{.cshrc} file for initialization information, and when you use
12102 @code{sh} or @code{bash}, it looks to the @file{.profile} file.@refill
12103
12104 @need 1000
12105 In a @file{.cshrc} file, you could use the following @code{csh} command
12106 sequence:@refill
12107
12108 @example
12109 setenv TEXINPUTS .:/usr/me/mylib:/usr/lib/tex/macros
12110 @end example
12111
12112 @need 1000
12113 In a @file{.profile} file, you could use the following @code{sh} command
12114 sequence:
12115
12116 @example
12117 @group
12118 TEXINPUTS=.:/usr/me/mylib:/usr/lib/tex/macros
12119 export TEXINPUTS
12120 @end group
12121 @end example
12122
12123 @noindent
12124 This would cause @TeX{} to look for @file{\input} file first in the current
12125 directory, indicated by the @samp{.}, then in a hypothetical user's
12126 @file{me/mylib} directory, and finally in the system library.@refill
12127
12128 @node Overfull hboxes, smallbook, Preparing for TeX, Format/Print Hardcopy
12129 @comment  node-name,  next,  previous,  up
12130 @section Overfull ``hboxes''
12131 @cindex Overfull @samp{hboxes}
12132 @cindex @samp{hboxes}, overfull
12133 @cindex Final output
12134
12135 @TeX{} is sometimes unable to typeset a line without extending it into
12136 the right margin.  This can occur when @TeX{} comes upon what it
12137 interprets as a long word that it cannot hyphenate, such as an
12138 electronic mail network address or a very long title.  When this
12139 happens, @TeX{} prints an error message like this:@refill
12140
12141 @example
12142 Overfull \hbox (20.76302pt too wide)
12143 @end example
12144
12145 @noindent
12146 (In @TeX{}, lines are in ``horizontal boxes'', hence the term, ``hbox''.
12147 The backslash, @samp{\}, is the @TeX{} equivalent of @samp{@@}.)@refill
12148
12149 @TeX{} also provides the line number in the Texinfo source file and
12150 the text of the offending line, which is marked at all the places that
12151 @TeX{} knows how to hyphenate words.
12152 @xref{Debugging with TeX, , Catching Errors with @TeX{} Formatting},
12153 for more information about typesetting errors.@refill
12154
12155 If the Texinfo file has an overfull hbox, you can rewrite the sentence
12156 so the overfull hbox does not occur, or you can decide to leave it.  A
12157 small excursion into the right margin often does not matter and may not
12158 even be noticeable.@refill
12159
12160 @cindex Black rectangle in hardcopy
12161 @cindex Rectangle, ugly, black in hardcopy
12162 However, unless told otherwise, @TeX{} will print a large, ugly, black
12163 rectangle beside the line that contains the overfull hbox.  This is so
12164 you will notice the location of the problem if you are correcting a
12165 draft.@refill
12166
12167 @need 1000
12168 @findex finalout
12169 To prevent such a monstrosity from marring your final printout, write
12170 the following in the beginning of the Texinfo file on a line of its own,
12171 before the @code{@@titlepage} command:@refill
12172
12173 @example
12174 @@finalout
12175 @end example
12176
12177 @node smallbook, A4 Paper, Overfull hboxes, Format/Print Hardcopy
12178 @comment  node-name,  next,  previous,  up
12179 @section Printing ``Small'' Books
12180 @findex smallbook
12181 @cindex Small book size
12182 @cindex Book, printing small
12183 @cindex Page sizes for books
12184 @cindex Size of printed book
12185
12186 By default, @TeX{} typesets pages for printing in an 8.5 by 11 inch
12187 format.  However, you can direct @TeX{} to typeset a document in a 7 by
12188 9.25 inch format that is suitable for bound books by inserting the
12189 following command on a line by itself at the beginning of the Texinfo
12190 file, before the title page:@refill
12191
12192 @example
12193 @@smallbook
12194 @end example
12195
12196 @noindent
12197 (Since regular sized books are often about 7 by 9.25 inches, this
12198 command might better have been called the @code{@@regularbooksize}
12199 command, but it came to be called the @code{@@smallbook} command by
12200 comparison to the 8.5 by 11 inch format.)@refill
12201
12202 If you write the @code{@@smallbook} command between the
12203 start-of-header and end-of-header lines, the Texinfo mode @TeX{}
12204 region formatting command, @code{texinfo-tex-region}, will format the
12205 region in ``small'' book size (@pxref{Start of Header}).@refill
12206
12207 The Free Software Foundation distributes printed copies of @cite{The GNU
12208 Emacs Manual} and other manuals in the ``small'' book size.
12209 @xref{smallexample & smalllisp, , @code{@@smallexample} and
12210 @code{@@smalllisp}}, for information about commands that make it easier
12211 to produce examples for a smaller manual.@refill
12212
12213 @node A4 Paper, Cropmarks and Magnification, smallbook, Format/Print Hardcopy
12214 @comment  node-name,  next,  previous,  up
12215 @section Printing on A4 Paper
12216 @cindex A4 paper, printing on
12217 @cindex Paper size, European A4
12218 @cindex European A4 paper
12219 @findex afourpaper
12220
12221 You can tell @TeX{} to typeset a document for printing on European size
12222 A4 paper with the @code{@@afourpaper} command.  Write the command on a
12223 line by itself between @code{@@iftex} and @code{@@end iftex} lines near
12224 the beginning of the Texinfo file, before the title page:@refill
12225
12226 For example, this is how you would write the header for this manual:@refill
12227
12228 @example
12229 @group
12230 \input texinfo    @@c -*-texinfo-*-
12231 @@c %**start of header
12232 @@setfilename texinfo
12233 @@settitle Texinfo
12234 @@syncodeindex vr fn
12235 @@iftex
12236 @@afourpaper
12237 @@end iftex
12238 @@c %**end of header
12239 @end group
12240 @end example
12241
12242 @node Cropmarks and Magnification, , A4 Paper, Format/Print Hardcopy
12243 @comment  node-name,  next,  previous,  up
12244 @section Cropmarks and Magnification
12245
12246 @findex cropmarks
12247 @cindex Cropmarks for printing
12248 @cindex Printing cropmarks
12249 You can attempt to direct @TeX{} to print cropmarks at the corners of
12250 pages with the @code{@@cropmarks} command.  Write the @code{@@cropmarks}
12251 command on a line by itself between @code{@@iftex} and @code{@@end
12252 iftex} lines near the beginning of the Texinfo file, before the title
12253 page, like this:@refill
12254
12255 @example
12256 @group
12257 @@iftex
12258 @@cropmarks
12259 @@end iftex
12260 @end group
12261 @end example
12262
12263 This command is mainly for printers that typeset several pages on one
12264 sheet of film; but you can attempt to use it to mark the corners of a
12265 book set to 7 by 9.25 inches with the @code{@@smallbook} command.
12266 (Printers will not produce cropmarks for regular sized output that is
12267 printed on regular sized paper.)  Since different printing machines work
12268 in different ways, you should explore the use of this command with a
12269 spirit of adventure.  You may have to redefine the command in the
12270 @file{texinfo.tex} definitions file.@refill
12271
12272 @findex mag @r{(@TeX{} command)}
12273 @cindex Magnified printing
12274 @cindex Larger or smaller pages
12275 You can attempt to direct @TeX{} to typeset pages larger or smaller than
12276 usual with the @code{\mag} @TeX{} command.  Everything that is typeset
12277 is scaled proportionally larger or smaller.  (@code{\mag} stands for
12278 ``magnification''.)  This is @emph{not} a Texinfo @@-command, but is a
12279 plain @TeX{} command that is prefixed with a backslash.  You have to
12280 write this command between @code{@@tex} and @code{@@end tex}
12281 (@pxref{Using Ordinary TeX Commands, , Using Ordinary @TeX{}
12282 Commands}).@refill
12283
12284 Follow the @code{\mag} command with an @samp{=} and then a number that
12285 is 1000 times the magnification you desire.  For example, to print pages
12286 at 1.2 normal size, write the following near the beginning of the
12287 Texinfo file, before the title page:@refill
12288
12289 @example
12290 @group
12291 @@tex
12292 \mag=1200
12293 @@end tex
12294 @end group
12295 @end example
12296
12297 With some printing technologies, you can print normal-sized copies that
12298 look better than usual by using a larger-than-normal master.@refill
12299
12300 Depending on your system, @code{\mag} may not work or may work only at
12301 certain magnifications.  Be prepared to experiment.@refill
12302
12303 @node Create an Info File, Install an Info File, Format/Print Hardcopy, Top
12304 @comment  node-name,  next,  previous,  up
12305 @chapter Creating an Info File
12306 @cindex Creating an Info file
12307 @cindex Info, creating an on-line file
12308 @cindex Formatting a file for Info
12309
12310 @code{makeinfo} is a utility that converts a Texinfo file into an Info
12311 file; @code{texinfo-format-region} and @code{texinfo-format-buffer} are
12312 GNU Emacs functions that do the same.@refill
12313
12314 A Texinfo file must possess an @code{@@setfilename} line near its
12315 beginning, otherwise the Info formatting commands will fail.@refill
12316
12317 For information on installing the Info file in the Info system, see
12318 @ref{Install an Info File}.@refill
12319
12320 @menu
12321 * makeinfo advantages::         @code{makeinfo} provides better error checking.
12322 * Invoking makeinfo::           How to run @code{makeinfo} from a shell.
12323 * makeinfo options::            Specify fill-column and other options.
12324 * Pointer Validation::          How to check that pointers point somewhere.
12325 * makeinfo in Emacs::           How to run @code{makeinfo} from Emacs.
12326 * texinfo-format commands::     Two Info formatting commands written
12327                                   in Emacs Lisp are an alternative
12328                                   to @code{makeinfo}.
12329 * Batch Formatting::            How to format for Info in Emacs Batch mode.
12330 * Tag and Split Files::         How tagged and split files help Info
12331                                   to run better.
12332 @end menu
12333
12334 @node makeinfo advantages, Invoking makeinfo, Create an Info File, Create an Info File
12335 @ifinfo
12336 @heading @code{makeinfo} Preferred
12337 @end ifinfo
12338
12339 The @code{makeinfo} utility creates an Info file from a Texinfo source
12340 file more quickly than either of the Emacs formatting commands and
12341 provides better error messages.  We recommend it.  @code{makeinfo} is a
12342 C program that is independent of Emacs.  You do not need to run Emacs to
12343 use @code{makeinfo}, which means you can use @code{makeinfo} on machines
12344 that are too small to run Emacs. You can run @code{makeinfo} in
12345 any one of three ways: from an operating system shell, from a shell
12346 inside Emacs, or by typing a key command in Texinfo mode in Emacs.
12347 @refill
12348
12349 The @code{texinfo-format-region} and the @code{texinfo-format-buffer}
12350 commands are useful if you cannot run @code{makeinfo}.  Also, in some
12351 circumstances, they format short regions or buffers more quickly than
12352 @code{makeinfo}.@refill
12353
12354 @node Invoking makeinfo, makeinfo options, makeinfo advantages, Create an Info File
12355 @section Running @code{makeinfo} from a Shell
12356
12357 To create an Info file from a Texinfo file, type @code{makeinfo}
12358 followed by the name of the Texinfo file.  Thus, to create the Info
12359 file for Bison, type the following at the shell prompt (where @samp{%}
12360 is the prompt):@refill
12361
12362 @example
12363 % makeinfo bison.texinfo
12364 @end example
12365
12366 (You can run a shell inside Emacs by typing @kbd{M-x
12367 shell}.)@refill
12368
12369 @ifinfo
12370 Sometimes you will want to specify options.  For example, if you wish
12371 to discover which version of @code{makeinfo} you are using,
12372 type:@refill
12373
12374 @example
12375 % makeinfo --version
12376 @end example
12377
12378 @xref{makeinfo options}, for more information.
12379 @end ifinfo
12380
12381 @node makeinfo options, Pointer Validation, Invoking makeinfo, Create an Info File
12382 @comment  node-name,  next,  previous,  up
12383 @section Options for @code{makeinfo}
12384 @cindex @code{makeinfo} options
12385 @cindex Options for @code{makeinfo}
12386
12387 The @code{makeinfo} command takes a number of options.  Most often,
12388 options are used to set the value of the fill column and specify the
12389 footnote style.  Each command line option is a word preceded by
12390 @samp{--}@footnote{@samp{--} has replaced @samp{+}, the old introductory
12391 character, to maintain POSIX.2 compatibility without losing long-named
12392 options.} or a letter preceded by @samp{-}.  You can use abbreviations
12393 for the option names as long as they are unique.@refill
12394
12395 For example, you could use the following command to create an Info
12396 file for @file{bison.texinfo} in which each line is filled to only 68
12397 columns (where @samp{%} is the prompt):@refill
12398
12399 @example
12400 % makeinfo --fill-column=68 bison.texinfo
12401 @end example
12402
12403 You can write two or more options in sequence, like this:@refill
12404
12405 @example
12406 % makeinfo --no-split --fill-column=70 @dots{}
12407 @end example
12408
12409 @noindent
12410 This would keep the Info file together as one possibly very long
12411 file and would also set the fill column to 70.@refill
12412
12413 @iftex
12414 If you wish to discover which version of @code{makeinfo}
12415 you are using, type:@refill
12416
12417 @example
12418 % makeinfo --version
12419 @end example
12420 @end iftex
12421
12422 The options are:@refill
12423
12424 @need 100
12425 @table @code
12426 @item -D @var{var}
12427 Cause @var{var} to be defined.  This is equivalent to
12428 @code{@@set @var{var}} in the Texinfo file.
12429
12430 @need 150
12431 @item --error-limit @var{limit}
12432 Set the maximum number of errors that @code{makeinfo} will report
12433 before exiting (on the assumption that continuing would be useless).
12434 The default number of errors that can be reported before
12435 @code{makeinfo} gives up is 100.@refill
12436
12437 @need 150
12438 @item --fill-column @var{width}
12439 Specify the maximum number of columns in a line; this is the right-hand
12440 edge of a line.  Paragraphs that are filled will be filled to this
12441 width.  (Filling is the process of breaking up and connecting lines so
12442 that lines are the same length as or shorter than the number specified
12443 as the fill column.  Lines are broken between words.) The default value
12444 for @code{fill-column} is 72.
12445 @refill
12446
12447 @item --footnote-style @var{style}
12448 Set the footnote style to @var{style}, either @samp{end} for the end
12449 node style or @samp{separate} for the separate node style.  The value
12450 set by this option overrides the value set in a Texinfo file by an
12451 @code{@@footnotestyle} command.  When the footnote style is
12452 @samp{separate}, @code{makeinfo} makes a new node containing the
12453 footnotes found in the current node.  When the footnote style is
12454 @samp{end}, @code{makeinfo} places the footnote references at the end
12455 of the current node.@refill
12456
12457 @need 150
12458 @item -I @var{dir}
12459 Add @code{dir} to the directory search list for finding files that are
12460 included using the @code{@@include} command.  By default,
12461 @code{makeinfo} searches only the current directory.
12462
12463 @need 150
12464 @item --no-headers
12465 Do not include menus or node lines in the output.  This results in an
12466 @sc{ascii} file that you cannot read in Info since it does not contain
12467 the requisite nodes or menus; but you can print such a file in a
12468 single, typewriter-like font and produce acceptable output.
12469
12470 @need 150
12471 @item --no-split
12472 Suppress the splitting stage of @code{makeinfo}.  Normally, large
12473 output files (where the size is greater than 70k bytes) are split into
12474 smaller subfiles, each one approximately 50k bytes.  If you specify
12475 @samp{--no-split}, @code{makeinfo} will not split up the output
12476 file.@refill
12477
12478 @need 100
12479 @item --no-pointer-validate
12480 @item --no-validate
12481 Suppress the pointer-validation phase of @code{makeinfo}.  Normally,
12482 after a Texinfo file is processed, some consistency checks are made to
12483 ensure that cross references can be resolved, etc.
12484 @xref{Pointer Validation}.@refill
12485
12486 @need 150
12487 @item --no-warn
12488 Suppress the output of warning messages.  This does @emph{not}
12489 suppress the output of error messages, only warnings.  You might
12490 want this if the file you are creating has examples of Texinfo cross
12491 references within it, and the nodes that are referenced do not actually
12492 exist.@refill
12493
12494 @item --no-number-footnotes
12495 Suppress automatic footnote numbering.  By default, @code{makeinfo}
12496 numbers each footnote sequentially in a single node, resetting the
12497 current footnote number to 1 at the start of each node.
12498
12499 @need 150
12500 @item --output @var{file}
12501 @itemx -o @var{file}
12502 Specify that the output should be directed to @var{file} and not to the
12503 file name specified in the @code{@@setfilename} command found in the Texinfo
12504 source.  @var{file} can be the special token @samp{-}, which specifies
12505 standard output.
12506
12507 @need 150
12508 @item --paragraph-indent @var{indent}
12509 Set the paragraph indentation style to @var{indent}.  The value set by
12510 this option overrides the value set in a Texinfo file by an
12511 @code{@@paragraphindent} command.  The value of @var{indent} is
12512 interpreted as follows:@refill
12513
12514 @itemize @bullet
12515 @item
12516 If the value of @var{indent} is @samp{asis}, do not change the
12517 existing indentation at the starts of paragraphs.@refill
12518
12519 @item
12520 If the value of @var{indent} is zero, delete any existing
12521 indentation.@refill
12522
12523 @item
12524 If the value of @var{indent} is greater than zero, indent each
12525 paragraph by that number of spaces.@refill
12526 @end itemize
12527
12528 @need 100
12529 @item --reference-limit @var{limit}
12530 Set the value of the number of references to a node that
12531 @code{makeinfo} will make without reporting a warning.  If a node has more
12532 than this number of references in it, @code{makeinfo} will make the
12533 references but also report a warning.@refill
12534
12535 @need 150
12536 @item -U @var{var}
12537 Cause @var{var} to be undefined.  This is equivalent to
12538 @code{@@clear @var{var}} in the Texinfo file.
12539
12540 @need 100
12541 @item --verbose
12542 Cause @code{makeinfo} to display messages saying what it is doing.
12543 Normally, @code{makeinfo} only outputs messages if there are errors or
12544 warnings.@refill
12545
12546 @need 100
12547 @item --version
12548 Report the version number of this copy of @code{makeinfo}.@refill
12549 @end table
12550
12551 @node Pointer Validation, makeinfo in Emacs, makeinfo options, Create an Info File
12552 @section Pointer Validation
12553 @cindex Pointer validation with @code{makeinfo}
12554 @cindex Validation of pointers
12555
12556 If you do not suppress pointer-validation, @code{makeinfo} will check
12557 the validity of the final Info file.  Mostly, this means ensuring that
12558 nodes you have referenced really exist.  Here is a complete list of what
12559 is checked:@refill
12560
12561 @enumerate
12562 @item
12563 If a `Next', `Previous', or `Up' node reference is a reference to a
12564 node in the current file and is not an external reference such as to
12565 @file{(dir)}, then the referenced node must exist.@refill
12566
12567 @item
12568 In every node, if the `Previous' node is different from the `Up' node,
12569 then the `Previous' node must also be pointed to by a `Next' node.@refill
12570
12571 @item
12572 Every node except the `Top' node must have an `Up' pointer.@refill
12573
12574 @item
12575 The node referenced by an `Up' pointer must contain a reference to the
12576 current node in some manner other than through a `Next' reference.
12577 This includes menu entries and cross references.@refill
12578
12579 @item
12580 If the `Next' reference of a node is not the same as the `Next' reference
12581 of the `Up' reference, then the node referenced by the `Next' pointer
12582 must have a `Previous' pointer that points back to the current node.
12583 This rule allows the last node in a section to point to the first node
12584 of the next chapter.@refill
12585 @end enumerate
12586
12587 @node makeinfo in Emacs, texinfo-format commands, Pointer Validation, Create an Info File
12588 @section Running @code{makeinfo} inside Emacs
12589 @cindex Running @code{makeinfo} in Emacs
12590 @cindex @code{makeinfo} inside Emacs
12591 @cindex Shell, running @code{makeinfo} in
12592
12593 You can run @code{makeinfo} in GNU Emacs Texinfo mode by using either the
12594 @code{makeinfo-region} or the @code{makeinfo-buffer} commands.  In
12595 Texinfo mode, the commands are bound to @kbd{C-c C-m C-r} and @kbd{C-c
12596 C-m C-b} by default.@refill
12597
12598 @table @kbd
12599 @item C-c C-m C-r
12600 @itemx M-x makeinfo-region
12601 Format the current region for Info.@refill
12602 @findex makeinfo-region
12603
12604 @item C-c C-m C-b
12605 @itemx M-x makeinfo-buffer
12606 Format the current buffer for Info.@refill
12607 @findex makeinfo-buffer
12608 @end table
12609
12610 When you invoke either @code{makeinfo-region} or
12611 @code{makeinfo-buffer}, Emacs prompts for a file name, offering the
12612 name of the visited file as the default.  You can edit the default
12613 file name in the minibuffer if you wish, before typing @key{RET} to
12614 start the @code{makeinfo} process.@refill
12615
12616 The Emacs @code{makeinfo-region} and @code{makeinfo-buffer} commands
12617 run the @code{makeinfo} program in a temporary shell buffer.  If
12618 @code{makeinfo} finds any errors, Emacs displays the error messages in
12619 the temporary buffer.@refill
12620
12621 @cindex Errors, parsing
12622 @cindex Parsing errors
12623 @findex next-error
12624 You can parse the error messages by typing @kbd{C-x `}
12625 (@code{next-error}).  This causes Emacs to go to and position the
12626 cursor on the line in the Texinfo source that @code{makeinfo} thinks
12627 caused the error.  @xref{Compilation, , Running @code{make} or
12628 Compilers Generally, emacs, The GNU Emacs Manual}, for more
12629 information about using the @code{next-error} command.@refill
12630
12631 In addition, you can kill the shell in which the @code{makeinfo}
12632 command is running or make the shell buffer display its most recent
12633 output.@refill
12634
12635 @table @kbd
12636 @item C-c C-m C-k
12637 @itemx M-x makeinfo-kill-job
12638 @findex makeinfo-kill-job
12639 Kill the current running @code{makeinfo} job created by
12640 @code{makeinfo-region} or @code{makeinfo-buffer}.@refill
12641
12642 @item C-c C-m C-l
12643 @itemx M-x makeinfo-recenter-output-buffer
12644 @findex makeinfo-recenter-output-buffer
12645 Redisplay the @code{makeinfo} shell buffer to display its most recent
12646 output.@refill
12647 @end table
12648
12649 @noindent
12650 (Note that the parallel commands for killing and recentering a @TeX{}
12651 job are @kbd{C-c C-t C-k} and @kbd{C-c C-t C-l}.  @xref{Texinfo Mode
12652 Printing}.)@refill
12653
12654 You can specify options for @code{makeinfo} by setting the
12655 @code{makeinfo-options} variable with either the @kbd{M-x
12656 edit-options} or the @kbd{M-x set-variable} command, or by setting the
12657 variable in your @file{.emacs} initialization file.@refill
12658
12659 For example, you could write the following in your @file{.emacs} file:@refill
12660
12661 @example
12662 @group
12663 (setq makeinfo-options
12664       "--paragraph-indent=0 --no-split
12665        --fill-column=70 --verbose")
12666 @end group
12667 @end example
12668
12669 @c If you write these three cross references using xref, you see
12670 @c three references to the same named manual, which looks strange.
12671 @iftex
12672 For more information, see @ref{makeinfo options, , Options for
12673 @code{makeinfo}}, as well as ``Editing Variable Values,''``Examining and
12674 Setting Variables,'' and ``Init File'' in the @cite{The GNU Emacs
12675 Manual}.
12676 @end iftex
12677 @noindent
12678 @ifinfo
12679 For more information, see@*
12680 @ref{Edit Options, , Editing Variable Values, emacs, The GNU Emacs Manual},@*
12681 @ref{Examining, , Examining and Setting Variables, emacs, The GNU Emacs Manual},@*
12682 @ref{Init File, , , emacs, The GNU Emacs Manual}, and@*
12683 @ref{makeinfo options, , Options for @code{makeinfo}}.
12684 @end ifinfo
12685
12686 @node texinfo-format commands, Batch Formatting, makeinfo in Emacs, Create an Info File
12687 @comment  node-name,  next,  previous,  up
12688 @section The @code{texinfo-format@dots{}} Commands
12689 @findex texinfo-format-region
12690 @findex texinfo-format-buffer
12691
12692 In GNU Emacs in Texinfo mode, you can format part or all of a Texinfo
12693 file with the @code{texinfo-format-region} command.  This formats the
12694 current region and displays the formatted text in a temporary buffer
12695 called @samp{*Info Region*}.@refill
12696
12697 Similarly, you can format a buffer with the
12698 @code{texinfo-format-buffer} command.  This command creates a new
12699 buffer and generates the Info file in it.  Typing @kbd{C-x C-s} will
12700 save the Info file under the name specified by the
12701 @code{@@setfilename} line which must be near the beginning of the
12702 Texinfo file.@refill
12703
12704 @table @kbd
12705 @item C-c C-e C-r
12706 @itemx @code{texinfo-format-region}
12707 Format the current region for Info.
12708 @findex texinfo-format-region
12709
12710 @item C-c C-e C-b
12711 @itemx @code{texinfo-format-buffer}
12712 Format the current buffer for Info.
12713 @findex texinfo-format-buffer
12714 @end table
12715
12716 The @code{texinfo-format-region} and @code{texinfo-format-buffer}
12717 commands provide you with some error checking, and other functions can
12718 provide you with further help in finding formatting errors.  These
12719 procedures are described in an appendix; see @ref{Catching Mistakes}.
12720 However, the @code{makeinfo} program is often faster and
12721 provides better error checking (@pxref{makeinfo in Emacs}).@refill
12722
12723 @node Batch Formatting, Tag and Split Files, texinfo-format commands, Create an Info File
12724 @comment  node-name,  next,  previous,  up
12725 @section Batch Formatting
12726 @cindex Batch formatting for Info
12727 @cindex Info batch formatting
12728
12729 You can format Texinfo files for Info using @code{batch-texinfo-format}
12730 and Emacs Batch mode.  You can run Emacs in Batch mode from any shell,
12731 including a shell inside of Emacs.  (@xref{Command Switches, , Command
12732 Line Switches and Arguments, emacs, The GNU Emacs Manual}.)@refill
12733
12734 Here is the command to format all the files that end in @file{.texinfo}
12735 in the current directory (where @samp{%} is the shell prompt):@refill
12736
12737 @example
12738 % emacs -batch -funcall batch-texinfo-format *.texinfo
12739 @end example
12740
12741 @noindent
12742 Emacs processes all the files listed on the command line, even if an
12743 error occurs while attempting to format some of them.@refill
12744
12745 Run @code{batch-texinfo-format} only with Emacs in Batch mode as shown;
12746 it is not interactive.  It kills the Batch mode Emacs on completion.@refill
12747
12748 @code{batch-texinfo-format} is convenient if you lack @code{makeinfo}
12749 and want to format several Texinfo files at once.  When you use Batch
12750 mode, you create a new Emacs process.  This frees your current Emacs, so
12751 you can continue working in it.  (When you run
12752 @code{texinfo-format-region} or @code{texinfo-format-buffer}, you cannot
12753 use that Emacs for anything else until the command finishes.)@refill
12754
12755 @node Tag and Split Files, , Batch Formatting, Create an Info File
12756 @comment  node-name,  next,  previous,  up
12757 @section Tag Files and Split Files
12758 @cindex Making a tag table automatically
12759 @cindex Tag table, making automatically
12760
12761 If a Texinfo file has more than 30,000 bytes,
12762 @code{texinfo-format-buffer} automatically creates a tag table
12763 for its Info file;  @code{makeinfo} always creates a tag table.  With
12764 a @dfn{tag table}, Info can jump to new nodes more quickly than it can
12765 otherwise.@refill
12766
12767 @cindex Indirect subfiles
12768 In addition, if the Texinfo file contains more than about 70,000
12769 bytes, @code{texinfo-format-buffer} and @code{makeinfo} split the
12770 large Info file into shorter @dfn{indirect} subfiles of about 50,000
12771 bytes each.  Big files are split into smaller files so that Emacs does
12772 not need to make a large buffer to hold the whole of a large Info
12773 file; instead, Emacs allocates just enough memory for the small, split
12774 off file that is needed at the time.  This way, Emacs avoids wasting
12775 memory when you run Info.  (Before splitting was implemented, Info
12776 files were always kept short and @dfn{include files} were designed as
12777 a way to create a single, large printed manual out of the smaller Info
12778 files.  @xref{Include Files}, for more information.  Include files are
12779 still used for very large documents, such as @cite{The Emacs Lisp
12780 Reference Manual}, in which each chapter is a separate file.)@refill
12781
12782 When a file is split, Info itself makes use of a shortened version of
12783 the original file that contains just the tag table and references to
12784 the files that were split off.  The split off files are called
12785 @dfn{indirect} files.@refill
12786
12787 The split off files have names that are created by appending @w{@samp{-1}},
12788 @w{@samp{-2}}, @w{@samp{-3}} and so on to the file name specified by the
12789 @code{@@setfilename} command.  The shortened version of the original file
12790 continues to have the name specified by @code{@@setfilename}.@refill
12791
12792 At one stage in writing this document, for example, the Info file was saved
12793 as @file{test-texinfo} and that file looked like this:@refill
12794
12795 @example
12796 @group
12797 Info file: test-texinfo,    -*-Text-*-
12798 produced by texinfo-format-buffer
12799 from file: new-texinfo-manual.texinfo
12800
12801 ^_
12802 Indirect:
12803 test-texinfo-1: 102
12804 test-texinfo-2: 50422
12805 @end group
12806 @group
12807 test-texinfo-3: 101300
12808 ^_^L
12809 Tag table:
12810 (Indirect)
12811 Node: overview^?104
12812 Node: info file^?1271
12813 @end group
12814 @group
12815 Node: printed manual^?4853
12816 Node: conventions^?6855
12817 @dots{}
12818 @end group
12819 @end example
12820
12821 @noindent
12822 (But @file{test-texinfo} had far more nodes than are shown here.)  Each of
12823 the split off, indirect files, @file{test-texinfo-1},
12824 @file{test-texinfo-2}, and @file{test-texinfo-3}, is listed in this file
12825 after the line that says @samp{Indirect:}.  The tag table is listed after
12826 the line that says @samp{Tag table:}. @refill
12827
12828 In the list of indirect files, the number following the file name
12829 records the cumulative number of bytes in the preceding indirect files,
12830 not counting the file list itself, the tag table, or the permissions
12831 text in each file.  In the tag table, the number following the node name
12832 records the location of the beginning of the node, in bytes from the
12833 beginning.@refill
12834
12835 If you are using @code{texinfo-format-buffer} to create Info files,
12836 you may want to run the @code{Info-validate} command.  (The
12837 @code{makeinfo} command does such a good job on its own, you do not
12838 need @code{Info-validate}.)  However, you cannot run the @kbd{M-x
12839 Info-validate} node-checking command on indirect files.  For
12840 information on how to prevent files from being split and how to
12841 validate the structure of the nodes, see @ref{Using
12842 Info-validate}.@refill
12843
12844
12845 @node Install an Info File, Command List, Create an Info File, Top
12846 @comment  node-name,  next,  previous,  up
12847 @chapter Installing an Info File
12848 @cindex Installing an Info file
12849 @cindex Info file installation
12850 @cindex @file{dir} directory for Info installation
12851
12852 Info files are usually kept in the @file{info} directory.  You can read
12853 Info files using the standalone Info program or the Info reader built
12854 into Emacs.  (@inforef{Top, info, info}, for an introduction to Info.)
12855
12856 @menu
12857 * Directory file::              The top level menu for all Info files.
12858 * New Info File::               Listing a new info file.
12859 * Other Info Directories::      How to specify Info files that are
12860                                   located in other directories.
12861 * Installing Dir Entries::      How to specify what menu entry to add
12862                                   to the Info directory.
12863 * Invoking install-info::       @code{install-info} options.
12864 @end menu
12865
12866 @node Directory file, New Info File, Install an Info File, Install an Info File
12867 @ifinfo
12868 @heading The @file{dir} File
12869 @end ifinfo
12870
12871 For Info to work, the @file{info} directory must contain a file that
12872 serves as a top level directory for the Info system.  By convention,
12873 this file is called @file{dir}.  (You can find the location of this file
12874 within Emacs by typing @kbd{C-h i} to enter Info and then typing
12875 @kbd{C-x C-f} to see the pathname to the @file{info} directory.)
12876
12877 The @file{dir} file is itself an Info file.  It contains the top level
12878 menu for all the Info files in the system.  The menu looks like
12879 this:@refill
12880
12881 @example
12882 @group
12883 * Menu:
12884
12885 * Info:    (info).     Documentation browsing system.
12886 * Emacs:   (emacs).    The extensible, self-documenting
12887                        text editor.
12888 * Texinfo: (texinfo).  With one source file, make
12889                        either a printed manual using
12890                        TeX or an Info file.
12891 @dots{}
12892 @end group
12893 @end example
12894
12895 Each of these menu entries points to the `Top' node of the Info file
12896 that is named in parentheses.  (The menu entry does not need to
12897 specify the `Top' node, since Info goes to the `Top' node if no node
12898 name is mentioned.  @xref{Other Info Files, , Nodes in Other Info
12899 Files}.)@refill
12900
12901 Thus, the @samp{Info} entry points to the `Top' node of the
12902 @file{info} file and the @samp{Emacs} entry points to the `Top' node
12903 of the @file{emacs} file.@refill
12904
12905 In each of the Info files, the `Up' pointer of the `Top' node refers
12906 back to the @code{dir} file.  For example, the line for the `Top'
12907 node of the Emacs manual looks like this in Info:@refill
12908
12909 @example
12910 File: emacs  Node: Top, Up: (DIR), Next: Distrib
12911 @end example
12912
12913 @noindent
12914 (Note that in this case, the @file{dir} file name is written in upper
12915 case letters---it can be written in either upper or lower case.  Info
12916 has a feature that it will change the case of the file name to lower
12917 case if it cannot find the name as written.)@refill
12918 @c !!! Can any file name be written in upper or lower case,
12919 @c     or is dir a special case?
12920 @c     Yes, apparently so, at least with Gillespie's Info.  --rjc 24mar92
12921
12922
12923 @node New Info File, Other Info Directories, Directory file, Install an Info File
12924 @section Listing a New Info File
12925 @cindex Adding a new info file
12926 @cindex Listing a new info file
12927 @cindex New info file, listing it in @file{dir} file
12928 @cindex Info file, listing new one
12929 @cindex @file{dir} file listing
12930
12931 To add a new Info file to your system, you must write a menu entry to
12932 add to the menu in the @file{dir} file in the @file{info} directory.
12933 For example, if you were adding documentation for GDB, you would write
12934 the following new entry:@refill
12935
12936 @example
12937 * GDB: (gdb).           The source-level C debugger.
12938 @end example
12939
12940 @noindent
12941 The first part of the menu entry is the menu entry name, followed by a
12942 colon.  The second part is the name of the Info file, in parentheses,
12943 followed by a period.  The third part is the description.
12944
12945 The name of an Info file often has a @file{.info} extension.  Thus, the
12946 Info file for GDB might be called either @file{gdb} or @file{gdb.info}.
12947 The Info reader programs automatically try the file name both with and
12948 without @file{.info}; so it is better to avoid clutter and not to write
12949 @samp{.info} explicitly in the menu entry.  For example, the GDB menu
12950 entry should use just @samp{gdb} for the file name, not @samp{gdb.info}.
12951
12952
12953 @node Other Info Directories, Installing Dir Entries, New Info File, Install an Info File
12954 @comment  node-name,  next,  previous,  up
12955 @section Info Files in Other Directories
12956 @cindex Installing Info in another directory
12957 @cindex Info installed in another directory
12958 @cindex Another Info directory
12959
12960 If an Info file is not in the @file{info} directory, there are three
12961 ways to specify its location:@refill
12962
12963 @itemize @bullet
12964 @item
12965 Write the pathname in the @file{dir} file as the second part of the
12966 menu.@refill
12967
12968 @item
12969 If you are using Emacs, list the name of the file in a second @file{dir}
12970 file, in its directory; and then add the name of that directory to the
12971 @code{Info-directory-list} variable in your personal or site
12972 initialization file.
12973
12974 This tells Emacs's Info reader where to look for @file{dir}
12975 files.  Emacs merges the files named @file{dir} from each of the listed
12976 directories.  (In Emacs Version 18, you can set the
12977 @code{Info-directory} variable to the name of only one
12978 directory.)@refill
12979
12980 @item
12981 Specify the @file{info} directory name in the @code{INFOPATH}
12982 environment variable in your @file{.profile} or @file{.cshrc}
12983 initialization file.  (Only you and others who set this environment
12984 variable will be able to find Info files whose location is specified
12985 this way.)@refill
12986 @end itemize
12987
12988 For example, to reach a test file in the @file{~bob/manuals}
12989 directory, you could add an entry like this to the menu in the
12990 @file{dir} file:@refill
12991
12992 @example
12993 * Test: (/home/bob/manuals/info-test).  Bob's own test file.
12994 @end example
12995
12996 @noindent
12997 In this case, the absolute file name of the @file{info-test} file is
12998 written as the second part of the menu entry.@refill
12999
13000 @vindex Info-directory-list
13001 Alternatively, you could write the following in your @file{.emacs}
13002 file:@refill
13003
13004 @example
13005 @group
13006 (setq Info-directory-list
13007       '("/home/bob/manuals"
13008         "/usr/local/emacs/info"))
13009 @end group
13010 @end example
13011
13012 @c reworded to avoid overfill hbox
13013 This tells Emacs to merge the @file{dir} file from the
13014 @file{/home/bob/manuals} directory with the @file{dir} file from the
13015 @file{"/usr/local/emacs/info}" directory.  Info will list the
13016 @file{/home/bob/manuals/info-test} file as a menu entry in the
13017 @file{/home/bob/manuals/dir} file.@refill
13018
13019 @vindex INFOPATH
13020 Finally, you can tell Info where to look by setting the
13021 @code{INFOPATH} environment variable in your @file{.cshrc} or
13022 @file{.profile} file.@refill
13023
13024 If you use @code{sh} or @code{bash} for your shell command interpreter,
13025 you must set the @code{INFOPATH} environment variable in the
13026 @file{.profile} initialization file; but if you use @code{csh}, you must
13027 set the variable in the @file{.cshrc} initialization file.  The two
13028 files use slightly different command formats.@refill
13029
13030 @itemize @bullet
13031 @item
13032 In a @file{.cshrc} file, you could set the @code{INFOPATH}
13033 variable as follows:@refill
13034
13035 @smallexample
13036 setenv INFOPATH .:~bob/manuals:/usr/local/emacs/info
13037 @end smallexample
13038
13039 @item
13040 In a @file{.profile} file, you would achieve the same effect by
13041 writing:@refill
13042
13043 @smallexample
13044 INFOPATH=.:~bob/manuals:/usr/local/emacs/info
13045 export INFOPATH
13046 @end smallexample
13047 @end itemize
13048
13049 @noindent
13050 The @samp{.}  indicates the current directory.  Emacs uses the
13051 @code{INFOPATH} environment variable to initialize the value of Emacs's
13052 own @code{Info-directory-list} variable.
13053
13054
13055 @node Installing Dir Entries, Invoking install-info, Other Info Directories, Install an Info File
13056 @section Installing Info Directory Files
13057
13058 When you install an Info file onto your system, you can use the program
13059 @code{install-info} to update the Info directory file @file{dir}.
13060 Normally the makefile for the package runs @code{install-info}, just
13061 after copying the Info file into its proper installed location.
13062
13063 @findex dircategory
13064 @findex direntry
13065 In order for the Info file to work with @code{install-info}, you should
13066 use the commands @code{@@dircategory} and @code{@@direntry} in the
13067 Texinfo source file.  Use @code{@@direntry} to specify the menu entry to
13068 add to the Info directory file, and use @code{@@dircategory} to specify
13069 which part of the Info directory to put it in.  Here is how these
13070 commands are used in this manual:
13071
13072 @smallexample
13073 @@dircategory Texinfo documentation system
13074 @@direntry
13075 * Texinfo: (texinfo).           The GNU documentation format.
13076 * install-info: (texinfo)Invoking install-info. @dots{}
13077 @dots{}
13078 @@end direntry
13079 @end smallexample
13080
13081 Here's what this produces in the Info file:
13082
13083 @smallexample
13084 INFO-DIR-SECTION Texinfo documentation system
13085 START-INFO-DIR-ENTRY
13086 * Texinfo: (texinfo).           The GNU documentation format.
13087 * install-info: (texinfo)Invoking install-info. @dots{}
13088 @dots{}
13089 END-INFO-DIR-ENTRY
13090 @end smallexample
13091
13092 @noindent
13093 The @code{install-info} program sees these lines in the Info file, and
13094 that is how it knows what to do.
13095
13096 Always use the @code{@@direntry} and @code{@@dircategory} commands near
13097 the beginning of the Texinfo input, before the first @code{@@node}
13098 command.  If you use them later on in the input, @code{install-info}
13099 will not notice them.
13100
13101 If you use @code{@@dircategory} more than once in the Texinfo source,
13102 each usage specifies one category; the new menu entry is added to the
13103 Info directory file in each of the categories you specify.  If you use
13104 @code{@@direntry} more than once, each usage specifies one menu entry;
13105 each of these menu entries is added to the directory in each of the
13106 specified categories.
13107
13108
13109 @node Invoking install-info, , Installing Dir Entries, Install an Info File
13110 @section Invoking install-info
13111
13112 @pindex install-info
13113
13114 @code{install-info} inserts menu entries from an Info file into the
13115 top-level @file{dir} file in the Info system (see the previous sections
13116 for an explanation of how the @file{dir} file works).  It's most often
13117 run as part of software installation, or when constructing a dir file
13118 for all manuals on a system.  Synopsis:
13119
13120 @example
13121 install-info [@var{option}]@dots{} [@var{info-file} [@var{dir-file}]]
13122 @end example
13123
13124 If @var{info-file} or @var{dir-file} are not specified, the various
13125 options (described below) that define them must be.  There are no
13126 compile-time defaults, and standard input is never used.
13127 @code{install-info} can read only one info file and write only one dir
13128 file per invocation.
13129
13130 Options:
13131
13132 @table @samp
13133 @item --delete
13134 @opindex --delete
13135 Only delete existing entries in @var{info-file}; don't insert any new
13136 entries.
13137
13138 @item --dir-file=@var{name}
13139 @opindex --dir-file=@var{name}
13140 Specify file name of the Info directory file.  This is equivalent to
13141 using the @var{dir-file} argument.
13142
13143 @item --entry=@var{text}
13144 @opindex --entry=@var{text}
13145 Insert @var{text} as an Info directory entry; @var{text} should have the
13146 form of an Info menu item line plus zero or more extra lines starting
13147 with whitespace.  If you specify more than one entry, they are all
13148 added.  If you don't specify any entries, they are determined from
13149 information in the Info file itself.
13150
13151 @item --help
13152 @opindex --help
13153 Display a usage message listing basic usage and all available options,
13154 then exit successfully.
13155
13156 @item --info-file=@var{file}
13157 @opindex --info-file=@var{file}
13158 Specify Info file to install in the directory.
13159 This is equivalent to using the @var{info-file} argument.
13160
13161 @item --info-dir=@var{dir}
13162 @opindex --info-dir=@var{dir}
13163 Equivalent to @samp{--dir-file=@var{dir}/dir}.
13164
13165 @item --item=@var{text}
13166 @opindex --item=@var{text}
13167 Same as --entry=@var{text}.  An Info directory entry is actually a menu
13168 item.
13169
13170 @item --quiet
13171 @opindex --quiet
13172 Suppress warnings.
13173
13174 @item --remove
13175 @opindex --remove
13176 Same as --delete.
13177
13178 @item --section=@var{sec}
13179 @opindex --section=@var{sec}
13180 Put this file's entries in section @var{sec} of the directory.  If you
13181 specify more than one section, all the entries are added in each of the
13182 sections.  If you don't specify any sections, they are determined from
13183 information in the Info file itself.
13184
13185 @item --version
13186 @opindex --version
13187 @cindex version number, finding
13188 Display version information and exit successfully.
13189
13190 @end table
13191
13192
13193 @c ================ Appendix starts here ================
13194
13195 @node Command List, Tips, Install an Info File, Top
13196 @appendix @@-Command List
13197 @cindex Alphabetical @@-command list
13198 @cindex List of  @@-commands
13199 @cindex @@-command list
13200
13201 Here is an alphabetical list of the @@-commands in Texinfo.  Square
13202 brackets, @t{[}@w{ }@t{]}, indicate optional arguments; an ellipsis,
13203 @samp{@dots{}}, indicates repeated text.@refill
13204
13205 @sp 1
13206 @table @code
13207 @item @@@var{whitespace}
13208 An @code{@@} followed by a space, tab, or newline produces a normal,
13209 stretchable, interword space.  @xref{Multiple Spaces}.
13210
13211 @item @@!
13212 Generate an exclamation point that really does end a sentence (usually
13213 after an end-of-sentence capital letter).  @xref{Ending a Sentence}.
13214
13215 @item @@"
13216 @itemx @@'
13217 Generate an umlaut or acute accent, respectively, over the next
13218 character, as in @"o and @'o.  @xref{Inserting Accents}.
13219
13220 @item @@*
13221 Force a line break. Do not end a paragraph that uses @code{@@*} with
13222 an @code{@@refill} command.  @xref{Line Breaks}.@refill
13223
13224 @item @@,@{@var{c}@}
13225 Generate a cedilla accent under @var{c}, as in @,{c}.  @xref{Inserting
13226 Accents}.
13227
13228 @item @@-
13229 Insert a discretionary hyphenation point.  @xref{- and hyphenation}.
13230
13231 @item @@.
13232 Produce a period that really does end a sentence (usually after an
13233 end-of-sentence capital letter).  @xref{Ending a Sentence}.
13234
13235 @item @@:
13236 Indicate to @TeX{} that an immediately preceding period, question
13237 mark, exclamation mark, or colon does not end a sentence.  Prevent
13238 @TeX{} from inserting extra whitespace as it does at the end of a
13239 sentence.  The command has no effect on the Info file output.
13240 @xref{Not Ending a Sentence}.@refill
13241
13242 @item @@=
13243 Generate a macro (bar) accent over the next character, as in @=o.
13244 @xref{Inserting Accents}.
13245
13246 @item @@?
13247 Generate a question mark that really does end a sentence (usually after
13248 an end-of-sentence capital letter).  @xref{Ending a Sentence}.
13249
13250 @item @@@@
13251 Stands for an at sign, @samp{@@}.@*
13252 @xref{Braces Atsigns, , Inserting @@ and braces}.
13253
13254 @item @@^
13255 @itemx @@`
13256 Generate a circumflex (hat) or grave accent, respectively, over the next
13257 character, as in @^o.
13258 @xref{Inserting Accents}.
13259
13260 @item @@@{
13261 Stands for a left brace, @samp{@{}.@*
13262 @xref{Braces Atsigns, , Inserting @@ and braces}.
13263
13264 @item @@@}
13265 Stands for a right-hand brace, @samp{@}}.@*
13266 @xref{Braces Atsigns, , Inserting @@ and braces}.
13267
13268 @item @@=
13269 Generate a tilde accent over the next character, as in @~N.
13270 @xref{Inserting Accents}.
13271
13272 @item @@AA@{@}
13273 @itemx @@aa@{@}
13274 Generate the uppercase and lowercase Scandinavian A-ring letters,
13275 respectively: @AA{}, @aa{}.  @xref{Inserting Accents}.
13276
13277 @item @@AE@{@}
13278 @itemx @@ae@{@}
13279 Generate the uppercase and lowercase AE ligatures, respectively:
13280 @AE{}, @ae{}.  @xref{Inserting Accents}.
13281
13282 @item @@appendix @var{title}
13283 Begin an appendix.  The title appears in the table
13284 of contents of a printed manual.  In Info, the title is
13285 underlined with asterisks.  @xref{unnumbered & appendix, , The
13286 @code{@@unnumbered} and @code{@@appendix} Commands}.@refill
13287
13288 @item @@appendixsec @var{title}
13289 @itemx @@appendixsection @var{title}
13290 Begin an appendix section within an appendix.  The section title appears
13291 in the table of contents of a printed manual.  In Info, the title is
13292 underlined with equal signs.  @code{@@appendixsection} is a longer
13293 spelling of the @code{@@appendixsec} command.  @xref{unnumberedsec
13294 appendixsec heading, , Section Commands}.@refill
13295
13296 @item @@appendixsubsec @var{title}
13297 Begin an appendix subsection within an appendix.  The title appears
13298 in the table of contents of a printed manual.  In Info, the title is
13299 underlined with hyphens.  @xref{unnumberedsubsec appendixsubsec
13300 subheading, , Subsection Commands}.@refill
13301
13302 @item @@appendixsubsubsec @var{title}
13303 Begin an appendix subsubsection within a subappendix.  The title
13304 appears in the table of contents of a printed manual.  In Info, the
13305 title is underlined with periods.  @xref{subsubsection,, The `subsub'
13306 Commands}.@refill
13307
13308 @item @@asis
13309 Used following @code{@@table}, @code{@@ftable}, and @code{@@vtable} to
13310 print the table's first column without highlighting (``as is'').
13311 @xref{Two-column Tables, , Making a Two-column Table}.@refill
13312
13313 @item @@author @var{author}
13314 Typeset @var{author} flushleft and underline it.  @xref{title
13315 subtitle author, , The @code{@@title} and @code{@@author}
13316 Commands}.@refill
13317
13318 @item @@b@{@var{text}@}
13319 Print @var{text} in @b{bold} font.  No effect in Info.  @xref{Fonts}.@refill
13320
13321 @ignore
13322 @item @@br
13323 Force a paragraph break.  If used within a line, follow @code{@@br}
13324 with braces.  @xref{br, , @code{@@br}}.@refill
13325 @end ignore
13326
13327 @item @@bullet@{@}
13328 Generate a large round dot, or the closest possible
13329 thing to one.  @xref{bullet, , @code{@@bullet}}.@refill
13330
13331 @item @@bye
13332 Stop formatting a file.  The formatters do not see the contents of a
13333 file following an @code{@@bye} command.  @xref{Ending a File}.@refill
13334
13335 @item @@c @var{comment}
13336 Begin a comment in Texinfo.  The rest of the line does not appear in
13337 either the Info file or the printed manual.  A synonym for
13338 @code{@@comment}.  @xref{Comments, , Comments}.@refill
13339
13340 @item @@cartouche
13341 Highlight an example or quotation by drawing a box with rounded
13342 corners around it.  Pair with @code{@@end cartouche}.  No effect in
13343 Info.  @xref{cartouche, , Drawing Cartouches Around Examples}.)@refill
13344
13345 @item @@center @var{line-of-text}
13346 Center the line of text following the command.
13347 @xref{titlefont center sp, , @code{@@center}}.@refill
13348
13349 @item @@centerchap @var{line-of-text}
13350 Like @code{@@chapter}, but centers the chapter title.  @xref{chapter,,
13351 @code{@@chapter}}.
13352
13353 @item @@chapheading @var{title}
13354 Print a chapter-like heading in the text, but not in the table of
13355 contents of a printed manual.  In Info, the title is underlined with
13356 asterisks.  @xref{majorheading & chapheading, , @code{@@majorheading}
13357 and @code{@@chapheading}}.@refill
13358
13359 @item @@chapter @var{title}
13360 Begin a chapter.  The chapter title appears in the table of
13361 contents of a printed manual.  In Info, the title is underlined with
13362 asterisks.  @xref{chapter, , @code{@@chapter}}.@refill
13363
13364 @item @@cindex @var{entry}
13365 Add @var{entry} to the index of concepts.  @xref{Index Entries, ,
13366 Defining the Entries of an Index}.@refill
13367
13368 @item @@cite@{@var{reference}@}
13369 Highlight the name of a book or other reference that lacks a
13370 companion Info file.  @xref{cite, , @code{@@cite}}.@refill
13371
13372 @item @@clear @var{flag}
13373 Unset @var{flag}, preventing the Texinfo formatting commands from
13374 formatting text between subsequent pairs of @code{@@ifset @var{flag}}
13375 and @code{@@end ifset} commands, and preventing
13376 @code{@@value@{@var{flag}@}} from expanding to the value to which
13377 @var{flag} is set.
13378 @xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill
13379
13380 @item @@code@{@var{sample-code}@}
13381 Highlight text that is an expression, a syntactically complete token
13382 of a program, or a program name.  @xref{code, , @code{@@code}}.@refill
13383
13384 @item @@comment @var{comment}
13385 Begin a comment in Texinfo.  The rest of the line does not appear in
13386 either the Info file or the printed manual.  A synonym for @code{@@c}.
13387 @xref{Comments, , Comments}.@refill
13388
13389 @item @@contents
13390 Print a complete table of contents.  Has no effect in Info, which uses
13391 menus instead.  @xref{Contents, , Generating a Table of
13392 Contents}.@refill
13393
13394 @item @@copyright@{@}
13395 Generate a copyright symbol.  @xref{copyright symbol, ,
13396 @code{@@copyright}}.@refill
13397
13398 @ignore
13399 @item @@ctrl@{@var{ctrl-char}@}
13400 Describe an @sc{ascii} control character.  Insert actual control character
13401 into Info file.  @xref{ctrl, , @code{@@ctrl}}.@refill
13402 @end ignore
13403
13404 @item @@defcodeindex @var{index-name}
13405 Define a new index and its indexing command.  Print entries in an
13406 @code{@@code} font.  @xref{New Indices, , Defining New
13407 Indices}.@refill
13408
13409 @item @@defcv @var{category} @var{class} @var{name}
13410 @itemx @@defcvx @var{category} @var{class} @var{name}
13411 Format a description for a variable associated with a class in
13412 object-oriented programming.  Takes three arguments: the category of
13413 thing being defined, the class to which it belongs, and its name.
13414 @xref{Definition Commands}, and @ref{deffnx,, Def Cmds in Detail}.
13415
13416 @item @@deffn @var{category} @var{name} @var{arguments}@dots{}
13417 @itemx @@deffnx @var{category} @var{name} @var{arguments}@dots{}
13418 Format a description for a function, interactive command, or similar
13419 entity that may take arguments.  @code{@@deffn} takes as arguments the
13420 category of entity being described, the name of this particular
13421 entity, and its arguments, if any.  @xref{Definition Commands}.@refill
13422
13423 @item @@defindex @var{index-name}
13424 Define a new index and its indexing command.  Print entries in a roman
13425 font.  @xref{New Indices, , Defining New Indices}.@refill
13426
13427 @c Unused so far as I can see and unsupported by makeinfo -- karl, 15sep96.
13428 @item @@definfoenclose @var{new-command}, @var{before}, @var{after},
13429 Create new @@-command for Info that marks text by enclosing it in
13430 strings that precede and follow the text.  Write definition inside of
13431 @code{@@ifinfo} @dots{} @code{@@end ifinfo}. @xref{Customized
13432 Highlighting}.@refill
13433
13434 @item @@defivar @var{class} @var{instance-variable-name}
13435 @itemx @@defivarx @var{class} @var{instance-variable-name}
13436 This command formats a description for an instance variable in
13437 object-oriented programming.  The command is equivalent to @samp{@@defcv
13438 @{Instance Variable@} @dots{}}.  @xref{Definition Commands}, and
13439 @ref{deffnx,, Def Cmds in Detail}.
13440
13441 @item @@defmac @var{macro-name} @var{arguments}@dots{}
13442 @itemx @@defmacx @var{macro-name} @var{arguments}@dots{}
13443 Format a description for a macro.  The command is equivalent to
13444 @samp{@@deffn Macro @dots{}}.  @xref{Definition Commands}, and
13445 @ref{deffnx,, Def Cmds in Detail}.
13446
13447 @item @@defmethod @var{class} @var{method-name} @var{arguments}@dots{}
13448 @itemx @@defmethodx @var{class} @var{method-name} @var{arguments}@dots{}
13449 Format a description for a method in object-oriented programming.  The
13450 command is equivalent to @samp{@@defop Method @dots{}}.  Takes as
13451 arguments the name of the class of the method, the name of the
13452 method, and its arguments, if any.  @xref{Definition Commands}, and
13453 @ref{deffnx,, Def Cmds in Detail}.
13454
13455 @item @@defop @var{category} @var{class} @var{name} @var{arguments}@dots{}
13456 @itemx @@defopx @var{category} @var{class} @var{name} @var{arguments}@dots{}
13457 Format a description for an operation in object-oriented programming.
13458 @code{@@defop} takes as arguments the overall name of the category of
13459 operation, the name of the class of the operation, the name of the
13460 operation, and its arguments, if any.  @xref{Definition
13461 Commands}, and @ref{deffnx,, Def Cmds in Detail}.
13462
13463 @item @@defopt @var{option-name}
13464 @itemx @@defoptx @var{option-name}
13465 Format a description for a user option.  The command is equivalent to
13466 @samp{@@defvr @{User Option@} @dots{}}.  @xref{Definition Commands}, and
13467 @ref{deffnx,, Def Cmds in Detail}.
13468
13469 @item @@defspec @var{special-form-name} @var{arguments}@dots{}
13470 @itemx @@defspecx @var{special-form-name} @var{arguments}@dots{}
13471 Format a description for a special form.  The command is equivalent to
13472 @samp{@@deffn @{Special Form@} @dots{}}.  @xref{Definition Commands},
13473 and @ref{deffnx,, Def Cmds in Detail}.
13474
13475 @item @@deftp @var{category} @var{name-of-type} @var{attributes}@dots{}
13476 @itemx @@deftpx @var{category} @var{name-of-type} @var{attributes}@dots{}
13477 Format a description for a data type.  @code{@@deftp} takes as arguments
13478 the category, the name of the type (which is a word like @samp{int} or
13479 @samp{float}), and then the names of attributes of objects of that type.
13480 @xref{Definition Commands}, and @ref{deffnx,, Def Cmds in Detail}.
13481
13482 @item @@deftypefn @var{classification} @var{data-type} @var{name} @var{arguments}@dots{}
13483 @itemx @@deftypefnx @var{classification} @var{data-type} @var{name} @var{arguments}@dots{}
13484 Format a description for a function or similar entity that may take
13485 arguments and that is typed.  @code{@@deftypefn} takes as arguments the
13486 classification of entity being described, the type, the name of the
13487 entity, and its arguments, if any.  @xref{Definition Commands}, and
13488 @ref{deffnx,, Def Cmds in Detail}.
13489
13490 @item @@deftypefun @var{data-type} @var{function-name} @var{arguments}@dots{}
13491 @itemx @@deftypefunx @var{data-type} @var{function-name} @var{arguments}@dots{}
13492 Format a description for a function in a typed language.
13493 The command is equivalent to @samp{@@deftypefn Function @dots{}}.
13494 @xref{Definition Commands},
13495 and @ref{deffnx,, Def Cmds in Detail}.
13496
13497 @item @@deftypevr @var{classification} @var{data-type} @var{name}
13498 @itemx @@deftypevrx @var{classification} @var{data-type} @var{name}
13499 Format a description for something like a variable in a typed
13500 language---an entity that records a value.  Takes as arguments the
13501 classification of entity being described, the type, and the name of the
13502 entity.  @xref{Definition Commands}, and @ref{deffnx,, Def Cmds in
13503 Detail}.
13504
13505 @item @@deftypevar @var{data-type} @var{variable-name}
13506 @itemx @@deftypevarx @var{data-type} @var{variable-name}
13507 Format a description for a variable in a typed language.  The command is
13508 equivalent to @samp{@@deftypevr Variable @dots{}}.  @xref{Definition
13509 Commands}, and @ref{deffnx,, Def Cmds in Detail}.
13510
13511 @item @@defun @var{function-name} @var{arguments}@dots{}
13512 @itemx @@defunx @var{function-name} @var{arguments}@dots{}
13513 Format a description for functions.  The command is equivalent to
13514 @samp{@@deffn Function @dots{}}.  @xref{Definition Commands}, and
13515 @ref{deffnx,, Def Cmds in Detail}.
13516
13517 @item @@defvar @var{variable-name}
13518 @itemx @@defvarx @var{variable-name}
13519 Format a description for variables.  The command is equivalent to
13520 @samp{@@defvr Variable @dots{}}.  @xref{Definition Commands}, and
13521 @ref{deffnx,, Def Cmds in Detail}.
13522
13523 @item @@defvr @var{category} @var{name}
13524 @itemx @@defvrx @var{category} @var{name}
13525 Format a description for any kind of variable.  @code{@@defvr} takes
13526 as arguments the category of the entity and the name of the entity.
13527 @xref{Definition Commands},
13528 and @ref{deffnx,, Def Cmds in Detail}.
13529
13530 @item @@detailmenu@{@}
13531 Use to avoid Makeinfo confusion stemming from the detailed node listing
13532 in a master menu.  @xref{Master Menu Parts}.
13533
13534 @item @@dfn@{@var{term}@}
13535 Highlight the introductory or defining use of a term.
13536 @xref{dfn, , @code{@@dfn}}.@refill
13537
13538 @item @@dircategory @var{dirpart}
13539 Specify a part of the Info directory menu where this file's entry should
13540 go.  @xref{Installing Dir Entries}.
13541
13542 @item @@direntry
13543 Begin the Info directory menu entry for this file.
13544 @xref{Installing Dir Entries}.
13545
13546 @need 100
13547 @item @@display
13548 Begin a kind of example.  Indent text, do not fill, do not select a
13549 new font.  Pair with @code{@@end display}.  @xref{display, ,
13550 @code{@@display}}.@refill
13551
13552 @item @@dmn@{@var{dimension}@}
13553 Format a unit of measure, as in 12@dmn{pt}.  Causes @TeX{} to insert a
13554 thin space before @var{dimension}.  No effect in Info.
13555 @xref{dmn, , @code{@@dmn}}.@refill
13556
13557 @need 100
13558 @item @@dots@{@}
13559 Insert an ellipsis: @samp{@dots{}}.
13560 @xref{dots, , @code{@@dots}}.@refill
13561
13562 @item @@email@{@var{address}@}
13563 Indicate an electronic mail address.
13564 @xref{email, , @code{@@email}}.@refill
13565
13566 @need 100
13567 @item @@emph@{@var{text}@}
13568 Highlight @var{text}; text is displayed in @emph{italics} in printed
13569 output, and surrounded by asterisks in Info.  @xref{Emphasis, , Emphasizing Text}.@refill
13570
13571 @item @@end @var{environment}
13572 Ends @var{environment}, as in @samp{@@end example}.  @xref{Formatting
13573 Commands,,@@-commands}.
13574
13575 @item @@enddots@{@}
13576 Generate an end-of-sentence of ellipsis, like this @enddots{}
13577 @xref{dots,,@code{@@dots@{@}}}.
13578
13579 @need 100
13580 @item @@enumerate [@var{number-or-letter}]
13581 Begin a numbered list, using @code{@@item} for each entry.
13582 Optionally, start list with @var{number-or-letter}.  Pair with
13583 @code{@@end enumerate}.  @xref{enumerate, ,
13584 @code{@@enumerate}}.@refill
13585
13586 @need 100
13587 @item @@equiv@{@}
13588 Indicate to the reader the exact equivalence of two forms with a
13589 glyph: @samp{@equiv{}}.  @xref{Equivalence}.@refill
13590
13591 @item @@error@{@}
13592 Indicate to the reader with a glyph that the following text is
13593 an error message: @samp{@error{}}.  @xref{Error Glyph}.@refill
13594
13595 @item @@evenfooting [@var{left}] @@| [@var{center}] @@| [@var{right}]
13596 Specify page footings for even-numbered (left-hand) pages.  Not relevant to
13597 Info.  @xref{Custom Headings, , How to Make Your Own Headings}.@refill
13598
13599 @item @@evenheading [@var{left}] @@| [@var{center}] @@| [@var{right}]
13600 Specify page headings for even-numbered (left-hand) pages.  Only
13601 supported within @code{@@iftex}.  @xref{Custom Headings, , How to Make
13602 Your Own Headings}.@refill
13603
13604 @item @@everyfooting [@var{left}] @@| [@var{center}] @@| [@var{right}]
13605 @itemx @@everyheading [@var{left}] @@| [@var{center}] @@| [@var{right}]
13606 Specify page footings resp.@: headings for every page.  Not relevant to
13607 Info.  @xref{Custom Headings, , How to Make Your Own Headings}.@refill
13608
13609 @item @@example
13610 Begin an example.  Indent text, do not fill, and select fixed-width font.
13611 Pair with @code{@@end example}.  @xref{example, ,
13612 @code{@@example}}.@refill
13613
13614 @item @@exclamdown@{@}
13615 Generate an upside-down exclamation point.  @xref{Inserting Accents}.
13616
13617 @item @@exdent @var{line-of-text}
13618 Remove any indentation a line might have.  @xref{exdent, ,
13619 Undoing the Indentation of a Line}.@refill
13620
13621 @item @@expansion@{@}
13622 Indicate the result of a macro expansion to the reader with a special
13623 glyph: @samp{@expansion{}}.
13624 @xref{expansion, , @expansion{} Indicating an Expansion}.@refill
13625
13626 @item @@file@{@var{filename}@}
13627 Highlight the name of a file, buffer, node, or directory.  @xref{file, ,
13628 @code{@@file}}.@refill
13629
13630 @item @@finalout
13631 Prevent @TeX{} from printing large black warning rectangles beside
13632 over-wide lines.  @xref{Overfull hboxes}.@refill
13633
13634 @need 100
13635 @item @@findex @var{entry}
13636 Add @var{entry} to the index of functions.  @xref{Index Entries, ,
13637 Defining the Entries of an Index}.@refill
13638
13639 @need 200
13640 @item @@flushleft
13641 @itemx @@flushright
13642 Left justify every line but leave the right end ragged.
13643 Leave font as is.  Pair with @code{@@end flushleft}.
13644 @code{@@flushright} analogous.
13645 @xref{flushleft & flushright, , @code{@@flushleft} and
13646 @code{@@flushright}}.@refill
13647
13648 @need 200
13649 @item @@footnote@{@var{text-of-footnote}@}
13650 Enter a footnote.  Footnote text is printed at the bottom of the page
13651 by @TeX{}; Info may format in either `End' node or `Separate' node style.
13652 @xref{Footnotes}.@refill
13653
13654 @item @@footnotestyle @var{style}
13655 Specify an Info file's footnote style, either @samp{end} for the end
13656 node style or @samp{separate} for the separate node style.
13657 @xref{Footnotes}.@refill
13658
13659 @item @@format
13660 Begin a kind of example.  Like @code{@@example} or @code{@@display},
13661 but do not narrow the margins and do not select the fixed-width font.
13662 Pair with @code{@@end format}.  @xref{example, ,
13663 @code{@@example}}.@refill
13664
13665 @item @@ftable @var{formatting-command}
13666 Begin a two-column table, using @code{@@item} for each entry.
13667 Automatically enter each of the items in the first column into the
13668 index of functions.  Pair with @code{@@end ftable}.  The same as
13669 @code{@@table}, except for indexing.  @xref{ftable vtable, ,
13670 @code{@@ftable} and @code{@@vtable}}.@refill
13671
13672 @item @@group
13673 Hold text together that must appear on one printed page.  Pair with
13674 @code{@@end group}.  Not relevant to Info.  @xref{group, ,
13675 @code{@@group}}.@refill
13676
13677 @item @@H@{@var{c}@}
13678 Generate the long Hungarian umlaut accent over @var{c}, as in @H{o}.
13679
13680 @item @@heading @var{title}
13681 Print an unnumbered section-like heading in the text, but not in the
13682 table of contents of a printed manual.  In Info, the title is
13683 underlined with equal signs.  @xref{unnumberedsec appendixsec heading,
13684 , Section Commands}.@refill
13685
13686 @item @@headings @var{on-off-single-double}
13687 Turn page headings on or off, and/or specify single-sided or double-sided
13688 page headings for printing.  @xref{headings on off, , The
13689 @code{@@headings} Command}.
13690
13691 @item @@i@{@var{text}@}
13692 Print @var{text} in @i{italic} font.  No effect in Info.
13693 @xref{Fonts}.@refill
13694
13695 @item @@ifclear @var{flag}
13696 If @var{flag} is cleared, the Texinfo formatting commands format text
13697 between @code{@@ifclear @var{flag}} and the following @code{@@end
13698 ifclear} command.
13699 @xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill
13700
13701 @item @@ifhtml
13702 @itemx @@ifinfo
13703 Begin a stretch of text that will be ignored by @TeX{} when it typesets
13704 the printed manual.  The text appears only in the HTML resp.@: Info
13705 file.  Pair with @code{@@end ifhtml} resp.@: @code{@@end ifinfo}.
13706 @xref{Conditionals, , Conditionally Visible Text}.@refill
13707
13708 @item @@ifset @var{flag}
13709 If @var{flag} is set, the Texinfo formatting commands format text
13710 between @code{@@ifset @var{flag}} and the following @code{@@end ifset}
13711 command.
13712 @xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill
13713
13714 @item @@iftex
13715 Begin a stretch of text that will not appear in the Info file, but
13716 will be processed only by @TeX{}.  Pair with @code{@@end iftex}.
13717 @xref{Conditionals, , Conditionally Visible Text}.@refill
13718
13719 @item @@ignore
13720 Begin a stretch of text that will not appear in either the Info file
13721 or the printed output.  Pair with @code{@@end ignore}.
13722 @xref{Comments, , Comments and Ignored Text}.@refill
13723
13724 @item @@include @var{filename}
13725 Incorporate the contents of the file @var{filename} into the Info file
13726 or printed document.  @xref{Include Files}.@refill
13727
13728 @item @@inforef@{@var{node-name}, [@var{entry-name}], @var{info-file-name}@}
13729 Make a cross reference to an Info file for which there is no printed
13730 manual.  @xref{inforef, , Cross references using
13731 @code{@@inforef}}.@refill
13732
13733 @item \input @var{macro-definitions-file}
13734 Use the specified macro definitions file.  This command is used only
13735 in the first line of a Texinfo file to cause @TeX{} to make use of the
13736 @file{texinfo} macro definitions file.  The backslash in @code{\input}
13737 is used instead of an @code{@@} because @TeX{} does not
13738 recognize @code{@@} until after it has read the definitions file.
13739 @xref{Header, , The Texinfo File Header}.@refill
13740
13741 @item @@item
13742 Indicate the beginning of a marked paragraph for @code{@@itemize} and
13743 @code{@@enumerate}; indicate the beginning of the text of a first column
13744 entry for @code{@@table}, @code{@@ftable}, and @code{@@vtable}.
13745 @xref{Lists and Tables}.@refill
13746
13747 @item @@itemize  @var{mark-generating-character-or-command}
13748 Produce a sequence of indented paragraphs, with a mark inside the left
13749 margin at the beginning of each paragraph.  Pair with @code{@@end
13750 itemize}.  @xref{itemize, , @code{@@itemize}}.@refill
13751
13752 @item @@itemx
13753 Like @code{@@item} but do not generate extra vertical space above the
13754 item text.  @xref{itemx, , @code{@@itemx}}.@refill
13755
13756 @item @@kbd@{@var{keyboard-characters}@}
13757 Indicate text that is characters of input to be typed by
13758 users.  @xref{kbd, , @code{@@kbd}}.@refill
13759
13760 @item @@key@{@var{key-name}@}
13761 Highlight @var{key-name}, a name for a key on a keyboard.
13762 @xref{key, , @code{@@key}}.@refill
13763
13764 @item @@kindex @var{entry}
13765 Add @var{entry} to the index of keys.  @xref{Index Entries, , Defining the
13766 Entries of an Index}.@refill
13767
13768 @item @@L@{@}
13769 @itemx @@l@{@}
13770 Generate the uppercase and lowercase Polish suppressed-L letters,
13771 respectively: @L{}, @l{}.
13772
13773 @c Possibly this can be tossed now that we have macros.  --karl, 16sep96.
13774 @item @@global@@let@var{new-command}=@var{existing-command}
13775 Equate a new highlighting command with an existing one.  Only for
13776 @TeX{}.  Write definition inside of @code{@@iftex} @dots{} @code{@@end
13777 iftex}. @xref{Customized Highlighting}.@refill
13778
13779 @item @@lisp
13780 Begin an example of Lisp code.  Indent text, do not fill, and select
13781 fixed-width font.  Pair with @code{@@end lisp}.  @xref{Lisp Example, ,
13782 @code{@@lisp}}.@refill
13783
13784 @item @@lowersections
13785 Change subsequent chapters to sections, sections to subsections, and so
13786 on. @xref{Raise/lower sections, , @code{@@raisesections} and
13787 @code{@@lowersections}}.@refill
13788
13789 @item @@macro @var{macro-name} @{@var{params}@}
13790 Define a new Texinfo command @code{@@@var{macro-name}@{@var{params}@}}.
13791 Only supported by Makeinfo and Texi2dvi.  @xref{Defining Macros}.
13792
13793 @item @@majorheading @var{title}
13794 Print a chapter-like heading in the text, but not in the table of
13795 contents of a printed manual.  Generate more vertical whitespace before
13796 the heading than the @code{@@chapheading} command.  In Info, the chapter
13797 heading line is underlined with asterisks.  @xref{majorheading &
13798 chapheading, , @code{@@majorheading} and @code{@@chapheading}}.@refill
13799
13800 @item @@math@{@var{mathematical-expression}@}
13801 Format a mathematical expression.
13802 @xref{math, , @code{@@math}: Inserting Mathematical Expressions}.
13803
13804 @item @@menu
13805 Mark the beginning of a menu of nodes in Info.  No effect in a printed
13806 manual.  Pair with @code{@@end menu}.  @xref{Menus}.@refill
13807
13808 @item @@minus@{@}
13809 Generate a minus sign, `@minus{}'.  @xref{minus, , @code{@@minus}}.@refill
13810
13811 @item @@multitable @var{column-width-spec}
13812 Begin a multi-column table.  Pair with @code{@@end multitable}.
13813 @xref{Multitable Column Widths}.
13814
13815 @item @@need @var{n}
13816 Start a new page in a printed manual if fewer than @var{n} mils
13817 (thousandths of an inch) remain on the current page.  @xref{need, ,
13818 @code{@@need}}.@refill
13819
13820 @item @@node @var{name, next, previous, up}
13821 Define the beginning of a new node in Info, and serve as a locator for
13822 references for @TeX{}.  @xref{node, , @code{@@node}}.@refill
13823
13824 @item @@noindent
13825 Prevent text from being indented as if it were a new paragraph.
13826 @xref{noindent, , @code{@@noindent}}.@refill
13827
13828 @item @@O@{@}
13829 @itemx @@o@{@}
13830 Generate the uppercase and lowercase Owith-slash letters, respectively:
13831 @O{}, @o{}.
13832
13833 @item @@oddfooting [@var{left}] @@| [@var{center}] @@| [@var{right}]
13834 @itemx @@oddheading [@var{left}] @@| [@var{center}] @@| [@var{right}]
13835 Specify page footings resp.@: headings for odd-numbered (right-hand)
13836 pages.  Only allowed inside @code{@@iftex}.  @xref{Custom Headings, ,
13837 How to Make Your Own Headings}.@refill
13838
13839 @item @@OE@{@}
13840 @itemx @@oe@{@}
13841 Generate the uppercase and lowercase OE ligatures, respectively:
13842 @OE{}, @oe{}.  @xref{Inserting Accents}.
13843
13844 @item @@page
13845 Start a new page in a printed manual.  No effect in Info.
13846 @xref{page, , @code{@@page}}.@refill
13847
13848 @item @@paragraphindent @var{indent}
13849 Indent paragraphs by @var{indent} number of spaces; delete indentation
13850 if the value of @var{indent} is 0; and do not change indentation if
13851 @var{indent} is @code{asis}. @xref{paragraphindent, , Paragraph
13852 Indenting}.@refill
13853
13854 @item @@pindex @var{entry}
13855 Add @var{entry} to the index of programs.  @xref{Index Entries, , Defining
13856 the Entries of an Index}.@refill
13857
13858 @item @@point@{@}
13859 Indicate the position of point in a buffer to the reader with a
13860 glyph: @samp{@point{}}.  @xref{Point Glyph, , Indicating
13861 Point in a Buffer}.@refill
13862
13863 @item @@pounds@{@}
13864 Generate the pounds sterling currency sign.
13865 @xref{pounds,,@code{@@pounds@{@}}}.
13866
13867 @item @@print@{@}
13868 Indicate printed output to the reader with a glyph:
13869 @samp{@print{}}.  @xref{Print Glyph}.@refill
13870
13871 @item @@printindex @var{index-name}
13872 Print an alphabetized two-column index in a printed manual or generate
13873 an alphabetized menu of index entries for Info.  @xref{Printing
13874 Indices & Menus}.@refill
13875
13876 @item @@pxref@{@var{node-name}, [@var{entry}], [@var{topic-or-title}], [@var{info-file}], [@var{manual}]@}
13877 Make a reference that starts with a lower case `see' in a printed
13878 manual.  Use within parentheses only.  Do not follow command with a
13879 punctuation mark---the Info formatting commands automatically insert
13880 terminating punctuation as needed.  Only the first argument is mandatory.
13881 @xref{pxref, , @code{@@pxref}}.@refill
13882
13883 @item @@questiondown@{@}
13884 Generate an upside-down question mark.  @xref{Inserting Accents}.
13885
13886 @item @@quotation
13887 Narrow the margins to indicate text that is quoted from another real
13888 or imaginary work.  Write command on a line of its own.  Pair with
13889 @code{@@end quotation}.  @xref{quotation, ,
13890 @code{@@quotation}}.@refill
13891
13892 @need 100
13893 @item @@r@{@var{text}@}
13894 Print @var{text} in @r{roman} font.  No effect in Info.
13895 @xref{Fonts}.@refill
13896
13897 @item @@raisesections
13898 Change subsequent sections to chapters, subsections to sections, and so
13899 on.  @xref{Raise/lower sections, , @code{@@raisesections} and
13900 @code{@@lowersections}}.@refill
13901
13902 @need 300
13903 @item @@ref@{@var{node-name}, [@var{entry}], [@var{topic-or-title}], [@var{info-file}], [@var{manual}]@}
13904 Make a reference.  In a printed manual, the reference does not start
13905 with a `See'.  Follow command with a punctuation mark.  Only the first
13906 argument is mandatory.  @xref{ref, , @code{@@ref}}.@refill
13907
13908 @need 300
13909 @item @@refill
13910 In Info, refill and indent the paragraph after all the other processing
13911 has been done.  No effect on @TeX{}, which always refills.  This command
13912 is no longer needed, since all formatters now automatically refill.
13913 @xref{Refilling Paragraphs}.@refill
13914
13915 @need 300
13916 @item @@result@{@}
13917 Indicate the result of an expression to the reader with a special
13918 glyph: @samp{@result{}}.  @xref{result, , @code{@@result}}.@refill
13919
13920 @item @@ringaccent@{@var{c}@}
13921 Generate a ring accent over the next character, as in @ringaccent{o}.
13922 @xref{Inserting Accents}.
13923
13924 @item @@samp@{@var{text}@}
13925 Highlight @var{text} that is a literal example of a sequence of
13926 characters.  Used for single characters, for statements, and often for
13927 entire shell commands.  @xref{samp, , @code{@@samp}}.@refill
13928
13929 @item @@sc@{@var{text}@}
13930 Set @var{text} in a printed output in @sc{the small caps font} and
13931 set text in the Info file in uppercase letters.
13932 @xref{Smallcaps}.@refill
13933
13934 @item @@section @var{title}
13935 Begin a section within a chapter.  In a printed manual, the section
13936 title is numbered and appears in the table of contents.  In Info, the
13937 title is underlined with equal signs.  @xref{section, ,
13938 @code{@@section}}.@refill
13939
13940 @item @@set @var{flag} [@var{string}]
13941 Make @var{flag} active, causing the Texinfo formatting commands to
13942 format text between subsequent pairs of @code{@@ifset @var{flag}} and
13943 @code{@@end ifset} commands.  Optionally, set value of @var{flag} to
13944 @var{string}.
13945 @xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill
13946
13947 @item @@setchapternewpage @var{on-off-odd}
13948 Specify whether chapters start on new pages, and if so, whether on
13949 odd-numbered (right-hand) new pages.  @xref{setchapternewpage, ,
13950 @code{@@setchapternewpage}}.@refill
13951
13952 @item @@setfilename @var{info-file-name}
13953 Provide a name to be used by the Info file.  This command is essential
13954 for @TeX{} formatting as well, even though it produces no output.
13955 @xref{setfilename, , @code{@@setfilename}}.@refill
13956
13957 @item @@settitle @var{title}
13958 Provide a title for page headers in a printed manual.
13959 @xref{settitle, , @code{@@settitle}}.@refill
13960
13961 @item @@shortcontents
13962 Print a short table of contents.  Not relevant to Info, which uses
13963 menus rather than tables of contents.  A synonym for
13964 @code{@@summarycontents}.  @xref{Contents, , Generating a Table of
13965 Contents}.@refill
13966
13967 @item @@shorttitlepage@{@var{title}@}
13968 Generate a minimal title page.  @xref{titlepage,,@code{@@titlepage}}.
13969
13970 @need 400
13971 @item @@smallbook
13972 Cause @TeX{} to produce a printed manual in a 7 by 9.25 inch format
13973 rather than the regular 8.5 by 11 inch format.  @xref{smallbook, ,
13974 Printing Small Books}.  Also, see @ref{smallexample & smalllisp, ,
13975 @code{@@smallexample} and @code{@@smalllisp}}.@refill
13976
13977 @need 400
13978 @item @@smallexample
13979 Indent text to indicate an example.  Do not fill, select fixed-width
13980 font.  In @code{@@smallbook} format, print text in a smaller font than
13981 with @code{@@example}.  Pair with @code{@@end smallexample}.
13982 @xref{smallexample & smalllisp, , @code{@@smallexample} and
13983 @code{@@smalllisp}}.@refill
13984
13985 @need 400
13986 @item @@smalllisp
13987 Begin an example of Lisp code.  Indent text, do not fill, select
13988 fixed-width font.  In @code{@@smallbook} format, print text in a
13989 smaller font.  Pair with @code{@@end smalllisp}.  @xref{smallexample &
13990 smalllisp, , @code{@@smallexample} and @code{@@smalllisp}}.@refill
13991
13992 @need 700
13993 @item @@sp @var{n}
13994 Skip @var{n} blank lines.  @xref{sp, , @code{@@sp}}.@refill
13995
13996 @item @@ss@{@}
13997 Generate the German sharp-S es-zet letter, @ss{}.  @xref{Inserting Accents}.
13998
13999 @need 700
14000 @item @@strong @var{text}
14001 Emphasize @var{text} by typesetting it in a @strong{bold} font for the
14002 printed manual and by surrounding it with asterisks for Info.
14003 @xref{emph & strong, , Emphasizing Text}.@refill
14004
14005 @item @@subheading @var{title}
14006 Print an unnumbered subsection-like heading in the text, but not in
14007 the table of contents of a printed manual.  In Info, the title is
14008 underlined with hyphens.  @xref{unnumberedsubsec appendixsubsec
14009 subheading, , @code{@@unnumberedsubsec} @code{@@appendixsubsec}
14010 @code{@@subheading}}.@refill
14011
14012 @item @@subsection @var{title}
14013 Begin a subsection within a section.  In a printed manual, the
14014 subsection title is numbered and appears in the table of contents.  In
14015 Info, the title is underlined with hyphens.  @xref{subsection, ,
14016 @code{@@subsection}}.@refill
14017
14018 @item @@subsubheading @var{title}
14019 Print an unnumbered subsubsection-like heading in the text, but not in
14020 the table of contents of a printed manual.  In Info, the title is
14021 underlined with periods.  @xref{subsubsection, , The `subsub'
14022 Commands}.@refill
14023
14024 @item @@subsubsection @var{title}
14025 Begin a subsubsection within a subsection.  In a printed manual,
14026 the subsubsection title is numbered and appears in the table of
14027 contents.  In Info, the title is underlined with periods.
14028 @xref{subsubsection, , The `subsub' Commands}.@refill
14029
14030 @item @@subtitle @var{title}
14031 In a printed manual, set a subtitle in a normal sized font flush to
14032 the right-hand side of the page.  Not relevant to Info, which does not
14033 have title pages.  @xref{title subtitle author, , @code{@@title}
14034 @code{@@subtitle} and @code{@@author} Commands}.@refill
14035
14036 @item @@summarycontents
14037 Print a short table of contents.  Not relevant to Info, which uses
14038 menus rather than tables of contents.  A synonym for
14039 @code{@@shortcontents}.  @xref{Contents, , Generating a Table of
14040 Contents}.@refill
14041
14042 @need 300
14043 @item @@syncodeindex @var{from-index} @var{into-index}
14044 Merge the index named in the first argument into the index named in
14045 the second argument, printing the entries from the first index in
14046 @code{@@code} font.  @xref{Combining Indices}.@refill
14047
14048 @need 300
14049 @item @@synindex @var{from-index} @var{into-index}
14050 Merge the index named in the first argument into the index named in
14051 the second argument.  Do not change the font of @var{from-index}
14052 entries.  @xref{Combining Indices}.@refill
14053
14054 @need 100
14055 @item @@t@{@var{text}@}
14056 Print @var{text} in a @t{fixed-width}, typewriter-like font.
14057 No effect in Info.  @xref{Fonts}.@refill
14058
14059 @item @@tab
14060 Separate columns in a multitable.  @xref{Multitable Rows}.
14061
14062 @need 400
14063 @item @@table @var{formatting-command}
14064 Begin a two-column table, using @code{@@item} for each entry.  Write
14065 each first column entry on the same line as @code{@@item}.  First
14066 column entries are printed in the font resulting from
14067 @var{formatting-command}.  Pair with @code{@@end table}.
14068 @xref{Two-column Tables, , Making a Two-column Table}.
14069 Also see @ref{ftable vtable, , @code{@@ftable} and @code{@@vtable}},
14070 and @ref{itemx, , @code{@@itemx}}.@refill
14071
14072 @item @@TeX@{@}
14073 Insert the logo @TeX{}.  @xref{TeX and copyright, , Inserting @TeX{}
14074 and @copyright{}}.@refill
14075
14076 @item @@tex
14077 Enter @TeX{} completely.  Pair with @code{@@end tex}.  @xref{Using
14078 Ordinary TeX Commands, , Using Ordinary @TeX{} Commands}.@refill
14079
14080 @item @@thischapter
14081 @itemx @@thischaptername
14082 @itemx @@thisfile
14083 @itemx @@thispage
14084 @itemx @@thistitle
14085 Only allowed in a heading or footing.  Stands for the number and name of
14086 the current chapter (in the format `Chapter 1: Title'), the chapter name
14087 only, the filename, the current page number, and the title of the
14088 document, respectively.  @xref{Custom Headings, , How to Make Your Own
14089 Headings}.@refill
14090
14091 @item @@tindex @var{entry}
14092 Add @var{entry} to the index of data types.  @xref{Index Entries, ,
14093 Defining the Entries of an Index}.@refill
14094
14095 @item @@title @var{title}
14096 In a printed manual, set a title flush to the left-hand side of the
14097 page in a larger than normal font and underline it with a black rule.
14098 Not relevant to Info, which does not have title pages.  @xref{title
14099 subtitle author, , The @code{@@title} @code{@@subtitle} and
14100 @code{@@author} Commands}.@refill
14101
14102 @need 400
14103 @item @@titlefont@{@var{text}@}
14104 In a printed manual, print @var{text} in a larger than normal font.
14105 Not relevant to Info, which does not have title pages.
14106 @xref{titlefont center sp, , The @code{@@titlefont} @code{@@center}
14107 and @code{@@sp} Commands}.@refill
14108
14109 @need 300
14110 @item @@titlepage
14111 Indicate to Texinfo the beginning of the title page.  Write command on
14112 a line of its own.  Pair with @code{@@end titlepage}.  Nothing between
14113 @code{@@titlepage} and @code{@@end titlepage} appears in Info.
14114 @xref{titlepage, , @code{@@titlepage}}.@refill
14115
14116 @need 150
14117 @item @@today@{@}
14118 Insert the current date, in `1 Jan 1900' style.  @xref{Custom
14119 Headings, , How to Make Your Own Headings}.@refill
14120
14121 @item @@top @var{title}
14122 In a Texinfo file to be formatted with @code{makeinfo}, identify the
14123 topmost @code{@@node} line in the file, which must be written on the line
14124 immediately preceding the @code{@@top} command.  Used for
14125 @code{makeinfo}'s node pointer insertion feature.  The title is
14126 underlined with asterisks.  Both the @code{@@node} line and the @code{@@top}
14127 line normally should be enclosed by @code{@@ifinfo} and @code{@@end
14128 ifinfo}.  In @TeX{} and @code{texinfo-format-buffer}, the @code{@@top}
14129 command is merely a synonym for @code{@@unnumbered}.  @xref{makeinfo
14130 Pointer Creation, , Creating Pointers with @code{makeinfo}}.
14131
14132 @item @@u@var{c}
14133 @itemx @@ubaraccent@var{c}
14134 @itemx @@udotaccent@var{c}
14135 Generate a breve, underbar, or underdot accent, respectively, over or
14136 under the character @var{c}, as in @u{o}, @ubaraccent{o},
14137 @udotaccent{o}.  @xref{Inserting Accents}.
14138
14139 @item @@unnumbered @var{title}
14140 In a printed manual, begin a chapter that appears without chapter
14141 numbers of any kind.  The title appears in the table of contents of a
14142 printed manual.  In Info, the title is underlined with asterisks.
14143 @xref{unnumbered & appendix, , @code{@@unnumbered} and
14144 @code{@@appendix}}.@refill
14145
14146 @item @@unnumberedsec @var{title}
14147 In a printed manual, begin a section that appears without section
14148 numbers of any kind.  The title appears in the table of contents of a
14149 printed manual.  In Info, the title is underlined with equal signs.
14150 @xref{unnumberedsec appendixsec heading, , Section Commands}.@refill
14151
14152 @item @@unnumberedsubsec @var{title}
14153 In a printed manual, begin an unnumbered subsection within a
14154 chapter.  The title appears in the table of contents of a printed
14155 manual.  In Info, the title is underlined with hyphens.
14156 @xref{unnumberedsubsec appendixsubsec subheading, ,
14157 @code{@@unnumberedsubsec} @code{@@appendixsubsec}
14158 @code{@@subheading}}.@refill
14159
14160 @item @@unnumberedsubsubsec @var{title}
14161 In a printed manual, begin an unnumbered subsubsection within a
14162 chapter.  The title appears in the table of contents of a printed
14163 manual.  In Info, the title is underlined with periods.
14164 @xref{subsubsection, , The `subsub' Commands}.@refill
14165
14166 @item @@url@{@var{url}@}
14167 Highlight text that is a uniform resource locator for the World Wide
14168 Web.  @xref{url, , @code{@@url}}.@refill
14169
14170 @item @@v@var{c}
14171 Generate check accent over the character @var{c}, as in @v{o}.
14172 @xref{Inserting Accents}.
14173
14174 @item @@value@{@var{flag}@}
14175 Replace @var{flag} with the value to which it is set by @code{@@set
14176 @var{flag}}.
14177 @xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill
14178
14179 @item @@var@{@var{metasyntactic-variable}@}
14180 Highlight a metasyntactic variable, which is something that stands for
14181 another piece of text.  @xref{var, , Indicating Metasyntactic
14182 Variables}.@refill
14183
14184 @need 400
14185 @item @@vindex @var{entry}
14186 Add @var{entry} to the index of variables.  @xref{Index Entries, ,
14187 Defining the Entries of an Index}.@refill
14188
14189 @need 400
14190 @item @@vskip @var{amount}
14191 In a printed manual, insert whitespace so as to push text on the
14192 remainder of the page towards the bottom of the page.  Used in
14193 formatting the copyright page with the argument @samp{0pt plus
14194 1filll}.  (Note spelling of @samp{filll}.)  @code{@@vskip} may be used
14195 only in contexts ignored for Info.  @xref{Copyright & Permissions, ,
14196 The Copyright Page and Printed Permissions}.@refill
14197
14198 @need 400
14199 @item @@vtable @var{formatting-command}
14200 Begin a two-column table, using @code{@@item} for each entry.
14201 Automatically enter each of the items in the first column into the
14202 index of variables.  Pair with @code{@@end vtable}.  The same as
14203 @code{@@table}, except for indexing.  @xref{ftable vtable, ,
14204 @code{@@ftable} and @code{@@vtable}}.@refill
14205
14206 @need 400
14207 @item @@w@{@var{text}@}
14208 Prevent @var{text} from being split across two lines.  Do not end a
14209 paragraph that uses @code{@@w} with an @code{@@refill} command.
14210 @xref{w, , @code{@@w}}.@refill
14211
14212 @need 400
14213 @item @@xref@{@var{node-name}, [@var{entry}], [@var{topic-or-title}], [@var{info-file}], [@var{manual}]@}
14214 Make a reference that starts with `See' in a printed manual.  Follow
14215 command with a punctuation mark.  Only the first argument is
14216 mandatory.  @xref{xref, , @code{@@xref}}.@refill
14217 @end table
14218
14219 @node Tips, Sample Texinfo File, Command List, Top
14220 @comment  node-name,  next,  previous,  up
14221 @appendix Tips and Hints
14222
14223 Here are some tips for writing Texinfo documentation:@refill
14224
14225 @cindex Tips
14226 @cindex Usage tips
14227 @cindex Hints
14228 @itemize @bullet
14229 @item
14230 Write in the present tense, not in the past or the future.
14231
14232 @item
14233 Write actively!  For example, write ``We recommend that @dots{}'' rather
14234 than ``It is recommended that @dots{}''.
14235
14236 @item
14237 Use 70 or 72 as your fill column.  Longer lines are hard to read.
14238
14239 @item
14240 Include a copyright notice and copying permissions.
14241 @end itemize
14242
14243 @subsubheading Index, index, index!
14244
14245 Write many index entries, in different ways.
14246 Readers like indices; they are helpful and convenient.
14247
14248 Although it is easiest to write index entries as you write the body of
14249 the text, some people prefer to write entries afterwards.  In either
14250 case, write an entry before the paragraph to which it applies.  This
14251 way, an index entry points to the first page of a paragraph that is
14252 split across pages.
14253
14254 Here are more hints we have found valuable:
14255
14256 @itemize @bullet
14257 @item
14258 Write each index entry differently, so each entry refers to a different
14259 place in the document.
14260
14261 @item
14262 Write index entries only where a topic is discussed significantly.  For
14263 example, it is not useful to index ``debugging information'' in a
14264 chapter on reporting bugs.  Someone who wants to know about debugging
14265 information will certainly not find it in that chapter.
14266
14267 @item
14268 Consistently capitalize the first word of every concept index entry,
14269 or else consistently use lower case.  Terse entries often call for
14270 lower case; longer entries for capitalization.  Whichever case
14271 convention you use, please use one or the other consistently!  Mixing
14272 the two styles looks bad.
14273
14274 @item
14275 Always capitalize or use upper case for those words in an index for
14276 which this is proper, such as names of countries or acronyms.  Always
14277 use the appropriate case for case-sensitive names, such as those in C or
14278 Lisp.
14279
14280 @item
14281 Write the indexing commands that refer to a whole section immediately
14282 after the section command, and write the indexing commands that refer to
14283 the paragraph before the paragraph.
14284
14285 @need 1000
14286 In the example that follows, a blank line comes after the index
14287 entry for ``Leaping'':
14288
14289 @example
14290 @group
14291 @@section The Dog and the Fox
14292 @@cindex Jumping, in general
14293 @@cindex Leaping
14294
14295 @@cindex Dog, lazy, jumped over
14296 @@cindex Lazy dog jumped over
14297 @@cindex Fox, jumps over dog
14298 @@cindex Quick fox jumps over dog
14299 The quick brown fox jumps over the lazy dog.
14300 @end group
14301 @end example
14302
14303 @noindent
14304 (Note that the example shows entries for the same concept that are
14305 written in different ways---@samp{Lazy dog}, and @samp{Dog, lazy}---so
14306 readers can look up the concept in different ways.)
14307 @end itemize
14308
14309 @subsubheading Blank lines
14310
14311 @itemize @bullet
14312 @item
14313 Insert a blank line between a sectioning command and the first following
14314 sentence or paragraph, or between the indexing commands associated with
14315 the sectioning command and the first following sentence or paragraph, as
14316 shown in the tip on indexing.  Otherwise, a formatter may fold title and
14317 paragraph together.
14318
14319 @item
14320 Always insert a blank line before an @code{@@table} command and after an
14321 @code{@@end table} command; but never insert a blank line after an
14322 @code{@@table} command or before an @code{@@end table} command.
14323
14324 @need 1000
14325 For example,
14326
14327 @example
14328 @group
14329 Types of fox:
14330
14331 @@table @@samp
14332 @@item Quick
14333 Jump over lazy dogs.
14334 @end group
14335
14336 @group
14337 @@item Brown
14338 Also jump over lazy dogs.
14339 @@end table
14340
14341 @end group
14342 @group
14343 @@noindent
14344 On the other hand, @dots{}
14345 @end group
14346 @end example
14347
14348 Insert blank lines before and after @code{@@itemize} @dots{} @code{@@end
14349 itemize} and @code{@@enumerate} @dots{} @code{@@end enumerate} in the
14350 same way.
14351 @end itemize
14352
14353 @subsubheading Complete phrases
14354
14355 Complete phrases are easier to read than @dots{}
14356
14357 @itemize @bullet
14358 @item
14359 Write entries in an itemized list as complete sentences; or at least, as
14360 complete phrases.  Incomplete expressions @dots{} awkward @dots{} like
14361 this.
14362
14363 @item
14364 Write the prefatory sentence or phrase for a multi-item list or table as
14365 a complete expression.  Do not write ``You can set:''; instead, write
14366 ``You can set these variables:''.  The former expression sounds cut off.
14367 @end itemize
14368
14369 @subsubheading Editions, dates and versions
14370
14371 Write the edition and version numbers and date in three places in every
14372 manual:
14373
14374 @enumerate
14375 @item
14376 In the first @code{@@ifinfo} section, for people reading the Texinfo file.
14377
14378 @item
14379 In the @code{@@titlepage} section, for people reading the printed manual.
14380
14381 @item
14382 In the `Top' node, for people reading the Info file.
14383 @end enumerate
14384
14385 @noindent
14386 Also, it helps to write a note before the first @code{@@ifinfo}
14387 section to explain what you are doing.
14388
14389 @need 800
14390 @noindent
14391 For example:
14392
14393 @example
14394 @group
14395 @@c ===> NOTE! <==
14396 @@c Specify the edition and version numbers and date
14397 @@c in *three* places:
14398 @@c   1. First ifinfo section  2. title page  3. top node
14399 @@c To find the locations, search for !!set
14400 @end group
14401
14402 @group
14403 @@ifinfo
14404 @@c !!set edition, date, version
14405 This is Edition 4.03, January 1992,
14406 of the @@cite@{GDB Manual@} for GDB Version 4.3.
14407 @dots{}
14408 @end group
14409 @end example
14410
14411 @noindent
14412 ---or use @code{@@set} and @code{@@value}
14413 (@pxref{value Example, , @code{@@value} Example}).
14414
14415 @subsubheading Definition Commands
14416
14417 Definition commands are @code{@@deffn}, @code{@@defun},
14418 @code{@@defmac}, and the like, and enable you to write descriptions in
14419 a uniform format.@refill
14420
14421 @itemize @bullet
14422 @item
14423 Write just one definition command for each entity you define with a
14424 definition command.  The automatic indexing feature creates an index
14425 entry that leads the reader to the definition.
14426
14427 @item
14428 Use @code{@@table} @dots{} @code{@@end table} in an appendix that
14429 contains a summary of functions, not @code{@@deffn} or other definition
14430 commands.
14431 @end itemize
14432
14433 @subsubheading Capitalization
14434
14435 @itemize @bullet
14436 @item
14437 Capitalize @samp{Texinfo}; it is a name.  Do not write the @samp{x} or
14438 @samp{i} in upper case.
14439
14440 @item
14441 Capitalize @samp{Info}; it is a name.
14442
14443 @item
14444 Write @TeX{} using the @code{@@TeX@{@}} command.  Note the uppercase
14445 @samp{T} and @samp{X}.  This command causes the formatters to
14446 typeset the name according to the wishes of Donald Knuth, who wrote
14447 @TeX{}.
14448 @end itemize
14449
14450 @subsubheading Spaces
14451
14452 Do not use spaces to format a Texinfo file, except inside of
14453 @code{@@example} @dots{} @code{@@end example} and similar commands.
14454
14455 @need 700
14456 For example, @TeX{} fills the following:
14457
14458 @example
14459 @group
14460     @@kbd@{C-x v@}
14461     @@kbd@{M-x vc-next-action@}
14462        Perform the next logical operation
14463        on the version-controlled file
14464        corresponding to the current buffer.
14465 @end group
14466 @end example
14467
14468 @need 950
14469 @noindent
14470 so it looks like this:
14471
14472 @iftex
14473 @quotation
14474     @kbd{C-x v}
14475     @kbd{M-x vc-next-action}
14476        Perform the next logical operation on the version-controlled file
14477        corresponding to the current buffer.
14478 @end quotation
14479 @end iftex
14480 @ifinfo
14481 @quotation
14482 `C-x v' `M-x vc-next-action' Perform the next logical operation on the
14483 version-controlled file corresponding to the current buffer.
14484 @end quotation
14485 @end ifinfo
14486
14487 @noindent
14488 In this case, the text should be formatted with
14489 @code{@@table}, @code{@@item}, and @code{@@itemx}, to create a table.
14490
14491 @subsubheading @@code, @@samp, @@var, and @samp{---}
14492
14493 @itemize @bullet
14494 @item
14495 Use @code{@@code} around Lisp symbols, including command names.
14496 For example,
14497
14498 @example
14499 The main function is @@code@{vc-next-action@}, @dots{}
14500 @end example
14501
14502 @item
14503 Avoid putting letters such as @samp{s} immediately after an
14504 @samp{@@code}.  Such letters look bad.
14505
14506 @item
14507 Use @code{@@var} around meta-variables.  Do not write angle brackets
14508 around them.
14509
14510 @item
14511 Use three hyphens in a row, @samp{---}, to indicate a long dash.  @TeX{}
14512 typesets these as a long dash and the Info formatters reduce three
14513 hyphens to two.
14514 @end itemize
14515
14516 @subsubheading Periods Outside of Quotes
14517
14518 Place periods and other punctuation marks @emph{outside} of quotations,
14519 unless the punctuation is part of the quotation.  This practice goes
14520 against publishing conventions in the United States, but enables the
14521 reader to distinguish between the contents of the quotation and the
14522 whole passage.
14523
14524 For example, you should write the following sentence with the period
14525 outside the end quotation marks:
14526
14527 @example
14528 Evidently, @samp{au} is an abbreviation for ``author''.
14529 @end example
14530
14531 @noindent
14532 since @samp{au} does @emph{not} serve as an  abbreviation for
14533 @samp{author.} (with a period following the word).
14534
14535 @subsubheading Introducing New Terms
14536
14537 @itemize @bullet
14538 @item
14539 Introduce new terms so that a reader who does not know them can
14540 understand them from context; or write a definition for the term.
14541
14542 For example, in the following, the terms ``check in'', ``register'' and
14543 ``delta'' are all appearing for the first time; the example sentence should be
14544 rewritten so they are understandable.
14545
14546 @quotation
14547 The major function assists you in checking in a file to your
14548 version control system and registering successive sets of changes to
14549 it as deltas.
14550 @end quotation
14551
14552 @item
14553 Use the @code{@@dfn} command around a word being introduced, to indicate
14554 that the reader should not expect to know the meaning already, and
14555 should expect to learn the meaning from this passage.
14556 @end itemize
14557
14558 @subsubheading @@pxref
14559
14560 @c !!! maybe include this in the tips on pxref
14561 @ignore
14562 By the way, it is okay to use pxref with something else in front of
14563 it within the parens, as long as the pxref is followed by the close
14564 paren, and the material inside the parens is not part of a larger
14565 sentence.  Also, you can use xref inside parens as part of a complete
14566 sentence so long as you terminate the cross reference with punctuation.
14567 @end ignore
14568 Absolutely never use @code{@@pxref} except in the special context for
14569 which it is designed: inside parentheses, with the closing parenthesis
14570 following immediately after the closing brace.  One formatter
14571 automatically inserts closing punctuation and the other does not.  This
14572 means that the output looks right both in printed output and in an Info
14573 file, but only when the command is used inside parentheses.
14574
14575 @subsubheading Invoking from a Shell
14576
14577 You can invoke programs such as Emacs, GCC, and GAWK from a shell.
14578 The documentation for each program should contain a section that
14579 describes this.  Unfortunately, if the node names and titles for these
14580 sections are all different, readers find it hard to search for the
14581 section.@refill
14582
14583 Name such sections with a phrase beginning with the word
14584 @w{`Invoking @dots{}'}, as in `Invoking Emacs'; this way
14585 users can find the section easily.
14586
14587 @subsubheading @sc{ansi c} Syntax
14588
14589 When you use @code{@@example} to describe a C function's calling
14590 conventions, use the @sc{ansi c} syntax, like this:@refill
14591
14592 @example
14593 void dld_init (char *@@var@{path@});
14594 @end example
14595
14596 @noindent
14597 And in the subsequent discussion, refer to the argument values by
14598 writing the same argument names, again highlighted with
14599 @code{@@var}.@refill
14600
14601 @need 800
14602 Avoid the obsolete style that looks like this:@refill
14603
14604 @example
14605 #include <dld.h>
14606
14607 dld_init (path)
14608 char *path;
14609 @end example
14610
14611 Also, it is best to avoid writing @code{#include} above the
14612 declaration just to indicate that the function is declared in a
14613 header file.  The practice may give the misimpression that the
14614 @code{#include} belongs near the declaration of the function.  Either
14615 state explicitly which header file holds the declaration or, better
14616 yet, name the header file used for a group of functions at the
14617 beginning of the section that describes the functions.@refill
14618
14619 @subsubheading Bad Examples
14620
14621 Here are several examples of bad writing to avoid:
14622
14623 In this example, say, `` @dots{} you must @code{@@dfn}@{check
14624 in@} the new version.''  That flows better.
14625
14626 @quotation
14627 When you are done editing the file, you must perform a
14628 @code{@@dfn}@{check in@}.
14629 @end quotation
14630
14631 In the following example, say, ``@dots{} makes a unified interface such as VC
14632 mode possible.''
14633
14634 @quotation
14635 SCCS, RCS and other version-control systems all perform similar
14636 functions in broadly similar ways (it is this resemblance which makes
14637 a unified control mode like this possible).
14638 @end quotation
14639
14640 And in this example, you should specify what `it' refers to:
14641
14642 @quotation
14643 If you are working with other people, it assists in coordinating
14644 everyone's changes so they do not step on each other.
14645 @end quotation
14646
14647 @subsubheading And Finally @dots{}
14648
14649 @itemize @bullet
14650 @item
14651 Pronounce @TeX{} as if the @samp{X} were a Greek `chi', as the last
14652 sound in the name `Bach'.  But pronounce Texinfo as in `speck':
14653 @samp{teckinfo}.
14654
14655 @item
14656 Write notes for yourself at the very end of a Texinfo file after the
14657 @code{@@bye}.  None of the formatters process text after the
14658 @code{@@bye}; it is as if the text were within @code{@@ignore} @dots{}
14659 @code{@@end ignore}.
14660 @end itemize
14661
14662 @node Sample Texinfo File, Sample Permissions, Tips, Top
14663 @comment  node-name,  next,  previous,  up
14664 @appendix A Sample Texinfo File
14665 @cindex Sample Texinfo file, no comments
14666
14667 Here is a complete, short sample Texinfo file, without any commentary.
14668 You can see this file, with comments, in the first chapter.
14669 @xref{Short Sample, , A Short Sample Texinfo File}.
14670
14671 @sp 1
14672 @example
14673 \input texinfo   @@c -*-texinfo-*-
14674 @@c %**start of header
14675 @@setfilename sample.info
14676 @@settitle Sample Document
14677 @@c %**end of header
14678
14679 @@setchapternewpage odd
14680
14681 @@ifinfo
14682 This is a short example of a complete Texinfo file.
14683
14684 Copyright 1990 Free Software Foundation, Inc.
14685 @@end ifinfo
14686
14687 @@titlepage
14688 @@sp 10
14689 @@comment The title is printed in a large font.
14690 @@center @@titlefont@{Sample Title@}
14691
14692 @@c The following two commands start the copyright page.
14693 @@page
14694 @@vskip 0pt plus 1filll
14695 Copyright @@copyright@{@} 1990 Free Software Foundation, Inc.
14696 @@end titlepage
14697
14698 @@node    Top,       First Chapter, (dir),    (dir)
14699 @@comment node-name, next,          previous, up
14700
14701 @@menu
14702 * First Chapter::    The first chapter is the
14703                      only chapter in this sample.
14704 * Concept Index::    This index has two entries.
14705 @@end menu
14706
14707 @@node    First Chapter, Concept Index, Top,      Top
14708 @@comment node-name,     next,          previous, up
14709 @@chapter First Chapter
14710 @@cindex Sample index entry
14711
14712 This is the contents of the first chapter.
14713 @@cindex Another sample index entry
14714
14715 Here is a numbered list.
14716
14717 @@enumerate
14718 @@item
14719 This is the first item.
14720
14721 @@item
14722 This is the second item.
14723 @@end enumerate
14724
14725 The @@code@{makeinfo@} and @@code@{texinfo-format-buffer@}
14726 commands transform a Texinfo file such as this into
14727 an Info file; and @@TeX@{@} typesets it for a printed
14728 manual.
14729
14730 @@node    Concept Index,    ,  First Chapter, Top
14731 @@comment node-name,    next,  previous,      up
14732 @@unnumbered Concept Index
14733
14734 @@printindex cp
14735
14736 @@contents
14737 @@bye
14738 @end example
14739
14740 @node Sample Permissions, Include Files, Sample Texinfo File, Top
14741 @appendix Sample Permissions
14742 @cindex Permissions
14743 @cindex Copying permissions
14744
14745 Texinfo files should contain sections that tell the readers that they
14746 have the right to copy and distribute the Texinfo file, the Info file,
14747 and the printed manual.@refill
14748
14749 Also, if you are writing a manual about software, you should explain
14750 that the software is free and either include the GNU General Public
14751 License (GPL) or provide a reference to it.  @xref{Distrib, ,
14752 Distribution, emacs, The GNU Emacs Manual}, for an example of the text
14753 that could be used in the software ``Distribution'', ``General Public
14754 License'', and ``NO WARRANTY'' sections of a document.  @xref{Copying,
14755 , Texinfo Copying Conditions}, for an example of a brief explanation
14756 of how the copying conditions provide you with rights. @refill
14757
14758 @menu
14759 * Inserting Permissions::       How to put permissions in your document.
14760 * ifinfo Permissions::          Sample @samp{ifinfo} copying permissions.
14761 * Titlepage Permissions::       Sample Titlepage copying permissions.
14762 @end menu
14763
14764 @node Inserting Permissions, ifinfo Permissions, Sample Permissions, Sample Permissions
14765 @ifinfo
14766 @appendixsec Inserting Permissions
14767 @end ifinfo
14768
14769 In a Texinfo file, the first @code{@@ifinfo} section usually begins
14770 with a line that says what the file documents.  This is what a person
14771 reading the unprocessed Texinfo file or using the advanced Info
14772 command @kbd{g *} sees first.  @inforef{Expert, Advanced Info
14773 commands, info}, for more information. (A reader using the regular
14774 Info commands usually starts reading at the first node and skips
14775 this first section, which is not in a node.)@refill
14776
14777 In the @code{@@ifinfo} section, the summary sentence is followed by a
14778 copyright notice and then by the copying permission notice.  One of
14779 the copying permission paragraphs is enclosed in @code{@@ignore} and
14780 @code{@@end ignore} commands.  This paragraph states that the Texinfo
14781 file can be processed through @TeX{} and printed, provided the printed
14782 manual carries the proper copying permission notice.  This paragraph
14783 is not made part of the Info file since it is not relevant to the Info
14784 file; but it is a mandatory part of the Texinfo file since it permits
14785 people to process the Texinfo file in @TeX{} and print the
14786 results.@refill
14787
14788 In the printed manual, the Free Software Foundation copying permission
14789 notice follows the copyright notice and publishing information and is
14790 located within the region delineated by the @code{@@titlepage} and
14791 @code{@@end titlepage} commands.  The copying permission notice is exactly
14792 the same as the notice in the @code{@@ifinfo} section except that the
14793 paragraph enclosed in @code{@@ignore} and @code{@@end ignore} commands is
14794 not part of the notice.@refill
14795
14796 To make it simple to insert a permission notice into each section of
14797 the Texinfo file, sample permission notices for each section are
14798 reproduced in full below.@refill
14799
14800 Note that you may need to specify the correct name of a section
14801 mentioned in the permission notice.  For example, in @cite{The GDB
14802 Manual}, the name of the section referring to the General Public
14803 License is called the ``GDB General Public License'', but in the
14804 sample shown below, that section is referred to generically as the
14805 ``GNU General Public License''.  If the Texinfo file does not carry a
14806 copy of the General Public License, leave out the reference to it, but
14807 be sure to include the rest of the sentence.@refill
14808
14809 @node ifinfo Permissions, Titlepage Permissions, Inserting Permissions, Sample Permissions
14810 @comment  node-name,  next,  previous,  up
14811 @appendixsec @samp{ifinfo} Copying Permissions
14812 @cindex @samp{ifinfo} permissions
14813
14814 In the @code{@@ifinfo} section of a Texinfo file, the standard Free
14815 Software Foundation permission notice reads as follows:@refill
14816
14817 @example
14818 This file documents @dots{}
14819
14820 Copyright 1992 Free Software Foundation, Inc.
14821
14822 Permission is granted to make and distribute verbatim
14823 copies of this manual provided the copyright notice and
14824 this permission notice are preserved on all copies.
14825
14826 @@ignore
14827 Permission is granted to process this file through TeX
14828 and print the results, provided the printed document
14829 carries a copying permission notice identical to this
14830 one except for the removal of this paragraph (this
14831 paragraph not being relevant to the printed manual).
14832
14833 @@end ignore
14834 Permission is granted to copy and distribute modified
14835 versions of this manual under the conditions for
14836 verbatim copying, provided also that the sections
14837 entitled ``Copying'' and ``GNU General Public License''
14838 are included exactly as in the original, and provided
14839 that the entire resulting derived work is distributed
14840 under the terms of a permission notice identical to this
14841 one.
14842
14843 Permission is granted to copy and distribute
14844 translations of this manual into another language,
14845 under the above conditions for modified versions,
14846 except that this permission notice may be stated in a
14847 translation approved by the Free Software Foundation.
14848 @end example
14849
14850 @node Titlepage Permissions, , ifinfo Permissions, Sample Permissions
14851 @comment  node-name,  next,  previous,  up
14852 @appendixsec Titlepage Copying Permissions
14853 @cindex Titlepage permissions
14854
14855 In the @code{@@titlepage} section of a Texinfo file, the standard Free
14856 Software Foundation copying permission notice follows the copyright
14857 notice and publishing information.  The standard phrasing is as
14858 follows:@refill
14859
14860 @example
14861 Permission is granted to make and distribute verbatim
14862 copies of this manual provided the copyright notice and
14863 this permission notice are preserved on all copies.
14864
14865 Permission is granted to copy and distribute modified
14866 versions of this manual under the conditions for
14867 verbatim copying, provided also that the sections
14868 entitled ``Copying'' and ``GNU General Public License''
14869 are included exactly as in the original, and provided
14870 that the entire resulting derived work is distributed
14871 under the terms of a permission notice identical to this
14872 one.
14873
14874 Permission is granted to copy and distribute
14875 translations of this manual into another language,
14876 under the above conditions for modified versions,
14877 except that this permission notice may be stated in a
14878 translation approved by the Free Software Foundation.
14879 @end example
14880
14881 @node Include Files, Headings, Sample Permissions, Top
14882 @comment  node-name,  next,  previous,  up
14883 @appendix Include Files
14884 @cindex Include files
14885
14886 When @TeX{} or an Info formatting command sees an @code{@@include}
14887 command in a Texinfo file, it processes the contents of the file named
14888 by the command and incorporates them into the @sc{dvi} or Info file being
14889 created.  Index entries from the included file are incorporated into
14890 the indices of the output file.@refill
14891
14892 Include files let you keep a single large document as a collection of
14893 conveniently small parts.@refill
14894
14895 @menu
14896 * Using Include Files::         How to use the @code{@@include} command.
14897 * texinfo-multiple-files-update::  How to create and update nodes and
14898                                   menus when using included files.
14899 * Include File Requirements::   What @code{texinfo-multiple-files-update} expects.
14900 * Sample Include File::         A sample outer file with included files
14901                                   within it; and a sample included file.
14902 * Include Files Evolution::     How use of the @code{@@include} command
14903                                   has changed over time.
14904 @end menu
14905
14906 @node Using Include Files, texinfo-multiple-files-update, Include Files, Include Files
14907 @appendixsec How to Use Include Files
14908 @findex include
14909
14910 To include another file within a Texinfo file, write the
14911 @code{@@include} command at the beginning of a line and follow it on
14912 the same line by the name of a file to be included.  For
14913 example:@refill
14914
14915 @example
14916 @@include buffers.texi
14917 @end example
14918
14919 An included file should simply be a segment of text that you expect to
14920 be included as is into the overall or @dfn{outer} Texinfo file; it
14921 should not contain the standard beginning and end parts of a Texinfo
14922 file.  In particular, you should not start an included file with a
14923 line saying @samp{\input texinfo}; if you do, that phrase is inserted
14924 into the output file as is.  Likewise, you should not end an included
14925 file with an @code{@@bye} command; nothing after @code{@@bye} is
14926 formatted.@refill
14927
14928 In the past, you were required to write an @code{@@setfilename} line at the
14929 beginning of an included file, but no longer.  Now, it does not matter
14930 whether you write such a line.  If an @code{@@setfilename} line exists
14931 in an included file, it is ignored.@refill
14932
14933 Conventionally, an included file begins with an @code{@@node} line that
14934 is followed by an @code{@@chapter} line.  Each included file is one
14935 chapter.  This makes it easy to use the regular node and menu creating
14936 and updating commands to create the node pointers and menus within the
14937 included file.  However, the simple Emacs node and menu creating and
14938 updating commands do not work with multiple Texinfo files.  Thus you
14939 cannot use these commands to fill in the `Next', `Previous', and `Up'
14940 pointers of the @code{@@node} line that begins the included file.  Also,
14941 you cannot use the regular commands to create a master menu for the
14942 whole file.  Either you must insert the menus and the `Next',
14943 `Previous', and `Up' pointers by hand, or you must use the GNU Emacs
14944 Texinfo mode command, @code{texinfo-multiple-files-update}, that is
14945 designed for @code{@@include} files.@refill
14946
14947 @node texinfo-multiple-files-update, Include File Requirements, Using Include Files, Include Files
14948 @appendixsec @code{texinfo-multiple-files-update}
14949 @findex texinfo-multiple-files-update
14950
14951 GNU Emacs Texinfo mode provides the @code{texinfo-multiple-files-update}
14952 command.  This command creates or updates `Next', `Previous', and `Up'
14953 pointers of included files as well as those in the outer or overall
14954 Texinfo file, and it creates or updates a main menu in the outer file.
14955 Depending whether you call it with optional arguments, the command
14956 updates only the pointers in the first @code{@@node} line of the
14957 included files or all of them:@refill
14958
14959 @table @kbd
14960 @item M-x texinfo-multiple-files-update
14961 Called without any arguments:@refill
14962
14963 @itemize @minus
14964 @item
14965 Create or update the `Next', `Previous', and `Up' pointers of the
14966 first @code{@@node} line in each file included in an outer or overall
14967 Texinfo file.@refill
14968
14969 @item
14970 Create or update the `Top' level node pointers of the outer or
14971 overall file.@refill
14972
14973 @item
14974 Create or update a main menu in the outer file.@refill
14975 @end itemize
14976
14977 @item C-u M-x texinfo-multiple-files-update
14978 Called with @kbd{C-u} as a prefix argument:
14979
14980 @itemize @minus{}
14981 @item
14982 Create or update pointers in the first @code{@@node} line in each
14983 included file.
14984
14985 @item
14986 Create or update the `Top' level node pointers of the outer file.
14987
14988 @item
14989 Create and insert a master menu in the outer file.  The master menu
14990 is made from all the menus in all the included files.@refill
14991 @end itemize
14992
14993 @item C-u 8 M-x texinfo-multiple-files-update
14994 Called with a numeric prefix argument, such as @kbd{C-u 8}:
14995
14996 @itemize @minus
14997 @item
14998 Create or update @strong{all} the `Next', `Previous', and `Up' pointers
14999 of all the included files.@refill
15000
15001 @item
15002 Create or update @strong{all} the menus of all the included
15003 files.@refill
15004
15005 @item
15006 Create or update the `Top' level node pointers of the outer or
15007 overall file.@refill
15008
15009 @item
15010 And then create a master menu in the outer file.  This is similar to
15011 invoking @code{texinfo-master-menu} with an argument when you are
15012 working with just one file.@refill
15013 @end itemize
15014 @end table
15015
15016 Note the use of the prefix argument in interactive use: with a regular
15017 prefix argument, just @w{@kbd{C-u}}, the
15018 @code{texinfo-multiple-files-update} command inserts a master menu;
15019 with a numeric prefix argument, such as @kbd{C-u 8}, the command
15020 updates @strong{every} pointer and menu in @strong{all} the files and then inserts a
15021 master menu.@refill
15022
15023 @node Include File Requirements, Sample Include File, texinfo-multiple-files-update, Include Files
15024 @appendixsec Include File Requirements
15025 @cindex Include file requirements
15026 @cindex Requirements for include files
15027
15028 If you plan to use the @code{texinfo-multiple-files-update} command,
15029 the outer Texinfo file that lists included files within it should
15030 contain nothing but the beginning and end parts of a Texinfo file, and
15031 a number of @code{@@include} commands listing the included files.  It
15032 should not even include indices, which should be listed in an included
15033 file of their own.@refill
15034
15035 Moreover, each of the included files must contain exactly one highest
15036 level node (conventionally, @code{@@chapter} or equivalent),
15037 and this node must be the first node in the included file.
15038 Furthermore, each of these highest level nodes in each included file
15039 must be at the same hierarchical level in the file structure.
15040 Usually, each is an @code{@@chapter}, an @code{@@appendix}, or an
15041 @code{@@unnumbered} node.  Thus, normally, each included file contains
15042 one, and only one, chapter or equivalent-level node.@refill
15043
15044 The outer file should contain only @emph{one} node, the `Top' node.  It
15045 should @emph{not} contain any nodes besides the single `Top' node.  The
15046 @code{texinfo-multiple-files-update} command will not process
15047 them.@refill
15048
15049 @node Sample Include File, Include Files Evolution, Include File Requirements, Include Files
15050 @appendixsec Sample File with @code{@@include}
15051 @cindex Sample @code{@@include} file
15052 @cindex Include file sample
15053 @cindex @code{@@include} file sample
15054
15055 Here is an example of a complete outer Texinfo file with @code{@@include} files
15056 within it before running @code{texinfo-multiple-files-update}, which
15057 would insert a main or master menu:@refill
15058
15059 @example
15060 @group
15061 \input texinfo @@c -*-texinfo-*-
15062 @c %**start of header
15063 @@setfilename  include-example.info
15064 @@settitle Include Example
15065 @c %**end of header
15066 @end group
15067
15068 @group
15069 @@setchapternewpage odd
15070 @@titlepage
15071 @@sp 12
15072 @@center @@titlefont@{Include Example@}
15073 @@sp 2
15074 @@center by Whom Ever
15075 @end group
15076
15077 @group
15078 @@page
15079 @@vskip 0pt plus 1filll
15080 Copyright @@copyright@{@} 1990 Free Software Foundation, Inc.
15081 @@end titlepage
15082 @end group
15083
15084 @group
15085 @@ifinfo
15086 @@node Top, First, (dir), (dir)
15087 @@top Master Menu
15088 @@end ifinfo
15089 @end group
15090
15091 @group
15092 @@include foo.texinfo
15093 @@include bar.texinfo
15094 @@include concept-index.texinfo
15095 @end group
15096
15097 @group
15098 @@summarycontents
15099 @@contents
15100
15101 @@bye
15102 @end group
15103 @end example
15104
15105 An included file, such as @file{foo.texinfo}, might look like
15106 this:@refill
15107
15108 @example
15109 @group
15110 @@node First, Second, , Top
15111 @@chapter First Chapter
15112
15113 Contents of first chapter @dots{}
15114 @end group
15115 @end example
15116
15117 The full contents of @file{concept-index.texinfo} might be as simple as this:
15118
15119 @example
15120 @group
15121 @@node Concept Index, , Second, Top
15122 @@unnumbered Concept Index
15123
15124 @@printindex cp
15125 @end group
15126 @end example
15127
15128 The outer Texinfo source file for @cite{The GNU Emacs Lisp Reference
15129 Manual} is named @file{elisp.texi}.  This outer file contains a master
15130 menu with 417 entries and a list of 41 @code{@@include}
15131 files.@refill
15132
15133 @node Include Files Evolution, , Sample Include File, Include Files
15134 @comment  node-name,  next,  previous,  up
15135 @appendixsec Evolution of Include Files
15136
15137 When Info was first created, it was customary to create many small
15138 Info files on one subject.  Each Info file was formatted from its own
15139 Texinfo source file.  This custom meant that Emacs did not need to
15140 make a large buffer to hold the whole of a large Info file when
15141 someone wanted information; instead, Emacs allocated just enough
15142 memory for the small Info file that contained the particular
15143 information sought.  This way, Emacs could avoid wasting memory.@refill
15144
15145 References from one file to another were made by referring to the file
15146 name as well as the node name. (@xref{Other Info Files, , Referring to
15147 Other Info Files}.  Also, see @ref{Four and Five Arguments, ,
15148 @code{@@xref} with Four and Five Arguments}.)@refill
15149
15150 Include files were designed primarily as a way to create a single,
15151 large printed manual out of several smaller Info files.  In a printed
15152 manual, all the references were within the same document, so @TeX{}
15153 could automatically determine the references' page numbers.  The Info
15154 formatting commands used include files only for creating joint
15155 indices; each of the individual Texinfo files had to be formatted for
15156 Info individually.  (Each, therefore, required its own
15157 @code{@@setfilename} line.)@refill
15158
15159 However, because large Info files are now split automatically, it is
15160 no longer necessary to keep them small.@refill
15161
15162 Nowadays, multiple Texinfo files are used mostly for large documents,
15163 such as @cite{The GNU Emacs Lisp Reference Manual}, and for projects
15164 in which several different people write different sections of a
15165 document simultaneously.@refill
15166
15167 In addition, the Info formatting commands have been extended to work
15168 with the @code{@@include} command so as to create a single large Info
15169 file that is split into smaller files if necessary.  This means that
15170 you can write menus and cross references without naming the different
15171 Texinfo files.@refill
15172
15173 @node Headings, Catching Mistakes, Include Files, Top
15174 @comment  node-name,  next,  previous,  up
15175 @appendix Page Headings
15176 @cindex Headings
15177 @cindex Footings
15178 @cindex Page numbering
15179 @cindex Page headings
15180 @cindex Formatting headings and footings
15181
15182 Most printed manuals contain headings along the top of every page
15183 except the title and copyright pages.  Some manuals also contain
15184 footings.  (Headings and footings have no meaning to Info, which is
15185 not paginated.)@refill
15186
15187 @menu
15188 * Headings Introduced::         Conventions for using page headings.
15189 * Heading Format::              Standard page heading formats.
15190 * Heading Choice::              How to specify the type of page heading.
15191 * Custom Headings::             How to create your own headings and footings.
15192 @end menu
15193
15194 @node Headings Introduced, Heading Format, Headings, Headings
15195 @ifinfo
15196 @heading Headings Introduced
15197 @end ifinfo
15198
15199 Texinfo provides standard page heading formats for manuals that are printed
15200 on one side of each sheet of paper and for manuals that are printed on
15201 both sides of the paper.  Usually, you will use one or other of these
15202 formats, but you can specify your own format, if you wish.@refill
15203
15204 In addition, you can specify whether chapters should begin on a new
15205 page, or merely continue the same page as the previous chapter; and if
15206 chapters begin on new pages, you can specify whether they must be
15207 odd-numbered pages.@refill
15208
15209 By convention, a book is printed on both sides of each sheet of paper.
15210 When you open a book, the right-hand page is odd-numbered, and
15211 chapters begin on right-hand pages---a preceding left-hand page is
15212 left blank if necessary.  Reports, however, are often printed on just
15213 one side of paper, and chapters begin on a fresh page immediately
15214 following the end of the preceding chapter.  In short or informal
15215 reports, chapters often do not begin on a new page at all, but are
15216 separated from the preceding text by a small amount of whitespace.@refill
15217
15218 The @code{@@setchapternewpage} command controls whether chapters begin
15219 on new pages, and whether one of the standard heading formats is used.
15220 In addition, Texinfo has several heading and footing commands that you
15221 can use to generate your own heading and footing formats.@refill
15222
15223 In Texinfo, headings and footings are single lines at the tops and
15224 bottoms of pages; you cannot create multiline headings or footings.
15225 Each header or footer line is divided into three parts: a left part, a
15226 middle part, and a right part.  Any part, or a whole line, may be left
15227 blank.  Text for the left part of a header or footer line is set
15228 flushleft; text for the middle part is centered; and, text for the
15229 right part is set flushright.@refill
15230
15231 @node Heading Format, Heading Choice, Headings Introduced, Headings
15232 @comment  node-name,  next,  previous,  up
15233 @appendixsec Standard Heading Formats
15234
15235 Texinfo provides two standard heading formats, one for manuals printed
15236 on one side of each sheet of paper, and the other for manuals printed
15237 on both sides of the paper.
15238
15239 By default, nothing is specified for the footing of a Texinfo file,
15240 so the footing remains blank.@refill
15241
15242 The standard format for single-sided printing consists of a header
15243 line in which the left-hand part contains the name of the chapter, the
15244 central part is blank, and the right-hand part contains the page
15245 number.@refill
15246
15247 @need 950
15248 A single-sided page looks like this:
15249
15250 @example
15251 @group
15252    _______________________
15253   |                       |
15254   | chapter   page number |
15255   |                       |
15256   | Start of text ...     |
15257   | ...                   |
15258   |                       |
15259
15260 @end group
15261 @end example
15262
15263 The standard format for two-sided printing depends on whether the page
15264 number is even or odd.  By convention, even-numbered pages are on the
15265 left- and odd-numbered pages are on the right.  (@TeX{} will adjust the
15266 widths of the left- and right-hand margins.  Usually, widths are
15267 correct, but during double-sided printing, it is wise to check that
15268 pages will bind properly---sometimes a printer will produce output in
15269 which the even-numbered pages have a larger right-hand margin than the
15270 odd-numbered pages.)@refill
15271
15272 In the standard double-sided format, the left part of the left-hand
15273 (even-numbered) page contains the page number, the central part is
15274 blank, and the right part contains the title (specified by the
15275 @code{@@settitle} command).  The left part of the right-hand
15276 (odd-numbered) page contains the name of the chapter, the central part
15277 is blank, and the right part contains the page number.@refill
15278
15279 @need 750
15280 Two pages, side by side as in an open book, look like this:@refill
15281
15282 @example
15283 @group
15284    _______________________     _______________________
15285   |                       |   |                       |
15286   | page number     title |   | chapter   page number |
15287   |                       |   |                       |
15288   | Start of text ...     |   | More  text ...        |
15289   | ...                   |   | ...                   |
15290   |                       |   |                       |
15291
15292 @end group
15293 @end example
15294
15295 @noindent
15296 The chapter name is preceded by the word @samp{Chapter}, the chapter
15297 number and a colon.  This makes it easier to keep track of where you
15298 are in the manual.@refill
15299
15300 @node Heading Choice, Custom Headings, Heading Format, Headings
15301 @comment  node-name,  next,  previous,  up
15302 @appendixsec Specifying the Type of Heading
15303
15304 @TeX{} does not begin to generate page headings for a standard Texinfo
15305 file until it reaches the @code{@@end titlepage} command.  Thus, the
15306 title and copyright pages are not numbered.  The @code{@@end
15307 titlepage} command causes @TeX{} to begin to generate page headings
15308 according to a standard format specified by the
15309 @code{@@setchapternewpage} command that precedes the
15310 @code{@@titlepage} section.@refill
15311
15312 @need 1000
15313 There are four possibilities:@refill
15314
15315 @table @asis
15316 @item No @code{@@setchapternewpage} command
15317 Cause @TeX{} to specify the single-sided heading format, with chapters
15318 on new pages. This is the same as @code{@@setchapternewpage on}.@refill
15319
15320 @item @code{@@setchapternewpage on}
15321 Specify the single-sided heading format, with chapters on new pages.@refill
15322
15323 @item @code{@@setchapternewpage off}
15324 Cause @TeX{} to start a new chapter on the same page as the last page of
15325 the preceding chapter, after skipping some vertical whitespace.  Also
15326 cause @TeX{} to typeset for single-sided printing.  (You can override
15327 the headers format with the @code{@@headings double} command; see
15328 @ref{headings on off, , The @code{@@headings} Command}.)@refill
15329
15330 @item @code{@@setchapternewpage odd}
15331 Specify the double-sided heading format, with chapters on new pages.@refill
15332 @end table
15333
15334 @noindent
15335 Texinfo lacks an @code{@@setchapternewpage even} command.@refill
15336
15337 @node Custom Headings, , Heading Choice, Headings
15338 @comment  node-name,  next,  previous,  up
15339 @appendixsec How to Make Your Own Headings
15340
15341 You can use the standard headings provided with Texinfo or specify
15342 your own.@refill
15343
15344 @c Following paragraph is verbose to prevent overfull hboxes.
15345 Texinfo provides six commands for specifying headings and
15346 footings.  The @code{@@everyheading} command and
15347 @code{@@everyfooting} command generate page headers and footers
15348 that are the same for both even- and odd-numbered pages.
15349 The @code{@@evenheading} command and @code{@@evenfooting}
15350 command generate headers and footers for even-numbered
15351 (left-hand) pages; and the @code{@@oddheading} command and
15352 @code{@@oddfooting} command generate headers and footers for
15353 odd-numbered (right-hand) pages.@refill
15354
15355 Write custom heading specifications in the Texinfo file immediately
15356 after the @code{@@end titlepage} command.  Enclose your specifications
15357 between @code{@@iftex} and @code{@@end iftex} commands since the
15358 @code{texinfo-format-buffer} command may not recognize them.  Also,
15359 you must cancel the predefined heading commands with the
15360 @code{@@headings off} command before defining your own
15361 specifications.@refill
15362
15363 @need 1000
15364 Here is how to tell @TeX{} to place the chapter name at the left, the
15365 page number in the center, and the date at the right of every header
15366 for both even- and odd-numbered pages:@refill
15367
15368 @example
15369 @group
15370 @@iftex
15371 @@headings off
15372 @@everyheading @@thischapter @@| @@thispage @@| @@today@{@}
15373 @@end iftex
15374 @end group
15375 @end example
15376
15377 @noindent
15378 You need to divide the left part from the central part and the central
15379 part from the right had part by inserting @samp{@@|} between parts.
15380 Otherwise, the specification command will not be able to tell where
15381 the text for one part ends and the next part begins.@refill
15382
15383 Each part can contain text or @@-commands.  The text
15384 is printed as if the part were within an ordinary paragraph in the
15385 body of the page.  The @@-commands replace
15386 themselves with the page number, date, chapter name, or
15387 whatever.@refill
15388
15389 @need 950
15390 Here are the six heading and footing commands:@refill
15391
15392 @findex everyheading
15393 @findex everyfooting
15394 @table @code
15395 @item @@everyheading @var{left} @@| @var{center} @@| @var{right}
15396 @itemx @@everyfooting @var{left} @@| @var{center} @@| @var{right}
15397
15398 The `every' commands specify the format for both even- and odd-numbered
15399 pages.  These commands are for documents that are printed on one side
15400 of each sheet of paper, or for documents in which you want symmetrical
15401 headers or footers.@refill
15402
15403 @findex evenheading
15404 @findex evenfooting
15405 @findex oddheading
15406 @findex oddfooting
15407 @item @@evenheading @var{left} @@| @var{center} @@| @var{right}
15408 @itemx @@oddheading  @var{left} @@| @var{center} @@| @var{right}
15409
15410 @itemx @@evenfooting @var{left} @@| @var{center} @@| @var{right}
15411 @itemx @@oddfooting  @var{left} @@| @var{center} @@| @var{right}
15412
15413 The `even' and `odd' commands specify the format for even-numbered
15414 pages and odd-numbered pages.  These commands are for books and
15415 manuals that are printed on both sides of each sheet of paper.@refill
15416 @end table
15417
15418 Use the @samp{@@this@dots{}} series of @@-commands to
15419 provide the names of chapters
15420 and sections and the page number.  You can use the
15421 @samp{@@this@dots{}} commands in the left, center, or right portions
15422 of headers and footers, or anywhere else in a Texinfo file so long as
15423 they are between @code{@@iftex} and @code{@@end iftex} commands.@refill
15424
15425 @need 1000
15426 Here are the @samp{@@this@dots{}} commands:@refill
15427
15428 @table @code
15429 @findex thispage
15430 @item @@thispage
15431 Expands to the current page number.@refill
15432 @c !!! Karl Berry says that `thissection' fails on page breaks.
15433 @ignore
15434 @item @@thissection
15435 Expands to the name of the current section.@refill
15436 @end ignore
15437
15438 @findex thischaptername
15439 @item @@thischaptername
15440 Expands to the name of the current chapter.@refill
15441
15442 @findex thischapter
15443 @item @@thischapter
15444 Expands to the number and name of the current
15445 chapter, in the format `Chapter 1: Title'.@refill
15446
15447 @findex thistitle
15448 @item @@thistitle
15449 Expands to the name of the document, as specified by the
15450 @code{@@settitle} command.@refill
15451
15452 @findex thisfile
15453 @item @@thisfile
15454 For @code{@@include} files only: expands to the name of the current
15455 @code{@@include} file.  If the current Texinfo source file is not an
15456 @code{@@include} file, this command has no effect.  This command does
15457 @emph{not} provide the name of the current Texinfo source file unless
15458 it is an @code{@@include} file.  (@xref{Include Files}, for more
15459 information about @code{@@include} files.)@refill
15460 @end table
15461
15462 @noindent
15463 You can also use the @code{@@today@{@}} command, which expands to the
15464 current date, in `1 Jan 1900' format.@refill
15465 @findex today
15466
15467 Other @@-commands and text are printed in a header or footer just as
15468 if they were in the body of a page.  It is useful to incorporate text,
15469 particularly when you are writing drafts:@refill
15470
15471 @example
15472 @group
15473 @@iftex
15474 @@headings off
15475 @@everyheading @@emph@{Draft!@} @@| @@thispage @@| @@thischapter
15476 @@everyfooting @@| @@| Version: 0.27: @@today@{@}
15477 @@end iftex
15478 @end group
15479 @end example
15480
15481 Beware of overlong titles: they may overlap another part of the
15482 header or footer and blot it out.@refill
15483
15484 @node Catching Mistakes, Refilling Paragraphs, Headings, Top
15485 @comment  node-name,  next,  previous,  up
15486 @appendix Formatting Mistakes
15487 @cindex Structure, catching mistakes in
15488 @cindex Nodes, catching mistakes
15489 @cindex Catching mistakes
15490 @cindex Correcting mistakes
15491 @cindex Mistakes, catching
15492 @cindex Problems, catching
15493 @cindex Debugging the Texinfo structure
15494
15495 Besides mistakes in the content of your documentation, there
15496 are two kinds of mistake you can make with Texinfo:  you can make mistakes
15497 with @@-commands, and you can make mistakes with the structure of the
15498 nodes and chapters.@refill
15499
15500 Emacs has two tools for catching the @@-command mistakes and two for
15501 catching structuring mistakes.@refill
15502
15503 For finding problems with @@-commands, you can run @TeX{} or a region
15504 formatting command on the region that has a problem; indeed, you can
15505 run these commands on each region as you write it.@refill
15506
15507 For finding problems with the structure of nodes and chapters, you can use
15508 @kbd{C-c C-s} (@code{texinfo-show-structure}) and the related @code{occur}
15509 command and you can use the @kbd{M-x Info-validate} command.@refill
15510
15511 @menu
15512 * makeinfo preferred::          @code{makeinfo} finds errors.
15513 * Debugging with Info::         How to catch errors with Info formatting.
15514 * Debugging with TeX::          How to catch errors with @TeX{} formatting.
15515 * Using texinfo-show-structure::  How to use @code{texinfo-show-structure}.
15516 * Using occur::                 How to list all lines containing a pattern.
15517 * Running Info-Validate::       How to find badly referenced nodes.
15518 @end menu
15519
15520 @node makeinfo preferred, Debugging with Info, Catching Mistakes, Catching Mistakes
15521 @ifinfo
15522 @heading @code{makeinfo} Find Errors
15523 @end ifinfo
15524
15525 The @code{makeinfo} program does an excellent job of catching errors
15526 and reporting them---far better than @code{texinfo-format-region} or
15527 @code{texinfo-format-buffer}.  In addition, the various functions for
15528 automatically creating and updating node pointers and menus remove
15529 many opportunities for human error.@refill
15530
15531 If you can, use the updating commands to create and insert pointers
15532 and menus.  These prevent many errors.  Then use @code{makeinfo} (or
15533 its Texinfo mode manifestations, @code{makeinfo-region} and
15534 @code{makeinfo-buffer}) to format your file and check for other
15535 errors.  This is the best way to work with Texinfo.  But if you
15536 cannot use @code{makeinfo}, or your problem is very puzzling, then you
15537 may want to use the tools described in this appendix.@refill
15538
15539 @node Debugging with Info, Debugging with TeX, makeinfo preferred, Catching Mistakes
15540 @comment  node-name,  next,  previous,  up
15541 @appendixsec Catching Errors with Info Formatting
15542 @cindex Catching errors with Info formatting
15543 @cindex Debugging with Info formatting
15544
15545 After you have written part of a Texinfo file, you can use the
15546 @code{texinfo-format-region} or the @code{makeinfo-region} command to
15547 see whether the region formats properly.@refill
15548
15549 Most likely, however, you are reading this section because for some
15550 reason you cannot use the @code{makeinfo-region} command; therefore, the
15551 rest of this section presumes that you are using
15552 @code{texinfo-format-region}.@refill
15553
15554 If you have made a mistake with an @@-command,
15555 @code{texinfo-format-region} will stop processing at or after the
15556 error and display an error message.  To see where in the buffer the
15557 error occurred, switch to the @samp{*Info Region*} buffer; the cursor
15558 will be in a position that is after the location of the error.  Also,
15559 the text will not be formatted after the place where the error
15560 occurred (or more precisely, where it was detected).@refill
15561
15562 For example, if you accidentally end a menu with the command @code{@@end
15563 menus} with an `s' on the end, instead of with @code{@@end menu}, you
15564 will see an error message that says:@refill
15565
15566 @example
15567 @@end menus is not handled by texinfo
15568 @end example
15569
15570 @noindent
15571 The cursor will stop at the point in the buffer where the error
15572 occurs, or not long after it.  The buffer will look like this:@refill
15573
15574 @example
15575 @group
15576 ---------- Buffer: *Info Region* ----------
15577 * Menu:
15578
15579 * Using texinfo-show-structure::  How to use
15580                                   `texinfo-show-structure'
15581                                   to catch mistakes.
15582 * Running Info-Validate::         How to check for
15583                                   unreferenced nodes.
15584 @@end menus
15585 @point{}
15586 ---------- Buffer: *Info Region* ----------
15587 @end group
15588 @end example
15589
15590 The @code{texinfo-format-region} command sometimes provides slightly
15591 odd error messages.  For example, the following cross reference fails to format:@refill
15592
15593 @example
15594 (@@xref@{Catching Mistakes, for more info.)
15595 @end example
15596
15597 @noindent
15598 In this case, @code{texinfo-format-region} detects the missing closing
15599 brace but displays a message that says @samp{Unbalanced parentheses}
15600 rather than @samp{Unbalanced braces}.  This is because the formatting
15601 command looks for mismatches between braces as if they were
15602 parentheses.@refill
15603
15604 Sometimes @code{texinfo-format-region} fails to detect mistakes.  For
15605 example, in the following, the closing brace is swapped with the
15606 closing parenthesis:@refill
15607
15608 @example
15609 (@@xref@{Catching Mistakes), for more info.@}
15610 @end example
15611
15612 @noindent
15613 Formatting produces:
15614 @example
15615 (*Note for more info.: Catching Mistakes)
15616 @end example
15617
15618 The only way for you to detect this error is to realize that the
15619 reference should have looked like this:@refill
15620
15621 @example
15622 (*Note Catching Mistakes::, for more info.)
15623 @end example
15624
15625 Incidentally, if you are reading this node in Info and type @kbd{f
15626 @key{RET}} (@code{Info-follow-reference}), you will generate an error
15627 message that says:
15628
15629 @example
15630 No such node: "Catching Mistakes) The only way @dots{}
15631 @end example
15632
15633 @noindent
15634 This is because Info perceives the example of the error as the first
15635 cross reference in this node and if you type a @key{RET} immediately
15636 after typing the Info @kbd{f} command, Info will attempt to go to the
15637 referenced node.  If you type @kbd{f catch @key{TAB} @key{RET}}, Info
15638 will complete the node name of the correctly written example and take
15639 you to the `Catching Mistakes' node.  (If you try this, you can return
15640 from the `Catching Mistakes' node by typing @kbd{l}
15641 (@code{Info-last}).)
15642
15643 @c !!! section on using Elisp debugger ignored.
15644 @ignore
15645 Sometimes @code{texinfo-format-region} will stop long after the
15646 original error; this is because it does not discover the problem until
15647 then.  In this case, you will need to backtrack.@refill
15648
15649 @c menu
15650 @c * Using the Emacs Lisp Debugger::  How to use the Emacs Lisp debugger.
15651 @c end menu
15652
15653 @c node Using the Emacs Lisp Debugger
15654 @c appendixsubsec Using the Emacs Lisp Debugger
15655 @c index Using the Emacs Lisp debugger
15656 @c index Emacs Lisp debugger
15657 @c index Debugger, using the Emacs Lisp
15658
15659 If an error is especially elusive, you can turn on the Emacs Lisp
15660 debugger and look at the backtrace; this tells you where in the
15661 @code{texinfo-format-region} function the problem occurred.  You can
15662 turn on the debugger with the command:@refill
15663
15664 @example
15665 M-x set-variable @key{RET} debug-on-error @key{RET} t @key{RET}
15666 @end example
15667
15668 @noindent
15669 and turn it off with
15670
15671 @example
15672 M-x set-variable @key{RET} debug-on-error @key{RET} nil @key{RET}
15673 @end example
15674
15675 Often, when you are using the debugger, it is easier to follow what is
15676 going on if you use the Emacs Lisp files that are not byte-compiled.
15677 The byte-compiled sources send octal numbers to the debugger that may
15678 look mysterious.  To use the uncompiled source files, load
15679 @file{texinfmt.el} and @file{texinfo.el} with the @kbd{M-x load-file}
15680 command.@refill
15681
15682 The debugger will not catch an error if @code{texinfo-format-region}
15683 does not detect one.  In the example shown above,
15684 @code{texinfo-format-region} did not find the error when the whole
15685 list was formatted, but only when part of the list was formatted.
15686 When @code{texinfo-format-region} did not find an error, the debugger
15687 did not find one either. @refill
15688
15689 However, when @code{texinfo-format-region} did report an error, it
15690 invoked the debugger.  This is the backtrace it produced:@refill
15691
15692 @example
15693 ---------- Buffer: *Backtrace* ----------
15694 Signalling: (search-failed "[@},]")
15695   re-search-forward("[@},]")
15696   (while ...)
15697   (let ...)
15698   texinfo-format-parse-args()
15699   (let ...)
15700   texinfo-format-xref()
15701   funcall(texinfo-format-xref)
15702   (if ...)
15703   (let ...)
15704   (if ...)
15705   (while ...)
15706   texinfo-format-scan()
15707   (save-excursion ...)
15708   (let ...)
15709   texinfo-format-region(103370 103631)
15710 * call-interactively(texinfo-format-region)
15711 ---------- Buffer: *Backtrace* ----------
15712 @end example
15713
15714 The backtrace is read from the bottom up.
15715 @code{texinfo-format-region} was called interactively; and it, in
15716 turn, called various functions, including @code{texinfo-format-scan},
15717 @code{texinfo-format-xref} and @code{texinfo-format-parse-args}.
15718 Inside the function @code{texinfo-format-parse-args}, the function
15719 @code{re-search-forward} was called; it was this function that could
15720 not find the missing right-hand brace.@refill
15721
15722 @xref{Lisp Debug, , Debugging Emacs Lisp, emacs, The GNU Emacs
15723 Manual}, for more information.@refill
15724 @end ignore
15725
15726 @node Debugging with TeX, Using texinfo-show-structure, Debugging with Info, Catching Mistakes
15727 @comment  node-name,  next,  previous,  up
15728 @appendixsec Catching Errors with @TeX{} Formatting
15729 @cindex Catching errors with @TeX{} formatting
15730 @cindex Debugging with @TeX{} formatting
15731
15732 You can also catch mistakes when you format a file with @TeX{}.@refill
15733
15734 Usually, you will want to do this after you have run
15735 @code{texinfo-format-buffer} (or, better, @code{makeinfo-buffer}) on
15736 the same file, because @code{texinfo-format-buffer} sometimes displays
15737 error messages that make more sense than @TeX{}.  (@xref{Debugging
15738 with Info}, for more information.)@refill
15739
15740 For example, @TeX{} was run on a Texinfo file, part of which is shown
15741 here:@refill
15742
15743 @example
15744 ---------- Buffer: texinfo.texi ----------
15745 name of the Texinfo file as an extension.  The
15746 @@samp@{??@} are `wildcards' that cause the shell to
15747 substitute all the raw index files.  (@@xref@{sorting
15748 indices, for more information about sorting
15749 indices.)@@refill
15750 ---------- Buffer: texinfo.texi ----------
15751 @end example
15752
15753 @noindent
15754 (The cross reference lacks a closing brace.)
15755 @TeX{} produced the following output, after which it stopped:@refill
15756
15757 @example
15758 ---------- Buffer: *tex-shell* ----------
15759 Runaway argument?
15760 @{sorting indices, for more information about sorting
15761 indices.) @@refill @@ETC.
15762 ! Paragraph ended before @@xref was complete.
15763 <to be read again>
15764                    @@par
15765 l.27
15766
15767 ?
15768 ---------- Buffer: *tex-shell* ----------
15769 @end example
15770
15771 In this case, @TeX{} produced an accurate and
15772 understandable error message:
15773
15774 @example
15775 Paragraph ended before @@xref was complete.
15776 @end example
15777
15778 @noindent
15779 @samp{@@par} is an internal @TeX{} command of no relevance to Texinfo.
15780 @samp{l.27} means that @TeX{} detected the problem on line 27 of the
15781 Texinfo file.  The @samp{?} is the prompt @TeX{} uses in this
15782 circumstance.@refill
15783
15784 Unfortunately, @TeX{} is not always so helpful, and sometimes you must
15785 truly be a Sherlock Holmes to discover what went wrong.@refill
15786
15787 In any case, if you run into a problem like this, you can do one of three
15788 things.@refill
15789
15790 @enumerate
15791 @item
15792 You can tell @TeX{} to continue running and ignore just this error by
15793 typing @key{RET} at the @samp{?} prompt.@refill
15794
15795 @item
15796 You can tell @TeX{} to continue running and to ignore all errors as best
15797 it can by typing @kbd{r @key{RET}} at the @samp{?} prompt.@refill
15798
15799 This is often the best thing to do.  However, beware: the one error
15800 may produce a cascade of additional error messages as its consequences
15801 are felt through the rest of the file.  (To stop @TeX{} when it is
15802 producing such an avalanche of error messages, type @kbd{C-d} (or
15803 @kbd{C-c C-d}, if you are running a shell inside Emacs.))@refill
15804
15805 @item
15806 You can tell @TeX{} to stop this run by typing @kbd{x @key{RET}}
15807 at the @samp{?} prompt.@refill
15808 @end enumerate
15809
15810 Please note that if you are running @TeX{} inside Emacs, you need to
15811 switch to the shell buffer and line at which @TeX{} offers the @samp{?}
15812 prompt.@refill
15813
15814 Sometimes @TeX{} will format a file without producing error messages even
15815 though there is a problem.  This usually occurs if a command is not ended
15816 but @TeX{} is able to continue processing anyhow.  For example, if you fail
15817 to end an itemized list with the @code{@@end itemize} command, @TeX{} will
15818 write a @sc{dvi} file that you can print out.  The only error message that
15819 @TeX{} will give you is the somewhat mysterious comment that@refill
15820
15821 @example
15822 (@@end occurred inside a group at level 1)
15823 @end example
15824
15825 @noindent
15826 However, if you print the @sc{dvi} file, you will find that the text
15827 of the file that follows the itemized list is entirely indented as if
15828 it were part of the last item in the itemized list.  The error message
15829 is the way @TeX{} says that it expected to find an @code{@@end}
15830 command somewhere in the file; but that it could not determine where
15831 it was needed.@refill
15832
15833 Another source of notoriously hard-to-find errors is a missing
15834 @code{@@end group} command.  If you ever are stumped by
15835 incomprehensible errors, look for a missing @code{@@end group} command
15836 first.@refill
15837
15838 If the Texinfo file lacks header lines,
15839 @TeX{} may stop in the
15840 beginning of its run and display output that looks like the following.
15841 The @samp{*} indicates that @TeX{} is waiting for input.@refill
15842
15843 @example
15844 This is TeX, Version 3.14159 (Web2c 7.0)
15845 (test.texinfo [1])
15846 *
15847 @end example
15848
15849 @noindent
15850 In this case, simply type @kbd{\end @key{RET}} after the asterisk.  Then
15851 write the header lines in the Texinfo file and run the @TeX{} command
15852 again. (Note the use of the backslash, @samp{\}.  @TeX{} uses @samp{\}
15853 instead of @samp{@@}; and in this circumstance, you are working
15854 directly with @TeX{}, not with Texinfo.)@refill
15855
15856 @node Using texinfo-show-structure, Using occur, Debugging with TeX, Catching Mistakes
15857 @comment  node-name,  next,  previous,  up
15858 @appendixsec Using @code{texinfo-show-structure}
15859 @cindex Showing the structure of a file
15860 @findex texinfo-show-structure
15861
15862 It is not always easy to keep track of the nodes, chapters, sections, and
15863 subsections of a Texinfo file.  This is especially true if you are revising
15864 or adding to a Texinfo file that someone else has written.@refill
15865
15866 In GNU Emacs, in Texinfo mode, the @code{texinfo-show-structure}
15867 command lists all the lines that begin with the @@-commands that
15868 specify the structure: @code{@@chapter}, @code{@@section},
15869 @code{@@appendix}, and so on.  With an argument (@w{@kbd{C-u}}
15870 as prefix argument, if interactive),
15871 the command also shows the @code{@@node} lines.  The
15872 @code{texinfo-show-structure} command is bound to @kbd{C-c C-s} in
15873 Texinfo mode, by default.@refill
15874
15875 The lines are displayed in a buffer called the @samp{*Occur*} buffer,
15876 indented by hierarchical level.  For example, here is a part of what was
15877 produced by running @code{texinfo-show-structure} on this manual:@refill
15878
15879 @example
15880 @group
15881  Lines matching "^@@\\(chapter \\|sect\\|subs\\|subh\\|
15882  unnum\\|major\\|chapheading \\|heading \\|appendix\\)"
15883  in buffer texinfo.texi.
15884  @dots{}
15885  4177:@@chapter Nodes
15886  4198:    @@heading Two Paths
15887  4231:    @@section Node and Menu Illustration
15888  4337:    @@section The @@code@{@@@@node@} Command
15889  4393:        @@subheading Choosing Node and Pointer Names
15890  4417:        @@subsection How to Write an @@code@{@@@@node@} Line
15891  4469:        @@subsection @@code@{@@@@node@} Line Tips
15892  @dots{}
15893 @end group
15894 @end example
15895
15896 This says that lines 4337, 4393, and 4417 of @file{texinfo.texi} begin
15897 with the @code{@@section}, @code{@@subheading}, and @code{@@subsection}
15898 commands respectively.  If you move your cursor into the @samp{*Occur*}
15899 window, you can position the cursor over one of the lines and use the
15900 @kbd{C-c C-c} command (@code{occur-mode-goto-occurrence}), to jump to
15901 the corresponding spot in the Texinfo file.  @xref{Other Repeating
15902 Search, , Using Occur, emacs, The GNU Emacs Manual}, for more
15903 information about @code{occur-mode-goto-occurrence}.@refill
15904
15905 The first line in the @samp{*Occur*} window describes the @dfn{regular
15906 expression} specified by @var{texinfo-heading-pattern}.  This regular
15907 expression is the pattern that @code{texinfo-show-structure} looks for.
15908 @xref{Regexps, , Using Regular Expressions, emacs, The GNU Emacs Manual},
15909 for more information.@refill
15910
15911 When you invoke the @code{texinfo-show-structure} command, Emacs will
15912 display the structure of the whole buffer.  If you want to see the
15913 structure of just a part of the buffer, of one chapter, for example,
15914 use the @kbd{C-x n n} (@code{narrow-to-region}) command to mark the
15915 region.  (@xref{Narrowing, , , emacs, The GNU Emacs Manual}.)  This is
15916 how the example used above was generated.  (To see the whole buffer
15917 again, use @kbd{C-x n w} (@code{widen}).)@refill
15918
15919 If you call @code{texinfo-show-structure} with a prefix argument by
15920 typing @w{@kbd{C-u C-c C-s}}, it will list lines beginning with
15921 @code{@@node} as well as the lines beginning with the @@-sign commands
15922 for @code{@@chapter}, @code{@@section}, and the like.@refill
15923
15924 You can remind yourself of the structure of a Texinfo file by looking at
15925 the list in the @samp{*Occur*} window; and if you have mis-named a node
15926 or left out a section, you can correct the mistake.@refill
15927
15928 @node Using occur, Running Info-Validate, Using texinfo-show-structure, Catching Mistakes
15929 @comment  node-name,  next,  previous,  up
15930 @appendixsec Using @code{occur}
15931 @cindex Occurrences, listing with @code{@@occur}
15932 @findex occur
15933
15934 Sometimes the @code{texinfo-show-structure} command produces too much
15935 information.  Perhaps you want to remind yourself of the overall structure
15936 of a Texinfo file, and are overwhelmed by the detailed list produced by
15937 @code{texinfo-show-structure}.  In this case, you can use the @code{occur}
15938 command directly.  To do this, type@refill
15939
15940 @example
15941 @kbd{M-x occur}
15942 @end example
15943
15944 @noindent
15945 and then, when prompted, type a @dfn{regexp}, a regular expression for
15946 the pattern you want to match.  (@xref{Regexps, , Regular Expressions,
15947 emacs, The GNU Emacs Manual}.)  The @code{occur} command works from
15948 the current location of the cursor in the buffer to the end of the
15949 buffer.  If you want to run @code{occur} on the whole buffer, place
15950 the cursor at the beginning of the buffer.@refill
15951
15952 For example, to see all the lines that contain the word
15953 @samp{@@chapter} in them, just type @samp{@@chapter}.  This will
15954 produce a list of the chapters.  It will also list all the sentences
15955 with @samp{@@chapter} in the middle of the line.@refill
15956
15957 If you want to see only those lines that start with the word
15958 @samp{@@chapter}, type @samp{^@@chapter} when prompted by
15959 @code{occur}.  If you want to see all the lines that end with a word
15960 or phrase, end the last word with a @samp{$}; for example,
15961 @samp{catching mistakes$}.  This can be helpful when you want to see
15962 all the nodes that are part of the same chapter or section and
15963 therefore have the same `Up' pointer.@refill
15964
15965 @xref{Other Repeating Search, , Using Occur, emacs , The GNU Emacs Manual},
15966 for more information.@refill
15967
15968 @node Running Info-Validate, , Using occur, Catching Mistakes
15969 @comment  node-name,  next,  previous,  up
15970 @appendixsec Finding Badly Referenced Nodes
15971 @findex Info-validate
15972 @cindex Nodes, checking for badly referenced
15973 @cindex Checking for badly referenced nodes
15974 @cindex Looking for badly referenced nodes
15975 @cindex Finding badly referenced nodes
15976 @cindex Badly referenced nodes
15977
15978 You can use the @code{Info-validate} command to check whether any of
15979 the `Next', `Previous', `Up' or other node pointers fail to point to a
15980 node.  This command checks that every node pointer points to an
15981 existing node.  The @code{Info-validate} command works only on Info
15982 files, not on Texinfo files.@refill
15983
15984 The @code{makeinfo} program validates pointers automatically, so you
15985 do not need to use the @code{Info-validate} command if you are using
15986 @code{makeinfo}.  You only may need to use @code{Info-validate} if you
15987 are unable to run @code{makeinfo} and instead must create an Info file
15988 using @code{texinfo-format-region} or @code{texinfo-format-buffer}, or
15989 if you write an Info file from scratch.@refill
15990
15991 @menu
15992 * Using Info-validate::         How to run @code{Info-validate}.
15993 * Unsplit::                     How to create an unsplit file.
15994 * Tagifying::                   How to tagify a file.
15995 * Splitting::                   How to split a file manually.
15996 @end menu
15997
15998 @node Using Info-validate, Unsplit, Running Info-Validate, Running Info-Validate
15999 @appendixsubsec Running @code{Info-validate}
16000 @cindex Running @code{Info-validate}
16001 @cindex Info validating a large file
16002 @cindex Validating a large file
16003
16004 To use @code{Info-validate}, visit the Info file you wish to check and
16005 type:@refill
16006
16007 @example
16008 M-x Info-validate
16009 @end example
16010
16011 @noindent
16012 (Note that the @code{Info-validate} command requires an upper case
16013 `I'.  You may also need to create a tag table before running
16014 @code{Info-validate}.  @xref{Tagifying}.)@refill
16015
16016 If your file is valid, you will receive a message that says ``File appears
16017 valid''.  However, if you have a pointer that does not point to a node,
16018 error messages will be displayed in a buffer called @samp{*problems in
16019 info file*}.@refill
16020
16021 For example, @code{Info-validate} was run on a test file that contained
16022 only the first node of this manual.  One of the messages said:@refill
16023
16024 @example
16025 In node "Overview", invalid Next: Texinfo Mode
16026 @end example
16027
16028 @noindent
16029 This meant that the node called @samp{Overview} had a `Next' pointer that
16030 did not point to anything (which was true in this case, since the test file
16031 had only one node in it).@refill
16032
16033 Now suppose we add a node named @samp{Texinfo Mode} to our test case
16034 but we do not specify a `Previous' for this node.  Then we will get
16035 the following error message:@refill
16036
16037 @example
16038 In node "Texinfo Mode", should have Previous: Overview
16039 @end example
16040
16041 @noindent
16042 This is because every `Next' pointer should be matched by a
16043 `Previous' (in the node where the `Next' points) which points back.@refill
16044
16045 @code{Info-validate} also checks that all menu entries and cross references
16046 point to actual nodes.@refill
16047
16048 Note that @code{Info-validate} requires a tag table and does not work
16049 with files that have been split.  (The @code{texinfo-format-buffer}
16050 command automatically splits large files.)  In order to use
16051 @code{Info-validate} on a large file, you must run
16052 @code{texinfo-format-buffer} with an argument so that it does not split
16053 the Info file; and you must create a tag table for the unsplit
16054 file.@refill
16055
16056 @node Unsplit, Tagifying, Using Info-validate, Running Info-Validate
16057 @comment  node-name,  next,  previous,  up
16058 @appendixsubsec Creating an Unsplit File
16059 @cindex Creating an unsplit file
16060 @cindex Unsplit file creation
16061
16062 You can run @code{Info-validate} only on a single Info file that has a
16063 tag table.  The command will not work on the indirect subfiles that
16064 are generated when a master file is split.  If you have a large file
16065 (longer than 70,000 bytes or so), you need to run the
16066 @code{texinfo-format-buffer} or @code{makeinfo-buffer} command in such
16067 a way that it does not create indirect subfiles.  You will also need
16068 to create a tag table for the Info file.  After you have done this,
16069 you can run @code{Info-validate} and look for badly referenced
16070 nodes.@refill
16071
16072 The first step is to create an unsplit Info file.  To prevent
16073 @code{texinfo-format-buffer} from splitting a Texinfo file into
16074 smaller Info files, give a prefix to the @kbd{M-x
16075 texinfo-format-buffer} command:@refill
16076
16077 @example
16078 C-u M-x texinfo-format-buffer
16079 @end example
16080
16081 @noindent
16082 or else
16083
16084 @example
16085 C-u C-c C-e C-b
16086 @end example
16087
16088 @noindent
16089 When you do this, Texinfo will not split the file and will not create
16090 a tag table for it. @refill
16091 @cindex Making a tag table manually
16092 @cindex Tag table, making manually
16093
16094 @node Tagifying, Splitting, Unsplit, Running Info-Validate
16095 @appendixsubsec Tagifying a File
16096
16097 After creating an unsplit Info file, you must create a tag table for
16098 it.  Visit the Info file you wish to tagify and type:@refill
16099
16100 @example
16101 M-x Info-tagify
16102 @end example
16103
16104 @noindent
16105 (Note the upper case @samp{I} in @code{Info-tagify}.)  This creates an
16106 Info file with a tag table that you can validate.@refill
16107
16108 The third step is to validate the Info file:@refill
16109
16110 @example
16111 M-x Info-validate
16112 @end example
16113
16114 @noindent
16115 (Note the upper case @samp{I} in @code{Info-validate}.)
16116 In brief, the steps are:@refill
16117
16118 @example
16119 @group
16120 C-u M-x texinfo-format-buffer
16121 M-x Info-tagify
16122 M-x Info-validate
16123 @end group
16124 @end example
16125
16126 After you have validated the node structure, you can rerun
16127 @code{texinfo-format-buffer} in the normal way so it will construct a
16128 tag table and split the file automatically, or you can make the tag
16129 table and split the file manually.@refill
16130
16131 @node Splitting, , Tagifying, Running Info-Validate
16132 @comment  node-name,  next,  previous,  up
16133 @appendixsubsec Splitting a File Manually
16134 @cindex Splitting an Info file manually
16135 @cindex Info file, splitting manually
16136
16137 You should split a large file or else let the
16138 @code{texinfo-format-buffer} or @code{makeinfo-buffer} command do it
16139 for you automatically.  (Generally you will let one of the formatting
16140 commands do this job for you.  @xref{Create an Info File}.)@refill
16141
16142 The split-off files are called the indirect subfiles.@refill
16143
16144 Info files are split to save memory.  With smaller files, Emacs does not
16145 have make such a large buffer to hold the information.@refill
16146
16147 If an Info file has more than 30 nodes, you should also make a tag
16148 table for it. @xref{Using Info-validate}, for information
16149 about creating a tag table.  (Again, tag tables are usually created
16150 automatically by the formatting command; you only need to create a tag
16151 table yourself if you are doing the job manually.  Most likely, you
16152 will do this for a large, unsplit file on which you have run
16153 @code{Info-validate}.)@refill
16154
16155 @c Info-split is autoloaded in `loaddefs.el' in Emacs 18.51
16156 @ignore
16157 Before running @code{Info-split}, you need to load the @code{info} library
16158 into Emacs by giving the command @kbd{M-x load-library @key{RET} info
16159 @key{RET}}.
16160 @end ignore
16161
16162 Visit the Info file you wish to tagify and split and type the two
16163 commands:@refill
16164
16165 @example
16166 M-x Info-tagify
16167 M-x Info-split
16168 @end example
16169
16170 @noindent
16171 (Note that the @samp{I} in @samp{Info} is upper case.)@refill
16172
16173 When you use the @code{Info-split} command, the buffer is modified into a
16174 (small) Info file which lists the indirect subfiles.  This file should be
16175 saved in place of the original visited file.  The indirect subfiles are
16176 written in the same directory the original file is in, with names generated
16177 by appending @samp{-} and a number to the original file name.@refill
16178
16179 The primary file still functions as an Info file, but it contains just
16180 the tag table and a directory of subfiles.@refill
16181
16182 @node Refilling Paragraphs, Command Syntax, Catching Mistakes, Top
16183 @comment  node-name,  next,  previous,  up
16184 @appendix Refilling Paragraphs
16185 @cindex Refilling paragraphs
16186 @cindex Filling paragraphs
16187 @findex refill
16188
16189 The @code{@@refill} command refills and, optionally, indents the first
16190 line of a paragraph.@footnote{Perhaps the command should have been
16191 called the @code{@@refillandindent} command, but @code{@@refill} is
16192 shorter and the name was chosen before indenting was possible.} The
16193 @code{@@refill} command is no longer important, but we describe it here
16194 because you once needed it.  You will see it in many old Texinfo
16195 files.@refill
16196
16197 Without refilling, paragraphs containing long @@-constructs may look
16198 bad after formatting because the formatter removes @@-commands and
16199 shortens some lines more than others.  In the past, neither the
16200 @code{texinfo-format-region} command nor the
16201 @code{texinfo-format-buffer} command refilled paragraphs
16202 automatically.  The @code{@@refill} command had to be written at the
16203 end of every paragraph to cause these formatters to fill them.  (Both
16204 @TeX{} and @code{makeinfo} have always refilled paragraphs
16205 automatically.)  Now, all the Info formatters automatically fill and
16206 indent those paragraphs that need to be filled and indented.@refill
16207
16208 The @code{@@refill} command causes @code{texinfo-format-region} and
16209 @code{texinfo-format-buffer} to refill a paragraph in the Info file
16210 @emph{after} all the other processing has been done.  For this reason,
16211 you can not use @code{@@refill} with a paragraph containing either
16212 @code{@@*} or @code{@@w@{ @dots{} @}} since the refilling action will
16213 override those two commands.@refill
16214
16215 The @code{texinfo-format-region} and @code{texinfo-format-buffer}
16216 commands now automatically append @code{@@refill} to the end of each
16217 paragraph that should be filled.  They do not append @code{@@refill} to
16218 the ends of paragraphs that contain @code{@@*} or @w{@code{@@w@{ @dots{}@}}}
16219 and therefore do not refill or indent them.@refill
16220
16221 @node Command Syntax, Obtaining TeX, Refilling Paragraphs, Top
16222 @comment node-name,  next,  previous,  up
16223 @appendix @@-Command Syntax
16224 @cindex @@-command syntax
16225
16226 The character @samp{@@} is used to start special Texinfo commands.
16227 (It has the same meaning that @samp{\} has in plain @TeX{}.)  Texinfo
16228 has four types of @@-command:@refill
16229
16230 @table @asis
16231 @item 1. Non-alphabetic commands.
16232 These commands consist of an @@ followed by a punctuation mark or other
16233 character that is not part of the alphabet.  Non-alphabetic commands
16234 are almost always part of the text within a paragraph, and never take
16235 any argument.  The two characters (@@ and the other one) are complete
16236 in themselves; none is followed by braces.  The non-alphabetic
16237 commands are: @code{@@.}, @code{@@:}, @code{@@*}, @code{@@@@},
16238 @code{@@@{}, and @code{@@@}}.@refill
16239
16240 @item 2. Alphabetic commands that do not require arguments.
16241 These commands start with @@ followed by a word followed by left- and
16242 right-hand braces.  These commands insert special symbols in the
16243 document; they do not require arguments.  For example,
16244 @code{@@dots@{@}} @result{} @samp{@dots{}}, @code{@@equiv@{@}}
16245 @result{} @samp{@equiv{}}, @code{@@TeX@{@}} @result{} `@TeX{}',
16246 and @code{@@bullet@{@}} @result{} @samp{@bullet{}}.@refill
16247
16248 @item 3. Alphabetic commands that require arguments within braces.
16249 These commands start with @@ followed by a letter or a word, followed by an
16250 argument within braces.  For example, the command @code{@@dfn} indicates
16251 the introductory or defining use of a term; it is used as follows: @samp{In
16252 Texinfo, @@@@-commands are @@dfn@{mark-up@} commands.}@refill
16253
16254 @item 4. Alphabetic commands that occupy an entire line.
16255 These commands occupy an entire line.  The line starts with @@,
16256 followed by the name of the command (a word); for example, @code{@@center}
16257 or @code{@@cindex}.  If no argument is needed, the word is followed by
16258 the end of the line.  If there is an argument, it is separated from
16259 the command name by a space.  Braces are not used.@refill
16260 @end table
16261
16262 @cindex Braces and argument syntax
16263 Thus, the alphabetic commands fall into classes that have
16264 different argument syntaxes.  You cannot tell to which class a command
16265 belongs by the appearance of its name, but you can tell by the
16266 command's meaning: if the command stands for a glyph, it is in
16267 class 2 and does not require an argument; if it makes sense to use the
16268 command together with other text as part of a paragraph, the command
16269 is in class 3 and must be followed by an argument in braces;
16270 otherwise, it is in class 4 and uses the rest of the line as its
16271 argument.@refill
16272
16273 The purpose of having a different syntax for commands of classes 3 and
16274 4 is to make Texinfo files easier to read, and also to help the GNU
16275 Emacs paragraph and filling commands work properly.  There is only one
16276 exception to this rule: the command @code{@@refill}, which is always
16277 used at the end of a paragraph immediately following the final period
16278 or other punctuation character.  @code{@@refill} takes no argument and
16279 does @emph{not} require braces.  @code{@@refill} never confuses the
16280 Emacs paragraph commands because it cannot appear at the beginning of
16281 a line.@refill
16282
16283 @node Obtaining TeX, New Features, Command Syntax, Top
16284 @appendix How to Obtain @TeX{}
16285 @cindex Obtaining @TeX{}
16286 @cindex @TeX{}, how to obtain
16287
16288 @c !!! Here is information about obtaining TeX.  Update it whenever.
16289 @c !!! Also consider updating TeX.README on prep.
16290 @c     Updated by RJC on 1 March 1995, conversation with MacKay.
16291 @c     Updated by kb@cs.umb.edu on 29 July 1996.
16292 @TeX{} is freely redistributable.  You can obtain @TeX{} for Unix
16293 systems via anonymous ftp or on tape or CD-ROM.  The core material
16294 consists of Karl Berry's Web2c @TeX{} distribution.
16295
16296 On-line retrieval instructions are available from either:
16297 @example
16298 @url{ftp://ftp.tug.org/tex/unixtex.ftp}
16299 @url{http://www.tug.org/unixtex.ftp}
16300 @end example
16301
16302 The Free Software Foundation provides a core distribution on its Source
16303 Code CD-ROM suitable for printing Texinfo manuals; the University of
16304 Washington maintains and supports a tape distribution; the @TeX{} Users
16305 Group co-sponsors a complete CD-ROM @TeX{} distribution.
16306
16307 For the FSF Source Code CD-ROM, please contact:
16308
16309 @iftex
16310 @display
16311 @group
16312 Free Software Foundation, Inc.
16313 59 Temple Place Suite 330
16314 Boston, MA w{ } 02111-1307
16315 USA
16316
16317 Telephone: @w{@t{+}1--617--542--5942}
16318 Fax: (including Japan) @w{@t{+}1--617--542--2652}
16319 Free Dial Fax (in Japan):
16320 @w{ } @w{ } @w{ } 0031--13--2473 (KDD)
16321 @w{ } @w{ } @w{ } 0066--3382--0158 (IDC)
16322 Electronic mail: @code{gnu@@prep.ai.mit.edu}
16323 @end group
16324 @end display
16325 @end iftex
16326 @ifinfo
16327 @display
16328 @group
16329 Free Software Foundation, Inc.
16330 59 Temple Place Suite 330
16331 Boston, MA @w{ } 02111-1307
16332 USA
16333
16334 Telephone: @w{@t{+}1-617-542-5942}
16335 Fax: (including Japan) @w{@t{+}1-617-542-2652}
16336 Free Dial Fax (in Japan):
16337 @w{ } @w{ } @w{ } 0031-13-2473 (KDD)
16338 @w{ } @w{ } @w{ } 0066-3382-0158 (IDC)
16339 Electronic mail: @code{gnu@@prep.ai.mit.edu}
16340 @end group
16341 @end display
16342 @end ifinfo
16343
16344 To order a full distribution on CD-ROM, please see:
16345 @display
16346 @url{http://www.tug.org/tex-live.html}
16347 @end display
16348
16349 @noindent
16350 (The distribution is also available by FTP; see the URL's above.)
16351
16352 To order a full distribution from the University of Washington on either a
16353 1/4@dmn{in} 4-track QIC-24 cartridge or a 4@dmn{mm} DAT cartridge, send
16354 $210 to:
16355
16356 @display
16357 @group
16358 Pierre A. MacKay
16359 Denny Hall, Mail Stop DH-10
16360 University of Washington
16361 Seattle, WA @w{ } 98195
16362 USA
16363
16364 Telephone: @t{+}1--206--543--2268
16365 Electronic mail: @code{mackay@@cs.washington.edu}
16366 @end group
16367 @end display
16368
16369 Please make checks payable to the University of Washington.
16370 Checks must be in U.S.@: dollars, drawn on a U.S.@: bank.
16371
16372 Prepaid orders are the only orders that can now be handled.  Overseas
16373 sites: please add to the base cost, if desired, $20.00 for shipment
16374 via air parcel post, or $30.00 for shipment via courier.
16375
16376 Please check with the above for current prices and formats.
16377
16378
16379 @node New Features, Command and Variable Index, Obtaining TeX, Top
16380 @appendix Second Edition Features
16381
16382 @tex
16383 % Widen the space for the first column so three control-character
16384 % strings fit in the first column.  Switched back to default .8in
16385 % value at end of chapter.
16386 \global\tableindent=1.0in
16387 @end tex
16388
16389 The second edition of the Texinfo manual describes more than 20 new
16390 Texinfo mode commands and more than 50 previously undocumented Texinfo
16391 @@-commands.  This edition is more than twice the length of the first
16392 edition.@refill
16393
16394 Here is a brief description of the new commands.@refill
16395
16396 @menu
16397 * New Texinfo Mode Commands::   The updating commands are especially useful.
16398 * New Commands::                Many newly described @@-commands.
16399 @end menu
16400
16401 @node New Texinfo Mode Commands, New Commands, New Features, New Features
16402 @appendixsec New Texinfo Mode Commands
16403
16404 Texinfo mode provides commands and features especially designed for
16405 working with Texinfo files.  More than 20 new commands have been
16406 added, including commands for automatically creating and updating
16407 both nodes and menus.  This is a tedious task when done by hand.@refill
16408
16409 The keybindings are intended to be somewhat mnemonic.@refill
16410
16411 @subheading Update all nodes and menus
16412
16413 The @code{texinfo-master-menu} command is the primary command:
16414
16415 @table @kbd
16416 @item C-c C-u m
16417 @itemx M-x texinfo-master-menu
16418 Create or update a master menu.
16419 With @kbd{C-u} as a prefix argument,
16420 first create or update all nodes
16421 and regular menus.
16422 @end table
16423
16424 @subheading Update Pointers
16425
16426 @noindent
16427 Create or update `Next', `Previous', and `Up' node pointers.@refill
16428
16429 @noindent
16430 @xref{Updating Nodes and Menus}.
16431
16432 @table @kbd
16433 @item C-c C-u C-n
16434 @itemx M-x texinfo-update-node
16435 Update a node.
16436
16437 @item C-c C-u C-e
16438 @itemx M-x texinfo-every-node-update
16439 Update every node in the buffer.
16440 @end table
16441
16442 @subheading Update Menus
16443
16444 @noindent
16445 Create or update menus.@refill
16446
16447 @noindent
16448 @xref{Updating Nodes and Menus}.
16449
16450 @table @kbd
16451 @item C-c C-u C-m
16452 @itemx M-x texinfo-make-menu
16453 Make or update a menu.
16454
16455 @item C-c C-u C-a
16456 @itemx M-x texinfo-all-menus-update
16457 Make or update all the menus in a buffer.
16458 With @kbd{C-u} as a prefix argument,
16459 first update all the nodes.
16460 @end table
16461
16462 @subheading Insert Title as Description
16463
16464 @noindent
16465 Insert a node's chapter or section title in the space for the
16466 description in a menu entry line; position point so you can edit the
16467 insert.  (This command works somewhat differently than the other
16468 insertion commands, which insert only a predefined string.)@refill
16469
16470 @noindent
16471 @xref{Inserting, Inserting Frequently Used Commands}.
16472
16473 @table @kbd
16474 @item C-c C-c C-d
16475 Insert title.
16476 @end table
16477
16478 @subheading Format for Info
16479
16480 @noindent
16481 Provide keybindings both for the Info formatting commands that are
16482 written in Emacs Lisp and for @code{makeinfo} that is written in
16483 C.@refill
16484
16485 @noindent
16486 @xref{Info Formatting}.
16487
16488 @noindent
16489 Use the Emacs lisp @code{texinfo-format@dots{}} commands:
16490
16491 @table @kbd
16492 @item C-c C-e C-r
16493 Format the region.
16494
16495 @item C-c C-e C-b
16496 Format the buffer.
16497 @end table
16498
16499 @noindent
16500 Use @code{makeinfo}:
16501
16502 @table @kbd
16503 @item C-c C-m C-r
16504 Format the region.
16505
16506 @item C-c C-m C-b
16507 Format the buffer.
16508
16509 @item C-c C-m C-l
16510 Recenter the @code{makeinfo} output buffer.
16511
16512 @item C-c C-m C-k
16513 Kill the @code{makeinfo} formatting job.
16514 @end table
16515
16516 @subheading Typeset and Print
16517
16518 @noindent
16519 Typeset and print Texinfo documents from within Emacs.@refill
16520
16521 @ifinfo
16522 @noindent
16523 @xref{Printing}.
16524 @end ifinfo
16525 @iftex
16526 @noindent
16527 @xref{Printing, , Formatting and Printing}.
16528 @end iftex
16529
16530 @table @kbd
16531 @item C-c C-t C-b
16532 Run @code{texi2dvi} on the buffer.
16533
16534 @item C-c C-t C-r
16535 Run @TeX{} on the region.
16536
16537 @item C-c C-t C-i
16538 Run @code{texindex}.
16539
16540 @item C-c C-t C-p
16541 Print the @sc{dvi} file.
16542
16543 @item C-c C-t C-q
16544 Show the print queue.
16545
16546 @item C-c C-t C-d
16547 Delete a job from the print queue.
16548
16549 @item C-c C-t C-k
16550 Kill the current @TeX{} formatting job.
16551
16552 @item C-c C-t C-x
16553 Quit a currently stopped @TeX{} formatting job.
16554
16555 @item C-c C-t C-l
16556 Recenter the output buffer.
16557 @end table
16558
16559 @subheading Other Updating Commands
16560
16561 @noindent
16562 The ``other updating commands'' do not have standard keybindings because
16563 they are used less frequently.@refill
16564
16565 @noindent
16566 @xref{Other Updating Commands}.
16567
16568 @table @kbd
16569 @item M-x texinfo-insert-node-lines
16570 Insert missing @code{@@node} lines using
16571 section titles as node names.
16572
16573 @item M-x texinfo-multiple-files-update
16574 Update a multi-file document.
16575 With a numeric prefix, such as @kbd{C-u 8},
16576 update  @strong{every} pointer and
16577 menu in @strong{all} the files and
16578 then insert a master menu.
16579
16580 @item M-x texinfo-indent-menu-description
16581 Indent descriptions in menus.
16582
16583 @item M-x texinfo-sequential-node-update
16584 Insert node pointers in strict sequence.
16585 @end table
16586
16587 @node New Commands, , New Texinfo Mode Commands, New Features
16588 @appendixsec New Texinfo @@-Commands
16589
16590 The second edition of the Texinfo manual describes more than 50
16591 commands that were not described in the first edition.  A third or so
16592 of these commands existed in Texinfo but were not documented in the
16593 manual; the others are new.  Here is a listing, with brief
16594 descriptions of them:@refill
16595
16596 @subheading Indexing
16597
16598 @noindent
16599 Create your own index, and merge indices.@refill
16600
16601 @noindent
16602 @xref{Indices}.
16603
16604 @table @kbd
16605 @item @@defindex @var{index-name}
16606 Define a new index and its indexing command.
16607 See also the @code{@@defcodeindex} command.
16608
16609 @c written verbosely to avoid overfull hbox
16610 @item @@synindex @var{from-index} @var{into-index}
16611 Merge the @var{from-index} index into the @var{into-index} index.
16612 See also the @code{@@syncodeindex} command.
16613 @end table
16614
16615 @subheading Definitions
16616
16617 @noindent
16618 Describe functions, variables, macros,
16619 commands, user options, special forms, and other such artifacts in a
16620 uniform format.@refill
16621
16622 @noindent
16623 @xref{Definition Commands}.
16624
16625 @table @kbd
16626 @item @@deffn @var{category} @var{name} @var{arguments}@dots{}
16627 Format a description for functions, interactive
16628 commands, and similar entities.
16629
16630 @item @@defvr, @@defop, @dots{}
16631 15 other related commands.
16632 @end table
16633
16634 @subheading Glyphs
16635
16636 @noindent
16637 Indicate the results of evaluation, expansion,
16638 printed output, an error message, equivalence of expressions, and the
16639 location of point.@refill
16640
16641 @noindent
16642 @xref{Glyphs}.
16643
16644 @table @kbd
16645 @item @@equiv@{@}
16646 @itemx @equiv{}
16647 Equivalence:
16648
16649 @item @@error@{@}
16650 @itemx @error{}
16651 Error message
16652
16653 @item @@expansion@{@}
16654 @itemx @expansion{}
16655 Macro expansion
16656
16657 @item @@point@{@}
16658 @itemx @point{}
16659 Position of point
16660
16661 @item @@print@{@}
16662 @itemx @print{}
16663 Printed output
16664
16665 @item @@result@{@}
16666 @itemx @result{}
16667 Result of an expression
16668 @end table
16669
16670 @subheading Page Headings
16671
16672 @noindent
16673 Customize page headings.
16674
16675 @noindent
16676 @xref{Headings}.
16677
16678 @table @kbd
16679 @item @@headings @var{on-off-single-double}
16680 Headings on or off, single, or double-sided.
16681
16682 @item @@evenfooting [@var{left}] @@| [@var{center}] @@| [@var{right}]
16683 Footings for even-numbered (left-hand) pages.
16684
16685 @item @@evenheading, @@everyheading, @@oddheading, @dots{}
16686 Five other related commands.
16687
16688 @item @@thischapter
16689 Insert name of chapter and chapter number.
16690
16691 @item @@thischaptername, @@thisfile, @@thistitle, @@thispage
16692 Related commands.
16693 @end table
16694
16695 @subheading Formatting
16696
16697 @noindent
16698 Format blocks of text.
16699
16700 @noindent
16701 @xref{Quotations and Examples}, and@*
16702 @ref{Lists and Tables, , Making Lists and Tables}.
16703
16704 @table @kbd
16705 @item @@cartouche
16706 Draw rounded box surrounding text (not in Info).
16707
16708 @item @@enumerate @var{optional-arg}
16709 Enumerate a list with letters or numbers.
16710
16711 @item @@exdent @var{line-of-text}
16712 Remove indentation.
16713
16714 @item @@flushleft
16715 Left justify.
16716
16717 @item @@flushright
16718 Right justify.
16719
16720 @item @@format
16721 Do not narrow nor change font.
16722
16723 @item @@ftable @var{formatting-command}
16724 @itemx @@vtable @var{formatting-command}
16725 Two-column table with indexing.
16726
16727 @item @@lisp
16728 For an example of Lisp code.
16729
16730 @item @@smallexample
16731 @itemx @@smalllisp
16732 Like @@table and @@lisp @r{but for} @@smallbook.
16733 @end table
16734
16735 @subheading Conditionals
16736
16737 @noindent
16738 Conditionally format text.
16739
16740 @noindent
16741 @xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill
16742
16743 @table @kbd
16744 @item @@set @var{flag} [@var{string}]
16745 Set a flag.  Optionally, set value
16746 of @var{flag} to @var{string}.
16747
16748 @item @@clear @var{flag}
16749 Clear a flag.
16750
16751 @item @@value@{@var{flag}@}
16752 Replace with value to which @var{flag} is set.
16753
16754 @item @@ifset @var{flag}
16755 Format, if @var{flag} is set.
16756
16757 @item @@ifclear @var{flag}
16758 Ignore, if @var{flag} is set.
16759 @end table
16760
16761 @subheading @@heading series for Titles
16762
16763 @noindent
16764 Produce unnumbered headings that do not appear in a table of contents.
16765
16766 @noindent
16767 @xref{Structuring}.
16768
16769 @table @kbd
16770 @item @@heading @var{title}
16771 Unnumbered section-like heading not listed
16772 in the table of contents of a printed manual.
16773
16774 @item @@chapheading, @@majorheading, @@subheading, @@subsubheading
16775 Related commands.
16776 @end table
16777
16778 @need 1000
16779 @subheading Font commands
16780
16781 @need 1000
16782 @noindent
16783 @xref{Smallcaps}, and @*
16784 @ref{Fonts}.
16785
16786 @table @kbd
16787 @item @@r@{@var{text}@}
16788 Print in roman font.
16789
16790 @item @@sc@{@var{text}@}
16791 Print in @sc{small caps} font.
16792 @end table
16793
16794 @subheading Miscellaneous
16795
16796 @noindent
16797 See @ref{title subtitle author, , @code{@@title} @code{@@subtitle} and @code{@@author} Commands},@*
16798 see @ref{Customized Highlighting},@*
16799 see @ref{Overfull hboxes},@*
16800 see @ref{Footnotes},@*
16801 see @ref{dmn, , Format a Dimension},@*
16802 see @ref{Raise/lower sections, , @code{@@raisesections} and @code{@@lowersections}},@*
16803 see @ref{math, , @code{@@math}: Inserting Mathematical Expressions}.@*
16804 see @ref{minus, , Inserting a Minus Sign},@*
16805 see @ref{paragraphindent, , Paragraph Indenting},@*
16806 see @ref{Cross Reference Commands},@*
16807 see @ref{title subtitle author, , @code{@@title} @code{@@subtitle} and @code{@@author}}, and@*
16808 see @ref{Custom Headings, , How to Make Your Own Headings}.
16809
16810 @table @kbd
16811 @item @@author @var{author}
16812 Typeset author's name.
16813
16814 @ignore
16815 @item @@definfoenclose @var{new-command}, @var{before}, @var{after},
16816 Define a highlighting command for Info.  (Info only.)
16817 @end ignore
16818
16819 @item @@finalout
16820 Produce cleaner printed output.
16821
16822 @item @@footnotestyle @var{end-or-separate}
16823 Specify footnote style.
16824
16825 @item @@dmn@{@var{dimension}@}
16826 Format a dimension.
16827
16828 @item @@global@@let@var{new-cmd}=@var{existing-cmd}
16829 Define a highlighting command for @TeX{}. (@TeX{} only.)
16830
16831 @item @@lowersections
16832 Reduce hierarchical level of sectioning commands.
16833
16834 @item @@math@{@var{mathematical-expression}@}
16835 Format a mathematical expression.
16836
16837 @item @@minus@{@}
16838 Generate a minus sign.
16839
16840 @item @@paragraphindent @var{asis-or-number}
16841 Specify paragraph indentation.
16842
16843 @item @@raisesections
16844 Raise hierarchical level of sectioning commands.
16845
16846 @item @@ref@{@var{node-name}, @r{[}@var{entry}@r{]}, @r{[}@var{topic-or-title}@r{]}, @r{[}@var{info-file}@r{]}, @r{[}@var{manual}@r{]}@}
16847 Make a reference.  In the printed manual, the
16848 reference does not start with the word `see'.
16849
16850 @item @@title @var{title}
16851 Typeset @var{title} in the alternative
16852 title page format.
16853
16854 @item @@subtitle @var{subtitle}
16855 Typeset @var{subtitle} in the alternative
16856 title page format.
16857
16858 @item @@today@{@}
16859 Insert the current date.
16860 @end table
16861 @tex
16862 % Switch width of first column of tables back to default value
16863 \global\tableindent=.8in
16864 @end tex
16865
16866
16867 @node Command and Variable Index, Concept Index, New Features, Top
16868 @comment  node-name,  next,  previous,  up
16869 @unnumbered Command and Variable Index
16870
16871 This is an alphabetical list of all the @@-commands, assorted Emacs Lisp
16872 functions, and several variables.  To make the list easier to use, the
16873 commands are listed without their preceding @samp{@@}.@refill
16874
16875 @printindex fn
16876
16877
16878 @node Concept Index, , Command and Variable Index, Top
16879 @unnumbered Concept Index
16880
16881 @printindex cp
16882
16883
16884 @summarycontents
16885 @contents
16886 @bye