comparison man/texinfo.texi @ 0:376386a54a3c r19-14

Import from CVS: tag r19-14
author cvs
date Mon, 13 Aug 2007 08:45:50 +0200
parents
children ec9a17fef872
comparison
equal deleted inserted replaced
-1:000000000000 0:376386a54a3c
1 \input texinfo.tex @c -*-texinfo-*-
2 @comment %**start of header
3 @setfilename ../info/texinfo.info
4 @settitle Texinfo @value{edition}
5 @syncodeindex vr fn
6 @footnotestyle separate
7 @paragraphindent 2
8 @smallbook
9 @comment %**end of header
10
11 @c Set smallbook if printing in smallbook format so the example of the
12 @c smallbook font is actually written using smallbook; in bigbook, a kludge
13 @c is used for TeX output.
14 @set smallbook
15 @c @@clear smallbook
16
17 @ignore
18 @ifinfo
19 @format
20 START-INFO-DIR-ENTRY
21 * Texinfo: (texinfo). The documentation format for the GNU Project.
22 END-INFO-DIR-ENTRY
23 @end format
24 @end ifinfo
25 @end ignore
26
27 @set edition 2.21
28 @set update-date 7 June 1995
29 @set update-month June 1995
30
31 @c Experiment with smaller amounts of whitespace between chapters
32 @c and sections.
33 @tex
34 \global\chapheadingskip = 15pt plus 4pt minus 2pt
35 \global\secheadingskip = 12pt plus 3pt minus 2pt
36 \global\subsecheadingskip = 9pt plus 2pt minus 2pt
37 @end tex
38
39 @c Experiment with smaller amounts of whitespace between paragraphs in
40 @c the 8.5 by 11 inch format.
41 @ifclear smallbook
42 @tex
43 \global\parskip 6pt plus 1pt
44 @end tex
45 @end ifclear
46
47 @finalout
48
49 @c Currently undocumented command, 5 December 1993:
50 @c
51 @c nwnode (Same as node, but no warnings; for `makeinfo'.)
52
53 @ifinfo
54 This file documents Texinfo, a documentation system that uses a single
55 source file to produce both on-line information and a printed manual.
56
57 Copyright (C) 1988, 1990, 1991, 1992, 1993, 1995 Free Software Foundation, Inc.
58
59 This is the second edition of the Texinfo documentation,@*
60 and is consistent with version 2 of @file{texinfo.tex}.
61
62 Permission is granted to make and distribute verbatim copies of
63 this manual provided the copyright notice and this permission notice
64 are preserved on all copies.
65
66 @ignore
67 Permission is granted to process this file through TeX and print the
68 results, provided the printed document carries copying permission
69 notice identical to this one except for the removal of this paragraph
70 (this paragraph not being relevant to the printed manual).
71
72 @end ignore
73 Permission is granted to copy and distribute modified versions of this
74 manual under the conditions for verbatim copying, provided that the entire
75 resulting derived work is distributed under the terms of a permission
76 notice identical to this one.
77
78 Permission is granted to copy and distribute translations of this manual
79 into another language, under the above conditions for modified versions,
80 except that this permission notice may be stated in a translation approved
81 by the Free Software Foundation.
82 @end ifinfo
83
84 @setchapternewpage odd
85
86 @shorttitlepage Texinfo
87
88 @titlepage
89 @c use the new format for titles
90 @title Texinfo
91 @subtitle The GNU Documentation Format
92 @subtitle Edition @value{edition}, for Texinfo Version Three
93 @subtitle @value{update-month}
94
95 @author by Robert J. Chassell and Richard M. Stallman
96
97 @comment Include the Distribution inside the titlepage so
98 @c that headings are turned off.
99
100 @page
101 @vskip 0pt plus 1filll
102 Copyright @copyright{} 1988, 1990, 1991, 1992, 1993, 1995 Free Software Foundation, Inc.
103
104 @sp 2
105 This is the second edition of the Texinfo documentation,@*
106 and is consistent with version 2 of @file{texinfo.tex}.
107 @sp 2
108
109 Published by the Free Software Foundation @*
110 59 Temple Place Suite 330, @*
111 Boston, MA 02111-1307 USA @*
112 Printed copies are available for $15 each.@*
113 ISBN 1-882114-63-9
114 @c ISBN number 1-882114-63-9 is for edition 2.20 of 28 February 1995
115
116 Permission is granted to make and distribute verbatim copies of
117 this manual provided the copyright notice and this permission notice
118 are preserved on all copies.
119
120 Permission is granted to copy and distribute modified versions of this
121 manual under the conditions for verbatim copying, provided that the entire
122 resulting derived work is distributed under the terms of a permission
123 notice identical to this one.
124
125 Permission is granted to copy and distribute translations of this manual
126 into another language, under the above conditions for modified versions,
127 except that this permission notice may be stated in a translation approved
128 by the Free Software Foundation.
129 @sp 2
130 Cover art by Etienne Suvasa.
131 @end titlepage
132
133 @ifinfo
134 @node Top, Copying, (dir), (dir)
135 @top Texinfo
136
137 Texinfo is a documentation system that uses a single source file to
138 produce both on-line information and printed output.@refill
139
140 The first part of this master menu lists the major nodes in this Info
141 document, including the @@-command and concept indices. The rest of
142 the menu lists all the lower level nodes in the document.@refill
143
144 This is Edition @value{edition} of the Texinfo documentation,
145 @w{@value{update-date},} for Texinfo Version Three.
146 @end ifinfo
147
148 @c Here is a spare copy of the chapter menu entry descriptions,
149 @c in case they are accidently deleted
150 @ignore
151 Your rights.
152 Texinfo in brief.
153 How to use Texinfo mode.
154 What is at the beginning of a Texinfo file?
155 What is at the end of a Texinfo file?
156 How to create chapters, sections, subsections,
157 appendices, and other parts.
158 How to provide structure for a document.
159 How to write nodes.
160 How to write menus.
161 How to write cross references.
162 How to mark words and phrases as code,
163 keyboard input, meta-syntactic
164 variables, and the like.
165 How to write quotations, examples, etc.
166 How to write lists and tables.
167 How to create indices.
168 How to insert @@-signs, braces, etc.
169 How to indicate results of evaluation,
170 expansion of macros, errors, etc.
171 How to force and prevent line and page breaks.
172 How to describe functions and the like in a uniform manner.
173 How to write footnotes.
174 How to specify text for either @TeX{} or Info.
175 How to print hardcopy.
176 How to create an Info file.
177 How to install an Info file
178 A list of all the Texinfo @@-commands.
179 Hints on how to write a Texinfo document.
180 A sample Texinfo file to look at.
181 Tell readers they have the right to copy
182 and distribute.
183 How to incorporate other Texinfo files.
184 How to write page headings and footings.
185 How to find formatting mistakes.
186 All about paragraph refilling.
187 A description of @@-Command syntax.
188 Texinfo second edition features.
189 A menu containing commands and variables.
190 A menu covering many topics.
191 @end ignore
192
193 @menu
194 * Copying:: Your rights.
195 * Overview:: Texinfo in brief.
196 * Texinfo Mode:: How to use Texinfo mode.
197 * Beginning a File:: What is at the beginning of a Texinfo file?
198 * Ending a File:: What is at the end of a Texinfo file?
199 * Structuring:: How to create chapters, sections, subsections,
200 appendices, and other parts.
201 * Nodes:: How to write nodes.
202 * Menus:: How to write menus.
203 * Cross References:: How to write cross references.
204 * Marking Text:: How to mark words and phrases as code,
205 keyboard input, meta-syntactic
206 variables, and the like.
207 * Quotations and Examples:: How to write quotations, examples, etc.
208 * Lists and Tables:: How to write lists and tables.
209 * Indices:: How to create indices.
210 * Insertions:: How to insert @@-signs, braces, etc.
211 * Glyphs:: How to indicate results of evaluation,
212 expansion of macros, errors, etc.
213 * Breaks:: How to force and prevent line and page breaks.
214 * Definition Commands:: How to describe functions and the like
215 in a uniform manner.
216 * Footnotes:: How to write footnotes.
217 * Conditionals:: How to specify text for either @TeX{} or Info.
218 * Format/Print Hardcopy:: How to convert a Texinfo file to a file
219 for printing and how to print that file.
220 * Create an Info File:: Convert a Texinfo file into an Info file.
221 * Install an Info File:: Make an Info file accessible to users.
222 * Command List:: All the Texinfo @@-commands.
223 * Tips:: Hints on how to write a Texinfo document.
224 * Sample Texinfo File:: A sample Texinfo file to look at.
225 * Sample Permissions:: Tell readers they have the right to copy
226 and distribute.
227 * Include Files:: How to incorporate other Texinfo files.
228 * Headings:: How to write page headings and footings.
229 * Catching Mistakes:: How to find formatting mistakes.
230 * Refilling Paragraphs:: All about paragraph refilling.
231 * Command Syntax:: A description of @@-Command syntax.
232 * Obtaining TeX:: How to Obtain @TeX{}.
233 * New Features:: Texinfo second edition features.
234 * Command and Variable Index:: A menu containing commands and variables.
235 * Concept Index:: A menu covering many topics.
236
237 --- The Detailed Node Listing ---
238
239 Overview of Texinfo
240
241 * Using Texinfo:: Create a conventional printed book
242 or an Info file.
243 * Info Files:: What is an Info file?
244 * Printed Books:: Characteristics of a printed book or manual.
245 * Formatting Commands:: @@-commands are used for formatting.
246 * Conventions:: General rules for writing a Texinfo file.
247 * Comments:: How to write comments and mark regions that
248 the formatting commands will ignore.
249 * Minimum:: What a Texinfo file must have.
250 * Six Parts:: Usually, a Texinfo file has six parts.
251 * Short Sample:: A short sample Texinfo file.
252 * Acknowledgements::
253
254 Using Texinfo Mode
255
256 * Texinfo Mode Overview:: How Texinfo mode can help you.
257 * Emacs Editing:: Texinfo mode adds to GNU Emacs' general
258 purpose editing features.
259 * Inserting:: How to insert frequently used @@-commands.
260 * Showing the Structure:: How to show the structure of a file.
261 * Updating Nodes and Menus:: How to update or create new nodes and menus.
262 * Info Formatting:: How to format for Info.
263 * Printing:: How to format and print part or all of a file.
264 * Texinfo Mode Summary:: Summary of all the Texinfo mode commands.
265
266 Updating Nodes and Menus
267
268 * Updating Commands:: Five major updating commands.
269 * Updating Requirements:: How to structure a Texinfo file for
270 using the updating command.
271 * Other Updating Commands:: How to indent descriptions, insert
272 missing nodes lines, and update
273 nodes in sequence.
274
275 Beginning a Texinfo File
276
277 * Four Parts:: Four parts begin a Texinfo file.
278 * Sample Beginning:: Here is a sample beginning for a Texinfo file.
279 * Header:: The very beginning of a Texinfo file.
280 * Info Summary and Permissions:: Summary and copying permissions for Info.
281 * Titlepage & Copyright Page:: Creating the title and copyright pages.
282 * The Top Node:: Creating the `Top' node and master menu.
283 * Software Copying Permissions:: Ensure that you and others continue to
284 have the right to use and share software.
285
286 The Texinfo File Header
287
288 * First Line:: The first line of a Texinfo file.
289 * Start of Header:: Formatting a region requires this.
290 * setfilename:: Tell Info the name of the Info file.
291 * settitle:: Create a title for the printed work.
292 * setchapternewpage:: Start chapters on right-hand pages.
293 * paragraphindent:: An option to specify paragraph indentation.
294 * End of Header:: Formatting a region requires this.
295
296 The Title and Copyright Pages
297
298 * titlepage:: Create a title for the printed document.
299 * titlefont center sp:: The @code{@@titlefont}, @code{@@center},
300 and @code{@@sp} commands.
301 * title subtitle author:: The @code{@@title}, @code{@@subtitle},
302 and @code{@@author} commands.
303 * Copyright & Permissions:: How to write the copyright notice and
304 include copying permissions.
305 * end titlepage:: Turn on page headings after the title and
306 copyright pages.
307 * headings on off:: An option for turning headings on and off
308 and double or single sided printing.
309
310 The `Top' Node and Master Menu
311
312 * Title of Top Node:: Sketch what the file is about.
313 * Master Menu Parts:: A master menu has three or more parts.
314
315 Ending a Texinfo File
316
317 * Printing Indices & Menus:: How to print an index in hardcopy and
318 generate index menus in Info.
319 * Contents:: How to create a table of contents.
320 * File End:: How to mark the end of a file.
321
322 Chapter Structuring
323
324 * Tree Structuring:: A manual is like an upside down tree @dots{}
325 * Structuring Command Types:: How to divide a manual into parts.
326 * makeinfo top:: The @code{@@top} command, part of the `Top' node.
327 * chapter::
328 * unnumbered & appendix::
329 * majorheading & chapheading::
330 * section::
331 * unnumberedsec appendixsec heading::
332 * subsection::
333 * unnumberedsubsec appendixsubsec subheading::
334 * subsubsection:: Commands for the lowest level sections.
335 * Raise/lower sections:: How to change commands' hierarchical level.
336
337 Nodes
338
339 * Two Paths:: Different commands to structure
340 Info output and printed output.
341 * Node Menu Illustration:: A diagram, and sample nodes and menus.
342 * node:: How to write a node, in detail.
343 * makeinfo Pointer Creation:: How to create node pointers with @code{makeinfo}.
344
345 The @code{@@node} Command
346
347 * Node Names:: How to choose node and pointer names.
348 * Writing a Node:: How to write an @code{@@node} line.
349 * Node Line Tips:: Keep names short.
350 * Node Line Requirements:: Keep names unique, without @@-commands.
351 * First Node:: How to write a `Top' node.
352 * makeinfo top command:: How to use the @code{@@top} command.
353 * Top Node Summary:: Write a brief description for readers.
354
355 Menus
356
357 * Menu Location:: Put a menu in a short node.
358 * Writing a Menu:: What is a menu?
359 * Menu Parts:: A menu entry has three parts.
360 * Less Cluttered Menu Entry:: Two part menu entry.
361 * Menu Example:: Two and three part menu entries.
362 * Other Info Files:: How to refer to a different Info file.
363
364 Cross References
365
366 * References:: What cross references are for.
367 * Cross Reference Commands:: A summary of the different commands.
368 * Cross Reference Parts:: A cross reference has several parts.
369 * xref:: Begin a reference with `See' @dots{}
370 * Top Node Naming:: How to refer to the beginning of another file.
371 * ref:: A reference for the last part of a sentence.
372 * pxref:: How to write a parenthetical cross reference.
373 * inforef:: How to refer to an Info-only file.
374
375 @code{@@xref}
376
377 * Reference Syntax:: What a reference looks like and requires.
378 * One Argument:: @code{@@xref} with one argument.
379 * Two Arguments:: @code{@@xref} with two arguments.
380 * Three Arguments:: @code{@@xref} with three arguments.
381 * Four and Five Arguments:: @code{@@xref} with four and five arguments.
382
383 Marking Words and Phrases
384
385 * Indicating:: How to indicate definitions, files, etc.
386 * Emphasis:: How to emphasize text.
387
388 Indicating Definitions, Commands, etc.
389
390 * Useful Highlighting:: Highlighting provides useful information.
391 * code:: How to indicate code.
392 * kbd:: How to show keyboard input.
393 * key:: How to specify keys.
394 * samp:: How to show a literal sequence of characters.
395 * var:: How to indicate a metasyntactic variable.
396 * file:: How to indicate the name of a file.
397 * dfn:: How to specify a definition.
398 * cite:: How to refer to a book that is not in Info.
399
400 Emphasizing Text
401
402 * emph & strong:: How to emphasize text in Texinfo.
403 * Smallcaps:: How to use the small caps font.
404 * Fonts:: Various font commands for printed output.
405 * Customized Highlighting:: How to define highlighting commands.
406
407 Quotations and Examples
408
409 * Block Enclosing Commands:: Use different constructs for
410 different purposes.
411 * quotation:: How to write a quotation.
412 * example:: How to write an example in a fixed-width font.
413 * noindent:: How to prevent paragraph indentation.
414 * Lisp Example:: How to illustrate Lisp code.
415 * smallexample & smalllisp:: Forms for the @code{@@smallbook} option.
416 * display:: How to write an example in the current font.
417 * format:: How to write an example that does not narrow
418 the margins.
419 * exdent:: How to undo the indentation of a line.
420 * flushleft & flushright:: How to push text flushleft or flushright.
421 * cartouche:: How to draw cartouches around examples.
422
423 Making Lists and Tables
424
425 * Introducing Lists:: Texinfo formats lists for you.
426 * itemize:: How to construct a simple list.
427 * enumerate:: How to construct a numbered list.
428 * Two-column Tables:: How to construct a two-column table.
429
430 Making a Two-column Table
431
432 * table:: How to construct a two-column table.
433 * ftable vtable:: How to construct a two-column table
434 with automatic indexing.
435 * itemx:: How to put more entries in the first column.
436
437 Creating Indices
438
439 * Index Entries:: Choose different words for index entries.
440 * Predefined Indices:: Use different indices for different kinds
441 of entry.
442 * Indexing Commands:: How to make an index entry.
443 * Combining Indices:: How to combine indices.
444 * New Indices:: How to define your own indices.
445
446 Combining Indices
447
448 * syncodeindex:: How to merge two indices, using @code{@@code}
449 font for the merged-from index.
450 * synindex:: How to merge two indices, using the
451 default font of the merged-to index.
452
453 Special Insertions
454
455 * Braces Atsigns Periods:: How to insert braces, @samp{@@} and periods.
456 * dmn:: How to format a dimension.
457 * Dots Bullets:: How to insert dots and bullets.
458 * TeX and copyright:: How to insert the @TeX{} logo
459 and the copyright symbol.
460 * minus:: How to insert a minus sign.
461 * math:: How to format a mathematical expression.
462
463 Inserting @samp{@@}, Braces, and Periods
464
465 * Inserting An Atsign::
466 * Inserting Braces:: How to insert @samp{@{} and @samp{@}}
467 * Controlling Spacing:: How to insert the right amount of space
468 after punctuation within a sentence.
469
470 Inserting Ellipsis, Dots, and Bullets
471
472 * dots:: How to insert dots @dots{}
473 * bullet:: How to insert a bullet.
474
475 Inserting @TeX{} and the Copyright Symbol
476
477 * tex:: How to insert the @TeX{} logo.
478 * copyright symbol:: How to use @code{@@copyright}@{@}.
479
480 Glyphs for Examples
481
482 * Glyphs Summary::
483 * result:: How to show the result of expression.
484 * expansion:: How to indicate an expansion.
485 * Print Glyph:: How to indicate printed output.
486 * Error Glyph:: How to indicate an error message.
487 * Equivalence:: How to indicate equivalence.
488 * Point Glyph:: How to indicate the location of point.
489
490 Making and Preventing Breaks
491
492 * Break Commands:: Cause and prevent splits.
493 * Line Breaks:: How to force a single line to use two lines.
494 * w:: How to prevent unwanted line breaks.
495 * sp:: How to insert blank lines.
496 * page:: How to force the start of a new page.
497 * group:: How to prevent unwanted page breaks.
498 * need:: Another way to prevent unwanted page breaks.
499
500 Definition Commands
501
502 * Def Cmd Template:: How to structure a description using a
503 definition command.
504 * Optional Arguments:: How to handle optional and repeated arguments.
505 * deffnx:: How to group two or more `first' lines.
506 * Def Cmds in Detail:: All the definition commands.
507 * Def Cmd Conventions:: Conventions for writing definitions.
508 * Sample Function Definition::
509
510 The Definition Commands
511
512 * Functions Commands:: Commands for functions and similar entities.
513 * Variables Commands:: Commands for variables and similar entities.
514 * Typed Functions:: Commands for functions in typed languages.
515 * Typed Variables:: Commands for variables in typed languages.
516 * Abstract Objects:: Commands for object-oriented programming.
517 * Data Types:: The definition command for data types.
518
519 Conditionally Visible Text
520
521 * Conditional Commands:: How to specify text for Info or @TeX{}.
522 * Using Ordinary TeX Commands:: You can use any and all @TeX{} commands.
523 * set clear value:: How to designate which text to format (for
524 both Info and @TeX{}); and how to set a
525 flag to a string that you can insert.
526
527 @code{@@set}, @code{@@clear}, and @code{@@value}
528
529 * ifset ifclear:: Format a region if a flag is set.
530 * value:: Replace a flag with a string.
531 * value Example:: An easy way to update edition information.
532
533 Format and Print Hardcopy
534
535 * Use TeX:: Use @TeX{} to format for hardcopy.
536 * Format with tex/texindex:: How to format in a shell.
537 * Format with texi2dvi:: A simpler way to use the shell.
538 * Print with lpr:: How to print.
539 * Within Emacs:: How to format and print from an Emacs shell.
540 * Texinfo Mode Printing:: How to format and print in Texinfo mode.
541 * Compile-Command:: How to print using Emacs's compile command.
542 * Requirements Summary:: @TeX{} formatting requirements summary.
543 * Preparing for TeX:: What you need to do to use @TeX{}.
544 * Overfull hboxes:: What are and what to do with overfull hboxes.
545 * smallbook:: How to print small format books and manuals.
546 * A4 Paper:: How to print on European A4 paper.
547 * Cropmarks and Magnification:: How to print marks to indicate the size
548 of pages and how to print scaled up output.
549
550 Creating an Info File
551
552 * makeinfo advantages:: @code{makeinfo} provides better error checking.
553 * Invoking makeinfo:: How to run @code{makeinfo} from a shell.
554 * makeinfo options:: Specify fill-column and other options.
555 * Pointer Validation:: How to check that pointers point somewhere.
556 * makeinfo in Emacs:: How to run @code{makeinfo} from Emacs.
557 * texinfo-format commands:: Two Info formatting commands written
558 in Emacs Lisp are an alternative
559 to @code{makeinfo}.
560 * Batch Formatting:: How to format for Info in Emacs Batch mode.
561 * Tag and Split Files:: How tagged and split files help Info
562 to run better.
563
564 Installing an Info File
565
566 * Directory file:: The top level menu for all Info files.
567 * New Info File:: Listing a new info file.
568 * Other Info Directories:: How to specify Info files that are
569 located in other directories.
570
571 Sample Permissions
572
573 * Inserting Permissions:: How to put permissions in your document.
574 * ifinfo Permissions:: Sample @samp{ifinfo} copying permissions.
575 * Titlepage Permissions:: Sample Titlepage copying permissions.
576
577 Include Files
578
579 * Using Include Files:: How to use the @code{@@include} command.
580 * texinfo-multiple-files-update:: How to create and update nodes and
581 menus when using included files.
582 * Include File Requirements:: What @code{texinfo-multiple-files-update} expects.
583 * Sample Include File:: A sample outer file with included files
584 within it; and a sample included file.
585 * Include Files Evolution:: How use of the @code{@@include} command
586 has changed over time.
587
588 Page Headings
589
590 * Headings Introduced:: Conventions for using page headings.
591 * Heading Format:: Standard page heading formats.
592 * Heading Choice:: How to specify the type of page heading.
593 * Custom Headings:: How to create your own headings and footings.
594
595 Formatting Mistakes
596
597 * makeinfo preferred:: @code{makeinfo} finds errors.
598 * Debugging with Info:: How to catch errors with Info formatting.
599 * Debugging with TeX:: How to catch errors with @TeX{} formatting.
600 * Using texinfo-show-structure:: How to use @code{texinfo-show-structure}.
601 * Using occur:: How to list all lines containing a pattern.
602 * Running Info-Validate:: How to find badly referenced nodes.
603
604 Finding Badly Referenced Nodes
605
606 * Using Info-validate:: How to run @code{Info-validate}.
607 * Unsplit:: How to create an unsplit file.
608 * Tagifying:: How to tagify a file.
609 * Splitting:: How to split a file manually.
610
611 Second Edition Features
612
613 * New Texinfo Mode Commands:: The updating commands are especially useful.
614 * New Commands:: Many newly described @@-commands.
615 @end menu
616
617 @node Copying, Overview, Top, Top
618 @comment node-name, next, previous, up
619 @unnumbered Texinfo Copying Conditions
620 @cindex Copying conditions
621 @cindex Conditions for copying Texinfo
622
623 The programs currently being distributed that relate to Texinfo include
624 portions of GNU Emacs, plus other separate programs (including
625 @code{makeinfo}, @code{info}, @code{texindex}, and @file{texinfo.tex}).
626 These programs are @dfn{free}; this means that everyone is free to use
627 them and free to redistribute them on a free basis. The Texinfo-related
628 programs are not in the public domain; they are copyrighted and there
629 are restrictions on their distribution, but these restrictions are
630 designed to permit everything that a good cooperating citizen would want
631 to do. What is not allowed is to try to prevent others from further
632 sharing any version of these programs that they might get from
633 you.@refill
634
635 Specifically, we want to make sure that you have the right to give
636 away copies of the programs that relate to Texinfo, that you receive
637 source code or else can get it if you want it, that you can change these
638 programs or use pieces of them in new free programs, and that you know
639 you can do these things.@refill
640
641 To make sure that everyone has such rights, we have to forbid you to
642 deprive anyone else of these rights. For example, if you distribute
643 copies of the Texinfo related programs, you must give the recipients all
644 the rights that you have. You must make sure that they, too, receive or
645 can get the source code. And you must tell them their rights.@refill
646
647 Also, for our own protection, we must make certain that everyone finds
648 out that there is no warranty for the programs that relate to Texinfo.
649 If these programs are modified by someone else and passed on, we want
650 their recipients to know that what they have is not what we distributed,
651 so that any problems introduced by others will not reflect on our
652 reputation.@refill
653
654 The precise conditions of the licenses for the programs currently
655 being distributed that relate to Texinfo are found in the General Public
656 Licenses that accompany them.@refill
657
658 @node Overview, Texinfo Mode, Copying, Top
659 @comment node-name, next, previous, up
660 @chapter Overview of Texinfo
661 @cindex Overview of Texinfo
662 @cindex Texinfo overview
663
664 @dfn{Texinfo}@footnote{Note that the first syllable of ``Texinfo'' is
665 pronounced like ``speck'', not ``hex''. This odd pronunciation is
666 derived from, but is not the same as, the pronunciation of @TeX{}. In
667 the word @TeX{}, the @samp{X} is actually the Greek letter ``chi''
668 rather than the English letter ``ex''. Pronounce @TeX{} as if the
669 @samp{X} were the last sound in the name `Bach'; but pronounce Texinfo
670 as if the @samp{x} were a `k'. Spell ``Texinfo'' with a capital ``T''
671 and write the other letters in lower case.}
672 is a documentation system that uses a single source file to produce both
673 on-line information and printed output. This means that instead of
674 writing two different documents, one for the on-line help or other on-line
675 information and the other for a typeset manual or other printed work, you
676 need write only one document. When the work is revised, you need revise
677 only one document. (You can read the on-line information, known as an
678 @dfn{Info file}, with an Info documentation-reading program.)@refill
679
680 @menu
681 * Using Texinfo:: Create a conventional printed book
682 or an Info file.
683 * Info Files:: What is an Info file?
684 * Printed Books:: Characteristics of a printed book or manual.
685 * Formatting Commands:: @@-commands are used for formatting.
686 * Conventions:: General rules for writing a Texinfo file.
687 * Comments:: How to write comments and mark regions that
688 the formatting commands will ignore.
689 * Minimum:: What a Texinfo file must have.
690 * Six Parts:: Usually, a Texinfo file has six parts.
691 * Short Sample:: A short sample Texinfo file.
692 * Acknowledgements::
693 @end menu
694
695 @node Using Texinfo, Info Files, Overview, Overview
696 @ifinfo
697 @heading Using Texinfo
698 @end ifinfo
699
700 Using Texinfo, you can create a printed document with the normal
701 features of a book, including chapters, sections, cross references,
702 and indices. From the same Texinfo source file, you can create a
703 menu-driven, on-line Info file with nodes, menus, cross references,
704 and indices. You can, if you wish, make the chapters and sections of
705 the printed document correspond to the nodes of the on-line
706 information; and you use the same cross references and indices for
707 both the Info file and the printed work. @cite{The GNU
708 Emacs Manual} is a good example of a Texinfo file, as is this manual.@refill
709
710 To make a printed document, you process a Texinfo source file with the
711 @TeX{} typesetting program. This creates a @sc{dvi} file that you can
712 typeset and print as a book or report. (Note that the Texinfo language is
713 completely different from @TeX{}'s usual language, Plain@TeX{}, which
714 Texinfo replaces.) If you do not have @TeX{}, but do have
715 @code{troff} or @code{nroff}, you can use the @code{texi2roff} program
716 instead.@refill
717
718 To make an Info file, you process a Texinfo source file with the
719 @code{makeinfo} utility or Emacs's @code{texinfo-format-buffer} command;
720 this creates an Info file that you can install on-line.@refill
721
722 @TeX{} and @code{texi2roff} work with many types of printer; similarly,
723 Info works with almost every type of computer terminal. This power
724 makes Texinfo a general purpose system, but brings with it a constraint,
725 which is that a Texinfo file may contain only the customary
726 ``typewriter'' characters (letters, numbers, spaces, and punctuation
727 marks) but no special graphics.@refill
728
729 A Texinfo file is a plain @sc{ascii} file containing text and
730 @dfn{@@-commands} (words preceded by an @samp{@@}) that tell the
731 typesetting and formatting programs what to do. You may edit a
732 Texinfo file with any text editor; but it is especially convenient to
733 use GNU Emacs since that editor has a special mode, called Texinfo
734 mode, that provides various Texinfo-related features. (@xref{Texinfo
735 Mode}.)@refill
736
737 Before writing a Texinfo source file, you should become familiar with
738 the Info documentation reading program and learn about nodes,
739 menus, cross references, and the rest. (@inforef{Top, info, info},
740 for more information.)@refill
741
742 You can use Texinfo to create both on-line help and printed manuals;
743 moreover, Texinfo is freely redistributable. For these reasons, Texinfo
744 is the format in which documentation for GNU utilities and libraries is
745 written.@refill
746
747 @node Info Files, Printed Books, Using Texinfo, Overview
748 @comment node-name, next, previous, up
749 @section Info files
750 @cindex Info files
751
752 An Info file is a Texinfo file formatted so that the Info documentation
753 reading program can operate on it. (@code{makeinfo}
754 and @code{texinfo-format-buffer} are two commands that convert a Texinfo file
755 into an Info file.)@refill
756
757 Info files are divided into pieces called @dfn{nodes}, each of which
758 contains the discussion of one topic. Each node has a name, and
759 contains both text for the user to read and pointers to other nodes,
760 which are identified by their names. The Info program displays one node
761 at a time, and provides commands with which the user can move to other
762 related nodes.@refill
763
764 @ifinfo
765 @inforef{Top, info, info}, for more information about using Info.@refill
766 @end ifinfo
767
768 Each node of an Info file may have any number of child nodes that
769 describe subtopics of the node's topic. The names of child
770 nodes are listed in a @dfn{menu} within the parent node; this
771 allows you to use certain Info commands to move to one of the child
772 nodes. Generally, an Info file is organized like a book. If a node
773 is at the logical level of a chapter, its child nodes are at the level
774 of sections; likewise, the child nodes of sections are at the level
775 of subsections.@refill
776
777 All the children of any one parent are linked together in a
778 bidirectional chain of `Next' and `Previous' pointers. The `Next'
779 pointer provides a link to the next section, and the `Previous' pointer
780 provides a link to the previous section. This means that all the nodes
781 that are at the level of sections within a chapter are linked together.
782 Normally the order in this chain is the same as the order of the
783 children in the parent's menu. Each child node records the parent node
784 name as its `Up' pointer. The last child has no `Next' pointer, and the
785 first child has the parent both as its `Previous' and as its `Up'
786 pointer.@footnote{In some documents, the first child has no `Previous'
787 pointer. Occasionally, the last child has the node name of the next
788 following higher level node as its `Next' pointer.}@refill
789
790 The book-like structuring of an Info file into nodes that correspond
791 to chapters, sections, and the like is a matter of convention, not a
792 requirement. The `Up', `Previous', and `Next' pointers of a node can
793 point to any other nodes, and a menu can contain any other nodes.
794 Thus, the node structure can be any directed graph. But it is usually
795 more comprehensible to follow a structure that corresponds to the
796 structure of chapters and sections in a printed book or report.@refill
797
798 In addition to menus and to `Next', `Previous', and `Up' pointers, Info
799 provides pointers of another kind, called references, that can be
800 sprinkled throughout the text. This is usually the best way to
801 represent links that do not fit a hierarchical structure.@refill
802
803 Usually, you will design a document so that its nodes match the
804 structure of chapters and sections in the printed output. But there
805 are times when this is not right for the material being discussed.
806 Therefore, Texinfo uses separate commands to specify the node
807 structure for the Info file and the section structure for the printed
808 output.@refill
809
810 Generally, you enter an Info file through a node that by convention is
811 called @samp{Top}. This node normally contains just a brief summary
812 of the file's purpose, and a large menu through which the rest of the
813 file is reached. From this node, you can either traverse the file
814 systematically by going from node to node, or you can go to a specific
815 node listed in the main menu, or you can search the index menus and
816 then go directly to the node that has the information you want.@refill
817 @c !!! With the standalone Info system you may go to specific nodes
818 @c directly..
819
820 If you want to read through an Info file in sequence, as if it were a
821 printed manual, you can get the whole file with the advanced Info
822 command @kbd{g* @key{RET}}. (@inforef{Expert, Advanced Info commands,
823 info}.)@refill
824
825 @c !!! dir file may be located in one of many places:
826 @c /usr/local/emacs/info mentioned in info.c DEFAULT_INFOPATH
827 @c /usr/local/lib/emacs/info mentioned in info.c DEFAULT_INFOPATH
828 @c /usr/gnu/info mentioned in info.c DEFAULT_INFOPATH
829 @c /usr/local/info
830 @c /usr/local/lib/info
831 The @file{dir} file in the @file{info} directory serves as the
832 departure point for the whole Info system. From it, you can reach the
833 `Top' nodes of each of the documents in a complete Info system.@refill
834
835 @node Printed Books, Formatting Commands, Info Files, Overview
836 @comment node-name, next, previous, up
837 @section Printed Books
838 @cindex Printed book and manual characteristics
839 @cindex Manual characteristics, printed
840 @cindex Book characteristics, printed
841 @cindex Texinfo printed book characteristics
842 @cindex Characteristics, printed books or manuals
843
844 A Texinfo file can be formatted and typeset as a printed book or manual.
845 To do this, you need @TeX{}, a powerful, sophisticated typesetting
846 program written by Donald Knuth.@footnote{You can also use the
847 @code{texi2roff} program if you do not have @TeX{}; since Texinfo is
848 designed for use with @TeX{}, @code{texi2roff} is not described here.
849 @code{texi2roff} is part of the standard GNU distribution.}@refill
850
851 A Texinfo-based book is similar to any other typeset, printed work: it
852 can have a title page, copyright page, table of contents, and preface,
853 as well as chapters, numbered or unnumbered sections and subsections,
854 page headers, cross references, footnotes, and indices.@refill
855
856 You can use Texinfo to write a book without ever having the intention
857 of converting it into on-line information. You can use Texinfo for
858 writing a printed novel, and even to write a printed memo, although
859 this latter application is not recommended since electronic mail is so
860 much easier.@refill
861
862 @TeX{} is a general purpose typesetting program. Texinfo provides a
863 file called @file{texinfo.tex} that contains information (definitions or
864 @dfn{macros}) that @TeX{} uses when it typesets a Texinfo file.
865 (@file{texinfo.tex} tells @TeX{} how to convert the Texinfo @@-commands
866 to @TeX{} commands, which @TeX{} can then process to create the typeset
867 document.) @file{texinfo.tex} contains the specifications for printing
868 a document.@refill
869
870 Most often, documents are printed on 8.5 inch by 11 inch
871 pages (216@dmn{mm} by 280@dmn{mm}; this is the default size), but you
872 can also print for 7 inch by 9.25 inch pages (178@dmn{mm} by
873 235@dmn{mm}; the @code{@@smallbook} size) or on European A4 size paper
874 (@code{@@afourpaper}). (@xref{smallbook, , Printing ``Small'' Books}.
875 Also, see @ref{A4 Paper, ,Printing on A4 Paper}.)@refill
876
877 By changing the parameters in @file{texinfo.tex}, you can change the
878 size of the printed document. In addition, you can change the style in
879 which the printed document is formatted; for example, you can change the
880 sizes and fonts used, the amount of indentation for each paragraph, the
881 degree to which words are hyphenated, and the like. By changing the
882 specifications, you can make a book look dignified, old and serious, or
883 light-hearted, young and cheery.@refill
884
885 @TeX{} is freely distributable. It is written in a dialect of Pascal
886 called WEB and can be compiled either in Pascal or (by using a
887 conversion program that comes with the @TeX{} distribution) in C.
888 (@xref{TeX Mode, ,@TeX{} Mode, emacs, The GNU Emacs Manual}, for information
889 about @TeX{}.)@refill
890
891 @TeX{} is very powerful and has a great many features. Because a
892 Texinfo file must be able to present information both on a
893 character-only terminal in Info form and in a typeset book, the
894 formatting commands that Texinfo supports are necessarily
895 limited.@refill
896
897 @xref{Obtaining TeX, , How to Obtain @TeX{}}.
898
899
900 @node Formatting Commands, Conventions, Printed Books, Overview
901 @comment node-name, next, previous, up
902 @section @@-commands
903 @cindex @@-commands
904 @cindex Formatting commands
905
906 In a Texinfo file, the commands that tell @TeX{} how to typeset the
907 printed manual and tell @code{makeinfo} and
908 @code{texinfo-format-buffer} how to create an Info file are preceded
909 by @samp{@@}; they are called @dfn{@@-commands}. For example,
910 @code{@@node} is the command to indicate a node and @code{@@chapter}
911 is the command to indicate the start of a chapter.@refill
912
913 @quotation
914 @strong{Please note:} All the @@-commands, with the exception of the
915 @code{@@TeX@{@}} command, must be written entirely in lower
916 case.@refill
917 @end quotation
918
919 The Texinfo @@-commands are a strictly limited set of constructs. The
920 strict limits make it possible for Texinfo files to be understood both
921 by @TeX{} and by the code that converts them into Info files. You can
922 display Info files on any terminal that displays alphabetic and
923 numeric characters. Similarly, you can print the output generated by
924 @TeX{} on a wide variety of printers.@refill
925
926 Depending on what they do or what arguments@footnote{The word
927 @dfn{argument} comes from the way it is used in mathematics and does
928 not refer to a disputation between two people; it refers to the
929 information presented to the command. According to the @cite{Oxford
930 English Dictionary}, the word derives from the Latin for @dfn{to make
931 clear, prove}; thus it came to mean `the evidence offered as proof',
932 which is to say, `the information offered', which led to its
933 mathematical meaning. In its other thread of derivation, the word
934 came to mean `to assert in a manner against which others may make
935 counter assertions', which led to the meaning of `argument' as a
936 disputation.} they take, you need to write @@-commands on lines of
937 their own or as part of sentences:@refill
938
939 @itemize @bullet
940 @item
941 Write a command such as @code{@@noindent} at the beginning of a line as
942 the only text on the line. (@code{@@noindent} prevents the beginning of
943 the next line from being indented as the beginning of a
944 paragraph.)@refill
945
946 @item
947 Write a command such as @code{@@chapter} at the beginning of a line
948 followed by the command's arguments, in this case the chapter title, on
949 the rest of the line. (@code{@@chapter} creates chapter titles.)@refill
950
951 @item
952 Write a command such as @code{@@dots@{@}} wherever you wish but usually
953 within a sentence. (@code{@@dots@{@}} creates dots @dots{})@refill
954
955 @item
956 Write a command such as @code{@@code@{@var{sample-code}@}} wherever you
957 wish (but usually within a sentence) with its argument,
958 @var{sample-code} in this example, between the braces. (@code{@@code}
959 marks text as being code.)@refill
960
961 @item
962 Write a command such as @code{@@example} at the beginning of a line of
963 its own; write the body-text on following lines; and write the matching
964 @code{@@end} command, @code{@@end example} in this case, at the
965 beginning of a line of its own after the body-text. (@code{@@example}
966 @dots{} @code{@@end example} indents and typesets body-text as an
967 example.)@refill
968 @end itemize
969
970 @noindent
971 @cindex Braces, when to use
972 As a general rule, a command requires braces if it mingles among other
973 text; but it does not need braces if it starts a line of its own. The
974 non-alphabetic commands, such as @code{@@:}, are exceptions to the rule;
975 they do not need braces.@refill
976
977 As you gain experience with Texinfo, you will rapidly learn how to
978 write the different commands: the different ways to write commands
979 make it easier to write and read Texinfo files than if all commands
980 followed exactly the same syntax. (For details about @@-command
981 syntax, see @ref{Command Syntax, , @@-Command Syntax}.)@refill
982
983 @node Conventions, Comments, Formatting Commands, Overview
984 @comment node-name, next, previous, up
985 @section General Syntactic Conventions
986 @cindex General syntactic conventions
987 @cindex Syntactic conventions
988 @cindex Conventions, syntactic
989
990 All @sc{ascii} printing characters except @samp{@@}, @samp{@{} and
991 @samp{@}} can appear in a Texinfo file and stand for themselves.
992 @samp{@@} is the escape character which introduces commands.
993 @samp{@{} and @samp{@}} should be used only to surround arguments to
994 certain commands. To put one of these special characters into the
995 document, put an @samp{@@} character in front of it, like this:
996 @samp{@@@@}, @samp{@@@{}, and @samp{@@@}}.@refill
997
998 @ifinfo
999 It is customary in @TeX{} to use doubled single-quote characters to
1000 begin and end quotations: ` ` and ' ' (but without a space between the
1001 two single-quote characters). This convention should be followed in
1002 Texinfo files. @TeX{} converts doubled single-quote characters to
1003 left- and right-hand doubled quotation marks and Info converts doubled
1004 single-quote characters to @sc{ascii} double-quotes: ` ` and ' ' to " .@refill
1005 @end ifinfo
1006 @iftex
1007 It is customary in @TeX{} to use doubled single-quote characters to
1008 begin and end quotations: @w{@tt{ `` }} and @w{@tt{ '' }}. This
1009 convention should be followed in Texinfo files. @TeX{} converts
1010 doubled single-quote characters to left- and right-hand doubled
1011 quotation marks, ``like this'', and Info converts doubled single-quote
1012 characters to @sc{ascii} double-quotes: @w{@tt{ `` }} and
1013 @w{@tt{ '' }} to @w{@tt{ " }}.@refill
1014 @end iftex
1015
1016 Use three hyphens in a row, @samp{---}, for a dash---like this. In
1017 @TeX{}, a single or even a double hyphen produces a printed dash that
1018 is shorter than the usual typeset dash. Info reduces three hyphens to two for
1019 display on the screen.@refill
1020
1021 To prevent a paragraph from being indented in the printed manual, put
1022 the command @code{@@noindent} on a line by itself before the
1023 paragraph.@refill
1024
1025 If you mark off a region of the Texinfo file with the @code{@@iftex}
1026 and @w{@code{@@end iftex}} commands, that region will appear only in
1027 the printed copy; in that region, you can use certain commands
1028 borrowed from Plain@TeX{} that you cannot use in Info. Likewise, if
1029 you mark off a region with the @code{@@ifinfo} and @code{@@end ifinfo}
1030 commands, that region will appear only in the Info file; in that
1031 region, you can use Info commands that you cannot use in @TeX{}.
1032 (@xref{Conditionals}.)
1033
1034 @cindex Tabs; don't use!
1035 @quotation
1036 @strong{Caution:} Do not use tabs in a Texinfo file! @TeX{} uses
1037 variable-width fonts, which means that it cannot predefine a tab to work
1038 in all circumstances. Consequently, @TeX{} treats tabs like single
1039 spaces, and that is not what they look like.@refill
1040
1041 @noindent
1042 To avoid this problem, Texinfo mode causes GNU Emacs to insert multiple
1043 spaces when you press the @key{TAB} key.@refill
1044
1045 @noindent
1046 Also, you can run @code{untabify} in Emacs to convert tabs in a region
1047 to multiple spaces.@refill
1048 @end quotation
1049
1050 @node Comments, Minimum, Conventions, Overview
1051 @comment node-name, next, previous, up
1052 @section Comments
1053
1054 You can write comments in a Texinfo file that will not appear in
1055 either the Info file or the printed manual by using the
1056 @code{@@comment} command (which may be abbreviated to @code{@@c}).
1057 Such comments are for the person who reads the Texinfo file. All the
1058 text on a line that follows either @code{@@comment} or @code{@@c} is a
1059 comment; the rest of the line does not appear in either the Info file
1060 or the printed manual. (Often, you can write the @code{@@comment} or
1061 @code{@@c} in the middle of a line, and only the text that follows after
1062 the @code{@@comment} or @code{@@c} command does not appear; but some
1063 commands, such as @code{@@settitle} and @code{@@setfilename}, work on a
1064 whole line. You cannot use @code{@@comment} or @code{@@c} in a line
1065 beginning with such a command.)@refill
1066 @cindex Comments
1067 @findex comment
1068 @findex c @r{(comment)}
1069
1070 You can write long stretches of text that will not appear in either
1071 the Info file or the printed manual by using the @code{@@ignore} and
1072 @code{@@end ignore} commands. Write each of these commands on a line
1073 of its own, starting each command at the beginning of the line. Text
1074 between these two commands does not appear in the processed output.
1075 You can use @code{@@ignore} and @code{@@end ignore} for writing
1076 comments. Often, @code{@@ignore} and @code{@@end ignore} is used
1077 to enclose a part of the copying permissions that applies to the
1078 Texinfo source file of a document, but not to the Info or printed
1079 version of the document.@refill
1080 @cindex Ignored text
1081 @cindex Unprocessed text
1082 @findex ignore
1083 @c !!! Perhaps include this comment about ignore and ifset:
1084 @ignore
1085 Text enclosed by @code{@@ignore} or by failing @code{@@ifset} or
1086 @code{@@ifclear} conditions is ignored in the sense that it will not
1087 contribute to the formatted output. However, TeX and makeinfo must
1088 still parse the ignored text, in order to understand when to
1089 @emph{stop} ignoring text from the source file; that means that you
1090 will still get error messages if you have invalid Texinfo markup
1091 within ignored text.
1092 @end ignore
1093
1094 @node Minimum, Six Parts, Comments, Overview
1095 @comment node-name, next, previous, up
1096 @section What a Texinfo File Must Have
1097 @cindex Minimal Texinfo file (requirements)
1098 @cindex Must have in Texinfo file
1099 @cindex Required in Texinfo file
1100 @cindex Texinfo file minimum
1101
1102 By convention, the names of Texinfo files end with one of the
1103 extensions @file{.texinfo}, @file{.texi}, or @file{.tex}. The longer
1104 extension is preferred since it describes more clearly to a human
1105 reader the nature of the file. The shorter extensions are for
1106 operating systems that cannot handle long file names.@refill
1107
1108 In order to be made into a printed manual and an Info file, a
1109 Texinfo file @strong{must} begin with lines like this:@refill
1110
1111 @example
1112 @group
1113 \input texinfo
1114 @@setfilename @var{info-file-name}
1115 @@settitle @var{name-of-manual}
1116 @end group
1117 @end example
1118
1119 @noindent
1120 The contents of the file follow this beginning, and then you @strong{must} end
1121 a Texinfo file with a line like this:@refill
1122
1123 @example
1124 @@bye
1125 @end example
1126
1127 @findex input @r{(@TeX{} command)}
1128 @noindent
1129 The @samp{\input texinfo} line tells @TeX{} to use the
1130 @file{texinfo.tex} file, which tells @TeX{} how to translate the Texinfo
1131 @@-commands into @TeX{} typesetting commands. (Note the use of the
1132 backslash, @samp{\}; this is correct for @TeX{}.) The
1133 @samp{@@setfilename} line provides a name for the Info file and the
1134 @samp{@@settitle} line specifies a title for the page headers (or
1135 footers) of the printed manual.@refill
1136
1137 The @code{@@bye} line at the end of the file on a line of its own tells
1138 the formatters that the file is ended and to stop formatting.@refill
1139
1140 Usually, you will not use quite such a spare format, but will include
1141 mode setting and start-of-header and end-of-header lines at the
1142 beginning of a Texinfo file, like this:@refill
1143
1144 @example
1145 @group
1146 \input texinfo @@c -*-texinfo-*-
1147 @@c %**start of header
1148 @@setfilename @var{info-file-name}
1149 @@settitle @var{name-of-manual}
1150 @@c %**end of header
1151 @end group
1152 @end example
1153
1154 @noindent
1155 In the first line, @samp{-*-texinfo-*-} causes Emacs to switch into
1156 Texinfo mode when you edit the file.
1157
1158 The @code{@@c} lines which surround the @samp{@@setfilename} and
1159 @samp{@@settitle} lines are optional, but you need them in order to
1160 run @TeX{} or Info on just part of the file. (@xref{Start of Header},
1161 for more information.)@refill
1162
1163 Furthermore, you will usually provide a Texinfo file with a title
1164 page, indices, and the like. But the minimum, which can be useful
1165 for short documents, is just the three lines at the beginning and the
1166 one line at the end.@refill
1167
1168 @node Six Parts, Short Sample, Minimum, Overview
1169 @comment node-name, next, previous, up
1170 @section Six Parts of a Texinfo File
1171
1172 Generally, a Texinfo file contains more than the minimal
1173 beginning and end---it usually contains six parts:@refill
1174
1175 @table @r
1176 @item 1. Header
1177 The @dfn{Header} names the file, tells @TeX{} which definitions' file to
1178 use, and performs other ``housekeeping'' tasks.@refill
1179
1180 @item 2. Summary Description and Copyright
1181 The @dfn{Summary Description and Copyright} segment describes the document
1182 and contains the copyright notice and copying permissions for the Info
1183 file. The segment must be enclosed between @code{@@ifinfo} and
1184 @code{@@end ifinfo} commands so that the formatters place it only in the Info
1185 file.@refill
1186
1187 @item 3. Title and Copyright
1188 The @dfn{Title and Copyright} segment contains the title and copyright pages
1189 and copying permissions for the printed manual. The segment must be
1190 enclosed between @code{@@titlepage} and @code{@@end titlepage} commands.
1191 The title and copyright page appear only in the printed @w{manual}.@refill
1192
1193 @item 4. `Top' Node and Master Menu
1194 The @dfn{Master Menu} contains a complete menu of all the nodes in the whole
1195 Info file. It appears only in the Info file, in the `Top' node.@refill
1196
1197 @item 5. Body
1198 The @dfn{Body} of the document may be structured like a traditional book or
1199 encyclopedia or it may be free form.@refill
1200
1201 @item 6. End
1202 The @dfn{End} contains commands for printing indices and generating
1203 the table of contents, and the @code{@@bye} command on a line of its
1204 own.@refill
1205 @end table
1206
1207 @node Short Sample, Acknowledgements, Six Parts, Overview
1208 @comment node-name, next, previous, up
1209 @section A Short Sample Texinfo File
1210 @cindex Sample Texinfo file
1211
1212 Here is a complete but very short Texinfo file, in 6 parts. The first
1213 three parts of the file, from @samp{\input texinfo} through to
1214 @samp{@@end titlepage}, look more intimidating than they are. Most of
1215 the material is standard boilerplate; when you write a manual, simply
1216 insert the names for your own manual in this segment. (@xref{Beginning a
1217 File}.)@refill
1218
1219 @noindent
1220 In the following, the sample text is @emph{indented}; comments on it are
1221 not. The complete file, without any comments, is shown in
1222 @ref{Sample Texinfo File}.
1223
1224 @subheading Part 1: Header
1225
1226 @noindent
1227 The header does not appear in either the Info file or the@*
1228 printed output. It sets various parameters, including the@*
1229 name of the Info file and the title used in the header.
1230
1231 @example
1232 @group
1233 \input texinfo @@c -*-texinfo-*-
1234 @@c %**start of header
1235 @@setfilename sample.info
1236 @@settitle Sample Document
1237 @@c %**end of header
1238
1239 @@setchapternewpage odd
1240 @end group
1241 @end example
1242
1243 @subheading Part 2: Summary Description and Copyright
1244
1245 @noindent
1246 The summary description and copyright segment does not@*
1247 appear in the printed document.
1248
1249 @example
1250 @group
1251 @@ifinfo
1252 This is a short example of a complete Texinfo file.
1253
1254 Copyright @@copyright@{@} 1990 Free Software Foundation, Inc.
1255 @@end ifinfo
1256 @end group
1257 @end example
1258
1259 @subheading Part 3: Titlepage and Copyright
1260
1261 @noindent
1262 The titlepage segment does not appear in the Info file.
1263
1264 @example
1265 @group
1266 @@titlepage
1267 @@sp 10
1268 @@comment The title is printed in a large font.
1269 @@center @@titlefont@{Sample Title@}
1270 @end group
1271
1272 @group
1273 @@c The following two commands start the copyright page.
1274 @@page
1275 @@vskip 0pt plus 1filll
1276 Copyright @@copyright@{@} 1990 Free Software Foundation, Inc.
1277 @@end titlepage
1278 @end group
1279 @end example
1280
1281 @subheading Part 4: `Top' Node and Master Menu
1282
1283 @noindent
1284 The `Top' node contains the master menu for the Info file.@*
1285 Since a printed manual uses a table of contents rather than@*
1286 a menu, the master menu appears only in the Info file.
1287
1288 @example
1289 @group
1290 @@node Top, First Chapter, (dir), (dir)
1291 @@comment node-name, next, previous, up
1292 @end group
1293 @end example
1294
1295 @example
1296 @group
1297 @@menu
1298 * First Chapter:: The first chapter is the
1299 only chapter in this sample.
1300 * Concept Index:: This index has two entries.
1301 @@end menu
1302 @end group
1303 @end example
1304
1305 @subheading Part 5: The Body of the Document
1306
1307 @noindent
1308 The body segment contains all the text of the document, but not the
1309 indices or table of contents. This example illustrates a node and a
1310 chapter containing an enumerated list.@refill
1311
1312 @example
1313 @group
1314 @@node First Chapter, Concept Index, Top, Top
1315 @@comment node-name, next, previous, up
1316 @@chapter First Chapter
1317 @@cindex Sample index entry
1318 @end group
1319
1320 @group
1321 This is the contents of the first chapter.
1322 @@cindex Another sample index entry
1323 @end group
1324
1325 @group
1326 Here is a numbered list.
1327
1328 @@enumerate
1329 @@item
1330 This is the first item.
1331
1332 @@item
1333 This is the second item.
1334 @@end enumerate
1335 @end group
1336
1337 @group
1338 The @@code@{makeinfo@} and @@code@{texinfo-format-buffer@}
1339 commands transform a Texinfo file such as this into
1340 an Info file; and @@TeX@{@} typesets it for a printed
1341 manual.
1342 @end group
1343 @end example
1344
1345 @subheading Part 6: The End of the Document
1346
1347 @noindent
1348 The end segment contains commands both for generating an index in a node
1349 and unnumbered chapter of its own and for generating the table of
1350 contents; and it contains the @code{@@bye} command that marks the end of
1351 the document.@refill
1352
1353 @example
1354 @group
1355 @@node Concept Index, , First Chapter, Top
1356 @@comment node-name, next, previous, up
1357 @@unnumbered Concept Index
1358 @end group
1359
1360 @group
1361 @@printindex cp
1362
1363 @@contents
1364 @@bye
1365 @end group
1366 @end example
1367
1368 @subheading The Results
1369
1370 Here is what the contents of the first chapter of the sample look like:
1371
1372 @sp 1
1373 @need 700
1374 @quotation
1375 This is the contents of the first chapter.
1376
1377 Here is a numbered list.
1378
1379 @enumerate
1380 @item
1381 This is the first item.
1382
1383 @item
1384 This is the second item.
1385 @end enumerate
1386
1387 The @code{makeinfo} and @code{texinfo-format-buffer}
1388 commands transform a Texinfo file such as this into
1389 an Info file; and @TeX{} typesets it for a printed
1390 manual.
1391 @end quotation
1392
1393 @node Acknowledgements, , Short Sample, Overview
1394 @comment node-name, next, previous, up
1395 @section Acknowledgements
1396
1397 Richard M.@: Stallman wrote Edition 1.0 of this manual.
1398 @w{Robert J.@: Chassell} revised and extended it,
1399 starting with Edition 1.1.
1400
1401 Our thanks go out to all who helped improve this work, particularly to
1402 @w{Francois Pinard} and @w{David D.@: Zuhn}, who tirelessly recorded
1403 and reported mistakes and obscurities; our special thanks go to
1404 @w{Melissa Weisshaus} for her frequent and often tedious reviews of
1405 nearly similar editions. Our mistakes are our own.
1406
1407 @c ignore until mailing lists set up
1408 @ignore
1409 Please send suggestions and corrections to:
1410
1411 @example
1412 @group
1413 @r{Internet address:}
1414 bug-texinfo@@prep.ai.mit.edu
1415
1416 @r{UUCP path:}
1417 mit-eddie!prep.ai.mit.edu!bug-texinfo
1418 @end group
1419 @end example
1420
1421 @noindent
1422 Please include the manual's edition number in your messages.
1423 @end ignore
1424
1425 @node Texinfo Mode, Beginning a File, Overview, Top
1426 @comment node-name, next, previous, up
1427 @chapter Using Texinfo Mode
1428 @cindex Texinfo mode
1429 @cindex Mode, using Texinfo
1430 @cindex GNU Emacs
1431 @cindex Emacs
1432
1433 You may edit a Texinfo file with any text editor you choose. A Texinfo
1434 file is no different from any other @sc{ascii} file. However, GNU Emacs
1435 comes with a special mode, called Texinfo
1436 mode, that provides Emacs commands and tools to help ease your work.@refill
1437
1438 This chapter describes features of GNU Emacs' Texinfo mode but not any
1439 features of the Texinfo formatting language. If you are reading this
1440 manual straight through from the beginning, you may want to skim through
1441 this chapter briefly and come back to it after reading succeeding
1442 chapters which describe the Texinfo formatting language in
1443 detail.@refill
1444
1445 @menu
1446 * Texinfo Mode Overview:: How Texinfo mode can help you.
1447 * Emacs Editing:: Texinfo mode adds to GNU Emacs' general
1448 purpose editing features.
1449 * Inserting:: How to insert frequently used @@-commands.
1450 * Showing the Structure:: How to show the structure of a file.
1451 * Updating Nodes and Menus:: How to update or create new nodes and menus.
1452 * Info Formatting:: How to format for Info.
1453 * Printing:: How to format and print part or all of a file.
1454 * Texinfo Mode Summary:: Summary of all the Texinfo mode commands.
1455 @end menu
1456
1457 @node Texinfo Mode Overview, Emacs Editing, Texinfo Mode, Texinfo Mode
1458 @ifinfo
1459 @heading Texinfo Mode Overview
1460 @end ifinfo
1461
1462 Texinfo mode provides special features for working with Texinfo
1463 files:@refill
1464
1465 @itemize @bullet
1466 @item
1467 Insert frequently used @@-commands. @refill
1468
1469 @item
1470 Automatically create @code{@@node} lines.
1471
1472 @item
1473 Show the structure of a Texinfo source file.@refill
1474
1475 @item
1476 Automatically create or update the `Next',@*
1477 `Previous', and `Up' pointers of a node.
1478
1479 @item
1480 Automatically create or update menus.@refill
1481
1482 @item
1483 Automatically create a master menu.@refill
1484
1485 @item
1486 Format a part or all of a file for Info.@refill
1487
1488 @item
1489 Typeset and print part or all of a file.@refill
1490 @end itemize
1491
1492 Perhaps the two most helpful features are those for inserting frequently
1493 used @@-commands and for creating node pointers and menus.@refill
1494
1495 @node Emacs Editing, Inserting, Texinfo Mode Overview, Texinfo Mode
1496 @section The Usual GNU Emacs Editing Commands
1497
1498 In most cases, the usual Text mode commands work the same in Texinfo
1499 mode as they do in Text mode. Texinfo mode adds new editing commands
1500 and tools to GNU Emacs' general purpose editing features. The major
1501 difference concerns filling. In Texinfo mode, the paragraph
1502 separation variable and syntax table are redefined so that Texinfo
1503 commands that should be on lines of their own are not inadvertently
1504 included in paragraphs. Thus, the @kbd{M-q} (@code{fill-paragraph})
1505 command will refill a paragraph but not mix an indexing command on a
1506 line adjacent to it into the paragraph.@refill
1507
1508 In addition, Texinfo mode sets the @code{page-delimiter} variable to
1509 the value of @code{texinfo-chapter-level-regexp}; by default, this is
1510 a regular expression matching the commands for chapters and their
1511 equivalents, such as appendices. With this value for the page
1512 delimiter, you can jump from chapter title to chapter title with the
1513 @kbd{C-x ]} (@code{forward-page}) and @kbd{C-x [}
1514 (@code{backward-page}) commands and narrow to a chapter with the
1515 @kbd{C-x p} (@code{narrow-to-page}) command. (@xref{Pages, , ,emacs,
1516 The GNU Emacs Manual}, for details about the page commands.)@refill
1517
1518 You may name a Texinfo file however you wish, but the convention is to
1519 end a Texinfo file name with one of the three extensions
1520 @file{.texinfo}, @file{.texi}, or @file{.tex}. A longer extension is
1521 preferred, since it is explicit, but a shorter extension may be
1522 necessary for operating systems that limit the length of file names.
1523 GNU Emacs automatically enters Texinfo mode when you visit a file with
1524 a @file{.texinfo} or @file{.texi}
1525 extension. Also, Emacs switches to Texinfo mode
1526 when you visit a
1527 file that has @samp{-*-texinfo-*-} in its first line. If ever you are
1528 in another mode and wish to switch to Texinfo mode, type @code{M-x
1529 texinfo-mode}.@refill
1530
1531 Like all other Emacs features, you can customize or enhance Texinfo
1532 mode as you wish. In particular, the keybindings are very easy to
1533 change. The keybindings described here are the default or standard
1534 ones.@refill
1535
1536 @node Inserting, Showing the Structure, Emacs Editing, Texinfo Mode
1537 @comment node-name, next, previous, up
1538 @section Inserting Frequently Used Commands
1539 @cindex Inserting frequently used commands
1540 @cindex Frequently used commands, inserting
1541 @cindex Commands, inserting them
1542
1543 Texinfo mode provides commands to insert various frequently used
1544 @@-commands into the buffer. You can use these commands to save
1545 keystrokes.@refill
1546
1547 The insert commands are invoked by typing @kbd{C-c} twice and then the
1548 first letter of the @@-command:@refill
1549
1550 @table @kbd
1551 @item C-c C-c c
1552 @itemx M-x texinfo-insert-@@code
1553 @findex texinfo-insert-@@code
1554 Insert @code{@@code@{@}} and put the
1555 cursor between the braces.@refill
1556
1557 @item C-c C-c d
1558 @itemx M-x texinfo-insert-@@dfn
1559 @findex texinfo-insert-@@dfn
1560 Insert @code{@@dfn@{@}} and put the
1561 cursor between the braces.@refill
1562
1563 @item C-c C-c e
1564 @itemx M-x texinfo-insert-@@end
1565 @findex texinfo-insert-@@end
1566 Insert @code{@@end} and attempt to insert the correct following word,
1567 such as @samp{example} or @samp{table}. (This command does not handle
1568 nested lists correctly, but inserts the word appropriate to the
1569 immediately preceding list.)@refill
1570
1571 @item C-c C-c i
1572 @itemx M-x texinfo-insert-@@item
1573 @findex texinfo-insert-@@item
1574 Insert @code{@@item} and put the
1575 cursor at the beginning of the next line.@refill
1576
1577 @item C-c C-c k
1578 @itemx M-x texinfo-insert-@@kbd
1579 @findex texinfo-insert-@@kbd
1580 Insert @code{@@kbd@{@}} and put the
1581 cursor between the braces.@refill
1582
1583 @item C-c C-c n
1584 @itemx M-x texinfo-insert-@@node
1585 @findex texinfo-insert-@@node
1586 Insert @code{@@node} and a comment line
1587 listing the sequence for the `Next',
1588 `Previous', and `Up' nodes.
1589 Leave point after the @code{@@node}.@refill
1590
1591 @item C-c C-c o
1592 @itemx M-x texinfo-insert-@@noindent
1593 @findex texinfo-insert-@@noindent
1594 Insert @code{@@noindent} and put the
1595 cursor at the beginning of the next line.@refill
1596
1597 @item C-c C-c s
1598 @itemx M-x texinfo-insert-@@samp
1599 @findex texinfo-insert-@@samp
1600 Insert @code{@@samp@{@}} and put the
1601 cursor between the braces.@refill
1602
1603 @item C-c C-c t
1604 @itemx M-x texinfo-insert-@@table
1605 @findex texinfo-insert-@@table
1606 Insert @code{@@table} followed by a @key{SPC}
1607 and leave the cursor after the @key{SPC}.@refill
1608
1609 @item C-c C-c v
1610 @itemx M-x texinfo-insert-@@var
1611 @findex texinfo-insert-@@var
1612 Insert @code{@@var@{@}} and put the
1613 cursor between the braces.@refill
1614
1615 @item C-c C-c x
1616 @itemx M-x texinfo-insert-@@example
1617 @findex texinfo-insert-@@example
1618 Insert @code{@@example} and put the
1619 cursor at the beginning of the next line.@refill
1620
1621 @c M-@{ was the binding for texinfo-insert-braces;
1622 @c in Emacs 19, backward-paragraph will take this binding.
1623 @item C-c C-c @{
1624 @itemx M-x texinfo-insert-braces
1625 @findex texinfo-insert-braces
1626 Insert @code{@{@}} and put the cursor between the braces.@refill
1627
1628 @item C-c C-c @}
1629 @itemx C-c C-c ]
1630 @itemx M-x up-list
1631 @findex up-list
1632 Move from between a pair of braces forward past the closing brace.
1633 Typing @kbd{C-c C-c ]} is easier than typing @kbd{C-c C-c @}}, which
1634 is, however, more mnemonic; hence the two keybindings. (Also, you can
1635 move out from between braces by typing @kbd{C-f}.)@refill
1636 @end table
1637
1638 To put a command such as @w{@code{@@code@{@dots{}@}}} around an
1639 @emph{existing} word, position the cursor in front of the word and type
1640 @kbd{C-u 1 C-c C-c c}. This makes it easy to edit existing plain text.
1641 The value of the prefix argument tells Emacs how many words following
1642 point to include between braces---1 for one word, 2 for two words, and
1643 so on. Use a negative argument to enclose the previous word or words.
1644 If you do not specify a prefix argument, Emacs inserts the @@-command
1645 string and positions the cursor between the braces. This feature works
1646 only for those @@-commands that operate on a word or words within one
1647 line, such as @code{@@kbd} and @code{@@var}.@refill
1648
1649 This set of insert commands was created after analyzing the frequency
1650 with which different @@-commands are used in the @cite{GNU Emacs
1651 Manual} and the @cite{GDB Manual}. If you wish to add your own insert
1652 commands, you can bind a keyboard macro to a key, use abbreviations,
1653 or extend the code in @file{texinfo.el}.@refill
1654
1655 @findex texinfo-start-menu-description
1656 @cindex Menu description, start
1657 @cindex Description for menu, start
1658 @kbd{C-c C-c C-d} (@code{texinfo-start-menu-description}) is an insert
1659 command that works differently from the other insert commands. It
1660 inserts a node's section or chapter title in the space for the
1661 description in a menu entry line. (A menu entry has three parts, the
1662 entry name, the node name, and the description. Only the node name is
1663 required, but a description helps explain what the node is about.
1664 @xref{Menu Parts, , The Parts of a Menu}.)@refill
1665
1666 To use @code{texinfo-start-menu-description}, position point in a menu
1667 entry line and type @kbd{C-c C-c C-d}. The command looks for and copies
1668 the title that goes with the node name, and inserts the title as a
1669 description; it positions point at beginning of the inserted text so you
1670 can edit it. The function does not insert the title if the menu entry
1671 line already contains a description.@refill
1672
1673 This command is only an aid to writing descriptions; it does not do the
1674 whole job. You must edit the inserted text since a title tends to use
1675 the same words as a node name but a useful description uses different
1676 words.@refill
1677
1678 @node Showing the Structure, Updating Nodes and Menus, Inserting, Texinfo Mode
1679 @comment node-name, next, previous, up
1680 @section Showing the Section Structure of a File
1681 @cindex Showing the section structure of a file
1682 @cindex Section structure of a file, showing it
1683 @cindex Structure of a file, showing it
1684 @cindex Outline of file structure, showing it
1685 @cindex Contents-like outline of file structure
1686 @cindex File section structure, showing it
1687 @cindex Texinfo file section structure, showing it
1688
1689 You can show the section structure of a Texinfo file by using the
1690 @kbd{C-c C-s} command (@code{texinfo-show-structure}). This command
1691 shows the section structure of a Texinfo file by listing the lines
1692 that begin with the @@-commands for @code{@@chapter},
1693 @code{@@section}, and the like. It constructs what amounts
1694 to a table of contents. These lines are displayed in another buffer
1695 called the @samp{*Occur*} buffer. In that buffer, you can position
1696 the cursor over one of the lines and use the @kbd{C-c C-c} command
1697 (@code{occur-mode-goto-occurrence}), to jump to the corresponding spot
1698 in the Texinfo file.@refill
1699
1700 @table @kbd
1701 @item C-c C-s
1702 @itemx M-x texinfo-show-structure
1703 @findex texinfo-show-structure
1704 Show the @code{@@chapter}, @code{@@section}, and such lines of a
1705 Texinfo file.@refill
1706
1707 @item C-c C-c
1708 @itemx M-x occur-mode-goto-occurrence
1709 @findex occur-mode-goto-occurrence
1710 Go to the line in the Texinfo file corresponding to the line under the
1711 cursor in the @file{*Occur*} buffer.@refill
1712 @end table
1713
1714 If you call @code{texinfo-show-structure} with a prefix argument by
1715 typing @w{@kbd{C-u C-c C-s}}, it will list not only those lines with the
1716 @@-commands for @code{@@chapter}, @code{@@section}, and the like,
1717 but also the @code{@@node} lines. (This is how the
1718 @code{texinfo-show-structure} command worked without an argument in
1719 the first version of Texinfo. It was changed because @code{@@node}
1720 lines clutter up the @samp{*Occur*} buffer and are usually not
1721 needed.) You can use @code{texinfo-show-structure} with a prefix
1722 argument to check whether the `Next', `Previous', and `Up' pointers of
1723 an @code{@@node} line are correct.@refill
1724
1725 Often, when you are working on a manual, you will be interested only
1726 in the structure of the current chapter. In this case, you can mark
1727 off the region of the buffer that you are interested in by using the
1728 @kbd{C-x n n} (@code{narrow-to-region}) command and
1729 @code{texinfo-show-structure} will work on only that region. To see
1730 the whole buffer again, use @w{@kbd{C-x n w}} (@code{widen}).
1731 (@xref{Narrowing, , , emacs, The GNU Emacs Manual}, for more
1732 information about the narrowing commands.)@refill
1733
1734 @vindex page-delimiter
1735 @cindex Page delimiter in Texinfo mode
1736 In addition to providing the @code{texinfo-show-structure} command,
1737 Texinfo mode sets the value of the page delimiter variable to match
1738 the chapter-level @@-commands. This enables you to use the @kbd{C-x
1739 ]} (@code{forward-page}) and @kbd{C-x [} (@code{backward-page})
1740 commands to move forward and backward by chapter, and to use the
1741 @kbd{C-x p} (@code{narrow-to-page}) command to narrow to a chapter.
1742 @xref{Pages, , , emacs, The GNU Emacs Manual}, for more information
1743 about the page commands.@refill
1744
1745 @node Updating Nodes and Menus, Info Formatting, Showing the Structure, Texinfo Mode
1746 @comment node-name, next, previous, up
1747 @section Updating Nodes and Menus
1748 @cindex Updating nodes and menus
1749 @cindex Create nodes, menus automatically
1750 @cindex Insert nodes, menus automatically
1751 @cindex Automatically insert nodes, menus
1752
1753 Texinfo mode provides commands for automatically creating or updating
1754 menus and node pointers. The commands are called ``update'' commands
1755 because their most frequent use is for updating a Texinfo file after
1756 you have worked on it; but you can use them to insert the `Next',
1757 `Previous', and `Up' pointers into an @code{@@node} line that has none and to
1758 create menus in a file that has none.@refill
1759
1760 If you do not use the updating commands, you need to write menus and
1761 node pointers by hand, which is a tedious task.@refill
1762
1763 @menu
1764 * Updating Commands:: Five major updating commands.
1765 * Updating Requirements:: How to structure a Texinfo file for
1766 using the updating command.
1767 * Other Updating Commands:: How to indent descriptions, insert
1768 missing nodes lines, and update
1769 nodes in sequence.
1770 @end menu
1771
1772 @node Updating Commands, Updating Requirements, Updating Nodes and Menus, Updating Nodes and Menus
1773 @ifinfo
1774 @subheading The Updating Commands
1775 @end ifinfo
1776
1777 You can use the updating commands@refill
1778
1779 @itemize @bullet
1780 @item
1781 to insert or update the `Next', `Previous', and `Up' pointers of a
1782 node,@refill
1783
1784 @item
1785 to insert or update the menu for a section, and@refill
1786
1787 @item
1788 to create a master menu for a Texinfo source file.@refill
1789 @end itemize
1790
1791 You can also use the commands to update all the nodes and menus in a
1792 region or in a whole Texinfo file.@refill
1793
1794 The updating commands work only with conventional Texinfo files, which
1795 are structured hierarchically like books. In such files, a structuring
1796 command line must follow closely after each @code{@@node} line, except
1797 for the `Top' @code{@@node} line. (A @dfn{structuring command line} is
1798 a line beginning with @code{@@chapter}, @code{@@section}, or other
1799 similar command.)
1800
1801 You can write the structuring command line on the line that follows
1802 immediately after an @code{@@node} line or else on the line that
1803 follows after a single @code{@@comment} line or a single
1804 @code{@@ifinfo} line. You cannot interpose more than one line between
1805 the @code{@@node} line and the structuring command line; and you may
1806 interpose only an @code{@@comment} line or an @code{@@ifinfo} line.
1807
1808 Commands which work on a whole buffer require that the `Top' node be
1809 followed by a node with an @code{@@chapter} or equivalent-level command.
1810 Note that the menu updating commands will not create a main or master
1811 menu for a Texinfo file that has only @code{@@chapter}-level nodes! The
1812 menu updating commands only create menus @emph{within} nodes for lower level
1813 nodes. To create a menu of chapters, you must provide a `Top'
1814 node.@refill
1815
1816 The menu updating commands remove menu entries that refer to other Info
1817 files since they do not refer to nodes within the current buffer. This
1818 is a deficiency. Rather than use menu entries, you can use cross
1819 references to refer to other Info files. None of the updating commands
1820 affect cross references.@refill
1821
1822 Texinfo mode has five updating commands that are used most often: two
1823 are for updating the node pointers or menu of a single node (or a
1824 region); two are for updating every node pointer and menu in a file;
1825 and one, the @code{texinfo-master-menu} command, is for creating a
1826 master menu for a complete file, and optionally, for updating every
1827 node and menu in the whole Texinfo file.@refill
1828
1829 The @code{texinfo-master-menu} command is the primary command:@refill
1830
1831 @table @kbd
1832 @item C-c C-u m
1833 @itemx M-x texinfo-master-menu
1834 @findex texinfo-master-menu
1835 Create or update a master menu that includes all the other menus
1836 (incorporating the descriptions from pre-existing menus, if
1837 any).@refill
1838
1839 With an argument (prefix argument, @kbd{C-u,} if interactive), first create or
1840 update all the nodes and all the regular menus in the buffer before
1841 constructing the master menu. (@xref{The Top Node, , The Top Node and
1842 Master Menu}, for more about a master menu.)@refill
1843
1844 For @code{texinfo-master-menu} to work, the Texinfo file must have a
1845 `Top' node and at least one subsequent node.@refill
1846
1847 After extensively editing a Texinfo file, you can type the following:
1848
1849 @example
1850 C-u M-x texinfo-master-menu
1851 @exdent or
1852 C-u C-c C-u m
1853 @end example
1854
1855 @noindent
1856 This updates all the nodes and menus completely and all at once.@refill
1857 @end table
1858
1859 The other major updating commands do smaller jobs and are designed for
1860 the person who updates nodes and menus as he or she writes a Texinfo
1861 file.@refill
1862
1863 @need 1000
1864 The commands are:@refill
1865
1866 @table @kbd
1867 @item C-c C-u C-n
1868 @itemx M-x texinfo-update-node
1869 @findex texinfo-update-node
1870 Insert the `Next', `Previous', and `Up' pointers for the node that point is
1871 within (i.e., for the @code{@@node} line preceding point). If the
1872 @code{@@node} line has pre-existing `Next', `Previous', or `Up'
1873 pointers in it, the old pointers are removed and new ones inserted.
1874 With an argument (prefix argument, @kbd{C-u}, if interactive), this command
1875 updates all @code{@@node} lines in the region (which is the text
1876 between point and mark).@refill
1877
1878 @item C-c C-u C-m
1879 @itemx M-x texinfo-make-menu
1880 @findex texinfo-make-menu
1881 Create or update the menu in the node that point is within.
1882 With an argument (@kbd{C-u} as prefix argument, if
1883 interactive), the command makes or updates menus for the
1884 nodes which are either within or a part of the
1885 region.@refill
1886
1887 Whenever @code{texinfo-make-menu} updates an existing menu, the
1888 descriptions from that menu are incorporated into the new menu. This
1889 is done by copying descriptions from the existing menu to the entries
1890 in the new menu that have the same node names. If the node names are
1891 different, the descriptions are not copied to the new menu.@refill
1892
1893 @item C-c C-u C-e
1894 @itemx M-x texinfo-every-node-update
1895 @findex texinfo-every-node-update
1896 Insert or update the `Next', `Previous', and `Up' pointers for every
1897 node in the buffer.@refill
1898
1899 @item C-c C-u C-a
1900 @itemx M-x texinfo-all-menus-update
1901 @findex texinfo-all-menus-update
1902 Create or update all the menus in the buffer. With an argument
1903 (@kbd{C-u} as prefix argument, if interactive), first insert
1904 or update all the node
1905 pointers before working on the menus.@refill
1906
1907 If a master menu exists, the @code{texinfo-all-menus-update} command
1908 updates it; but the command does not create a new master menu if none
1909 already exists. (Use the @code{texinfo-master-menu} command for
1910 that.)@refill
1911
1912 When working on a document that does not merit a master menu, you can
1913 type the following:
1914
1915 @example
1916 C-u C-c C-u C-a
1917 @exdent or
1918 C-u M-x texinfo-all-menus-update
1919 @end example
1920
1921 @noindent
1922 This updates all the nodes and menus.@refill
1923 @end table
1924
1925 The @code{texinfo-column-for-description} variable specifies the
1926 column to which menu descriptions are indented. By default, the value
1927 is 32 although it is often useful to reduce it to as low as 24. You
1928 can set the variable with the @kbd{M-x edit-options} command
1929 (@pxref{Edit Options, , Editing Variable Values, emacs, The GNU Emacs
1930 Manual}) or with the @kbd{M-x set-variable} command (@pxref{Examining,
1931 , Examining and Setting Variables, emacs, The GNU Emacs
1932 Manual}).@refill
1933
1934 Also, the @code{texinfo-indent-menu-description} command may be used to
1935 indent existing menu descriptions to a specified column. Finally, if
1936 you wish, you can use the @code{texinfo-insert-node-lines} command to
1937 insert missing @code{@@node} lines into a file. (@xref{Other Updating
1938 Commands}, for more information.)@refill
1939
1940 @node Updating Requirements, Other Updating Commands, Updating Commands, Updating Nodes and Menus
1941 @comment node-name, next, previous, up
1942 @subsection Updating Requirements
1943 @cindex Updating requirements
1944 @cindex Requirements for updating commands
1945
1946 To use the updating commands, you must organize the Texinfo file
1947 hierarchically with chapters, sections, subsections, and the like.
1948 When you construct the hierarchy of the manual, do not `jump down'
1949 more than one level at a time: you can follow the `Top' node with a
1950 chapter, but not with a section; you can follow a chapter with a
1951 section, but not with a subsection. However, you may `jump up' any
1952 number of levels at one time---for example, from a subsection to a
1953 chapter.@refill
1954
1955 Each @code{@@node} line, with the exception of the line for the `Top'
1956 node, must be followed by a line with a structuring command such as
1957 @code{@@chapter}, @code{@@section}, or
1958 @code{@@unnumberedsubsec}.@refill
1959
1960 Each @code{@@node} line/structuring-command line combination
1961 must look either like this:@refill
1962
1963 @example
1964 @group
1965 @@node Comments, Minimum, Conventions, Overview
1966 @@comment node-name, next, previous, up
1967 @@section Comments
1968 @end group
1969 @end example
1970
1971 or like this (without the @code{@@comment} line):
1972
1973 @example
1974 @group
1975 @@node Comments, Minimum, Conventions, Overview
1976 @@section Comments
1977 @end group
1978 @end example
1979
1980 @noindent
1981 In this example, `Comments' is the name of both the node and the
1982 section. The next node is called `Minimum' and the previous node is
1983 called `Conventions'. The `Comments' section is within the `Overview'
1984 node, which is specified by the `Up' pointer. (Instead of an
1985 @code{@@comment} line, you can write an @code{@@ifinfo} line.)@refill
1986
1987 If a file has a `Top' node, it must be called @samp{top} or @samp{Top}
1988 and be the first node in the file.@refill
1989
1990 The menu updating commands create a menu of sections within a chapter,
1991 a menu of subsections within a section, and so on. This means that
1992 you must have a `Top' node if you want a menu of chapters.@refill
1993
1994 Incidentally, the @code{makeinfo} command will create an Info file for
1995 a hierarchically organized Texinfo file that lacks `Next', `Previous'
1996 and `Up' pointers. Thus, if you can be sure that your Texinfo file
1997 will be formatted with @code{makeinfo}, you have no need for the
1998 `update node' commands. (@xref{Create an Info File, , Creating an
1999 Info File}, for more information about @code{makeinfo}.) However,
2000 both @code{makeinfo} and the @code{texinfo-format-@dots{}} commands
2001 require that you insert menus in the file.@refill
2002
2003 @node Other Updating Commands, , Updating Requirements, Updating Nodes and Menus
2004 @comment node-name, next, previous, up
2005 @subsection Other Updating Commands
2006
2007 In addition to the five major updating commands, Texinfo mode
2008 possesses several less frequently used updating commands:@refill
2009
2010 @table @kbd
2011 @item M-x texinfo-insert-node-lines
2012 @findex texinfo-insert-node-lines
2013 Insert @code{@@node} lines before the @code{@@chapter},
2014 @code{@@section}, and other sectioning commands wherever they are
2015 missing throughout a region in a Texinfo file.@refill
2016
2017 With an argument (@kbd{C-u} as prefix argument, if interactive), the
2018 @code{texinfo-insert-node-lines} command not only inserts
2019 @code{@@node} lines but also inserts the chapter or section titles as
2020 the names of the corresponding nodes. In addition, it inserts the
2021 titles as node names in pre-existing @code{@@node} lines that lack
2022 names. Since node names should be more concise than section or
2023 chapter titles, you must manually edit node names so inserted.@refill
2024
2025 For example, the following marks a whole buffer as a region and inserts
2026 @code{@@node} lines and titles throughout:@refill
2027
2028 @example
2029 C-x h C-u M-x texinfo-insert-node-lines
2030 @end example
2031
2032 (Note that this command inserts titles as node names in @code{@@node}
2033 lines; the @code{texinfo-start-menu-description} command
2034 (@pxref{Inserting, Inserting Frequently Used Commands}) inserts titles
2035 as descriptions in menu entries, a different action. However, in both
2036 cases, you need to edit the inserted text.)@refill
2037
2038 @item M-x texinfo-multiple-files-update
2039 @findex texinfo-multiple-files-update @r{(in brief)}
2040 Update nodes and menus in a document built from several separate files.
2041 With @kbd{C-u} as a prefix argument, create and insert a master menu in
2042 the outer file. With a numeric prefix argument, such as @kbd{C-u 2}, first
2043 update all the menus and all the `Next', `Previous', and `Up' pointers
2044 of all the included files before creating and inserting a master menu in
2045 the outer file. The @code{texinfo-multiple-files-update} command is
2046 described in the appendix on @code{@@include} files.
2047 @ifinfo
2048 @xref{texinfo-multiple-files-update}.@refill
2049 @end ifinfo
2050 @iftex
2051 @xref{texinfo-multiple-files-update, ,
2052 @code{texinfo-multiple-files-update}}.@refill
2053 @end iftex
2054
2055 @item M-x texinfo-indent-menu-description
2056 @findex texinfo-indent-menu-description
2057 Indent every description in the menu following point to the specified
2058 column. You can use this command to give yourself more space for
2059 descriptions. With an argument (@kbd{C-u} as prefix argument, if
2060 interactive), the @code{texinfo-indent-menu-description} command indents
2061 every description in every menu in the region. However, this command
2062 does not indent the second and subsequent lines of a multi-line
2063 description.@refill
2064
2065 @item M-x texinfo-sequential-node-update
2066 @findex texinfo-sequential-node-update
2067 Insert the names of the nodes immediately following and preceding the
2068 current node as the `Next' or `Previous' pointers regardless of those
2069 nodes' hierarchical level. This means that the `Next' node of a
2070 subsection may well be the next chapter. Sequentially ordered nodes are
2071 useful for novels and other documents that you read through
2072 sequentially. (However, in Info, the @code{g* @key{RET}} command lets
2073 you look through the file sequentially, so sequentially ordered nodes
2074 are not strictly necessary.) With an argument (prefix argument, if
2075 interactive), the @code{texinfo-sequential-node-update} command
2076 sequentially updates all the nodes in the region.@refill
2077 @end table
2078
2079 @node Info Formatting, Printing, Updating Nodes and Menus, Texinfo Mode
2080 @comment node-name, next, previous, up
2081 @section Formatting for Info
2082 @cindex Formatting for Info
2083 @cindex Running an Info formatter
2084 @cindex Info formatting
2085
2086 Texinfo mode provides several commands for formatting part or all of a
2087 Texinfo file for Info. Often, when you are writing a document, you
2088 want to format only part of a file---that is, a region.@refill
2089
2090 You can use either the @code{texinfo-format-region} or the
2091 @code{makeinfo-region} command to format a region:@refill
2092
2093 @table @kbd
2094 @findex texinfo-format-region
2095 @item C-c C-e C-r
2096 @itemx M-x texinfo-format-region
2097 @itemx C-c C-m C-r
2098 @itemx M-x makeinfo-region
2099 Format the current region for Info.@refill
2100 @end table
2101
2102 You can use either the @code{texinfo-format-buffer} or the
2103 @code{makeinfo-buffer} command to format a whole buffer:@refill
2104
2105 @table @kbd
2106 @findex texinfo-format-buffer
2107 @item C-c C-e C-b
2108 @itemx M-x texinfo-format-buffer
2109 @itemx C-c C-m C-b
2110 @itemx M-x makeinfo-buffer
2111 Format the current buffer for Info.@refill
2112 @end table
2113
2114 @need 1000
2115 For example, after writing a Texinfo file, you can type the following:
2116
2117 @example
2118 C-u C-c C-u m
2119 @exdent or
2120 C-u M-x texinfo-master-menu
2121 @end example
2122
2123 @noindent
2124 This updates all the nodes and menus. Then type the following to create
2125 an Info file:
2126
2127 @example
2128 C-c C-m C-b
2129 @exdent or
2130 M-x makeinfo-buffer
2131 @end example
2132
2133 For the Info formatting commands to work, the file @emph{must} include
2134 a line that has @code{@@setfilename} in its header.@refill
2135
2136 Not all systems support the @code{makeinfo}-based formatting commands.@refill
2137
2138 @xref{Create an Info File}, for details about Info formatting.@refill
2139
2140 @node Printing, Texinfo Mode Summary, Info Formatting, Texinfo Mode
2141 @comment node-name, next, previous, up
2142 @section Formatting and Printing
2143 @cindex Formatting for printing
2144 @cindex Printing a region or buffer
2145 @cindex Region formatting and printing
2146 @cindex Buffer formatting and printing
2147 @cindex Part of file formatting and printing
2148
2149 Typesetting and printing a Texinfo file is a multi-step process in which
2150 you first create a file for printing (called a @sc{dvi} file), and then
2151 print the file. Optionally, you may also create indices. To do this,
2152 you must run the @code{texindex} command after first running the
2153 @code{tex} typesetting command; and then you must run the @code{tex}
2154 command again. Or else run the @code{texi2dvi} command which
2155 automatically creates indices as needed.@refill
2156
2157 Often, when you are writing a document, you want to typeset and print
2158 only part of a file to see what it will look like. You can use the
2159 @code{texinfo-tex-region} and related commands for this purpose. Use
2160 the @code{texinfo-tex-buffer} command to format all of a
2161 buffer.@refill
2162
2163 @table @kbd
2164 @item C-c C-t C-b
2165 @itemx M-x texinfo-tex-buffer
2166 @findex texinfo-tex-buffer
2167 Run @code{texi2dvi} on the buffer. In addition to running @TeX{} on the
2168 buffer, this command automatically creates or updates indices as
2169 needed.@refill
2170
2171 @item C-c C-t C-r
2172 @itemx M-x texinfo-tex-region
2173 @findex texinfo-tex-region
2174 Run @TeX{} on the region.@refill
2175
2176 @item C-c C-t C-i
2177 @itemx M-x texinfo-texindex
2178 Run @code{texindex} to sort the indices of a Texinfo file formatted with
2179 @code{texinfo-tex-region}. The @code{texinfo-tex-region} command does
2180 not run @code{texindex} automatically; it only runs the @code{tex}
2181 typesetting command. You must run the @code{texinfo-tex-region} command
2182 a second time after sorting the raw index files with the @code{texindex}
2183 command. (Usually, you do not format an index when you format a region,
2184 only when you format a buffer. Now that the @code{texi2dvi} command
2185 exists, there is no little need for this command.)@refill
2186
2187 @item C-c C-t C-p
2188 @itemx M-x texinfo-tex-print
2189 @findex texinfo-tex-print
2190 Print the file (or the part of the file) previously formatted with
2191 @code{texinfo-tex-buffer} or @code{texinfo-tex-region}.@refill
2192 @end table
2193
2194 For @code{texinfo-tex-region} or @code{texinfo-tex-buffer} to work, the
2195 file @emph{must} start with a @samp{\input texinfo} line and must
2196 include an @code{@@settitle} line. The file must end with @code{@@bye}
2197 on a line by itself. (When you use @code{texinfo-tex-region}, you must
2198 surround the @code{@@settitle} line with start-of-header and
2199 end-of-header lines.)@refill
2200
2201 @xref{Format/Print Hardcopy}, for a description of the other @TeX{} related
2202 commands, such as @code{tex-show-print-queue}.@refill
2203
2204 @node Texinfo Mode Summary, , Printing, Texinfo Mode
2205 @comment node-name, next, previous, up
2206 @section Texinfo Mode Summary
2207
2208 In Texinfo mode, each set of commands has default keybindings that
2209 begin with the same keys. All the commands that are custom-created
2210 for Texinfo mode begin with @kbd{C-c}. The keys are somewhat
2211 mnemonic.@refill
2212
2213 @subheading Insert Commands
2214
2215 The insert commands are invoked by typing @kbd{C-c} twice and then the
2216 first letter of the @@-command to be inserted. (It might make more
2217 sense mnemonically to use @kbd{C-c C-i}, for `custom insert', but
2218 @kbd{C-c C-c} is quick to type.)@refill
2219
2220 @example
2221 C-c C-c c @r{Insert} @samp{@@code}.
2222 C-c C-c d @r{Insert} @samp{@@dfn}.
2223 C-c C-c e @r{Insert} @samp{@@end}.
2224 C-c C-c i @r{Insert} @samp{@@item}.
2225 C-c C-c n @r{Insert} @samp{@@node}.
2226 C-c C-c s @r{Insert} @samp{@@samp}.
2227 C-c C-c v @r{Insert} @samp{@@var}.
2228 C-c C-c @{ @r{Insert braces.}
2229 C-c C-c ]
2230 C-c C-c @} @r{Move out of enclosing braces.}
2231
2232 @group
2233 C-c C-c C-d @r{Insert a node's section title}
2234 @r{in the space for the description}
2235 @r{in a menu entry line.}
2236 @end group
2237 @end example
2238
2239 @subheading Show Structure
2240
2241 The @code{texinfo-show-structure} command is often used within a
2242 narrowed region.@refill
2243
2244 @example
2245 C-c C-s @r{List all the headings.}
2246 @end example
2247
2248 @subheading The Master Update Command
2249
2250 The @code{texinfo-master-menu} command creates a master menu; and can
2251 be used to update every node and menu in a file as well.@refill
2252
2253 @example
2254 @group
2255 C-c C-u m
2256 M-x texinfo-master-menu
2257 @r{Create or update a master menu.}
2258 @end group
2259
2260 @group
2261 C-u C-c C-u m @r{With @kbd{C-u} as a prefix argument, first}
2262 @r{create or update all nodes and regular}
2263 @r{menus, and then create a master menu.}
2264 @end group
2265 @end example
2266
2267 @subheading Update Pointers
2268
2269 The update pointer commands are invoked by typing @kbd{C-c C-u} and
2270 then either @kbd{C-n} for @code{texinfo-update-node} or @kbd{C-e} for
2271 @code{texinfo-every-node-update}.@refill
2272
2273 @example
2274 C-c C-u C-n @r{Update a node.}
2275 C-c C-u C-e @r{Update every node in the buffer.}
2276 @end example
2277
2278 @subheading Update Menus
2279
2280 Invoke the update menu commands by typing @kbd{C-c C-u}
2281 and then either @kbd{C-m} for @code{texinfo-make-menu} or
2282 @kbd{C-a} for @code{texinfo-all-menus-update}. To update
2283 both nodes and menus at the same time, precede @kbd{C-c C-u
2284 C-a} with @kbd{C-u}.@refill
2285
2286 @example
2287 C-c C-u C-m @r{Make or update a menu.}
2288
2289 @group
2290 C-c C-u C-a @r{Make or update all}
2291 @r{menus in a buffer.}
2292 @end group
2293
2294 @group
2295 C-u C-c C-u C-a @r{With @kbd{C-u} as a prefix argument,}
2296 @r{first create or update all nodes and}
2297 @r{then create or update all menus.}
2298 @end group
2299 @end example
2300
2301 @subheading Format for Info
2302
2303 The Info formatting commands that are written in Emacs Lisp are
2304 invoked by typing @kbd{C-c C-e} and then either @kbd{C-r} for a region
2305 or @kbd{C-b} for the whole buffer.@refill
2306
2307 The Info formatting commands that are written in C and based on the
2308 @code{makeinfo} program are invoked by typing @kbd{C-c C-m} and then
2309 either @kbd{C-r} for a region or @kbd{C-b} for the whole buffer.@refill
2310
2311 @need 800
2312 @noindent
2313 Use the @code{texinfo-format@dots{}} commands:
2314
2315 @example
2316 @group
2317 C-c C-e C-r @r{Format the region.}
2318 C-c C-e C-b @r{Format the buffer.}
2319 @end group
2320 @end example
2321
2322 @need 750
2323 @noindent
2324 Use @code{makeinfo}:
2325
2326 @example
2327 C-c C-m C-r @r{Format the region.}
2328 C-c C-m C-b @r{Format the buffer.}
2329 C-c C-m C-l @r{Recenter the @code{makeinfo} output buffer.}
2330 C-c C-m C-k @r{Kill the @code{makeinfo} formatting job.}
2331 @end example
2332
2333 @subheading Typeset and Print
2334
2335 The @TeX{} typesetting and printing commands are invoked by typing
2336 @kbd{C-c C-t} and then another control command: @kbd{C-r} for
2337 @code{texinfo-tex-region}, @kbd{C-b} for @code{texinfo-tex-buffer},
2338 and so on.@refill
2339
2340 @example
2341 C-c C-t C-r @r{Run @TeX{} on the region.}
2342 C-c C-t C-b @r{Run} @code{texi2dvi} @r{on the buffer.}
2343 C-c C-t C-i @r{Run} @code{texindex}.
2344 C-c C-t C-p @r{Print the @sc{dvi} file.}
2345 C-c C-t C-q @r{Show the print queue.}
2346 C-c C-t C-d @r{Delete a job from the print queue.}
2347 C-c C-t C-k @r{Kill the current @TeX{} formatting job.}
2348 C-c C-t C-x @r{Quit a currently stopped @TeX{} formatting job.}
2349 C-c C-t C-l @r{Recenter the output buffer.}
2350 @end example
2351
2352 @subheading Other Updating Commands
2353
2354 The `other updating commands' do not have standard keybindings because
2355 they are rarely used.
2356
2357 @example
2358 @group
2359 M-x texinfo-insert-node-lines
2360 @r{Insert missing @code{@@node} lines in region.}
2361 @r{With @kbd{C-u} as a prefix argument,}
2362 @r{use section titles as node names.}
2363 @end group
2364
2365 @group
2366 M-x texinfo-multiple-files-update
2367 @r{Update a multi-file document.}
2368 @r{With @kbd{C-u 2} as a prefix argument,}
2369 @r{create or update all nodes and menus}
2370 @r{in all included files first.}
2371 @end group
2372
2373 @group
2374 M-x texinfo-indent-menu-description
2375 @r{Indent descriptions.}
2376 @end group
2377
2378 @group
2379 M-x texinfo-sequential-node-update
2380 @r{Insert node pointers in strict sequence.}
2381 @end group
2382 @end example
2383
2384 @node Beginning a File, Ending a File, Texinfo Mode, Top
2385 @comment node-name, next, previous, up
2386 @chapter Beginning a Texinfo File
2387 @cindex Beginning a Texinfo file
2388 @cindex Texinfo file beginning
2389 @cindex File beginning
2390
2391 Certain pieces of information must be provided at the beginning of a
2392 Texinfo file, such as the name of the file and the title of the
2393 document.@refill
2394
2395 @menu
2396 * Four Parts:: Four parts begin a Texinfo file.
2397 * Sample Beginning:: Here is a sample beginning for a Texinfo file.
2398 * Header:: The very beginning of a Texinfo file.
2399 * Info Summary and Permissions:: Summary and copying permissions for Info.
2400 * Titlepage & Copyright Page:: Creating the title and copyright pages.
2401 * The Top Node:: Creating the `Top' node and master menu.
2402 * Software Copying Permissions:: Ensure that you and others continue to
2403 have the right to use and share software.
2404 @end menu
2405
2406 @node Four Parts, Sample Beginning, Beginning a File, Beginning a File
2407 @ifinfo
2408 @heading Four Parts Begin a File
2409 @end ifinfo
2410
2411 Generally, the beginning of a Texinfo file has four parts:@refill
2412
2413 @enumerate
2414 @item
2415 The header, delimited by special comment lines, that includes the
2416 commands for naming the Texinfo file and telling @TeX{} what
2417 definitions' file to use when processing the Texinfo file.@refill
2418
2419 @item
2420 A short statement of what the file is about, with a copyright notice
2421 and copying permissions. This is enclosed in @code{@@ifinfo} and
2422 @code{@@end ifinfo} commands so that the formatters place it only
2423 in the Info file.@refill
2424
2425 @item
2426 A title page and copyright page, with a copyright notice and copying
2427 permissions. This is enclosed between @code{@@titlepage} and
2428 @code{@@end titlepage} commands. The title and copyright page appear
2429 only in the printed @w{manual}.@refill
2430
2431 @item
2432 The `Top' node that contains a menu for the whole Info file. The
2433 contents of this node appear only in the Info file.@refill
2434 @end enumerate
2435
2436 Also, optionally, you may include the copying conditions for a program
2437 and a warranty disclaimer. The copying section will be followed by an
2438 introduction or else by the first chapter of the manual.@refill
2439
2440 Since the copyright notice and copying permissions for the Texinfo
2441 document (in contrast to the copying permissions for a program) are in
2442 parts that appear only in the Info file or only in the printed manual,
2443 this information must be given twice.@refill
2444
2445 @node Sample Beginning, Header, Four Parts, Beginning a File
2446 @comment node-name, next, previous, up
2447 @section Sample Texinfo File Beginning
2448
2449 The following sample shows what is needed.@refill
2450
2451 @example
2452 \input texinfo @@c -*-texinfo-*-
2453 @@c %**start of header
2454 @@setfilename @var{name-of-info-file}
2455 @@settitle @var{name-of-manual}
2456 @@setchapternewpage odd
2457 @@c %**end of header
2458
2459 @@ifinfo
2460 This file documents @dots{}
2461
2462 Copyright @var{year} @var{copyright-owner}
2463
2464 @group
2465 Permission is granted to @dots{}
2466 @@end ifinfo
2467 @end group
2468
2469 @group
2470 @@c This title page illustrates only one of the
2471 @@c two methods of forming a title page.
2472 @end group
2473
2474 @group
2475 @@titlepage
2476 @@title @var{name-of-manual-when-printed}
2477 @@subtitle @var{subtitle-if-any}
2478 @@subtitle @var{second-subtitle}
2479 @@author @var{author}
2480 @end group
2481
2482 @group
2483 @@c The following two commands
2484 @@c start the copyright page.
2485 @@page
2486 @@vskip 0pt plus 1filll
2487 Copyright @@copyright@{@} @var{year} @var{copyright-owner}
2488 @end group
2489
2490 Published by @dots{}
2491
2492 Permission is granted to @dots{}
2493 @@end titlepage
2494
2495 @@node Top, Overview, (dir), (dir)
2496
2497 @@ifinfo
2498 This document describes @dots{}
2499
2500 This document applies to version @dots{}
2501 of the program named @dots{}
2502 @@end ifinfo
2503
2504 @group
2505 @@menu
2506 * Copying:: Your rights and freedoms.
2507 * First Chapter:: Getting started @dots{}
2508 * Second Chapter:: @dots{}
2509 @dots{}
2510 @dots{}
2511 @@end menu
2512 @end group
2513
2514 @group
2515 @@node First Chapter, Second Chapter, top, top
2516 @@comment node-name, next, previous, up
2517 @@chapter First Chapter
2518 @@cindex Index entry for First Chapter
2519 @end group
2520 @end example
2521
2522 @node Header, Info Summary and Permissions, Sample Beginning, Beginning a File
2523 @comment node-name, next, previous, up
2524 @section The Texinfo File Header
2525 @cindex Header for Texinfo files
2526 @cindex Texinfo file header
2527
2528 Texinfo files start with at least three lines that provide Info and
2529 @TeX{} with necessary information. These are the @code{\input
2530 texinfo} line, the @code{@@settitle} line, and the
2531 @code{@@setfilename} line. If you want to run @TeX{} on just a part
2532 of the Texinfo File, you must write the @code{@@settitle}
2533 and @code{@@setfilename} lines between start-of-header and end-of-header
2534 lines.@refill
2535
2536 Thus, the beginning of a Texinfo file looks like this:
2537
2538 @example
2539 @group
2540 \input texinfo @@c -*-texinfo-*-
2541 @@setfilename sample.info
2542 @@settitle Sample Document
2543 @end group
2544 @end example
2545
2546 @noindent
2547 or else like this:
2548
2549 @example
2550 @group
2551 \input texinfo @@c -*-texinfo-*-
2552 @@c %**start of header
2553 @@setfilename sample.info
2554 @@settitle Sample Document
2555 @@c %**end of header
2556 @end group
2557 @end example
2558
2559 @menu
2560 * First Line:: The first line of a Texinfo file.
2561 * Start of Header:: Formatting a region requires this.
2562 * setfilename:: Tell Info the name of the Info file.
2563 * settitle:: Create a title for the printed work.
2564 * setchapternewpage:: Start chapters on right-hand pages.
2565 * paragraphindent:: An option to specify paragraph indentation.
2566 * End of Header:: Formatting a region requires this.
2567 @end menu
2568
2569 @node First Line, Start of Header, Header, Header
2570 @comment node-name, next, previous, up
2571 @subsection The First Line of a Texinfo File
2572 @cindex First line of a Texinfo file
2573 @cindex Beginning line of a Texinfo file
2574 @cindex Header of a Texinfo file
2575
2576 Every Texinfo file that is to be the top-level input to @TeX{} must begin
2577 with a line that looks like this:@refill
2578
2579 @example
2580 \input texinfo @@c -*-texinfo-*-
2581 @end example
2582
2583 @noindent
2584 This line serves two functions:
2585
2586 @enumerate
2587 @item
2588 When the file is processed by @TeX{}, the @code{\input texinfo} command
2589 tells @TeX{} to load the macros needed for processing a Texinfo file.
2590 These are in a file called @file{texinfo.tex}, which is usually located
2591 in the @file{/usr/lib/tex/macros} directory. @TeX{} uses the backslash,
2592 @samp{\}, to mark the beginning of a command, just as Texinfo uses
2593 @code{@@}. The @file{texinfo.tex} file causes the switch from @samp{\}
2594 to @samp{@@}; before the switch occurs, @TeX{} requires @samp{\}, which
2595 is why it appears at the beginning of the file.@refill
2596
2597 @item
2598 When the file is edited in GNU Emacs, the @samp{-*-texinfo-*-} mode
2599 specification tells Emacs to use Texinfo mode.@refill
2600 @end enumerate
2601
2602 @node Start of Header, setfilename, First Line, Header
2603 @comment node-name, next, previous, up
2604 @subsection Start of Header
2605 @cindex Start of header line
2606
2607 Write a start-of-header line on the second line of a Texinfo file.
2608 Follow the start-of-header line with @code{@@setfilename} and
2609 @code{@@settitle} lines and, optionally, with other command lines, such
2610 as @code{@@smallbook} or @code{@@footnotestyle}; and then by an
2611 end-of-header line (@pxref{End of Header}).@refill
2612
2613 With these lines, you can format part of a Texinfo file for Info or
2614 typeset part for printing.@refill
2615
2616 A start-of-header line looks like this:@refill
2617
2618 @example
2619 @@c %**start of header
2620 @end example
2621
2622 The odd string of characters, @samp{%**}, is to ensure that no other
2623 comment is accidentally taken for a start-of-header line.@refill
2624
2625 @node setfilename, settitle, Start of Header, Header
2626 @comment node-name, next, previous, up
2627 @subsection @code{@@setfilename}
2628 @cindex Info file requires @code{@@setfilename}
2629 @findex setfilename
2630
2631 In order to be made into an Info file, a Texinfo file must contain a line
2632 that looks like this:@refill
2633
2634 @example
2635 @@setfilename @var{info-file-name}
2636 @end example
2637
2638 Write the @code{@@setfilename} command at the beginning of a line and
2639 follow it on the same line by the Info file name. Do not write
2640 anything else on the line; anything on the line after the command is
2641 considered part of the file name, including a comment.@refill
2642
2643 The @code{@@setfilename} line specifies the name of the Info file to be
2644 generated. This name should be different from the name of the Texinfo
2645 file. The convention is to write a name with a @samp{.info} extension,
2646 to produce an Info file name such as @file{texinfo.info}.@refill
2647
2648 Some operating systems cannot handle long file names. You can run into
2649 a problem even when the file name you specify is itself short enough.
2650 This occurs because the Info formatters split a long Info file into
2651 short indirect subfiles, and name them by appending `-1', `-2', @dots{},
2652 `-10', `-11', and so on, to the original file name. (@xref{Tag and
2653 Split Files, , Tag Files and Split Files}.) The subfile name
2654 @file{texinfo.info-10}, for example, is too long for some systems; so
2655 the Info file name for this document is actually @file{texinfo} rather than
2656 @file{texinfo.info}.@refill
2657
2658 The Info formatting commands ignore everything written before the
2659 @code{@@setfilename} line, which is why the very first line of
2660 the file (the @code{\input} line) does not need to be commented out.
2661 The @code{@@setfilename} line is ignored when you typeset a printed
2662 manual.@refill
2663
2664 @node settitle, setchapternewpage, setfilename, Header
2665 @comment node-name, next, previous, up
2666 @subsection @code{@@settitle}
2667 @findex settitle
2668
2669 In order to be made into a printed manual, a Texinfo file must contain
2670 a line that looks like this:@refill
2671
2672 @example
2673 @@settitle @var{title}
2674 @end example
2675
2676 Write the @code{@@settitle} command at the beginning of a line and
2677 follow it on the same line by the title. This tells @TeX{} the title
2678 to use in a header or footer. Do not write anything else on the line;
2679 anything on the line after the command is considered part of the
2680 title, including a comment.@refill
2681
2682 Conventionally, when @TeX{} formats a Texinfo file for double-sided
2683 output, the title is printed in the left-hand (even-numbered) page
2684 headings and the current chapter title is printed in the right-hand
2685 (odd-numbered) page headings. (@TeX{} learns the title of each chapter
2686 from each @code{@@chapter} command.) Page footers are not
2687 printed.@refill
2688
2689 Even if you are printing in a single-sided style, @TeX{} looks for an
2690 @code{@@settitle} command line, in case you include the manual title
2691 in the heading. @refill
2692
2693 The @code{@@settitle} command should precede everything that generates
2694 actual output in @TeX{}.@refill
2695
2696 Although the title in the @code{@@settitle} command is usually the
2697 same as the title on the title page, it does not affect the title as
2698 it appears on the title page. Thus, the two do not need not match
2699 exactly; and the title in the @code{@@settitle} command can be a
2700 shortened or expanded version of the title as it appears on the title
2701 page. (@xref{titlepage, , @code{@@titlepage}}.)@refill
2702
2703 @TeX{} prints page headings only for that text that comes after the
2704 @code{@@end titlepage} command in the Texinfo file, or that comes
2705 after an @code{@@headings} command that turns on headings.
2706 (@xref{headings on off, , The @code{@@headings} Command}, for more
2707 information.)@refill
2708
2709 You may, if you wish, create your own, customized headings and
2710 footings. @xref{Headings, , Page Headings}, for a detailed discussion
2711 of this process.@refill
2712
2713 @node setchapternewpage, paragraphindent, settitle, Header
2714 @comment node-name, next, previous, up
2715 @subsection @code{@@setchapternewpage}
2716 @cindex Starting chapters
2717 @cindex Pages, starting odd
2718 @findex setchapternewpage
2719
2720 In a book or a manual, text is usually printed on both sides of the
2721 paper, chapters start on right-hand pages, and right-hand pages have
2722 odd numbers. But in short reports, text often is printed only on one
2723 side of the paper. Also in short reports, chapters sometimes do not
2724 start on new pages, but are printed on the same page as the end of the
2725 preceding chapter, after a small amount of vertical whitespace.@refill
2726
2727 You can use the @code{@@setchapternewpage} command with various
2728 arguments to specify how @TeX{} should start chapters and whether it
2729 should typeset pages for printing on one or both sides of the paper
2730 (single-sided or double-sided printing).@refill
2731
2732 Write the @code{@@setchapternewpage} command at the beginning of a
2733 line followed by its argument.@refill
2734
2735 For example, you would write the following to cause each chapter to
2736 start on a fresh odd-numbered page:@refill
2737
2738 @example
2739 @@setchapternewpage odd
2740 @end example
2741
2742 You can specify one of three alternatives with the
2743 @code{@@setchapternewpage} command:@refill
2744
2745 @table @asis
2746 @ignore
2747 @item No @code{@@setchapternewpage} command
2748 If the Texinfo file does not contain an @code{@@setchapternewpage}
2749 command before the @code{@@titlepage} command, @TeX{} automatically
2750 begins chapters on new pages and prints headings in the standard
2751 format for single-sided printing. This is the conventional format for
2752 single-sided printing.@refill
2753
2754 The result is exactly the same as when you write
2755 @code{@@setchapternewpage on}.@refill
2756 @end ignore
2757 @item @code{@@setchapternewpage off}
2758 Cause @TeX{} to typeset a new chapter on the same page as the last
2759 chapter, after skipping some vertical whitespace. Also, cause @TeX{} to
2760 format page headers for single-sided printing. (You can override the
2761 headers format with the @code{@@headings double} command; see
2762 @ref{headings on off, , The @code{@@headings} Command}.)@refill
2763
2764 @item @code{@@setchapternewpage on}
2765 Cause @TeX{} to start new chapters on new pages and to typeset page
2766 headers for single-sided printing. This is the form most often
2767 used for short reports.@refill
2768
2769 This alternative is the default.@refill
2770
2771 @item @code{@@setchapternewpage odd}
2772 Cause @TeX{} to start new chapters on new, odd-numbered pages
2773 (right-handed pages) and to typeset for double-sided printing. This is
2774 the form most often used for books and manuals.@refill
2775 @end table
2776
2777 @noindent
2778 Texinfo does not have an @code{@@setchapternewpage even} command.@refill
2779
2780 @noindent
2781 (You can countermand or modify an @code{@@setchapternewpage} command
2782 with an @code{@@headings} command. @xref{headings on off, , The
2783 @code{@@headings} Command}.)@refill
2784
2785 At the beginning of a manual or book, pages are not numbered---for
2786 example, the title and copyright pages of a book are not numbered.
2787 By convention, table of contents pages are numbered with roman
2788 numerals and not in sequence with the rest of the document.@refill
2789
2790 Since an Info file does not have pages, the @code{@@setchapternewpage}
2791 command has no effect on it.@refill
2792
2793 Usually, you do not write an @code{@@setchapternewpage} command for
2794 single-sided printing, but accept the default which is to typeset for
2795 single-sided printing and to start new chapters on new pages. Usually,
2796 you write an @code{@@setchapternewpage odd} command for double-sided
2797 printing.@refill
2798
2799 @node paragraphindent, End of Header, setchapternewpage, Header
2800 @comment node-name, next, previous, up
2801 @subsection Paragraph Indenting
2802 @cindex Indenting paragraphs
2803 @cindex Paragraph indentation
2804 @findex paragraphindent
2805
2806 The Info formatting commands may insert spaces at the beginning of the
2807 first line of each paragraph, thereby indenting that paragraph. You
2808 can use the @code{@@paragraphindent} command to specify the
2809 indentation. Write an @code{@@paragraphindent} command at the
2810 beginning of a line followed by either @samp{asis} or a number. The
2811 template is:@refill
2812
2813 @example
2814 @@paragraphindent @var{indent}
2815 @end example
2816
2817 The Info formatting commands indent according to the value of
2818 @var{indent}:@refill
2819
2820 @itemize @bullet
2821 @item
2822 If the value of @var{indent} is @samp{asis}, the Info formatting
2823 commands do not change the existing indentation.@refill
2824
2825 @item
2826 If the value of @var{indent} is 0, the Info formatting commands delete
2827 existing indentation.@refill
2828
2829 @item
2830 If the value of @var{indent} is greater than 0, the Info formatting
2831 commands indent the paragraph by that number of spaces.@refill
2832 @end itemize
2833
2834 The default value of @var{indent} is @samp{asis}.@refill
2835
2836 Write the @code{@@paragraphindent} command before or shortly after the
2837 end-of-header line at the beginning of a Texinfo file. (If you write
2838 the command between the start-of-header and end-of-header lines, the
2839 region formatting commands indent paragraphs as specified.)@refill
2840
2841 A peculiarity of the @code{texinfo-format-buffer} and
2842 @code{texinfo-format-region} commands is that they do not indent (nor
2843 fill) paragraphs that contain @code{@@w} or @code{@@*} commands.
2844 @xref{Refilling Paragraphs}, for a detailed description of what goes
2845 on.@refill
2846
2847 @node End of Header, , paragraphindent, Header
2848 @comment node-name, next, previous, up
2849 @subsection End of Header
2850 @cindex End of header line
2851
2852 Follow the header lines with an @w{end-of-header} line.
2853 An end-of-header line looks like this:@refill
2854
2855 @example
2856 @@c %**end of header
2857 @end example
2858
2859 If you include the @code{@@setchapternewpage} command between the
2860 start-of-header and end-of-header lines, @TeX{} will typeset a region as
2861 that command specifies. Similarly, if you include an @code{@@smallbook}
2862 command between the start-of-header and end-of-header lines, @TeX{} will
2863 typeset a region in the ``small'' book format.@refill
2864
2865 @ifinfo
2866 The reason for the odd string of characters (@samp{%**}) is so that the
2867 @code{texinfo-tex-region} command does not accidentally find
2868 something that it should not when it is looking for the header.@refill
2869
2870 The start-of-header line and the end-of-header line are Texinfo mode
2871 variables that you can change.@refill
2872 @end ifinfo
2873
2874 @iftex
2875 @xref{Start of Header}.
2876 @end iftex
2877
2878 @node Info Summary and Permissions, Titlepage & Copyright Page, Header, Beginning a File
2879 @comment node-name, next, previous, up
2880 @section Summary and Copying Permissions for Info
2881
2882 The title page and the copyright page appear only in the printed copy of
2883 the manual; therefore, the same information must be inserted in a
2884 section that appears only in the Info file. This section usually
2885 contains a brief description of the contents of the Info file, a
2886 copyright notice, and copying permissions.@refill
2887
2888 The copyright notice should read:@refill
2889
2890 @example
2891 Copyright @var{year} @var{copyright-owner}
2892 @end example
2893
2894 @noindent
2895 and be put on a line by itself.@refill
2896
2897 Standard text for the copyright permissions is contained in an appendix
2898 to this manual; see @ref{ifinfo Permissions, , @samp{ifinfo} Copying
2899 Permissions}, for the complete text.@refill
2900
2901 The permissions text appears in an Info file @emph{before} the first
2902 node. This mean that a reader does @emph{not} see this text when
2903 reading the file using Info, except when using the advanced Info command
2904 @kbd{g *}.
2905
2906 @node Titlepage & Copyright Page, The Top Node, Info Summary and Permissions, Beginning a File
2907 @comment node-name, next, previous, up
2908 @section The Title and Copyright Pages
2909
2910 A manual's name and author are usually printed on a title page.
2911 Sometimes copyright information is printed on the title page as well;
2912 more often, copyright information is printed on the back of the title
2913 page.
2914
2915 The title and copyright pages appear in the printed manual, but not in the
2916 Info file. Because of this, it is possible to use several slightly
2917 obscure @TeX{} typesetting commands that cannot be used in an Info file.
2918 In addition, this part of the beginning of a Texinfo file contains the text
2919 of the copying permissions that will appear in the printed manual.@refill
2920
2921 @xref{Titlepage Permissions, , Titlepage Copying Permissions}, for the
2922 standard text for the copyright permissions.@refill
2923
2924 @menu
2925 * titlepage:: Create a title for the printed document.
2926 * titlefont center sp:: The @code{@@titlefont}, @code{@@center},
2927 and @code{@@sp} commands.
2928 * title subtitle author:: The @code{@@title}, @code{@@subtitle},
2929 and @code{@@author} commands.
2930 * Copyright & Permissions:: How to write the copyright notice and
2931 include copying permissions.
2932 * end titlepage:: Turn on page headings after the title and
2933 copyright pages.
2934 * headings on off:: An option for turning headings on and off
2935 and double or single sided printing.
2936 @end menu
2937
2938 @node titlepage, titlefont center sp, Titlepage & Copyright Page, Titlepage & Copyright Page
2939 @comment node-name, next, previous, up
2940 @subsection @code{@@titlepage}
2941 @cindex Title page
2942 @findex titlepage
2943
2944 Start the material for the title page and following copyright page
2945 with @code{@@titlepage} on a line by itself and end it with
2946 @code{@@end titlepage} on a line by itself.@refill
2947
2948 The @code{@@end titlepage} command starts a new page and turns on page
2949 numbering. (@xref{Headings, , Page Headings}, for details about how to
2950 generate of page headings.) All the material that you want to
2951 appear on unnumbered pages should be put between the
2952 @code{@@titlepage} and @code{@@end titlepage} commands. By using the
2953 @code{@@page} command you can force a page break within the region
2954 delineated by the @code{@@titlepage} and @code{@@end titlepage}
2955 commands and thereby create more than one unnumbered page. This is
2956 how the copyright page is produced. (The @code{@@titlepage} command
2957 might perhaps have been better named the
2958 @code{@@titleandadditionalpages} command, but that would have been
2959 rather long!)@refill
2960
2961 @c !!! append refill to footnote when makeinfo can handle it.
2962 When you write a manual about a computer program, you should write the
2963 version of the program to which the manual applies on the title
2964 page. If the manual changes more frequently than the program or is
2965 independent of it, you should also include an edition
2966 number@footnote{We have found that it is helpful to refer to versions
2967 of manuals as `editions' and versions of programs as `versions';
2968 otherwise, we find we are liable to confuse each other in conversation
2969 by referring to both the documentation and the software with the same
2970 words.} for the manual. This helps readers keep track of which manual
2971 is for which version of the program. (The `Top' node
2972 should also contain this information; see @ref{makeinfo top, ,
2973 @code{@@top}}.)@refill
2974
2975 Texinfo provides two methods for creating a title page. One method
2976 uses the @code{@@titlefont}, @code{@@sp}, and @code{@@center} commands
2977 to generate a title page in which the words on the page are
2978 centered.@refill
2979
2980 The second method uses the @code{@@title}, @code{@@subtitle}, and
2981 @code{@@author} commands to create a title page with black rules under
2982 the title and author lines and the subtitle text set flush to the
2983 right hand side of the page. With this method, you do not specify any
2984 of the actual formatting of the title page. You specify the text
2985 you want, and Texinfo does the formatting. You may use either
2986 method.@refill
2987
2988 @node titlefont center sp, title subtitle author, titlepage, Titlepage & Copyright Page
2989 @comment node-name, next, previous, up
2990 @subsection @code{@@titlefont}, @code{@@center}, and @code{@@sp}
2991 @findex titlefont
2992 @findex center
2993 @findex sp @r{(titlepage line spacing)}
2994
2995 You can use the @code{@@titlefont}, @code{@@sp}, and @code{@@center}
2996 commands to create a title page for a printed document. (This is the
2997 first of the two methods for creating a title page in Texinfo.)@refill
2998
2999 Use the @code{@@titlefont} command to select a large font suitable for
3000 the title itself.@refill
3001
3002 @need 700
3003 For example:
3004
3005 @example
3006 @@titlefont@{Texinfo@}
3007 @end example
3008
3009 Use the @code{@@center} command at the beginning of a line to center
3010 the remaining text on that line. Thus,@refill
3011
3012 @example
3013 @@center @@titlefont@{Texinfo@}
3014 @end example
3015
3016 @noindent
3017 centers the title, which in this example is ``Texinfo'' printed
3018 in the title font.@refill
3019
3020 Use the @code{@@sp} command to insert vertical space. For example:@refill
3021
3022 @example
3023 @@sp 2
3024 @end example
3025
3026 @noindent
3027 This inserts two blank lines on the printed page. (@xref{sp, ,
3028 @code{@@sp}}, for more information about the @code{@@sp}
3029 command.)@refill
3030
3031 A template for this method looks like this:@refill
3032
3033 @example
3034 @group
3035 @@titlepage
3036 @@sp 10
3037 @@center @@titlefont@{@var{name-of-manual-when-printed}@}
3038 @@sp 2
3039 @@center @var{subtitle-if-any}
3040 @@sp 2
3041 @@center @var{author}
3042 @dots{}
3043 @@end titlepage
3044 @end group
3045 @end example
3046
3047 The spacing of the example fits an 8 1/2 by 11 inch manual.@refill
3048
3049 @node title subtitle author, Copyright & Permissions, titlefont center sp, Titlepage & Copyright Page
3050 @comment node-name, next, previous, up
3051 @subsection @code{@@title}, @code{@@subtitle}, and @code{@@author}
3052 @findex title
3053 @findex subtitle
3054 @findex author
3055
3056 You can use the @code{@@title}, @code{@@subtitle}, and @code{@@author}
3057 commands to create a title page in which the vertical and horizontal
3058 spacing is done for you automatically. This contrasts with the method
3059 described in
3060 the previous section, in which the @code{@@sp} command is needed to
3061 adjust vertical spacing.@refill
3062
3063 Write the @code{@@title}, @code{@@subtitle}, or @code{@@author}
3064 commands at the beginning of a line followed by the title, subtitle,
3065 or author.@refill
3066
3067 The @code{@@title} command produces a line in which the title is set
3068 flush to the left-hand side of the page in a larger than normal font.
3069 The title is underlined with a black rule.@refill
3070
3071 The @code{@@subtitle} command sets subtitles in a normal-sized font
3072 flush to the right-hand side of the page.@refill
3073
3074 The @code{@@author} command sets the names of the author or authors in
3075 a middle-sized font flush to the left-hand side of the page on a line
3076 near the bottom of the title page. The names are underlined with a
3077 black rule that is thinner than the rule that underlines the title.
3078 (The black rule only occurs if the @code{@@author} command line is
3079 followed by an @code{@@page} command line.)@refill
3080
3081 There are two ways to use the @code{@@author} command: you can write
3082 the name or names on the remaining part of the line that starts with
3083 an @code{@@author} command:@refill
3084
3085 @example
3086 @@author by Jane Smith and John Doe
3087 @end example
3088
3089 @noindent
3090 or you can write the names one above each other by using two (or more)
3091 @code{@@author} commands:@refill
3092
3093 @example
3094 @group
3095 @@author Jane Smith
3096 @@author John Doe
3097 @end group
3098 @end example
3099
3100 @noindent
3101 (Only the bottom name is underlined with a black rule.)@refill
3102
3103 @need 950
3104 A template for this method looks like this:@refill
3105
3106 @example
3107 @group
3108 @@titlepage
3109 @@title @var{name-of-manual-when-printed}
3110 @@subtitle @var{subtitle-if-any}
3111 @@subtitle @var{second-subtitle}
3112 @@author @var{author}
3113 @@page
3114 @dots{}
3115 @@end titlepage
3116 @end group
3117 @end example
3118
3119 @ifinfo
3120 @noindent
3121 Contrast this form with the form of a title page written using the
3122 @code{@@sp}, @code{@@center}, and @code{@@titlefont} commands:@refill
3123
3124 @example
3125 @@titlepage
3126 @@sp 10
3127 @@center @@titlefont@{Name of Manual When Printed@}
3128 @@sp 2
3129 @@center Subtitle, If Any
3130 @@sp 1
3131 @@center Second subtitle
3132 @@sp 2
3133 @@center Author
3134 @@page
3135 @dots{}
3136 @@end titlepage
3137 @end example
3138 @end ifinfo
3139
3140 @node Copyright & Permissions, end titlepage, title subtitle author, Titlepage & Copyright Page
3141 @comment node-name, next, previous, up
3142 @subsection Copyright Page and Permissions
3143 @cindex Copyright page
3144 @cindex Printed permissions
3145 @cindex Permissions, printed
3146
3147 By international treaty, the copyright notice for a book should be
3148 either on the title page or on the back of the title page. The
3149 copyright notice should include the year followed by the name of the
3150 organization or person who owns the copyright.@refill
3151
3152 When the copyright notice is on the back of the title page, that page
3153 is customarily not numbered. Therefore, in Texinfo, the information
3154 on the copyright page should be within @code{@@titlepage} and
3155 @code{@@end titlepage} commands.@refill
3156
3157 @findex vskip
3158 @findex filll
3159 @cindex Vertical whitespace (@samp{vskip})
3160 Use the @code{@@page} command to cause a page break. To push the
3161 copyright notice and the other text on the copyright page towards the
3162 bottom of the page, you can write a somewhat mysterious line after the
3163 @code{@@page} command that reads like this:@refill
3164
3165 @example
3166 @@vskip 0pt plus 1filll
3167 @end example
3168
3169 @noindent
3170 This is a @TeX{} command that is not supported by the Info formatting
3171 commands. The @code{@@vskip} command inserts whitespace. The
3172 @samp{0pt plus 1filll} means to put in zero points of mandatory whitespace,
3173 and as much optional whitespace as needed to push the
3174 following text to the bottom of the page. Note the use of three
3175 @samp{l}s in the word @samp{filll}; this is the correct usage in
3176 @TeX{}.@refill
3177
3178 @findex copyright
3179 In a printed manual, the @code{@@copyright@{@}} command generates a
3180 @samp{c} inside a circle. (In Info, it generates @samp{(C)}.) The
3181 copyright notice itself has the following legally defined sequence:@refill
3182
3183 @example
3184 Copyright @copyright{} @var{year} @var{copyright-owner}
3185 @end example
3186
3187 It is customary to put information on how to get a manual after the
3188 copyright notice, followed by the copying permissions for the
3189 manual.@refill
3190
3191 Note that permissions must be given here as well as in the summary
3192 segment within @code{@@ifinfo} and @code{@@end ifinfo} that
3193 immediately follows the header since this text appears only in the
3194 printed manual and the @samp{ifinfo} text appears only in the Info
3195 file.@refill
3196
3197 @xref{Sample Permissions}, for the standard text.@refill
3198
3199 @node end titlepage, headings on off, Copyright & Permissions, Titlepage & Copyright Page
3200 @comment node-name, next, previous, up
3201 @subsection Heading Generation
3202 @findex end titlepage
3203 @cindex Headings, page, begin to appear
3204 @cindex Titlepage end starts headings
3205 @cindex End titlepage starts headings
3206
3207 An @code{@@end titlepage} command on a line by itself not only marks
3208 the end of the title and copyright pages, but also causes @TeX{} to start
3209 generating page headings and page numbers.
3210
3211 To repeat what is said elsewhere, Texinfo has two standard page heading
3212 formats, one for documents which are printed on one side of each sheet of paper
3213 (single-sided printing), and the other for documents which are printed on both
3214 sides of each sheet (double-sided printing).
3215 (@xref{setchapternewpage, ,@code{@@setchapternewpage}}.)
3216 You can specify these formats in different ways:@refill
3217
3218 @itemize @bullet
3219 @item
3220 The conventional way is to write an @code{@@setchapternewpage} command
3221 before the title page commands, and then have the @code{@@end
3222 titlepage} command start generating page headings in the manner desired.
3223 (@xref{setchapternewpage, , @code{@@setchapternewpage}}.)@refill
3224
3225 @item
3226 Alternatively, you can use the @code{@@headings} command to prevent page
3227 headings from being generated or to start them for either single or
3228 double-sided printing. (Write an @code{@@headings} command immediately
3229 after the @code{@@end titlepage} command. @xref{headings on off, , The
3230 @code{@@headings} Command}, for more information.)@refill
3231
3232 @item
3233 Or, you may specify your own page heading and footing format.
3234 @xref{Headings, , Page Headings}, for detailed
3235 information about page headings and footings.@refill
3236 @end itemize
3237
3238 Most documents are formatted with the standard single-sided or
3239 double-sided format, using @code{@@setchapternewpage odd} for
3240 double-sided printing and no @code{@@setchapternewpage} command for
3241 single-sided printing.@refill
3242
3243 @node headings on off, , end titlepage, Titlepage & Copyright Page
3244 @comment node-name, next, previous, up
3245 @subsection The @code{@@headings} Command
3246 @findex headings
3247
3248 The @code{@@headings} command is rarely used. It specifies what kind of
3249 page headings and footings to print on each page. Usually, this is
3250 controlled by the @code{@@setchapternewpage} command. You need the
3251 @code{@@headings} command only if the @code{@@setchapternewpage} command
3252 does not do what you want, or if you want to turn off pre-defined page
3253 headings prior to defining your own. Write an @code{@@headings} command
3254 immediately after the @code{@@end titlepage} command.@refill
3255
3256 There are four ways to use the @code{@@headings} command:@refill
3257
3258 @table @code
3259 @item @@headings off
3260 Turn off printing of page headings.@refill
3261
3262 @item @@headings single
3263 Turn on page headings appropriate for single-sided printing.
3264 @refill
3265
3266 @item @@headings double
3267 @itemx @@headings on
3268 Turn on page headings appropriate for double-sided printing. The two
3269 commands, @code{@@headings on} and @code{@@headings double}, are
3270 synonymous.@refill
3271 @end table
3272
3273 For example, suppose you write @code{@@setchapternewpage off} before the
3274 @code{@@titlepage} command to tell @TeX{} to start a new chapter on the
3275 same page as the end of the last chapter. This command also causes
3276 @TeX{} to typeset page headers for single-sided printing. To cause
3277 @TeX{} to typeset for double sided printing, write @code{@@headings
3278 double} after the @code{@@end titlepage} command.
3279
3280 You can stop @TeX{} from generating any page headings at all by
3281 writing @code{@@headings off} on a line of its own immediately after the
3282 line containing the @code{@@end titlepage} command, like this:@refill
3283
3284 @example
3285 @@end titlepage
3286 @@headings off
3287 @end example
3288
3289 @noindent
3290 The @code{@@headings off} command overrides the @code{@@end titlepage}
3291 command, which would otherwise cause @TeX{} to print page
3292 headings.@refill
3293
3294 You can also specify your own style of page heading and footing.
3295 @xref{Headings, , Page Headings}, for more information.@refill
3296
3297 @node The Top Node, Software Copying Permissions, Titlepage & Copyright Page, Beginning a File
3298 @comment node-name, next, previous, up
3299 @section The `Top' Node and Master Menu
3300 @cindex @samp{@r{Top}} node
3301 @cindex Master menu
3302 @cindex Node, `Top'
3303
3304 The `Top' node is the node from which you enter an Info file.@refill
3305
3306 A `Top' node should contain a brief description of the Info file and an
3307 extensive, master menu for the whole Info file.
3308 This helps the reader understand what the Info file is
3309 about. Also, you should write the version number of the program to
3310 which the Info file applies; or, at least, the edition number.@refill
3311
3312 The contents of the `Top' node should appear only in the Info file; none
3313 of it should appear in printed output, so enclose it between
3314 @code{@@ifinfo} and @code{@@end ifinfo} commands. (@TeX{} does not
3315 print either an @code{@@node} line or a menu; they appear only in Info;
3316 strictly speaking, you are not required to enclose these parts between
3317 @code{@@ifinfo} and @code{@@end ifinfo}, but it is simplest to do so.
3318 @xref{Conditionals, , Conditionally Visible Text}.)@refill
3319
3320 @menu
3321 * Title of Top Node:: Sketch what the file is about.
3322 * Master Menu Parts:: A master menu has three or more parts.
3323 @end menu
3324
3325 @node Title of Top Node, Master Menu Parts, The Top Node, The Top Node
3326 @ifinfo
3327 @subheading `Top' Node Title
3328 @end ifinfo
3329
3330 Sometimes, you will want to place an @code{@@top} sectioning command
3331 line containing the title of the document immediately after the
3332 @code{@@node Top} line (@pxref{makeinfo top command, , The @code{@@top}
3333 Sectioning Command}, for more information).@refill
3334
3335 For example, the beginning of the Top node of this manual contains an
3336 @code{@@top} sectioning command, a short description, and edition and
3337 version information. It looks like this:@refill
3338
3339 @example
3340 @group
3341 @dots{}
3342 @@end titlepage
3343
3344 @@ifinfo
3345 @@node Top, Copying, (dir), (dir)
3346 @@top Texinfo
3347
3348 Texinfo is a documentation system@dots{}
3349 @end group
3350
3351 @group
3352 This is edition@dots{}
3353 @dots{}
3354 @@end ifinfo
3355 @end group
3356
3357 @group
3358 @@menu
3359 * Copying:: Texinfo is freely
3360 redistributable.
3361 * Overview:: What is Texinfo?
3362 @dots{}
3363 @end group
3364 @@end menu
3365 @end example
3366
3367 In a `Top' node, the `Previous', and `Up' nodes usually refer to the top
3368 level directory of the whole Info system, which is called @samp{(dir)}.
3369 The `Next' node refers to the first node that follows the main or master
3370 menu, which is usually the copying permissions, introduction, or first
3371 chapter.@refill
3372
3373 @node Master Menu Parts, , Title of Top Node, The Top Node
3374 @subsection Parts of a Master Menu
3375 @cindex Master menu parts
3376 @cindex Parts of a master menu
3377
3378 A @dfn{master menu} is a detailed main menu listing all the nodes in a
3379 file.
3380
3381 A master menu is enclosed in @code{@@menu} and @code{@@end menu}
3382 commands and does not appear in the printed document.@refill
3383
3384 Generally, a master menu is divided into parts.@refill
3385
3386 @itemize @bullet
3387 @item
3388 The first part contains the major nodes in the Texinfo file: the nodes
3389 for the chapters, chapter-like sections, and the appendices.@refill
3390
3391 @item
3392 The second part contains nodes for the indices.@refill
3393
3394 @item
3395 The third and subsequent parts contain a listing of the other, lower
3396 level nodes, often ordered by chapter. This way, rather than go
3397 through an intermediary menu, an inquirer can go directly to a
3398 particular node when searching for specific information. These menu
3399 items are not required; add them if you think they are a
3400 convenience.@refill
3401 @end itemize
3402
3403 Each section in the menu can be introduced by a descriptive line. So
3404 long as the line does not begin with an asterisk, it will not be
3405 treated as a menu entry. (@xref{Writing a Menu}, for more
3406 information.)@refill
3407
3408 For example, the master menu for this manual looks like the following
3409 (but has many more entries):@refill
3410
3411 @example
3412 @group
3413 @@menu
3414 * Copying:: Texinfo is freely
3415 redistributable.
3416 * Overview:: What is Texinfo?
3417 * Texinfo Mode:: Special features in GNU Emacs.
3418 @dots{}
3419 @dots{}
3420 @end group
3421 @group
3422 * Command and Variable Index::
3423 An entry for each @@-command.
3424 * Concept Index:: An entry for each concept.
3425 @end group
3426
3427 @group
3428 --- The Detailed Node Listing ---
3429
3430 Overview of Texinfo
3431
3432 * Info Files:: What is an Info file?
3433 * Printed Manuals:: Characteristics of
3434 a printed manual.
3435 @dots{}
3436 @dots{}
3437 @end group
3438
3439 @group
3440 Using Texinfo Mode
3441
3442 * Info on a Region:: Formatting part of a file
3443 for Info.
3444 @dots{}
3445 @dots{}
3446 @@end menu
3447 @end group
3448 @end example
3449
3450 @node Software Copying Permissions, , The Top Node, Beginning a File
3451 @comment node-name, next, previous, up
3452 @section Software Copying Permissions
3453 @cindex Software copying permissions
3454 @cindex Copying software
3455 @cindex Distribution
3456 @cindex License agreement
3457
3458 If the Texinfo file has a section containing the ``General Public
3459 License'' and the distribution information and a warranty disclaimer
3460 for the software that is documented, this section usually follows the
3461 `Top' node. The General Public License is very important to Project
3462 GNU software. It ensures that you and others will continue to have a
3463 right to use and share the software.@refill
3464
3465 The copying and distribution information and the disclaimer are
3466 followed by an introduction or else by the first chapter of the
3467 manual.@refill
3468
3469 @cindex Introduction, as part of file
3470 Although an introduction is not a required part of a Texinfo file, it
3471 is very helpful. Ideally, it should state clearly and concisely what
3472 the file is about and who would be interested in reading it. In
3473 general, an introduction would follow the licensing and distribution
3474 information, although sometimes people put it earlier in the document.
3475 Usually, an introduction is put in an @code{@@unnumbered} section.
3476 (@xref{unnumbered & appendix, , The @code{@@unnumbered} and
3477 @code{@@appendix} Commands}.)@refill
3478
3479 @node Ending a File, Structuring, Beginning a File, Top
3480 @comment node-name, next, previous, up
3481 @chapter Ending a Texinfo File
3482 @cindex Ending a Texinfo file
3483 @cindex Texinfo file ending
3484 @cindex File ending
3485 @findex bye
3486
3487 The end of a Texinfo file should include the commands that create
3488 indices and generate detailed and summary tables of contents.
3489 And it must include the @code{@@bye} command that marks the last line
3490 processed by @TeX{}.@refill
3491
3492 @need 700
3493 For example:
3494
3495 @example
3496 @@node Concept Index, , Variables Index, Top
3497 @@c node-name, next, previous, up
3498 @@unnumbered Concept Index
3499
3500 @@printindex cp
3501
3502 @@contents
3503 @@bye
3504 @end example
3505
3506 @menu
3507 * Printing Indices & Menus:: How to print an index in hardcopy and
3508 generate index menus in Info.
3509 * Contents:: How to create a table of contents.
3510 * File End:: How to mark the end of a file.
3511 @end menu
3512
3513 @node Printing Indices & Menus, Contents, Ending a File, Ending a File
3514 @comment node-name, next, previous, up
3515 @section Index Menus and Printing an Index
3516 @findex printindex
3517 @cindex Printing an index
3518 @cindex Indices, printing and menus
3519 @cindex Generating menus with indices
3520 @cindex Menus generated with indices
3521
3522 To print an index means to include it as part of a manual or Info
3523 file. This does not happen automatically just because you use
3524 @code{@@cindex} or other index-entry generating commands in the
3525 Texinfo file; those just cause the raw data for the index to be
3526 accumulated. To generate an index, you must include the
3527 @code{@@printindex} command at the place in the document where you
3528 want the index to appear. Also, as part of the process of creating a
3529 printed manual, you must run a program called @code{texindex}
3530 (@pxref{Format/Print Hardcopy}) to sort the raw data to produce a sorted
3531 index file. The sorted index file is what is actually used to
3532 print the index.@refill
3533
3534 Texinfo offers six different types of predefined index: the concept
3535 index, the function index, the variables index, the keystroke index, the
3536 program index, and the data type index (@pxref{Predefined Indices}). Each
3537 index type has a two-letter name: @samp{cp}, @samp{fn}, @samp{vr},
3538 @samp{ky}, @samp{pg}, and @samp{tp}. You may merge indices, or put them
3539 into separate sections (@pxref{Combining Indices}); or you may define
3540 your own indices (@pxref{New Indices, , Defining New Indices}).@refill
3541
3542 The @code{@@printindex} command takes a two-letter index name, reads
3543 the corresponding sorted index file and formats it appropriately into
3544 an index.@refill
3545
3546 @ignore
3547 The two-letter index names are:
3548
3549 @table @samp
3550 @item cp
3551 concept index
3552 @item fn
3553 function index
3554 @item vr
3555 variable index
3556 @item ky
3557 key index
3558 @item pg
3559 program index
3560 @item tp
3561 data type index
3562 @end table
3563 @end ignore
3564 The @code{@@printindex} command does not generate a chapter heading
3565 for the index. Consequently, you should precede the
3566 @code{@@printindex} command with a suitable section or chapter command
3567 (usually @code{@@unnumbered}) to supply the chapter heading and put
3568 the index into the table of contents. Precede the @code{@@unnumbered}
3569 command with an @code{@@node} line.@refill
3570
3571 @need 1200
3572 For example:
3573
3574 @smallexample
3575 @group
3576 @@node Variable Index, Concept Index, Function Index, Top
3577 @@comment node-name, next, previous, up
3578 @@unnumbered Variable Index
3579
3580 @@printindex vr
3581 @end group
3582
3583 @group
3584 @@node Concept Index, , Variable Index, Top
3585 @@comment node-name, next, previous, up
3586 @@unnumbered Concept Index
3587
3588 @@printindex cp
3589 @end group
3590
3591 @group
3592 @@summarycontents
3593 @@contents
3594 @@bye
3595 @end group
3596 @end smallexample
3597
3598 @noindent
3599 (Readers often prefer that the concept index come last in a book,
3600 since that makes it easiest to find.)@refill
3601
3602 @ignore
3603 In @TeX{}, the @code{@@printindex} command needs a sorted index file
3604 to work from. @TeX{} does not know how to do sorting; this is a
3605 deficiency. @TeX{} writes output files of raw index data; use the
3606 @code{texindex} program to convert these files to sorted index files.
3607 (@xref{Format/Print Hardcopy}, for more information.)@refill
3608 @end ignore
3609 @node Contents, File End, Printing Indices & Menus, Ending a File
3610 @comment node-name, next, previous, up
3611 @section Generating a Table of Contents
3612 @cindex Table of contents
3613 @cindex Contents, Table of
3614 @findex contents
3615 @findex summarycontents
3616 @findex shortcontents
3617
3618 The @code{@@chapter}, @code{@@section}, and other structuring commands
3619 supply the information to make up a table of contents, but they do not
3620 cause an actual table to appear in the manual. To do this, you must
3621 use the @code{@@contents} and @code{@@summarycontents}
3622 commands:@refill
3623
3624 @table @code
3625 @item @@contents
3626 Generate a table of contents in a printed manual, including all
3627 chapters, sections, subsections, etc., as well as appendices and
3628 unnumbered chapters. (Headings generated by the @code{@@heading}
3629 series of commands do not appear in the table of contents.) The
3630 @code{@@contents} command should be written on a line by
3631 itself.@refill
3632
3633 @item @@shortcontents
3634 @itemx @@summarycontents
3635 (@code{@@summarycontents} is a synonym for @code{@@shortcontents}; the
3636 two commands are exactly the same.)@refill
3637
3638 Generate a short or summary table of contents that lists only the
3639 chapters (and appendices and unnumbered chapters). Omit sections, subsections
3640 and subsubsections. Only a long manual needs a short table
3641 of contents in addition to the full table of contents.@refill
3642
3643 Write the @code{@@shortcontents} command on a line by itself right
3644 @emph{before} the @code{@@contents} command.@refill
3645 @end table
3646
3647 The table of contents commands automatically generate a chapter-like
3648 heading at the top of the first table of contents page. Write the table
3649 of contents commands at the very end of a Texinfo file, just before the
3650 @code{@@bye} command, following any index sections---anything in the
3651 Texinfo file after the table of contents commands will be omitted from
3652 the table of contents.@refill
3653
3654 When you print a manual with a table of contents, the table of
3655 contents are printed last and numbered with roman numerals. You need
3656 to place those pages in their proper place, after the title page,
3657 yourself. (This is the only collating you need to do for a printed
3658 manual. The table of contents is printed last because it is generated
3659 after the rest of the manual is typeset.)@refill
3660
3661 @need 700
3662 Here is an example of where to write table of contents commands:@refill
3663
3664 @example
3665 @group
3666 @var{indices}@dots{}
3667 @@shortcontents
3668 @@contents
3669 @@bye
3670 @end group
3671 @end example
3672
3673 Since an Info file uses menus instead of tables of contents, the Info
3674 formatting commands ignore the @code{@@contents} and
3675 @code{@@shortcontents} commands.@refill
3676
3677 @node File End, , Contents, Ending a File
3678 @comment node-name, next, previous, up
3679 @section @code{@@bye} File Ending
3680 @findex bye
3681
3682 An @code{@@bye} command terminates @TeX{} or Info formatting. None of
3683 the formatting commands see any of the file following @code{@@bye}.
3684 The @code{@@bye} command should be on a line by itself.@refill
3685
3686 If you wish, you may follow the @code{@@bye} line with notes. These notes
3687 will not be formatted and will not appear in either Info or a printed
3688 manual; it is as if text after @code{@@bye} were within @code{@@ignore}
3689 @dots{} @code{@@end ignore}. Also, you may follow the @code{@@bye} line
3690 with a local variables list. @xref{Compile-Command, , Using Local
3691 Variables and the Compile Command}, for more information.@refill
3692
3693 @node Structuring, Nodes, Ending a File, Top
3694 @comment node-name, next, previous, up
3695 @chapter Chapter Structuring
3696 @cindex Chapter structuring
3697 @cindex Structuring of chapters
3698
3699 The @dfn{chapter structuring} commands divide a document into a hierarchy of
3700 chapters, sections, subsections, and subsubsections. These commands
3701 generate large headings; they also provide information for the table
3702 of contents of a printed manual (@pxref{Contents, , Generating a Table
3703 of Contents}).@refill
3704
3705 The chapter structuring commands do not create an Info node structure,
3706 so normally you should put an @code{@@node} command immediately before
3707 each chapter structuring command (@pxref{Nodes}). The only time you
3708 are likely to use the chapter structuring commands without using the
3709 node structuring commands is if you are writing a document that
3710 contains no cross references and will never be transformed into Info
3711 format.@refill
3712
3713 It is unlikely that you will ever write a Texinfo file that is
3714 intended only as an Info file and not as a printable document. If you
3715 do, you might still use chapter structuring commands to create a
3716 heading at the top of each node---but you don't need to.@refill
3717
3718 @menu
3719 * Tree Structuring:: A manual is like an upside down tree @dots{}
3720 * Structuring Command Types:: How to divide a manual into parts.
3721 * makeinfo top:: The @code{@@top} command, part of the `Top' node.
3722 * chapter::
3723 * unnumbered & appendix::
3724 * majorheading & chapheading::
3725 * section::
3726 * unnumberedsec appendixsec heading::
3727 * subsection::
3728 * unnumberedsubsec appendixsubsec subheading::
3729 * subsubsection:: Commands for the lowest level sections.
3730 * Raise/lower sections:: How to change commands' hierarchical level.
3731 @end menu
3732
3733 @node Tree Structuring, Structuring Command Types, Structuring, Structuring
3734 @comment node-name, next, previous, up
3735 @section Tree Structure of Sections
3736 @cindex Tree structuring
3737
3738 A Texinfo file is usually structured like a book with chapters,
3739 sections, subsections, and the like. This structure can be visualized
3740 as a tree (or rather as an upside-down tree) with the root at the top
3741 and the levels corresponding to chapters, sections, subsection, and
3742 subsubsections.@refill
3743
3744 Here is a diagram that shows a Texinfo file with three chapters,
3745 each of which has two sections.@refill
3746
3747 @example
3748 @group
3749 Top
3750 |
3751 -------------------------------------
3752 | | |
3753 Chapter 1 Chapter 2 Chapter 3
3754 | | |
3755 -------- -------- --------
3756 | | | | | |
3757 Section Section Section Section Section Section
3758 1.1 1.2 2.1 2.2 3.1 3.2
3759
3760 @end group
3761 @end example
3762
3763 In a Texinfo file that has this structure, the beginning of Chapter 2
3764 looks like this:@refill
3765
3766 @example
3767 @group
3768 @@node Chapter 2, Chapter 3, Chapter 1, top
3769 @@chapter Chapter 2
3770 @end group
3771 @end example
3772
3773 The chapter structuring commands are described in the sections that
3774 follow; the @code{@@node} and @code{@@menu} commands are described in
3775 following chapters. (@xref{Nodes}, and see @ref{Menus}.)@refill
3776
3777 @node Structuring Command Types, makeinfo top, Tree Structuring, Structuring
3778 @comment node-name, next, previous, up
3779 @section Types of Structuring Command
3780
3781 The chapter structuring commands fall into four groups or series, each
3782 of which contains structuring commands corresponding to the
3783 hierarchical levels of chapters, sections, subsections, and
3784 subsubsections.@refill
3785
3786 The four groups are the @code{@@chapter} series, the
3787 @code{@@unnumbered} series, the @code{@@appendix} series, and the
3788 @code{@@heading} series.@refill
3789
3790 Each command produces titles that have a different appearance on the
3791 printed page or Info file; only some of the commands produce
3792 titles that are listed in the table of contents of a printed book or
3793 manual.@refill
3794
3795 @itemize @bullet
3796 @item
3797 The @code{@@chapter} and @code{@@appendix} series of commands produce
3798 numbered or lettered entries both in the body of a printed work and in
3799 its table of contents.@refill
3800
3801 @item
3802 The @code{@@unnumbered} series of commands produce unnumbered entries
3803 both in the body of a printed work and in its table of contents. The
3804 @code{@@top} command, which has a special use, is a member of this
3805 series (@pxref{makeinfo top, , @code{@@top}}).@refill
3806
3807 @item
3808 The @code{@@heading} series of commands produce unnumbered headings
3809 that do not appear in a table of contents. The heading commands never
3810 start a new page.@refill
3811
3812 @item
3813 The @code{@@majorheading} command produces results similar to using
3814 the @code{@@chapheading} command but generates a larger vertical
3815 whitespace before the heading.@refill
3816
3817 @item
3818 When an @code{@@setchapternewpage} command says to do so, the
3819 @code{@@chapter}, @code{@@unnumbered}, and @code{@@appendix} commands
3820 start new pages in the printed manual; the @code{@@heading} commands
3821 do not.@refill
3822 @end itemize
3823
3824 @need 1000
3825 Here are the four groups of chapter structuring commands:@refill
3826
3827 @c Slightly different formatting for regular sized books and smallbooks.
3828 @ifset smallbook
3829 @sp 1
3830 @tex
3831 {\let\rm=\indrm \let\tt=\indtt
3832 \halign{\hskip\itemindent#\hfil& \hskip.5em#\hfil& \hskip.5em#\hfil&
3833 \hskip.5em#\hfil\cr
3834
3835 & & & \rm No new pages\cr
3836 \rm Numbered& \rm Unnumbered& \rm Lettered and numbered& \rm Unnumbered\cr
3837 \rm In contents& \rm In contents& \rm In contents& \rm Not in contents\cr
3838
3839 & & & \cr
3840 & \tt @@top& & \tt @@majorheading\cr
3841 \tt @@chapter& \tt @@unnumbered& \tt @@appendix& \tt @@chapheading\cr
3842 \tt @@section& \tt @@unnumberedsec& \tt @@appendixsec& \tt @@heading\cr
3843 \tt @@subsection&\tt @@unnumberedsubsec&\tt @@appendixsubsec&
3844 \tt @@subheading\cr
3845 \tt @@subsubsection& \tt @@unnumberedsubsubsec& \tt @@appendixsubsubsec&
3846 \tt @@subsubheading\cr}}
3847 @end tex
3848 @end ifset
3849 @ifclear smallbook
3850 @sp 1
3851 @tex
3852 \vbox{
3853 \halign{\hskip\itemindent\hskip.5em#\hfil& \hskip.5em#\hfil&
3854 \hskip.5em#\hfil& \hskip.5em #\hfil\cr
3855
3856 & & & \cr
3857 & & & \rm No new pages\cr
3858 \rm Numbered& \rm Unnumbered& \rm Lettered and numbered& \rm Unnumbered\cr
3859 \rm In contents& \rm In contents& \rm In contents& \rm Not in contents\cr
3860
3861 & & & \cr
3862 & \tt @@top& & \tt @@majorheading\cr
3863 \tt @@chapter& \tt @@unnumbered& \tt @@appendix& \tt @@chapheading\cr
3864 \tt @@section& \tt @@unnumberedsec& \tt @@appendixsec& \tt @@heading\cr
3865 \tt @@subsection&\tt @@unnumberedsubsec&\tt @@appendixsubsec&
3866 \tt @@subheading\cr
3867 \tt @@subsubsection& \tt @@unnumberedsubsubsec& \tt @@appendixsubsubsec&
3868 \tt @@subsubheading\cr}}
3869 @end tex
3870 @end ifclear
3871 @ifinfo
3872 @example
3873 @group
3874 @r{No new pages}
3875 @r{Numbered} @r{Unnumbered} @r{Lettered and numbered} @r{Unnumbered}
3876 @r{In contents} @r{In contents} @r{In contents} @r{Not in contents}
3877
3878 @@top @@majorheading
3879 @@chapter @@unnumbered @@appendix @@chapheading
3880 @@section @@unnumberedsec @@appendixsec @@heading
3881 @@subsection @@unnumberedsubsec @@appendixsubsec @@subheading
3882 @@subsubsection @@unnumberedsubsubsec @@appendixsubsubsec @@subsubheading
3883 @end group
3884 @end example
3885 @end ifinfo
3886
3887 @c Cannot line up columns properly inside of an example because of roman
3888 @c proportional fonts.
3889 @ignore
3890 @ifset smallbook
3891 @iftex
3892 @smallexample
3893 @group
3894 @r{No new pages}
3895 @r{Numbered} @r{Unnumbered} @r{Lettered and numbered} @r{Unnumbered}
3896 @r{In contents} @r{In contents} @r{In contents} @r{Not in contents}
3897
3898 @@top @@majorheading
3899 @@chapter @@unnumbered @@appendix @@chapheading
3900 @@section @@unnumberedsec @@appendixsec @@heading
3901 @@subsection @@unnumberedsubsec @@appendixsubsec @@subheading
3902 @@subsubsection @@unnumberedsubsubsec @@appendixsubsubsec @@subsubheading
3903 @end group
3904 @end smallexample
3905 @end iftex
3906 @end ifset
3907 @ifclear smallbook
3908 @iftex
3909 @smallexample
3910 @group
3911 @r{No new pages}
3912 @r{Numbered} @r{Unnumbered} @r{Lettered and numbered} @r{Unnumbered}
3913 @r{In contents} @r{In contents} @r{In contents} @r{Not in contents}
3914
3915 @@top @@majorheading
3916 @@chapter @@unnumbered @@appendix @@chapheading
3917 @@section @@unnumberedsec @@appendixsec @@heading
3918 @@subsection @@unnumberedsubsec @@appendixsubsec @@subheading
3919 @@subsubsection @@unnumberedsubsubsec @@appendixsubsubsec @@subsubheading
3920 @end group
3921 @end smallexample
3922 @end iftex
3923 @end ignore
3924
3925 @node makeinfo top, chapter, Structuring Command Types, Structuring
3926 @comment node-name, next, previous, up
3927 @section @code{@@top}
3928
3929 The @code{@@top} command is a special sectioning command that you use
3930 only after an @code{@@node Top} line at the beginning of a Texinfo file.
3931 The @code{@@top} command tells the @code{makeinfo} formatter
3932 which node is the `Top'
3933 node. It has the same typesetting effect as @code{@@unnumbered}
3934 (@pxref{unnumbered & appendix, , @code{@@unnumbered}, @code{@@appendix}}).
3935 For detailed information, see
3936 @ref{makeinfo top command, , The @code{@@top} Command}.@refill
3937
3938 @node chapter, unnumbered & appendix, makeinfo top, Structuring
3939 @comment node-name, next, previous, up
3940 @section @code{@@chapter}
3941 @findex chapter
3942
3943 @code{@@chapter} identifies a chapter in the document. Write the
3944 command at the beginning of a line and follow it on the same line by
3945 the title of the chapter.@refill
3946
3947 For example, this chapter in this manual is entitled ``Chapter
3948 Structuring''; the @code{@@chapter} line looks like this:@refill
3949
3950 @example
3951 @@chapter Chapter Structuring
3952 @end example
3953
3954 In @TeX{}, the @code{@@chapter} command creates a chapter in the
3955 document, specifying the chapter title. The chapter is numbered
3956 automatically.@refill
3957
3958 In Info, the @code{@@chapter} command causes the title to appear on a
3959 line by itself, with a line of asterisks inserted underneath. Thus,
3960 in Info, the above example produces the following output:@refill
3961
3962 @example
3963 Chapter Structuring
3964 *******************
3965 @end example
3966
3967 @node unnumbered & appendix, majorheading & chapheading, chapter, Structuring
3968 @comment node-name, next, previous, up
3969 @section @code{@@unnumbered}, @code{@@appendix}
3970 @findex unnumbered
3971 @findex appendix
3972
3973 Use the @code{@@unnumbered} command to create a chapter that appears
3974 in a printed manual without chapter numbers of any kind. Use the
3975 @code{@@appendix} command to create an appendix in a printed manual
3976 that is labelled by letter instead of by number.@refill
3977
3978 For Info file output, the @code{@@unnumbered} and @code{@@appendix}
3979 commands are equivalent to @code{@@chapter}: the title is printed on a
3980 line by itself with a line of asterisks underneath. (@xref{chapter, ,
3981 @code{@@chapter}}.)@refill
3982
3983 To create an appendix or an unnumbered chapter, write an
3984 @code{@@appendix} or @code{@@unnumbered} command at the beginning of a
3985 line and follow it on the same line by the title, as you would if you
3986 were creating a chapter.@refill
3987
3988 @node majorheading & chapheading, section, unnumbered & appendix, Structuring
3989 @section @code{@@majorheading}, @code{@@chapheading}
3990 @findex majorheading
3991 @findex chapheading
3992
3993 The @code{@@majorheading} and @code{@@chapheading} commands put
3994 chapter-like headings in the body of a document.@refill
3995
3996 However, neither command causes @TeX{} to produce a numbered heading
3997 or an entry in the table of contents; and neither command causes
3998 @TeX{} to start a new page in a printed manual.@refill
3999
4000 In @TeX{}, an @code{@@majorheading} command generates a larger vertical
4001 whitespace before the heading than an @code{@@chapheading} command but
4002 is otherwise the same.@refill
4003
4004 In Info,
4005 the @code{@@majorheading} and
4006 @code{@@chapheading} commands are equivalent to
4007 @code{@@chapter}: the title is printed on a line by itself with a line
4008 of asterisks underneath. (@xref{chapter, , @code{@@chapter}}.)@refill
4009
4010 @node section, unnumberedsec appendixsec heading, majorheading & chapheading, Structuring
4011 @comment node-name, next, previous, up
4012 @section @code{@@section}
4013 @findex section
4014
4015 In a printed manual, an @code{@@section} command identifies a
4016 numbered section within a chapter. The section title appears in the
4017 table of contents. In Info, an @code{@@section} command provides a
4018 title for a segment of text, underlined with @samp{=}.@refill
4019
4020 This section is headed with an @code{@@section} command and looks like
4021 this in the Texinfo file:@refill
4022
4023 @example
4024 @@section @@code@{@@@@section@}
4025 @end example
4026
4027 To create a section, write the @code{@@section} command at the
4028 beginning of a line and follow it on the same line by the section
4029 title.@refill
4030
4031 Thus,
4032
4033 @example
4034 @@section This is a section
4035 @end example
4036
4037 @noindent
4038 produces
4039
4040 @example
4041 @group
4042 This is a section
4043 =================
4044 @end group
4045 @end example
4046
4047 @noindent
4048 in Info.
4049
4050 @node unnumberedsec appendixsec heading, subsection, section, Structuring
4051 @comment node-name, next, previous, up
4052 @section @code{@@unnumberedsec}, @code{@@appendixsec}, @code{@@heading}
4053 @findex unnumberedsec
4054 @findex appendixsec
4055 @findex heading
4056
4057 The @code{@@unnumberedsec}, @code{@@appendixsec}, and @code{@@heading}
4058 commands are, respectively, the unnumbered, appendix-like, and
4059 heading-like equivalents of the @code{@@section} command.
4060 (@xref{section, , @code{@@section}}.)@refill
4061
4062 @table @code
4063 @item @@unnumberedsec
4064 The @code{@@unnumberedsec} command may be used within an
4065 unnumbered chapter or within a regular chapter or appendix to
4066 provide an unnumbered section.@refill
4067
4068 @item @@appendixsec
4069 @itemx @@appendixsection
4070 @code{@@appendixsection} is a longer spelling of the
4071 @code{@@appendixsec} command; the two are synonymous.@refill
4072 @findex appendixsection
4073
4074 Conventionally, the @code{@@appendixsec} or @code{@@appendixsection}
4075 command is used only within appendices.@refill
4076
4077 @item @@heading
4078 You may use the @code{@@heading} command anywhere you wish for a
4079 section-style heading that will not appear in the table of contents.@refill
4080 @end table
4081
4082 @node subsection, unnumberedsubsec appendixsubsec subheading, unnumberedsec appendixsec heading, Structuring
4083 @comment node-name, next, previous, up
4084 @section The @code{@@subsection} Command
4085 @findex subsection
4086
4087 Subsections are to sections as sections are to chapters.
4088 (@xref{section, , @code{@@section}}.) In Info, subsection titles are
4089 underlined with @samp{-}. For example,@refill
4090
4091 @example
4092 @@subsection This is a subsection
4093 @end example
4094
4095 @noindent
4096 produces
4097
4098 @example
4099 @group
4100 This is a subsection
4101 --------------------
4102 @end group
4103 @end example
4104
4105 In a printed manual, subsections are listed in the table of contents
4106 and are numbered three levels deep.@refill
4107
4108 @node unnumberedsubsec appendixsubsec subheading, subsubsection, subsection, Structuring
4109 @comment node-name, next, previous, up
4110 @section The @code{@@subsection}-like Commands
4111 @cindex Subsection-like commands
4112 @findex unnumberedsubsec
4113 @findex appendixsubsec
4114 @findex subheading
4115
4116 The @code{@@unnumberedsubsec}, @code{@@appendixsubsec}, and
4117 @code{@@subheading} commands are, respectively, the unnumbered,
4118 appendix-like, and heading-like equivalents of the @code{@@subsection}
4119 command. (@xref{subsection, , @code{@@subsection}}.)@refill
4120
4121 In Info, the @code{@@subsection}-like commands generate a title
4122 underlined with hyphens. In a printed manual, an @code{@@subheading}
4123 command produces a heading like that of a subsection except that it is
4124 not numbered and does not appear in the table of contents. Similarly,
4125 an @code{@@unnumberedsubsec} command produces an unnumbered heading like
4126 that of a subsection and an @code{@@appendixsubsec} command produces a
4127 subsection-like heading labelled with a letter and numbers; both of
4128 these commands produce headings that appear in the table of
4129 contents.@refill
4130
4131 @node subsubsection, Raise/lower sections, unnumberedsubsec appendixsubsec subheading, Structuring
4132 @comment node-name, next, previous, up
4133 @section The `subsub' Commands
4134 @cindex Subsub commands
4135 @findex subsubsection
4136 @findex unnumberedsubsubsec
4137 @findex appendixsubsubsec
4138 @findex subsubheading
4139
4140 The fourth and lowest level sectioning commands in Texinfo are the
4141 `subsub' commands. They are:@refill
4142
4143 @table @code
4144 @item @@subsubsection
4145 Subsubsections are to subsections as subsections are to sections.
4146 (@xref{subsection, , @code{@@subsection}}.) In a printed manual,
4147 subsubsection titles appear in the table of contents and are numbered
4148 four levels deep.@refill
4149
4150 @item @@unnumberedsubsubsec
4151 Unnumbered subsubsection titles appear in the table of contents of a
4152 printed manual, but lack numbers. Otherwise, unnumbered
4153 subsubsections are the same as subsubsections. In Info, unnumbered
4154 subsubsections look exactly like ordinary subsubsections.@refill
4155
4156 @item @@appendixsubsubsec
4157 Conventionally, appendix commands are used only for appendices and are
4158 lettered and numbered appropriately in a printed manual. They also
4159 appear in the table of contents. In Info, appendix subsubsections look
4160 exactly like ordinary subsubsections.@refill
4161
4162 @item @@subsubheading
4163 The @code{@@subsubheading} command may be used anywhere that you need
4164 a small heading that will not appear in the table of contents. In
4165 Info, subsubheadings look exactly like ordinary subsubsection
4166 headings.@refill
4167 @end table
4168
4169 In Info, `subsub' titles are underlined with periods.
4170 For example,@refill
4171
4172 @example
4173 @@subsubsection This is a subsubsection
4174 @end example
4175
4176 @noindent
4177 produces
4178
4179 @example
4180 @group
4181 This is a subsubsection
4182 .......................
4183 @end group
4184 @end example
4185
4186 @node Raise/lower sections, , subsubsection, Structuring
4187 @comment node-name, next, previous, up
4188 @section @code{@@raisesections} and @code{@@lowersections}
4189 @findex @@raisesections
4190 @findex @@lowersections
4191 @cindex Raising and lowering sections
4192 @cindex Sections, raising and lowering
4193
4194 The @code{@@raisesections} and @code{@@lowersections} commands raise and
4195 lower the hierarchical level of chapters, sections, subsections and the
4196 like. The @code{@@raisesections} command changes sections to chapters,
4197 subsections to sections, and so on. The @code{@@lowersections} command
4198 changes chapters to sections, sections to subsections, and so on.
4199
4200 An @code{@@lowersections} command is useful if you wish to include text
4201 that is written as an outer or standalone Texinfo file in another
4202 Texinfo file as an inner, included file. If you write the command at
4203 the beginning of the file, all your @code{@@chapter} commands are
4204 formatted as if they were @code{@@section} commands, all your
4205 @code{@@section} command are formatted as if they were
4206 @code{@@subsection} commands, and so on.
4207
4208 @need 1000
4209 @code{@@raisesections} raises a command one level in the chapter
4210 structuring hierarchy:@refill
4211
4212 @example
4213 @group
4214 @r{Change} @r{To}
4215
4216 @@subsection @@section,
4217 @@section @@chapter,
4218 @@heading @@chapheading,
4219 @r{etc.}
4220 @end group
4221 @end example
4222
4223 @need 1000
4224 @code{@@lowersections} lowers a command one level in the chapter
4225 structuring hierarchy:@refill
4226
4227 @example
4228 @group
4229 @r{Change} @r{To}
4230
4231 @@chapter @@section,
4232 @@subsection @@subsubsection,
4233 @@heading @@subheading,
4234 @r{etc.}
4235 @end group
4236 @end example
4237
4238 An @code{@@raisesections} or @code{@@lowersections} command changes only
4239 those structuring commands that follow the command in the Texinfo file.
4240 Write an @code{@@raisesections} or @code{@@lowersections} command on a
4241 line of its own.
4242
4243 An @code{@@lowersections} command cancels an @code{@@raisesections}
4244 command, and vice versa.
4245
4246 Repeated use of the commands continue to raise or lower the hierarchical
4247 level a step at a time.
4248
4249 An attempt to raise above `chapters' reproduces chapter commands; an
4250 attempt to lower below `subsubsections' reproduces subsubsection
4251 commands.
4252
4253 @node Nodes, Menus, Structuring, Top
4254 @comment node-name, next, previous, up
4255 @chapter Nodes
4256
4257 @dfn{Nodes} are the primary segments of a Texinfo file. They do not
4258 themselves impose a hierarchic or any other kind of structure on a file.
4259 Nodes contain @dfn{node pointers} that name other nodes, and can contain
4260 @dfn{menus} which are lists of nodes. In Info, the movement commands
4261 can carry you to a pointed-to node or to a node listed in a menu. Node
4262 pointers and menus provide structure for Info files just as chapters,
4263 sections, subsections, and the like, provide structure for printed
4264 books.@refill
4265
4266 @menu
4267 * Two Paths:: Different commands to structure
4268 Info output and printed output.
4269 * Node Menu Illustration:: A diagram, and sample nodes and menus.
4270 * node:: How to write a node, in detail.
4271 * makeinfo Pointer Creation:: How to create node pointers with @code{makeinfo}.
4272 @end menu
4273
4274 @node Two Paths, Node Menu Illustration, Nodes, Nodes
4275 @ifinfo
4276 @heading Two Paths
4277 @end ifinfo
4278
4279 The node and menu commands and the chapter structuring commands are
4280 independent of each other:
4281
4282 @itemize @bullet
4283 @item
4284 In Info, node and menu commands provide structure. The chapter
4285 structuring commands generate headings with different kinds of
4286 underlining---asterisks for chapters, hyphens for sections, and so on;
4287 they do nothing else.@refill
4288
4289 @item
4290 In @TeX{}, the chapter structuring commands generate chapter and section
4291 numbers and tables of contents. The node and menu commands provide
4292 information for cross references; they do nothing else.@refill
4293 @end itemize
4294
4295 You can use node pointers and menus to structure an Info file any way
4296 you want; and you can write a Texinfo file so that its Info output has a
4297 different structure than its printed output. However, most Texinfo
4298 files are written such that the structure for the Info output
4299 corresponds to the structure for the printed output. It is not
4300 convenient to do otherwise.@refill
4301
4302 Generally, printed output is structured in a tree-like hierarchy in
4303 which the chapters are the major limbs from which the sections branch
4304 out. Similarly, node pointers and menus are organized to create a
4305 matching structure in the Info output.@refill
4306
4307 @node Node Menu Illustration, node, Two Paths, Nodes
4308 @comment node-name, next, previous, up
4309 @section Node and Menu Illustration
4310
4311 Here is a copy of the diagram shown earlier that illustrates a Texinfo
4312 file with three chapters, each of which contains two sections.@refill
4313
4314 Note that the ``root'' is at the top of the diagram and the ``leaves''
4315 are at the bottom. This is how such a diagram is drawn conventionally;
4316 it illustrates an upside-down tree. For this reason, the root node is
4317 called the `Top' node, and `Up' node pointers carry you closer to the
4318 root.@refill
4319
4320 @example
4321 @group
4322 Top
4323 |
4324 -------------------------------------
4325 | | |
4326 Chapter 1 Chapter 2 Chapter 3
4327 | | |
4328 -------- -------- --------
4329 | | | | | |
4330 Section Section Section Section Section Section
4331 1.1 1.2 2.1 2.2 3.1 3.2
4332
4333 @end group
4334 @end example
4335
4336 Write the beginning of the node for Chapter 2 like this:@refill
4337
4338 @example
4339 @group
4340 @@node Chapter 2, Chapter 3, Chapter 1, top
4341 @@comment node-name, next, previous, up
4342 @end group
4343 @end example
4344
4345 @noindent
4346 This @code{@@node} line says that the name of this node is ``Chapter 2'', the
4347 name of the `Next' node is ``Chapter 3'', the name of the `Previous'
4348 node is ``Chapter 1'', and the name of the `Up' node is ``Top''.
4349
4350 @quotation
4351 @strong{Please Note:} `Next' refers to the next node at the same
4352 hierarchical level in the manual, not necessarily to the next node
4353 within the Texinfo file. In the Texinfo file, the subsequent node may
4354 be at a lower level---a section-level node may follow a chapter-level
4355 node, and a subsection-level node may follow a section-level node.
4356 `Next' and `Previous' refer to nodes at the @emph{same} hierarchical
4357 level. (The `Top' node contains the exception to this rule. Since the
4358 `Top' node is the only node at that level, `Next' refers to the first
4359 following node, which is almost always a chapter or chapter-level
4360 node.)@refill
4361 @end quotation
4362
4363 To go to Sections 2.1 and 2.2 using Info, you need a menu inside Chapter
4364 2. (@xref{Menus}.) You would write the menu just
4365 before the beginning of Section 2.1, like this:@refill
4366
4367 @example
4368 @group
4369 @@menu
4370 * Sect. 2.1:: Description of this section.
4371 * Sect. 2.2::
4372 @@end menu
4373 @end group
4374 @end example
4375
4376 Write the node for Sect. 2.1 like this:@refill
4377
4378 @example
4379 @group
4380 @@node Sect. 2.1, Sect. 2.2, Chapter 2, Chapter 2
4381 @@comment node-name, next, previous, up
4382 @end group
4383 @end example
4384
4385 In Info format, the `Next' and `Previous' pointers of a node usually
4386 lead to other nodes at the same level---from chapter to chapter or from
4387 section to section (sometimes, as shown, the `Previous' pointer points
4388 up); an `Up' pointer usually leads to a node at the level above (closer
4389 to the `Top' node); and a `Menu' leads to nodes at a level below (closer
4390 to `leaves'). (A cross reference can point to a node at any level;
4391 see @ref{Cross References}.)@refill
4392
4393 Usually, an @code{@@node} command and a chapter structuring command are
4394 used in sequence, along with indexing commands. (You may follow the
4395 @code{@@node} line with a comment line that reminds you which pointer is
4396 which.)@refill
4397
4398 Here is the beginning of the chapter in this manual called ``Ending a
4399 Texinfo File''. This shows an @code{@@node} line followed by a comment
4400 line, an @code{@@chapter} line, and then by indexing lines.@refill
4401
4402 @example
4403 @group
4404 @@node Ending a File, Structuring, Beginning a File, Top
4405 @@comment node-name, next, previous, up
4406 @@chapter Ending a Texinfo File
4407 @@cindex Ending a Texinfo file
4408 @@cindex Texinfo file ending
4409 @@cindex File ending
4410 @end group
4411 @end example
4412
4413 @node node, makeinfo Pointer Creation, Node Menu Illustration, Nodes
4414 @comment node-name, next, previous, up
4415 @section The @code{@@node} Command
4416
4417 @cindex Node, defined
4418 A @dfn{node} is a segment of text that begins at an @code{@@node}
4419 command and continues until the next @code{@@node} command. The
4420 definition of node is different from that for chapter or section. A
4421 chapter may contain sections and a section may contain subsections;
4422 but a node cannot contain subnodes; the text of a node continues only
4423 until the next @code{@@node} command in the file. A node usually
4424 contains only one chapter structuring command, the one that follows
4425 the @code{@@node} line. On the other hand, in printed output nodes
4426 are used only for cross references, so a chapter or section may
4427 contain any number of nodes. Indeed, a chapter usually contains
4428 several nodes, one for each section, subsection, and
4429 subsubsection.@refill
4430
4431 To create a node, write an @code{@@node} command at the beginning of a
4432 line, and follow it with four arguments, separated by commas, on the
4433 rest of the same line. These arguments are the name of the node, and
4434 the names of the `Next', `Previous', and `Up' pointers, in that order.
4435 You may insert spaces before each pointer if you wish; the spaces are
4436 ignored. You must write the name of the node, and the names of the
4437 `Next', `Previous', and `Up' pointers, all on the same line. Otherwise,
4438 the formatters fail. (@inforef{Top, info, info}, for more information
4439 about nodes in Info.)@refill
4440
4441 Usually, you write one of the chapter-structuring command lines
4442 immediately after an @code{@@node} line---for example, an
4443 @code{@@section} or @code{@@subsection} line. (@xref{Structuring
4444 Command Types, , Types of Structuring Command}.)@refill
4445
4446 @quotation
4447 @strong{Please note:} The GNU Emacs Texinfo mode updating commands work
4448 only with Texinfo files in which @code{@@node} lines are followed by chapter
4449 structuring lines. @xref{Updating Requirements}.@refill
4450 @end quotation
4451
4452 @TeX{} uses @code{@@node} lines to identify the names to use for cross
4453 references. For this reason, you must write @code{@@node} lines in a
4454 Texinfo file that you intend to format for printing, even if you do not
4455 intend to format it for Info. (Cross references, such as the one at the
4456 end of this sentence, are made with @code{@@xref} and its related
4457 commands; see @ref{Cross References}.)@refill
4458
4459 @menu
4460 * Node Names:: How to choose node and pointer names.
4461 * Writing a Node:: How to write an @code{@@node} line.
4462 * Node Line Tips:: Keep names short.
4463 * Node Line Requirements:: Keep names unique, without @@-commands.
4464 * First Node:: How to write a `Top' node.
4465 * makeinfo top command:: How to use the @code{@@top} command.
4466 * Top Node Summary:: Write a brief description for readers.
4467 @end menu
4468
4469 @node Node Names, Writing a Node, node, node
4470 @ifinfo
4471 @subheading Choosing Node and Pointer Names
4472 @end ifinfo
4473
4474 The name of a node identifies the node. The pointers enable
4475 you to reach other nodes and consist of the names of those nodes.@refill
4476
4477 Normally, a node's `Up' pointer contains the name of the node whose menu
4478 mentions that node. The node's `Next' pointer contains the name of the
4479 node that follows that node in that menu and its `Previous' pointer
4480 contains the name of the node that precedes it in that menu. When a
4481 node's `Previous' node is the same as its `Up' node, both node pointers
4482 name the same node.@refill
4483
4484 Usually, the first node of a Texinfo file is the `Top' node, and its
4485 `Up' and `Previous' pointers point to the @file{dir} file, which
4486 contains the main menu for all of Info.@refill
4487
4488 The `Top' node itself contains the main or master menu for the manual.
4489 Also, it is helpful to include a brief description of the manual in the
4490 `Top' node. @xref{First Node}, for information on how to write the
4491 first node of a Texinfo file.@refill
4492
4493 @node Writing a Node, Node Line Tips, Node Names, node
4494 @comment node-name, next, previous, up
4495 @subsection How to Write an @code{@@node} Line
4496 @cindex Writing an @code{@@node} line
4497 @cindex @code{@@node} line writing
4498 @cindex Node line writing
4499
4500 The easiest way to write an @code{@@node} line is to write @code{@@node}
4501 at the beginning of a line and then the name of the node, like
4502 this:@refill
4503
4504 @example
4505 @@node @var{node-name}
4506 @end example
4507
4508 If you are using GNU Emacs, you can use the update node commands
4509 provided by Texinfo mode to insert the names of the pointers; or you
4510 can leave the pointers out of the Texinfo file and let @code{makeinfo}
4511 insert node pointers into the Info file it creates. (@xref{Texinfo
4512 Mode}, and @ref{makeinfo Pointer Creation}.)@refill
4513
4514 Alternatively, you can insert the `Next', `Previous', and `Up'
4515 pointers yourself. If you do this, you may find it helpful to use the
4516 Texinfo mode keyboard command @kbd{C-c C-c n}. This command inserts
4517 @samp{@@node} and a comment line listing the names of the pointers in
4518 their proper order. The comment line helps you keep track of which
4519 arguments are for which pointers. This comment line is especially useful
4520 if you are not familiar with Texinfo.@refill
4521
4522 The template for a node line with `Next', `Previous', and `Up' pointers
4523 looks like this:@refill
4524
4525 @example
4526 @@node @var{node-name}, @var{next}, @var{previous}, @var{up}
4527 @end example
4528
4529 If you wish, you can ignore @code{@@node} lines altogether in your first
4530 draft and then use the @code{texinfo-insert-node-lines} command to
4531 create @code{@@node} lines for you. However, we do not
4532 recommend this practice. It is better to name the node itself
4533 at the same time that you
4534 write a segment so you can easily make cross references. A large number
4535 of cross references are an especially important feature of a good Info
4536 file.@refill
4537
4538 After you have inserted an @code{@@node} line, you should immediately
4539 write an @@-command for the chapter or section and insert its name.
4540 Next (and this is important!), put in several index entries. Usually,
4541 you will find at least two and often as many as four or five ways of
4542 referring to the node in the index. Use them all. This will make it
4543 much easier for people to find the node.@refill
4544
4545 @node Node Line Tips, Node Line Requirements, Writing a Node, node
4546 @comment node-name, next, previous, up
4547 @subsection @code{@@node} Line Tips
4548
4549 Here are three suggestions:
4550
4551 @itemize @bullet
4552 @item
4553 Try to pick node names that are informative but short.@refill
4554
4555 In the Info file, the file name, node name, and pointer names are all
4556 inserted on one line, which may run into the right edge of the window.
4557 (This does not cause a problem with Info, but is ugly.)@refill
4558
4559 @item
4560 Try to pick node names that differ from each other near the beginnings
4561 of their names. This way, it is easy to use automatic name completion in
4562 Info.@refill
4563
4564 @item
4565 By convention, node names are capitalized just as they would be for
4566 section or chapter titles---initial and significant words are
4567 capitalized; others are not.@refill
4568 @end itemize
4569
4570 @node Node Line Requirements, First Node, Node Line Tips, node
4571 @comment node-name, next, previous, up
4572 @subsection @code{@@node} Line Requirements
4573
4574 @cindex Node line requirements
4575 Here are several requirements for @code{@@node} lines:
4576
4577 @itemize @bullet
4578 @cindex Unique nodename requirement
4579 @cindex Nodename must be unique
4580 @item
4581 All the node names for a single Info file must be unique.@refill
4582
4583 Duplicates confuse the Info movement commands. This means, for
4584 example, that if you end every chapter with a summary, you must name
4585 each summary node differently. You cannot just call each one
4586 ``Summary''. You may, however, duplicate the titles of chapters, sections,
4587 and the like. Thus you can end each chapter in a book with a section
4588 called ``Summary'', so long as the node names for those sections are all
4589 different.@refill
4590
4591 @item
4592 A pointer name must be the name of a node.@refill
4593
4594 The node to which a pointer points may come before or after the
4595 node containing the pointer.@refill
4596
4597 @cindex @@-command in nodename
4598 @cindex Nodename, cannot contain
4599 @item
4600 You cannot use any of the Texinfo @@-commands in a node name;
4601 @w{@@-commands} confuse Info.@refill
4602
4603 @need 750
4604 Thus, the beginning of the section called @code{@@chapter} looks like
4605 this:@refill
4606
4607 @smallexample
4608 @group
4609 @@node chapter, unnumbered & appendix, makeinfo top, Structuring
4610 @@comment node-name, next, previous, up
4611 @@section @@code@{@@@@chapter@}
4612 @@findex chapter
4613 @end group
4614 @end smallexample
4615
4616 @cindex Comma in nodename
4617 @cindex Colon in nodename
4618 @cindex Apostrophe in nodename
4619 @item
4620 You cannot use commas, colons, or apostrophes within a node name; these
4621 confuse @TeX{} or the Info formatters.@refill
4622
4623 @need 700
4624 For example, the following is a section title:
4625
4626 @smallexample
4627 @@code@{@@@@unnumberedsec@}, @@code@{@@@@appendixsec@}, @@code@{@@@@heading@}
4628 @end smallexample
4629
4630 @noindent
4631 The corresponding node name is:
4632
4633 @smallexample
4634 unnumberedsec appendixsec heading
4635 @end smallexample
4636
4637 @cindex Case in nodename
4638 @item
4639 Case is significant.
4640 @end itemize
4641
4642 @node First Node, makeinfo top command, Node Line Requirements, node
4643 @comment node-name, next, previous, up
4644 @subsection The First Node
4645 @cindex @samp{@r{Top}} node is first
4646 @cindex First node
4647
4648 The first node of a Texinfo file is the `Top' node, except in an
4649 included file (@pxref{Include Files}).
4650
4651 The `Top' node (which must be named @samp{top} or @samp{Top}) should
4652 have as its `Up' and `Previous' nodes the name of a node in another
4653 file, where there is a menu that leads to this file. Specify the file
4654 name in parentheses. If the file is to be installed directly in the
4655 Info directory file, use @samp{(dir)} as the parent of the `Top' node;
4656 this is short for @samp{(dir)top}, and specifies the `Top' node in the
4657 @file{dir} file, which contains the main menu for Info. For example,
4658 the @code{@@node Top} line of this manual looks like this:@refill
4659
4660 @example
4661 @@node Top, Overview, (dir), (dir)
4662 @end example
4663
4664 @noindent
4665 (You may use the Texinfo updating commands or the @code{makeinfo}
4666 utility to insert these `Next' and @samp{(dir)} pointers
4667 automatically.)@refill
4668
4669 @xref{Install an Info File}, for more information about installing
4670 an Info file in the @file{info} directory.@refill
4671
4672 The `Top' node contains the main or master menu for the document.
4673
4674 @node makeinfo top command, Top Node Summary, First Node, node
4675 @comment node-name, next, previous, up
4676 @subsection The @code{@@top} Sectioning Command
4677 @findex top @r{(@@-command)}
4678
4679 A special sectioning command, @code{@@top}, has been created for use
4680 with the @code{@@node Top} line. The @code{@@top} sectioning command tells
4681 @code{makeinfo} that it marks the `Top' node in the file. It provides
4682 the information that @code{makeinfo} needs to insert node
4683 pointers automatically. Write the @code{@@top} command at the
4684 beginning of the line immediately following the @code{@@node Top}
4685 line. Write the title on the remaining part of the same line as the
4686 @code{@@top} command.@refill
4687
4688 In Info, the @code{@@top} sectioning command causes the title to appear on a
4689 line by itself, with a line of asterisks inserted underneath.@refill
4690
4691 In @TeX{} and @code{texinfo-format-buffer}, the @code{@@top}
4692 sectioning command is merely a synonym for @code{@@unnumbered}.
4693 Neither of these formatters require an @code{@@top} command, and do
4694 nothing special with it. You can use @code{@@chapter} or
4695 @code{@@unnumbered} after the @code{@@node Top} line when you use
4696 these formatters. Also, you can use @code{@@chapter} or
4697 @code{@@unnumbered} when you use the Texinfo updating commands to
4698 create or update pointers and menus.@refill
4699
4700 @node Top Node Summary, , makeinfo top command, node
4701 @subsection The `Top' Node Summary
4702 @cindex @samp{@r{Top}} node summary
4703
4704 You can help readers by writing a summary in the `Top' node, after the
4705 @code{@@top} line, before the main or master menu. The summary should
4706 briefly describe the document. In Info, this summary will appear just
4707 before the master menu. In a printed manual, this summary will appear
4708 on a page of its own.@refill
4709
4710 If you do not want the summary to appear on a page of its own in a
4711 printed manual, you can enclose the whole of the `Top' node, including
4712 the @code{@@node Top} line and the @code{@@top} sectioning command line
4713 or other sectioning command line between @code{@@ifinfo} and @code{@@end
4714 ifinfo}. This prevents any of the text from appearing in the printed
4715 output. (@pxref{Conditionals, , Conditionally Visible Text}). You can
4716 repeat the brief description from the `Top' node within @code{@@iftex}
4717 @dots{} @code{@@end iftex} at the beginning of the first chapter, for
4718 those who read the printed manual. This saves paper and may look
4719 neater.@refill
4720
4721 You should write the version number of the program to which the manual
4722 applies in the summary. This helps the reader keep track of which
4723 manual is for which version of the program. If the manual changes more
4724 frequently than the program or is independent of it, you should also
4725 include an edition number for the manual. (The title page should also
4726 contain this information: see @ref{titlepage, ,
4727 @code{@@titlepage}}.)@refill
4728
4729 @node makeinfo Pointer Creation, , node, Nodes
4730 @section Creating Pointers with @code{makeinfo}
4731 @cindex Creating pointers with @code{makeinfo}
4732 @cindex Pointer creation with @code{makeinfo}
4733 @cindex Automatic pointer creation with @code{makeinfo}
4734
4735 The @code{makeinfo} program has a feature for automatically creating
4736 node pointers for a hierarchically organized file that lacks
4737 them.@refill
4738
4739 When you take advantage of this feature, you do not need to write the
4740 `Next', `Previous', and `Up' pointers after the name of a node.
4741 However, you must write a sectioning command, such as @code{@@chapter}
4742 or @code{@@section}, on the line immediately following each truncated
4743 @code{@@node} line. You cannot write a comment line after a node
4744 line; the section line must follow it immediately.@refill
4745
4746 In addition, you must follow the `Top' @code{@@node} line with a line beginning
4747 with @code{@@top} to mark the `Top' node in the file. @xref{makeinfo
4748 top, , @code{@@top}}.
4749
4750 Finally, you must write the name of each node (except for the `Top'
4751 node) in a menu that is one or more hierarchical levels above the
4752 node's hierarchical level.@refill
4753
4754 This node pointer insertion feature in @code{makeinfo} is an
4755 alternative to the menu and pointer creation and update commands in
4756 Texinfo mode. (@xref{Updating Nodes and Menus}.) It is especially
4757 helpful to people who do not use GNU Emacs for writing Texinfo
4758 documents.@refill
4759
4760 @node Menus, Cross References, Nodes, Top
4761 @comment node-name, next, previous, up
4762 @chapter Menus
4763 @cindex Menus
4764 @findex menu
4765
4766 @dfn{Menus} contain pointers to subordinate
4767 nodes.@footnote{Menus can carry you to any node, regardless
4768 of the hierarchical structure; even to nodes in a different
4769 Info file. However, the GNU Emacs Texinfo mode updating
4770 commands work only to create menus of subordinate nodes.
4771 Conventionally, cross references are used to refer to other
4772 nodes.} In Info, you use menus to go to such nodes. Menus
4773 have no effect in printed manuals and do not appear in
4774 them.@refill
4775
4776 By convention, a menu is put at the end of a node since a reader who
4777 uses the menu may not see text that follows it.@refill
4778
4779 @ifinfo
4780 A node that has a menu should @emph{not} contain much text. If you
4781 have a lot of text and a menu, move most of the text into a new
4782 subnode---all but a few lines.@refill
4783 @end ifinfo
4784 @iftex
4785 @emph{A node that has a menu should not contain much text.} If you
4786 have a lot of text and a menu, move most of the text into a new
4787 subnode---all but a few lines. Otherwise, a reader with a terminal
4788 that displays only a few lines may miss the menu and its associated
4789 text. As a practical matter, you should locate a menu within 20 lines
4790 of the beginning of the node.@refill
4791 @end iftex
4792
4793 @menu
4794 * Menu Location:: Put a menu in a short node.
4795 * Writing a Menu:: What is a menu?
4796 * Menu Parts:: A menu entry has three parts.
4797 * Less Cluttered Menu Entry:: Two part menu entry.
4798 * Menu Example:: Two and three part menu entries.
4799 * Other Info Files:: How to refer to a different Info file.
4800 @end menu
4801
4802 @node Menu Location, Writing a Menu, Menus, Menus
4803 @ifinfo
4804 @heading Menus Need Short Nodes
4805 @end ifinfo
4806 @cindex Menu location
4807 @cindex Location of menus
4808 @cindex Nodes for menus are short
4809 @cindex Short nodes for menus
4810
4811 @ifinfo
4812 A reader can easily see a menu that is close to the beginning of the
4813 node. The node should be short. As a practical matter, you should
4814 locate a menu within 20 lines of the beginning of the node.
4815 Otherwise, a reader with a terminal that displays only a few lines may
4816 miss the menu and its associated text.@refill
4817 @end ifinfo
4818
4819 The short text before a menu may look awkward in a printed manual. To
4820 avoid this, you can write a menu near the beginning of its node and
4821 follow the menu by an @code{@@node} line, and then an @code{@@heading}
4822 line located within @code{@@ifinfo} and @code{@@end ifinfo}. This way,
4823 the menu, @code{@@node} line, and title appear only in the Info file,
4824 not the printed document.@refill
4825
4826 For example, the preceding two paragraphs follow an Info-only menu,
4827 @code{@@node} line, and heading, and look like this:@refill
4828
4829 @example
4830 @group
4831 @@menu
4832 * Menu Location:: Put a menu in a short node.
4833 * Writing a Menu:: What is a menu?
4834 * Menu Parts:: A menu entry has three parts.
4835 * Less Cluttered Menu Entry:: Two part menu entry.
4836 * Menu Example:: Two and three part entries.
4837 * Other Info Files:: How to refer to a different
4838 Info file.
4839 @@end menu
4840
4841 @@node Menu Location, Writing a Menu, , Menus
4842 @@ifinfo
4843 @@heading Menus Need Short Nodes
4844 @@end ifinfo
4845 @end group
4846 @end example
4847
4848 The Texinfo file for this document contains more than a dozen
4849 examples of this procedure. One is at the beginning of this chapter;
4850 another is at the beginning of the ``Cross References'' chapter.@refill
4851
4852 @node Writing a Menu, Menu Parts, Menu Location, Menus
4853 @section Writing a Menu
4854 @cindex Writing a menu
4855 @cindex Menu writing
4856
4857 A menu consists of an @code{@@menu} command on a line by
4858 itself followed by menu entry lines or menu comment lines
4859 and then by an @code{@@end menu} command on a line by
4860 itself.@refill
4861
4862 A menu looks like this:@refill
4863
4864 @example
4865 @group
4866 @@menu
4867 Larger Units of Text
4868
4869 * Files:: All about handling files.
4870 * Multiples: Buffers. Multiple buffers; editing
4871 several files at once.
4872 @@end menu
4873 @end group
4874 @end example
4875
4876 In a menu, every line that begins with an @w{@samp{* }} is a
4877 @dfn{menu entry}. (Note the space after the asterisk.) A
4878 line that does not start with an @w{@samp{* }} may also
4879 appear in a menu. Such a line is not a menu entry but is a
4880 menu comment line that appears in the Info file. In
4881 the example above, the line @samp{Larger Units of Text} is a
4882 menu comment line; the two lines starting with @w{@samp{* }}
4883 are menu entries.
4884
4885 @node Menu Parts, Less Cluttered Menu Entry, Writing a Menu, Menus
4886 @section The Parts of a Menu
4887 @cindex Parts of a menu
4888 @cindex Menu parts
4889 @cindex @code{@@menu} parts
4890
4891 A menu entry has three parts, only the second of which is
4892 required:@refill
4893
4894 @enumerate
4895 @item
4896 The menu entry name.
4897
4898 @item
4899 The name of the node (required).
4900
4901 @item
4902 A description of the item.
4903 @end enumerate
4904
4905 The template for a menu entry looks like this:@refill
4906
4907 @example
4908 * @var{menu-entry-name}: @var{node-name}. @var{description}
4909 @end example
4910
4911 Follow the menu entry name with a single colon and follow the node name
4912 with tab, comma, period, or newline.@refill
4913
4914 In Info, a user selects a node with the @kbd{m} (@code{Info-menu})
4915 command. The menu entry name is what the user types after the @kbd{m}
4916 command.@refill
4917
4918 The third part of a menu entry is a descriptive phrase or
4919 sentence. Menu entry names and node names are often short; the
4920 description explains to the reader what the node is about. The
4921 description, which is optional, can spread over two or more lines. A
4922 useful description complements the node name rather than repeats
4923 it.@refill
4924
4925 @node Less Cluttered Menu Entry, Menu Example, Menu Parts, Menus
4926 @comment node-name, next, previous, up
4927 @section Less Cluttered Menu Entry
4928 @cindex Two part menu entry
4929 @cindex Double-colon menu entries
4930 @cindex Menu entries with two colons
4931 @cindex Less cluttered menu entry
4932 @cindex Uncluttered menu entry
4933
4934 When the menu entry name and node name are the same, you can write
4935 the name immediately after the asterisk and space at the beginning of
4936 the line and follow the name with two colons.@refill
4937
4938 @need 800
4939 For example, write
4940
4941 @example
4942 * Name:: @var{description}
4943 @end example
4944
4945 @need 800
4946 @noindent
4947 instead of
4948
4949 @example
4950 * Name: Name. @var{description}
4951 @end example
4952
4953 You should use the node name for the menu entry name whenever possible,
4954 since it reduces visual clutter in the menu.@refill
4955
4956 @node Menu Example, Other Info Files, Less Cluttered Menu Entry, Menus
4957 @comment node-name, next, previous, up
4958 @section A Menu Example
4959 @cindex Menu example
4960 @cindex Example menu
4961
4962 A menu looks like this in Texinfo:@refill
4963
4964 @example
4965 @group
4966 @@menu
4967 * menu entry name: Node name. A short description.
4968 * Node name:: This form is preferred.
4969 @@end menu
4970 @end group
4971 @end example
4972
4973 @need 800
4974 @noindent
4975 This produces:
4976
4977 @example
4978 @group
4979 * menu:
4980
4981 * menu entry name: Node name. A short description.
4982 * Node name:: This form is preferred.
4983 @end group
4984 @end example
4985
4986 @need 700
4987 Here is an example as you might see it in a Texinfo file:@refill
4988
4989 @example
4990 @group
4991 @@menu
4992 Larger Units of Text
4993
4994 * Files:: All about handling files.
4995 * Multiples: Buffers. Multiple buffers; editing
4996 several files at once.
4997 @@end menu
4998 @end group
4999 @end example
5000
5001 @need 800
5002 @noindent
5003 This produces:
5004
5005 @example
5006 @group
5007 * menu:
5008 Larger Units of Text
5009
5010 * Files:: All about handling files.
5011 * Multiples: Buffers. Multiple buffers; editing
5012 several files at once.
5013 @end group
5014 @end example
5015
5016 In this example, the menu has two entries. @samp{Files} is both a menu
5017 entry name and the name of the node referred to by that name.
5018 @samp{Multiples} is the menu entry name; it refers to the node named
5019 @samp{Buffers}. The line @samp{Larger Units of Text} is a comment; it
5020 appears in the menu, but is not an entry.@refill
5021
5022 Since no file name is specified with either @samp{Files} or
5023 @samp{Buffers}, they must be the names of nodes in the same Info file
5024 (@pxref{Other Info Files, , Referring to Other Info Files}).@refill
5025
5026 @node Other Info Files, , Menu Example, Menus
5027 @comment node-name, next, previous, up
5028 @section Referring to Other Info Files
5029 @cindex Referring to other Info files
5030 @cindex Nodes in other Info files
5031 @cindex Other Info files' nodes
5032 @cindex Going to other Info files' nodes
5033 @cindex Info; other files' nodes
5034
5035 You can create a menu entry that enables a reader in Info to go to a
5036 node in another Info file by writing the file name in parentheses just
5037 before the node name. In this case, you should use the three-part menu
5038 entry format, which saves the reader from having to type the file
5039 name.@refill
5040
5041 @need 800
5042 The format looks like this:@refill
5043
5044 @example
5045 @group
5046 @@menu
5047 * @var{first-entry-name}:(@var{filename})@var{nodename}. @var{description}
5048 * @var{second-entry-name}:(@var{filename})@var{second-node}. @var{description}
5049 @@end menu
5050 @end group
5051 @end example
5052
5053 For example, to refer directly to the @samp{Outlining} and
5054 @samp{Rebinding} nodes in the @cite{Emacs Manual}, you would write a
5055 menu like this:@refill
5056
5057 @example
5058 @group
5059 @@menu
5060 * Outlining: (emacs)Outline Mode. The major mode for
5061 editing outlines.
5062 * Rebinding: (emacs)Rebinding. How to redefine the
5063 meaning of a key.
5064 @@end menu
5065 @end group
5066 @end example
5067
5068 If you do not list the node name, but only name the file, then Info
5069 presumes that you are referring to the `Top' node.@refill
5070
5071 The @file{dir} file that contains the main menu for Info has menu
5072 entries that list only file names. These take you directly to the `Top'
5073 nodes of each Info document. (@xref{Install an Info File}.)@refill
5074
5075 @need 700
5076 For example:
5077
5078 @example
5079 @group
5080 * Info: (info). Documentation browsing system.
5081 * Emacs: (emacs). The extensible, self-documenting
5082 text editor.
5083 @end group
5084 @end example
5085
5086 @noindent
5087 (The @file{dir} top level directory for the Info system is an Info file,
5088 not a Texinfo file, but a menu entry looks the same in both types of
5089 file.)@refill
5090
5091 Note that the GNU Emacs Texinfo mode menu updating commands only work
5092 with nodes within the current buffer, so you cannot use them to create
5093 menus that refer to other files. You must write such menus by hand.@refill
5094
5095 @node Cross References, Marking Text, Menus, Top
5096 @comment node-name, next, previous, up
5097 @chapter Cross References
5098 @cindex Making cross references
5099 @cindex Cross references
5100 @cindex References
5101
5102 @dfn{Cross references} are used to refer the reader to other parts of the
5103 same or different Texinfo files. In Texinfo, nodes are the
5104 places to which cross references can refer.@refill
5105
5106 @menu
5107 * References:: What cross references are for.
5108 * Cross Reference Commands:: A summary of the different commands.
5109 * Cross Reference Parts:: A cross reference has several parts.
5110 * xref:: Begin a reference with `See' @dots{}
5111 * Top Node Naming:: How to refer to the beginning of another file.
5112 * ref:: A reference for the last part of a sentence.
5113 * pxref:: How to write a parenthetical cross reference.
5114 * inforef:: How to refer to an Info-only file.
5115 @end menu
5116
5117 @node References, Cross Reference Commands, Cross References, Cross References
5118 @ifinfo
5119 @heading What References Are For
5120 @end ifinfo
5121
5122 Often, but not always, a printed document should be designed so that
5123 it can be read sequentially. People tire of flipping back and forth
5124 to find information that should be presented to them as they need
5125 it.@refill
5126
5127 However, in any document, some information will be too detailed for
5128 the current context, or incidental to it; use cross references to
5129 provide access to such information. Also, an on-line help system or a
5130 reference manual is not like a novel; few read such documents in
5131 sequence from beginning to end. Instead, people look up what they
5132 need. For this reason, such creations should contain many cross
5133 references to help readers find other information that they may not
5134 have read.@refill
5135
5136 In a printed manual, a cross reference results in a page reference,
5137 unless it is to another manual altogether, in which case the cross
5138 reference names that manual.@refill
5139
5140 In Info, a cross reference results in an entry that you can follow using
5141 the Info @samp{f} command. (@inforef{Help-Adv, Some advanced Info
5142 commands, info}.)@refill
5143
5144 The various cross reference commands use nodes to define cross
5145 reference locations. This is evident in Info, in which a cross
5146 reference takes you to the specified node. @TeX{} also uses nodes to
5147 define cross reference locations, but the action is less obvious. When
5148 @TeX{} generates a @sc{dvi} file, it records nodes' page numbers and
5149 uses the page numbers in making references. Thus, if you are writing
5150 a manual that will only be printed, and will not be used on-line, you
5151 must nonetheless write @code{@@node} lines to name the places to which
5152 you make cross references.@refill
5153
5154 @need 800
5155 @node Cross Reference Commands, Cross Reference Parts, References, Cross References
5156 @comment node-name, next, previous, up
5157 @section Different Cross Reference Commands
5158 @cindex Different cross reference commands
5159
5160 There are four different cross reference commands:@refill
5161
5162 @table @code
5163 @item @@xref
5164 Used to start a sentence in the printed manual saying @w{`See @dots{}'}
5165 or an Info cross-reference saying @samp{*Note @var{name}: @var{node}.}.
5166
5167 @item @@ref
5168 Used within or, more often, at the end of a sentence; same as
5169 @code{@@xref} for Info; produces just the reference in the printed
5170 manual without a preceding `See'.@refill
5171
5172 @item @@pxref
5173 Used within parentheses to make a reference that suits both an Info
5174 file and a printed book. Starts with a lower case `see' within the
5175 printed manual. (@samp{p} is for `parenthesis'.)@refill
5176
5177 @item @@inforef
5178 Used to make a reference to an Info file for which there is no printed
5179 manual.@refill
5180 @end table
5181
5182 @noindent
5183 (The @code{@@cite} command is used to make references to books and
5184 manuals for which there is no corresponding Info file and, therefore,
5185 no node to which to point. @xref{cite, , @code{@@cite}}.)@refill
5186
5187 @node Cross Reference Parts, xref, Cross Reference Commands, Cross References
5188 @comment node-name, next, previous, up
5189 @section Parts of a Cross Reference
5190 @cindex Cross reference parts
5191 @cindex Parts of a cross reference
5192
5193 A cross reference command requires only one argument, which is the
5194 name of the node to which it refers. But a cross reference command
5195 may contain up to four additional arguments. By using these
5196 arguments, you can provide a cross reference name for Info, a topic
5197 description or section title for the printed output, the name of a
5198 different Info file, and the name of a different printed
5199 manual.@refill
5200
5201 Here is a simple cross reference example:@refill
5202
5203 @example
5204 @@xref@{Node name@}.
5205 @end example
5206
5207 @noindent
5208 which produces
5209
5210 @example
5211 *Note Node name::.
5212 @end example
5213
5214 @noindent
5215 and
5216
5217 @quotation
5218 See Section @var{nnn} [Node name], page @var{ppp}.
5219 @end quotation
5220
5221 @need 700
5222 Here is an example of a full five-part cross reference:@refill
5223
5224 @example
5225 @group
5226 @@xref@{Node name, Cross Reference Name, Particular Topic,
5227 info-file-name, A Printed Manual@}, for details.
5228 @end group
5229 @end example
5230
5231 @noindent
5232 which produces
5233
5234 @example
5235 *Note Cross Reference Name: (info-file-name)Node name,
5236 for details.
5237 @end example
5238
5239 @noindent
5240 in Info and
5241
5242 @quotation
5243 See section ``Particular Topic'' in @i{A Printed Manual}, for details.
5244 @end quotation
5245
5246 @noindent
5247 in a printed book.
5248
5249 The five possible arguments for a cross reference are:@refill
5250
5251 @enumerate
5252 @item
5253 The node name (required). This is the node to which the
5254 cross reference takes you. In a printed document, the location of the
5255 node provides the page reference only for references within the same
5256 document.@refill
5257
5258 @item
5259 The cross reference name for the Info reference, if it is to be different
5260 from the node name. If you include this argument, it argument becomes
5261 the first part of the cross reference. It is usually omitted.@refill
5262
5263 @item
5264 A topic description or section name. Often, this is the title of the
5265 section. This is used as the name of the reference in the printed
5266 manual. If omitted, the node name is used.@refill
5267
5268 @item
5269 The name of the Info file in which the reference is located, if it is
5270 different from the current file.@refill
5271
5272 @item
5273 The name of a printed manual from a different Texinfo file.@refill
5274 @end enumerate
5275
5276 The template for a full five argument cross reference looks like
5277 this:@refill
5278
5279 @example
5280 @group
5281 @@xref@{@var{node-name}, @var{cross-reference-name}, @var{title-or-topic},
5282 @var{info-file-name}, @var{printed-manual-title}@}.
5283 @end group
5284 @end example
5285
5286 Cross references with one, two, three, four, and five arguments are
5287 described separately following the description of @code{@@xref}.@refill
5288
5289 Write a node name in a cross reference in exactly the same way as in
5290 the @code{@@node} line, including the same capitalization; otherwise, the
5291 formatters may not find the reference.@refill
5292
5293 You can write cross reference commands within a paragraph, but note
5294 how Info and @TeX{} format the output of each of the various commands:
5295 write @code{@@xref} at the beginning of a sentence; write
5296 @code{@@pxref} only within parentheses, and so on.@refill
5297
5298 @node xref, Top Node Naming, Cross Reference Parts, Cross References
5299 @comment node-name, next, previous, up
5300 @section @code{@@xref}
5301 @findex xref
5302 @cindex Cross references using @code{@@xref}
5303 @cindex References using @code{@@xref}
5304
5305 The @code{@@xref} command generates a cross reference for the
5306 beginning of a sentence. The Info formatting commands convert it into
5307 an Info cross reference, which the Info @samp{f} command can use to
5308 bring you directly to another node. The @TeX{} typesetting commands
5309 convert it into a page reference, or a reference to another book or
5310 manual.@refill
5311
5312 @menu
5313 * Reference Syntax:: What a reference looks like and requires.
5314 * One Argument:: @code{@@xref} with one argument.
5315 * Two Arguments:: @code{@@xref} with two arguments.
5316 * Three Arguments:: @code{@@xref} with three arguments.
5317 * Four and Five Arguments:: @code{@@xref} with four and five arguments.
5318 @end menu
5319
5320 @node Reference Syntax, One Argument, xref, xref
5321 @ifinfo
5322 @subheading What a Reference Looks Like and Requires
5323 @end ifinfo
5324
5325 Most often, an Info cross reference looks like this:@refill
5326
5327 @example
5328 *Note @var{node-name}::.
5329 @end example
5330
5331 @noindent
5332 or like this
5333
5334 @example
5335 *Note @var{cross-reference-name}: @var{node-name}.
5336 @end example
5337
5338 @noindent
5339 In @TeX{}, a cross reference looks like this:
5340
5341 @example
5342 See Section @var{section-number} [@var{node-name}], page @var{page}.
5343 @end example
5344
5345 @noindent
5346 or like this
5347
5348 @example
5349 See Section @var{section-number} [@var{title-or-topic}], page @var{page}.
5350 @end example
5351
5352 The @code{@@xref} command does not generate a period or comma to end
5353 the cross reference in either the Info file or the printed output.
5354 You must write that period or comma yourself; otherwise, Info will not
5355 recognize the end of the reference. (The @code{@@pxref} command works
5356 differently. @xref{pxref, , @code{@@pxref}}.)@refill
5357
5358 @quotation
5359 @strong{Please note:} A period or comma @strong{must} follow the closing
5360 brace of an @code{@@xref}. It is required to terminate the cross
5361 reference. This period or comma will appear in the output, both in
5362 the Info file and in the printed manual.@refill
5363 @end quotation
5364
5365 @code{@@xref} must refer to an Info node by name. Use @code{@@node}
5366 to define the node (@pxref{Writing a Node}).@refill
5367
5368 @code{@@xref} is followed by several arguments inside braces, separated by
5369 commas. Whitespace before and after these commas is ignored.@refill
5370
5371 A cross reference requires only the name of a node; but it may contain
5372 up to four additional arguments. Each of these variations produces a
5373 cross reference that looks somewhat different.@refill
5374
5375 @quotation
5376 @strong{Please note:} Commas separate arguments in a cross reference;
5377 avoid including them in the title or other part lest the formatters
5378 mistake them for separators.@refill
5379 @end quotation
5380
5381 @node One Argument, Two Arguments, Reference Syntax, xref
5382 @subsection @code{@@xref} with One Argument
5383
5384 The simplest form of @code{@@xref} takes one argument, the name of
5385 another node in the same Info file. The Info formatters produce
5386 output that the Info readers can use to jump to the reference; @TeX{}
5387 produces output that specifies the page and section number for you.@refill
5388
5389 @need 700
5390 @noindent
5391 For example,
5392
5393 @example
5394 @@xref@{Tropical Storms@}.
5395 @end example
5396
5397 @noindent
5398 produces
5399
5400 @example
5401 *Note Tropical Storms::.
5402 @end example
5403
5404 @noindent
5405 and
5406
5407 @quotation
5408 See Section 3.1 [Tropical Storms], page 24.
5409 @end quotation
5410
5411 @noindent
5412 (Note that in the preceding example the closing brace is followed by a
5413 period.)@refill
5414
5415 You can write a clause after the cross reference, like this:@refill
5416
5417 @example
5418 @@xref@{Tropical Storms@}, for more info.
5419 @end example
5420
5421 @noindent
5422 which produces
5423
5424 @example
5425 *Note Tropical Storms::, for more info.
5426 @end example
5427
5428 @quotation
5429 See Section 3.1 [Tropical Storms], page 24, for more info.
5430 @end quotation
5431
5432 @noindent
5433 (Note that in the preceding example the closing brace is followed by a
5434 comma, and then by the clause, which is followed by a period.)@refill
5435
5436 @node Two Arguments, Three Arguments, One Argument, xref
5437 @subsection @code{@@xref} with Two Arguments
5438
5439 With two arguments, the second is used as the name of the Info cross
5440 reference, while the first is still the name of the node to which the
5441 cross reference points.@refill
5442
5443 @need 750
5444 @noindent
5445 The template is like this:
5446
5447 @example
5448 @@xref@{@var{node-name}, @var{cross-reference-name}@}.
5449 @end example
5450
5451 @need 700
5452 @noindent
5453 For example,
5454
5455 @example
5456 @@xref@{Electrical Effects, Lightning@}.
5457 @end example
5458
5459 @noindent
5460 produces:
5461
5462 @example
5463 *Note Lightning: Electrical Effects.
5464 @end example
5465
5466 @noindent
5467 and
5468
5469 @quotation
5470 See Section 5.2 [Electrical Effects], page 57.
5471 @end quotation
5472
5473 @noindent
5474 (Note that in the preceding example the closing brace is followed by a
5475 period; and that the node name is printed, not the cross reference name.)@refill
5476
5477 You can write a clause after the cross reference, like this:@refill
5478
5479 @example
5480 @@xref@{Electrical Effects, Lightning@}, for more info.
5481 @end example
5482
5483 @noindent
5484 which produces
5485 @example
5486 *Note Lightning: Electrical Effects, for more info.
5487 @end example
5488
5489 @noindent
5490 and
5491
5492 @quotation
5493 See Section 5.2 [Electrical Effects], page 57, for more info.
5494 @end quotation
5495
5496 @noindent
5497 (Note that in the preceding example the closing brace is followed by a
5498 comma, and then by the clause, which is followed by a period.)@refill
5499
5500 @node Three Arguments, Four and Five Arguments, Two Arguments, xref
5501 @subsection @code{@@xref} with Three Arguments
5502
5503 A third argument replaces the node name in the @TeX{} output. The third
5504 argument should be the name of the section in the printed output, or
5505 else state the topic discussed by that section. Often, you will want to
5506 use initial upper case letters so it will be easier to read when the
5507 reference is printed. Use a third argument when the node name is
5508 unsuitable because of syntax or meaning.@refill
5509
5510 Remember to avoid placing a comma within the title or topic section of
5511 a cross reference, or within any other section. The formatters divide
5512 cross references into arguments according to the commas; a comma
5513 within a title or other section will divide it into two arguments. In
5514 a reference, you need to write a title such as ``Clouds, Mist, and
5515 Fog'' without the commas.@refill
5516
5517 Also, remember to write a comma or period after the closing brace of a
5518 @code{@@xref} to terminate the cross reference. In the following
5519 examples, a clause follows a terminating comma.@refill
5520
5521
5522 @need 750
5523 @noindent
5524 The template is like this:
5525
5526 @example
5527 @group
5528 @@xref@{@var{node-name}, @var{cross-reference-name}, @var{title-or-topic}@}.
5529 @end group
5530 @end example
5531
5532 @need 700
5533 @noindent
5534 For example,
5535
5536 @example
5537 @group
5538 @@xref@{Electrical Effects, Lightning, Thunder and Lightning@},
5539 for details.
5540 @end group
5541 @end example
5542
5543 @noindent
5544 produces
5545
5546 @example
5547 *Note Lightning: Electrical Effects, for details.
5548 @end example
5549
5550 @noindent
5551 and
5552
5553 @quotation
5554 See Section 5.2 [Thunder and Lightning], page 57, for details.
5555 @end quotation
5556
5557 If a third argument is given and the second one is empty, then the
5558 third argument serves both. (Note how two commas, side by side, mark
5559 the empty second argument.)@refill
5560
5561 @example
5562 @group
5563 @@xref@{Electrical Effects, , Thunder and Lightning@},
5564 for details.
5565 @end group
5566 @end example
5567
5568 @noindent
5569 produces
5570
5571 @example
5572 *Note Thunder and Lightning: Electrical Effects, for details.
5573 @end example
5574
5575 @noindent
5576 and
5577
5578 @quotation
5579 See Section 5.2 [Thunder and Lightning], page 57, for details.
5580 @end quotation
5581
5582 As a practical matter, it is often best to write cross references with
5583 just the first argument if the node name and the section title are the
5584 same, and with the first and third arguments if the node name and title
5585 are different.@refill
5586
5587 Here are several examples from @cite{The GAWK Manual}:@refill
5588
5589 @smallexample
5590 @@xref@{Sample Program@}.
5591 @@xref@{Glossary@}.
5592 @@xref@{Case-sensitivity, ,Case-sensitivity in Matching@}.
5593 @@xref@{Close Output, , Closing Output Files and Pipes@},
5594 for more information.
5595 @@xref@{Regexp, , Regular Expressions as Patterns@}.
5596 @end smallexample
5597
5598 @node Four and Five Arguments, , Three Arguments, xref
5599 @subsection @code{@@xref} with Four and Five Arguments
5600
5601 In a cross reference, a fourth argument specifies the name of another
5602 Info file, different from the file in which the reference appears, and
5603 a fifth argument specifies its title as a printed manual.@refill
5604
5605 Remember that a comma or period must follow the closing brace of an
5606 @code{@@xref} command to terminate the cross reference. In the
5607 following examples, a clause follows a terminating comma.@refill
5608
5609 @need 800
5610 @noindent
5611 The template is:
5612
5613 @example
5614 @group
5615 @@xref@{@var{node-name}, @var{cross-reference-name}, @var{title-or-topic},
5616 @var{info-file-name}, @var{printed-manual-title}@}.
5617 @end group
5618 @end example
5619
5620 @need 700
5621 @noindent
5622 For example,
5623
5624 @example
5625 @@xref@{Electrical Effects, Lightning, Thunder and Lightning,
5626 weather, An Introduction to Meteorology@}, for details.
5627 @end example
5628
5629 @noindent
5630 produces
5631
5632 @example
5633 *Note Lightning: (weather)Electrical Effects, for details.
5634 @end example
5635
5636 @noindent
5637 The name of the Info file is enclosed in parentheses and precedes
5638 the name of the node.
5639
5640 @noindent
5641 In a printed manual, the reference looks like this:@refill
5642
5643 @quotation
5644 See section ``Thunder and Lightning'' in @i{An Introduction to
5645 Meteorology}, for details.
5646 @end quotation
5647
5648 @noindent
5649 The title of the printed manual is typeset in italics; and the
5650 reference lacks a page number since @TeX{} cannot know to which page a
5651 reference refers when that reference is to another manual.@refill
5652
5653 Often, you will leave out the second argument when you use the long
5654 version of @code{@@xref}. In this case, the third argument, the topic
5655 description, will be used as the cross reference name in Info.@refill
5656
5657 @noindent
5658 The template looks like this:
5659
5660 @example
5661 @@xref@{@var{node-name}, , @var{title-or-topic}, @var{info-file-name},
5662 @var{printed-manual-title}@}, for details.
5663 @end example
5664
5665 @noindent
5666 which produces
5667
5668 @example
5669 *Note @var{title-or-topic}: (@var{info-file-name})@var{node-name}, for details.
5670 @end example
5671
5672 @noindent
5673 and
5674
5675 @quotation
5676 See section @var{title-or-topic} in @var{printed-manual-title}, for details.
5677 @end quotation
5678
5679 @need 700
5680 @noindent
5681 For example,
5682
5683 @example
5684 @@xref@{Electrical Effects, , Thunder and Lightning,
5685 weather, An Introduction to Meteorology@}, for details.
5686 @end example
5687
5688 @noindent
5689 produces
5690
5691 @example
5692 @group
5693 *Note Thunder and Lightning: (weather)Electrical Effects,
5694 for details.
5695 @end group
5696 @end example
5697
5698 @noindent
5699 and
5700
5701 @quotation
5702 See section ``Thunder and Lightning'' in @i{An Introduction to
5703 Meteorology}, for details.
5704 @end quotation
5705
5706 On rare occasions, you may want to refer to another Info file that
5707 is within a single printed manual---when multiple Texinfo files are
5708 incorporated into the same @TeX{} run but make separate Info files.
5709 In this case, you need to specify only the fourth argument, and not
5710 the fifth.@refill
5711
5712 @node Top Node Naming, ref, xref, Cross References
5713 @section Naming a `Top' Node
5714 @cindex Naming a `Top' Node in references
5715 @cindex @samp{@r{Top}} node naming for references
5716
5717 In a cross reference, you must always name a node. This means that in
5718 order to refer to a whole manual, you must identify the `Top' node by
5719 writing it as the first argument to the @code{@@xref} command. (This
5720 is different from the way you write a menu entry; see @ref{Other Info
5721 Files, , Referring to Other Info Files}.) At the same time, to
5722 provide a meaningful section topic or title in the printed cross
5723 reference (instead of the word `Top'), you must write an appropriate
5724 entry for the third argument to the @code{@@xref} command.
5725 @refill
5726
5727 @noindent
5728 Thus, to make a cross reference to @cite{The GNU Make Manual},
5729 write:@refill
5730
5731 @example
5732 @@xref@{Top, , Overview, make, The GNU Make Manual@}.
5733 @end example
5734
5735 @noindent
5736 which produces
5737
5738 @example
5739 *Note Overview: (make)Top.
5740 @end example
5741
5742 @noindent
5743 and
5744
5745 @quotation
5746 See section ``Overview'' in @i{The GNU Make Manual}.
5747 @end quotation
5748
5749 @noindent
5750 In this example, @samp{Top} is the name of the first node, and
5751 @samp{Overview} is the name of the first section of the manual.@refill
5752 @node ref, pxref, Top Node Naming, Cross References
5753 @comment node-name, next, previous, up
5754 @section @code{@@ref}
5755 @cindex Cross references using @code{@@ref}
5756 @cindex References using @code{@@ref}
5757 @findex ref
5758
5759 @code{@@ref} is nearly the same as @code{@@xref} except that it does
5760 not generate a `See' in the printed output, just the reference itself.
5761 This makes it useful as the last part of a sentence.@refill
5762
5763 @need 700
5764 @noindent
5765 For example,
5766
5767 @example
5768 For more information, see @@ref@{Hurricanes@}.
5769 @end example
5770
5771 @noindent
5772 produces
5773
5774 @example
5775 For more information, see *Note Hurricanes.
5776 @end example
5777
5778 @noindent
5779 and
5780
5781 @quotation
5782 For more information, see Section 8.2 [Hurricanes], page 123.
5783 @end quotation
5784
5785 The @code{@@ref} command sometimes leads writers to express themselves
5786 in a manner that is suitable for a printed manual but looks awkward
5787 in the Info format. Bear in mind that your audience will be using
5788 both the printed and the Info format.@refill
5789
5790 @need 800
5791 @noindent
5792 For example,
5793
5794 @example
5795 @group
5796 Sea surges are described in @@ref@{Hurricanes@}.
5797 @end group
5798 @end example
5799
5800 @need 800
5801 @noindent
5802 produces
5803
5804 @quotation
5805 Sea surges are described in Section 6.7 [Hurricanes], page 72.
5806 @end quotation
5807
5808 @need 800
5809 @noindent
5810 in a printed document, and the following in Info:
5811
5812 @example
5813 Sea surges are described in *Note Hurricanes::.
5814 @end example
5815
5816 @quotation
5817 @strong{Caution:} You @emph{must} write a period or comma immediately
5818 after an @code{@@ref} command with two or more arguments. Otherwise,
5819 Info will not find the end of the cross reference entry and its
5820 attempt to follow the cross reference will fail. As a general rule,
5821 you should write a period or comma after every @code{@@ref} command.
5822 This looks best in both the printed and the Info output.@refill
5823 @end quotation
5824
5825 @node pxref, inforef, ref, Cross References
5826 @comment node-name, next, previous, up
5827 @section @code{@@pxref}
5828 @cindex Cross references using @code{@@pxref}
5829 @cindex References using @code{@@pxref}
5830 @findex pxref
5831
5832 The parenthetical reference command, @code{@@pxref}, is nearly the
5833 same as @code{@@xref}, but you use it @emph{only} inside parentheses
5834 and you do @emph{not} type a comma or period after the command's
5835 closing brace. The command differs from @code{@@xref} in two
5836 ways:@refill
5837
5838 @enumerate
5839 @item
5840 @TeX{} typesets the reference for the printed manual with a lower case
5841 `see' rather than an upper case `See'.@refill
5842
5843 @item
5844 The Info formatting commands automatically end the reference with a
5845 closing colon or period.@refill
5846 @end enumerate
5847
5848 Because one type of formatting automatically inserts closing
5849 punctuation and the other does not, you should use @code{@@pxref}
5850 @emph{only} inside parentheses as part of another sentence. Also, you
5851 yourself should not insert punctuation after the reference, as you do
5852 with @code{@@xref}.@refill
5853
5854 @code{@@pxref} is designed so that the output looks right and works
5855 right between parentheses both in printed output and in an Info file.
5856 In a printed manual, a closing comma or period should not follow a
5857 cross reference within parentheses; such punctuation is wrong. But in
5858 an Info file, suitable closing punctuation must follow the cross
5859 reference so Info can recognize its end. @code{@@pxref} spares you
5860 the need to use complicated methods to put a terminator into one form
5861 of the output and not the other.@refill
5862
5863 @noindent
5864 With one argument, a parenthetical cross reference looks like
5865 this:@refill
5866
5867 @example
5868 @dots{} storms cause flooding (@@pxref@{Hurricanes@}) @dots{}
5869 @end example
5870
5871 @need 800
5872 @noindent
5873 which produces
5874
5875 @example
5876 @group
5877 @dots{} storms cause flooding (*Note Hurricanes::) @dots{}
5878 @end group
5879 @end example
5880
5881 @noindent
5882 and
5883
5884 @quotation
5885 @dots{} storms cause flooding (see Section 6.7 [Hurricanes], page 72) @dots{}
5886 @end quotation
5887
5888 With two arguments, a parenthetical cross reference has this
5889 template:@refill
5890
5891 @example
5892 @dots{} (@@pxref@{@var{node-name}, @var{cross-reference-name}@}) @dots{}
5893 @end example
5894
5895 @noindent
5896 which produces
5897
5898 @example
5899 @dots{} (*Note @var{cross-reference-name}: @var{node-name}.) @dots{}
5900 @end example
5901
5902 @noindent
5903 and
5904
5905 @need 1500
5906 @quotation
5907 @dots{} (see Section @var{nnn} [@var{node-name}], page @var{ppp}) @dots{}
5908 @end quotation
5909
5910 @code{@@pxref} can be used with up to five arguments just like
5911 @code{@@xref} (@pxref{xref, , @code{@@xref}}).@refill
5912
5913 @quotation
5914 @strong{Please note:} Use @code{@@pxref} only as a parenthetical
5915 reference. Do not try to use @code{@@pxref} as a clause in a sentence.
5916 It will look bad in either the Info file, the printed output, or
5917 both.@refill
5918
5919 Also, parenthetical cross references look best at the ends of sentences.
5920 Although you may write them in the middle of a sentence, that location
5921 breaks up the flow of text.@refill
5922 @end quotation
5923
5924 @node inforef, , pxref, Cross References
5925 @comment node-name, next, previous, up
5926 @section @code{@@inforef}
5927 @cindex Cross references using @code{@@inforef}
5928 @cindex References using @code{@@inforef}
5929 @findex inforef
5930
5931 @code{@@inforef} is used for cross references to Info files for which
5932 there are no printed manuals. Even in a printed manual,
5933 @code{@@inforef} generates a reference directing the user to look in
5934 an Info file.@refill
5935
5936 The command takes either two or three arguments, in the following
5937 order:@refill
5938
5939 @enumerate
5940 @item
5941 The node name.
5942
5943 @item
5944 The cross reference name (optional).
5945
5946 @item
5947 The Info file name.
5948 @end enumerate
5949
5950 @noindent
5951 Separate the arguments with commas, as with @code{@@xref}. Also, you
5952 must terminate the reference with a comma or period after the
5953 @samp{@}}, as you do with @code{@@xref}.@refill
5954
5955 @noindent
5956 The template is:
5957
5958 @example
5959 @@inforef@{@var{node-name}, @var{cross-reference-name}, @var{info-file-name}@},
5960 @end example
5961
5962 @need 800
5963 @noindent
5964 Thus,
5965
5966 @example
5967 @group
5968 @@inforef@{Expert, Advanced Info commands, info@},
5969 for more information.
5970 @end group
5971 @end example
5972
5973 @need 800
5974 @noindent
5975 produces
5976
5977 @example
5978 @group
5979 *Note Advanced Info commands: (info)Expert,
5980 for more information.
5981 @end group
5982 @end example
5983
5984 @need 800
5985 @noindent
5986 and
5987
5988 @quotation
5989 See Info file @file{info}, node @samp{Expert}, for more information.
5990 @end quotation
5991
5992 @need 800
5993 @noindent
5994 Similarly,
5995
5996 @example
5997 @group
5998 @@inforef@{Expert, , info@}, for more information.
5999 @end group
6000 @end example
6001
6002 @need 800
6003 @noindent
6004 produces
6005
6006 @example
6007 *Note (info)Expert::, for more information.
6008 @end example
6009
6010 @need 800
6011 @noindent
6012 and
6013
6014 @quotation
6015 See Info file @file{info}, node @samp{Expert}, for more information.
6016 @end quotation
6017
6018 The converse of @code{@@inforef} is @code{@@cite}, which is used to
6019 refer to printed works for which no Info form exists. @xref{cite, ,
6020 @code{@@cite}}.@refill
6021
6022 @node Marking Text, Quotations and Examples, Cross References, Top
6023 @comment node-name, next, previous, up
6024 @chapter Marking Words and Phrases
6025 @cindex Paragraph, marking text within
6026 @cindex Marking words and phrases
6027 @cindex Words and phrases, marking them
6028 @cindex Marking text within a paragraph
6029
6030 In Texinfo, you can mark words and phrases in a variety of ways.
6031 The Texinfo formatters use this information to determine how to
6032 highlight the text.
6033 You can specify, for example, whether a word or phrase is a
6034 defining occurrence, a metasyntactic variable, or a symbol used in a
6035 program. Also, you can emphasize text.@refill
6036
6037 @menu
6038 * Indicating:: How to indicate definitions, files, etc.
6039 * Emphasis:: How to emphasize text.
6040 @end menu
6041
6042 @node Indicating, Emphasis, Marking Text, Marking Text
6043 @comment node-name, next, previous, up
6044 @section Indicating Definitions, Commands, etc.
6045 @cindex Highlighting text
6046 @cindex Indicating commands, definitions, etc.
6047
6048 Texinfo has commands for indicating just what kind of object a piece of
6049 text refers to. For example, metasyntactic variables are marked by
6050 @code{@@var}, and code by @code{@@code}. Since the pieces of text are
6051 labelled by commands that tell what kind of object they are, it is easy
6052 to change the way the Texinfo formatters prepare such text. (Texinfo is
6053 an @emph{intentional} formatting language rather than a @emph{typesetting}
6054 formatting language.)@refill
6055
6056 For example, in a printed manual,
6057 code is usually illustrated in a typewriter font;
6058 @code{@@code} tells @TeX{} to typeset this text in this font. But it
6059 would be easy to change the way @TeX{} highlights code to use another
6060 font, and this change would not effect how keystroke examples are
6061 highlighted. If straight typesetting commands were used in the body
6062 of the file and you wanted to make a change, you would need to check
6063 every single occurrence to make sure that you were changing code and
6064 not something else that should not be changed.@refill
6065
6066 @menu
6067 * Useful Highlighting:: Highlighting provides useful information.
6068 * code:: How to indicate code.
6069 * kbd:: How to show keyboard input.
6070 * key:: How to specify keys.
6071 * samp:: How to show a literal sequence of characters.
6072 * var:: How to indicate a metasyntactic variable.
6073 * file:: How to indicate the name of a file.
6074 * dfn:: How to specify a definition.
6075 * cite:: How to refer to a book that is not in Info.
6076 @end menu
6077
6078 @node Useful Highlighting, code, Indicating, Indicating
6079 @ifinfo
6080 @subheading Highlighting Commands are Useful
6081 @end ifinfo
6082
6083 The highlighting commands can be used to generate useful information
6084 from the file, such as lists of functions or file names. It is
6085 possible, for example, to write a program in Emacs Lisp (or a keyboard
6086 macro) to insert an index entry after every paragraph that contains
6087 words or phrases marked by a specified command. You could do this to
6088 construct an index of functions if you had not already made the
6089 entries.@refill
6090
6091 The commands serve a variety of purposes:@refill
6092
6093 @table @code
6094 @item @@code@{@var{sample-code}@}
6095 Indicate text that is a literal example of a piece of a program.@refill
6096
6097 @item @@kbd@{@var{keyboard-characters}@}
6098 Indicate keyboard input.@refill
6099
6100 @item @@key@{@var{key-name}@}
6101 Indicate the conventional name for a key on a keyboard.@refill
6102
6103 @item @@samp@{@var{text}@}
6104 Indicate text that is a literal example of a sequence of characters.@refill
6105
6106 @item @@var@{@var{metasyntactic-variable}@}
6107 Indicate a metasyntactic variable.@refill
6108
6109 @item @@file@{@var{file-name}@}
6110 Indicate the name of a file.@refill
6111
6112 @item @@dfn@{@var{term}@}
6113 Indicate the introductory or defining use of a term.@refill
6114
6115 @item @@cite@{@var{reference}@}
6116 Indicate the name of a book.@refill
6117
6118 @ignore
6119 @item @@ctrl@{@var{ctrl-char}@}
6120 Use for an @sc{ascii} control character.@refill
6121 @end ignore
6122 @end table
6123
6124 @node code, kbd, Useful Highlighting, Indicating
6125 @comment node-name, next, previous, up
6126 @subsection @code{@@code}@{@var{sample-code}@}
6127 @findex code
6128
6129 Use the @code{@@code} command to indicate text that is a piece of a
6130 program and which consists of entire syntactic tokens. Enclose the
6131 text in braces.@refill
6132
6133 Thus, you should use @code{@@code} for an expression in a program, for
6134 the name of a variable or function used in a program, or for a
6135 keyword. Also, you should use @code{@@code} for the name of a
6136 program, such as @code{diff}, that is a name used in the machine. (You
6137 should write the name of a program in the ordinary text font if you
6138 regard it as a new English word, such as `Emacs' or `Bison'.)@refill
6139
6140 Use @code{@@code} for environment variables such as @code{TEXINPUTS},
6141 and other variables.@refill
6142
6143 Use @code{@@code} for command names in command languages that
6144 resemble programming languages, such as Texinfo or the shell.
6145 For example, @code{@@code} and @code{@@samp} are produced by writing
6146 @samp{@@code@{@@@@code@}} and @samp{@@code@{@@@@samp@}} in the Texinfo
6147 source, respectively.@refill
6148
6149 Note, however, that you should not use @code{@@code} for shell options
6150 such as @samp{-c} when such options stand alone. (Use @code{@@samp}.)
6151 Also, an entire shell command often looks better if written using
6152 @code{@@samp} rather than @code{@@code}. In this case, the rule is to
6153 choose the more pleasing format.@refill
6154
6155 It is incorrect to alter the case of a word inside an @code{@@code}
6156 command when it appears at the beginning of a sentence. Most computer
6157 languages are case sensitive. In C, for example, @code{Printf} is
6158 different from the identifier @code{printf}, and most likely is a
6159 misspelling of it. Even in languages which are not case sensitive, it
6160 is confusing to a human reader to see identifiers spelled in different
6161 ways. Pick one spelling and always use that. If you do not want to
6162 start a sentence with a command written all in lower case, you should
6163 rearrange the sentence.@refill
6164
6165 Do not use the @code{@@code} command for a string of characters shorter
6166 than a syntactic token. If you are writing about @samp{TEXINPU}, which
6167 is just a part of the name for the @code{TEXINPUTS} environment
6168 variable, you should use @code{@@samp}.@refill
6169
6170 In particular, you should not use the @code{@@code} command when writing
6171 about the characters used in a token; do not, for example, use
6172 @code{@@code} when you are explaining what letters or printable symbols
6173 can be used in the names of functions. (Use @code{@@samp}.) Also, you
6174 should not use @code{@@code} to mark text that is considered input to
6175 programs unless the input is written in a language that is like a
6176 programming language. For example, you should not use @code{@@code} for
6177 the keystroke commands of GNU Emacs (use @code{@@kbd} instead) although
6178 you may use @code{@@code} for the names of the Emacs Lisp functions that
6179 the keystroke commands invoke.@refill
6180
6181 In the printed manual, @code{@@code} causes @TeX{} to typeset the
6182 argument in a typewriter face. In the Info file, it causes the Info
6183 formatting commands to use single quotation marks around the text.
6184
6185 @need 700
6186 For example,
6187
6188 @example
6189 Use @@code@{diff@} to compare two files.
6190 @end example
6191
6192 @noindent
6193 produces this in the printed manual:@refill
6194
6195 @quotation
6196 Use @code{diff} to compare two files.
6197 @end quotation
6198 @iftex
6199
6200 @noindent
6201 and this in the Info file:@refill
6202
6203 @example
6204 Use `diff' to compare two files.
6205 @end example
6206 @end iftex
6207
6208 @node kbd, key, code, Indicating
6209 @comment node-name, next, previous, up
6210 @subsection @code{@@kbd}@{@var{keyboard-characters}@}
6211 @findex kbd
6212
6213 Use the @code{@@kbd} command for characters of input to be typed by
6214 users. For example, to refer to the characters @kbd{M-a},
6215 write@refill
6216
6217 @example
6218 @@kbd@{M-a@}
6219 @end example
6220
6221 @noindent
6222 and to refer to the characters @kbd{M-x shell}, write@refill
6223
6224 @example
6225 @@kbd@{M-x shell@}
6226 @end example
6227
6228 The @code{@@kbd} command has the same effect as @code{@@code} in Info,
6229 but may produce a different font in a printed manual.@refill
6230
6231 You can embed another @@-command inside the braces of an @code{@@kbd}
6232 command. Here, for example, is the way to describe a command that
6233 would be described more verbosely as ``press an @samp{r} and then
6234 press the @key{RET} key'':@refill
6235
6236 @example
6237 @@kbd@{r @@key@{RET@}@}
6238 @end example
6239
6240 @noindent
6241 This produces: @kbd{r @key{RET}}
6242
6243 You also use the @code{@@kbd} command if you are spelling out the letters
6244 you type; for example:@refill
6245
6246 @example
6247 To give the @@code@{logout@} command,
6248 type the characters @@kbd@{l o g o u t @@key@{RET@}@}.
6249 @end example
6250
6251 @noindent
6252 This produces:
6253
6254 @quotation
6255 To give the @code{logout} command,
6256 type the characters @kbd{l o g o u t @key{RET}}.
6257 @end quotation
6258
6259 (Also, this example shows that you can add spaces for clarity. If you
6260 really want to mention a space character as one of the characters of
6261 input, write @kbd{@@key@{SPC@}} for it.)@refill
6262
6263 @node key, samp, kbd, Indicating
6264 @comment node-name, next, previous, up
6265 @subsection @code{@@key}@{@var{key-name}@}
6266 @findex key
6267
6268 Use the @code{@@key} command for the conventional name for a key on a
6269 keyboard, as in:@refill
6270
6271 @example
6272 @@key@{RET@}
6273 @end example
6274
6275 You can use the @code{@@key} command within the argument of an
6276 @code{@@kbd} command when the sequence of characters to be typed
6277 includes one or more keys that are described by name.@refill
6278
6279 @need 700
6280 For example, to produce @kbd{C-x @key{ESC}} you would type:@refill
6281
6282 @example
6283 @@kbd@{C-x @@key@{ESC@}@}
6284 @end example
6285
6286 @c bob: this next sentence looks weird, having a semi-colon followed by
6287 @c a colon that ends the "sentence".. --mew
6288 Here is a list of the recommended names for keys; they are all in
6289 upper case:@refill
6290 @cindex Recommended names for keys
6291 @cindex Keys, recommended names
6292 @cindex Names recommended for keys
6293 @cindex Abbreviations for keys
6294
6295 @quotation
6296 @table @t
6297 @item SPC
6298 Space
6299 @item RET
6300 Return
6301 @item LFD
6302 Linefeed
6303 @item TAB
6304 Tab
6305 @item BS
6306 Backspace
6307 @item ESC
6308 Escape
6309 @item DEL
6310 Delete
6311 @item SFT
6312 Shift
6313 @item CTL
6314 Control
6315 @item META
6316 Meta
6317 @end table
6318 @end quotation
6319
6320 There are subtleties to handling words like `meta' or `ctl' that are
6321 names of shift keys. When mentioning a character in which the shift
6322 key is used, such as @kbd{Meta-a}, use the @code{@@kbd} command alone;
6323 do not use the @code{@@key} command; but when you are referring to the
6324 shift key in isolation, use the @code{@@key} command. For example,
6325 write @samp{@@kbd@{Meta-a@}} to produce @kbd{Meta-a} and
6326 @samp{@@key@{META@}} to produce @key{META}. This is because
6327 @kbd{Meta-a} refers to keys that you press on a keyboard, but
6328 @key{META} refers to a key without implying that you press it. In
6329 short, use @code{@@kbd} for what you do, and use @code{@@key} for what
6330 you talk about: ``Press @code{@@kbd@{M-a@}} to move point to the
6331 beginning of the sentence. The @code{@@key@{META@}} key is often in the
6332 lower left of the keyboard.''@refill
6333 @cindex META key
6334
6335 @node samp, var, key, Indicating
6336 @comment node-name, next, previous, up
6337 @subsection @code{@@samp}@{@var{text}@}
6338 @findex samp
6339
6340 Use the @code{@@samp} command to indicate text that is a literal example
6341 or `sample' of a sequence of characters in a file, string, pattern, etc.
6342 Enclose the text in braces. The argument appears within single
6343 quotation marks in both the Info file and the printed manual; in
6344 addition, it is printed in a fixed-width font.@refill
6345
6346 @example
6347 To match @@samp@{foo@} at the end of the line,
6348 use the regexp @@samp@{foo$@}.
6349 @end example
6350
6351 @noindent
6352 produces
6353
6354 @quotation
6355 To match @samp{foo} at the end of the line, use the regexp
6356 @samp{foo$}.@refill
6357 @end quotation
6358
6359 Any time you are referring to single characters, you should use
6360 @code{@@samp} unless @code{@@kbd} is more appropriate. Use
6361 @code{@@samp} for the names of command-line options. Also, you may use
6362 @code{@@samp} for entire statements in C and for entire shell
6363 commands---in this case, @code{@@samp} often looks better than
6364 @code{@@code}. Basically, @code{@@samp} is a catchall for whatever is
6365 not covered by @code{@@code}, @code{@@kbd}, or @code{@@key}.@refill
6366
6367 Only include punctuation marks within braces if they are part of the
6368 string you are specifying. Write punctuation marks outside the braces
6369 if those punctuation marks are part of the English text that surrounds
6370 the string. In the following sentence, for example, the commas and
6371 period are outside of the braces:@refill
6372
6373 @example
6374 @group
6375 In English, the vowels are @@samp@{a@}, @@samp@{e@},
6376 @@samp@{i@}, @@samp@{o@}, @@samp@{u@}, and sometimes
6377 @@samp@{y@}.
6378 @end group
6379 @end example
6380
6381 @noindent
6382 This produces:
6383
6384 @quotation
6385 In English, the vowels are @samp{a}, @samp{e},
6386 @samp{i}, @samp{o}, @samp{u}, and sometimes
6387 @samp{y}.
6388 @end quotation
6389
6390 @node var, file, samp, Indicating
6391 @comment node-name, next, previous, up
6392 @subsection @code{@@var}@{@var{metasyntactic-variable}@}
6393 @findex var
6394
6395 Use the @code{@@var} command to indicate metasyntactic variables. A
6396 @dfn{metasyntactic variable} is something that stands for another piece of
6397 text. For example, you should use a metasyntactic variable in the
6398 documentation of a function to describe the arguments that are passed
6399 to that function.@refill
6400
6401 Do not use @code{@@var} for the names of particular variables in
6402 programming languages. These are specific names from a program, so
6403 @code{@@code} is correct for them. For example, the Lisp variable
6404 @code{texinfo-tex-command} is not a metasyntactic variable; it is
6405 properly formatted using @code{@@code}.@refill
6406
6407 The effect of @code{@@var} in the Info file is to change the case of
6408 the argument to all upper case; in the printed manual, to italicize it.
6409
6410 @need 700
6411 For example,
6412
6413 @example
6414 To delete file @@var@{filename@},
6415 type @@code@{rm @@var@{filename@}@}.
6416 @end example
6417
6418 @noindent
6419 produces
6420
6421 @quotation
6422 To delete file @var{filename}, type @code{rm @var{filename}}.
6423 @end quotation
6424
6425 @noindent
6426 (Note that @code{@@var} may appear inside @code{@@code},
6427 @code{@@samp}, @code{@@file}, etc.)@refill
6428
6429 Write a metasyntactic variable all in lower case without spaces, and
6430 use hyphens to make it more readable. Thus, the Texinfo source for
6431 the illustration of how to begin a Texinfo manual looks like
6432 this:@refill
6433
6434 @example
6435 @group
6436 \input texinfo
6437 @@@@setfilename @@var@{info-file-name@}
6438 @@@@settitle @@var@{name-of-manual@}
6439 @end group
6440 @end example
6441
6442 @noindent
6443 This produces:
6444
6445 @example
6446 @group
6447 \input texinfo
6448 @@setfilename @var{info-file-name}
6449 @@settitle @var{name-of-manual}
6450 @end group
6451 @end example
6452
6453 In some documentation styles, metasyntactic variables are shown with
6454 angle brackets, for example:@refill
6455
6456 @example
6457 @dots{}, type rm <filename>
6458 @end example
6459
6460 @noindent
6461 However, that is not the style that Texinfo uses. (You can, of
6462 course, modify the sources to @TeX{} and the Info formatting commands
6463 to output the @code{<@dots{}>} format if you wish.)@refill
6464
6465 @node file, dfn, var, Indicating
6466 @comment node-name, next, previous, up
6467 @subsection @code{@@file}@{@var{file-name}@}
6468 @findex file
6469
6470 Use the @code{@@file} command to indicate text that is the name of a
6471 file, buffer, or directory, or is the name of a node in Info. You can
6472 also use the command for file name suffixes. Do not use @code{@@file}
6473 for symbols in a programming language; use @code{@@code}.
6474
6475 Currently, @code{@@file} is equivalent to @code{@@samp} in its effects.
6476 For example,@refill
6477
6478 @example
6479 The @@file@{.el@} files are in
6480 the @@file@{/usr/local/emacs/lisp@} directory.
6481 @end example
6482
6483 @noindent
6484 produces
6485
6486 @quotation
6487 The @file{.el} files are in
6488 the @file{/usr/local/emacs/lisp} directory.
6489 @end quotation
6490
6491 @node dfn, cite, file, Indicating
6492 @comment node-name, next, previous, up
6493 @subsection @code{@@dfn}@{@var{term}@}
6494 @findex dfn
6495
6496 Use the @code{@@dfn} command to identify the introductory or defining
6497 use of a technical term. Use the command only in passages whose
6498 purpose is to introduce a term which will be used again or which the
6499 reader ought to know. Mere passing mention of a term for the first
6500 time does not deserve @code{@@dfn}. The command generates italics in
6501 the printed manual, and double quotation marks in the Info file. For
6502 example:@refill
6503
6504 @example
6505 Getting rid of a file is called @@dfn@{deleting@} it.
6506 @end example
6507
6508 @noindent
6509 produces
6510
6511 @quotation
6512 Getting rid of a file is called @dfn{deleting} it.
6513 @end quotation
6514
6515 As a general rule, a sentence containing the defining occurrence of a
6516 term should be a definition of the term. The sentence does not need
6517 to say explicitly that it is a definition, but it should contain the
6518 information of a definition---it should make the meaning clear.
6519
6520 @node cite, , dfn, Indicating
6521 @comment node-name, next, previous, up
6522 @subsection @code{@@cite}@{@var{reference}@}
6523 @findex cite
6524
6525 Use the @code{@@cite} command for the name of a book that lacks a
6526 companion Info file. The command produces italics in the printed
6527 manual, and quotation marks in the Info file.@refill
6528
6529 (If a book is written in Texinfo, it is better to use a cross reference
6530 command since a reader can easily follow such a reference in Info.
6531 @xref{xref, , @code{@@xref}}.)@refill
6532 @ignore
6533
6534 @c node ctrl, , cite, Indicating
6535 @comment node-name, next, previous, up
6536 @c subsection @code{@@ctrl}@{@var{ctrl-char}@}
6537 @findex ctrl
6538
6539 The @code{@@ctrl} command is seldom used. It describes an @sc{ascii}
6540 control character by inserting the actual character into the Info
6541 file.
6542
6543 Usually, in Texinfo, you talk what you type as keyboard entry by
6544 describing it with @code{@@kbd}: thus, @samp{@@kbd@{C-a@}} for
6545 @kbd{C-a}. Use @code{@@kbd} in this way when talking about a control
6546 character that is typed on the keyboard by the user. When talking
6547 about a control character appearing in a file or a string, do not use
6548 @code{@@kbd} since the control character is not typed. Also, do not
6549 use @samp{C-} but spell out @code{control-}, as in @samp{control-a},
6550 to make it easier for a reader to understand.@refill
6551
6552 @code{@@ctrl} is an idea from the beginnings of Texinfo which may not
6553 really fit in to the scheme of things. But there may be times when
6554 you want to use the command. The pattern is
6555 @code{@@ctrl@{@var{ch}@}}, where @var{ch} is an @sc{ascii} character
6556 whose control-equivalent is wanted. For example, to specify
6557 @samp{control-f}, you would enter@refill
6558
6559 @example
6560 @@ctrl@{f@}
6561 @end example
6562
6563 @noindent
6564 produces
6565
6566 @quotation
6567 @ctrl{f}
6568 @end quotation
6569
6570 In the Info file, this generates the specified control character, output
6571 literally into the file. This is done so a user can copy the specified
6572 control character (along with whatever else he or she wants) into another
6573 Emacs buffer and use it. Since the `control-h',`control-i', and
6574 `control-j' characters are formatting characters, they should not be
6575 indicated with @code{@@ctrl}.@refill
6576
6577 In a printed manual, @code{@@ctrl} generates text to describe or
6578 identify that control character: an uparrow followed by the character
6579 @var{ch}.@refill
6580 @end ignore
6581
6582 @node Emphasis, , Indicating, Marking Text
6583 @comment node-name, next, previous, up
6584 @section Emphasizing Text
6585 @cindex Emphasizing text
6586
6587 Usually, Texinfo changes the font to mark words in the text according to
6588 what category the words belong to; an example is the @code{@@code} command.
6589 Most often, this is the best way to mark words.
6590 However, sometimes you will want to emphasize text without indicating a
6591 category. Texinfo has two commands to do this. Also, Texinfo has
6592 several commands that specify the font in which @TeX{} will typeset
6593 text. These commands have no affect on Info and only one of them,
6594 the @code{@@r} command, has any regular use.@refill
6595
6596 @menu
6597 * emph & strong:: How to emphasize text in Texinfo.
6598 * Smallcaps:: How to use the small caps font.
6599 * Fonts:: Various font commands for printed output.
6600 * Customized Highlighting:: How to define highlighting commands.
6601 @end menu
6602
6603 @node emph & strong, Smallcaps, Emphasis, Emphasis
6604 @comment node-name, next, previous, up
6605 @subsection @code{@@emph}@{@var{text}@} and @code{@@strong}@{@var{text}@}
6606 @cindex Emphasizing text, font for
6607 @findex emph
6608 @findex strong
6609
6610 The @code{@@emph} and @code{@@strong} commands are for emphasis;
6611 @code{@@strong} is stronger. In printed output, @code{@@emph}
6612 produces @emph{italics} and @code{@@strong} produces
6613 @strong{bold}.@refill
6614
6615 @need 800
6616 For example,
6617
6618 @example
6619 @group
6620 @@quotation
6621 @@strong@{Caution:@} @@code@{rm * .[^.]*@} removes @@emph@{all@}
6622 files in the directory.
6623 @@end quotation
6624 @end group
6625 @end example
6626
6627 @iftex
6628 @noindent
6629 produces the following in printed output:
6630
6631 @quotation
6632 @strong{Caution}: @code{rm * .[^.]*} removes @emph{all}
6633 files in the directory.
6634 @end quotation
6635
6636 @noindent
6637 and the following in Info:
6638 @end iftex
6639 @ifinfo
6640 @noindent
6641 produces:
6642 @end ifinfo
6643
6644 @example
6645 *Caution*: `rm * .[^.]*' removes *all*
6646 files in the directory.
6647 @end example
6648
6649 The @code{@@strong} command is seldom used except to mark what is, in
6650 effect, a typographical element, such as the word `Caution' in the
6651 preceding example.
6652
6653 In the Info file, both @code{@@emph} and @code{@@strong} put asterisks
6654 around the text.@refill
6655
6656 @quotation
6657 @strong{Caution:} Do not use @code{@@emph} or @code{@@strong} with the
6658 word @samp{Note}; Info will mistake the combination for a cross
6659 reference. Use a phrase such as @strong{Please note} or
6660 @strong{Caution} instead.@refill
6661 @end quotation
6662
6663 @node Smallcaps, Fonts, emph & strong, Emphasis
6664 @subsection @code{@@sc}@{@var{text}@}: The Small Caps Font
6665 @cindex Small caps font
6666 @findex sc @r{(small caps font)}
6667
6668 @iftex
6669 Use the @samp{@@sc} command to set text in the printed output in @sc{a
6670 small caps font} and set text in the Info file in upper case letters.@refill
6671 @end iftex
6672 @ifinfo
6673 Use the @samp{@@sc} command to set text in the printed output in a
6674 small caps font and set text in the Info file in upper case letters.@refill
6675 @end ifinfo
6676
6677 Write the text between braces in lower case, like this:@refill
6678
6679 @example
6680 The @@sc@{acm@} and @@sc@{ieee@} are technical societies.
6681 @end example
6682
6683 @noindent
6684 This produces:
6685
6686 @display
6687 The @sc{acm} and @sc{ieee} are technical societies.
6688 @end display
6689
6690 @TeX{} typesets the small caps font in a manner that prevents the
6691 letters from `jumping out at you on the page'. This makes small caps
6692 text easier to read than text in all upper case. The Info formatting
6693 commands set all small caps text in upper case.@refill
6694
6695 @ifinfo
6696 If the text between the braces of an @code{@@sc} command is upper case,
6697 @TeX{} typesets in full-size capitals. Use full-size capitals
6698 sparingly.@refill
6699 @end ifinfo
6700 @iftex
6701 If the text between the braces of an @code{@@sc} command is upper case,
6702 @TeX{} typesets in @sc{FULL-SIZE CAPITALS}. Use full-size capitals
6703 sparingly.@refill
6704 @end iftex
6705
6706 You may also use the small caps font for a jargon word such as
6707 @sc{ato} (a @sc{nasa} word meaning `abort to orbit').@refill
6708
6709 There are subtleties to using the small caps font with a jargon word
6710 such as @sc{cdr}, a word used in Lisp programming. In this case, you
6711 should use the small caps font when the word refers to the second and
6712 subsequent elements of a list (the @sc{cdr} of the list), but you
6713 should use @samp{@@code} when the word refers to the Lisp function of
6714 the same spelling.@refill
6715
6716 @node Fonts, Customized Highlighting, Smallcaps, Emphasis
6717 @comment node-name, next, previous, up
6718 @subsection Fonts for Printing, Not Info
6719 @cindex Fonts for printing, not for Info
6720 @findex i @r{(italic font)}
6721 @findex b @r{(bold font)}
6722 @findex t @r{(typewriter font)}
6723 @findex r @r{(Roman font)}
6724
6725 Texinfo provides four font commands that specify font changes in the
6726 printed manual but have no effect in the Info file. @code{@@i}
6727 requests @i{italic} font (in some versions of @TeX{}, a slanted font
6728 is used), @code{@@b} requests @b{bold} face, @code{@@t} requests the
6729 @t{fixed-width}, typewriter-style font used by @code{@@code}, and @code{@@r} requests a
6730 @r{roman} font, which is the usual font in which text is printed. All
6731 four commands apply to an argument that follows, surrounded by
6732 braces.@refill
6733
6734 Only the @code{@@r} command has much use: in example programs, you
6735 can use the @code{@@r} command to convert code comments from the
6736 fixed-width font to a roman font. This looks better in printed
6737 output.@refill
6738
6739 @need 700
6740 For example,
6741
6742 @example
6743 @group
6744 @@lisp
6745 (+ 2 2) ; @@r@{Add two plus two.@}
6746 @@end lisp
6747 @end group
6748 @end example
6749
6750 @noindent
6751 produces
6752
6753 @lisp
6754 (+ 2 2) ; @r{Add two plus two.}
6755 @end lisp
6756
6757 If possible, you should avoid using the other three font commands. If
6758 you need to use one, it probably indicates a gap in the Texinfo
6759 language.@refill
6760
6761 @node Customized Highlighting, , Fonts, Emphasis
6762 @comment node-name, next, previous, up
6763 @subsection Customized Highlighting
6764 @findex @@definfoenclose
6765 @cindex `Enclosure' command for Info
6766 @cindex Highlighting, customized
6767 @cindex Customized highlighting
6768
6769 You can use regular @TeX{} commands inside of @code{@@iftex} @dots{}
6770 @code{@@end iftex} to create your own customized highlighting commands
6771 for Texinfo. The easiest way to do this is to equate your customized
6772 commands with pre-existing commands, such as those for italics. Such
6773 new commands work only with @TeX{}.@refill
6774
6775 You can use the @code{@@definfoenclose} command inside of
6776 @code{@@ifinfo} @dots{} @code{@@end ifinfo} to define commands for Info
6777 with the same names as new commands for @TeX{}.
6778 @code{@@definfoenclose} creates new commands for Info that mark text by
6779 enclosing it in strings that precede and follow the text.
6780 @footnote{Currently, @code{@@definfoenclose} works only with
6781 @code{texinfo-format-buffer} and @code{texinfo-format-region}, not with
6782 @code{makeinfo}.}@refill
6783
6784 Here is how to create a new @@-command called @code{@@phoo} that causes
6785 @TeX{} to typeset its argument in italics and causes Info to display the
6786 argument between @samp{//} and @samp{\\}.@refill
6787
6788 @need 1300
6789 For @TeX{}, write the following to equate the @code{@@phoo} command with
6790 the existing @code{@@i} italics command:@refill
6791
6792 @example
6793 @group
6794 @@iftex
6795 @@global@@let@@phoo=@@i
6796 @@end iftex
6797 @end group
6798 @end example
6799
6800 @noindent
6801 This defines @code{@@phoo} as a command that causes @TeX{} to typeset
6802 the argument to @code{@@phoo} in italics. @code{@@global@@let} tells
6803 @TeX{} to equate the next argument with the argument that follows the
6804 equals sign.
6805
6806 @need 1300
6807 For Info, write the following to tell the Info formatters to enclose the
6808 argument between @samp{//} and @samp{\\}:
6809
6810 @example
6811 @group
6812 @@ifinfo
6813 @@definfoenclose phoo, //, \\
6814 @@end ifinfo
6815 @end group
6816 @end example
6817
6818 @noindent
6819 Write the @code{@@definfoenclose} command on a line and follow it with
6820 three arguments separated by commas (commas are used as separators in an
6821 @code{@@node} line in the same way).@refill
6822
6823 @itemize @bullet
6824 @item
6825 The first argument to @code{@@definfoenclose} is the @@-command name
6826 @strong{without} the @samp{@@};
6827
6828 @item
6829 the second argument is the Info start delimiter string; and,
6830
6831 @item
6832 the third argument is the Info end delimiter string.
6833 @end itemize
6834
6835 @noindent
6836 The latter two arguments enclose the highlighted text in the Info file.
6837 A delimiter string may contain spaces. Neither the start nor end
6838 delimiter is required. However, if you do not provide a start
6839 delimiter, you must follow the command name with two commas in a row;
6840 otherwise, the Info formatting commands will misinterpret the end
6841 delimiter string as a start delimiter string.@refill
6842
6843 After you have defined @code{@@phoo} both for @TeX{} and for Info, you
6844 can then write @code{@@phoo@{bar@}} to see @samp{//bar\\}
6845 in Info and see
6846 @ifinfo
6847 @samp{bar} in italics in printed output.
6848 @end ifinfo
6849 @iftex
6850 @i{bar} in italics in printed output.
6851 @end iftex
6852
6853 Note that each definition applies to its own formatter: one for @TeX{},
6854 the other for Info.
6855
6856 @need 1200
6857 Here is another example:
6858
6859 @example
6860 @group
6861 @@ifinfo
6862 @@definfoenclose headword, , :
6863 @@end ifinfo
6864 @@iftex
6865 @@global@@let@@headword=@@b
6866 @@end iftex
6867 @end group
6868 @end example
6869
6870 @noindent
6871 This defines @code{@@headword} as an Info formatting command that
6872 inserts nothing before and a colon after the argument and as a @TeX{}
6873 formatting command to typeset its argument in bold.
6874
6875 @node Quotations and Examples, Lists and Tables, Marking Text, Top
6876 @comment node-name, next, previous, up
6877 @chapter Quotations and Examples
6878
6879 Quotations and examples are blocks of text consisting of one or more
6880 whole paragraphs that are set off from the bulk of the text and
6881 treated differently. They are usually indented.@refill
6882
6883 In Texinfo, you always begin a quotation or example by writing an
6884 @@-command at the beginning of a line by itself, and end it by writing
6885 an @code{@@end} command that is also at the beginning of a line by
6886 itself. For instance, you begin an example by writing @code{@@example}
6887 by itself at the beginning of a line and end the example by writing
6888 @code{@@end example} on a line by itself, at the beginning of that
6889 line.@refill
6890 @findex end
6891
6892 @menu
6893 * Block Enclosing Commands:: Use different constructs for
6894 different purposes.
6895 * quotation:: How to write a quotation.
6896 * example:: How to write an example in a fixed-width font.
6897 * noindent:: How to prevent paragraph indentation.
6898 * Lisp Example:: How to illustrate Lisp code.
6899 * smallexample & smalllisp:: Forms for the @code{@@smallbook} option.
6900 * display:: How to write an example in the current font.
6901 * format:: How to write an example that does not narrow
6902 the margins.
6903 * exdent:: How to undo the indentation of a line.
6904 * flushleft & flushright:: How to push text flushleft or flushright.
6905 * cartouche:: How to draw cartouches around examples.
6906 @end menu
6907
6908 @node Block Enclosing Commands, quotation, Quotations and Examples, Quotations and Examples
6909 @section The Block Enclosing Commands
6910
6911 Here are commands for quotations and examples:@refill
6912
6913 @table @code
6914 @item @@quotation
6915 Indicate text that is quoted. The text is filled, indented, and
6916 printed in a roman font by default.@refill
6917
6918 @item @@example
6919 Illustrate code, commands, and the like. The text is printed
6920 in a fixed-width font, and indented but not filled.@refill
6921
6922 @item @@lisp
6923 Illustrate Lisp code. The text is printed in a fixed-width font,
6924 and indented but not filled.@refill
6925
6926 @item @@smallexample
6927 Illustrate code, commands, and the like. Similar to
6928 @code{@@example}, except that in @TeX{} this command typesets text in
6929 a smaller font for the smaller @code{@@smallbook} format than for the
6930 8.5 by 11 inch format.@refill
6931
6932 @item @@smalllisp
6933 Illustrate Lisp code. Similar to @code{@@lisp}, except that
6934 in @TeX{} this command typesets text in a smaller font for the smaller
6935 @code{@@smallbook} format than for the 8.5 by 11 inch format.@refill
6936
6937 @item @@display
6938 Display illustrative text. The text is indented but not filled, and
6939 no font is specified (so, by default, the font is roman).@refill
6940
6941 @item @@format
6942 Print illustrative text. The text is not indented and not filled
6943 and no font is specified (so, by default, the font is roman).@refill
6944 @end table
6945
6946 The @code{@@exdent} command is used within the above constructs to
6947 undo the indentation of a line.
6948
6949 The @code{@@flushleft} and @code{@@flushright} commands are used to line
6950 up the left or right margins of unfilled text.@refill
6951
6952 The @code{@@noindent} command may be used after one of the above
6953 constructs to prevent the following text from being indented as a new
6954 paragraph.@refill
6955
6956 You can use the @code{@@cartouche} command within one of the above
6957 constructs to highlight the example or quotation by drawing a box with
6958 rounded corners around it. (The @code{@@cartouche} command affects
6959 only the printed manual; it has no effect in the Info file; see
6960 @ref{cartouche, , Drawing Cartouches Around Examples}.)@refill
6961
6962 @node quotation, example, Block Enclosing Commands, Quotations and Examples
6963 @comment node-name, next, previous, up
6964 @section @code{@@quotation}
6965 @cindex Quotations
6966 @findex quotation
6967
6968 The text of a quotation is
6969 processed normally except that:@refill
6970
6971 @itemize @bullet
6972 @item
6973 the margins are closer to the center of the page, so the whole of the
6974 quotation is indented;@refill
6975
6976 @item
6977 the first lines of paragraphs are indented no more than other
6978 lines;@refill
6979
6980 @item
6981 in the printed output, interparagraph spacing is reduced.@refill
6982 @end itemize
6983
6984 @quotation
6985 This is an example of text written between an @code{@@quotation}
6986 command and an @code{@@end quotation} command. An @code{@@quotation}
6987 command is most often used to indicate text that is excerpted from
6988 another (real or hypothetical) printed work.@refill
6989 @end quotation
6990
6991 Write an @code{@@quotation} command as text on a line by itself. This
6992 line will disappear from the output. Mark the end of the quotation
6993 with a line beginning with and containing only @code{@@end quotation}.
6994 The @code{@@end quotation} line will likewise disappear from the
6995 output. Thus, the following,@refill
6996
6997 @example
6998 @@quotation
6999 This is
7000 a foo.
7001 @@end quotation
7002 @end example
7003
7004 @noindent
7005 produces
7006
7007 @quotation
7008 This is a foo.
7009 @end quotation
7010
7011 @node example, noindent, quotation, Quotations and Examples
7012 @comment node-name, next, previous, up
7013 @section @code{@@example}
7014 @cindex Examples, formatting them
7015 @cindex Formatting examples
7016 @findex example
7017
7018 The @code{@@example} command is used to indicate an example that is
7019 not part of the running text, such as computer input or output.@refill
7020
7021 @example
7022 @group
7023 This is an example of text written between an
7024 @code{@@example} command
7025 and an @code{@@end example} command.
7026 The text is indented but not filled.
7027 @end group
7028
7029 @group
7030 In the printed manual, the text is typeset in a
7031 fixed-width font, and extra spaces and blank lines are
7032 significant. In the Info file, an analogous result is
7033 obtained by indenting each line with five spaces.
7034 @end group
7035 @end example
7036
7037 Write an @code{@@example} command at the beginning of a line by itself.
7038 This line will disappear from the output. Mark the end of the example
7039 with an @code{@@end example} command, also written at the beginning of a
7040 line by itself. The @code{@@end example} will disappear from the
7041 output.@refill
7042
7043 @need 700
7044 For example,
7045
7046 @example
7047 @@example
7048 mv foo bar
7049 @@end example
7050 @end example
7051
7052 @noindent
7053 produces
7054
7055 @example
7056 mv foo bar
7057 @end example
7058
7059 Since the lines containing @code{@@example} and @code{@@end example}
7060 will disappear, you should put a blank line before the
7061 @code{@@example} and another blank line after the @code{@@end
7062 example}. (Remember that blank lines between the beginning
7063 @code{@@example} and the ending @code{@@end example} will appear in
7064 the output.)@refill
7065
7066 @quotation
7067 @strong{Caution:} Do not use tabs in the lines of an example (or anywhere
7068 else in Texinfo, for that matter)! @TeX{} treats tabs as single
7069 spaces, and that is not what they look like. This is a problem with
7070 @TeX{}. (If necessary, in Emacs, you can use @kbd{M-x untabify} to
7071 convert tabs in a region to multiple spaces.)@refill
7072 @end quotation
7073
7074 Examples are often, logically speaking, ``in the middle'' of a
7075 paragraph, and the text continues after an example should not be
7076 indented. The @code{@@noindent} command prevents a piece of text from
7077 being indented as if it were a new paragraph.
7078 @ifinfo
7079 (@xref{noindent}.)
7080 @end ifinfo
7081
7082 (The @code{@@code} command is used for examples of code that are
7083 embedded within sentences, not set off from preceding and following
7084 text. @xref{code, , @code{@@code}}.)
7085
7086 @node noindent, Lisp Example, example, Quotations and Examples
7087 @comment node-name, next, previous, up
7088 @section @code{@@noindent}
7089 @findex noindent
7090
7091 An example or other inclusion can break a paragraph into segments.
7092 Ordinarily, the formatters indent text that follows an example as a new
7093 paragraph. However, you can prevent this by writing @code{@@noindent}
7094 at the beginning of a line by itself preceding the continuation
7095 text.@refill
7096
7097 @need 1500
7098 For example:
7099
7100 @example
7101 @group
7102 @@example
7103 This is an example
7104 @@end example
7105
7106 @@noindent
7107 This line is not indented. As you can see, the
7108 beginning of the line is fully flush left with the line
7109 that follows after it. (This whole example is between
7110 @@code@{@@@@display@} and @@code@{@@@@end display@}.)
7111 @end group
7112 @end example
7113
7114 @noindent
7115 produces
7116
7117 @display
7118 @example
7119 This is an example
7120 @end example
7121 @tex
7122 % Remove extra vskip; this is a kludge to counter the effect of display
7123 \vskip-3.5\baselineskip
7124 @end tex
7125
7126 @noindent
7127 This line is not indented. As you can see, the
7128 beginning of the line is fully flush left with the line
7129 that follows after it. (This whole example is between
7130 @code{@@display} and @code{@@end display}.)
7131 @end display
7132
7133 To adjust the number of blank lines properly in the Info file output,
7134 remember that the line containing @code{@@noindent} does not generate a
7135 blank line, and neither does the @code{@@end example} line.@refill
7136
7137 In the Texinfo source file for this manual, each line that says
7138 `produces' is preceded by a line containing @code{@@noindent}.@refill
7139
7140 Do not put braces after an @code{@@noindent} command; they are not
7141 necessary, since @code{@@noindent} is a command used outside of
7142 paragraphs (@pxref{Command Syntax}).@refill
7143
7144 @node Lisp Example, smallexample & smalllisp, noindent, Quotations and Examples
7145 @comment node-name, next, previous, up
7146 @section @code{@@lisp}
7147 @cindex Lisp example
7148 @findex lisp
7149
7150 The @code{@@lisp} command is used for Lisp code. It is synonymous
7151 with the @code{@@example} command.
7152
7153 @lisp
7154 This is an example of text written between an
7155 @code{@@lisp} command and an @code{@@end lisp} command.
7156 @end lisp
7157
7158 Use @code{@@lisp} instead of @code{@@example} so as to preserve
7159 information regarding the nature of the example. This is useful, for
7160 example, if you write a function that evaluates only and all the Lisp
7161 code in a Texinfo file. Then you can use the Texinfo file as a Lisp
7162 library.@footnote{It would be straightforward to extend Texinfo to
7163 work in a similar fashion for C, @sc{fortran}, or other languages.}@refill
7164
7165 Mark the end of @code{@@lisp} with @code{@@end lisp} on a line by
7166 itself.@refill
7167
7168 @node smallexample & smalllisp, display, Lisp Example, Quotations and Examples
7169 @comment node-name, next, previous, up
7170 @section @code{@@smallexample} and @code{@@smalllisp}
7171 @cindex Small book example
7172 @cindex Example for a small book
7173 @cindex Lisp example for a small book
7174 @findex smallexample
7175 @findex smalllisp
7176
7177 In addition to the regular @code{@@example} and @code{@@lisp} commands,
7178 Texinfo has two other ``example-style'' commands. These are the
7179 @code{@@smallexample} and @code{@@smalllisp} commands. Both these
7180 commands are designed for use with the @code{@@smallbook} command that
7181 causes @TeX{} to produce a printed manual in a 7 by 9.25 inch format
7182 rather than the regular 8.5 by 11 inch format.@refill
7183
7184 In @TeX{}, the @code{@@smallexample} and @code{@@smalllisp} commands
7185 typeset text in a smaller font for the smaller @code{@@smallbook}
7186 format than for the 8.5 by 11 inch format. Consequently, many examples
7187 containing long lines fit in a narrower, @code{@@smallbook} page
7188 without needing to be shortened. Both commands typeset in the normal
7189 font size when you format for the 8.5 by 11 inch size; indeed,
7190 in this situation, the @code{@@smallexample} and @code{@@smalllisp}
7191 commands are defined to be the @code{@@example} and @code{@@lisp}
7192 commands.@refill
7193
7194 In Info, the @code{@@smallexample} and @code{@@smalllisp} commands are
7195 equivalent to the @code{@@example} and @code{@@lisp} commands, and work
7196 exactly the same.@refill
7197
7198 Mark the end of @code{@@smallexample} or @code{@@smalllisp} with
7199 @code{@@end smallexample} or @code{@@end smalllisp},
7200 respectively.@refill
7201
7202 @iftex
7203 Here is an example written in the small font used by the
7204 @code{@@smallexample} and @code{@@smalllisp} commands:
7205
7206 @ifclear smallbook
7207 @display
7208 @tex
7209 % Remove extra vskip; this is a kludge to counter the effect of display
7210 \vskip-3\baselineskip
7211 {\ninett
7212 \dots{} to make sure that you have the freedom to
7213 distribute copies of free software (and charge for
7214 this service if you wish), that you receive source
7215 code or can get it if you want it, that you can
7216 change the software or use pieces of it in new free
7217 programs; and that you know you can do these things.}
7218 @end tex
7219 @end display
7220 @end ifclear
7221 @end iftex
7222 @ifset smallbook
7223 @iftex
7224 @smallexample
7225 This is an example of text written between @code{@@smallexample} and
7226 @code{@@end smallexample}. In Info and in an 8.5 by 11 inch manual,
7227 this text appears in its normal size; but in a 7 by 9.25 inch manual,
7228 this text appears in a smaller font.
7229 @end smallexample
7230 @end iftex
7231 @end ifset
7232 @ifinfo
7233 @smallexample
7234 This is an example of text written between @code{@@smallexample} and
7235 @code{@@end smallexample}. In Info and in an 8.5 by 11 inch manual,
7236 this text appears in its normal size; but in a 7 by 9.25 inch manual,
7237 this text appears in a smaller font.
7238 @end smallexample
7239 @end ifinfo
7240
7241 The @code{@@smallexample} and @code{@@smalllisp} commands make it
7242 easier to prepare smaller format manuals without forcing you to edit
7243 examples by hand to fit them onto narrower pages.@refill
7244
7245 As a general rule, a printed document looks better if you write all the
7246 examples in a chapter consistently in @code{@@example} or in
7247 @code{@@smallexample}. Only occasionally should you mix the two
7248 formats.@refill
7249
7250 @xref{smallbook, , Printing ``Small'' Books}, for more information
7251 about the @code{@@smallbook} command.@refill
7252
7253 @node display, format, smallexample & smalllisp, Quotations and Examples
7254 @comment node-name, next, previous, up
7255 @section @code{@@display}
7256 @cindex Display formatting
7257 @findex display
7258
7259 The @code{@@display} command begins a kind of example. It is like the
7260 @code{@@example} command
7261 except that, in
7262 a printed manual, @code{@@display} does not select the fixed-width
7263 font. In fact, it does not specify the font at all, so that the text
7264 appears in the same font it would have appeared in without the
7265 @code{@@display} command.@refill
7266
7267 @display
7268 This is an example of text written between an @code{@@display} command
7269 and an @code{@@end display} command. The @code{@@display} command
7270 indents the text, but does not fill it.
7271 @end display
7272
7273 @node format, exdent, display, Quotations and Examples
7274 @comment node-name, next, previous, up
7275 @section @code{@@format}
7276 @findex format
7277
7278 The @code{@@format} command is similar to @code{@@example} except
7279 that, in the printed manual, @code{@@format} does not select the
7280 fixed-width font and does not narrow the margins.@refill
7281
7282 @format
7283 This is an example of text written between an @code{@@format} command
7284 and an @code{@@end format} command. As you can see
7285 from this example,
7286 the @code{@@format} command does not fill the text.
7287 @end format
7288
7289 @node exdent, flushleft & flushright, format, Quotations and Examples
7290 @section @code{@@exdent}: Undoing a Line's Indentation
7291 @cindex Indentation undoing
7292 @findex exdent
7293
7294 The @code{@@exdent} command removes any indentation a line might have.
7295 The command is written at the beginning of a line and applies only to
7296 the text that follows the command that is on the same line. Do not use
7297 braces around the text. In a printed manual, the text on an
7298 @code{@@exdent} line is printed in the roman font.@refill
7299
7300 @code{@@exdent} is usually used within examples. Thus,@refill
7301
7302 @example
7303 @group
7304 @@example
7305 This line follows an @@@@example command.
7306 @@exdent This line is exdented.
7307 This line follows the exdented line.
7308 The @@@@end example comes on the next line.
7309 @@end group
7310 @end group
7311 @end example
7312
7313 @noindent
7314 produces
7315
7316 @example
7317 @group
7318 This line follows an @@example command.
7319 @exdent This line is exdented.
7320 This line follows the exdented line.
7321 The @@end example comes on the next line.
7322 @end group
7323 @end example
7324
7325 In practice, the @code{@@exdent} command is rarely used.
7326 Usually, you un-indent text by ending the example and
7327 returning the page to its normal width.@refill
7328
7329 @node flushleft & flushright, cartouche, exdent, Quotations and Examples
7330 @section @code{@@flushleft} and @code{@@flushright}
7331 @findex flushleft
7332 @findex flushright
7333
7334 The @code{@@flushleft} and @code{@@flushright} commands line up the
7335 ends of lines on the left and right margins of a page,
7336 but do not fill the text. The commands are written on lines of their
7337 own, without braces. The @code{@@flushleft} and @code{@@flushright}
7338 commands are ended by @code{@@end flushleft} and @code{@@end
7339 flushright} commands on lines of their own.@refill
7340
7341 @need 1500
7342 For example,
7343
7344 @example
7345 @group
7346 @@flushleft
7347 This text is
7348 written flushleft.
7349 @@end flushleft
7350 @end group
7351 @end example
7352
7353 @noindent
7354 produces
7355
7356 @quotation
7357 @flushleft
7358 This text is
7359 written flushleft.
7360 @end flushleft
7361 @end quotation
7362
7363
7364 Flushright produces the type of indentation often used in the return
7365 address of letters.@refill
7366
7367 @need 1500
7368 @noindent
7369 For example,
7370
7371 @example
7372 @group
7373 @@flushright
7374 Here is an example of text written
7375 flushright. The @@code@{@@flushright@} command
7376 right justifies every line but leaves the
7377 left end ragged.
7378 @@end flushright
7379 @end group
7380 @end example
7381
7382 @noindent
7383 produces
7384
7385 @flushright
7386 Here is an example of text written
7387 flushright. The @code{@@flushright} command
7388 right justifies every line but leaves the
7389 left end ragged.
7390 @end flushright
7391
7392 @node cartouche, , flushleft & flushright, Quotations and Examples
7393 @section Drawing Cartouches Around Examples
7394 @findex cartouche
7395 @cindex Box with rounded corners
7396
7397 In a printed manual, the @code{@@cartouche} command draws a box with
7398 rounded corners around its contents. You can use this command to
7399 further highlight an example or quotation. For instance, you could
7400 write a manual in which one type of example is surrounded by a cartouche
7401 for emphasis.@refill
7402
7403 The @code{@@cartouche} command affects only the printed manual; it has
7404 no effect in the Info file.@refill
7405
7406 @need 1500
7407 For example,
7408
7409 @example
7410 @group
7411 @@example
7412 @@cartouche
7413 % pwd
7414 /usr/local/lib/emacs/info
7415 @@end cartouche
7416 @@end example
7417 @end group
7418 @end example
7419
7420 @noindent
7421 surrounds the two-line example with a box with rounded corners, in the
7422 printed manual.
7423
7424 @iftex
7425 In a printed manual, the example looks like this:@refill
7426
7427 @example
7428 @group
7429 @cartouche
7430 % pwd
7431 /usr/local/lib/emacs/info
7432 @end cartouche
7433 @end group
7434 @end example
7435 @end iftex
7436
7437 @node Lists and Tables, Indices, Quotations and Examples, Top
7438 @comment node-name, next, previous, up
7439 @chapter Making Lists and Tables
7440 @cindex Making lists and tables
7441 @cindex Lists and tables, making them
7442 @cindex Tables and lists, making them
7443
7444 Texinfo has several ways of making lists and two-column tables. Lists can
7445 be bulleted or numbered, while two-column tables can highlight the items in
7446 the first column.@refill
7447
7448 @menu
7449 * Introducing Lists:: Texinfo formats lists for you.
7450 * itemize:: How to construct a simple list.
7451 * enumerate:: How to construct a numbered list.
7452 * Two-column Tables:: How to construct a two-column table.
7453 @end menu
7454
7455 @ifinfo
7456 @node Introducing Lists, itemize, Lists and Tables, Lists and Tables
7457 @heading Introducing Lists
7458 @end ifinfo
7459
7460 Texinfo automatically indents the text in lists or tables, and numbers
7461 an enumerated list. This last feature is useful if you modify the
7462 list, since you do not need to renumber it yourself.@refill
7463
7464 Numbered lists and tables begin with the appropriate @@-command at the
7465 beginning of a line, and end with the corresponding @code{@@end}
7466 command on a line by itself. The table and itemized-list commands
7467 also require that you write formatting information on the same line as
7468 the beginning @@-command.@refill
7469
7470 Begin an enumerated list, for example, with an @code{@@enumerate}
7471 command and end the list with an @code{@@end enumerate} command.
7472 Begin an itemized list with an @code{@@itemize} command, followed on
7473 the same line by a formatting command such as @code{@@bullet}, and end
7474 the list with an @code{@@end itemize} command.@refill
7475 @findex end
7476
7477 Precede each element of a list with an @code{@@item} or @code{@@itemx}
7478 command.@refill
7479
7480 @sp 1
7481 @noindent
7482 Here is an itemized list of the different kinds of table and lists:@refill
7483
7484 @itemize @bullet
7485 @item
7486 Itemized lists with and without bullets.
7487
7488 @item
7489 Enumerated lists, using numbers or letters.
7490
7491 @item
7492 Two-column tables with highlighting.
7493 @end itemize
7494
7495 @sp 1
7496 @noindent
7497 Here is an enumerated list with the same items:@refill
7498
7499 @enumerate
7500 @item
7501 Itemized lists with and without bullets.
7502
7503 @item
7504 Enumerated lists, using numbers or letters.
7505
7506 @item
7507 Two-column tables with highlighting.
7508 @end enumerate
7509
7510 @sp 1
7511 @noindent
7512 And here is a two-column table with the same items and their
7513 @w{@@-commands}:@refill
7514
7515 @table @code
7516 @item @@itemize
7517 Itemized lists with and without bullets.
7518
7519 @item @@enumerate
7520 Enumerated lists, using numbers or letters.
7521
7522 @item @@table
7523 @itemx @@ftable
7524 @itemx @@vtable
7525 Two-column tables with highlighting.
7526 @end table
7527
7528 @node itemize, enumerate, Introducing Lists, Lists and Tables
7529 @comment node-name, next, previous, up
7530 @section Making an Itemized List
7531 @cindex Itemization
7532 @findex itemize
7533
7534 The @code{@@itemize} command produces sequences of indented
7535 paragraphs, with a bullet or other mark inside the left margin
7536 at the beginning of each paragraph for which such a mark is desired.@refill
7537
7538 Begin an itemized list by writing @code{@@itemize} at the beginning of
7539 a line. Follow the command, on the same line, with a character or a
7540 Texinfo command that generates a mark. Usually, you will write
7541 @code{@@bullet} after @code{@@itemize}, but you can use
7542 @code{@@minus}, or any character or any special symbol that results in
7543 a single character in the Info file. (When you write @code{@@bullet}
7544 or @code{@@minus} after an @code{@@itemize} command, you may omit the
7545 @samp{@{@}}.)@refill
7546
7547 Write the text of the indented paragraphs themselves after the
7548 @code{@@itemize}, up to another line that says @code{@@end
7549 itemize}.@refill
7550
7551 Before each paragraph for which a mark in the margin is desired, write
7552 a line that says just @code{@@item}. Do not write any other text on this
7553 line.@refill
7554 @findex item
7555
7556 Usually, you should put a blank line before an @code{@@item}. This
7557 puts a blank line in the Info file. (@TeX{} inserts the proper
7558 interline whitespace in either case.) Except when the entries are
7559 very brief, these blank lines make the list look better.@refill
7560
7561 Here is an example of the use of @code{@@itemize}, followed by the
7562 output it produces. Note that @code{@@bullet} produces an @samp{*} in
7563 Info and a round dot in @TeX{}.@refill
7564
7565 @example
7566 @group
7567 @@itemize @@bullet
7568 @@item
7569 Some text for foo.
7570
7571 @@item
7572 Some text
7573 for bar.
7574 @@end itemize
7575 @end group
7576 @end example
7577
7578 @noindent
7579 This produces:
7580
7581 @quotation
7582 @itemize @bullet
7583 @item
7584 Some text for foo.
7585
7586 @item
7587 Some text
7588 for bar.
7589 @end itemize
7590 @end quotation
7591
7592 Itemized lists may be embedded within other itemized lists. Here is a
7593 list marked with dashes embedded in a list marked with bullets:@refill
7594
7595 @example
7596 @group
7597 @@itemize @@bullet
7598 @@item
7599 First item.
7600
7601 @@itemize @@minus
7602 @@item
7603 Inner item.
7604
7605 @@item
7606 Second inner item.
7607 @@end itemize
7608
7609 @@item
7610 Second outer item.
7611 @@end itemize
7612 @end group
7613 @end example
7614
7615 @noindent
7616 This produces:
7617
7618 @quotation
7619 @itemize @bullet
7620 @item
7621 First item.
7622
7623 @itemize @minus
7624 @item
7625 Inner item.
7626
7627 @item
7628 Second inner item.
7629 @end itemize
7630
7631 @item
7632 Second outer item.
7633 @end itemize
7634 @end quotation
7635
7636 @node enumerate, Two-column Tables, itemize, Lists and Tables
7637 @comment node-name, next, previous, up
7638 @section Making a Numbered or Lettered List
7639 @cindex Enumeration
7640 @findex enumerate
7641
7642 @code{@@enumerate} is like @code{@@itemize} except that the marks in
7643 the left margin contain successive integers or letters.
7644 (@xref{itemize, , @code{@@itemize}}.)@refill
7645
7646 Write the @code{@@enumerate} command at the beginning of a line.
7647 The command does not require an argument, but accepts either a number or
7648 a letter as an option.
7649 Without an argument, @code{@@enumerate} starts the list
7650 with the number 1. With a numeric argument, such as 3,
7651 the command starts the list with that number.
7652 With an upper or lower case letter, such as @kbd{a} or @kbd{A},
7653 the command starts the list with that letter.@refill
7654
7655 Write the text of the enumerated list in the same way you write an
7656 itemized list: put @code{@@item} on a line of its own before the start of
7657 each paragraph that you want enumerated. Do not write any other text on
7658 the line beginning with @code{@@item}.@refill
7659
7660 You should put a blank line between entries in the list.
7661 This generally makes it easier to read the Info file.@refill
7662
7663 @need 1500
7664 Here is an example of @code{@@enumerate} without an argument:@refill
7665
7666 @example
7667 @group
7668 @@enumerate
7669 @@item
7670 Underlying causes.
7671
7672 @@item
7673 Proximate causes.
7674 @@end enumerate
7675 @end group
7676 @end example
7677
7678 @noindent
7679 This produces:
7680
7681 @enumerate
7682 @item
7683 Underlying causes.
7684
7685 @item
7686 Proximate causes.
7687 @end enumerate
7688 @sp 1
7689 Here is an example with an argument of @kbd{3}:@refill
7690 @sp 1
7691 @example
7692 @group
7693 @@enumerate 3
7694 @@item
7695 Predisposing causes.
7696
7697 @@item
7698 Precipitating causes.
7699
7700 @@item
7701 Perpetuating causes.
7702 @@end enumerate
7703 @end group
7704 @end example
7705
7706 @noindent
7707 This produces:
7708
7709 @enumerate 3
7710 @item
7711 Predisposing causes.
7712
7713 @item
7714 Precipitating causes.
7715
7716 @item
7717 Perpetuating causes.
7718 @end enumerate
7719 @sp 1
7720 Here is a brief summary of the alternatives. The summary is constructed
7721 using @code{@@enumerate} with an argument of @kbd{a}.@refill
7722 @sp 1
7723 @enumerate a
7724 @item
7725 @code{@@enumerate}
7726
7727 Without an argument, produce a numbered list, starting with the number
7728 1.@refill
7729
7730 @item
7731 @code{@@enumerate @var{positive-integer}}
7732
7733 With a (positive) numeric argument, start a numbered list with that
7734 number. You can use this to continue a list that you interrupted with
7735 other text.@refill
7736
7737 @item
7738 @code{@@enumerate @var{upper-case-letter}}
7739
7740 With an upper case letter as argument, start a list
7741 in which each item is marked
7742 by a letter, beginning with that upper case letter.@refill
7743
7744 @item
7745 @code{@@enumerate @var{lower-case-letter}}
7746
7747 With a lower case letter as argument, start a list
7748 in which each item is marked by
7749 a letter, beginning with that lower case letter.@refill
7750 @end enumerate
7751
7752 You can also nest enumerated lists, as in an outline.@refill
7753
7754 @node Two-column Tables, , enumerate, Lists and Tables
7755 @comment node-name, next, previous, up
7756 @section Making a Two-column Table
7757 @cindex Tables, making two-column
7758 @findex table
7759
7760 @code{@@table} is similar to @code{@@itemize}, but the command allows
7761 you to specify a name or heading line for each item. (@xref{itemize,
7762 , @code{@@itemize}}.) The @code{@@table} command is used to produce
7763 two-column tables, and is especially useful for glossaries and
7764 explanatory exhibits.@refill
7765
7766 @menu
7767 * table:: How to construct a two-column table.
7768 * ftable vtable:: How to construct a two-column table
7769 with automatic indexing.
7770 * itemx:: How to put more entries in the first column.
7771 @end menu
7772
7773 @ifinfo
7774 @node table, ftable vtable, Two-column Tables, Two-column Tables
7775 @subheading Using the @code{@@table} Command
7776
7777 Use the @code{@@table} command to produce two-column tables.@refill
7778 @end ifinfo
7779
7780 Write the @code{@@table} command at the beginning of a line and follow
7781 it on the same line with an argument that is a Texinfo command such as
7782 @code{@@code}, @code{@@samp}, @code{@@var}, or @code{@@kbd}.
7783 Although these commands are usually followed by arguments in braces,
7784 in this case you use the command name without an argument because
7785 @code{@@item} will supply the argument. This command will be applied
7786 to the text that goes into the first column of each item and
7787 determines how it will be highlighted. For example, @code{@@samp}
7788 will cause the text in the first column to be highlighted with an
7789 @code{@@samp} command.@refill
7790
7791 You may also choose to use the @code{@@asis} command as an argument to
7792 @code{@@table}. @code{@@asis} is a command that does nothing; if you use this
7793 command after @code{@@table}, @TeX{} and the Info formatting commands
7794 output the first column entries without added highlighting (`as
7795 is').@refill
7796
7797 (The @code{@@table} command may work with other commands besides those
7798 listed here. However, you can only use commands
7799 that normally take arguments in braces.)@refill
7800
7801 Begin each table entry with an @code{@@item} command at the beginning
7802 of a line. Write the first column text on the same line as the
7803 @code{@@item} command. Write the second column text on the line
7804 following the @code{@@item} line and on subsequent lines. (You do not
7805 need to type anything for an empty second column entry.) You may
7806 write as many lines of supporting text as you wish, even several
7807 paragraphs. But only text on the same line as the @code{@@item} will
7808 be placed in the first column.@refill
7809 @findex item
7810
7811 Normally, you should put a blank line before an @code{@@item} line.
7812 This puts a blank like in the Info file. Except when the entries are
7813 very brief, a blank line looks better.@refill
7814
7815 @need 1500
7816 The following table, for example, highlights the text in the first
7817 column with an @code{@@samp} command:@refill
7818
7819 @example
7820 @group
7821 @@table @@samp
7822 @@item foo
7823 This is the text for
7824 @@samp@{foo@}.
7825
7826 @@item bar
7827 Text for @@samp@{bar@}.
7828 @@end table
7829 @end group
7830 @end example
7831
7832 @noindent
7833 This produces:
7834
7835 @table @samp
7836 @item foo
7837 This is the text for
7838 @samp{foo}.
7839 @item bar
7840 Text for @samp{bar}.
7841 @end table
7842
7843 If you want to list two or more named items with a single block of
7844 text, use the @code{@@itemx} command. (@xref{itemx, ,
7845 @code{@@itemx}}.)@refill
7846
7847 @node ftable vtable, itemx, table, Two-column Tables
7848 @comment node-name, next, previous, up
7849 @subsection @code{@@ftable} and @code{@@vtable}
7850 @cindex Tables with indexes
7851 @cindex Indexing table entries automatically
7852 @findex ftable
7853 @findex vtable
7854
7855 The @code{@@ftable} and @code{@@vtable} commands are the same as the
7856 @code{@@table} command except that @code{@@ftable} automatically enters
7857 each of the items in the first column of the table into the index of
7858 functions and @code{@@vtable} automatically enters each of the items in
7859 the first column of the table into the index of variables. This
7860 simplifies the task of creating indices. Only the items on the same
7861 line as the @code{@@item} commands are indexed, and they are indexed in
7862 exactly the form that they appear on that line. @xref{Indices, ,
7863 Creating Indices}, for more information about indices.@refill
7864
7865 Begin a two-column table using @code{@@ftable} or @code{@@vtable} by
7866 writing the @@-command at the beginning of a line, followed on the same
7867 line by an argument that is a Texinfo command such as @code{@@code},
7868 exactly as you would for an @code{@@table} command; and end the table
7869 with an @code{@@end ftable} or @code{@@end vtable} command on a line by
7870 itself.
7871
7872 @node itemx, , ftable vtable, Two-column Tables
7873 @comment node-name, next, previous, up
7874 @subsection @code{@@itemx}
7875 @cindex Two named items for @code{@@table}
7876 @findex itemx
7877
7878 Use the @code{@@itemx} command inside a table when you have two or
7879 more first column entries for the same item, each of which should
7880 appear on a line of its own. Use @code{@@itemx} for all but the first
7881 entry. The @code{@@itemx} command works exactly like @code{@@item}
7882 except that it does not generate extra vertical space above the first
7883 column text.@refill
7884
7885 @need 1000
7886 For example,
7887
7888 @example
7889 @group
7890 @@table @@code
7891 @@item upcase
7892 @@itemx downcase
7893 These two functions accept a character or a string as
7894 argument, and return the corresponding upper case (lower
7895 case) character or string.
7896 @@end table
7897 @end group
7898 @end example
7899
7900 @noindent
7901 This produces:
7902
7903 @table @code
7904 @item upcase
7905 @itemx downcase
7906 These two functions accept a character or a string as
7907 argument, and return the corresponding upper case (lower
7908 case) character or string.@refill
7909 @end table
7910
7911 @noindent
7912 (Note also that this example illustrates multi-line supporting text in
7913 a two-column table.)@refill
7914
7915 @node Indices, Insertions, Lists and Tables, Top
7916 @comment node-name, next, previous, up
7917 @chapter Creating Indices
7918 @cindex Indices
7919 @cindex Creating indices
7920
7921 Using Texinfo, you can generate indices without having to sort and
7922 collate entries manually. In an index, the entries are listed in
7923 alphabetical order, together with information on how to find the
7924 discussion of each entry. In a printed manual, this information
7925 consists of page numbers. In an Info file, this information is a menu
7926 entry leading to the first node referenced.@refill
7927
7928 Texinfo provides several predefined kinds of index: an index
7929 for functions, an index for variables, an index for concepts, and so
7930 on. You can combine indices or use them for other than their
7931 canonical purpose. If you wish, you can define your own indices.@refill
7932
7933 @menu
7934 * Index Entries:: Choose different words for index entries.
7935 * Predefined Indices:: Use different indices for different kinds
7936 of entry.
7937 * Indexing Commands:: How to make an index entry.
7938 * Combining Indices:: How to combine indices.
7939 * New Indices:: How to define your own indices.
7940 @end menu
7941
7942 @node Index Entries, Predefined Indices, Indices, Indices
7943 @comment node-name, next, previous, up
7944 @section Making Index Entries
7945 @cindex Index entries, making
7946 @cindex Entries, making index
7947
7948 When you are making index entries, it is good practice to think of the
7949 different ways people may look for something. Different people
7950 @emph{do not} think of the same words when they look something up. A
7951 helpful index will have items indexed under all the different words
7952 that people may use. For example, one reader may think it obvious that
7953 the two-letter names for indices should be listed under ``Indices,
7954 two-letter names'', since the word ``Index'' is the general concept.
7955 But another reader may remember the specific concept of two-letter
7956 names and search for the entry listed as ``Two letter names for
7957 indices''. A good index will have both entries and will help both
7958 readers.@refill
7959
7960 Like typesetting, the construction of an index is a highly skilled,
7961 professional art, the subtleties of which are not appreciated until you
7962 need to do it yourself.@refill
7963
7964 @xref{Printing Indices & Menus}, for information about printing an index
7965 at the end of a book or creating an index menu in an Info file.@refill
7966
7967 @node Predefined Indices, Indexing Commands, Index Entries, Indices
7968 @comment node-name, next, previous, up
7969 @section Predefined Indices
7970
7971 Texinfo provides six predefined indices:@refill
7972
7973 @itemize @bullet
7974 @item
7975 A @dfn{concept index} listing concepts that are discussed.@refill
7976
7977 @item
7978 A @dfn{function index} listing functions (such as entry points of
7979 libraries).@refill
7980
7981 @item
7982 A @dfn{variables index} listing variables (such as global variables
7983 of libraries).@refill
7984
7985 @item
7986 A @dfn{keystroke index} listing keyboard commands.@refill
7987
7988 @item
7989 A @dfn{program index} listing names of programs.@refill
7990
7991 @item
7992 A @dfn{data type index} listing data types (such as structures defined in
7993 header files).@refill
7994 @end itemize
7995
7996 @noindent
7997 Not every manual needs all of these, and most manuals use two or three
7998 of them. This manual has two indices: a
7999 concept index and an @@-command index (that is actually the function
8000 index but is called a command index in the chapter heading). Two or
8001 more indices can be combined into one using the @code{@@synindex} or
8002 @code{@@syncodeindex} commands. @xref{Combining Indices}.@refill
8003
8004 @node Indexing Commands, Combining Indices, Predefined Indices, Indices
8005 @comment node-name, next, previous, up
8006 @section Defining the Entries of an Index
8007 @cindex Defining indexing entries
8008 @cindex Index entries
8009 @cindex Entries for an index
8010 @cindex Specifying index entries
8011 @cindex Creating index entries
8012
8013 The data to make an index come from many individual indexing commands
8014 scattered throughout the Texinfo source file. Each command says to add
8015 one entry to a particular index; after formatting, the index will give
8016 the current page number or node name as the reference.@refill
8017
8018 An index entry consists of an indexing command at the beginning of a
8019 line followed, on the rest of the line, by the entry.@refill
8020
8021 For example, this section begins with the following five entries for
8022 the concept index:@refill
8023
8024 @example
8025 @@cindex Defining indexing entries
8026 @@cindex Index entries
8027 @@cindex Entries for an index
8028 @@cindex Specifying index entries
8029 @@cindex Creating index entries
8030 @end example
8031
8032 Each predefined index has its own indexing command---@code{@@cindex}
8033 for the concept index, @code{@@findex} for the function index, and so
8034 on.@refill
8035
8036 @cindex Writing index entries
8037 @cindex Index entry writing
8038 Concept index entries consist of text. The best way to write an index
8039 is to choose entries that are terse yet clear. If you can do this,
8040 the index often looks better if the entries are not capitalized, but
8041 written just as they would appear in the middle of a sentence.
8042 (Capitalize proper names and acronyms that always call for upper case
8043 letters.) This is the case convention we use in most GNU manuals'
8044 indices.
8045
8046 If you don't see how to make an entry terse yet clear, make it longer
8047 and clear---not terse and confusing. If many of the entries are several
8048 words long, the index may look better if you use a different convention:
8049 to capitalize the first word of each entry. But do not capitalize a
8050 case-sensitive name such as a C or Lisp function name or a shell
8051 command; that would be a spelling error.
8052
8053 Whichever case convention you use, please use it consistently!
8054
8055 @ignore
8056 Concept index entries consist of English text. The usual convention
8057 is to capitalize the first word of each such index entry, unless that
8058 word is the name of a function, variable, or other such entity that
8059 should not be capitalized. However, if your concept index entries are
8060 consistently short (one or two words each) it may look better for each
8061 regular entry to start with a lower case letter, aside from proper
8062 names and acronyms that always call for upper case letters. Whichever
8063 convention you adapt, please be consistent!
8064 @end ignore
8065
8066 Entries in indices other than the concept index are symbol names in
8067 programming languages, or program names; these names are usually
8068 case-sensitive, so use upper and lower case as required for them.
8069
8070 By default, entries for a concept index are printed in a small roman
8071 font and entries for the other indices are printed in a small
8072 @code{@@code} font. You may change the way part of an entry is
8073 printed with the usual Texinfo commands, such as @code{@@file} for
8074 file names and @code{@@emph} for emphasis (@pxref{Marking
8075 Text}).@refill
8076 @cindex Index font types
8077
8078 @cindex Predefined indexing commands
8079 @cindex Indexing commands, predefined
8080 The six indexing commands for predefined indices are:
8081
8082 @table @code
8083 @item @@cindex @var{concept}
8084 @findex cindex
8085 Make an entry in the concept index for @var{concept}.@refill
8086
8087 @item @@findex @var{function}
8088 @findex findex
8089 Make an entry in the function index for @var{function}.@refill
8090
8091 @item @@vindex @var{variable}
8092 @findex vindex
8093 Make an entry in the variable index for @var{variable}.@refill
8094
8095 @item @@kindex @var{keystroke}
8096 @findex kindex
8097 Make an entry in the key index for @var{keystroke}.@refill
8098
8099 @item @@pindex @var{program}
8100 @findex pindex
8101 Make an entry in the program index for @var{program}.@refill
8102
8103 @item @@tindex @var{data type}
8104 @findex tindex
8105 Make an entry in the data type index for @var{data type}.@refill
8106 @end table
8107
8108 @quotation
8109 @strong{Caution:} Do not use a colon in an index entry. In Info, a
8110 colon separates the menu entry name from the node name. An extra
8111 colon confuses Info.
8112 @xref{Menu Parts, , The Parts of a Menu},
8113 for more information about the structure of a menu entry.@refill
8114 @end quotation
8115
8116 If you write several identical index entries in different places in a
8117 Texinfo file, the index in the printed manual will list all the pages to
8118 which those entries refer. However, the index in the Info file will
8119 list @strong{only} the node that references the @strong{first} of those
8120 index entries. Therefore, it is best to write indices in which each
8121 entry refers to only one place in the Texinfo file. Fortunately, this
8122 constraint is a feature rather than a loss since it means that the index
8123 will be easy to use. Otherwise, you could create an index that lists
8124 several pages for one entry and your reader would not know to which page
8125 to turn. If you have two identical entries for one topic, change the
8126 topics slightly, or qualify them to indicate the difference.@refill
8127
8128 You are not actually required to use the predefined indices for their
8129 canonical purposes. For example, suppose you wish to index some C
8130 preprocessor macros. You could put them in the function index along
8131 with actual functions, just by writing @code{@@findex} commands for
8132 them; then, when you print the ``Function Index'' as an unnumbered
8133 chapter, you could give it the title `Function and Macro Index' and
8134 all will be consistent for the reader. Or you could put the macros in
8135 with the data types by writing @code{@@tindex} commands for them, and
8136 give that index a suitable title so the reader will understand.
8137 (@xref{Printing Indices & Menus}.)@refill
8138
8139 @node Combining Indices, New Indices, Indexing Commands, Indices
8140 @comment node-name, next, previous, up
8141 @section Combining Indices
8142 @cindex Combining indices
8143 @cindex Indices, combining them
8144
8145 Sometimes you will want to combine two disparate indices such as functions
8146 and concepts, perhaps because you have few enough of one of them that
8147 a separate index for them would look silly.@refill
8148
8149 You could put functions into the concept index by writing
8150 @code{@@cindex} commands for them instead of @code{@@findex} commands,
8151 and produce a consistent manual by printing the concept index with the
8152 title `Function and Concept Index' and not printing the `Function
8153 Index' at all; but this is not a robust procedure. It works only if
8154 your document is never included as part of another
8155 document that is designed to have a separate function index; if your
8156 document were to be included with such a document, the functions from
8157 your document and those from the other would not end up together.
8158 Also, to make your function names appear in the right font in the
8159 concept index, you would need to enclose every one of them between
8160 the braces of @code{@@code}.@refill
8161
8162 @menu
8163 * syncodeindex:: How to merge two indices, using @code{@@code}
8164 font for the merged-from index.
8165 * synindex:: How to merge two indices, using the
8166 default font of the merged-to index.
8167 @end menu
8168
8169 @node syncodeindex, synindex, Combining Indices, Combining Indices
8170 @subsection @code{@@syncodeindex}
8171 @findex syncodeindex
8172
8173 When you want to combine functions and concepts into one index, you
8174 should index the functions with @code{@@findex} and index the concepts
8175 with @code{@@cindex}, and use the @code{@@syncodeindex} command to
8176 redirect the function index entries into the concept index.@refill
8177 @findex syncodeindex
8178
8179 The @code{@@syncodeindex} command takes two arguments; they are the name
8180 of the index to redirect, and the name of the index to redirect it to.
8181 The template looks like this:@refill
8182
8183 @example
8184 @@syncodeindex @var{from} @var{to}
8185 @end example
8186
8187 @cindex Predefined names for indices
8188 @cindex Two letter names for indices
8189 @cindex Indices, two letter names
8190 @cindex Names for indices
8191 For this purpose, the indices are given two-letter names:@refill
8192
8193 @table @samp
8194 @item cp
8195 concept index
8196 @item fn
8197 function index
8198 @item vr
8199 variable index
8200 @item ky
8201 key index
8202 @item pg
8203 program index
8204 @item tp
8205 data type index
8206 @end table
8207
8208 Write an @code{@@syncodeindex} command before or shortly after the
8209 end-of-header line at the beginning of a Texinfo file. For example,
8210 to merge a function index with a concept index, write the
8211 following:@refill
8212
8213 @example
8214 @@syncodeindex fn cp
8215 @end example
8216
8217 @noindent
8218 This will cause all entries designated for the function index to merge
8219 in with the concept index instead.@refill
8220
8221 To merge both a variables index and a function index into a concept
8222 index, write the following:@refill
8223
8224 @example
8225 @group
8226 @@syncodeindex vr cp
8227 @@syncodeindex fn cp
8228 @end group
8229 @end example
8230
8231 @cindex Fonts for indices
8232 The @code{@@syncodeindex} command puts all the entries from the `from'
8233 index (the redirected index) into the @code{@@code} font, overriding
8234 whatever default font is used by the index to which the entries are
8235 now directed. This way, if you direct function names from a function
8236 index into a concept index, all the function names are printed in the
8237 @code{@@code} font as you would expect.@refill
8238
8239 @node synindex, , syncodeindex, Combining Indices
8240 @subsection @code{@@synindex}
8241 @findex synindex
8242
8243 The @code{@@synindex} command is nearly the same as the
8244 @code{@@syncodeindex} command, except that it does not put the
8245 `from' index entries into the @code{@@code} font; rather it puts
8246 them in the roman font. Thus, you use @code{@@synindex} when you
8247 merge a concept index into a function index.@refill
8248
8249 @xref{Printing Indices & Menus}, for information about printing an index
8250 at the end of a book or creating an index menu in an Info file.@refill
8251
8252 @node New Indices, , Combining Indices, Indices
8253 @section Defining New Indices
8254 @cindex Defining new indices
8255 @cindex Indices, defining new
8256 @cindex New index defining
8257 @findex defindex
8258 @findex defcodeindex
8259
8260 In addition to the predefined indices, you may use the
8261 @code{@@defindex} and @code{@@defcodeindex} commands to define new
8262 indices. These commands create new indexing @@-commands with which
8263 you mark index entries. The @code{@@defindex }command is used like
8264 this:@refill
8265
8266 @example
8267 @@defindex @var{name}
8268 @end example
8269
8270 The name of an index should be a two letter word, such as @samp{au}.
8271 For example:@refill
8272
8273 @example
8274 @@defindex au
8275 @end example
8276
8277 This defines a new index, called the @samp{au} index. At the same
8278 time, it creates a new indexing command, @code{@@auindex}, that you
8279 can use to make index entries. Use the new indexing command just as
8280 you would use a predefined indexing command.@refill
8281
8282 For example, here is a section heading followed by a concept index
8283 entry and two @samp{au} index entries.@refill
8284
8285 @example
8286 @@section Cognitive Semantics
8287 @@cindex kinesthetic image schemas
8288 @@auindex Johnson, Mark
8289 @@auindex Lakoff, George
8290 @end example
8291
8292 @noindent
8293 (Evidently, @samp{au} serves here as an abbreviation for ``author''.)
8294 Texinfo constructs the new indexing command by concatenating the name
8295 of the index with @samp{index}; thus, defining an @samp{au} index
8296 leads to the automatic creation of an @code{@@auindex} command.@refill
8297
8298 Use the @code{@@printindex} command to print the index, as you do with
8299 the predefined indices. For example:@refill
8300
8301 @example
8302 @group
8303 @@node Author Index, Subject Index, , Top
8304 @@unnumbered Author Index
8305
8306 @@printindex au
8307 @end group
8308 @end example
8309
8310 The @code{@@defcodeindex} is like the @code{@@defindex} command, except
8311 that, in the printed output, it prints entries in an @code{@@code} font
8312 instead of a roman font. Thus, it parallels the @code{@@findex} command
8313 rather than the @code{@@cindex} command.@refill
8314
8315 You should define new indices within or right after the end-of-header
8316 line of a Texinfo file, before any @code{@@synindex} or
8317 @code{@@syncodeindex} commands (@pxref{Header}).@refill
8318
8319 @node Insertions, Glyphs, Indices, Top
8320 @comment node-name, next, previous, up
8321 @chapter Special Insertions
8322 @cindex Inserting special characters and symbols
8323 @cindex Special insertions
8324
8325 Texinfo provides several commands for formatting dimensions, for
8326 inserting single characters that have special meaning in Texinfo, such
8327 as braces, and for inserting special graphic symbols that do not
8328 correspond to characters, such as dots and bullets.@refill
8329
8330 @iftex
8331 These are:
8332
8333 @itemize @bullet
8334 @item
8335 Braces, @samp{@@} and periods.
8336
8337 @item
8338 Format a dimension, such as @samp{12@dmn{pt}}.
8339
8340 @item
8341 Dots and bullets.
8342
8343 @item
8344 The @TeX{} logo and the copyright symbol.
8345
8346 @item
8347 A minus sign.
8348 @end itemize
8349 @end iftex
8350
8351 @menu
8352 * Braces Atsigns Periods:: How to insert braces, @samp{@@} and periods.
8353 * dmn:: How to format a dimension.
8354 * Dots Bullets:: How to insert dots and bullets.
8355 * TeX and copyright:: How to insert the @TeX{} logo
8356 and the copyright symbol.
8357 * minus:: How to insert a minus sign.
8358 * math:: How to format a mathematical expression.
8359 @end menu
8360
8361 @node Braces Atsigns Periods, dmn, Insertions, Insertions
8362 @comment node-name, next, previous, up
8363 @section Inserting @samp{@@}, Braces, and Periods
8364 @cindex Inserting @@, braces, and periods
8365 @cindex Braces, inserting
8366 @cindex Periods, inserting
8367 @cindex Single characters, commands to insert
8368 @cindex Commands to insert single characters
8369
8370 @samp{@@} and curly braces are special characters in Texinfo. To
8371 insert these characters so they appear in text, you must put an @samp{@@} in front
8372 of these characters to prevent Texinfo from misinterpreting them.@refill
8373
8374 Periods are also special. Depending on whether the period is inside
8375 or at the end of a sentence, less or more space is inserted after a
8376 period in a typeset manual. Since it is not always possible for
8377 Texinfo to determine when a period ends a sentence and when it is used
8378 in an abbreviation, special commands are needed in some circumstances.
8379 (Usually, Texinfo can guess how to handle periods, so you do not need
8380 to use the special commands; you just enter a period as you would if
8381 you were using a typewriter, which means you put two spaces after the
8382 period, question mark, or exclamation mark that ends a
8383 sentence.)@refill
8384
8385 Do not put braces after any of these commands; they are not
8386 necessary.@refill
8387
8388 @menu
8389 * Inserting An Atsign::
8390 * Inserting Braces:: How to insert @samp{@{} and @samp{@}}
8391 * Controlling Spacing:: How to insert the right amount of space
8392 after punctuation within a sentence.
8393 @end menu
8394
8395 @node Inserting An Atsign, Inserting Braces, Braces Atsigns Periods, Braces Atsigns Periods
8396 @comment node-name, next, previous, up
8397 @subsection Inserting @samp{@@} with @@@@
8398 @findex @@ @r{(single @samp{@@})}
8399
8400 @code{@@@@} stands for a single @samp{@@} in either printed or Info
8401 output.@refill
8402
8403 Do not put braces after an @code{@@@@} command.@refill
8404
8405 @node Inserting Braces, Controlling Spacing, Inserting An Atsign, Braces Atsigns Periods
8406 @comment node-name, next, previous, up
8407 @subsection Inserting @samp{@{} and @samp{@}}with @@@{ and @@@}
8408 @findex @{ @r{(single @samp{@{})}
8409 @findex @} @r{(single @samp{@}})}
8410
8411 @code{@@@{} stands for a single @samp{@{} in either printed or Info
8412 output.@refill
8413
8414 @code{@@@}} stands for a single @samp{@}} in either printed or Info
8415 output.@refill
8416
8417 Do not put braces after either an @code{@@@{} or an @code{@@@}}
8418 command.@refill
8419
8420 @node Controlling Spacing, , Inserting Braces, Braces Atsigns Periods
8421 @comment node-name, next, previous, up
8422 @subsection Spacing After Colons and Periods
8423 @findex : @r{(suppress widening)}
8424
8425 Use the @code{@@:}@: command after a period, question mark,
8426 exclamation mark, or colon that should not be followed by extra space.
8427 For example, use @code{@@:}@: after periods that end abbreviations
8428 which are not at the ends of sentences. @code{@@:}@: has no effect on
8429 the Info file output.@refill
8430
8431 @need 700
8432 For example,
8433
8434 @example
8435 The s.o.p.@@: has three parts @dots{}
8436 The s.o.p. has three parts @dots{}
8437 @end example
8438
8439 @noindent
8440 @ifinfo
8441 produces
8442 @end ifinfo
8443 @iftex
8444 produces the following. If you look carefully at this printed output,
8445 you will see a little more whitespace after @samp{s.o.p.} in the second
8446 line.@refill
8447 @end iftex
8448
8449 @quotation
8450 The s.o.p.@: has three parts @dots{}@*
8451 The s.o.p. has three parts @dots{}
8452 @end quotation
8453
8454 @noindent
8455 @kbd{@@:} has no effect on the Info output. (@samp{s.o.p} is an acronym
8456 for ``Standard Operating Procedure''.)
8457
8458 @findex . @r{(true end of sentence)}
8459 Use @code{@@.}@: instead of a period at the end of a sentence that
8460 ends with a single capital letter. Otherwise, @TeX{} will think the
8461 letter is an abbreviation and will not insert the correct
8462 end-of-sentence spacing. Here is an example:@refill
8463
8464 @example
8465 Give it to M.I.B. and to M.E.W@@. Also, give it to R.J.C@@.
8466 Give it to M.I.B. and to M.E.W. Also, give it to R.J.C.
8467 @end example
8468
8469 @noindent
8470 @ifinfo
8471 produces
8472 @end ifinfo
8473 @iftex
8474 produces the following. If you look carefully at this printed output,
8475 you will see a little more whitespace after the @samp{W} in the first
8476 line.@refill
8477 @end iftex
8478
8479 @quotation
8480 Give it to M.I.B. and to M.E.W@. Also, give it to R.J.C@.@*
8481 Give it to M.I.B. and to M.E.W. Also, give it to R.J.C.
8482 @end quotation
8483
8484 In the Info file output, @code{@@.}@: is equivalent to a simple
8485 @samp{.}.@refill
8486
8487 The meanings of @code{@@:}@: and @code{@@.}@: in Texinfo are designed
8488 to work well with the Emacs sentence motion commands. This made it
8489 necessary for them to be incompatible with some other formatting
8490 systems that use @@-commands.@refill
8491
8492 Do not put braces after either an @code{@@:} or an @code{@@.} command.@refill
8493
8494 @node dmn, Dots Bullets, Braces Atsigns Periods, Insertions
8495 @section @code{@@dmn}@{@var{dimension}@}: Format a Dimension
8496 @cindex Thin space between number, dimension
8497 @cindex Dimension formatting
8498 @cindex Format a dimension
8499 @findex dmn
8500
8501 At times, you may want to write @samp{12@dmn{pt}} or
8502 @samp{8.5@dmn{in}} with little or no space between the number and the
8503 abbreviation for the dimension. You can use the @code{@@dmn} command
8504 to do this. On seeing the command, @TeX{} inserts just enough space
8505 for proper typesetting; the Info formatting commands insert no space
8506 at all, since the Info file does not require it.@refill
8507
8508 To use the @code{@@dmn} command, write the number and then follow it
8509 immediately, with no intervening space, by @code{@@dmn}, and then by
8510 the dimension within braces.@refill
8511
8512 @need 700
8513 @noindent
8514 For example,
8515
8516 @example
8517 A4 paper is 8.27@@dmn@{in@} wide.
8518 @end example
8519
8520 @noindent
8521 produces
8522
8523 @quotation
8524 A4 paper is 8.27@dmn{in} wide.
8525 @end quotation
8526
8527 Not everyone uses this style. Instead of writing
8528 @w{@samp{8.27@@dmn@{in@}}} in the Texinfo file, you may write
8529 @w{@samp{8.27 in.}} or @w{@samp{8.27 inches}}. (In these cases, the
8530 formatters may insert a line break between the number and the
8531 dimension. Also, if you write a period after an abbreviation within a
8532 sentence, you should write @samp{@@:} after the period to prevent
8533 @TeX{} from inserting extra whitespace. @xref{Controlling Spacing, ,
8534 Spacing After Colons and Periods}.)@refill
8535
8536 @node Dots Bullets, TeX and copyright, dmn, Insertions
8537 @comment node-name, next, previous, up
8538 @section Inserting Ellipsis, Dots, and Bullets
8539 @cindex Dots, inserting
8540 @cindex Bullets, inserting
8541 @cindex Ellipsis, inserting
8542 @cindex Inserting ellipsis
8543 @cindex Inserting dots
8544 @cindex Special typesetting commands
8545 @cindex Typesetting commands for dots, etc.
8546
8547 An @dfn{ellipsis} (a line of dots) is not typeset as a string of
8548 periods, so a special command is used for ellipsis in Texinfo. The
8549 @code{@@bullet} command is special, too. Each of these commands is
8550 followed by a pair of braces, @samp{@{@}}, without any whitespace
8551 between the name of the command and the braces. (You need to use braces
8552 with these commands because you can use them next to other text; without
8553 the braces, the formatters would be confused. @xref{Command Syntax, ,
8554 @@-Command Syntax}, for further information.)@refill
8555
8556 @menu
8557 * dots:: How to insert dots @dots{}
8558 * bullet:: How to insert a bullet.
8559 @end menu
8560
8561 @node dots, bullet, Dots Bullets, Dots Bullets
8562 @comment node-name, next, previous, up
8563 @subsection @code{@@dots}@{@}
8564 @findex dots
8565 @cindex Inserting dots
8566 @cindex Dots, inserting
8567
8568 Use the @code{@@dots@{@}} command to generate an ellipsis, which is
8569 three dots in a row, appropriately spaced, like this: `@dots{}'. Do
8570 not simply write three periods in the input file; that would work for
8571 the Info file output, but would produce the wrong amount of space
8572 between the periods in the printed manual.@refill
8573
8574 Similarly, the @code{@@enddots@{@}} command helps you correctly set an
8575 end-of-sentence ellipsis (four dots).
8576
8577 @iftex
8578 Here is an ellipsis: @dots{}
8579
8580 Here are three periods in a row: ...
8581
8582 In printed output, the three periods in a row are closer together than
8583 the dots in the ellipsis.
8584 @end iftex
8585
8586 @node bullet, , dots, Dots Bullets
8587 @comment node-name, next, previous, up
8588 @subsection @code{@@bullet}@{@}
8589 @findex bullet
8590
8591 Use the @code{@@bullet@{@}} command to generate a large round dot, or
8592 the closest possible thing to one. In Info, an asterisk is used.@refill
8593
8594 Here is a bullet: @bullet{}
8595
8596 When you use @code{@@bullet} in @code{@@itemize}, you do not need to
8597 type the braces, because @code{@@itemize} supplies them.
8598 (@xref{itemize, , @code{@@itemize}}.)@refill
8599
8600 @node TeX and copyright, minus, Dots Bullets, Insertions
8601 @comment node-name, next, previous, up
8602 @section Inserting @TeX{} and the Copyright Symbol
8603
8604 The logo `@TeX{}' is typeset in a special fashion and it needs an
8605 @@-command. The copyright symbol, `@copyright{}', is also special.
8606 Each of these commands is followed by a pair of braces, @samp{@{@}},
8607 without any whitespace between the name of the command and the
8608 braces.@refill
8609
8610 @menu
8611 * tex:: How to insert the @TeX{} logo.
8612 * copyright symbol:: How to use @code{@@copyright}@{@}.
8613 @end menu
8614
8615 @node tex, copyright symbol, TeX and copyright, TeX and copyright
8616 @comment node-name, next, previous, up
8617 @subsection @code{@@TeX}@{@}
8618 @findex tex (command)
8619
8620 Use the @code{@@TeX@{@}} command to generate `@TeX{}'. In a printed
8621 manual, this is a special logo that is different from three ordinary
8622 letters. In Info, it just looks like @samp{TeX}. The
8623 @code{@@TeX@{@}} command is unique among Texinfo commands in that the
8624 @key{T} and the @key{X} are in upper case.@refill
8625
8626 @node copyright symbol, , tex, TeX and copyright
8627 @comment node-name, next, previous, up
8628 @subsection @code{@@copyright}@{@}
8629 @findex copyright
8630
8631 Use the @code{@@copyright@{@}} command to generate `@copyright{}'. In
8632 a printed manual, this is a @samp{c} inside a circle, and in Info,
8633 this is @samp{(C)}.@refill
8634
8635 @node minus, math, TeX and copyright, Insertions
8636 @section @code{@@minus}@{@}: Inserting a Minus Sign
8637 @findex minus
8638
8639 Use the @code{@@minus@{@}} command to generate a minus sign. In a
8640 fixed-width font, this is a single hyphen, but in a proportional font,
8641 the symbol is the customary length for a minus sign---a little longer
8642 than a hyphen.@refill
8643
8644 You can compare the two forms:
8645
8646 @display
8647 @samp{@minus{}} is a minus sign generated with @samp{@@minus@{@}},
8648
8649 `-' is a hyphen generated with the character @samp{-}.
8650 @end display
8651
8652 @noindent
8653 In the fixed-width font used by Info, @code{@@minus@{@}} is the same
8654 as a hyphen.@refill
8655
8656 You should not use @code{@@minus@{@}} inside @code{@@code} or
8657 @code{@@example} because the width distinction is not made in the
8658 fixed-width font they use.@refill
8659
8660 When you use @code{@@minus} to specify the mark beginning each entry in
8661 an itemized list, you do not need to type the braces
8662 (@pxref{itemize, , @code{@@itemize}}.)@refill
8663
8664 @node math, , minus, Insertions
8665 @comment node-name, next, previous, up
8666 @section @code{@@math}: Inserting Mathematical Expressions
8667 @findex math
8668 @cindex Mathematical expressions
8669
8670 You can write a short mathematical expression with the @code{@@math}
8671 command. Write the mathematical expression between braces, like this:
8672
8673 @example
8674 @@math@{(a + b)(a + b) = a^2 + 2ab + b^2@}
8675 @end example
8676
8677 @iftex
8678 @need 1000
8679 @noindent
8680 This produces the following in @TeX{}:
8681
8682 @display
8683 @math{(a + b)(a + b) = a^2 + 2ab + b^2}
8684 @end display
8685
8686 @noindent
8687 and the following in Info:
8688 @end iftex
8689 @ifinfo
8690 @noindent
8691 This produces the following in Info:
8692 @end ifinfo
8693
8694 @example
8695 (a + b)(a + b) = a^2 + 2ab + b^2
8696 @end example
8697
8698 The @code{@@math} command has no effect on the Info output. Currently,
8699 it has limited effect on typeset output. However, this may change since
8700 @TeX{} itself is designed for mathematical typesetting and does a
8701 splendid job.
8702
8703 Certainly, for complex mathematical expressions, you could use @TeX{}
8704 directly. @xref{Using Ordinary TeX Commands, , Using Ordinary @TeX{}
8705 Commands}. When you use @TeX{} directly, remember to write the
8706 mathematical expression between one or two @samp{$} (dollar-signs) as
8707 appropriate.
8708
8709 @node Glyphs, Breaks, Insertions, Top
8710 @comment node-name, next, previous, up
8711 @chapter Glyphs for Examples
8712 @cindex Glyphs
8713
8714 In Texinfo, code is often illustrated in examples that are delimited
8715 by @code{@@example} and @code{@@end example}, or by @code{@@lisp} and
8716 @code{@@end lisp}. In such examples, you can indicate the results of
8717 evaluation or an expansion using @samp{@result{}} or
8718 @samp{@expansion{}}. Likewise, there are commands to insert glyphs
8719 to indicate
8720 printed output, error messages, equivalence of expressions, and the
8721 location of point.@refill
8722
8723 The glyph-insertion commands do not need to be used within an example, but
8724 most often they are. Every glyph-insertion command is followed by a pair of
8725 left- and right-hand braces.@refill
8726
8727 @menu
8728 * Glyphs Summary::
8729 * result:: How to show the result of expression.
8730 * expansion:: How to indicate an expansion.
8731 * Print Glyph:: How to indicate printed output.
8732 * Error Glyph:: How to indicate an error message.
8733 * Equivalence:: How to indicate equivalence.
8734 * Point Glyph:: How to indicate the location of point.
8735 @end menu
8736
8737 @node Glyphs Summary, result, Glyphs, Glyphs
8738 @ifinfo
8739 @heading Glyphs Summary
8740
8741 Here are the different glyph commands:@refill
8742 @end ifinfo
8743
8744 @table @asis
8745 @item @result{}
8746 @code{@@result@{@}} points to the result of an expression.@refill
8747
8748 @item @expansion{}
8749 @code{@@expansion@{@}} shows the results of a macro expansion.@refill
8750
8751 @item @print{}
8752 @code{@@print@{@}} indicates printed output.@refill
8753
8754 @item @error{}
8755 @code{@@error@{@}} indicates that the following text is an error
8756 message.@refill
8757
8758 @item @equiv{}
8759 @code{@@equiv@{@}} indicates the exact equivalence of two forms.@refill
8760
8761 @item @point{}
8762 @code{@@point@{@}} shows the location of point.@refill
8763 @end table
8764
8765 @node result, expansion, Glyphs Summary, Glyphs
8766 @section @result{}: Indicating Evaluation
8767 @cindex Result of an expression
8768 @cindex Indicating evaluation
8769 @cindex Evaluation glyph
8770 @cindex Value of an expression, indicating
8771
8772 Use the @code{@@result@{@}} command to indicate the result of
8773 evaluating an expression.@refill
8774
8775 @iftex
8776 The @code{@@result@{@}} command is displayed as @samp{=>} in Info and
8777 as @samp{@result{}} in the printed output.
8778 @end iftex
8779 @ifinfo
8780 The @code{@@result@{@}} command is displayed as @samp{@result{}} in Info
8781 and as a double stemmed arrow in the printed output.@refill
8782 @end ifinfo
8783
8784 Thus, the following,
8785
8786 @lisp
8787 (cdr '(1 2 3))
8788 @result{} (2 3)
8789 @end lisp
8790
8791 @noindent
8792 may be read as ``@code{(cdr '(1 2 3))} evaluates to @code{(2 3)}''.
8793
8794 @node expansion, Print Glyph, result, Glyphs
8795 @section @expansion{}: Indicating an Expansion
8796 @cindex Expansion, indicating it
8797
8798 When an expression is a macro call, it expands into a new expression.
8799 You can indicate the result of the expansion with the
8800 @code{@@expansion@{@}} command.@refill
8801
8802 @iftex
8803 The @code{@@expansion@{@}} command is displayed as @samp{==>} in Info and
8804 as @samp{@expansion{}} in the printed output.
8805 @end iftex
8806 @ifinfo
8807 The @code{@@expansion@{@}} command is displayed as @samp{@expansion{}}
8808 in Info and as a long arrow with a flat base in the printed output.@refill
8809 @end ifinfo
8810
8811 @need 700
8812 For example, the following
8813
8814 @example
8815 @group
8816 @@lisp
8817 (third '(a b c))
8818 @@expansion@{@} (car (cdr (cdr '(a b c))))
8819 @@result@{@} c
8820 @@end lisp
8821 @end group
8822 @end example
8823
8824 @noindent
8825 produces
8826
8827 @lisp
8828 @group
8829 (third '(a b c))
8830 @expansion{} (car (cdr (cdr '(a b c))))
8831 @result{} c
8832 @end group
8833 @end lisp
8834
8835 @noindent
8836 which may be read as:
8837
8838 @quotation
8839 @code{(third '(a b c))} expands to @code{(car (cdr (cdr '(a b c))))};
8840 the result of evaluating the expression is @code{c}.
8841 @end quotation
8842
8843 @noindent
8844 Often, as in this case, an example looks better if the
8845 @code{@@expansion@{@}} and @code{@@result@{@}} commands are indented
8846 five spaces.@refill
8847
8848 @node Print Glyph, Error Glyph, expansion, Glyphs
8849 @section @print{}: Indicating Printed Output
8850 @cindex Printed output, indicating it
8851
8852 Sometimes an expression will print output during its execution. You
8853 can indicate the printed output with the @code{@@print@{@}} command.@refill
8854
8855 @iftex
8856 The @code{@@print@{@}} command is displayed as @samp{-|} in Info and
8857 as @samp{@print{}} in the printed output.
8858 @end iftex
8859 @ifinfo
8860 The @code{@@print@{@}} command is displayed as @samp{@print{}} in Info
8861 and similarly, as a horizontal dash butting against a vertical bar, in
8862 the printed output.@refill
8863 @end ifinfo
8864
8865 In the following example, the printed text is indicated with
8866 @samp{@print{}}, and the value of the expression follows on the
8867 last line.@refill
8868
8869 @lisp
8870 @group
8871 (progn (print 'foo) (print 'bar))
8872 @print{} foo
8873 @print{} bar
8874 @result{} bar
8875 @end group
8876 @end lisp
8877
8878 @noindent
8879 In a Texinfo source file, this example is written as follows:
8880
8881 @lisp
8882 @group
8883 @@lisp
8884 (progn (print 'foo) (print 'bar))
8885 @@print@{@} foo
8886 @@print@{@} bar
8887 @@result@{@} bar
8888 @@end lisp
8889 @end group
8890 @end lisp
8891
8892 @node Error Glyph, Equivalence, Print Glyph, Glyphs
8893 @section @error{}: Indicating an Error Message
8894 @cindex Error message, indicating it
8895
8896 A piece of code may cause an error when you evaluate it. You can
8897 designate the error message with the @code{@@error@{@}} command.@refill
8898
8899 @iftex
8900 The @code{@@error@{@}} command is displayed as @samp{error-->} in Info
8901 and as @samp{@error{}} in the printed output.
8902 @end iftex
8903 @ifinfo
8904 The @code{@@error@{@}} command is displayed as @samp{@error{}} in Info
8905 and as the word `error' in a box in the printed output.@refill
8906 @end ifinfo
8907
8908 @need 700
8909 Thus,
8910
8911 @example
8912 @@lisp
8913 (+ 23 'x)
8914 @@error@{@} Wrong type argument: integer-or-marker-p, x
8915 @@end lisp
8916 @end example
8917
8918 @noindent
8919 produces
8920
8921 @lisp
8922 (+ 23 'x)
8923 @error{} Wrong type argument: integer-or-marker-p, x
8924 @end lisp
8925
8926 @noindent
8927 This indicates that the following error message is printed
8928 when you evaluate the expression:
8929
8930 @lisp
8931 Wrong type argument: integer-or-marker-p, x
8932 @end lisp
8933
8934 Note that @samp{@error{}} itself is not part of the error
8935 message.
8936
8937 @node Equivalence, Point Glyph, Error Glyph, Glyphs
8938 @section @equiv{}: Indicating Equivalence
8939 @cindex Equivalence, indicating it
8940
8941 Sometimes two expressions produce identical results. You can indicate the
8942 exact equivalence of two forms with the @code{@@equiv@{@}} command.@refill
8943
8944 @iftex
8945 The @code{@@equiv@{@}} command is displayed as @samp{==} in Info and
8946 as @samp{@equiv{}} in the printed output.
8947 @end iftex
8948 @ifinfo
8949 The @code{@@equiv@{@}} command is displayed as @samp{@equiv{}} in Info
8950 and as a three parallel horizontal lines in the printed output.@refill
8951 @end ifinfo
8952
8953 Thus,
8954
8955 @example
8956 @@lisp
8957 (make-sparse-keymap) @@equiv@{@} (list 'keymap)
8958 @@end lisp
8959 @end example
8960
8961 @noindent
8962 produces
8963
8964 @lisp
8965 (make-sparse-keymap) @equiv{} (list 'keymap)
8966 @end lisp
8967
8968 @noindent
8969 This indicates that evaluating @code{(make-sparse-keymap)} produces
8970 identical results to evaluating @code{(list 'keymap)}.
8971
8972 @c Cannot write point command here because it causes trouble with TOC.
8973 @node Point Glyph, , Equivalence, Glyphs
8974 @section Indicating Point in a Buffer
8975 @cindex Point, indicating it in a buffer
8976
8977 Sometimes you need to show an example of text in an Emacs buffer. In
8978 such examples, the convention is to include the entire contents of the
8979 buffer in question between two lines of dashes containing the buffer
8980 name.@refill
8981
8982 You can use the @samp{@@point@{@}} command to show the location of point
8983 in the text in the buffer. (The symbol for point, of course, is not
8984 part of the text in the buffer; it indicates the place @emph{between}
8985 two characters where point is located.)@refill
8986
8987 @iftex
8988 The @code{@@point@{@}} command is displayed as @samp{-!-} in Info and
8989 as @samp{@point{}} in the printed output.
8990 @end iftex
8991 @ifinfo
8992 The @code{@@point@{@}} command is displayed as @samp{@point{}} in Info
8993 and as a small five pointed star in the printed output.@refill
8994 @end ifinfo
8995
8996 The following example shows the contents of buffer @file{foo} before
8997 and after evaluating a Lisp command to insert the word @code{changed}.@refill
8998
8999 @example
9000 @group
9001 ---------- Buffer: foo ----------
9002 This is the @point{}contents of foo.
9003 ---------- Buffer: foo ----------
9004
9005 @end group
9006 @end example
9007
9008 @example
9009 @group
9010 (insert "changed ")
9011 @result{} nil
9012 ---------- Buffer: foo ----------
9013 This is the changed @point{}contents of foo.
9014 ---------- Buffer: foo ----------
9015
9016 @end group
9017 @end example
9018
9019 In a Texinfo source file, the example is written like this:@refill
9020
9021 @example
9022 @@example
9023 ---------- Buffer: foo ----------
9024 This is the @@point@{@}contents of foo.
9025 ---------- Buffer: foo ----------
9026
9027 (insert "changed ")
9028 @@result@{@} nil
9029 ---------- Buffer: foo ----------
9030 This is the changed @@point@{@}contents of foo.
9031 ---------- Buffer: foo ----------
9032 @@end example
9033 @end example
9034
9035 @node Breaks, Definition Commands, Glyphs, Top
9036 @comment node-name, next, previous, up
9037 @chapter Making and Preventing Breaks
9038 @cindex Making line and page breaks
9039 @cindex Preventing line and page breaks
9040
9041 Usually, a Texinfo file is processed both by @TeX{} and by one of the
9042 Info formatting commands. Line, paragraph, or page breaks sometimes
9043 occur in the `wrong' place in one or other form of output. You must
9044 ensure that text looks right both in the printed manual and in the
9045 Info file.@refill
9046
9047 For example, in a printed manual, page breaks may occur awkwardly in
9048 the middle of an example; to prevent this, you can hold text together
9049 using a grouping command that keeps the text from being split across
9050 two pages. Conversely, you may want to force a page break where none
9051 would occur normally. Fortunately, problems like these do not often
9052 arise. When they do, use the break, break prevention, or pagination
9053 commands.@refill
9054
9055 @menu
9056 * Break Commands:: Cause and prevent splits.
9057 * Line Breaks:: How to force a single line to use two lines.
9058 * w:: How to prevent unwanted line breaks.
9059 * sp:: How to insert blank lines.
9060 * page:: How to force the start of a new page.
9061 * group:: How to prevent unwanted page breaks.
9062 * need:: Another way to prevent unwanted page breaks.
9063 @end menu
9064
9065 @ifinfo
9066 @node Break Commands, Line Breaks, Breaks, Breaks
9067 @heading The Break Commands
9068 @end ifinfo
9069 @iftex
9070 @sp 1
9071 @end iftex
9072
9073 The break commands create line and paragraph breaks:@refill
9074
9075 @table @code
9076 @item @@*
9077 Force a line break.
9078
9079 @item @@sp @var{n}
9080 Skip @var{n} blank lines.@refill
9081 @end table
9082 @iftex
9083 @sp 1
9084 @end iftex
9085
9086 The line-break-prevention command holds text together all on one
9087 line:@refill
9088
9089 @table @code
9090 @item @@w@{@var{text}@}
9091 Prevent @var{text} from being split and hyphenated across two lines.@refill
9092 @end table
9093 @iftex
9094 @sp 1
9095 @end iftex
9096
9097 The pagination commands apply only to printed output, since Info
9098 files do not have pages.@refill
9099
9100 @table @code
9101 @item @@page
9102 Start a new page in the printed manual.@refill
9103
9104 @item @@group
9105 Hold text together that must appear on one printed page.@refill
9106
9107 @item @@need @var{mils}
9108 Start a new printed page if not enough space on this one.@refill
9109 @end table
9110
9111 @node Line Breaks, w, Break Commands, Breaks
9112 @comment node-name, next, previous, up
9113 @section @code{@@*}: Generate Line Breaks
9114 @findex * @r{(force line break)}
9115 @cindex Line breaks
9116 @cindex Breaks in a line
9117
9118 The @code{@@*} command forces a line break in both the printed manual and
9119 in Info.@refill
9120
9121 @need 700
9122 For example,
9123
9124 @example
9125 This line @@* is broken @@*in two places.
9126 @end example
9127
9128 @noindent
9129 produces
9130
9131 @example
9132 @group
9133 This line
9134 is broken
9135 in two places.
9136 @end group
9137 @end example
9138
9139 @noindent
9140 (Note that the space after the first @code{@@*} command is faithfully
9141 carried down to the next line.)@refill
9142
9143 @need 800
9144 The @code{@@*} command is often used in a file's copyright page:@refill
9145
9146 @example
9147 @group
9148 This is edition 2.0 of the Texinfo documentation,@@*
9149 and is for @dots{}
9150 @end group
9151 @end example
9152
9153 @noindent
9154 In this case, the @code{@@*} command keeps @TeX{} from stretching the
9155 line across the whole page in an ugly manner.@refill
9156
9157 @quotation
9158 @strong{Please note:} Do not write braces after an @code{@@*} command;
9159 they are not needed.@refill
9160
9161 Do not write an @code{@@refill} command at the end of a paragraph
9162 containing an @code{@@*} command; it will cause the paragraph to be
9163 refilled after the line break occurs, negating the effect of the line
9164 break.@refill
9165 @end quotation
9166
9167 @node w, sp, Line Breaks, Breaks
9168 @comment node-name, next, previous, up
9169 @section @code{@@w}@{@var{text}@}: Prevent Line Breaks
9170 @findex w @r{(prevent line break)}
9171 @cindex Line breaks, preventing
9172
9173 @code{@@w@{@var{text}@}} outputs @var{text} and prohibits line breaks
9174 within @var{text}.@refill
9175
9176 You can use the @code{@@w} command to prevent @TeX{} from automatically
9177 hyphenating a long name or phrase that accidentally falls near the end
9178 of a line.@refill
9179
9180 @example
9181 You can copy GNU software from @@w@{@@file@{prep.ai.mit.edu@}@}.
9182 @end example
9183
9184 @noindent
9185 produces
9186
9187 @quotation
9188 You can copy GNU software from @w{@file{prep.ai.mit.edu}}.
9189 @end quotation
9190
9191 In the Texinfo file, you must write the @code{@@w} command and its
9192 argument (all the affected text) all on one line.@refill
9193
9194 @quotation
9195 @strong{Caution:} Do not write an @code{@@refill} command at the end
9196 of a paragraph containing an @code{@@w} command; it will cause the
9197 paragraph to be refilled and may thereby negate the effect of the
9198 @code{@@w} command.@refill
9199 @end quotation
9200
9201 @node sp, page, w, Breaks
9202 @comment node-name, next, previous, up
9203 @section @code{@@sp} @var{n}: Insert Blank Lines
9204 @findex sp @r{(line spacing)}
9205 @cindex Spaces (blank lines)
9206 @cindex Blank lines
9207 @cindex Line spacing
9208
9209 A line beginning with and containing only @code{@@sp @var{n}}
9210 generates @var{n} blank lines of space in both the printed manual and
9211 the Info file. @code{@@sp} also forces a paragraph break. For
9212 example,@refill
9213
9214 @example
9215 @@sp 2
9216 @end example
9217
9218 @noindent
9219 generates two blank lines.
9220
9221 The @code{@@sp} command is most often used in the title page.@refill
9222
9223 @ignore
9224 @c node br, page, sp, Breaks
9225 @comment node-name, next, previous, up
9226 @c section @code{@@br}: Generate Paragraph Breaks
9227 @findex br @r{(paragraph breaks)}
9228 @cindex Paragraph breaks
9229 @cindex Breaks in a paragraph
9230
9231 The @code{@@br} command forces a paragraph break. It inserts a blank
9232 line. You can use the command within or at the end of a line. If
9233 used within a line, the @code{@@br@{@}} command must be followed by
9234 left and right braces (as shown here) to mark the end of the
9235 command.@refill
9236
9237 @need 700
9238 For example,
9239
9240 @example
9241 @group
9242 This line @@br@{@}contains and is ended by paragraph breaks@@br
9243 and is followed by another line.
9244 @end group
9245 @end example
9246
9247 @noindent
9248 produces
9249
9250 @example
9251 @group
9252 This line
9253
9254 contains and is ended by paragraph breaks
9255
9256 and is followed by another line.
9257 @end group
9258 @end example
9259
9260 The @code{@@br} command is seldom used.
9261 @end ignore
9262
9263 @node page, group, sp, Breaks
9264 @comment node-name, next, previous, up
9265 @section @code{@@page}: Start a New Page
9266 @cindex Page breaks
9267 @findex page
9268
9269 A line containing only @code{@@page} starts a new page in a printed
9270 manual. The command has no effect on Info files since they are not
9271 paginated. An @code{@@page} command is often used in the @code{@@titlepage}
9272 section of a Texinfo file to start the copyright page.@refill
9273
9274 @node group, need, page, Breaks
9275 @comment node-name, next, previous, up
9276 @section @code{@@group}: Prevent Page Breaks
9277 @cindex Group (hold text together vertically)
9278 @cindex Holding text together vertically
9279 @cindex Vertically holding text together
9280 @findex group
9281
9282 The @code{@@group} command (on a line by itself) is used inside an
9283 @code{@@example} or similar construct to begin an unsplittable vertical
9284 group, which will appear entirely on one page in the printed output.
9285 The group is terminated by a line containing only @code{@@end group}.
9286 These two lines produce no output of their own, and in the Info file
9287 output they have no effect at all.@refill
9288
9289 @c Once said that these environments
9290 @c turn off vertical spacing between ``paragraphs''.
9291 @c Also, quotation used to work, but doesn't in texinfo-2.72
9292 Although @code{@@group} would make sense conceptually in a wide
9293 variety of contexts, its current implementation works reliably only
9294 within @code{@@example} and variants, and within @code{@@display},
9295 @code{@@format}, @code{@@flushleft} and @code{@@flushright}.
9296 @xref{Quotations and Examples}. (What all these commands have in
9297 common is that each line of input produces a line of output.) In
9298 other contexts, @code{@@group} can cause anomalous vertical
9299 spacing.@refill
9300
9301 @need 750
9302 This formatting requirement means that you should write:
9303
9304 @example
9305 @group
9306 @@example
9307 @@group
9308 @dots{}
9309 @@end group
9310 @@end example
9311 @end group
9312 @end example
9313
9314 @noindent
9315 with the @code{@@group} and @code{@@end group} commands inside the
9316 @code{@@example} and @code{@@end example} commands.
9317
9318 The @code{@@group} command is most often used to hold an example
9319 together on one page. In this Texinfo manual, more than 100 examples
9320 contain text that is enclosed between @code{@@group} and @code{@@end
9321 group}.
9322
9323 If you forget to end a group, you may get strange and unfathomable
9324 error messages when you run @TeX{}. This is because @TeX{} keeps
9325 trying to put the rest of the Texinfo file onto the one page and does
9326 not start to generate error messages until it has processed
9327 considerable text. It is a good rule of thumb to look for a missing
9328 @code{@@end group} if you get incomprehensible error messages in
9329 @TeX{}.@refill
9330
9331 @node need, , group, Breaks
9332 @comment node-name, next, previous, up
9333 @section @code{@@need @var{mils}}: Prevent Page Breaks
9334 @cindex Need space at page bottom
9335 @findex need
9336
9337 A line containing only @code{@@need @var{n}} starts
9338 a new page in a printed manual if fewer than @var{n} mils (thousandths
9339 of an inch) remain on the current page. Do not use
9340 braces around the argument @var{n}. The @code{@@need} command has no
9341 effect on Info files since they are not paginated.@refill
9342
9343 @need 800
9344 This paragraph is preceded by an @code{@@need} command that tells
9345 @TeX{} to start a new page if fewer than 800 mils (eight-tenths
9346 inch) remain on the page. It looks like this:@refill
9347
9348 @example
9349 @group
9350 @@need 800
9351 This paragraph is preceded by @dots{}
9352 @end group
9353 @end example
9354
9355 The @code{@@need} command is useful for preventing orphans (single
9356 lines at the bottoms of printed pages).@refill
9357
9358 @node Definition Commands, Footnotes, Breaks, Top
9359 @chapter Definition Commands
9360 @cindex Definition commands
9361
9362 The @code{@@deffn} command and the other @dfn{definition commands}
9363 enable you to describe functions, variables, macros, commands, user
9364 options, special forms and other such artifacts in a uniform
9365 format.@refill
9366
9367 In the Info file, a definition causes the entity
9368 category---`Function', `Variable', or whatever---to appear at the
9369 beginning of the first line of the definition, followed by the
9370 entity's name and arguments. In the printed manual, the command
9371 causes @TeX{} to print the entity's name and its arguments on the left
9372 margin and print the category next to the right margin. In both
9373 output formats, the body of the definition is indented. Also, the
9374 name of the entity is entered into the appropriate index:
9375 @code{@@deffn} enters the name into the index of functions,
9376 @code{@@defvr} enters it into the index of variables, and so
9377 on.@refill
9378
9379 A manual need not and should not contain more than one definition for
9380 a given name. An appendix containing a summary should use
9381 @code{@@table} rather than the definition commands.@refill
9382
9383 @menu
9384 * Def Cmd Template:: How to structure a description using a
9385 definition command.
9386 * Optional Arguments:: How to handle optional and repeated arguments.
9387 * deffnx:: How to group two or more `first' lines.
9388 * Def Cmds in Detail:: All the definition commands.
9389 * Def Cmd Conventions:: Conventions for writing definitions.
9390 * Sample Function Definition::
9391 @end menu
9392
9393 @node Def Cmd Template, Optional Arguments, Definition Commands, Definition Commands
9394 @section The Template for a Definition
9395 @cindex Definition template
9396 @cindex Template for a definition
9397
9398 The @code{@@deffn} command is used for definitions of entities that
9399 resemble functions. To write a definition using the @code{@@deffn}
9400 command, write the @code{@@deffn} command at the beginning of a line
9401 and follow it on the same line by the category of the entity, the name
9402 of the entity itself, and its arguments (if any). Then write the body
9403 of the definition on succeeding lines. (You may embed examples in the
9404 body.) Finally, end the definition with an @code{@@end deffn} command
9405 written on a line of its own. (The other definition commands follow
9406 the same format.)@refill
9407
9408 The template for a definition looks like this:
9409
9410 @example
9411 @group
9412 @@deffn @var{category} @var{name} @var{arguments}@dots{}
9413 @var{body-of-definition}
9414 @@end deffn
9415 @end group
9416 @end example
9417
9418 @need 700
9419 @noindent
9420 For example,
9421
9422 @example
9423 @group
9424 @@deffn Command forward-word count
9425 This command moves point forward @@var@{count@} words
9426 (or backward if @@var@{count@} is negative). @dots{}
9427 @@end deffn
9428 @end group
9429 @end example
9430
9431 @noindent
9432 produces
9433
9434 @quotation
9435 @deffn Command forward-word count
9436 This function moves point forward @var{count} words
9437 (or backward if @var{count} is negative). @dots{}
9438 @end deffn
9439 @end quotation
9440
9441 Capitalize the category name like a title. If the name of the
9442 category contains spaces, as in the phrase `Interactive Command',
9443 write braces around it. For example:@refill
9444
9445 @example
9446 @group
9447 @@deffn @{Interactive Command@} isearch-forward
9448 @dots{}
9449 @@end deffn
9450 @end group
9451 @end example
9452
9453 @noindent
9454 Otherwise, the second word will be mistaken for the name of the
9455 entity.@refill
9456
9457 Some of the definition commands are more general than others. The
9458 @code{@@deffn} command, for example, is the general definition command
9459 for functions and the like---for entities that may take arguments. When
9460 you use this command, you specify the category to which the entity
9461 belongs. The @code{@@deffn} command possesses three predefined,
9462 specialized variations, @code{@@defun}, @code{@@defmac}, and
9463 @code{@@defspec}, that specify the category for you: ``Function'',
9464 ``Macro'', and ``Special Form'' respectively. The @code{@@defvr}
9465 command also is accompanied by several predefined, specialized
9466 variations for describing particular kinds of variables.@refill
9467
9468 The template for a specialized definition, such as @code{@@defun}, is
9469 similar to the template for a generalized definition, except that you
9470 do not need to specify the category:@refill
9471
9472 @example
9473 @group
9474 @@defun @var{name} @var{arguments}@dots{}
9475 @var{body-of-definition}
9476 @@end defun
9477 @end group
9478 @end example
9479
9480 @noindent
9481 Thus,
9482
9483 @example
9484 @group
9485 @@defun buffer-end flag
9486 This function returns @@code@{(point-min)@} if @@var@{flag@}
9487 is less than 1, @@code@{(point-max)@} otherwise.
9488 @dots{}
9489 @@end defun
9490 @end group
9491 @end example
9492
9493 @noindent
9494 produces
9495
9496 @quotation
9497 @defun buffer-end flag
9498 This function returns @code{(point-min)} if @var{flag} is less than 1,
9499 @code{(point-max)} otherwise. @dots{}
9500 @end defun
9501 @end quotation
9502
9503 @noindent
9504 @xref{Sample Function Definition, Sample Function Definition, A Sample
9505 Function Definition}, for a more detailed example of a function
9506 definition, including the use of @code{@@example} inside the
9507 definition.@refill
9508
9509 The other specialized commands work like @code{@@defun}.@refill
9510
9511 @node Optional Arguments, deffnx, Def Cmd Template, Definition Commands
9512 @section Optional and Repeated Arguments
9513 @cindex Optional and repeated arguments
9514 @cindex Repeated and optional arguments
9515 @cindex Arguments, repeated and optional
9516 @cindex Syntax, optional & repeated arguments
9517 @cindex Meta-syntactic chars for arguments
9518
9519 Some entities take optional or repeated arguments, which may be
9520 specified by a distinctive glyph that uses square brackets and
9521 ellipses. For @w{example}, a special form often breaks its argument list
9522 into separate arguments in more complicated ways than a
9523 straightforward function.@refill
9524
9525 @iftex
9526 An argument enclosed within square brackets is optional.
9527 Thus, the phrase
9528 @samp{@code{@r{[}@var{optional-arg}@r{]}}} means that
9529 @var{optional-arg} is optional.
9530 An argument followed by an ellipsis is optional
9531 and may be repeated more than once.
9532 @c This is consistent with Emacs Lisp Reference manual
9533 Thus, @samp{@var{repeated-args}@dots{}} stands for zero or more arguments.
9534 Parentheses are used when several arguments are grouped
9535 into additional levels of list structure in Lisp.
9536 @end iftex
9537 @c The following looks better in Info (no `r', `samp' and `code'):
9538 @ifinfo
9539 An argument enclosed within square brackets is optional.
9540 Thus, [@var{optional-arg}] means that @var{optional-arg} is optional.
9541 An argument followed by an ellipsis is optional
9542 and may be repeated more than once.
9543 @c This is consistent with Emacs Lisp Reference manual
9544 Thus, @var{repeated-args}@dots{} stands for zero or more arguments.
9545 Parentheses are used when several arguments are grouped
9546 into additional levels of list structure in Lisp.
9547 @end ifinfo
9548
9549 Here is the @code{@@defspec} line of an example of an imaginary
9550 special form:@refill
9551
9552 @quotation
9553 @defspec foobar (@var{var} [@var{from} @var{to} [@var{inc}]]) @var{body}@dots{}
9554 @end defspec
9555 @tex
9556 \vskip \parskip
9557 @end tex
9558 @end quotation
9559
9560 @noindent
9561 In this example, the arguments @var{from} and @var{to} are optional,
9562 but must both be present or both absent. If they are present,
9563 @var{inc} may optionally be specified as well. These arguments are
9564 grouped with the argument @var{var} into a list, to distinguish them
9565 from @var{body}, which includes all remaining elements of the
9566 form.@refill
9567
9568 In a Texinfo source file, this @code{@@defspec} line is written like
9569 this (except it would not be split over two lines, as it is in this
9570 example).@refill
9571
9572 @example
9573 @group
9574 @@defspec foobar (@@var@{var@} [@@var@{from@} @@var@{to@}
9575 [@@var@{inc@}]]) @@var@{body@}@@dots@{@}
9576 @end group
9577 @end example
9578
9579 @noindent
9580 The function is listed in the Command and Variable Index under
9581 @samp{foobar}.@refill
9582
9583 @node deffnx, Def Cmds in Detail, Optional Arguments, Definition Commands
9584 @section Two or More `First' Lines
9585 @cindex Two `First' Lines for @code{@@deffn}
9586 @cindex Grouping two definitions together
9587 @cindex Definitions grouped together
9588 @findex deffnx
9589
9590 To create two or more `first' or header lines for a definition, follow
9591 the first @code{@@deffn} line by a line beginning with @code{@@deffnx}.
9592 The @code{@@deffnx} command works exactly like @code{@@deffn}
9593 except that it does not generate extra vertical white space between it
9594 and the preceding line.@refill
9595
9596 @need 1000
9597 For example,
9598
9599 @example
9600 @group
9601 @@deffn @{Interactive Command@} isearch-forward
9602 @@deffnx @{Interactive Command@} isearch-backward
9603 These two search commands are similar except @dots{}
9604 @@end deffn
9605 @end group
9606 @end example
9607
9608 @noindent
9609 produces
9610
9611 @deffn {Interactive Command} isearch-forward
9612 @deffnx {Interactive Command} isearch-backward
9613 These two search commands are similar except @dots{}
9614 @end deffn
9615
9616 Each of the other definition commands has an `x' form: @code{@@defunx},
9617 @code{@@defvrx}, @code{@@deftypefunx}, etc.
9618
9619 The `x' forms work just like @code{@@itemx}; see @ref{itemx, , @code{@@itemx}}.
9620
9621 @node Def Cmds in Detail, Def Cmd Conventions, deffnx, Definition Commands
9622 @section The Definition Commands
9623
9624 Texinfo provides more than a dozen definition commands, all of which
9625 are described in this section.@refill
9626
9627 The definition commands automatically enter the name of the entity in
9628 the appropriate index: for example, @code{@@deffn}, @code{@@defun},
9629 and @code{@@defmac} enter function names in the index of functions;
9630 @code{@@defvr} and @code{@@defvar} enter variable names in the index
9631 of variables.@refill
9632
9633 Although the examples that follow mostly illustrate Lisp, the commands
9634 can be used for other programming languages.@refill
9635
9636 @menu
9637 * Functions Commands:: Commands for functions and similar entities.
9638 * Variables Commands:: Commands for variables and similar entities.
9639 * Typed Functions:: Commands for functions in typed languages.
9640 * Typed Variables:: Commands for variables in typed languages.
9641 * Abstract Objects:: Commands for object-oriented programming.
9642 * Data Types:: The definition command for data types.
9643 @end menu
9644
9645 @node Functions Commands, Variables Commands, Def Cmds in Detail, Def Cmds in Detail
9646 @subsection Functions and Similar Entities
9647
9648 This section describes the commands for describing functions and similar
9649 entities:@refill
9650
9651 @table @code
9652 @findex deffn
9653 @item @@deffn @var{category} @var{name} @var{arguments}@dots{}
9654 The @code{@@deffn} command is the general definition command for
9655 functions, interactive commands, and similar entities that may take
9656 arguments. You must choose a term to describe the category of entity
9657 being defined; for example, ``Function'' could be used if the entity is
9658 a function. The @code{@@deffn} command is written at the beginning of a
9659 line and is followed on the same line by the category of entity being
9660 described, the name of this particular entity, and its arguments, if
9661 any. Terminate the definition with @code{@@end deffn} on a line of its
9662 own.@refill
9663
9664 @need 750
9665 For example, here is a definition:
9666
9667 @example
9668 @group
9669 @@deffn Command forward-char nchars
9670 Move point forward @@var@{nchars@} characters.
9671 @@end deffn
9672 @end group
9673 @end example
9674
9675 @noindent
9676 This shows a rather terse definition for a ``command'' named
9677 @code{forward-char} with one argument, @var{nchars}.
9678
9679 @code{@@deffn} prints argument names such as @var{nchars} in italics or
9680 upper case, as if @code{@@var} had been used, because we think of these
9681 names as metasyntactic variables---they stand for the actual argument
9682 values. Within the text of the description, write an argument name
9683 explicitly with @code{@@var} to refer to the value of the argument. In
9684 the example above, we used @samp{@@var@{nchars@}} in this way.
9685
9686 The template for @code{@@deffn} is:
9687
9688 @example
9689 @group
9690 @@deffn @var{category} @var{name} @var{arguments}@dots{}
9691 @var{body-of-definition}
9692 @@end deffn
9693 @end group
9694 @end example
9695
9696 @findex defun
9697 @item @@defun @var{name} @var{arguments}@dots{}
9698 The @code{@@defun} command is the definition command for functions.
9699 @code{@@defun} is equivalent to @samp{@@deffn Function
9700 @dots{}}.@refill
9701
9702 @need 800
9703 @noindent
9704 For example,
9705
9706 @example
9707 @group
9708 @@defun set symbol new-value
9709 Change the value of the symbol @@var@{symbol@}
9710 to @@var@{new-value@}.
9711 @@end defun
9712 @end group
9713 @end example
9714
9715 @noindent
9716 shows a rather terse definition for a function @code{set} whose
9717 arguments are @var{symbol} and @var{new-value}. The argument names on
9718 the @code{@@defun} line automatically appear in italics or upper case as
9719 if they were enclosed in @code{@@var}. Terminate the definition with
9720 @code{@@end defun} on a line of its own.@refill
9721
9722 The template is:
9723
9724 @example
9725 @group
9726 @@defun @var{function-name} @var{arguments}@dots{}
9727 @var{body-of-definition}
9728 @@end defun
9729 @end group
9730 @end example
9731
9732 @code{@@defun} creates an entry in the index of functions.
9733
9734 @findex defmac
9735 @item @@defmac @var{name} @var{arguments}@dots{}
9736 The @code{@@defmac} command is the definition command for macros.
9737 @code{@@defmac} is equivalent to @samp{@@deffn Macro @dots{}} and
9738 works like @code{@@defun}.@refill
9739
9740 @findex defspec
9741 @item @@defspec @var{name} @var{arguments}@dots{}
9742 The @code{@@defspec} command is the definition command for special
9743 forms. (In Lisp, a special form is an entity much like a function.)
9744 @code{@@defspec} is equivalent to @samp{@@deffn @{Special Form@}
9745 @dots{}} and works like @code{@@defun}.@refill
9746 @end table
9747
9748 @node Variables Commands, Typed Functions, Functions Commands, Def Cmds in Detail
9749 @subsection Variables and Similar Entities
9750
9751 Here are the commands for defining variables and similar
9752 entities:@refill
9753
9754 @table @code
9755 @findex defvr
9756 @item @@defvr @var{category} @var{name}
9757 The @code{@@defvr} command is a general definition command for
9758 something like a variable---an entity that records a value. You must
9759 choose a term to describe the category of entity being defined; for
9760 example, ``Variable'' could be used if the entity is a variable.
9761 Write the @code{@@defvr} command at the beginning of a line and
9762 followed it on the same line by the category of the entity and the
9763 name of the entity.@refill
9764
9765 Capitalize the category name like a title. If the name of the
9766 category contains spaces, as in the name `User Option', write braces
9767 around it. Otherwise, the second word will be mistaken for the name
9768 of the entity, for example:
9769
9770 @example
9771 @group
9772 @@defvr @{User Option@} fill-column
9773 This buffer-local variable specifies
9774 the maximum width of filled lines.
9775 @dots{}
9776 @@end defvr
9777 @end group
9778 @end example
9779
9780 Terminate the definition with @code{@@end defvr} on a line of its
9781 own.@refill
9782
9783 The template is:
9784
9785 @example
9786 @group
9787 @@defvr @var{category} @var{name}
9788 @var{body-of-definition}
9789 @@end defvr
9790 @end group
9791 @end example
9792
9793 @code{@@defvr} creates an entry in the index of variables for @var{name}.
9794
9795 @findex defvar
9796 @item @@defvar @var{name}
9797 The @code{@@defvar} command is the definition command for variables.
9798 @code{@@defvar} is equivalent to @samp{@@defvr Variable
9799 @dots{}}.@refill
9800
9801 @need 750
9802 For example:
9803
9804 @example
9805 @group
9806 @@defvar kill-ring
9807 @dots{}
9808 @@end defvar
9809 @end group
9810 @end example
9811
9812 The template is:
9813
9814 @example
9815 @group
9816 @@defvar @var{name}
9817 @var{body-of-definition}
9818 @@end defvar
9819 @end group
9820 @end example
9821
9822 @code{@@defvar} creates an entry in the index of variables for
9823 @var{name}.@refill
9824
9825 @findex defopt
9826 @item @@defopt @var{name}
9827 The @code{@@defopt} command is the definition command for user
9828 options. @code{@@defopt} is equivalent to @samp{@@defvr @{User
9829 Option@} @dots{}} and works like @code{@@defvar}.@refill
9830 @end table
9831
9832 @node Typed Functions, Typed Variables, Variables Commands, Def Cmds in Detail
9833 @subsection Functions in Typed Languages
9834
9835 The @code{@@deftypefn} command and its variations are for describing
9836 functions in C or any other language in which you must declare types
9837 of variables and functions.@refill
9838
9839 @table @code
9840 @findex deftypefn
9841 @item @@deftypefn @var{category} @var{data-type} @var{name} @var{arguments}@dots{}
9842 The @code{@@deftypefn} command is the general definition command for
9843 functions and similar entities that may take arguments and that are
9844 typed. The @code{@@deftypefn} command is written at the beginning of
9845 a line and is followed on the same line by the category of entity
9846 being described, the type of the returned value, the name of this
9847 particular entity, and its arguments, if any.@refill
9848
9849 @need 800
9850 @noindent
9851 For example,
9852
9853 @example
9854 @group
9855 @@deftypefn @{Library Function@} int foobar
9856 (int @@var@{foo@}, float @@var@{bar@})
9857 @dots{}
9858 @@end deftypefn
9859 @end group
9860 @end example
9861
9862 @need 1000
9863 @noindent
9864 (where the text before the ``@dots{}'', shown above as two lines, would
9865 actually be a single line in a real Texinfo file) produces the following
9866 in Info:
9867
9868 @smallexample
9869 @group
9870 -- Library Function: int foobar (int FOO, float BAR)
9871 @dots{}
9872 @end group
9873 @end smallexample
9874 @iftex
9875
9876 In a printed manual, it produces:
9877
9878 @quotation
9879 @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
9880 @dots{}
9881 @end deftypefn
9882 @end quotation
9883 @end iftex
9884
9885 This means that @code{foobar} is a ``library function'' that returns an
9886 @code{int}, and its arguments are @var{foo} (an @code{int}) and
9887 @var{bar} (a @code{float}).@refill
9888
9889 The argument names that you write in @code{@@deftypefn} are not subject
9890 to an implicit @code{@@var}---since the actual names of the arguments in
9891 @code{@@deftypefn} are typically scattered among data type names and
9892 keywords, Texinfo cannot find them without help. Instead, you must write
9893 @code{@@var} explicitly around the argument names. In the example
9894 above, the argument names are @samp{foo} and @samp{bar}.@refill
9895
9896 The template for @code{@@deftypefn} is:@refill
9897
9898 @example
9899 @group
9900 @@deftypefn @var{category} @var{data-type} @var{name} @var{arguments} @dots{}
9901 @var{body-of-description}
9902 @@end deftypefn
9903 @end group
9904 @end example
9905
9906 @noindent
9907 Note that if the @var{category} or @var{data type} is more than one
9908 word then it must be enclosed in braces to make it a single argument.@refill
9909
9910 If you are describing a procedure in a language that has packages,
9911 such as Ada, you might consider using @code{@@deftypefn} in a manner
9912 somewhat contrary to the convention described in the preceding
9913 paragraphs.@refill
9914
9915 @need 800
9916 @noindent
9917 For example:
9918
9919 @example
9920 @group
9921 @@deftypefn stacks private push
9922 (@@var@{s@}:in out stack;
9923 @@var@{n@}:in integer)
9924 @dots{}
9925 @@end deftypefn
9926 @end group
9927 @end example
9928
9929 @noindent
9930 (The @code{@@deftypefn} arguments are shown split into three lines, but
9931 would be a single line in a real Texinfo file.)
9932
9933 In this instance, the procedure is classified as belonging to the
9934 package @code{stacks} rather than classified as a `procedure' and its
9935 data type is described as @code{private}. (The name of the procedure
9936 is @code{push}, and its arguments are @var{s} and @var{n}.)@refill
9937
9938 @code{@@deftypefn} creates an entry in the index of functions for
9939 @var{name}.@refill
9940
9941 @findex deftypefun
9942 @item @@deftypefun @var{data-type} @var{name} @var{arguments}@dots{}
9943 The @code{@@deftypefun} command is the specialized definition command
9944 for functions in typed languages. The command is equivalent to
9945 @samp{@@deftypefn Function @dots{}}.@refill
9946
9947 @need 800
9948 @noindent
9949 Thus,
9950
9951 @smallexample
9952 @group
9953 @@deftypefun int foobar (int @@var@{foo@}, float @@var@{bar@})
9954 @dots{}
9955 @@end deftypefun
9956 @end group
9957 @end smallexample
9958
9959 @noindent
9960 produces the following in Info:
9961
9962 @example
9963 @group
9964 -- Function: int foobar (int FOO, float BAR)
9965 @dots{}
9966 @end group
9967 @end example
9968 @iftex
9969
9970 @need 800
9971 @noindent
9972 and the following in a printed manual:
9973
9974 @quotation
9975 @deftypefun int foobar (int @var{foo}, float @var{bar})
9976 @dots{}
9977 @end deftypefun
9978 @end quotation
9979 @end iftex
9980
9981 @need 800
9982 The template is:
9983
9984 @example
9985 @group
9986 @@deftypefun @var{type} @var{name} @var{arguments}@dots{}
9987 @var{body-of-description}
9988 @@end deftypefun
9989 @end group
9990 @end example
9991
9992 @code{@@deftypefun} creates an entry in the index of functions for
9993 @var{name}.@refill
9994 @end table
9995
9996 @node Typed Variables, Abstract Objects, Typed Functions, Def Cmds in Detail
9997 @subsection Variables in Typed Languages
9998
9999 Variables in typed languages are handled in a manner similar to
10000 functions in typed languages. @xref{Typed Functions}. The general
10001 definition command @code{@@deftypevr} corresponds to
10002 @code{@@deftypefn} and the specialized definition command
10003 @code{@@deftypevar} corresponds to @code{@@deftypefun}.@refill
10004
10005 @table @code
10006 @findex deftypevr
10007 @item @@deftypevr @var{category} @var{data-type} @var{name}
10008 The @code{@@deftypevr} command is the general definition command for
10009 something like a variable in a typed language---an entity that records
10010 a value. You must choose a term to describe the category of the
10011 entity being defined; for example, ``Variable'' could be used if the
10012 entity is a variable.@refill
10013
10014 The @code{@@deftypevr} command is written at the beginning of a line
10015 and is followed on the same line by the category of the entity
10016 being described, the data type, and the name of this particular
10017 entity.@refill
10018
10019 @need 800
10020 @noindent
10021 For example:
10022
10023 @example
10024 @group
10025 @@deftypevr @{Global Flag@} int enable
10026 @dots{}
10027 @@end deftypevr
10028 @end group
10029 @end example
10030
10031 @noindent
10032 produces the following in Info:
10033
10034 @example
10035 @group
10036 -- Global Flag: int enable
10037 @dots{}
10038 @end group
10039 @end example
10040 @iftex
10041
10042 @noindent
10043 and the following in a printed manual:
10044
10045 @quotation
10046 @deftypevr {Global Flag} int enable
10047 @dots{}
10048 @end deftypevr
10049 @end quotation
10050 @end iftex
10051
10052 @need 800
10053 The template is:
10054
10055 @example
10056 @@deftypevr @var{category} @var{data-type} @var{name}
10057 @var{body-of-description}
10058 @@end deftypevr
10059 @end example
10060
10061 @code{@@deftypevr} creates an entry in the index of variables for
10062 @var{name}.@refill
10063
10064 @findex deftypevar
10065 @item @@deftypevar @var{data-type} @var{name}
10066 The @code{@@deftypevar} command is the specialized definition command
10067 for variables in typed languages. @code{@@deftypevar} is equivalent
10068 to @samp{@@deftypevr Variable @dots{}}.@refill
10069
10070 @need 800
10071 @noindent
10072 For example:
10073
10074 @example
10075 @group
10076 @@deftypevar int fubar
10077 @dots{}
10078 @@end deftypevar
10079 @end group
10080 @end example
10081
10082 @noindent
10083 produces the following in Info:
10084
10085 @example
10086 @group
10087 -- Variable: int fubar
10088 @dots{}
10089 @end group
10090 @end example
10091 @iftex
10092
10093 @need 800
10094 @noindent
10095 and the following in a printed manual:
10096
10097 @quotation
10098 @deftypevar int fubar
10099 @dots{}
10100 @end deftypevar
10101 @end quotation
10102 @end iftex
10103
10104 @need 800
10105 @noindent
10106 The template is:
10107
10108 @example
10109 @group
10110 @@deftypevar @var{data-type} @var{name}
10111 @var{body-of-description}
10112 @@end deftypevar
10113 @end group
10114 @end example
10115
10116 @code{@@deftypevar} creates an entry in the index of variables for
10117 @var{name}.@refill
10118 @end table
10119
10120 @node Abstract Objects, Data Types, Typed Variables, Def Cmds in Detail
10121 @subsection Object-Oriented Programming
10122
10123 Here are the commands for formatting descriptions about abstract
10124 objects, such as are used in object-oriented programming. A class is
10125 a defined type of abstract object. An instance of a class is a
10126 particular object that has the type of the class. An instance
10127 variable is a variable that belongs to the class but for which each
10128 instance has its own value.@refill
10129
10130 In a definition, if the name of a class is truly a name defined in the
10131 programming system for a class, then you should write an @code{@@code}
10132 around it. Otherwise, it is printed in the usual text font.@refill
10133
10134 @table @code
10135 @findex defcv
10136 @item @@defcv @var{category} @var{class} @var{name}
10137 The @code{@@defcv} command is the general definition command for
10138 variables associated with classes in object-oriented programming. The
10139 @code{@@defcv} command is followed by three arguments: the category of
10140 thing being defined, the class to which it belongs, and its
10141 name. Thus,@refill
10142
10143 @example
10144 @group
10145 @@defcv @{Class Option@} Window border-pattern
10146 @dots{}
10147 @@end defcv
10148 @end group
10149 @end example
10150
10151 @noindent
10152 illustrates how you would write the first line of a definition of the
10153 @code{border-pattern} class option of the class @code{Window}.@refill
10154
10155 The template is
10156
10157 @example
10158 @group
10159 @@defcv @var{category} @var{class} @var{name}
10160 @dots{}
10161 @@end defcv
10162 @end group
10163 @end example
10164
10165 @code{@@defcv} creates an entry in the index of variables.
10166
10167 @findex defivar
10168 @item @@defivar @var{class} @var{name}
10169 The @code{@@defivar} command is the definition command for instance
10170 variables in object-oriented programming. @code{@@defivar} is
10171 equivalent to @samp{@@defcv @{Instance Variable@} @dots{}}@refill
10172
10173 The template is:
10174
10175 @example
10176 @group
10177 @@defivar @var{class} @var{instance-variable-name}
10178 @var{body-of-definition}
10179 @@end defivar
10180 @end group
10181 @end example
10182
10183 @code{@@defivar} creates an entry in the index of variables.
10184
10185 @findex defop
10186 @item @@defop @var{category} @var{class} @var{name} @var{arguments}@dots{}
10187 The @code{@@defop} command is the general definition command for
10188 entities that may resemble methods in object-oriented programming.
10189 These entities take arguments, as functions do, but are associated
10190 with particular classes of objects.@refill
10191
10192 For example, some systems have constructs called @dfn{wrappers} that
10193 are associated with classes as methods are, but that act more like
10194 macros than like functions. You could use @code{@@defop Wrapper} to
10195 describe one of these.@refill
10196
10197 Sometimes it is useful to distinguish methods and @dfn{operations}.
10198 You can think of an operation as the specification for a method.
10199 Thus, a window system might specify that all window classes have a
10200 method named @code{expose}; we would say that this window system
10201 defines an @code{expose} operation on windows in general. Typically,
10202 the operation has a name and also specifies the pattern of arguments;
10203 all methods that implement the operation must accept the same
10204 arguments, since applications that use the operation do so without
10205 knowing which method will implement it.@refill
10206
10207 Often it makes more sense to document operations than methods. For
10208 example, window application developers need to know about the
10209 @code{expose} operation, but need not be concerned with whether a
10210 given class of windows has its own method to implement this operation.
10211 To describe this operation, you would write:@refill
10212
10213 @example
10214 @@defop Operation windows expose
10215 @end example
10216
10217 The @code{@@defop} command is written at the beginning of a line and
10218 is followed on the same line by the overall name of the category of
10219 operation, the name of the class of the operation, the name of the
10220 operation, and its arguments, if any.@refill
10221
10222 @need 800
10223 @noindent
10224 The template is:
10225
10226 @example
10227 @group
10228 @@defop @var{category} @var{class} @var{name} @var{arguments}@dots{}
10229 @var{body-of-definition}
10230 @@end defop
10231 @end group
10232 @end example
10233
10234 @code{@@defop} creates an entry, such as `@code{expose} on
10235 @code{windows}', in the index of functions.@refill
10236
10237 @findex defmethod
10238 @item @@defmethod @var{class} @var{name} @var{arguments}@dots{}
10239 The @code{@@defmethod} command is the definition command for methods
10240 in object-oriented programming. A method is a kind of function that
10241 implements an operation for a particular class of objects and its
10242 subclasses. In the Lisp Machine, methods actually were functions, but
10243 they were usually defined with @code{defmethod}.
10244
10245 @code{@@defmethod} is equivalent to @samp{@@defop Method @dots{}}.
10246 The command is written at the beginning of a line and is followed by
10247 the name of the class of the method, the name of the method, and its
10248 arguments, if any.@refill
10249
10250 @need 800
10251 @noindent
10252 For example,
10253
10254 @example
10255 @group
10256 @@defmethod @code{bar-class} bar-method argument
10257 @dots{}
10258 @@end defmethod
10259 @end group
10260 @end example
10261
10262 @noindent
10263 illustrates the definition for a method called @code{bar-method} of
10264 the class @code{bar-class}. The method takes an argument.@refill
10265
10266 The template is:
10267
10268 @example
10269 @group
10270 @@defmethod @var{class} @var{method-name} @var{arguments}@dots{}
10271 @var{body-of-definition}
10272 @@end defmethod
10273 @end group
10274 @end example
10275
10276 @code{@@defmethod} creates an entry, such as `@code{bar-method} on
10277 @code{bar-class}', in the index of functions.@refill
10278 @end table
10279
10280 @node Data Types, , Abstract Objects, Def Cmds in Detail
10281 @subsection Data Types
10282
10283 Here is the command for data types:@refill
10284
10285 @table @code
10286 @findex deftp
10287 @item @@deftp @var{category} @var{name} @var{attributes}@dots{}
10288 The @code{@@deftp} command is the generic definition command for data
10289 types. The command is written at the beginning of a line and is
10290 followed on the same line by the category, by the name of the type
10291 (which is a word like @code{int} or @code{float}), and then by names of
10292 attributes of objects of that type. Thus, you could use this command
10293 for describing @code{int} or @code{float}, in which case you could use
10294 @code{data type} as the category. (A data type is a category of
10295 certain objects for purposes of deciding which operations can be
10296 performed on them.)@refill
10297
10298 In Lisp, for example, @dfn{pair} names a particular data
10299 type, and an object of that type has two slots called the
10300 @sc{car} and the @sc{cdr}. Here is how you would write the first line
10301 of a definition of @code{pair}.@refill
10302
10303 @example
10304 @group
10305 @@deftp @{Data type@} pair car cdr
10306 @dots{}
10307 @@end deftp
10308 @end group
10309 @end example
10310
10311 @need 950
10312 The template is:
10313
10314 @example
10315 @group
10316 @@deftp @var{category} @var{name-of-type} @var{attributes}@dots{}
10317 @var{body-of-definition}
10318 @@end deftp
10319 @end group
10320 @end example
10321
10322 @code{@@deftp} creates an entry in the index of data types.
10323 @end table
10324
10325 @node Def Cmd Conventions, Sample Function Definition, Def Cmds in Detail, Definition Commands
10326 @section Conventions for Writing Definitions
10327 @cindex Definition conventions
10328 @cindex Conventions for writing definitions
10329
10330 When you write a definition using @code{@@deffn}, @code{@@defun}, or
10331 one of the other definition commands, please take care to use
10332 arguments that indicate the meaning, as with the @var{count} argument
10333 to the @code{forward-word} function. Also, if the name of an argument
10334 contains the name of a type, such as @var{integer}, take care that the
10335 argument actually is of that type.@refill
10336
10337 @node Sample Function Definition, , Def Cmd Conventions, Definition Commands
10338 @section A Sample Function Definition
10339 @cindex Function definitions
10340 @cindex Command definitions
10341 @cindex Macro definitions
10342 @cindex Sample function definition
10343
10344 A function definition uses the @code{@@defun} and @code{@@end defun}
10345 commands. The name of the function follows immediately after the
10346 @code{@@defun} command and it is followed, on the same line, by the
10347 parameter list.@refill
10348
10349 Here is a definition from @cite{The GNU Emacs Lisp Reference Manual}.
10350 (@xref{Calling Functions, , Calling Functions, elisp, The GNU Emacs
10351 Lisp Reference Manual}.)
10352
10353 @quotation
10354 @defun apply function &rest arguments
10355 @code{apply} calls @var{function} with @var{arguments}, just
10356 like @code{funcall} but with one difference: the last of
10357 @var{arguments} is a list of arguments to give to
10358 @var{function}, rather than a single argument. We also say
10359 that this list is @dfn{appended} to the other arguments.
10360
10361 @code{apply} returns the result of calling @var{function}.
10362 As with @code{funcall}, @var{function} must either be a Lisp
10363 function or a primitive function; special forms and macros
10364 do not make sense in @code{apply}.
10365
10366 @example
10367 (setq f 'list)
10368 @result{} list
10369 (apply f 'x 'y 'z)
10370 @error{} Wrong type argument: listp, z
10371 (apply '+ 1 2 '(3 4))
10372 @result{} 10
10373 (apply '+ '(1 2 3 4))
10374 @result{} 10
10375
10376 (apply 'append '((a b c) nil (x y z) nil))
10377 @result{} (a b c x y z)
10378 @end example
10379
10380 An interesting example of using @code{apply} is found in the description
10381 of @code{mapcar}.@refill
10382 @end defun
10383 @end quotation
10384
10385 @need 1200
10386 In the Texinfo source file, this example looks like this:
10387
10388 @example
10389 @group
10390 @@defun apply function &rest arguments
10391
10392 @@code@{apply@} calls @@var@{function@} with
10393 @@var@{arguments@}, just like @@code@{funcall@} but with one
10394 difference: the last of @@var@{arguments@} is a list of
10395 arguments to give to @@var@{function@}, rather than a single
10396 argument. We also say that this list is @@dfn@{appended@}
10397 to the other arguments.
10398 @end group
10399
10400 @group
10401 @@code@{apply@} returns the result of calling
10402 @@var@{function@}. As with @@code@{funcall@},
10403 @@var@{function@} must either be a Lisp function or a
10404 primitive function; special forms and macros do not make
10405 sense in @@code@{apply@}.
10406 @end group
10407
10408 @group
10409 @@example
10410 (setq f 'list)
10411 @@result@{@} list
10412 (apply f 'x 'y 'z)
10413 @@error@{@} Wrong type argument: listp, z
10414 (apply '+ 1 2 '(3 4))
10415 @@result@{@} 10
10416 (apply '+ '(1 2 3 4))
10417 @@result@{@} 10
10418
10419 (apply 'append '((a b c) nil (x y z) nil))
10420 @@result@{@} (a b c x y z)
10421 @@end example
10422 @end group
10423
10424 @group
10425 An interesting example of using @@code@{apply@} is found
10426 in the description of @@code@{mapcar@}.@@refill
10427 @@end defun
10428 @end group
10429 @end example
10430
10431 @noindent
10432 In this manual, this function is listed in the Command and Variable
10433 Index under @code{apply}.@refill
10434
10435 Ordinary variables and user options are described using a format like
10436 that for functions except that variables do not take arguments.
10437
10438 @node Footnotes, Conditionals, Definition Commands, Top
10439 @comment node-name, next, previous, up
10440 @chapter Footnotes
10441 @cindex Footnotes
10442 @findex footnote
10443
10444 A @dfn{footnote} is for a reference that documents or elucidates the
10445 primary text.@footnote{A footnote should complement or expand upon
10446 the primary text, but a reader should not need to read a footnote to
10447 understand the primary text. For a thorough discussion of footnotes,
10448 see @cite{The Chicago Manual of Style}, which is published by the
10449 University of Chicago Press.}@refill
10450
10451 In Texinfo, footnotes are created with the @code{@@footnote} command.
10452 This command is followed immediately by a left brace, then by the text
10453 of the footnote, and then by a terminating right brace. The template
10454 is:
10455
10456 @example
10457 @@footnote@{@var{text}@}
10458 @end example
10459
10460 Footnotes may be of any length, but are usually short.@refill
10461
10462 For example, this clause is followed by a sample
10463 footnote@footnote{Here is the sample footnote.}; in the Texinfo
10464 source, it looks like this:@refill
10465
10466 @example
10467 @dots{}a sample footnote @@footnote@{Here is the sample
10468 footnote.@}; in the Texinfo source@dots{}
10469 @end example
10470
10471 In a printed manual or book, the reference mark for a footnote is a
10472 small, superscripted number; the text of the footnote is written at
10473 the bottom of the page, below a horizontal line.@refill
10474
10475 In Info, the reference mark for a footnote is a pair of parentheses
10476 with the footnote number between them, like this: @samp{(1)}.@refill
10477
10478 Info has two footnote styles, which determine where the text of the
10479 footnote is located:@refill
10480
10481 @itemize @bullet
10482 @cindex @samp{@r{End}} node footnote style
10483 @item
10484 In the `End' node style, all the footnotes for a single node
10485 are placed at the end of that node. The footnotes are separated from
10486 the rest of the node by a line of dashes with the word
10487 @samp{Footnotes} within it. Each footnote begins with an
10488 @samp{(@var{n})} reference mark.@refill
10489
10490 @need 700
10491 @noindent
10492 Here is an example of a single footnote in the end of node style:@refill
10493
10494 @example
10495 @group
10496 --------- Footnotes ---------
10497
10498 (1) Here is a sample footnote.
10499 @end group
10500 @end example
10501
10502 @cindex @samp{@r{Separate}} footnote style
10503 @item
10504 In the `Separate' node style, all the footnotes for a single
10505 node are placed in an automatically constructed node of
10506 their own. In this style, a ``footnote reference'' follows
10507 each @samp{(@var{n})} reference mark in the body of the
10508 node. The footnote reference is actually a cross reference
10509 which you use to reach the footnote node.@refill
10510
10511 The name of the node containing the footnotes is constructed
10512 by appending @w{@samp{-Footnotes}} to the name of the node
10513 that contains the footnotes. (Consequently, the footnotes'
10514 node for the @file{Footnotes} node is
10515 @w{@file{Footnotes-Footnotes}}!) The footnotes' node has an
10516 `Up' node pointer that leads back to its parent node.@refill
10517
10518 @noindent
10519 Here is how the first footnote in this manual looks after being
10520 formatted for Info in the separate node style:@refill
10521
10522 @smallexample
10523 @group
10524 File: texinfo.info Node: Overview-Footnotes, Up: Overview
10525
10526 (1) Note that the first syllable of "Texinfo" is
10527 pronounced like "speck", not "hex". @dots{}
10528 @end group
10529 @end smallexample
10530 @end itemize
10531
10532 A Texinfo file may be formatted into an Info file with either footnote
10533 style.@refill
10534
10535 @findex footnotestyle
10536 Use the @code{@@footnotestyle} command to specify an Info file's
10537 footnote style. Write this command at the beginning of a line followed
10538 by an argument, either @samp{end} for the end node style or
10539 @samp{separate} for the separate node style.
10540
10541 @need 700
10542 For example,
10543
10544 @example
10545 @@footnotestyle end
10546 @end example
10547 @noindent
10548 or
10549 @example
10550 @@footnotestyle separate
10551 @end example
10552
10553 Write an @code{@@footnotestyle} command before or shortly after the
10554 end-of-header line at the beginning of a Texinfo file. (If you
10555 include the @code{@@footnotestyle} command between the start-of-header
10556 and end-of-header lines, the region formatting commands will format
10557 footnotes as specified.)@refill
10558
10559 If you do not specify a footnote style, the formatting commands use
10560 their default style. Currently, @code{texinfo-format-buffer} and
10561 @code{texinfo-format-region} use the `separate' style and
10562 @code{makeinfo} uses the `end' style.@refill
10563
10564 @c !!! note: makeinfo's --footnote-style option overrides footnotestyle
10565 @ignore
10566 If you use @code{makeinfo} to create the Info file, the
10567 @samp{--footnote-style} option determines which style is used,
10568 @samp{end} for the end of node style or @samp{separate} for the
10569 separate node style. Thus, to format the Texinfo manual in the
10570 separate node style, you would use the following shell command:@refill
10571
10572 @example
10573 makeinfo --footnote-style=separate texinfo.texi
10574 @end example
10575
10576 @noindent
10577 To format the Texinfo manual in the end of node style, you would
10578 type:@refill
10579
10580 @example
10581 makeinfo --footnote-style=end texinfo.texi
10582 @end example
10583 @end ignore
10584 @ignore
10585 If you use @code{texinfo-format-buffer} or
10586 @code{texinfo-format-region} to create the Info file, the value of the
10587 @code{texinfo-footnote-style} variable controls the footnote style.
10588 It can be either @samp{"separate"} for the separate node style or
10589 @samp{"end"} for the end of node style. (You can change the value of
10590 this variable with the @kbd{M-x edit-options} command (@pxref{Edit
10591 Options, , Editing Variable Values, emacs, The GNU Emacs Manual}), or
10592 with the @kbd{M-x set-variable} command (@pxref{Examining, , Examining
10593 and Setting Variables, emacs, The GNU Emacs Manual}).@refill
10594
10595 The @code{texinfo-footnote-style} variable also controls the style if
10596 you use the @kbd{M-x makeinfo-region} or @kbd{M-x makeinfo-buffer}
10597 command in Emacs.@refill
10598 @end ignore
10599 This chapter contains two footnotes.@refill
10600
10601 @node Conditionals, Format/Print Hardcopy, Footnotes, Top
10602 @comment node-name, next, previous, up
10603 @chapter Conditionally Visible Text
10604 @cindex Conditionally visible text
10605 @cindex Text, conditionally visible
10606 @cindex Visibility of conditional text
10607 @cindex If text conditionally visible
10608 @findex ifinfo
10609 @findex iftex
10610
10611 Sometimes it is good to use different text for a printed manual and
10612 its corresponding Info file. In this case, you can use the
10613 @dfn{conditional commands} to specify which text is for the printed manual
10614 and which is for the Info file.@refill
10615
10616 @menu
10617 * Conditional Commands:: How to specify text for Info or @TeX{}.
10618 * Using Ordinary TeX Commands:: You can use any and all @TeX{} commands.
10619 * set clear value:: How to designate which text to format (for
10620 both Info and @TeX{}); and how to set a
10621 flag to a string that you can insert.
10622 @end menu
10623
10624 @node Conditional Commands, Using Ordinary TeX Commands, Conditionals, Conditionals
10625 @ifinfo
10626 @heading Using @code{@@ifinfo} and @code{@@iftex}
10627 @end ifinfo
10628
10629 @code{@@ifinfo} begins segments of text that should be ignored
10630 by @TeX{} when it
10631 typesets the printed manual. The segment of text appears only
10632 in the Info file.
10633 The @code{@@ifinfo} command should appear on a line by itself; end
10634 the Info-only text with a line containing @code{@@end ifinfo} by
10635 itself. At the beginning of a Texinfo file, the Info permissions are
10636 contained within a region marked by @code{@@ifinfo} and @code{@@end
10637 ifinfo}. (@xref{Info Summary and Permissions}.)@refill
10638
10639 The @code{@@iftex} and @code{@@end iftex} commands are similar to the
10640 @code{@@ifinfo} and @code{@@end ifinfo} commands, except that they
10641 specify text that will appear in the printed manual but not in the Info
10642 file.@refill
10643
10644 @need 700
10645 For example,
10646
10647 @example
10648 @@iftex
10649 This text will appear only in the printed manual.
10650 @@end iftex
10651
10652 @@ifinfo
10653 However, this text will appear only in Info.
10654 @@end ifinfo
10655 @end example
10656
10657 @noindent
10658 The preceding example produces the following line:
10659
10660 @iftex
10661 This text will appear only in the printed manual.
10662 @end iftex
10663
10664 @ifinfo
10665 However, this text will appear only in Info.
10666 @end ifinfo
10667
10668 @noindent
10669 Note how you only see one of the two lines, depending on whether you
10670 are reading the Info version or the printed version of this
10671 manual.@refill
10672
10673 The @code{@@titlepage} command is a special variant of @code{@@iftex} that
10674 is used for making the title and copyright pages of the printed
10675 manual. (@xref{titlepage, , @code{@@titlepage}}.) @refill
10676
10677 @node Using Ordinary TeX Commands, set clear value, Conditional Commands, Conditionals
10678 @comment node-name, next, previous, up
10679 @section Using Ordinary @TeX{} Commands
10680 @cindex @TeX{} commands, using ordinary
10681 @cindex Ordinary @TeX{} commands, using
10682 @cindex Commands using ordinary @TeX{}
10683 @cindex Plain@TeX{}
10684
10685 Inside a region delineated by @code{@@iftex} and @code{@@end iftex},
10686 you can embed some Plain@TeX{} commands. Info will ignore these
10687 commands since they are only in that part of the file which is seen by
10688 @TeX{}. You can write the @TeX{} commands as you would write them in
10689 a normal @TeX{} file, except that you must replace the @samp{\} used
10690 by @TeX{} with an @samp{@@}. For example, in the @code{@@titlepage}
10691 section of a Texinfo file, you can use the @TeX{} command
10692 @code{@@vskip} to format the copyright page. (The @code{@@titlepage}
10693 command causes Info to ignore the region automatically, as it does
10694 with the @code{@@iftex} command.)@refill
10695
10696 However, many features of Plain@TeX{} will not work, as they are
10697 overridden by features of Texinfo.
10698
10699 @findex tex
10700 You can enter Plain@TeX{} completely, and use @samp{\} in the @TeX{}
10701 commands, by delineating a region with the @code{@@tex} and @code{@@end
10702 tex} commands. (The @code{@@tex} command also causes Info to ignore the
10703 region, like the @code{@@iftex}
10704 command.)@refill
10705
10706 @cindex Mathematical expressions
10707 For example, here is a mathematical expression written in
10708 Plain@TeX{}:@refill
10709
10710 @example
10711 @@tex
10712 $$ \chi^2 = \sum_@{i=1@}^N
10713 \left (y_i - (a + b x_i)
10714 \over \sigma_i\right)^2 $$
10715 @@end tex
10716 @end example
10717
10718 @noindent
10719 The output of this example will appear only in a printed manual. If
10720 you are reading this in Info, you will not see anything after this
10721 paragraph.
10722 @iftex
10723 In a printed manual, the above expression looks like
10724 this:
10725 @end iftex
10726
10727 @tex
10728 $$ \chi^2 = \sum_{i=1}^N
10729 \left(y_i - (a + b x_i)
10730 \over \sigma_i\right)^2 $$
10731 @end tex
10732
10733 @node set clear value, , Using Ordinary TeX Commands, Conditionals
10734 @comment node-name, next, previous, up
10735 @section @code{@@set}, @code{@@clear}, and @code{@@value}
10736
10737 You can direct the Texinfo formatting commands to format or ignore parts
10738 of a Texinfo file with the @code{@@set}, @code{@@clear}, @code{@@ifset},
10739 and @code{@@ifclear} commands.@refill
10740
10741 In addition, you can use the @code{@@set @var{flag}} command to set the
10742 value of @var{flag} to a string of characters; and use
10743 @code{@@value@{@var{flag}@}} to insert that string. You can use
10744 @code{@@set}, for example, to set a date and use @code{@@value} to
10745 insert the date in several places in the Texinfo file.@refill
10746
10747 @menu
10748 * ifset ifclear:: Format a region if a flag is set.
10749 * value:: Replace a flag with a string.
10750 * value Example:: An easy way to update edition information.
10751 @end menu
10752
10753 @node ifset ifclear, value, set clear value, set clear value
10754 @subsection @code{@@ifset} and @code{@@ifclear}
10755
10756 @findex ifset
10757 When a @var{flag} is set, the Texinfo formatting commands format text
10758 between subsequent pairs of @code{@@ifset @var{flag}} and @code{@@end
10759 ifset} commands. When the @var{flag} is cleared, the Texinfo formatting
10760 commands do @emph{not} format the text.
10761
10762 Use the @code{@@set @var{flag}} command to turn on, or @dfn{set}, a
10763 @var{flag}; a @dfn{flag} can be any single word. The format for the
10764 command looks like this:@refill
10765 @findex set
10766
10767 @example
10768 @@set @var{flag}
10769 @end example
10770
10771 Write the conditionally formatted text between @code{@@ifset @var{flag}}
10772 and @code{@@end ifset} commands, like this:@refill
10773
10774 @example
10775 @group
10776 @@ifset @var{flag}
10777 @var{conditional-text}
10778 @@end ifset
10779 @end group
10780 @end example
10781
10782 For example, you can create one document that has two variants, such as
10783 a manual for a `large' and `small' model:@refill
10784
10785 @example
10786 You can use this machine to dig up shrubs
10787 without hurting them.
10788
10789 @@set large
10790
10791 @@ifset large
10792 It can also dig up fully grown trees.
10793 @@end ifset
10794
10795 Remember to replant promptly @dots{}
10796 @end example
10797
10798 @noindent
10799 In the example, the formatting commands will format the text between
10800 @code{@@ifset large} and @code{@@end ifset} because the @code{large}
10801 flag is set.@refill
10802
10803 @findex clear
10804 Use the @code{@@clear @var{flag}} command to turn off, or @dfn{clear},
10805 a flag. Clearing a flag is the opposite of setting a flag. The
10806 command looks like this:@refill
10807
10808 @example
10809 @@clear @var{flag}
10810 @end example
10811
10812 @noindent
10813 Write the command on a line of its own.
10814
10815 When @var{flag} is cleared, the Texinfo formatting commands do
10816 @emph{not} format the text between @code{@@ifset @var{flag}} and
10817 @code{@@end ifset}; that text is ignored and does not appear in either
10818 printed or Info output.@refill
10819
10820 For example, if you clear the flag of the preceding example by writing
10821 an @code{@@clear large} command after the @code{@@set large} command
10822 (but before the conditional text), then the Texinfo formatting commands
10823 ignore the text between the @code{@@ifset large} and @code{@@end ifset}
10824 commands. In the formatted output, that text does not appear; in both
10825 printed and Info output, you see only the lines that say, ``You can use
10826 this machine to dig up shrubs without hurting them. Remember to replant
10827 promptly @dots{}''.
10828
10829 @findex ifclear
10830 If a flag is cleared with an @code{@@clear @var{flag}} command, then
10831 the formatting commands format text between subsequent pairs of
10832 @code{@@ifclear} and @code{@@end ifclear} commands. But if the flag
10833 is set with @code{@@set @var{flag}}, then the formatting commands do
10834 @emph{not} format text between an @code{@@ifclear} and an @code{@@end
10835 ifclear} command; rather, they ignore that text. An @code{@@ifclear}
10836 command looks like this:@refill
10837
10838 @example
10839 @@ifclear @var{flag}
10840 @end example
10841
10842 @need 700
10843 In brief, the commands are:@refill
10844
10845 @table @code
10846 @item @@set @var{flag}
10847 Tell the Texinfo formatting commands that @var{flag} is set.@refill
10848
10849 @item @@clear @var{flag}
10850 Tell the Texinfo formatting commands that @var{flag} is cleared.@refill
10851
10852 @item @@ifset @var{flag}
10853 If @var{flag} is set, tell the Texinfo formatting commands to format
10854 the text up to the following @code{@@end ifset} command.@refill
10855
10856 If @var{flag} is cleared, tell the Texinfo formatting commands to
10857 ignore text up to the following @code{@@end ifset} command.@refill
10858
10859 @item @@ifclear @var{flag}
10860 If @var{flag} is set, tell the Texinfo formatting commands to ignore
10861 the text up to the following @code{@@end ifclear} command.@refill
10862
10863 If @var{flag} is cleared, tell the Texinfo formatting commands to
10864 format the text up to the following @code{@@end ifclear}
10865 command.@refill
10866 @end table
10867
10868 @node value, value Example, ifset ifclear, set clear value
10869 @subsection @code{@@value}
10870 @findex value
10871
10872 You can use the @code{@@set} command to specify a value for a flag,
10873 which is expanded by the @code{@@value} command. The value is a string
10874 a characters.
10875
10876 Write the @code{@@set} command like this:
10877
10878 @example
10879 @@set foo This is a string.
10880 @end example
10881
10882 @noindent
10883 This sets the value of @code{foo} to ``This is a string.''
10884
10885 The Texinfo formatters replace an @code{@@value@{@var{flag}@}} command with
10886 the string to which @var{flag} is set.@refill
10887
10888 Thus, when @code{foo} is set as shown above, the Texinfo formatters convert
10889
10890 @example
10891 @group
10892 @@value@{foo@}
10893 @exdent @r{to}
10894 This is a string.
10895 @end group
10896 @end example
10897
10898 You can write an @code{@@value} command within a paragraph; but you
10899 must write an @code{@@set} command on a line of its own.
10900
10901 If you write the @code{@@set} command like this:
10902
10903 @example
10904 @@set foo
10905 @end example
10906
10907 @noindent
10908 without specifying a string, the value of @code{foo} is an empty string.
10909
10910 If you clear a previously set flag with an @code{@@clear @var{flag}}
10911 command, a subsequent @code{@@value@{flag@}} command is invalid and the
10912 string is replaced with an error message that says @samp{@{No value for
10913 "@var{flag}"@}}.
10914
10915 For example, if you set @code{foo} as follows:@refill
10916
10917 @example
10918 @@set how-much very, very, very
10919 @end example
10920
10921 @noindent
10922 then the formatters transform
10923
10924 @example
10925 @group
10926 It is a @@value@{how-much@} wet day.
10927 @exdent @r{into}
10928 It is a very, very, very wet day.
10929 @end group
10930 @end example
10931
10932 If you write
10933
10934 @example
10935 @@clear how-much
10936 @end example
10937
10938 @noindent
10939 then the formatters transform
10940
10941 @example
10942 @group
10943 It is a @@value@{how-much@} wet day.
10944 @exdent @r{into}
10945 It is a @{No value for "how-much"@} wet day.
10946 @end group
10947 @end example
10948
10949 @node value Example, , value, set clear value
10950 @subsection @code{@@value} Example
10951
10952 You can use the @code{@@value} command to limit the number of places you
10953 need to change when you record an update to a manual.
10954 Here is how it is done in @cite{The GNU Make Manual}:
10955
10956 @need 1000
10957 @noindent
10958 Set the flags:
10959
10960 @example
10961 @group
10962 @@set EDITION 0.35 Beta
10963 @@set VERSION 3.63 Beta
10964 @@set UPDATED 14 August 1992
10965 @@set UPDATE-MONTH August 1992
10966 @end group
10967 @end example
10968
10969 @need 750
10970 @noindent
10971 Write text for the first @code{@@ifinfo} section, for people reading the
10972 Texinfo file:
10973
10974 @example
10975 @group
10976 This is Edition @@value@{EDITION@},
10977 last updated @@value@{UPDATED@},
10978 of @@cite@{The GNU Make Manual@},
10979 for @@code@{make@}, Version @@value@{VERSION@}.
10980 @end group
10981 @end example
10982
10983 @need 1000
10984 @noindent
10985 Write text for the title page, for people reading the printed manual:
10986 @c List only the month and the year since that looks less fussy on a
10987 @c printed cover than a date that lists the day as well.
10988
10989 @example
10990 @group
10991 @@title GNU Make
10992 @@subtitle A Program for Directing Recompilation
10993 @@subtitle Edition @@value@{EDITION@}, @dots{}
10994 @@subtitle @@value@{UPDATE-MONTH@}
10995 @end group
10996 @end example
10997
10998 @noindent
10999 (On a printed cover, a date listing the month and the year looks less
11000 fussy than a date listing the day as well as the month and year.)
11001
11002 @need 750
11003 @noindent
11004 Write text for the Top node, for people reading the Info file:
11005
11006 @example
11007 @group
11008 This is Edition @@value@{EDITION@}
11009 of the @@cite@{GNU Make Manual@},
11010 last updated @@value@{UPDATED@}
11011 for @@code@{make@} Version @@value@{VERSION@}.
11012 @end group
11013 @end example
11014
11015 @need 950
11016 After you format the manual, the text in the first @code{@@ifinfo}
11017 section looks like this:
11018
11019 @example
11020 @group
11021 This is Edition 0.35 Beta, last updated 14 August 1992,
11022 of `The GNU Make Manual', for `make', Version 3.63 Beta.
11023 @end group
11024 @end example
11025
11026 When you update the manual, change only the values of the flags; you do
11027 not need to rewrite the three sections.
11028
11029 @node Format/Print Hardcopy, Create an Info File, Conditionals, Top
11030 @comment node-name, next, previous, up
11031 @chapter Format and Print Hardcopy
11032 @cindex Format and print hardcopy
11033 @cindex Hardcopy, printing it
11034 @cindex Making a printed manual
11035 @cindex Sorting indices
11036 @cindex Indices, sorting
11037 @cindex @TeX{} index sorting
11038 @findex texindex
11039
11040 There are three major shell commands for making a printed manual from a
11041 Texinfo file: one for converting the Texinfo file into a file that will be
11042 printed, a second for sorting indices, and a third for printing the
11043 formatted document. When you use the shell commands, you can either
11044 work directly in the operating system shell or work within a shell
11045 inside GNU Emacs.@refill
11046
11047 If you are using GNU Emacs, you can use commands provided by Texinfo
11048 mode instead of shell commands. In addition to the three commands to
11049 format a file, sort the indices, and print the result, Texinfo mode
11050 offers key bindings for commands to recenter the output buffer, show the
11051 print queue, and delete a job from the print queue.@refill
11052
11053 @menu
11054 * Use TeX:: Use @TeX{} to format for hardcopy.
11055 * Format with tex/texindex:: How to format in a shell.
11056 * Format with texi2dvi:: A simpler way to use the shell.
11057 * Print with lpr:: How to print.
11058 * Within Emacs:: How to format and print from an Emacs shell.
11059 * Texinfo Mode Printing:: How to format and print in Texinfo mode.
11060 * Compile-Command:: How to print using Emacs's compile command.
11061 * Requirements Summary:: @TeX{} formatting requirements summary.
11062 * Preparing for TeX:: What you need to do to use @TeX{}.
11063 * Overfull hboxes:: What are and what to do with overfull hboxes.
11064 * smallbook:: How to print small format books and manuals.
11065 * A4 Paper:: How to print on European A4 paper.
11066 * Cropmarks and Magnification:: How to print marks to indicate the size
11067 of pages and how to print scaled up output.
11068 @end menu
11069
11070 @node Use TeX, Format with tex/texindex, Format/Print Hardcopy, Format/Print Hardcopy
11071 @ifinfo
11072 @heading Use @TeX{}
11073 @end ifinfo
11074
11075 The typesetting program called @TeX{} is used for formatting a Texinfo
11076 file. @TeX{} is a very powerful typesetting program and, if used right,
11077 does an exceptionally good job. @xref{Obtaining TeX, , How to Obtain
11078 @TeX{}}, for information on how to obtain @TeX{}.@refill
11079
11080 The @code{makeinfo}, @code{texinfo-format-region}, and
11081 @code{texinfo-format-buffer} commands read the very same @@-commands
11082 in the Texinfo file as does @TeX{}, but process them differently to
11083 make an Info file; see @ref{Create an Info File}.@refill
11084
11085 @node Format with tex/texindex, Format with texi2dvi, Use TeX, Format/Print Hardcopy
11086 @comment node-name, next, previous, up
11087 @section Format using @code{tex} and @code{texindex}
11088 @cindex Shell formatting with @code{tex} and @code{texindex}
11089 @cindex Formatting with @code{tex} and @code{texindex}
11090 @cindex DVI file
11091
11092 Format the Texinfo file with the shell command @code{tex} followed by
11093 the name of the Texinfo file. This command produces a formatted
11094 @sc{dvi} file as well as several auxiliary files containing indices,
11095 cross references, etc. The @sc{dvi} file (for @dfn{DeVice Independent}
11096 file) can be printed on a wide variety of printers.@refill
11097
11098 The @code{tex} formatting command itself does not sort the indices; it
11099 writes an output file of unsorted index data. This is a misfeature of
11100 @TeX{}. (The @code{texi2dvi} command automatically generates indices;
11101 see @ref{Format with texi2dvi, , Format using @code{texi2dvi}}.) To
11102 generate a printed index after running the @code{tex} command, you first
11103 need a sorted index to work from. The @code{texindex} command sorts
11104 indices. (The source file @file{texindex.c} comes as part of the
11105 standard GNU distribution and is usually installed when Emacs is
11106 installed.)@refill
11107 @findex texindex
11108 @ignore
11109 Usage: texindex [-k] [-T tempdir] infile [-o outfile] ...
11110
11111 Each infile arg can optionally be followed by a `-o outfile' arg;
11112 for each infile that is not followed by a -o arg, the infile name with
11113 `s' (for `sorted') appended is used for the outfile.
11114
11115 -T dir is the directory to put temp files in, instead of /tmp.
11116 -k means `keep tempfiles', for debugging.
11117 @end ignore
11118
11119 The @code{tex} formatting command outputs unsorted index files under
11120 names that obey a standard convention. These names are the name of
11121 your main input file to the @code{tex} formatting command, with
11122 everything after the first period thrown away, and the two letter
11123 names of indices added at the end. For example, the raw index output
11124 files for the input file @file{foo.texinfo} would be @file{foo.cp},
11125 @file{foo.vr}, @file{foo.fn}, @file{foo.tp}, @file{foo.pg} and
11126 @file{foo.ky}. Those are exactly the arguments to give to
11127 @code{texindex}.@refill
11128
11129 @need 1000
11130 Or else, you can use @samp{??} as ``wild-cards'' and give the command in
11131 this form:@refill
11132
11133 @example
11134 texindex foo.??
11135 @end example
11136
11137 @noindent
11138 This command will run @code{texindex} on all the unsorted index files,
11139 including any that you have defined yourself using @code{@@defindex}
11140 or @code{@@defcodeindex}. (You may execute @samp{texindex foo.??}
11141 even if there are similarly named files with two letter extensions
11142 that are not index files, such as @samp{foo.el}. The @code{texindex}
11143 command reports but otherwise ignores such files.)@refill
11144
11145 For each file specified, @code{texindex} generates a sorted index file
11146 whose name is made by appending @samp{s} to the input file name. The
11147 @code{@@printindex} command knows to look for a file of that name.
11148 @code{texindex} does not alter the raw index output file.@refill
11149
11150 After you have sorted the indices, you need to rerun the @code{tex}
11151 formatting command on the Texinfo file. This regenerates a formatted
11152 @sc{dvi} file with up-to-date index entries.@footnote{If you use more
11153 than one index and have cross references to an index other than the
11154 first, you must run @code{tex} @emph{three times} to get correct output:
11155 once to generate raw index data; again (after @code{texindex}) to output
11156 the text of the indices and determine their true page numbers; and a
11157 third time to output correct page numbers in cross references to them.
11158 However, cross references to indices are rare.}@refill
11159
11160 To summarize, this is a three step process:
11161
11162 @enumerate
11163 @item
11164 Run the @code{tex} formatting command on the Texinfo file. This
11165 generates the formatted @sc{dvi} file as well as the raw index files
11166 with two letter extensions.@refill
11167
11168 @item
11169 Run the shell command @code{texindex} on the raw index files to sort
11170 them. This creates the corresponding sorted index files.@refill
11171
11172 @item
11173 Rerun the @code{tex} formatting command on the Texinfo file. This
11174 regenerates a formatted @sc{dvi} file with the index entries in the
11175 correct order. This second run also corrects the page numbers for
11176 the cross references. (The tables of contents are always correct.)@refill
11177 @end enumerate
11178
11179 You need not run @code{texindex} each time after you run the
11180 @code{tex} formatting. If you do not, on the next run, the @code{tex}
11181 formatting command will use whatever sorted index files happen to
11182 exist from the previous use of @code{texindex}. This is usually
11183 @sc{ok} while you are debugging.@refill
11184
11185 @node Format with texi2dvi, Print with lpr, Format with tex/texindex, Format/Print Hardcopy
11186 @comment node-name, next, previous, up
11187 @section Format using @code{texi2dvi}
11188 @findex texi2dvi @r{(shell script)}
11189
11190 The @code{texi2dvi} command is a shell script that automatically runs
11191 both @code{tex} and @code{texindex} as needed to produce a @sc{dvi} file
11192 with up-to-date, sorted indices. It simplifies the
11193 @code{tex}---@code{texindex}---@code{tex} sequence described in the
11194 previous section.
11195
11196 @need 1000
11197 The syntax for @code{texi2dvi} is like this (where @samp{%} is the
11198 shell prompt):@refill
11199
11200 @example
11201 % texi2dvi @var{filename}@dots{}
11202 @end example
11203
11204 @node Print with lpr, Within Emacs, Format with texi2dvi, Format/Print Hardcopy
11205 @comment node-name, next, previous, up
11206 @section Shell Print Using @code{lpr -d}
11207 @findex lpr @r{(@sc{dvi} print command)}
11208
11209 You can print a @sc{dvi} file with the @sc{dvi} print command. The
11210 precise printing command to use depends on your system; @samp{lpr -d} is
11211 common. The @sc{dvi} print command may require a file name without any
11212 extension or with a @samp{.dvi} extension.@refill
11213
11214 @need 1200
11215 The following commands, for example, sort the indices, format, and
11216 print the @cite{Bison Manual} (where @samp{%} is the shell
11217 prompt):@refill
11218
11219 @example
11220 @group
11221 % tex bison.texinfo
11222 % texindex bison.??
11223 % tex bison.texinfo
11224 % lpr -d bison.dvi
11225 @end group
11226 @end example
11227
11228 @noindent
11229 (Remember that the shell commands may be different at your site; but
11230 these are commonly used versions.)@refill
11231
11232 @need 1000
11233 Using the @code{texi2dvi} shell script, you simply need type:@refill
11234
11235 @example
11236 @group
11237 % texi2dvi bison.texinfo
11238 % lpr -d bison.dvi
11239 @end group
11240 @end example
11241
11242 @node Within Emacs, Texinfo Mode Printing, Print with lpr, Format/Print Hardcopy
11243 @comment node-name, next, previous, up
11244 @section From an Emacs Shell @dots{}
11245 @cindex Print, format from Emacs shell
11246 @cindex Format, print from Emacs shell
11247 @cindex Shell, format, print from
11248 @cindex Emacs shell, format, print from
11249 @cindex GNU Emacs shell, format, print from
11250
11251 You can give formatting and printing commands from a shell within GNU
11252 Emacs. To create a shell within Emacs, type @kbd{M-x shell}. In this
11253 shell, you can format and print the document. @xref{Format/Print
11254 Hardcopy, , Format and Print Hardcopy}, for details.@refill
11255
11256 You can switch to and from the shell buffer while @code{tex} is
11257 running and do other editing. If you are formatting a long document
11258 on a slow machine, this can be very convenient.@refill
11259
11260 You can also use @code{texi2dvi} from an Emacs shell. For example,
11261 here is how to use @code{texi2dvi} to format and print @cite{Using and
11262 Porting GNU CC} from a shell within Emacs (where @samp{%} is the shell
11263 prompt):@refill
11264
11265 @example
11266 @group
11267 % texi2dvi gcc.texinfo
11268 % lpr -d gcc.dvi
11269 @end group
11270 @end example
11271 @ifinfo
11272
11273 @xref{Texinfo Mode Printing}, for more information about formatting
11274 and printing in Texinfo mode.@refill
11275 @end ifinfo
11276
11277 @node Texinfo Mode Printing, Compile-Command, Within Emacs, Format/Print Hardcopy
11278 @section Formatting and Printing in Texinfo Mode
11279 @cindex Region printing in Texinfo mode
11280 @cindex Format and print in Texinfo mode
11281 @cindex Print and format in Texinfo mode
11282
11283 Texinfo mode provides several predefined key commands for @TeX{}
11284 formatting and printing. These include commands for sorting indices,
11285 looking at the printer queue, killing the formatting job, and
11286 recentering the display of the buffer in which the operations
11287 occur.@refill
11288
11289 @table @kbd
11290 @item C-c C-t C-b
11291 @itemx M-x texinfo-tex-buffer
11292 Run @code{texi2dvi} on the current buffer.@refill
11293
11294 @item C-c C-t C-r
11295 @itemx M-x texinfo-tex-region
11296 Run @TeX{} on the current region.@refill
11297
11298 @item C-c C-t C-i
11299 @itemx M-x texinfo-texindex
11300 Sort the indices of a Texinfo file formatted with
11301 @code{texinfo-tex-region}.@refill
11302
11303 @item C-c C-t C-p
11304 @itemx M-x texinfo-tex-print
11305 Print a @sc{dvi} file that was made with @code{texinfo-tex-region} or
11306 @code{texinfo-tex-buffer}.@refill
11307
11308 @item C-c C-t C-q
11309 @itemx M-x tex-show-print-queue
11310 Show the print queue.@refill
11311
11312 @item C-c C-t C-d
11313 @itemx M-x texinfo-delete-from-print-queue
11314 Delete a job from the print queue; you will be prompted for the job
11315 number shown by a preceding @kbd{C-c C-t C-q} command
11316 (@code{texinfo-show-tex-print-queue}).@refill
11317
11318 @item C-c C-t C-k
11319 @itemx M-x tex-kill-job
11320 Kill the currently running @TeX{} job started by
11321 @code{texinfo-tex-region} or @code{texinfo-tex-buffer}, or any other
11322 process running in the Texinfo shell buffer.@refill
11323
11324 @item C-c C-t C-x
11325 @itemx M-x texinfo-quit-job
11326 Quit a @TeX{} formatting job that has stopped because of an error by
11327 sending an @key{x} to it. When you do this, @TeX{} preserves a record
11328 of what it did in a @file{.log} file.@refill
11329
11330 @item C-c C-t C-l
11331 @itemx M-x tex-recenter-output-buffer
11332 Redisplay the shell buffer in which the @TeX{} printing and formatting
11333 commands are run to show its most recent output.@refill
11334 @end table
11335
11336 @need 1000
11337 Thus, the usual sequence of commands for formatting a buffer is as
11338 follows (with comments to the right):@refill
11339
11340 @example
11341 @group
11342 C-c C-t C-b @r{Run @code{texi2dvi} on the buffer.}
11343 C-c C-t C-p @r{Print the @sc{dvi} file.}
11344 C-c C-t C-q @r{Display the printer queue.}
11345 @end group
11346 @end example
11347
11348 The Texinfo mode @TeX{} formatting commands start a subshell in Emacs
11349 called the @file{*tex-shell*}. The @code{texinfo-tex-command},
11350 @code{texinfo-texindex-command}, and @code{tex-dvi-print-command}
11351 commands are all run in this shell.
11352
11353 You can watch the commands operate in the @samp{*tex-shell*} buffer,
11354 and you can switch to and from and use the @samp{*tex-shell*} buffer
11355 as you would any other shell buffer.@refill
11356
11357 @need 1500
11358 The formatting and print commands depend on the values of several variables.
11359 The default values are:@refill
11360
11361 @example
11362 @group
11363 @r{Variable} @r{Default value}
11364
11365 texinfo-texi2dvi-command "texi2dvi"
11366 texinfo-tex-command "tex"
11367 texinfo-texindex-command "texindex"
11368 texinfo-delete-from-print-queue-command "lprm"
11369 texinfo-tex-trailer "@@bye"
11370 tex-start-of-header "%**start"
11371 tex-end-of-header "%**end"
11372 tex-dvi-print-command "lpr -d"
11373 tex-show-queue-command "lpq"
11374 @end group
11375 @end example
11376
11377 You can change the values of these variables with the @kbd{M-x
11378 edit-options} command (@pxref{Edit Options, , Editing Variable Values,
11379 emacs, The GNU Emacs Manual}), with the @kbd{M-x set-variable} command
11380 (@pxref{Examining, , Examining and Setting Variables, emacs, The GNU
11381 Emacs Manual}), or with your @file{.emacs} initialization file
11382 (@pxref{Init File, , , emacs, The GNU Emacs Manual}).@refill
11383
11384 @node Compile-Command, Requirements Summary, Texinfo Mode Printing, Format/Print Hardcopy
11385 @comment node-name, next, previous, up
11386 @section Using the Local Variables List
11387 @cindex Local variables
11388 @cindex Compile command for formatting
11389 @cindex Format with the compile command
11390
11391 Yet another way to apply the @TeX{} formatting command to a Texinfo file
11392 is to put that command in a @dfn{local variables list} at the end of the
11393 Texinfo file. You can then specify the @code{tex} or @code{texi2dvi}
11394 commands as a @code{compile-command} and have Emacs run it by typing
11395 @kbd{M-x compile}. This creates a special shell called the
11396 @file{*compilation*} buffer in which Emacs runs the compile command.
11397 For example, at the end of the @file{gdb.texinfo} file, after the
11398 @code{@@bye}, you could put the following:@refill
11399
11400 @example
11401 @group
11402 @@c Local Variables:
11403 @@c compile-command: "texi2dvi gdb.texinfo"
11404 @@c End:
11405 @end group
11406 @end example
11407
11408 @noindent
11409 This technique is most often used by programmers who also compile programs
11410 this way; see @ref{Compilation, , , emacs, The GNU Emacs Manual}.@refill
11411
11412 @node Requirements Summary, Preparing for TeX, Compile-Command, Format/Print Hardcopy
11413 @comment node-name, next, previous, up
11414 @section @TeX{} Formatting Requirements Summary
11415 @cindex Requirements for formatting
11416 @cindex Formatting requirements
11417
11418 Every Texinfo file that is to be input to @TeX{} must begin with a
11419 @code{\input} command and contain an @code{@@settitle} command:@refill
11420
11421 @example
11422 \input texinfo
11423 @@settitle @var{name-of-manual}
11424 @end example
11425
11426 @noindent
11427 The first command instructs @TeX{} to load the macros it needs to
11428 process a Texinfo file and the second command specifies the title of
11429 printed manual.@refill
11430
11431 @need 1000
11432 Every Texinfo file must end with a line that terminates @TeX{}
11433 processing and forces out unfinished pages:@refill
11434
11435 @example
11436 @@bye
11437 @end example
11438
11439 Strictly speaking, these three lines are all a Texinfo file needs for
11440 @TeX{}, besides the body. (The @code{@@setfilename} line is the only
11441 line that a Texinfo file needs for Info formatting.)@refill
11442
11443 Usually, the file's first line contains an @samp{@@c -*-texinfo-*-}
11444 comment that causes Emacs to switch to Texinfo mode when you edit the
11445 file. In addition, the beginning usually includes an
11446 @code{@@setfilename} for Info formatting, an @code{@@setchapternewpage}
11447 command, a title page, a copyright page, and permissions. Besides an
11448 @code{@@bye}, the end of a file usually includes indices and a table of
11449 contents.@refill
11450
11451 @iftex
11452 For more information, see
11453 @ref{setchapternewpage, , @code{@@setchapternewpage}},
11454 @ref{Headings, ,Page Headings},
11455 @ref{Titlepage & Copyright Page},
11456 @ref{Printing Indices & Menus}, and
11457 @ref{Contents}.
11458 @end iftex
11459 @noindent
11460 @ifinfo
11461 For more information, see@*
11462 @ref{setchapternewpage, , @code{@@setchapternewpage}},@*
11463 @ref{Headings, ,Page Headings},@*
11464 @ref{Titlepage & Copyright Page},@*
11465 @ref{Printing Indices & Menus}, and@*
11466 @ref{Contents}.
11467 @end ifinfo
11468
11469 @node Preparing for TeX, Overfull hboxes, Requirements Summary, Format/Print Hardcopy
11470 @comment node-name, next, previous, up
11471 @section Preparing to Use @TeX{}
11472 @cindex Preparing to use @TeX{}
11473 @cindex @TeX{} input initialization
11474 @cindex @code{TEXINPUTS} environment variable
11475 @vindex TEXINPUTS
11476 @cindex @b{.profile} initialization file
11477 @cindex @b{.cshrc} initialization file
11478 @cindex Initialization file for @TeX{} input
11479
11480 @TeX{} needs to know where to find the @file{texinfo.tex} file
11481 that you have told it to input with the @samp{\input texinfo} command
11482 at the beginning of the first line. The @file{texinfo.tex} file tells
11483 @TeX{} how to handle @@-commands. (@file{texinfo.tex} is
11484 included in the standard GNU distributions.)@refill
11485
11486 Usually, the @file{texinfo.tex} file is put in the default directory
11487 that contains @TeX{} macros (the @file{/usr/lib/tex/macros}
11488 directory) when GNU Emacs or other GNU software is installed.
11489 In this case, @TeX{} will
11490 find the file and you do not need to do anything special.
11491 Alternatively, you can put @file{texinfo.tex} in the directory in
11492 which the Texinfo source file is located, and @TeX{} will find it
11493 there.@refill
11494
11495 However, you may want to specify the location of the @code{\input} file
11496 yourself. One way to do this is to write the complete path for the file
11497 after the @code{\input} command. Another way is to set the
11498 @code{TEXINPUTS} environment variable in your @file{.cshrc} or
11499 @file{.profile} file. The @code{TEXINPUTS} environment variable will tell
11500 @TeX{} where to find the @file{texinfo.tex} file and any other file that
11501 you might want @TeX{} to use.@refill
11502
11503 Whether you use a @file{.cshrc} or @file{.profile} file depends on
11504 whether you use @code{csh}, @code{sh}, or @code{bash} for your shell
11505 command interpreter. When you use @code{csh}, it looks to the
11506 @file{.cshrc} file for initialization information, and when you use
11507 @code{sh} or @code{bash}, it looks to the @file{.profile} file.@refill
11508
11509 @need 1000
11510 In a @file{.cshrc} file, you could use the following @code{csh} command
11511 sequence:@refill
11512
11513 @example
11514 setenv TEXINPUTS .:/usr/me/mylib:/usr/lib/tex/macros
11515 @end example
11516
11517 @need 1000
11518 In a @file{.profile} file, you could use the following @code{sh} command
11519 sequence:
11520
11521 @example
11522 @group
11523 TEXINPUTS=.:/usr/me/mylib:/usr/lib/tex/macros
11524 export TEXINPUTS
11525 @end group
11526 @end example
11527
11528 @noindent
11529 This would cause @TeX{} to look for @file{\input} file first in the current
11530 directory, indicated by the @samp{.}, then in a hypothetical user's
11531 @file{me/mylib} directory, and finally in the system library.@refill
11532
11533 @node Overfull hboxes, smallbook, Preparing for TeX, Format/Print Hardcopy
11534 @comment node-name, next, previous, up
11535 @section Overfull ``hboxes''
11536 @cindex Overfull @samp{hboxes}
11537 @cindex @samp{hboxes}, overfull
11538 @cindex Final output
11539
11540 @TeX{} is sometimes unable to typeset a line without extending it into
11541 the right margin. This can occur when @TeX{} comes upon what it
11542 interprets as a long word that it cannot hyphenate, such as an
11543 electronic mail network address or a very long title. When this
11544 happens, @TeX{} prints an error message like this:@refill
11545
11546 @example
11547 Overfull \hbox (20.76302pt too wide)
11548 @end example
11549
11550 @noindent
11551 (In @TeX{}, lines are in ``horizontal boxes'', hence the term, ``hbox''.
11552 The backslash, @samp{\}, is the @TeX{} equivalent of @samp{@@}.)@refill
11553
11554 @TeX{} also provides the line number in the Texinfo source file and
11555 the text of the offending line, which is marked at all the places that
11556 @TeX{} knows how to hyphenate words.
11557 @xref{Debugging with TeX, , Catching Errors with @TeX{} Formatting},
11558 for more information about typesetting errors.@refill
11559
11560 If the Texinfo file has an overfull hbox, you can rewrite the sentence
11561 so the overfull hbox does not occur, or you can decide to leave it. A
11562 small excursion into the right margin often does not matter and may not
11563 even be noticeable.@refill
11564
11565 @cindex Black rectangle in hardcopy
11566 @cindex Rectangle, ugly, black in hardcopy
11567 However, unless told otherwise, @TeX{} will print a large, ugly, black
11568 rectangle beside the line that contains the overful hbox. This is so
11569 you will notice the location of the problem if you are correcting a
11570 draft.@refill
11571
11572 @need 1000
11573 @findex finalout
11574 To prevent such a monstrosity from marring your final printout, write
11575 the following in the beginning of the Texinfo file on a line of its own,
11576 before the @code{@@titlepage} command:@refill
11577
11578 @example
11579 @@finalout
11580 @end example
11581
11582 @node smallbook, A4 Paper, Overfull hboxes, Format/Print Hardcopy
11583 @comment node-name, next, previous, up
11584 @section Printing ``Small'' Books
11585 @findex smallbook
11586 @cindex Small book size
11587 @cindex Book, printing small
11588 @cindex Page sizes for books
11589 @cindex Size of printed book
11590
11591 By default, @TeX{} typesets pages for printing in an 8.5 by 11 inch
11592 format. However, you can direct @TeX{} to typeset a document in a 7 by
11593 9.25 inch format that is suitable for bound books by inserting the
11594 following command on a line by itself at the beginning of the Texinfo
11595 file, before the title page:@refill
11596
11597 @example
11598 @@smallbook
11599 @end example
11600
11601 @noindent
11602 (Since regular sized books are often about 7 by 9.25 inches, this
11603 command might better have been called the @code{@@regularbooksize}
11604 command, but it came to be called the @code{@@smallbook} command by
11605 comparison to the 8.5 by 11 inch format.)@refill
11606
11607 If you write the @code{@@smallbook} command between the
11608 start-of-header and end-of-header lines, the Texinfo mode @TeX{}
11609 region formatting command, @code{texinfo-tex-region}, will format the
11610 region in ``small'' book size (@pxref{Start of Header}).@refill
11611
11612 The Free Software Foundation distributes printed copies of @cite{The GNU
11613 Emacs Manual} and other manuals in the ``small'' book size.
11614 @xref{smallexample & smalllisp, , @code{@@smallexample} and
11615 @code{@@smalllisp}}, for information about commands that make it easier
11616 to produce examples for a smaller manual.@refill
11617
11618 @node A4 Paper, Cropmarks and Magnification, smallbook, Format/Print Hardcopy
11619 @comment node-name, next, previous, up
11620 @section Printing on A4 Paper
11621 @cindex A4 paper, printing on
11622 @cindex Paper size, European A4
11623 @cindex European A4 paper
11624 @findex afourpaper
11625
11626 You can tell @TeX{} to typeset a document for printing on European size
11627 A4 paper with the @code{@@afourpaper} command. Write the command on a
11628 line by itself between @code{@@iftex} and @code{@@end iftex} lines near
11629 the beginning of the Texinfo file, before the title page:@refill
11630
11631 For example, this is how you would write the header for this manual:@refill
11632
11633 @example
11634 @group
11635 \input texinfo @@c -*-texinfo-*-
11636 @@c %**start of header
11637 @@setfilename texinfo
11638 @@settitle Texinfo
11639 @@syncodeindex vr fn
11640 @@iftex
11641 @@afourpaper
11642 @@end iftex
11643 @@c %**end of header
11644 @end group
11645 @end example
11646
11647 @node Cropmarks and Magnification, , A4 Paper, Format/Print Hardcopy
11648 @comment node-name, next, previous, up
11649 @section Cropmarks and Magnification
11650
11651 @findex cropmarks
11652 @cindex Cropmarks for printing
11653 @cindex Printing cropmarks
11654 You can attempt to direct @TeX{} to print cropmarks at the corners of
11655 pages with the @code{@@cropmarks} command. Write the @code{@@cropmarks}
11656 command on a line by itself between @code{@@iftex} and @code{@@end
11657 iftex} lines near the beginning of the Texinfo file, before the title
11658 page, like this:@refill
11659
11660 @example
11661 @group
11662 @@iftex
11663 @@cropmarks
11664 @@end iftex
11665 @end group
11666 @end example
11667
11668 This command is mainly for printers that typeset several pages on one
11669 sheet of film; but you can attempt to use it to mark the corners of a
11670 book set to 7 by 9.25 inches with the @code{@@smallbook} command.
11671 (Printers will not produce cropmarks for regular sized output that is
11672 printed on regular sized paper.) Since different printing machines work
11673 in different ways, you should explore the use of this command with a
11674 spirit of adventure. You may have to redefine the command in the
11675 @file{texinfo.tex} definitions file.@refill
11676
11677 @findex mag @r{(@TeX{} command)}
11678 @cindex Magnified printing
11679 @cindex Larger or smaller pages
11680 You can attempt to direct @TeX{} to typeset pages larger or smaller than
11681 usual with the @code{\mag} @TeX{} command. Everything that is typeset
11682 is scaled proportionally larger or smaller. (@code{\mag} stands for
11683 ``magnification''.) This is @emph{not} a Texinfo @@-command, but is a
11684 Plain@TeX{} command that is prefixed with a backslash. You have to
11685 write this command between @code{@@tex} and @code{@@end tex}
11686 (@pxref{Using Ordinary TeX Commands, , Using Ordinary @TeX{}
11687 Commands}).@refill
11688
11689 Follow the @code{\mag} command with an @samp{=} and then a number that
11690 is 1000 times the magnification you desire. For example, to print pages
11691 at 1.2 normal size, write the following near the beginning of the
11692 Texinfo file, before the title page:@refill
11693
11694 @example
11695 @group
11696 @@tex
11697 \mag=1200
11698 @@end tex
11699 @end group
11700 @end example
11701
11702 With some printing technologies, you can print normal-sized copies that
11703 look better than usual by using a larger-than-normal master.@refill
11704
11705 Depending on your system, @code{\mag} may not work or may work only at
11706 certain magnifications. Be prepared to experiment.@refill
11707
11708 @node Create an Info File, Install an Info File, Format/Print Hardcopy, Top
11709 @comment node-name, next, previous, up
11710 @chapter Creating an Info File
11711 @cindex Creating an Info file
11712 @cindex Info, creating an on-line file
11713 @cindex Formatting a file for Info
11714
11715 @code{makeinfo} is a utility that converts a Texinfo file into an Info
11716 file; @code{texinfo-format-region} and @code{texinfo-format-buffer} are
11717 GNU Emacs functions that do the same.@refill
11718
11719 A Texinfo file must possess an @code{@@setfilename} line near its
11720 beginning, otherwise the Info formatting commands will fail.@refill
11721
11722 For information on installing the Info file in the Info system, see
11723 @ref{Install an Info File}.@refill
11724
11725 @menu
11726 * makeinfo advantages:: @code{makeinfo} provides better error checking.
11727 * Invoking makeinfo:: How to run @code{makeinfo} from a shell.
11728 * makeinfo options:: Specify fill-column and other options.
11729 * Pointer Validation:: How to check that pointers point somewhere.
11730 * makeinfo in Emacs:: How to run @code{makeinfo} from Emacs.
11731 * texinfo-format commands:: Two Info formatting commands written
11732 in Emacs Lisp are an alternative
11733 to @code{makeinfo}.
11734 * Batch Formatting:: How to format for Info in Emacs Batch mode.
11735 * Tag and Split Files:: How tagged and split files help Info
11736 to run better.
11737 @end menu
11738
11739 @node makeinfo advantages, Invoking makeinfo, Create an Info File, Create an Info File
11740 @ifinfo
11741 @heading @code{makeinfo} Preferred
11742 @end ifinfo
11743
11744 The @code{makeinfo} utility creates an Info file from a Texinfo source
11745 file more quickly than either of the Emacs formatting commands and
11746 provides better error messages. We recommend it. @code{makeinfo} is a
11747 C program that is independent of Emacs. You do not need to run Emacs to
11748 use @code{makeinfo}, which means you can use @code{makeinfo} on machines
11749 that are too small to run Emacs. You can run @code{makeinfo} in
11750 any one of three ways: from an operating system shell, from a shell
11751 inside Emacs, or by typing a key command in Texinfo mode in Emacs.
11752 @refill
11753
11754 The @code{texinfo-format-region} and the @code{texinfo-format-buffer}
11755 commands are useful if you cannot run @code{makeinfo}. Also, in some
11756 circumstances, they format short regions or buffers more quickly than
11757 @code{makeinfo}.@refill
11758
11759 @node Invoking makeinfo, makeinfo options, makeinfo advantages, Create an Info File
11760 @section Running @code{makeinfo} from a Shell
11761
11762 To create an Info file from a Texinfo file, type @code{makeinfo}
11763 followed by the name of the Texinfo file. Thus, to create the Info
11764 file for Bison, type the following at the shell prompt (where @samp{%}
11765 is the prompt):@refill
11766
11767 @example
11768 % makeinfo bison.texinfo
11769 @end example
11770
11771 (You can run a shell inside Emacs by typing @kbd{M-x
11772 shell}.)@refill
11773
11774 @ifinfo
11775 Sometimes you will want to specify options. For example, if you wish
11776 to discover which version of @code{makeinfo} you are using,
11777 type:@refill
11778
11779 @example
11780 % makeinfo --version
11781 @end example
11782
11783 @xref{makeinfo options}, for more information.
11784 @end ifinfo
11785
11786 @node makeinfo options, Pointer Validation, Invoking makeinfo, Create an Info File
11787 @comment node-name, next, previous, up
11788 @section Options for @code{makeinfo}
11789 @cindex @code{makeinfo} options
11790 @cindex Options for @code{makeinfo}
11791
11792 The @code{makeinfo} command takes a number of options. Most often,
11793 options are used to set the value of the fill column and specify the
11794 footnote style. Each command line option is a word preceded by
11795 @samp{--}@footnote{@samp{--} has replaced @samp{+}, the old introductory
11796 character, to maintain POSIX.2 compatibility without losing long-named
11797 options.} or a letter preceded by @samp{-}. You can use abbreviations
11798 for the option names as long as they are unique.@refill
11799
11800 For example, you could use the following command to create an Info
11801 file for @file{bison.texinfo} in which each line is filled to only 68
11802 columns (where @samp{%} is the prompt):@refill
11803
11804 @example
11805 % makeinfo --fill-column=68 bison.texinfo
11806 @end example
11807
11808 You can write two or more options in sequence, like this:@refill
11809
11810 @example
11811 % makeinfo --no-split --fill-column=70 @dots{}
11812 @end example
11813
11814 @noindent
11815 This would keep the Info file together as one possibly very long
11816 file and would also set the fill column to 70.@refill
11817
11818 @iftex
11819 If you wish to discover which version of @code{makeinfo}
11820 you are using, type:@refill
11821
11822 @example
11823 % makeinfo --version
11824 @end example
11825 @end iftex
11826
11827 The options are:@refill
11828
11829 @need 100
11830 @table @code
11831 @item -D @var{var}
11832 Cause @var{var} to be defined. This is equivalent to
11833 @code{@@set @var{var}} in the Texinfo file.
11834
11835 @need 150
11836 @item --error-limit @var{limit}
11837 Set the maximum number of errors that @code{makeinfo} will report
11838 before exiting (on the assumption that continuing would be useless).
11839 The default number of errors that can be reported before
11840 @code{makeinfo} gives up is 100.@refill
11841
11842 @need 150
11843 @item --fill-column @var{width}
11844 Specify the maximum number of columns in a line; this is the right-hand
11845 edge of a line. Paragraphs that are filled will be filled to this
11846 width. (Filling is the process of breaking up and connecting lines so
11847 that lines are the same length as or shorter than the number specified
11848 as the fill column. Lines are broken between words.) The default value
11849 for @code{fill-column} is 72.
11850 @refill
11851
11852 @item --footnote-style @var{style}
11853 Set the footnote style to @var{style}, either @samp{end} for the end
11854 node style or @samp{separate} for the separate node style. The value
11855 set by this option overrides the value set in a Texinfo file by an
11856 @code{@@footnotestyle} command. When the footnote style is
11857 @samp{separate}, @code{makeinfo} makes a new node containing the
11858 footnotes found in the current node. When the footnote style is
11859 @samp{end}, @code{makeinfo} places the footnote references at the end
11860 of the current node.@refill
11861
11862 @need 150
11863 @item -I @var{dir}
11864 Add @code{dir} to the directory search list for finding files that are
11865 included using the @code{@@include} command. By default,
11866 @code{makeinfo} searches only the current directory.
11867
11868 @need 150
11869 @item --no-headers
11870 Do not include menus or node lines in the output. This results in an
11871 @sc{ascii} file that you cannot read in Info since it does not contain
11872 the requisite nodes or menus; but you can print such a file in a
11873 single, typewriter-like font and produce acceptable output.
11874
11875 @need 150
11876 @item --no-split
11877 Suppress the splitting stage of @code{makeinfo}. Normally, large
11878 output files (where the size is greater than 70k bytes) are split into
11879 smaller subfiles, each one approximately 50k bytes. If you specify
11880 @samp{--no-split}, @code{makeinfo} will not split up the output
11881 file.@refill
11882
11883 @need 100
11884 @item --no-pointer-validate
11885 @item --no-validate
11886 Suppress the pointer-validation phase of @code{makeinfo}. Normally,
11887 after a Texinfo file is processed, some consistency checks are made to
11888 ensure that cross references can be resolved, etc.
11889 @xref{Pointer Validation}.@refill
11890
11891 @need 150
11892 @item --no-warn
11893 Suppress the output of warning messages. This does @emph{not}
11894 suppress the output of error messages, only warnings. You might
11895 want this if the file you are creating has examples of Texinfo cross
11896 references within it, and the nodes that are referenced do not actually
11897 exist.@refill
11898
11899 @item --no-number-footnotes
11900 Suppress automatic footnote numbering. By default, @code{makeinfo}
11901 numbers each footnote sequentially in a single node, resetting the
11902 current footnote number to 1 at the start of each node.
11903
11904 @need 150
11905 @item --output @var{file}
11906 @itemx -o @var{file}
11907 Specify that the output should be directed to @var{file} and not to the
11908 file name specified in the @code{@@setfilename} command found in the Texinfo
11909 source. @var{file} can be the special token @samp{-}, which specifies
11910 standard output.
11911
11912 @need 150
11913 @item --paragraph-indent @var{indent}
11914 Set the paragraph indentation style to @var{indent}. The value set by
11915 this option overrides the value set in a Texinfo file by an
11916 @code{@@paragraphindent} command. The value of @var{indent} is
11917 interpreted as follows:@refill
11918
11919 @itemize @bullet
11920 @item
11921 If the value of @var{indent} is @samp{asis}, do not change the
11922 existing indentation at the starts of paragraphs.@refill
11923
11924 @item
11925 If the value of @var{indent} is zero, delete any existing
11926 indentation.@refill
11927
11928 @item
11929 If the value of @var{indent} is greater than zero, indent each
11930 paragraph by that number of spaces.@refill
11931 @end itemize
11932
11933 @need 100
11934 @item --reference-limit @var{limit}
11935 Set the value of the number of references to a node that
11936 @code{makeinfo} will make without reporting a warning. If a node has more
11937 than this number of references in it, @code{makeinfo} will make the
11938 references but also report a warning.@refill
11939
11940 @need 150
11941 @item -U @var{var}
11942 Cause @var{var} to be undefined. This is equivalent to
11943 @code{@@clear @var{var}} in the Texinfo file.
11944
11945 @need 100
11946 @item --verbose
11947 Cause @code{makeinfo} to display messages saying what it is doing.
11948 Normally, @code{makeinfo} only outputs messages if there are errors or
11949 warnings.@refill
11950
11951 @need 100
11952 @item --version
11953 Report the version number of this copy of @code{makeinfo}.@refill
11954 @end table
11955
11956 @node Pointer Validation, makeinfo in Emacs, makeinfo options, Create an Info File
11957 @section Pointer Validation
11958 @cindex Pointer validation with @code{makeinfo}
11959 @cindex Validation of pointers
11960
11961 If you do not suppress pointer-validation, @code{makeinfo} will check
11962 the validity of the final Info file. Mostly, this means ensuring that
11963 nodes you have referenced really exist. Here is a complete list of what
11964 is checked:@refill
11965
11966 @enumerate
11967 @item
11968 If a `Next', `Previous', or `Up' node reference is a reference to a
11969 node in the current file and is not an external reference such as to
11970 @file{(dir)}, then the referenced node must exist.@refill
11971
11972 @item
11973 In every node, if the `Previous' node is different from the `Up' node,
11974 then the `Previous' node must also be pointed to by a `Next' node.@refill
11975
11976 @item
11977 Every node except the `Top' node must have an `Up' pointer.@refill
11978
11979 @item
11980 The node referenced by an `Up' pointer must contain a reference to the
11981 current node in some manner other than through a `Next' reference.
11982 This includes menu entries and cross references.@refill
11983
11984 @item
11985 If the `Next' reference of a node is not the same as the `Next' reference
11986 of the `Up' reference, then the node referenced by the `Next' pointer
11987 must have a `Previous' pointer that points back to the current node.
11988 This rule allows the last node in a section to point to the first node
11989 of the next chapter.@refill
11990 @end enumerate
11991
11992 @node makeinfo in Emacs, texinfo-format commands, Pointer Validation, Create an Info File
11993 @section Running @code{makeinfo} inside Emacs
11994 @cindex Running @code{makeinfo} in Emacs
11995 @cindex @code{makeinfo} inside Emacs
11996 @cindex Shell, running @code{makeinfo} in
11997
11998 You can run @code{makeinfo} in GNU Emacs Texinfo mode by using either the
11999 @code{makeinfo-region} or the @code{makeinfo-buffer} commands. In
12000 Texinfo mode, the commands are bound to @kbd{C-c C-m C-r} and @kbd{C-c
12001 C-m C-b} by default.@refill
12002
12003 @table @kbd
12004 @item C-c C-m C-r
12005 @itemx M-x makeinfo-region
12006 Format the current region for Info.@refill
12007 @findex makeinfo-region
12008
12009 @item C-c C-m C-b
12010 @itemx M-x makeinfo-buffer
12011 Format the current buffer for Info.@refill
12012 @findex makeinfo-buffer
12013 @end table
12014
12015 When you invoke either @code{makeinfo-region} or
12016 @code{makeinfo-buffer}, Emacs prompts for a file name, offering the
12017 name of the visited file as the default. You can edit the default
12018 file name in the minibuffer if you wish, before typing @key{RET} to
12019 start the @code{makeinfo} process.@refill
12020
12021 The Emacs @code{makeinfo-region} and @code{makeinfo-buffer} commands
12022 run the @code{makeinfo} program in a temporary shell buffer. If
12023 @code{makeinfo} finds any errors, Emacs displays the error messages in
12024 the temporary buffer.@refill
12025
12026 @cindex Errors, parsing
12027 @cindex Parsing errors
12028 @findex next-error
12029 You can parse the error messages by typing @kbd{C-x `}
12030 (@code{next-error}). This causes Emacs to go to and position the
12031 cursor on the line in the Texinfo source that @code{makeinfo} thinks
12032 caused the error. @xref{Compilation, , Running @code{make} or
12033 Compilers Generally, emacs, The GNU Emacs Manual}, for more
12034 information about using the @code{next-error} command.@refill
12035
12036 In addition, you can kill the shell in which the @code{makeinfo}
12037 command is running or make the shell buffer display its most recent
12038 output.@refill
12039
12040 @table @kbd
12041 @item C-c C-m C-k
12042 @itemx M-x makeinfo-kill-job
12043 @findex makeinfo-kill-job
12044 Kill the current running @code{makeinfo} job created by
12045 @code{makeinfo-region} or @code{makeinfo-buffer}.@refill
12046
12047 @item C-c C-m C-l
12048 @itemx M-x makeinfo-recenter-output-buffer
12049 @findex makeinfo-recenter-output-buffer
12050 Redisplay the @code{makeinfo} shell buffer to display its most recent
12051 output.@refill
12052 @end table
12053
12054 @noindent
12055 (Note that the parallel commands for killing and recentering a @TeX{}
12056 job are @kbd{C-c C-t C-k} and @kbd{C-c C-t C-l}. @xref{Texinfo Mode
12057 Printing}.)@refill
12058
12059 You can specify options for @code{makeinfo} by setting the
12060 @code{makeinfo-options} variable with either the @kbd{M-x
12061 edit-options} or the @kbd{M-x set-variable} command, or by setting the
12062 variable in your @file{.emacs} initialization file.@refill
12063
12064 For example, you could write the following in your @file{.emacs} file:@refill
12065
12066 @example
12067 @group
12068 (setq makeinfo-options
12069 "--paragraph-indent=0 --no-split
12070 --fill-column=70 --verbose")
12071 @end group
12072 @end example
12073
12074 @c If you write these three cross references using xref, you see
12075 @c three references to the same named manual, which looks strange.
12076 @iftex
12077 For more information, see @ref{makeinfo options, , Options for
12078 @code{makeinfo}}, as well as ``Editing Variable Values,''``Examining and
12079 Setting Variables,'' and ``Init File'' in the @cite{The GNU Emacs
12080 Manual}.
12081 @end iftex
12082 @noindent
12083 @ifinfo
12084 For more information, see@*
12085 @ref{Edit Options, , Editing Variable Values, emacs, The GNU Emacs Manual},@*
12086 @ref{Examining, , Examining and Setting Variables, emacs, The GNU Emacs Manual},@*
12087 @ref{Init File, , , emacs, The GNU Emacs Manual}, and@*
12088 @ref{makeinfo options, , Options for @code{makeinfo}}.
12089 @end ifinfo
12090
12091 @node texinfo-format commands, Batch Formatting, makeinfo in Emacs, Create an Info File
12092 @comment node-name, next, previous, up
12093 @section The @code{texinfo-format@dots{}} Commands
12094 @findex texinfo-format-region
12095 @findex texinfo-format-buffer
12096
12097 In GNU Emacs in Texinfo mode, you can format part or all of a Texinfo
12098 file with the @code{texinfo-format-region} command. This formats the
12099 current region and displays the formatted text in a temporary buffer
12100 called @samp{*Info Region*}.@refill
12101
12102 Similarly, you can format a buffer with the
12103 @code{texinfo-format-buffer} command. This command creates a new
12104 buffer and generates the Info file in it. Typing @kbd{C-x C-s} will
12105 save the Info file under the name specified by the
12106 @code{@@setfilename} line which must be near the beginning of the
12107 Texinfo file.@refill
12108
12109 @table @kbd
12110 @item C-c C-e C-r
12111 @itemx @code{texinfo-format-region}
12112 Format the current region for Info.
12113 @findex texinfo-format-region
12114
12115 @item C-c C-e C-b
12116 @itemx @code{texinfo-format-buffer}
12117 Format the current buffer for Info.
12118 @findex texinfo-format-buffer
12119 @end table
12120
12121 The @code{texinfo-format-region} and @code{texinfo-format-buffer}
12122 commands provide you with some error checking, and other functions can
12123 provide you with further help in finding formatting errors. These
12124 procedures are described in an appendix; see @ref{Catching Mistakes}.
12125 However, the @code{makeinfo} program is often faster and
12126 provides better error checking (@pxref{makeinfo in Emacs}).@refill
12127
12128 @node Batch Formatting, Tag and Split Files, texinfo-format commands, Create an Info File
12129 @comment node-name, next, previous, up
12130 @section Batch Formatting
12131 @cindex Batch formatting for Info
12132 @cindex Info batch formatting
12133
12134 You can format Texinfo files for Info using @code{batch-texinfo-format}
12135 and Emacs Batch mode. You can run Emacs in Batch mode from any shell,
12136 including a shell inside of Emacs. (@xref{Command Switches, , Command
12137 Line Switches and Arguments, emacs, The GNU Emacs Manual}.)@refill
12138
12139 Here is the command to format all the files that end in @file{.texinfo}
12140 in the current directory (where @samp{%} is the shell prompt):@refill
12141
12142 @example
12143 % emacs -batch -funcall batch-texinfo-format *.texinfo
12144 @end example
12145
12146 @noindent
12147 Emacs processes all the files listed on the command line, even if an
12148 error occurs while attempting to format some of them.@refill
12149
12150 Run @code{batch-texinfo-format} only with Emacs in Batch mode as shown;
12151 it is not interactive. It kills the Batch mode Emacs on completion.@refill
12152
12153 @code{batch-texinfo-format} is convenient if you lack @code{makeinfo}
12154 and want to format several Texinfo files at once. When you use Batch
12155 mode, you create a new Emacs process. This frees your current Emacs, so
12156 you can continue working in it. (When you run
12157 @code{texinfo-format-region} or @code{texinfo-format-buffer}, you cannot
12158 use that Emacs for anything else until the command finishes.)@refill
12159
12160 @node Tag and Split Files, , Batch Formatting, Create an Info File
12161 @comment node-name, next, previous, up
12162 @section Tag Files and Split Files
12163 @cindex Making a tag table automatically
12164 @cindex Tag table, making automatically
12165
12166 If a Texinfo file has more than 30,000 bytes,
12167 @code{texinfo-format-buffer} automatically creates a tag table
12168 for its Info file; @code{makeinfo} always creates a tag table. With
12169 a @dfn{tag table}, Info can jump to new nodes more quickly than it can
12170 otherwise.@refill
12171
12172 @cindex Indirect subfiles
12173 In addition, if the Texinfo file contains more than about 70,000
12174 bytes, @code{texinfo-format-buffer} and @code{makeinfo} split the
12175 large Info file into shorter @dfn{indirect} subfiles of about 50,000
12176 bytes each. Big files are split into smaller files so that Emacs does
12177 not need to make a large buffer to hold the whole of a large Info
12178 file; instead, Emacs allocates just enough memory for the small, split
12179 off file that is needed at the time. This way, Emacs avoids wasting
12180 memory when you run Info. (Before splitting was implemented, Info
12181 files were always kept short and @dfn{include files} were designed as
12182 a way to create a single, large printed manual out of the smaller Info
12183 files. @xref{Include Files}, for more information. Include files are
12184 still used for very large documents, such as @cite{The Emacs Lisp
12185 Reference Manual}, in which each chapter is a separate file.)@refill
12186
12187 When a file is split, Info itself makes use of a shortened version of
12188 the original file that contains just the tag table and references to
12189 the files that were split off. The split off files are called
12190 @dfn{indirect} files.@refill
12191
12192 The split off files have names that are created by appending @w{@samp{-1}},
12193 @w{@samp{-2}}, @w{@samp{-3}} and so on to the file name specified by the
12194 @code{@@setfilename} command. The shortened version of the original file
12195 continues to have the name specified by @code{@@setfilename}.@refill
12196
12197 At one stage in writing this document, for example, the Info file was saved
12198 as @file{test-texinfo} and that file looked like this:@refill
12199
12200 @example
12201 @group
12202 Info file: test-texinfo, -*-Text-*-
12203 produced by texinfo-format-buffer
12204 from file: new-texinfo-manual.texinfo
12205
12206 ^_
12207 Indirect:
12208 test-texinfo-1: 102
12209 test-texinfo-2: 50422
12210 @end group
12211 @group
12212 test-texinfo-3: 101300
12213 ^_^L
12214 Tag table:
12215 (Indirect)
12216 Node: overview^?104
12217 Node: info file^?1271
12218 @end group
12219 @group
12220 Node: printed manual^?4853
12221 Node: conventions^?6855
12222 @dots{}
12223 @end group
12224 @end example
12225
12226 @noindent
12227 (But @file{test-texinfo} had far more nodes than are shown here.) Each of
12228 the split off, indirect files, @file{test-texinfo-1},
12229 @file{test-texinfo-2}, and @file{test-texinfo-3}, is listed in this file
12230 after the line that says @samp{Indirect:}. The tag table is listed after
12231 the line that says @samp{Tag table:}. @refill
12232
12233 In the list of indirect files, the number following the file name
12234 records the cumulative number of bytes in the preceding indirect files,
12235 not counting the file list itself, the tag table, or the permissions
12236 text in each file. In the tag table, the number following the node name
12237 records the location of the beginning of the node, in bytes from the
12238 beginning.@refill
12239
12240 If you are using @code{texinfo-format-buffer} to create Info files,
12241 you may want to run the @code{Info-validate} command. (The
12242 @code{makeinfo} command does such a good job on its own, you do not
12243 need @code{Info-validate}.) However, you cannot run the @kbd{M-x
12244 Info-validate} node-checking command on indirect files. For
12245 information on how to prevent files from being split and how to
12246 validate the structure of the nodes, see @ref{Using
12247 Info-validate}.@refill
12248
12249 @node Install an Info File, Command List, Create an Info File, Top
12250 @comment node-name, next, previous, up
12251 @chapter Installing an Info File
12252 @cindex Installing an Info file
12253 @cindex Info file installation
12254 @cindex @file{dir} directory for Info installation
12255
12256 Info files are usually kept in the @file{info} directory. You can read
12257 Info files using the standalone Info program or the Info reader built
12258 into Emacs. (@inforef{Top, info, info}, for an introduction to Info.)
12259
12260 @menu
12261 * Directory file:: The top level menu for all Info files.
12262 * New Info File:: Listing a new info file.
12263 * Other Info Directories:: How to specify Info files that are
12264 located in other directories.
12265 @end menu
12266
12267 @node Directory file, New Info File, Install an Info File, Install an Info File
12268 @ifinfo
12269 @heading The @file{dir} File
12270 @end ifinfo
12271
12272 For Info to work, the @file{info} directory must contain a file that
12273 serves as a top level directory for the Info system. By convention,
12274 this file is called @file{dir}. (You can find the location of this file
12275 within Emacs by typing @kbd{C-h i} to enter Info and then typing
12276 @kbd{C-x C-f} to see the pathname to the @file{info} directory.)
12277
12278 The @file{dir} file is itself an Info file. It contains the top level
12279 menu for all the Info files in the system. The menu looks like
12280 this:@refill
12281
12282 @example
12283 @group
12284 * Menu:
12285
12286 * Info: (info). Documentation browsing system.
12287 * Emacs: (emacs). The extensible, self-documenting
12288 text editor.
12289 * Texinfo: (texinfo). With one source file, make
12290 either a printed manual using
12291 TeX or an Info file.
12292 @dots{}
12293 @end group
12294 @end example
12295
12296 Each of these menu entries points to the `Top' node of the Info file
12297 that is named in parentheses. (The menu entry does not need to
12298 specify the `Top' node, since Info goes to the `Top' node if no node
12299 name is mentioned. @xref{Other Info Files, , Nodes in Other Info
12300 Files}.)@refill
12301
12302 Thus, the @samp{Info} entry points to the `Top' node of the
12303 @file{info} file and the @samp{Emacs} entry points to the `Top' node
12304 of the @file{emacs} file.@refill
12305
12306 In each of the Info files, the `Up' pointer of the `Top' node refers
12307 back to the @code{dir} file. For example, the line for the `Top'
12308 node of the Emacs manual looks like this in Info:@refill
12309
12310 @example
12311 File: emacs Node: Top, Up: (DIR), Next: Distrib
12312 @end example
12313
12314 @noindent
12315 (Note that in this case, the @file{dir} file name is written in upper
12316 case letters---it can be written in either upper or lower case. Info
12317 has a feature that it will change the case of the file name to lower
12318 case if it cannot find the name as written.)@refill
12319
12320 @c !!! Can any file name be written in upper or lower case,
12321 @c or is dir a special case?
12322 @c Yes, apparently so, at least with Gillespie's Info. --rjc 24mar92
12323 @c
12324 @node New Info File, Other Info Directories, Directory file, Install an Info File
12325 @section Listing a New Info File
12326 @cindex Adding a new info file
12327 @cindex Listing a new info file
12328 @cindex New info file, listing it in @file{dir} file
12329 @cindex Info file, listing new one
12330 @cindex @file{dir} file listing
12331
12332 To add a new Info file to your system, write a menu entry for it in the
12333 menu in the @file{dir} file in the @file{info} directory. Also, move
12334 the new Info file itself to the @file{info} directory. For example, if
12335 you were adding documentation for GDB, you would write the following new
12336 entry:@refill
12337
12338 @example
12339 * GDB: (gdb). The source-level C debugger.
12340 @end example
12341
12342 @noindent
12343 The first part of the menu entry is the menu entry name, followed by a
12344 colon. The second part is the name of the Info file, in parentheses,
12345 followed by a period. The third part is the description.@refill
12346
12347 Conventionally, the name of an Info file has a @file{.info} extension.
12348 Thus, you might list the name of the file like this:
12349
12350 @example
12351 * GDB: (gdb.info). The source-level C debugger.
12352 @end example
12353
12354 @noindent
12355 However, Info will look for a file with a @file{.info} extension if it
12356 does not find the file under the name given in the menu. This means
12357 that you can refer to the file @file{gdb.info} as @file{gdb}, as shown
12358 in the first example. This looks better.
12359
12360 @node Other Info Directories, , New Info File, Install an Info File
12361 @comment node-name, next, previous, up
12362 @section Info Files in Other Directories
12363 @cindex Installing Info in another directory
12364 @cindex Info installed in another directory
12365 @cindex Another Info directory
12366
12367 If an Info file is not in the @file{info} directory, there are three
12368 ways to specify its location:@refill
12369
12370 @itemize @bullet
12371 @item
12372 Write the pathname in the @file{dir} file as the second part of the
12373 menu.@refill
12374
12375 @item
12376 If you are using Emacs, list the name of the file in a second @file{dir}
12377 file, in its directory; and then add the name of that directory to the
12378 @code{Info-directory-list} variable in your personal or site
12379 initialization file.
12380
12381 This tells Emacs's Info reader reader where to look for @file{dir}
12382 files. Emacs merges the files named @file{dir} from each of the listed
12383 directories. (In Emacs Version 18, you can set the
12384 @code{Info-directory} variable to the name of only one
12385 directory.)@refill
12386
12387 @item
12388 Specify the @file{info} directory name in an environment variable in
12389 your @file{.profile} or @file{.cshrc} initialization file. (Only you
12390 and others who set this environment variable will be able to find Info
12391 files whose location is specified this way.)@refill
12392 @end itemize
12393
12394 For example, to reach a test file in the @file{~bob/manuals}
12395 directory, you could add an entry like this to the menu in the
12396 @file{dir} file:@refill
12397
12398 @example
12399 * Test: (/usr/bob/manuals/info-test). Bob's own test file.
12400 @end example
12401
12402 @noindent
12403 In this case, the absolute file name of the @file{info-test} file is
12404 written as the second part of the menu entry.@refill
12405
12406 @vindex Info-directory-list
12407 Alternatively, you could write the following in your @file{.emacs}
12408 file:@refill
12409
12410 @example
12411 @group
12412 (setq Info-directory-list
12413 '("/usr/bob/manuals"
12414 "/usr/local/emacs/info"))
12415 @end group
12416 @end example
12417
12418 @c reworded to avoid overfill hbox
12419 This tells Emacs to merge the @file{dir} file from the
12420 @file{/usr/bob/manuals} directory with the @file{dir} file from the
12421 @file{"/usr/local/emacs/info}" directory. Info will list the
12422 @file{/usr/bob/manuals/info-test} file as a menu entry in the
12423 @file{/usr/bob/manuals/dir} file.@refill
12424
12425 @vindex INFOPATH
12426 Finally, you can tell Info where to look by setting the
12427 @code{INFOPATH} environment variable in your @file{.cshrc} or
12428 @file{.profile} file.@refill
12429
12430 If you use @code{sh} or @code{bash} for your shell command interpreter,
12431 you must set the @code{INFOPATH} environment variable in the
12432 @file{.profile} initialization file; but if you use @code{csh}, you must
12433 set the variable in the @file{.cshrc} initialization file. The two
12434 files require slightly different command formats.@refill
12435
12436 @itemize @bullet
12437 @item
12438 In a @file{.cshrc} file, you could set the @code{INFOPATH}
12439 variable as follows:@refill
12440
12441 @smallexample
12442 setenv INFOPATH .:~bob/manuals:/usr/local/emacs/info
12443 @end smallexample
12444
12445 @item
12446 In a @file{.profile} file, you would achieve the same effect by
12447 writing:@refill
12448
12449 @smallexample
12450 INFOPATH=.:~bob/manuals:/usr/local/emacs/info
12451 export INFOPATH
12452 @end smallexample
12453 @end itemize
12454
12455 @noindent
12456 The @samp{.} indicates the current directory. Emacs uses the
12457 @code{INFOPATH} environment variable to initialize the value of Emacs's
12458 own @code{Info-directory-list} variable.
12459
12460 @c ================ Appendix starts here ================
12461
12462 @node Command List, Tips, Install an Info File, Top
12463 @appendix @@-Command List
12464 @cindex Alphabetical @@-command list
12465 @cindex List of @@-commands
12466 @cindex @@-command list
12467
12468 Here is an alphabetical list of the @@-commands in Texinfo. Square
12469 brackets, @t{[}@w{ }@t{]}, indicate optional arguments; an ellipsis,
12470 @samp{@dots{}}, indicates repeated text.@refill
12471
12472 @sp 1
12473 @table @code
12474 @item @@*
12475 Force a line break. Do not end a paragraph that uses @code{@@*} with
12476 an @code{@@refill} command. @xref{Line Breaks}.@refill
12477
12478 @item @@.
12479 Stands for a period that really does end a sentence (usually after an
12480 end-of-sentence capital letter). @xref{Controlling Spacing}.@refill
12481
12482 @item @@:
12483 Indicate to @TeX{} that an immediately preceding period, question
12484 mark, exclamation mark, or colon does not end a sentence. Prevent
12485 @TeX{} from inserting extra whitespace as it does at the end of a
12486 sentence. The command has no effect on the Info file output.
12487 @xref{Controlling Spacing}.@refill
12488
12489 @item @@@@
12490 Stands for @samp{@@}. @xref{Braces Atsigns Periods, , Inserting
12491 @samp{@@}}.@refill
12492
12493 @item @@@{
12494 Stands for a left-hand brace, @samp{@{}.@*
12495 @xref{Braces Atsigns Periods, , Inserting @@ braces and periods}.@refill
12496
12497 @item @@@}
12498 Stands for a right-hand brace, @samp{@}}.@*
12499 @xref{Braces Atsigns Periods, , Inserting @@ braces and periods}.@refill
12500
12501 @item @@appendix @var{title}
12502 Begin an appendix. The title appears in the table
12503 of contents of a printed manual. In Info, the title is
12504 underlined with asterisks. @xref{unnumbered & appendix, , The
12505 @code{@@unnumbered} and @code{@@appendix} Commands}.@refill
12506
12507 @item @@appendixsec @var{title}
12508 @itemx @@appendixsection @var{title}
12509 Begin an appendix section within an appendix. The section title appears
12510 in the table of contents of a printed manual. In Info, the title is
12511 underlined with equal signs. @code{@@appendixsection} is a longer
12512 spelling of the @code{@@appendixsec} command. @xref{unnumberedsec
12513 appendixsec heading, , Section Commands}.@refill
12514
12515 @item @@appendixsubsec @var{title}
12516 Begin an appendix subsection within an appendix. The title appears
12517 in the table of contents of a printed manual. In Info, the title is
12518 underlined with hyphens. @xref{unnumberedsubsec appendixsubsec
12519 subheading, , Subsection Commands}.@refill
12520
12521 @item @@appendixsubsubsec @var{title}
12522 Begin an appendix subsubsection within a subappendix. The title
12523 appears in the table of contents of a printed manual. In Info, the
12524 title is underlined with periods. @xref{subsubsection,, The `subsub'
12525 Commands}.@refill
12526
12527 @item @@asis
12528 Used following @code{@@table}, @code{@@ftable}, and @code{@@vtable} to
12529 print the table's first column without highlighting (``as is'').
12530 @xref{Two-column Tables, , Making a Two-column Table}.@refill
12531
12532 @item @@author @var{author}
12533 Typeset @var{author} flushleft and underline it. @xref{title
12534 subtitle author, , The @code{@@title} and @code{@@author}
12535 Commands}.@refill
12536
12537 @item @@b@{@var{text}@}
12538 Print @var{text} in @b{bold} font. No effect in Info. @xref{Fonts}.@refill
12539
12540 @ignore
12541 @item @@br
12542 Force a paragraph break. If used within a line, follow @code{@@br}
12543 with braces. @xref{br, , @code{@@br}}.@refill
12544 @end ignore
12545
12546 @item @@bullet@{@}
12547 Generate a large round dot, or the closest possible
12548 thing to one. @xref{bullet, , @code{@@bullet}}.@refill
12549
12550 @item @@bye
12551 Stop formatting a file. The formatters do not see the contents of a
12552 file following an @code{@@bye} command. @xref{Ending a File}.@refill
12553
12554 @item @@c @var{comment}
12555 Begin a comment in Texinfo. The rest of the line does not appear in
12556 either the Info file or the printed manual. A synonym for
12557 @code{@@comment}. @xref{Comments, , Comments}.@refill
12558
12559 @item @@cartouche
12560 Highlight an example or quotation by drawing a box with rounded
12561 corners around it. Pair with @code{@@end cartouche}. No effect in
12562 Info. @xref{cartouche, , Drawing Cartouches Around Examples}.)@refill
12563
12564 @item @@center @var{line-of-text}
12565 Center the line of text following the command.
12566 @xref{titlefont center sp, , @code{@@center}}.@refill
12567
12568 @item @@lowersections
12569 Change subsequent chapters to sections, sections to subsections, and so
12570 on. @xref{Raise/lower sections, , @code{@@raisesections} and
12571 @code{@@lowersections}}.@refill
12572
12573 @item @@chapheading @var{title}
12574 Print a chapter-like heading in the text, but not in the table of
12575 contents of a printed manual. In Info, the title is underlined with
12576 asterisks. @xref{majorheading & chapheading, , @code{@@majorheading}
12577 and @code{@@chapheading}}.@refill
12578
12579 @item @@chapter @var{title}
12580 Begin a chapter. The chapter title appears in the table of
12581 contents of a printed manual. In Info, the title is underlined with
12582 asterisks. @xref{chapter, , @code{@@chapter}}.@refill
12583
12584 @item @@cindex @var{entry}
12585 Add @var{entry} to the index of concepts. @xref{Index Entries, ,
12586 Defining the Entries of an Index}.@refill
12587
12588 @item @@cite@{@var{reference}@}
12589 Highlight the name of a book or other reference that lacks a
12590 companion Info file. @xref{cite, , @code{@@cite}}.@refill
12591
12592 @item @@clear @var{flag}
12593 Unset @var{flag}, preventing the Texinfo formatting commands from
12594 formatting text between subsequent pairs of @code{@@ifset @var{flag}}
12595 and @code{@@end ifset} commands, and preventing
12596 @code{@@value@{@var{flag}@}} from expanding to the value to which
12597 @var{flag} is set.
12598 @xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill
12599
12600 @item @@code@{@var{sample-code}@}
12601 Highlight text that is an expression, a syntactically complete token
12602 of a program, or a program name. @xref{code, , @code{@@code}}.@refill
12603
12604 @item @@comment @var{comment}
12605 Begin a comment in Texinfo. The rest of the line does not appear in
12606 either the Info file or the printed manual. A synonym for @code{@@c}.
12607 @xref{Comments, , Comments}.@refill
12608
12609 @item @@contents
12610 Print a complete table of contents. Has no effect in Info, which uses
12611 menus instead. @xref{Contents, , Generating a Table of
12612 Contents}.@refill
12613
12614 @item @@copyright@{@}
12615 Generate a copyright symbol. @xref{copyright symbol, ,
12616 @code{@@copyright}}.@refill
12617
12618 @ignore
12619 @item @@ctrl@{@var{ctrl-char}@}
12620 Describe an @sc{ascii} control character. Insert actual control character
12621 into Info file. @xref{ctrl, , @code{@@ctrl}}.@refill
12622 @end ignore
12623
12624 @item @@defcodeindex @var{index-name}
12625 Define a new index and its indexing command. Print entries in an
12626 @code{@@code} font. @xref{New Indices, , Defining New
12627 Indices}.@refill
12628
12629 @item @@defcv @var{category} @var{class} @var{name}
12630 Format a description for a variable associated with a class in
12631 object-oriented programming. Takes three arguments: the category of
12632 thing being defined, the class to which it belongs, and its name.
12633 @xref{Definition Commands}.@refill
12634
12635 @item @@deffn @var{category} @var{name} @var{arguments}@dots{}
12636 Format a description for a function, interactive command, or similar
12637 entity that may take arguments. @code{@@deffn} takes as arguments the
12638 category of entity being described, the name of this particular
12639 entity, and its arguments, if any. @xref{Definition Commands}.@refill
12640
12641 @item @@defindex @var{index-name}
12642 Define a new index and its indexing command. Print entries in a roman
12643 font. @xref{New Indices, , Defining New Indices}.@refill
12644
12645 @item @@definfoenclose @var{new-command}, @var{before}, @var{after},
12646 Create new @@-command for Info that marks text by enclosing it in
12647 strings that precede and follow the text. Write definition inside of
12648 @code{@@ifinfo} @dots{} @code{@@end ifinfo}. @xref{Customized
12649 Highlighting}.@refill
12650
12651 @item @@defivar @var{class} @var{instance-variable-name}
12652 This command formats a description for an instance variable in
12653 object-oriented programming. The command is equivalent to @samp{@@defcv
12654 @{Instance Variable@} @dots{}}. @xref{Definition Commands}.@refill
12655
12656 @item @@defmac @var{macro-name} @var{arguments}@dots{}
12657 Format a description for a macro. The command is equivalent to
12658 @samp{@@deffn Macro @dots{}}. @xref{Definition Commands}.@refill
12659
12660 @item @@defmethod @var{class} @var{method-name} @var{arguments}@dots{}
12661 Format a description for a method in object-oriented programming. The
12662 command is equivalent to @samp{@@defop Method @dots{}}. Takes as
12663 arguments the name of the class of the method, the name of the
12664 method, and its arguments, if any. @xref{Definition Commands}.@refill
12665
12666 @item @@defop @var{category} @var{class} @var{name} @var{arguments}@dots{}
12667 Format a description for an operation in object-oriented programming.
12668 @code{@@defop} takes as arguments the overall name of the category of
12669 operation, the name of the class of the operation, the name of the
12670 operation, and its arguments, if any. @xref{Definition
12671 Commands}.@refill
12672
12673 @need 100
12674 @item @@defopt @var{option-name}
12675 Format a description for a user option. The command is equivalent to
12676 @samp{@@defvr @{User Option@} @dots{}}. @xref{Definition Commands}.@refill
12677
12678 @need 100
12679 @item @@defspec @var{special-form-name} @var{arguments}@dots{}
12680 Format a description for a special form. The command is equivalent to
12681 @samp{@@deffn @{Special Form@} @dots{}}. @xref{Definition Commands}.@refill
12682
12683 @need 200
12684 @item @@deftp @var{category} @var{name-of-type} @var{attributes}@dots{}
12685 Format a description for a data type. @code{@@deftp} takes as
12686 arguments the category, the name of the type (which is a word like
12687 @samp{int} or @samp{float}), and then the names of attributes of
12688 objects of that
12689 type. @xref{Definition Commands}.@refill
12690
12691 @item @@deftypefn @var{classification} @var{data-type} @var{name} @var{arguments}@dots{}
12692 Format a description for a function or similar entity that may take
12693 arguments and that is typed. @code{@@deftypefn} takes as arguments
12694 the classification of entity being described, the type, the name of
12695 the entity, and its arguments, if any. @xref{Definition
12696 Commands}.@refill
12697
12698 @item @@deftypefun @var{data-type} @var{function-name} @var{arguments}@dots{}
12699 Format a description for a function in a typed language.
12700 The command is equivalent to @samp{@@deftypefn Function @dots{}}.
12701 @xref{Definition Commands}.@refill
12702
12703 @item @@deftypevr @var{classification} @var{data-type} @var{name}
12704 Format a description for something like a variable in a typed
12705 language---an entity that records a value. Takes as arguments the
12706 classification of entity being described, the type, and the name of
12707 the entity. @xref{Definition Commands}.@refill
12708
12709 @item @@deftypevar @var{data-type} @var{variable-name}
12710 Format a description for a variable in a typed language. The command is
12711 equivalent to @samp{@@deftypevr Variable @dots{}}. @xref{Definition
12712 Commands}.@refill
12713
12714 @item @@defun @var{function-name} @var{arguments}@dots{}
12715 Format a description for functions. The command is equivalent to
12716 @samp{@@deffn Function @dots{}}. @xref{Definition Commands}.@refill
12717
12718 @item @@defvar @var{variable-name}
12719 Format a description for variables. The command is equivalent to
12720 @samp{@@defvr Variable @dots{}}. @xref{Definition Commands}.@refill
12721
12722 @item @@defvr @var{category} @var{name}
12723 Format a description for any kind of variable. @code{@@defvr} takes
12724 as arguments the category of the entity and the name of the entity.
12725 @xref{Definition Commands}.@refill
12726
12727 @item @@dfn@{@var{term}@}
12728 Highlight the introductory or defining use of a term.
12729 @xref{dfn, , @code{@@dfn}}.@refill
12730
12731 @need 100
12732 @item @@display
12733 Begin a kind of example. Indent text, do not fill, do not select a
12734 new font. Pair with @code{@@end display}. @xref{display, ,
12735 @code{@@display}}.@refill
12736
12737 @need 100
12738 @item @@dmn@{@var{dimension}@}
12739 Format a dimension. Cause @TeX{} to insert a narrow space before
12740 @var{dimension}. No effect in Info. Use for writing a number
12741 followed by an abbreviation of a dimension name, such as
12742 @samp{12@dmn{pt}}, written as @samp{12@@dmn@{pt@}}, with no space
12743 between the number and the @code{@@dmn} command. @xref{dmn, ,
12744 @code{@@dmn}}.@refill
12745
12746 @need 100
12747 @item @@dots@{@}
12748 Insert an ellipsis: @samp{@dots{}}.
12749 @xref{dots, , @code{@@dots}}.@refill
12750
12751 @need 100
12752 @item @@emph@{@var{text}@}
12753 Highlight @var{text}; text is displayed in @emph{italics} in printed
12754 output, and surrounded by asterisks in Info. @xref{Emphasis, , Emphasizing Text}.@refill
12755
12756 @need 100
12757 @item @@enumerate [@var{number-or-letter}]
12758 Begin a numbered list, using @code{@@item} for each entry.
12759 Optionally, start list with @var{number-or-letter}. Pair with
12760 @code{@@end enumerate}. @xref{enumerate, ,
12761 @code{@@enumerate}}.@refill
12762
12763 @need 100
12764 @item @@equiv@{@}
12765 Indicate to the reader the exact equivalence of two forms with a
12766 glyph: @samp{@equiv{}}. @xref{Equivalence}.@refill
12767
12768 @item @@error@{@}
12769 Indicate to the reader with a glyph that the following text is
12770 an error message: @samp{@error{}}. @xref{Error Glyph}.@refill
12771
12772 @item @@evenfooting [@var{left}] @@| [@var{center}] @@| [@var{right}]
12773 Specify page footings for even-numbered (left-hand) pages. Not relevant to
12774 Info. @xref{Custom Headings, , How to Make Your Own Headings}.@refill
12775
12776 @item @@evenheading [@var{left}] @@| [@var{center}] @@| [@var{right}]
12777 Specify page headings for even-numbered (left-hand) pages. Not relevant to
12778 Info. @xref{Custom Headings, , How to Make Your Own Headings}.@refill
12779
12780 @item @@everyfooting [@var{left}] @@| [@var{center}] @@| [@var{right}]
12781 Specify page footings for every page. Not relevant to Info. @xref{Custom
12782 Headings, , How to Make Your Own Headings}.@refill
12783
12784 @item @@everyheading [@var{left}] @@| [@var{center}] @@| [@var{right}]
12785 Specify page headings for every page. Not relevant to Info. @xref{Custom
12786 Headings, , How to Make Your Own Headings}.@refill
12787
12788 @item @@example
12789 Begin an example. Indent text, do not fill, and select fixed-width font.
12790 Pair with @code{@@end example}. @xref{example, ,
12791 @code{@@example}}.@refill
12792
12793 @item @@exdent @var{line-of-text}
12794 Remove any indentation a line might have. @xref{exdent, ,
12795 Undoing the Indentation of a Line}.@refill
12796
12797 @item @@expansion@{@}
12798 Indicate the result of a macro expansion to the reader with a special
12799 glyph: @samp{@expansion{}}.
12800 @xref{expansion, , @expansion{} Indicating an Expansion}.@refill
12801
12802 @item @@file@{@var{filename}@}
12803 Highlight the name of a file, buffer, node, or directory. @xref{file, ,
12804 @code{@@file}}.@refill
12805
12806 @item @@finalout
12807 Prevent @TeX{} from printing large black warning rectangles beside
12808 over-wide lines. @xref{Overfull hboxes}.@refill
12809
12810 @need 100
12811 @item @@findex @var{entry}
12812 Add @var{entry} to the index of functions. @xref{Index Entries, ,
12813 Defining the Entries of an Index}.@refill
12814
12815 @need 200
12816 @item @@flushleft
12817 Left justify every line but leave the right end ragged.
12818 Leave font as is. Pair with @code{@@end flushleft}.
12819 @xref{flushleft & flushright, , @code{@@flushleft} and
12820 @code{@@flushright}}.@refill
12821
12822 @need 200
12823 @item @@flushright
12824 Right justify every line but leave the left end ragged.
12825 Leave font as is. Pair with @code{@@end flushright}.
12826 @xref{flushleft & flushright, , @code{@@flushleft} and
12827 @code{@@flushright}}.@refill
12828
12829 @need 200
12830 @item @@footnote@{@var{text-of-footnote}@}
12831 Enter a footnote. Footnote text is printed at the bottom of the page
12832 by @TeX{}; Info may format in either `End' node or `Separate' node style.
12833 @xref{Footnotes}.@refill
12834
12835 @item @@footnotestyle @var{style}
12836 Specify an Info file's footnote style, either @samp{end} for the end
12837 node style or @samp{separate} for the separate node style.
12838 @xref{Footnotes}.@refill
12839
12840 @item @@format
12841 Begin a kind of example. Like @code{@@example} or @code{@@display},
12842 but do not narrow the margins and do not select the fixed-width font.
12843 Pair with @code{@@end format}. @xref{example, ,
12844 @code{@@example}}.@refill
12845
12846 @item @@ftable @var{formatting-command}
12847 Begin a two-column table, using @code{@@item} for each entry.
12848 Automatically enter each of the items in the first column into the
12849 index of functions. Pair with @code{@@end ftable}. The same as
12850 @code{@@table}, except for indexing. @xref{ftable vtable, ,
12851 @code{@@ftable} and @code{@@vtable}}.@refill
12852
12853 @item @@group
12854 Hold text together that must appear on one printed page. Pair with
12855 @code{@@end group}. Not relevant to Info. @xref{group, ,
12856 @code{@@group}}.@refill
12857
12858 @item @@heading @var{title}
12859 Print an unnumbered section-like heading in the text, but not in the
12860 table of contents of a printed manual. In Info, the title is
12861 underlined with equal signs. @xref{unnumberedsec appendixsec heading,
12862 , Section Commands}.@refill
12863
12864 @item @@headings @var{on-off-single-double}
12865 Turn page headings on or off, or specify single-sided or double-sided
12866 page headings for printing. @code{@@headings on} is synonymous with
12867 @code{@@headings double}. @xref{headings on off, , The
12868 @code{@@headings} Command}.@refill
12869
12870 @item @@i@{@var{text}@}
12871 Print @var{text} in @i{italic} font. No effect in Info.
12872 @xref{Fonts}.@refill
12873
12874 @item @@ifclear @var{flag}
12875 If @var{flag} is cleared, the Texinfo formatting commands format text
12876 between @code{@@ifclear @var{flag}} and the following @code{@@end
12877 ifclear} command.
12878 @xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill
12879
12880 @item @@ifinfo
12881 Begin a stretch of text that will be ignored by @TeX{} when it
12882 typesets the printed manual. The text appears only in the Info file.
12883 Pair with @code{@@end ifinfo}. @xref{Conditionals, , Conditionally
12884 Visible Text}.@refill
12885
12886 @item @@ifset @var{flag}
12887 If @var{flag} is set, the Texinfo formatting commands format text
12888 between @code{@@ifset @var{flag}} and the following @code{@@end ifset}
12889 command.
12890 @xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill
12891
12892 @item @@iftex
12893 Begin a stretch of text that will not appear in the Info file, but
12894 will be processed only by @TeX{}. Pair with @code{@@end iftex}.
12895 @xref{Conditionals, , Conditionally Visible Text}.@refill
12896
12897 @item @@ignore
12898 Begin a stretch of text that will not appear in either the Info file
12899 or the printed output. Pair with @code{@@end ignore}.
12900 @xref{Comments, , Comments and Ignored Text}.@refill
12901
12902 @item @@include @var{filename}
12903 Incorporate the contents of the file @var{filename} into the Info file
12904 or printed document. @xref{Include Files}.@refill
12905
12906 @item @@inforef@{@var{node-name}, [@var{entry-name}], @var{info-file-name}@}
12907 Make a cross reference to an Info file for which there is no printed
12908 manual. @xref{inforef, , Cross references using
12909 @code{@@inforef}}.@refill
12910
12911 @item \input @var{macro-definitions-file}
12912 Use the specified macro definitions file. This command is used only
12913 in the first line of a Texinfo file to cause @TeX{} to make use of the
12914 @file{texinfo} macro definitions file. The backslash in @code{\input}
12915 is used instead of an @code{@@} because @TeX{} does not properly
12916 recognize @code{@@} until after it has read the definitions file.
12917 @xref{Header, , The Texinfo File Header}.@refill
12918
12919 @item @@item
12920 Indicate the beginning of a marked paragraph for @code{@@itemize} and
12921 @code{@@enumerate}; indicate the beginning of the text of a first column
12922 entry for @code{@@table}, @code{@@ftable}, and @code{@@vtable}.
12923 @xref{Lists and Tables}.@refill
12924
12925 @item @@itemize @var{mark-generating-character-or-command}
12926 Produce a sequence of indented paragraphs, with a mark inside the left
12927 margin at the beginning of each paragraph. Pair with @code{@@end
12928 itemize}. @xref{itemize, , @code{@@itemize}}.@refill
12929
12930 @item @@itemx
12931 Like @code{@@item} but do not generate extra vertical space above the
12932 item text. @xref{itemx, , @code{@@itemx}}.@refill
12933
12934 @item @@kbd@{@var{keyboard-characters}@}
12935 Indicate text that consists of characters of input to be typed by
12936 users. @xref{kbd, , @code{@@kbd}}.@refill
12937
12938 @item @@key@{@var{key-name}@}
12939 Highlight @var{key-name}, a conventional name for a key on a keyboard.
12940 @xref{key, , @code{@@key}}.@refill
12941
12942 @item @@kindex @var{entry}
12943 Add @var{entry} to the index of keys. @xref{Index Entries, , Defining the
12944 Entries of an Index}.@refill
12945
12946 @item @@global@@let@var{new-command}=@var{existing-command}
12947 Equate a new highlighting command with an existing one. Only for
12948 @TeX{}. Write definition inside of @code{@@iftex} @dots{} @code{@@end
12949 iftex}. @xref{Customized Highlighting}.@refill
12950
12951 @item @@lisp
12952 Begin an example of Lisp code. Indent text, do not fill, and select
12953 fixed-width font. Pair with @code{@@end lisp}. @xref{Lisp Example, ,
12954 @code{@@lisp}}.@refill
12955
12956 @item @@majorheading @var{title}
12957 Print a chapter-like heading in the text, but not in the table of
12958 contents of a printed manual. Generate more vertical whitespace before
12959 the heading than the @code{@@chapheading} command. In Info, the chapter
12960 heading line is underlined with asterisks. @xref{majorheading &
12961 chapheading, , @code{@@majorheading} and @code{@@chapheading}}.@refill
12962
12963 @item @@math@{@var{mathematical-expression}@}
12964 Format a mathematical expression.
12965 @xref{math, , @code{@@math}: Inserting Mathematical Expressions}.
12966
12967 @item @@menu
12968 Mark the beginning of a menu of nodes in Info. No effect in a printed
12969 manual. Pair with @code{@@end menu}. @xref{Menus}.@refill
12970
12971 @item @@minus@{@}
12972 Generate a minus sign. @xref{minus, , @code{@@minus}}.@refill
12973
12974 @item @@need @var{n}
12975 Start a new page in a printed manual if fewer than @var{n} mils
12976 (thousandths of an inch) remain on the current page. @xref{need, ,
12977 @code{@@need}}.@refill
12978
12979 @item @@node @var{name, next, previous, up}
12980 Define the beginning of a new node in Info, and serve as a locator for
12981 references for @TeX{}. @xref{node, , @code{@@node}}.@refill
12982
12983 @need 200
12984 @item @@noindent
12985 Prevent text from being indented as if it were a new paragraph.
12986 @xref{noindent, , @code{@@noindent}}.@refill
12987
12988 @item @@oddfooting [@var{left}] @@| [@var{center}] @@| [@var{right}]
12989 Specify page footings for odd-numbered (right-hand) pages. Not relevant to
12990 Info. @xref{Custom Headings, , How to Make Your Own Headings}.@refill
12991
12992 @item @@oddheading [@var{left}] @@| [@var{center}] @@| [@var{right}]
12993 Specify page headings for odd-numbered (right-hand) pages. Not relevant to
12994 Info. @xref{Custom Headings, , How to Make Your Own Headings}.@refill
12995
12996 @item @@page
12997 Start a new page in a printed manual. No effect in Info.
12998 @xref{page, , @code{@@page}}.@refill
12999
13000 @item @@paragraphindent @var{indent}
13001 Indent paragraphs by @var{indent} number of spaces; delete indentation
13002 if the value of @var{indent} is 0; and do not change indentation if
13003 @var{indent} is @code{asis}. @xref{paragraphindent, , Paragraph
13004 Indenting}.@refill
13005
13006 @item @@pindex @var{entry}
13007 Add @var{entry} to the index of programs. @xref{Index Entries, , Defining
13008 the Entries of an Index}.@refill
13009
13010 @item @@point@{@}
13011 Indicate the position of point in a buffer to the reader with a
13012 glyph: @samp{@point{}}. @xref{Point Glyph, , Indicating
13013 Point in a Buffer}.@refill
13014
13015 @item @@print@{@}
13016 Indicate printed output to the reader with a glyph:
13017 @samp{@print{}}. @xref{Print Glyph}.@refill
13018
13019 @item @@printindex @var{index-name}
13020 Print an alphabetized two-column index in a printed manual or generate
13021 an alphabetized menu of index entries for Info. @xref{Printing
13022 Indices & Menus}.@refill
13023
13024 @item @@pxref@{@var{node-name}, [@var{entry}], [@var{topic-or-title}], [@var{info-file}], [@var{manual}]@}
13025 Make a reference that starts with a lower case `see' in a printed
13026 manual. Use within parentheses only. Do not follow command with a
13027 punctuation mark. The Info formatting commands automatically insert
13028 terminating punctuation as needed, which is why you do not need to
13029 insert punctuation. Only the first argument is mandatory.
13030 @xref{pxref, , @code{@@pxref}}.@refill
13031
13032 @item @@quotation
13033 Narrow the margins to indicate text that is quoted from another real
13034 or imaginary work. Write command on a line of its own. Pair with
13035 @code{@@end quotation}. @xref{quotation, ,
13036 @code{@@quotation}}.@refill
13037
13038 @need 100
13039 @item @@r@{@var{text}@}
13040 Print @var{text} in @r{roman} font. No effect in Info.
13041 @xref{Fonts}.@refill
13042
13043 @item @@raisesections
13044 Change subsequent sections to chapters, subsections to sections, and so
13045 on. @xref{Raise/lower sections, , @code{@@raisesections} and
13046 @code{@@lowersections}}.@refill
13047
13048 @need 300
13049 @item @@ref@{@var{node-name}, [@var{entry}], [@var{topic-or-title}], [@var{info-file}], [@var{manual}]@}
13050 Make a reference. In a printed manual, the reference does not start
13051 with a `See'. Follow command with a punctuation mark. Only the first
13052 argument is mandatory. @xref{ref, , @code{@@ref}}.@refill
13053
13054 @need 300
13055 @item @@refill
13056 In Info, refill and indent the paragraph after all the other processing
13057 has been done. No effect on @TeX{}, which always refills. This command
13058 is no longer needed, since all formatters now automatically refill.
13059 @xref{Refilling Paragraphs}.@refill
13060
13061 @need 300
13062 @item @@result@{@}
13063 Indicate the result of an expression to the reader with a special
13064 glyph: @samp{@result{}}. @xref{result, , @code{@@result}}.@refill
13065
13066 @item @@samp@{@var{text}@}
13067 Highlight @var{text} that is a literal example of a sequence of
13068 characters. Used for single characters, for statements, and often for
13069 entire shell commands. @xref{samp, , @code{@@samp}}.@refill
13070
13071 @item @@sc@{@var{text}@}
13072 Set @var{text} in a printed output in @sc{the small caps font} and
13073 set text in the Info file in uppercase letters.
13074 @xref{Smallcaps}.@refill
13075
13076 @item @@section @var{title}
13077 Begin a section within a chapter. In a printed manual, the section
13078 title is numbered and appears in the table of contents. In Info, the
13079 title is underlined with equal signs. @xref{section, ,
13080 @code{@@section}}.@refill
13081
13082 @item @@set @var{flag} [@var{string}]
13083 Make @var{flag} active, causing the Texinfo formatting commands to
13084 format text between subsequent pairs of @code{@@ifset @var{flag}} and
13085 @code{@@end ifset} commands. Optionally, set value of @var{flag} to
13086 @var{string}.
13087 @xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill
13088
13089 @item @@setchapternewpage @var{on-off-odd}
13090 Specify whether chapters start on new pages, and if so, whether on
13091 odd-numbered (right-hand) new pages. @xref{setchapternewpage, ,
13092 @code{@@setchapternewpage}}.@refill
13093
13094 @c awkward wording prevents overfull hbox
13095 @item @@setfilename @var{info-file-name}
13096 Provide a name to be used by the Info file. @xref{setfilename, ,
13097 @code{@@setfilename}}.@refill
13098
13099 @item @@settitle @var{title}
13100 Provide a title for page headers in a printed manual.
13101 @xref{settitle, , @code{@@settitle}}.@refill
13102
13103 @item @@shortcontents
13104 Print a short table of contents. Not relevant to Info, which uses
13105 menus rather than tables of contents. A synonym for
13106 @code{@@summarycontents}. @xref{Contents, , Generating a Table of
13107 Contents}.@refill
13108
13109 @need 400
13110 @item @@smallbook
13111 Cause @TeX{} to produce a printed manual in a 7 by 9.25 inch format
13112 rather than the regular 8.5 by 11 inch format. @xref{smallbook, ,
13113 Printing Small Books}. Also, see @ref{smallexample & smalllisp, ,
13114 @code{@@smallexample} and @code{@@smalllisp}}.@refill
13115
13116 @need 400
13117 @item @@smallexample
13118 Indent text to indicate an example. Do not fill, select fixed-width
13119 font. In @code{@@smallbook} format, print text in a smaller font than
13120 with @code{@@example}. Pair with @code{@@end smallexample}.
13121 @xref{smallexample & smalllisp, , @code{@@smallexample} and
13122 @code{@@smalllisp}}.@refill
13123
13124 @need 400
13125 @item @@smalllisp
13126 Begin an example of Lisp code. Indent text, do not fill, select
13127 fixed-width font. In @code{@@smallbook} format, print text in a
13128 smaller font. Pair with @code{@@end smalllisp}. @xref{smallexample &
13129 smalllisp, , @code{@@smallexample} and @code{@@smalllisp}}.@refill
13130
13131 @need 700
13132 @item @@sp @var{n}
13133 Skip @var{n} blank lines. @xref{sp, , @code{@@sp}}.@refill
13134
13135 @need 700
13136 @item @@strong @var{text}
13137 Emphasize @var{text} by typesetting it in a @strong{bold} font for the
13138 printed manual and by surrounding it with asterisks for Info.
13139 @xref{emph & strong, , Emphasizing Text}.@refill
13140
13141 @item @@subheading @var{title}
13142 Print an unnumbered subsection-like heading in the text, but not in
13143 the table of contents of a printed manual. In Info, the title is
13144 underlined with hyphens. @xref{unnumberedsubsec appendixsubsec
13145 subheading, , @code{@@unnumberedsubsec} @code{@@appendixsubsec}
13146 @code{@@subheading}}.@refill
13147
13148 @item @@subsection @var{title}
13149 Begin a subsection within a section. In a printed manual, the
13150 subsection title is numbered and appears in the table of contents. In
13151 Info, the title is underlined with hyphens. @xref{subsection, ,
13152 @code{@@subsection}}.@refill
13153
13154 @item @@subsubheading @var{title}
13155 Print an unnumbered subsubsection-like heading in the text, but not in
13156 the table of contents of a printed manual. In Info, the title is
13157 underlined with periods. @xref{subsubsection, , The `subsub'
13158 Commands}.@refill
13159
13160 @item @@subsubsection @var{title}
13161 Begin a subsubsection within a subsection. In a printed manual,
13162 the subsubsection title is numbered and appears in the table of
13163 contents. In Info, the title is underlined with periods.
13164 @xref{subsubsection, , The `subsub' Commands}.@refill
13165
13166 @item @@subtitle @var{title}
13167 In a printed manual, set a subtitle in a normal sized font flush to
13168 the right-hand side of the page. Not relevant to Info, which does not
13169 have title pages. @xref{title subtitle author, , @code{@@title}
13170 @code{@@subtitle} and @code{@@author} Commands}.@refill
13171
13172 @item @@summarycontents
13173 Print a short table of contents. Not relevant to Info, which uses
13174 menus rather than tables of contents. A synonym for
13175 @code{@@shortcontents}. @xref{Contents, , Generating a Table of
13176 Contents}.@refill
13177
13178 @need 300
13179 @item @@syncodeindex @var{from-index} @var{into-index}
13180 Merge the index named in the first argument into the index named in
13181 the second argument, printing the entries from the first index in
13182 @code{@@code} font. @xref{Combining Indices}.@refill
13183
13184 @need 300
13185 @item @@synindex @var{from-index} @var{into-index}
13186 Merge the index named in the first argument into the index named in
13187 the second argument. Do not change the font of @var{from-index}
13188 entries. @xref{Combining Indices}.@refill
13189
13190 @need 100
13191 @item @@t@{@var{text}@}
13192 Print @var{text} in a @t{fixed-width}, typewriter-like font.
13193 No effect in Info. @xref{Fonts}.@refill
13194
13195 @need 400
13196 @item @@table @var{formatting-command}
13197 Begin a two-column table, using @code{@@item} for each entry. Write
13198 each first column entry on the same line as @code{@@item}. First
13199 column entries are printed in the font resulting from
13200 @var{formatting-command}. Pair with @code{@@end table}.
13201 @xref{Two-column Tables, , Making a Two-column Table}.
13202 Also see @ref{ftable vtable, , @code{@@ftable} and @code{@@vtable}},
13203 and @ref{itemx, , @code{@@itemx}}.@refill
13204
13205 @item @@TeX@{@}
13206 Insert the logo @TeX{}. @xref{TeX and copyright, , Inserting @TeX{}
13207 and @copyright{}}.@refill
13208
13209 @item @@tex
13210 Enter @TeX{} completely. Pair with @code{@@end tex}. @xref{Using
13211 Ordinary TeX Commands, , Using Ordinary @TeX{} Commands}.@refill
13212
13213 @item @@thischapter
13214 In a heading or footing, stands for the number and name of the current
13215 chapter, in the format `Chapter 1: Title'. @xref{Custom
13216 Headings, , How to Make Your Own Headings}.@refill
13217
13218 @item @@thischaptername
13219 In a heading or footing, stands for the name of the current chapter.
13220 @xref{Custom Headings, , How to Make Your Own Headings}.@refill
13221
13222 @item @@thisfile
13223 In a heading or footing, stands for the name of the current
13224 @code{@@include} file. Does not insert anything if not within an
13225 @code{@@include} file. @xref{Custom Headings, , How to Make Your Own
13226 Headings}.@refill
13227
13228 @item @@thispage
13229 In a heading or footing, stands for the current page number.
13230 @xref{Custom Headings, , How to Make Your Own Headings}.@refill
13231
13232 @ignore
13233 @item @@thissection
13234 In a heading or footing, stands for the title of the current section.
13235 @xref{Custom Headings, , How to Make Your Own Headings}.@refill
13236 @end ignore
13237
13238 @item @@thistitle
13239 In a heading or footing, stands for the name of the document, as specified
13240 by the @code{@@settitle} command. @xref{Custom Headings, , How to
13241 Make Your Own Headings}.@refill
13242
13243 @item @@tindex @var{entry}
13244 Add @var{entry} to the index of data types. @xref{Index Entries, ,
13245 Defining the Entries of an Index}.@refill
13246
13247 @item @@title @var{title}
13248 In a printed manual, set a title flush to the left-hand side of the
13249 page in a larger than normal font and underline it with a black rule.
13250 Not relevant to Info, which does not have title pages. @xref{title
13251 subtitle author, , The @code{@@title} @code{@@subtitle} and
13252 @code{@@author} Commands}.@refill
13253
13254 @need 400
13255 @item @@titlefont@{@var{text}@}
13256 In a printed manual, print @var{text} in a larger than normal font.
13257 Not relevant to Info, which does not have title pages.
13258 @xref{titlefont center sp, , The @code{@@titlefont} @code{@@center}
13259 and @code{@@sp} Commands}.@refill
13260
13261 @need 300
13262 @item @@titlepage
13263 Indicate to Texinfo the beginning of the title page. Write command on
13264 a line of its own. Pair with @code{@@end titlepage}. Nothing between
13265 @code{@@titlepage} and @code{@@end titlepage} appears in Info.
13266 @xref{titlepage, , @code{@@titlepage}}.@refill
13267
13268 @need 150
13269 @item @@today@{@}
13270 Insert the current date, in `1 Jan 1900' style. @xref{Custom
13271 Headings, , How to Make Your Own Headings}.@refill
13272
13273 @item @@top @var{title}
13274 In a Texinfo file to be formatted with @code{makeinfo}, identify the
13275 topmost @code{@@node} line in the file, which must be written on the line
13276 immediately preceding the @code{@@top} command. Used for
13277 @code{makeinfo}'s node pointer insertion feature. The title is
13278 underlined with asterisks. Both the @code{@@node} line and the @code{@@top}
13279 line normally should be enclosed by @code{@@ifinfo} and @code{@@end
13280 ifinfo}. In @TeX{} and @code{texinfo-format-buffer}, the @code{@@top}
13281 command is merely a synonym for @code{@@unnumbered}. @xref{makeinfo
13282 Pointer Creation, , Creating Pointers with @code{makeinfo}}.
13283
13284 @item @@unnumbered @var{title}
13285 In a printed manual, begin a chapter that appears without chapter
13286 numbers of any kind. The title appears in the table of contents of a
13287 printed manual. In Info, the title is underlined with asterisks.
13288 @xref{unnumbered & appendix, , @code{@@unnumbered} and
13289 @code{@@appendix}}.@refill
13290
13291 @item @@unnumberedsec @var{title}
13292 In a printed manual, begin a section that appears without section
13293 numbers of any kind. The title appears in the table of contents of a
13294 printed manual. In Info, the title is underlined with equal signs.
13295 @xref{unnumberedsec appendixsec heading, , Section Commands}.@refill
13296
13297 @item @@unnumberedsubsec @var{title}
13298 In a printed manual, begin an unnumbered subsection within a
13299 chapter. The title appears in the table of contents of a printed
13300 manual. In Info, the title is underlined with hyphens.
13301 @xref{unnumberedsubsec appendixsubsec subheading, ,
13302 @code{@@unnumberedsubsec} @code{@@appendixsubsec}
13303 @code{@@subheading}}.@refill
13304
13305 @item @@unnumberedsubsubsec @var{title}
13306 In a printed manual, begin an unnumbered subsubsection within a
13307 chapter. The title appears in the table of contents of a printed
13308 manual. In Info, the title is underlined with periods.
13309 @xref{subsubsection, , The `subsub' Commands}.@refill
13310
13311 @item @@value@{@var{flag}@}
13312 Replace @var{flag} with the value to which it is set by @code{@@set
13313 @var{flag}}.
13314 @xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill
13315
13316 @item @@var@{@var{metasyntactic-variable}@}
13317 Highlight a metasyntactic variable, which is something that stands for
13318 another piece of text. @xref{var, , Indicating Metasyntactic
13319 Variables}.@refill
13320
13321 @need 400
13322 @item @@vindex @var{entry}
13323 Add @var{entry} to the index of variables. @xref{Index Entries, ,
13324 Defining the Entries of an Index}.@refill
13325
13326 @need 400
13327 @item @@vskip @var{amount}
13328 In a printed manual, insert whitespace so as to push text on the
13329 remainder of the page towards the bottom of the page. Used in
13330 formatting the copyright page with the argument @samp{0pt plus
13331 1filll}. (Note spelling of @samp{filll}.) @code{@@vskip} may be used
13332 only in contexts ignored for Info. @xref{Copyright & Permissions, ,
13333 The Copyright Page and Printed Permissions}.@refill
13334
13335 @need 400
13336 @item @@vtable @var{formatting-command}
13337 Begin a two-column table, using @code{@@item} for each entry.
13338 Automatically enter each of the items in the first column into the
13339 index of variables. Pair with @code{@@end vtable}. The same as
13340 @code{@@table}, except for indexing. @xref{ftable vtable, ,
13341 @code{@@ftable} and @code{@@vtable}}.@refill
13342
13343 @need 400
13344 @item @@w@{@var{text}@}
13345 Prevent @var{text} from being split across two lines. Do not end a
13346 paragraph that uses @code{@@w} with an @code{@@refill} command.
13347 In the Texinfo file, keep @var{text} on one line.
13348 @xref{w, , @code{@@w}}.@refill
13349
13350 @need 400
13351 @item @@xref@{@var{node-name}, [@var{entry}], [@var{topic-or-title}], [@var{info-file}], [@var{manual}]@}
13352 Make a reference that starts with `See' in a printed manual. Follow
13353 command with a punctuation mark. Only the first argument is
13354 mandatory. @xref{xref, , @code{@@xref}}.@refill
13355 @end table
13356
13357 @node Tips, Sample Texinfo File, Command List, Top
13358 @comment node-name, next, previous, up
13359 @appendix Tips and Hints
13360
13361 Here are some tips for writing Texinfo documentation:@refill
13362
13363 @cindex Tips
13364 @cindex Usage tips
13365 @cindex Hints
13366 @itemize @bullet
13367 @item
13368 Write in the present tense, not in the past or the future.
13369
13370 @item
13371 Write actively! For example, write ``We recommend that @dots{}'' rather
13372 than ``It is recommended that @dots{}''.
13373
13374 @item
13375 Use 70 or 72 as your fill column. Longer lines are hard to read.
13376
13377 @item
13378 Include a copyright notice and copying permissions.
13379 @end itemize
13380
13381 @subsubheading Index, index, index!
13382
13383 Write many index entries, in different ways.
13384 Readers like indices; they are helpful and convenient.
13385
13386 Although it is easiest to write index entries as you write the body of
13387 the text, some people prefer to write entries afterwards. In either
13388 case, write an entry before the paragraph to which it applies. This
13389 way, an index entry points to the first page of a paragraph that is
13390 split across pages.
13391
13392 Here are more hints we have found valuable:
13393
13394 @itemize @bullet
13395 @item
13396 Write each index entry differently, so each entry refers to a different
13397 place in the document. The index of an Info file lists only one
13398 location for each entry.
13399
13400 @item
13401 Write index entries only where a topic is discussed significantly. For
13402 example, it is not useful to index ``debugging information'' in a
13403 chapter on reporting bugs. Someone who wants to know about debugging
13404 information will certainly not find it in that chapter.
13405
13406 @item
13407 Consistently capitalize the first word of every concept index entry,
13408 or else consistently use lower case. Terse entries often call for
13409 lower case; longer entries for capitalization. Whichever case
13410 convention you use, please use one or the other consistently! Mixing
13411 the two styles looks bad.
13412
13413 @item
13414 Always capitalize or use upper case for those words in an index for
13415 which this is proper, such as names of countries or acronyms. Always
13416 use the appropriate case for case-sensitive names, such as those in C or
13417 Lisp.
13418
13419 @item
13420 Write the indexing commands that refer to a whole section immediately
13421 after the section command, and write the indexing commands that refer to
13422 the paragraph before the paragraph.
13423
13424 @need 1000
13425 In the example that follows, a blank line comes after the index
13426 entry for ``Leaping'':
13427
13428 @example
13429 @group
13430 @@section The Dog and the Fox
13431 @@cindex Jumping, in general
13432 @@cindex Leaping
13433
13434 @@cindex Dog, lazy, jumped over
13435 @@cindex Lazy dog jumped over
13436 @@cindex Fox, jumps over dog
13437 @@cindex Quick fox jumps over dog
13438 The quick brown fox jumps over the lazy dog.
13439 @end group
13440 @end example
13441
13442 @noindent
13443 (Note that the example shows entries for the same concept that are
13444 written in different ways---@samp{Lazy dog}, and @samp{Dog, lazy}---so
13445 readers can look up the concept in different ways.)
13446 @end itemize
13447
13448 @subsubheading Blank lines
13449
13450 @itemize @bullet
13451 @item
13452 Insert a blank line between a sectioning command and the first following
13453 sentence or paragraph, or between the indexing commands associated with
13454 the sectioning command and the first following sentence or paragraph, as
13455 shown in the tip on indexing. Otherwise, a formatter may fold title and
13456 paragraph together.
13457
13458 @item
13459 Always insert a blank line before an @code{@@table} command and after an
13460 @code{@@end table} command; but never insert a blank line after an
13461 @code{@@table} command or before an @code{@@end table} command.
13462
13463 @need 1000
13464 For example,
13465
13466 @example
13467 @group
13468 Types of fox:
13469
13470 @@table @@samp
13471 @@item Quick
13472 Jump over lazy dogs.
13473 @end group
13474
13475 @group
13476 @@item Brown
13477 Also jump over lazy dogs.
13478 @@end table
13479
13480 @end group
13481 @group
13482 @@noindent
13483 On the other hand, @dots{}
13484 @end group
13485 @end example
13486
13487 Insert blank lines before and after @code{@@itemize} @dots{} @code{@@end
13488 itemize} and @code{@@enumerate} @dots{} @code{@@end enumerate} in the
13489 same way.
13490 @end itemize
13491
13492 @subsubheading Complete phrases
13493
13494 Complete phrases are easier to read than @dots{}
13495
13496 @itemize @bullet
13497 @item
13498 Write entries in an itemized list as complete sentences; or at least, as
13499 complete phrases. Incomplete expressions @dots{} awkward @dots{} like
13500 this.
13501
13502 @item
13503 Write the prefatory sentence or phrase for a multi-item list or table as
13504 a complete expression. Do not write ``You can set:''; instead, write
13505 ``You can set these variables:''. The former expression sounds cut off.
13506 @end itemize
13507
13508 @subsubheading Editions, dates and versions
13509
13510 Write the edition and version numbers and date in three places in every
13511 manual:
13512
13513 @enumerate
13514 @item
13515 In the first @code{@@ifinfo} section, for people reading the Texinfo file.
13516
13517 @item
13518 In the @code{@@titlepage} section, for people reading the printed manual.
13519
13520 @item
13521 In the `Top' node, for people reading the Info file.
13522 @end enumerate
13523
13524 @noindent
13525 Also, it helps to write a note before the first @code{@@ifinfo}
13526 section to explain what you are doing.
13527
13528 @need 800
13529 @noindent
13530 For example:
13531
13532 @example
13533 @group
13534 @@c ===> NOTE! <==
13535 @@c Specify the edition and version numbers and date
13536 @@c in *three* places:
13537 @@c 1. First ifinfo section 2. title page 3. top node
13538 @@c To find the locations, search for !!set
13539 @end group
13540
13541 @group
13542 @@ifinfo
13543 @@c !!set edition, date, version
13544 This is Edition 4.03, January 1992,
13545 of the @@cite@{GDB Manual@} for GDB Version 4.3.
13546 @dots{}
13547 @end group
13548 @end example
13549
13550 @noindent
13551 ---or use @code{@@set} and @code{@@value}
13552 (@pxref{value Example, , @code{@@value} Example}).
13553
13554 @subsubheading Definition Commands
13555
13556 Definition commands are @code{@@deffn}, @code{@@defun},
13557 @code{@@defmac}, and the like, and enable you to write descriptions in
13558 a uniform format.@refill
13559
13560 @itemize @bullet
13561 @item
13562 Write just one definition command for each entity you define with a
13563 definition command. The automatic indexing feature creates an index
13564 entry that leads the reader to the definition.
13565
13566 @item
13567 Use @code{@@table} @dots{} @code{@@end table} in an appendix that
13568 contains a summary of functions, not @code{@@deffn} or other definition
13569 commands.
13570 @end itemize
13571
13572 @subsubheading Capitalization
13573
13574 @itemize @bullet
13575 @item
13576 Capitalize @samp{Texinfo}; it is a name. Do not write the @samp{x} or
13577 @samp{i} in upper case.
13578
13579 @item
13580 Capitalize @samp{Info}; it is a name.
13581
13582 @item
13583 Write @TeX{} using the @code{@@TeX@{@}} command. Note the uppercase
13584 @samp{T} and @samp{X}. This command causes the formatters to
13585 typeset the name according to the wishes of Donald Knuth, who wrote
13586 @TeX{}.
13587 @end itemize
13588
13589 @subsubheading Spaces
13590
13591 Do not use spaces to format a Texinfo file, except inside of
13592 @code{@@example} @dots{} @code{@@end example} and similar commands.
13593
13594 @need 700
13595 For example, @TeX{} fills the following:
13596
13597 @example
13598 @group
13599 @@kbd@{C-x v@}
13600 @@kbd@{M-x vc-next-action@}
13601 Perform the next logical operation
13602 on the version-controlled file
13603 corresponding to the current buffer.
13604 @end group
13605 @end example
13606
13607 @need 950
13608 @noindent
13609 so it looks like this:
13610
13611 @iftex
13612 @quotation
13613 @kbd{C-x v}
13614 @kbd{M-x vc-next-action}
13615 Perform the next logical operation on the version-controlled file
13616 corresponding to the current buffer.
13617 @end quotation
13618 @end iftex
13619 @ifinfo
13620 @quotation
13621 `C-x v' `M-x vc-next-action' Perform the next logical operation on the
13622 version-controlled file corresponding to the current buffer.
13623 @end quotation
13624 @end ifinfo
13625
13626 @noindent
13627 In this case, the text should be formatted with
13628 @code{@@table}, @code{@@item}, and @code{@@itemx}, to create a table.
13629
13630 @subsubheading @@code, @@samp, @@var, and @samp{---}
13631
13632 @itemize @bullet
13633 @item
13634 Use @code{@@code} around Lisp symbols, including command names.
13635 For example,
13636
13637 @example
13638 The main function is @@code@{vc-next-action@}, @dots{}
13639 @end example
13640
13641 @item
13642 Avoid putting letters such as @samp{s} immediately after an
13643 @samp{@@code}. Such letters look bad.
13644
13645 @item
13646 Use @code{@@var} around meta-variables. Do not write angle brackets
13647 around them.
13648
13649 @item
13650 Use three hyphens in a row, @samp{---}, to indicate a long dash. @TeX{}
13651 typesets these as a long dash and the Info formatters reduce three
13652 hyphens to two.
13653 @end itemize
13654
13655 @subsubheading Periods Outside of Quotes
13656
13657 Place periods and other punctuation marks @emph{outside} of quotations,
13658 unless the punctuation is part of the quotation. This practice goes against
13659 convention, but enables the reader to distinguish between the contents
13660 of the quotation and the whole passage.
13661
13662 For example, you should write the following sentence with the period
13663 outside the end quotation marks:
13664
13665 @example
13666 Evidently, @samp{au} is an abbreviation for ``author''.
13667 @end example
13668
13669 @noindent
13670 since @samp{au} does @emph{not} serve as an abbreviation for
13671 @samp{author.} (with a period following the word).
13672
13673 @subsubheading Introducing New Terms
13674
13675 @itemize @bullet
13676 @item
13677 Introduce new terms so that a user who does not know them can understand
13678 them from context; or write a definition for the term.
13679
13680 For example, in the following, the terms ``check in'', ``register'' and
13681 ``delta'' are all appearing for the first time; the example sentence should be
13682 rewritten so they are understandable.
13683
13684 @quotation
13685 The major function assists you in checking in a file to your
13686 version control system and registering successive sets of changes to
13687 it as deltas.
13688 @end quotation
13689
13690 @item
13691 Use the @code{@@dfn} command around a word being introduced, to indicate
13692 that the user should not expect to know the meaning already, and should
13693 expect to learn the meaning from this passage.
13694 @end itemize
13695
13696 @subsubheading @@pxref
13697
13698 @c !!! maybe include this in the tips on pxref
13699 @ignore
13700 By the way, it is okay to use pxref with something else in front of
13701 it within the parens, as long as the pxref is followed by the close
13702 paren, and the material inside the parents is not part of a larger
13703 sentence. Also, you can use xref inside parens as part of a complete
13704 sentence so long as you terminate the cross reference with punctuation.
13705 @end ignore
13706 Absolutely never use @code{@@pxref} except in the special context for
13707 which it is designed: inside parentheses, with the closing parenthesis
13708 following immediately after the closing brace. One formatter
13709 automatically inserts closing punctuation and the other does not. This
13710 means that the output looks right both in printed output and in an Info
13711 file, but only when the command is used inside parentheses.
13712
13713 @subsubheading Invoking from a Shell
13714
13715 You can invoke programs such as Emacs, GCC, and GAWK from a shell.
13716 The documentation for each program should contain a section that
13717 describes this. Unfortunately, if the node names and titles for these
13718 sections are all different, readers find it hard to search for the
13719 section.@refill
13720
13721 Name such sections with a phrase beginning with the word
13722 @w{`Invoking @dots{}'}, as in `Invoking Emacs'; this way
13723 users can find the section easily.
13724
13725 @subsubheading @sc{ansi c} Syntax
13726
13727 When you use @code{@@example} to describe a C function's calling
13728 conventions, use the @sc{ansi c} syntax, like this:@refill
13729
13730 @example
13731 void dld_init (char *@@var@{path@});
13732 @end example
13733
13734 @noindent
13735 And in the subsequent discussion, refer to the argument values by
13736 writing the same argument names, again highlighted with
13737 @code{@@var}.@refill
13738
13739 @need 800
13740 Avoid the obsolete style that looks like this:@refill
13741
13742 @example
13743 #include <dld.h>
13744
13745 dld_init (path)
13746 char *path;
13747 @end example
13748
13749 Also, it is best to avoid writing @code{#include} above the
13750 declaration just to indicate that the function is declared in a
13751 header file. The practice may give the misimpression that the
13752 @code{#include} belongs near the declaration of the function. Either
13753 state explicitly which header file holds the declaration or, better
13754 yet, name the header file used for a group of functions at the
13755 beginning of the section that describes the functions.@refill
13756
13757 @subsubheading Bad Examples
13758
13759 Here are several examples of bad writing to avoid:
13760
13761 In this example, say, `` @dots{} you must @code{@@dfn}@{check
13762 in@} the new version.'' That flows better.
13763
13764 @quotation
13765 When you are done editing the file, you must perform a
13766 @code{@@dfn}@{check in@}.
13767 @end quotation
13768
13769 In the following example, say, ``@dots{} makes a unified interface such as VC
13770 mode possible.''
13771
13772 @quotation
13773 SCCS, RCS and other version-control systems all perform similar
13774 functions in broadly similar ways (it is this resemblance which makes
13775 a unified control mode like this possible).
13776 @end quotation
13777
13778 And in this example, you should specify what `it' refers to:
13779
13780 @quotation
13781 If you are working with other people, it assists in coordinating
13782 everyone's changes so they do not step on each other.
13783 @end quotation
13784
13785 @subsubheading And Finally @dots{}
13786
13787 @itemize @bullet
13788 @item
13789 Pronounce @TeX{} as if the @samp{X} were a Greek `chi', as the last
13790 sound in the name `Bach'. But pronounce Texinfo as in `speck':
13791 @samp{teckinfo}.
13792
13793 @item
13794 Write notes for yourself at the very end of a Texinfo file after the
13795 @code{@@bye}. None of the formatters process text after the
13796 @code{@@bye}; it is as if the text were within @code{@@ignore} @dots{}
13797 @code{@@end ignore}.
13798 @end itemize
13799
13800 @node Sample Texinfo File, Sample Permissions, Tips, Top
13801 @comment node-name, next, previous, up
13802 @appendix A Sample Texinfo File
13803 @cindex Sample Texinfo file, no comments
13804
13805 Here is a complete, short sample Texinfo file, without any commentary.
13806 You can see this file, with comments, in the first chapter.
13807 @xref{Short Sample, , A Short Sample Texinfo File}.
13808
13809 @sp 1
13810 @example
13811 \input texinfo @@c -*-texinfo-*-
13812 @@c %**start of header
13813 @@setfilename sample.info
13814 @@settitle Sample Document
13815 @@c %**end of header
13816
13817 @@setchapternewpage odd
13818
13819 @@ifinfo
13820 This is a short example of a complete Texinfo file.
13821
13822 Copyright 1990 Free Software Foundation, Inc.
13823 @@end ifinfo
13824
13825 @@titlepage
13826 @@sp 10
13827 @@comment The title is printed in a large font.
13828 @@center @@titlefont@{Sample Title@}
13829
13830 @@c The following two commands start the copyright page.
13831 @@page
13832 @@vskip 0pt plus 1filll
13833 Copyright @@copyright@{@} 1990 Free Software Foundation, Inc.
13834 @@end titlepage
13835
13836 @@node Top, First Chapter, (dir), (dir)
13837 @@comment node-name, next, previous, up
13838
13839 @@menu
13840 * First Chapter:: The first chapter is the
13841 only chapter in this sample.
13842 * Concept Index:: This index has two entries.
13843 @@end menu
13844
13845 @@node First Chapter, Concept Index, Top, Top
13846 @@comment node-name, next, previous, up
13847 @@chapter First Chapter
13848 @@cindex Sample index entry
13849
13850 This is the contents of the first chapter.
13851 @@cindex Another sample index entry
13852
13853 Here is a numbered list.
13854
13855 @@enumerate
13856 @@item
13857 This is the first item.
13858
13859 @@item
13860 This is the second item.
13861 @@end enumerate
13862
13863 The @@code@{makeinfo@} and @@code@{texinfo-format-buffer@}
13864 commands transform a Texinfo file such as this into
13865 an Info file; and @@TeX@{@} typesets it for a printed
13866 manual.
13867
13868 @@node Concept Index, , First Chapter, Top
13869 @@comment node-name, next, previous, up
13870 @@unnumbered Concept Index
13871
13872 @@printindex cp
13873
13874 @@contents
13875 @@bye
13876 @end example
13877
13878 @node Sample Permissions, Include Files, Sample Texinfo File, Top
13879 @appendix Sample Permissions
13880 @cindex Permissions
13881 @cindex Copying permissions
13882
13883 Texinfo files should contain sections that tell the readers that they
13884 have the right to copy and distribute the Texinfo file, the Info file,
13885 and the printed manual.@refill
13886
13887 Also, if you are writing a manual about software, you should explain
13888 that the software is free and either include the GNU General Public
13889 License (GPL) or provide a reference to it. @xref{Distrib, ,
13890 Distribution, emacs, The GNU Emacs Manual}, for an example of the text
13891 that could be used in the software ``Distribution'', ``General Public
13892 License'', and ``NO WARRANTY'' sections of a document. @xref{Copying,
13893 , Texinfo Copying Conditions}, for an example of a brief explanation
13894 of how the copying conditions provide you with rights. @refill
13895
13896 @menu
13897 * Inserting Permissions:: How to put permissions in your document.
13898 * ifinfo Permissions:: Sample @samp{ifinfo} copying permissions.
13899 * Titlepage Permissions:: Sample Titlepage copying permissions.
13900 @end menu
13901
13902 @node Inserting Permissions, ifinfo Permissions, Sample Permissions, Sample Permissions
13903 @ifinfo
13904 @appendixsec Inserting Permissions
13905 @end ifinfo
13906
13907 In a Texinfo file, the first @code{@@ifinfo} section usually begins
13908 with a line that says what the file documents. This is what a person
13909 reading the unprocessed Texinfo file or using the advanced Info
13910 command @kbd{g *} sees first. @inforef{Expert, Advanced Info
13911 commands, info}, for more information. (A reader using the regular
13912 Info commands usually starts reading at the first node and skips
13913 this first section, which is not in a node.)@refill
13914
13915 In the @code{@@ifinfo} section, the summary sentence is followed by a
13916 copyright notice and then by the copying permission notice. One of
13917 the copying permission paragraphs is enclosed in @code{@@ignore} and
13918 @code{@@end ignore} commands. This paragraph states that the Texinfo
13919 file can be processed through @TeX{} and printed, provided the printed
13920 manual carries the proper copying permission notice. This paragraph
13921 is not made part of the Info file since it is not relevant to the Info
13922 file; but it is a mandatory part of the Texinfo file since it permits
13923 people to process the Texinfo file in @TeX{} and print the
13924 results.@refill
13925
13926 In the printed manual, the Free Software Foundation copying permission
13927 notice follows the copyright notice and publishing information and is
13928 located within the region delineated by the @code{@@titlepage} and
13929 @code{@@end titlepage} commands. The copying permission notice is exactly
13930 the same as the notice in the @code{@@ifinfo} section except that the
13931 paragraph enclosed in @code{@@ignore} and @code{@@end ignore} commands is
13932 not part of the notice.@refill
13933
13934 To make it simple to insert a permission notice into each section of
13935 the Texinfo file, sample permission notices for each section are
13936 reproduced in full below.@refill
13937
13938 Note that you may need to specify the correct name of a section
13939 mentioned in the permission notice. For example, in @cite{The GDB
13940 Manual}, the name of the section referring to the General Public
13941 License is called the ``GDB General Public License'', but in the
13942 sample shown below, that section is referred to generically as the
13943 ``GNU General Public License''. If the Texinfo file does not carry a
13944 copy of the General Public License, leave out the reference to it, but
13945 be sure to include the rest of the sentence.@refill
13946
13947 @node ifinfo Permissions, Titlepage Permissions, Inserting Permissions, Sample Permissions
13948 @comment node-name, next, previous, up
13949 @appendixsec @samp{ifinfo} Copying Permissions
13950 @cindex @samp{ifinfo} permissions
13951
13952 In the @code{@@ifinfo} section of a Texinfo file, the standard Free
13953 Software Foundation permission notice reads as follows:@refill
13954
13955 @example
13956 This file documents @dots{}
13957
13958 Copyright 1992 Free Software Foundation, Inc.
13959
13960 Permission is granted to make and distribute verbatim
13961 copies of this manual provided the copyright notice and
13962 this permission notice are preserved on all copies.
13963
13964 @@ignore
13965 Permission is granted to process this file through TeX
13966 and print the results, provided the printed document
13967 carries a copying permission notice identical to this
13968 one except for the removal of this paragraph (this
13969 paragraph not being relevant to the printed manual).
13970
13971 @@end ignore
13972 Permission is granted to copy and distribute modified
13973 versions of this manual under the conditions for
13974 verbatim copying, provided also that the sections
13975 entitled ``Copying'' and ``GNU General Public License''
13976 are included exactly as in the original, and provided
13977 that the entire resulting derived work is distributed
13978 under the terms of a permission notice identical to this
13979 one.
13980
13981 Permission is granted to copy and distribute
13982 translations of this manual into another language,
13983 under the above conditions for modified versions,
13984 except that this permission notice may be stated in a
13985 translation approved by the Free Software Foundation.
13986 @end example
13987
13988 @node Titlepage Permissions, , ifinfo Permissions, Sample Permissions
13989 @comment node-name, next, previous, up
13990 @appendixsec Titlepage Copying Permissions
13991 @cindex Titlepage permissions
13992
13993 In the @code{@@titlepage} section of a Texinfo file, the standard Free
13994 Software Foundation copying permission notice follows the copyright
13995 notice and publishing information. The standard phrasing is as
13996 follows:@refill
13997
13998 @example
13999 Permission is granted to make and distribute verbatim
14000 copies of this manual provided the copyright notice and
14001 this permission notice are preserved on all copies.
14002
14003 Permission is granted to copy and distribute modified
14004 versions of this manual under the conditions for
14005 verbatim copying, provided also that the sections
14006 entitled ``Copying'' and ``GNU General Public License''
14007 are included exactly as in the original, and provided
14008 that the entire resulting derived work is distributed
14009 under the terms of a permission notice identical to this
14010 one.
14011
14012 Permission is granted to copy and distribute
14013 translations of this manual into another language,
14014 under the above conditions for modified versions,
14015 except that this permission notice may be stated in a
14016 translation approved by the Free Software Foundation.
14017 @end example
14018
14019 @node Include Files, Headings, Sample Permissions, Top
14020 @comment node-name, next, previous, up
14021 @appendix Include Files
14022 @cindex Include files
14023
14024 When @TeX{} or an Info formatting command sees an @code{@@include}
14025 command in a Texinfo file, it processes the contents of the file named
14026 by the command and incorporates them into the @sc{dvi} or Info file being
14027 created. Index entries from the included file are incorporated into
14028 the indices of the output file.@refill
14029
14030 Include files let you keep a single large document as a collection of
14031 conveniently small parts.@refill
14032
14033 @menu
14034 * Using Include Files:: How to use the @code{@@include} command.
14035 * texinfo-multiple-files-update:: How to create and update nodes and
14036 menus when using included files.
14037 * Include File Requirements:: What @code{texinfo-multiple-files-update} expects.
14038 * Sample Include File:: A sample outer file with included files
14039 within it; and a sample included file.
14040 * Include Files Evolution:: How use of the @code{@@include} command
14041 has changed over time.
14042 @end menu
14043
14044 @node Using Include Files, texinfo-multiple-files-update, Include Files, Include Files
14045 @appendixsec How to Use Include Files
14046 @findex include
14047
14048 To include another file within a Texinfo file, write the
14049 @code{@@include} command at the beginning of a line and follow it on
14050 the same line by the name of a file to be included. For
14051 example:@refill
14052
14053 @example
14054 @@include buffers.texi
14055 @end example
14056
14057 An included file should simply be a segment of text that you expect to
14058 be included as is into the overall or @dfn{outer} Texinfo file; it
14059 should not contain the standard beginning and end parts of a Texinfo
14060 file. In particular, you should not start an included file with a
14061 line saying @samp{\input texinfo}; if you do, that phrase is inserted
14062 into the output file as is. Likewise, you should not end an included
14063 file with an @code{@@bye} command; nothing after @code{@@bye} is
14064 formatted.@refill
14065
14066 In the past, you were required to write an @code{@@setfilename} line at the
14067 beginning of an included file, but no longer. Now, it does not matter
14068 whether you write such a line. If an @code{@@setfilename} line exists
14069 in an included file, it is ignored.@refill
14070
14071 Conventionally, an included file begins with an @code{@@node} line that
14072 is followed by an @code{@@chapter} line. Each included file is one
14073 chapter. This makes it easy to use the regular node and menu creating
14074 and updating commands to create the node pointers and menus within the
14075 included file. However, the simple Emacs node and menu creating and
14076 updating commands do not work with multiple Texinfo files. Thus you
14077 cannot use these commands to fill in the `Next', `Previous', and `Up'
14078 pointers of the @code{@@node} line that begins the included file. Also,
14079 you cannot use the regular commands to create a master menu for the
14080 whole file. Either you must insert the menus and the `Next',
14081 `Previous', and `Up' pointers by hand, or you must use the GNU Emacs
14082 Texinfo mode command, @code{texinfo-multiple-files-update}, that is
14083 designed for @code{@@include} files.@refill
14084
14085 @node texinfo-multiple-files-update, Include File Requirements, Using Include Files, Include Files
14086 @appendixsec @code{texinfo-multiple-files-update}
14087 @findex texinfo-multiple-files-update
14088
14089 GNU Emacs Texinfo mode provides the @code{texinfo-multiple-files-update}
14090 command. This command creates or updates `Next', `Previous', and `Up'
14091 pointers of included files as well as those in the outer or overall
14092 Texinfo file, and it creates or updates a main menu in the outer file.
14093 Depending whether you call it with optional arguments, the command
14094 updates only the pointers in the first @code{@@node} line of the
14095 included files or all of them:@refill
14096
14097 @table @kbd
14098 @item M-x texinfo-multiple-files-update
14099 Called without any arguments:@refill
14100
14101 @itemize @minus
14102 @item
14103 Create or update the `Next', `Previous', and `Up' pointers of the
14104 first @code{@@node} line in each file included in an outer or overall
14105 Texinfo file.@refill
14106
14107 @item
14108 Create or update the `Top' level node pointers of the outer or
14109 overall file.@refill
14110
14111 @item
14112 Create or update a main menu in the outer file.@refill
14113 @end itemize
14114
14115 @item C-u M-x texinfo-multiple-files-update
14116 Called with @kbd{C-u} as a prefix argument:
14117
14118 @itemize @minus{}
14119 @item
14120 Create or update pointers in the first @code{@@node} line in each
14121 included file.
14122
14123 @item
14124 Create or update the `Top' level node pointers of the outer file.
14125
14126 @item
14127 Create and insert a master menu in the outer file. The master menu
14128 is made from all the menus in all the included files.@refill
14129 @end itemize
14130
14131 @item C-u 8 M-x texinfo-multiple-files-update
14132 Called with a numeric prefix argument, such as @kbd{C-u 8}:
14133
14134 @itemize @minus
14135 @item
14136 Create or update @strong{all} the `Next', `Previous', and `Up' pointers
14137 of all the included files.@refill
14138
14139 @item
14140 Create or update @strong{all} the menus of all the included
14141 files.@refill
14142
14143 @item
14144 Create or update the `Top' level node pointers of the outer or
14145 overall file.@refill
14146
14147 @item
14148 And then create a master menu in the outer file. This is similar to
14149 invoking @code{texinfo-master-menu} with an argument when you are
14150 working with just one file.@refill
14151 @end itemize
14152 @end table
14153
14154 Note the use of the prefix argument in interactive use: with a regular
14155 prefix argument, just @w{@kbd{C-u}}, the
14156 @code{texinfo-multiple-files-update} command inserts a master menu;
14157 with a numeric prefix argument, such as @kbd{C-u 8}, the command
14158 updates @strong{every} pointer and menu in @strong{all} the files and then inserts a
14159 master menu.@refill
14160
14161 @node Include File Requirements, Sample Include File, texinfo-multiple-files-update, Include Files
14162 @appendixsec Include File Requirements
14163 @cindex Include file requirements
14164 @cindex Requirements for include files
14165
14166 If you plan to use the @code{texinfo-multiple-files-update} command,
14167 the outer Texinfo file that lists included files within it should
14168 contain nothing but the beginning and end parts of a Texinfo file, and
14169 a number of @code{@@include} commands listing the included files. It
14170 should not even include indices, which should be listed in an included
14171 file of their own.@refill
14172
14173 Moreover, each of the included files must contain exactly one highest
14174 level node (conventionally, @code{@@chapter} or equivalent),
14175 and this node must be the first node in the included file.
14176 Furthermore, each of these highest level nodes in each included file
14177 must be at the same hierarchical level in the file structure.
14178 Usually, each is an @code{@@chapter}, an @code{@@appendix}, or an
14179 @code{@@unnumbered} node. Thus, normally, each included file contains
14180 one, and only one, chapter or equivalent-level node.@refill
14181
14182 The outer file should contain only @emph{one} node, the `Top' node. It
14183 should @emph{not} contain any nodes besides the single `Top' node. The
14184 @code{texinfo-multiple-files-update} command will not process
14185 them.@refill
14186
14187 @node Sample Include File, Include Files Evolution, Include File Requirements, Include Files
14188 @appendixsec Sample File with @code{@@include}
14189 @cindex Sample @code{@@include} file
14190 @cindex Include file sample
14191 @cindex @code{@@include} file sample
14192
14193 Here is an example of a complete outer Texinfo file with @code{@@include} files
14194 within it before running @code{texinfo-multiple-files-update}, which
14195 would insert a main or master menu:@refill
14196
14197 @example
14198 @group
14199 \input texinfo @@c -*-texinfo-*-
14200 @c %**start of header
14201 @@setfilename include-example.info
14202 @@settitle Include Example
14203 @c %**end of header
14204 @end group
14205
14206 @group
14207 @@setchapternewpage odd
14208 @@titlepage
14209 @@sp 12
14210 @@center @@titlefont@{Include Example@}
14211 @@sp 2
14212 @@center by Whom Ever
14213 @end group
14214
14215 @group
14216 @@page
14217 @@vskip 0pt plus 1filll
14218 Copyright @@copyright@{@} 1990 Free Software Foundation, Inc.
14219 @@end titlepage
14220 @end group
14221
14222 @group
14223 @@ifinfo
14224 @@node Top, First, (dir), (dir)
14225 @@top Master Menu
14226 @@end ifinfo
14227 @end group
14228
14229 @group
14230 @@include foo.texinfo
14231 @@include bar.texinfo
14232 @@include concept-index.texinfo
14233 @end group
14234
14235 @group
14236 @@summarycontents
14237 @@contents
14238
14239 @@bye
14240 @end group
14241 @end example
14242
14243 An included file, such as @file{foo.texinfo}, might look like
14244 this:@refill
14245
14246 @example
14247 @group
14248 @@node First, Second, , Top
14249 @@chapter First Chapter
14250
14251 Contents of first chapter @dots{}
14252 @end group
14253 @end example
14254
14255 The full contents of @file{concept-index.texinfo} might be as simple as this:
14256
14257 @example
14258 @group
14259 @@node Concept Index, , Second, Top
14260 @@unnumbered Concept Index
14261
14262 @@printindex cp
14263 @end group
14264 @end example
14265
14266 The outer Texinfo source file for @cite{The GNU Emacs Lisp Reference
14267 Manual} is named @file{elisp.texi}. This outer file contains a master
14268 menu with 417 entries and a list of 41 @code{@@include}
14269 files.@refill
14270
14271 @node Include Files Evolution, , Sample Include File, Include Files
14272 @comment node-name, next, previous, up
14273 @appendixsec Evolution of Include Files
14274
14275 When Info was first created, it was customary to create many small
14276 Info files on one subject. Each Info file was formatted from its own
14277 Texinfo source file. This custom meant that Emacs did not need to
14278 make a large buffer to hold the whole of a large Info file when
14279 someone wanted information; instead, Emacs allocated just enough
14280 memory for the small Info file that contained the particular
14281 information sought. This way, Emacs could avoid wasting memory.@refill
14282
14283 References from one file to another were made by referring to the file
14284 name as well as the node name. (@xref{Other Info Files, , Referring to
14285 Other Info Files}. Also, see @ref{Four and Five Arguments, ,
14286 @code{@@xref} with Four and Five Arguments}.)@refill
14287
14288 Include files were designed primarily as a way to create a single,
14289 large printed manual out of several smaller Info files. In a printed
14290 manual, all the references were within the same document, so @TeX{}
14291 could automatically determine the references' page numbers. The Info
14292 formatting commands used include files only for creating joint
14293 indices; each of the individual Texinfo files had to be formatted for
14294 Info individually. (Each, therefore, required its own
14295 @code{@@setfilename} line.)@refill
14296
14297 However, because large Info files are now split automatically, it is
14298 no longer necessary to keep them small.@refill
14299
14300 Nowadays, multiple Texinfo files are used mostly for large documents,
14301 such as @cite{The GNU Emacs Lisp Reference Manual}, and for projects
14302 in which several different people write different sections of a
14303 document simultaneously.@refill
14304
14305 In addition, the Info formatting commands have been extended to work
14306 with the @code{@@include} command so as to create a single large Info
14307 file that is split into smaller files if necessary. This means that
14308 you can write menus and cross references without naming the different
14309 Texinfo files.@refill
14310
14311 @node Headings, Catching Mistakes, Include Files, Top
14312 @comment node-name, next, previous, up
14313 @appendix Page Headings
14314 @cindex Headings
14315 @cindex Footings
14316 @cindex Page numbering
14317 @cindex Page headings
14318 @cindex Formatting headings and footings
14319
14320 Most printed manuals contain headings along the top of every page
14321 except the title and copyright pages. Some manuals also contain
14322 footings. (Headings and footings have no meaning to Info, which is
14323 not paginated.)@refill
14324
14325 @menu
14326 * Headings Introduced:: Conventions for using page headings.
14327 * Heading Format:: Standard page heading formats.
14328 * Heading Choice:: How to specify the type of page heading.
14329 * Custom Headings:: How to create your own headings and footings.
14330 @end menu
14331
14332 @node Headings Introduced, Heading Format, Headings, Headings
14333 @ifinfo
14334 @heading Headings Introduced
14335 @end ifinfo
14336
14337 Texinfo provides standard page heading formats for manuals that are printed
14338 on one side of each sheet of paper and for manuals that are printed on
14339 both sides of the paper. Usually, you will use one or other of these
14340 formats, but you can specify your own format, if you wish.@refill
14341
14342 In addition, you can specify whether chapters should begin on a new
14343 page, or merely continue the same page as the previous chapter; and if
14344 chapters begin on new pages, you can specify whether they must be
14345 odd-numbered pages.@refill
14346
14347 By convention, a book is printed on both sides of each sheet of paper.
14348 When you open a book, the right-hand page is odd-numbered, and
14349 chapters begin on right-hand pages---a preceding left-hand page is
14350 left blank if necessary. Reports, however, are often printed on just
14351 one side of paper, and chapters begin on a fresh page immediately
14352 following the end of the preceding chapter. In short or informal
14353 reports, chapters often do not begin on a new page at all, but are
14354 separated from the preceding text by a small amount of whitespace.@refill
14355
14356 The @code{@@setchapternewpage} command controls whether chapters begin
14357 on new pages, and whether one of the standard heading formats is used.
14358 In addition, Texinfo has several heading and footing commands that you
14359 can use to generate your own heading and footing formats.@refill
14360
14361 In Texinfo, headings and footings are single lines at the tops and
14362 bottoms of pages; you cannot create multiline headings or footings.
14363 Each header or footer line is divided into three parts: a left part, a
14364 middle part, and a right part. Any part, or a whole line, may be left
14365 blank. Text for the left part of a header or footer line is set
14366 flushleft; text for the middle part is centered; and, text for the
14367 right part is set flushright.@refill
14368
14369 @node Heading Format, Heading Choice, Headings Introduced, Headings
14370 @comment node-name, next, previous, up
14371 @appendixsec Standard Heading Formats
14372
14373 Texinfo provides two standard heading formats, one for manuals printed
14374 on one side of each sheet of paper, and the other for manuals printed
14375 on both sides of the paper.
14376
14377 By default, nothing is specified for the footing of a Texinfo file,
14378 so the footing remains blank.@refill
14379
14380 The standard format for single-sided printing consists of a header
14381 line in which the left-hand part contains the name of the chapter, the
14382 central part is blank, and the right-hand part contains the page
14383 number.@refill
14384
14385 @need 950
14386 A single-sided page looks like this:
14387
14388 @example
14389 @group
14390 _______________________
14391 | |
14392 | chapter page number |
14393 | |
14394 | Start of text ... |
14395 | ... |
14396 | |
14397
14398 @end group
14399 @end example
14400
14401 The standard format for two-sided printing depends on whether the page
14402 number is even or odd. By convention, even-numbered pages are on the
14403 left- and odd-numbered pages are on the right. (@TeX{} will adjust the
14404 widths of the left- and right-hand margins. Usually, widths are
14405 correct, but during double-sided printing, it is wise to check that
14406 pages will bind properly---sometimes a printer will produce output in
14407 which the even-numbered pages have a larger right-hand margin than the
14408 odd-numbered pages.)@refill
14409
14410 In the standard double-sided format, the left part of the left-hand
14411 (even-numbered) page contains the page number, the central part is
14412 blank, and the right part contains the title (specified by the
14413 @code{@@settitle} command). The left part of the right-hand
14414 (odd-numbered) page contains the name of the chapter, the central part
14415 is blank, and the right part contains the page number.@refill
14416
14417 @need 750
14418 Two pages, side by side as in an open book, look like this:@refill
14419
14420 @example
14421 @group
14422 _______________________ _______________________
14423 | | | |
14424 | page number title | | chapter page number |
14425 | | | |
14426 | Start of text ... | | More text ... |
14427 | ... | | ... |
14428 | | | |
14429
14430 @end group
14431 @end example
14432
14433 @noindent
14434 The chapter name is preceded by the word @samp{Chapter}, the chapter
14435 number and a colon. This makes it easier to keep track of where you
14436 are in the manual.@refill
14437
14438 @node Heading Choice, Custom Headings, Heading Format, Headings
14439 @comment node-name, next, previous, up
14440 @appendixsec Specifying the Type of Heading
14441
14442 @TeX{} does not begin to generate page headings for a standard Texinfo
14443 file until it reaches the @code{@@end titlepage} command. Thus, the
14444 title and copyright pages are not numbered. The @code{@@end
14445 titlepage} command causes @TeX{} to begin to generate page headings
14446 according to a standard format specified by the
14447 @code{@@setchapternewpage} command that precedes the
14448 @code{@@titlepage} section.@refill
14449
14450 @need 1000
14451 There are four possibilities:@refill
14452
14453 @table @asis
14454 @item No @code{@@setchapternewpage} command
14455 Cause @TeX{} to specify the single-sided heading format, with chapters
14456 on new pages. This is the same as @code{@@setchapternewpage on}.@refill
14457
14458 @item @code{@@setchapternewpage on}
14459 Specify the single-sided heading format, with chapters on new pages.@refill
14460
14461 @item @code{@@setchapternewpage off}
14462 Cause @TeX{} to start a new chapter on the same page as the last page of
14463 the preceding chapter, after skipping some vertical whitespace. Also
14464 cause @TeX{} to typeset for single-sided printing. (You can override
14465 the headers format with the @code{@@headings double} command; see
14466 @ref{headings on off, , The @code{@@headings} Command}.)@refill
14467
14468 @item @code{@@setchapternewpage odd}
14469 Specify the double-sided heading format, with chapters on new pages.@refill
14470 @end table
14471
14472 @noindent
14473 Texinfo lacks an @code{@@setchapternewpage even} command.@refill
14474
14475 @node Custom Headings, , Heading Choice, Headings
14476 @comment node-name, next, previous, up
14477 @appendixsec How to Make Your Own Headings
14478
14479 You can use the standard headings provided with Texinfo or specify
14480 your own.@refill
14481
14482 @c Following paragraph is verbose to prevent overfull hboxes.
14483 Texinfo provides six commands for specifying headings and
14484 footings. The @code{@@everyheading} command and
14485 @code{@@everyfooting} command generate page headers and footers
14486 that are the same for both even- and odd-numbered pages.
14487 The @code{@@evenheading} command and @code{@@evenfooting}
14488 command generate headers and footers for even-numbered
14489 (left-hand) pages; and the @code{@@oddheading} command and
14490 @code{@@oddfooting} command generate headers and footers for
14491 odd-numbered (right-hand) pages.@refill
14492
14493 Write custom heading specifications in the Texinfo file immediately
14494 after the @code{@@end titlepage} command. Enclose your specifications
14495 between @code{@@iftex} and @code{@@end iftex} commands since the
14496 @code{texinfo-format-buffer} command may not recognize them. Also,
14497 you must cancel the predefined heading commands with the
14498 @code{@@headings off} command before defining your own
14499 specifications.@refill
14500
14501 @need 1000
14502 Here is how to tell @TeX{} to place the chapter name at the left, the
14503 page number in the center, and the date at the right of every header
14504 for both even- and odd-numbered pages:@refill
14505
14506 @example
14507 @group
14508 @@iftex
14509 @@headings off
14510 @@everyheading @@thischapter @@| @@thispage @@| @@today@{@}
14511 @@end iftex
14512 @end group
14513 @end example
14514
14515 @noindent
14516 You need to divide the left part from the central part and the central
14517 part from the right had part by inserting @samp{@@|} between parts.
14518 Otherwise, the specification command will not be able to tell where
14519 the text for one part ends and the next part begins.@refill
14520
14521 Each part can contain text or @@-commands. The text
14522 is printed as if the part were within an ordinary paragraph in the
14523 body of the page. The @@-commands replace
14524 themselves with the page number, date, chapter name, or
14525 whatever.@refill
14526
14527 @need 950
14528 Here are the six heading and footing commands:@refill
14529
14530 @findex everyheading
14531 @findex everyfooting
14532 @table @code
14533 @item @@everyheading @var{left} @@| @var{center} @@| @var{right}
14534 @itemx @@everyfooting @var{left} @@| @var{center} @@| @var{right}
14535
14536 The `every' commands specify the format for both even- and odd-numbered
14537 pages. These commands are for documents that are printed on one side
14538 of each sheet of paper, or for documents in which you want symmetrical
14539 headers or footers.@refill
14540
14541 @findex evenheading
14542 @findex evenfooting
14543 @findex oddheading
14544 @findex oddfooting
14545 @item @@evenheading @var{left} @@| @var{center} @@| @var{right}
14546 @itemx @@oddheading @var{left} @@| @var{center} @@| @var{right}
14547
14548 @itemx @@evenfooting @var{left} @@| @var{center} @@| @var{right}
14549 @itemx @@oddfooting @var{left} @@| @var{center} @@| @var{right}
14550
14551 The `even' and `odd' commands specify the format for even-numbered
14552 pages and odd-numbered pages. These commands are for books and
14553 manuals that are printed on both sides of each sheet of paper.@refill
14554 @end table
14555
14556 Use the @samp{@@this@dots{}} series of @@-commands to
14557 provide the names of chapters
14558 and sections and the page number. You can use the
14559 @samp{@@this@dots{}} commands in the left, center, or right portions
14560 of headers and footers, or anywhere else in a Texinfo file so long as
14561 they are between @code{@@iftex} and @code{@@end iftex} commands.@refill
14562
14563 @need 1000
14564 Here are the @samp{@@this@dots{}} commands:@refill
14565
14566 @table @code
14567 @findex thispage
14568 @item @@thispage
14569 Expands to the current page number.@refill
14570 @c !!! Karl Berry says that `thissection' fails on page breaks.
14571 @ignore
14572 @item @@thissection
14573 Expands to the name of the current section.@refill
14574 @end ignore
14575
14576 @findex thischaptername
14577 @item @@thischaptername
14578 Expands to the name of the current chapter.@refill
14579
14580 @findex thischapter
14581 @item @@thischapter
14582 Expands to the number and name of the current
14583 chapter, in the format `Chapter 1: Title'.@refill
14584
14585 @findex thistitle
14586 @item @@thistitle
14587 Expands to the name of the document, as specified by the
14588 @code{@@settitle} command.@refill
14589
14590 @findex thisfile
14591 @item @@thisfile
14592 For @code{@@include} files only: expands to the name of the current
14593 @code{@@include} file. If the current Texinfo source file is not an
14594 @code{@@include} file, this command has no effect. This command does
14595 @emph{not} provide the name of the current Texinfo source file unless
14596 it is an @code{@@include} file. (@xref{Include Files}, for more
14597 information about @code{@@include} files.)@refill
14598 @end table
14599
14600 @noindent
14601 You can also use the @code{@@today@{@}} command, which expands to the
14602 current date, in `1 Jan 1900' format.@refill
14603 @findex today
14604
14605 Other @@-commands and text are printed in a header or footer just as
14606 if they were in the body of a page. It is useful to incorporate text,
14607 particularly when you are writing drafts:@refill
14608
14609 @example
14610 @group
14611 @@iftex
14612 @@headings off
14613 @@everyheading @@emph@{Draft!@} @@| @@thispage @@| @@thischapter
14614 @@everyfooting @@| @@| Version: 0.27: @@today@{@}
14615 @@end iftex
14616 @end group
14617 @end example
14618
14619 Beware of overlong titles: they may overlap another part of the
14620 header or footer and blot it out.@refill
14621
14622 @node Catching Mistakes, Refilling Paragraphs, Headings, Top
14623 @comment node-name, next, previous, up
14624 @appendix Formatting Mistakes
14625 @cindex Structure, catching mistakes in
14626 @cindex Nodes, catching mistakes
14627 @cindex Catching mistakes
14628 @cindex Correcting mistakes
14629 @cindex Mistakes, catching
14630 @cindex Problems, catching
14631 @cindex Debugging the Texinfo structure
14632
14633 Besides mistakes in the content of your documentation, there
14634 are two kinds of mistake you can make with Texinfo: you can make mistakes
14635 with @@-commands, and you can make mistakes with the structure of the
14636 nodes and chapters.@refill
14637
14638 Emacs has two tools for catching the @@-command mistakes and two for
14639 catching structuring mistakes.@refill
14640
14641 For finding problems with @@-commands, you can run @TeX{} or a region
14642 formatting command on the region that has a problem; indeed, you can
14643 run these commands on each region as you write it.@refill
14644
14645 For finding problems with the structure of nodes and chapters, you can use
14646 @kbd{C-c C-s} (@code{texinfo-show-structure}) and the related @code{occur}
14647 command and you can use the @kbd{M-x Info-validate} command.@refill
14648
14649 @menu
14650 * makeinfo preferred:: @code{makeinfo} finds errors.
14651 * Debugging with Info:: How to catch errors with Info formatting.
14652 * Debugging with TeX:: How to catch errors with @TeX{} formatting.
14653 * Using texinfo-show-structure:: How to use @code{texinfo-show-structure}.
14654 * Using occur:: How to list all lines containing a pattern.
14655 * Running Info-Validate:: How to find badly referenced nodes.
14656 @end menu
14657
14658 @node makeinfo preferred, Debugging with Info, Catching Mistakes, Catching Mistakes
14659 @ifinfo
14660 @heading @code{makeinfo} Find Errors
14661 @end ifinfo
14662
14663 The @code{makeinfo} program does an excellent job of catching errors
14664 and reporting them---far better than @code{texinfo-format-region} or
14665 @code{texinfo-format-buffer}. In addition, the various functions for
14666 automatically creating and updating node pointers and menus remove
14667 many opportunities for human error.@refill
14668
14669 If you can, use the updating commands to create and insert pointers
14670 and menus. These prevent many errors. Then use @code{makeinfo} (or
14671 its Texinfo mode manifestations, @code{makeinfo-region} and
14672 @code{makeinfo-buffer}) to format your file and check for other
14673 errors. This is the best way to work with Texinfo. But if you
14674 cannot use @code{makeinfo}, or your problem is very puzzling, then you
14675 may want to use the tools described in this appendix.@refill
14676
14677 @node Debugging with Info, Debugging with TeX, makeinfo preferred, Catching Mistakes
14678 @comment node-name, next, previous, up
14679 @appendixsec Catching Errors with Info Formatting
14680 @cindex Catching errors with Info formatting
14681 @cindex Debugging with Info formatting
14682
14683 After you have written part of a Texinfo file, you can use the
14684 @code{texinfo-format-region} or the @code{makeinfo-region} command to
14685 see whether the region formats properly.@refill
14686
14687 Most likely, however, you are reading this section because for some
14688 reason you cannot use the @code{makeinfo-region} command; therefore, the
14689 rest of this section presumes that you are using
14690 @code{texinfo-format-region}.@refill
14691
14692 If you have made a mistake with an @@-command,
14693 @code{texinfo-format-region} will stop processing at or after the
14694 error and display an error message. To see where in the buffer the
14695 error occurred, switch to the @samp{*Info Region*} buffer; the cursor
14696 will be in a position that is after the location of the error. Also,
14697 the text will not be formatted after the place where the error
14698 occurred (or more precisely, where it was detected).@refill
14699
14700 For example, if you accidentally end a menu with the command @code{@@end
14701 menus} with an `s' on the end, instead of with @code{@@end menu}, you
14702 will see an error message that says:@refill
14703
14704 @example
14705 @@end menus is not handled by texinfo
14706 @end example
14707
14708 @noindent
14709 The cursor will stop at the point in the buffer where the error
14710 occurs, or not long after it. The buffer will look like this:@refill
14711
14712 @example
14713 @group
14714 ---------- Buffer: *Info Region* ----------
14715 * Menu:
14716
14717 * Using texinfo-show-structure:: How to use
14718 `texinfo-show-structure'
14719 to catch mistakes.
14720 * Running Info-Validate:: How to check for
14721 unreferenced nodes.
14722 @@end menus
14723 @point{}
14724 ---------- Buffer: *Info Region* ----------
14725 @end group
14726 @end example
14727
14728 The @code{texinfo-format-region} command sometimes provides slightly
14729 odd error messages. For example, the following cross reference fails to format:@refill
14730
14731 @example
14732 (@@xref@{Catching Mistakes, for more info.)
14733 @end example
14734
14735 @noindent
14736 In this case, @code{texinfo-format-region} detects the missing closing
14737 brace but displays a message that says @samp{Unbalanced parentheses}
14738 rather than @samp{Unbalanced braces}. This is because the formatting
14739 command looks for mismatches between braces as if they were
14740 parentheses.@refill
14741
14742 Sometimes @code{texinfo-format-region} fails to detect mistakes. For
14743 example, in the following, the closing brace is swapped with the
14744 closing parenthesis:@refill
14745
14746 @example
14747 (@@xref@{Catching Mistakes), for more info.@}
14748 @end example
14749
14750 @noindent
14751 Formatting produces:
14752 @example
14753 (*Note for more info.: Catching Mistakes)
14754 @end example
14755
14756 The only way for you to detect this error is to realize that the
14757 reference should have looked like this:@refill
14758
14759 @example
14760 (*Note Catching Mistakes::, for more info.)
14761 @end example
14762
14763 Incidentally, if you are reading this node in Info and type @kbd{f
14764 @key{RET}} (@code{Info-follow-reference}), you will generate an error
14765 message that says:
14766
14767 @example
14768 No such node: "Catching Mistakes) The only way @dots{}
14769 @end example
14770
14771 @noindent
14772 This is because Info perceives the example of the error as the first
14773 cross reference in this node and if you type a @key{RET} immediately
14774 after typing the Info @kbd{f} command, Info will attempt to go to the
14775 referenced node. If you type @kbd{f catch @key{TAB} @key{RET}}, Info
14776 will complete the node name of the correctly written example and take
14777 you to the `Catching Mistakes' node. (If you try this, you can return
14778 from the `Catching Mistakes' node by typing @kbd{l}
14779 (@code{Info-last}).)
14780
14781 @c !!! section on using Elisp debugger ignored.
14782 @ignore
14783 Sometimes @code{texinfo-format-region} will stop long after the
14784 original error; this is because it does not discover the problem until
14785 then. In this case, you will need to backtrack.@refill
14786
14787 @c menu
14788 @c * Using the Emacs Lisp Debugger:: How to use the Emacs Lisp debugger.
14789 @c end menu
14790
14791 @c node Using the Emacs Lisp Debugger
14792 @c appendixsubsec Using the Emacs Lisp Debugger
14793 @c index Using the Emacs Lisp debugger
14794 @c index Emacs Lisp debugger
14795 @c index Debugger, using the Emacs Lisp
14796
14797 If an error is especially elusive, you can turn on the Emacs Lisp
14798 debugger and look at the backtrace; this tells you where in the
14799 @code{texinfo-format-region} function the problem occurred. You can
14800 turn on the debugger with the command:@refill
14801
14802 @example
14803 M-x set-variable @key{RET} debug-on-error @key{RET} t @key{RET}
14804 @end example
14805
14806 @noindent
14807 and turn it off with
14808
14809 @example
14810 M-x set-variable @key{RET} debug-on-error @key{RET} nil @key{RET}
14811 @end example
14812
14813 Often, when you are using the debugger, it is easier to follow what is
14814 going on if you use the Emacs Lisp files that are not byte-compiled.
14815 The byte-compiled sources send octal numbers to the debugger that may
14816 look mysterious. To use the uncompiled source files, load
14817 @file{texinfmt.el} and @file{texinfo.el} with the @kbd{M-x load-file}
14818 command.@refill
14819
14820 The debugger will not catch an error if @code{texinfo-format-region}
14821 does not detect one. In the example shown above,
14822 @code{texinfo-format-region} did not find the error when the whole
14823 list was formatted, but only when part of the list was formatted.
14824 When @code{texinfo-format-region} did not find an error, the debugger
14825 did not find one either. @refill
14826
14827 However, when @code{texinfo-format-region} did report an error, it
14828 invoked the debugger. This is the backtrace it produced:@refill
14829
14830 @example
14831 ---------- Buffer: *Backtrace* ----------
14832 Signalling: (search-failed "[@},]")
14833 re-search-forward("[@},]")
14834 (while ...)
14835 (let ...)
14836 texinfo-format-parse-args()
14837 (let ...)
14838 texinfo-format-xref()
14839 funcall(texinfo-format-xref)
14840 (if ...)
14841 (let ...)
14842 (if ...)
14843 (while ...)
14844 texinfo-format-scan()
14845 (save-excursion ...)
14846 (let ...)
14847 texinfo-format-region(103370 103631)
14848 * call-interactively(texinfo-format-region)
14849 ---------- Buffer: *Backtrace* ----------
14850 @end example
14851
14852 The backtrace is read from the bottom up.
14853 @code{texinfo-format-region} was called interactively; and it, in
14854 turn, called various functions, including @code{texinfo-format-scan},
14855 @code{texinfo-format-xref} and @code{texinfo-format-parse-args}.
14856 Inside the function @code{texinfo-format-parse-args}, the function
14857 @code{re-search-forward} was called; it was this function that could
14858 not find the missing right-hand brace.@refill
14859
14860 @xref{Lisp Debug, , Debugging Emacs Lisp, emacs, The GNU Emacs
14861 Manual}, for more information.@refill
14862 @end ignore
14863
14864 @node Debugging with TeX, Using texinfo-show-structure, Debugging with Info, Catching Mistakes
14865 @comment node-name, next, previous, up
14866 @appendixsec Catching Errors with @TeX{} Formatting
14867 @cindex Catching errors with @TeX{} formatting
14868 @cindex Debugging with @TeX{} formatting
14869
14870 You can also catch mistakes when you format a file with @TeX{}.@refill
14871
14872 Usually, you will want to do this after you have run
14873 @code{texinfo-format-buffer} (or, better, @code{makeinfo-buffer}) on
14874 the same file, because @code{texinfo-format-buffer} sometimes displays
14875 error messages that make more sense than @TeX{}. (@xref{Debugging
14876 with Info}, for more information.)@refill
14877
14878 For example, @TeX{} was run on a Texinfo file, part of which is shown
14879 here:@refill
14880
14881 @example
14882 ---------- Buffer: texinfo.texi ----------
14883 name of the Texinfo file as an extension. The
14884 @@samp@{??@} are `wildcards' that cause the shell to
14885 substitute all the raw index files. (@@xref@{sorting
14886 indices, for more information about sorting
14887 indices.)@@refill
14888 ---------- Buffer: texinfo.texi ----------
14889 @end example
14890
14891 @noindent
14892 (The cross reference lacks a closing brace.)
14893 @TeX{} produced the following output, after which it stopped:@refill
14894
14895 @example
14896 ---------- Buffer: *tex-shell* ----------
14897 Runaway argument?
14898 @{sorting indices, for more information about sorting
14899 indices.) @@refill @@ETC.
14900 ! Paragraph ended before @@xref was complete.
14901 <to be read again>
14902 @@par
14903 l.27
14904
14905 ?
14906 ---------- Buffer: *tex-shell* ----------
14907 @end example
14908
14909 In this case, @TeX{} produced an accurate and
14910 understandable error message:
14911
14912 @example
14913 Paragraph ended before @@xref was complete.
14914 @end example
14915
14916 @noindent
14917 @samp{@@par} is an internal @TeX{} command of no relevance to Texinfo.
14918 @samp{l.27} means that @TeX{} detected the problem on line 27 of the
14919 Texinfo file. The @samp{?} is the prompt @TeX{} uses in this
14920 circumstance.@refill
14921
14922 Unfortunately, @TeX{} is not always so helpful, and sometimes you must
14923 truly be a Sherlock Holmes to discover what went wrong.@refill
14924
14925 In any case, if you run into a problem like this, you can do one of three
14926 things.@refill
14927
14928 @enumerate
14929 @item
14930 You can tell @TeX{} to continue running and ignore just this error by
14931 typing @key{RET} at the @samp{?} prompt.@refill
14932
14933 @item
14934 You can tell @TeX{} to continue running and to ignore all errors as best
14935 it can by typing @kbd{r @key{RET}} at the @samp{?} prompt.@refill
14936
14937 This is often the best thing to do. However, beware: the one error
14938 may produce a cascade of additional error messages as its consequences
14939 are felt through the rest of the file. (To stop @TeX{} when it is
14940 producing such an avalanche of error messages, type @kbd{C-d} (or
14941 @kbd{C-c C-d}, if you are running a shell inside Emacs.))@refill
14942
14943 @item
14944 You can tell @TeX{} to stop this run by typing @kbd{x @key{RET}}
14945 at the @samp{?} prompt.@refill
14946 @end enumerate
14947
14948 Please note that if you are running @TeX{} inside Emacs, you need to
14949 switch to the shell buffer and line at which @TeX{} offers the @samp{?}
14950 prompt.@refill
14951
14952 Sometimes @TeX{} will format a file without producing error messages even
14953 though there is a problem. This usually occurs if a command is not ended
14954 but @TeX{} is able to continue processing anyhow. For example, if you fail
14955 to end an itemized list with the @code{@@end itemize} command, @TeX{} will
14956 write a @sc{dvi} file that you can print out. The only error message that
14957 @TeX{} will give you is the somewhat mysterious comment that@refill
14958
14959 @example
14960 (@@end occurred inside a group at level 1)
14961 @end example
14962
14963 @noindent
14964 However, if you print the @sc{dvi} file, you will find that the text
14965 of the file that follows the itemized list is entirely indented as if
14966 it were part of the last item in the itemized list. The error message
14967 is the way @TeX{} says that it expected to find an @code{@@end}
14968 command somewhere in the file; but that it could not determine where
14969 it was needed.@refill
14970
14971 Another source of notoriously hard-to-find errors is a missing
14972 @code{@@end group} command. If you ever are stumped by
14973 incomprehensible errors, look for a missing @code{@@end group} command
14974 first.@refill
14975
14976 If the Texinfo file lacks header lines,
14977 @TeX{} may stop in the
14978 beginning of its run and display output that looks like the following.
14979 The @samp{*} indicates that @TeX{} is waiting for input.@refill
14980
14981 @example
14982 This is TeX, Version 2.0 for Berkeley UNIX
14983 (preloaded format=plain-cm 87.10.25)
14984 (test.texinfo [1])
14985 *
14986 @end example
14987
14988 @noindent
14989 In this case, simply type @kbd{\end @key{RET}} after the asterisk. Then
14990 write the header lines in the Texinfo file and run the @TeX{} command
14991 again. (Note the use of the backslash, @samp{\}. @TeX{} uses @samp{\}
14992 instead of @samp{@@}; and in this circumstance, you are working
14993 directly with @TeX{}, not with Texinfo.)@refill
14994
14995 @node Using texinfo-show-structure, Using occur, Debugging with TeX, Catching Mistakes
14996 @comment node-name, next, previous, up
14997 @appendixsec Using @code{texinfo-show-structure}
14998 @cindex Showing the structure of a file
14999 @findex texinfo-show-structure
15000
15001 It is not always easy to keep track of the nodes, chapters, sections, and
15002 subsections of a Texinfo file. This is especially true if you are revising
15003 or adding to a Texinfo file that someone else has written.@refill
15004
15005 In GNU Emacs, in Texinfo mode, the @code{texinfo-show-structure}
15006 command lists all the lines that begin with the @@-commands that
15007 specify the structure: @code{@@chapter}, @code{@@section},
15008 @code{@@appendix}, and so on. With an argument (@w{@kbd{C-u}}
15009 as prefix argument, if interactive),
15010 the command also shows the @code{@@node} lines. The
15011 @code{texinfo-show-structure} command is bound to @kbd{C-c C-s} in
15012 Texinfo mode, by default.@refill
15013
15014 The lines are displayed in a buffer called the @samp{*Occur*} buffer,
15015 indented by hierarchical level. For example, here is a part of what was
15016 produced by running @code{texinfo-show-structure} on this manual:@refill
15017
15018 @example
15019 @group
15020 Lines matching "^@@\\(chapter \\|sect\\|subs\\|subh\\|
15021 unnum\\|major\\|chapheading \\|heading \\|appendix\\)"
15022 in buffer texinfo.texi.
15023 @dots{}
15024 4177:@@chapter Nodes
15025 4198: @@heading Two Paths
15026 4231: @@section Node and Menu Illustration
15027 4337: @@section The @@code@{@@@@node@} Command
15028 4393: @@subheading Choosing Node and Pointer Names
15029 4417: @@subsection How to Write an @@code@{@@@@node@} Line
15030 4469: @@subsection @@code@{@@@@node@} Line Tips
15031 @dots{}
15032 @end group
15033 @end example
15034
15035 This says that lines 4337, 4393, and 4417 of @file{texinfo.texi} begin
15036 with the @code{@@section}, @code{@@subheading}, and @code{@@subsection}
15037 commands respectively. If you move your cursor into the @samp{*Occur*}
15038 window, you can position the cursor over one of the lines and use the
15039 @kbd{C-c C-c} command (@code{occur-mode-goto-occurrence}), to jump to
15040 the corresponding spot in the Texinfo file. @xref{Other Repeating
15041 Search, , Using Occur, emacs, The GNU Emacs Manual}, for more
15042 information about @code{occur-mode-goto-occurrence}.@refill
15043
15044 The first line in the @samp{*Occur*} window describes the @dfn{regular
15045 expression} specified by @var{texinfo-heading-pattern}. This regular
15046 expression is the pattern that @code{texinfo-show-structure} looks for.
15047 @xref{Regexps, , Using Regular Expressions, emacs, The GNU Emacs Manual},
15048 for more information.@refill
15049
15050 When you invoke the @code{texinfo-show-structure} command, Emacs will
15051 display the structure of the whole buffer. If you want to see the
15052 structure of just a part of the buffer, of one chapter, for example,
15053 use the @kbd{C-x n n} (@code{narrow-to-region}) command to mark the
15054 region. (@xref{Narrowing, , , emacs, The GNU Emacs Manual}.) This is
15055 how the example used above was generated. (To see the whole buffer
15056 again, use @kbd{C-x n w} (@code{widen}).)@refill
15057
15058 If you call @code{texinfo-show-structure} with a prefix argument by
15059 typing @w{@kbd{C-u C-c C-s}}, it will list lines beginning with
15060 @code{@@node} as well as the lines beginning with the @@-sign commands
15061 for @code{@@chapter}, @code{@@section}, and the like.@refill
15062
15063 You can remind yourself of the structure of a Texinfo file by looking at
15064 the list in the @samp{*Occur*} window; and if you have mis-named a node
15065 or left out a section, you can correct the mistake.@refill
15066
15067 @node Using occur, Running Info-Validate, Using texinfo-show-structure, Catching Mistakes
15068 @comment node-name, next, previous, up
15069 @appendixsec Using @code{occur}
15070 @cindex Occurrences, listing with @code{@@occur}
15071 @findex occur
15072
15073 Sometimes the @code{texinfo-show-structure} command produces too much
15074 information. Perhaps you want to remind yourself of the overall structure
15075 of a Texinfo file, and are overwhelmed by the detailed list produced by
15076 @code{texinfo-show-structure}. In this case, you can use the @code{occur}
15077 command directly. To do this, type@refill
15078
15079 @example
15080 @kbd{M-x occur}
15081 @end example
15082
15083 @noindent
15084 and then, when prompted, type a @dfn{regexp}, a regular expression for
15085 the pattern you want to match. (@xref{Regexps, , Regular Expressions,
15086 emacs, The GNU Emacs Manual}.) The @code{occur} command works from
15087 the current location of the cursor in the buffer to the end of the
15088 buffer. If you want to run @code{occur} on the whole buffer, place
15089 the cursor at the beginning of the buffer.@refill
15090
15091 For example, to see all the lines that contain the word
15092 @samp{@@chapter} in them, just type @samp{@@chapter}. This will
15093 produce a list of the chapters. It will also list all the sentences
15094 with @samp{@@chapter} in the middle of the line.@refill
15095
15096 If you want to see only those lines that start with the word
15097 @samp{@@chapter}, type @samp{^@@chapter} when prompted by
15098 @code{occur}. If you want to see all the lines that end with a word
15099 or phrase, end the last word with a @samp{$}; for example,
15100 @samp{catching mistakes$}. This can be helpful when you want to see
15101 all the nodes that are part of the same chapter or section and
15102 therefore have the same `Up' pointer.@refill
15103
15104 @xref{Other Repeating Search, , Using Occur, emacs , The GNU Emacs Manual},
15105 for more information.@refill
15106
15107 @node Running Info-Validate, , Using occur, Catching Mistakes
15108 @comment node-name, next, previous, up
15109 @appendixsec Finding Badly Referenced Nodes
15110 @findex Info-validate
15111 @cindex Nodes, checking for badly referenced
15112 @cindex Checking for badly referenced nodes
15113 @cindex Looking for badly referenced nodes
15114 @cindex Finding badly referenced nodes
15115 @cindex Badly referenced nodes
15116
15117 You can use the @code{Info-validate} command to check whether any of
15118 the `Next', `Previous', `Up' or other node pointers fail to point to a
15119 node. This command checks that every node pointer points to an
15120 existing node. The @code{Info-validate} command works only on Info
15121 files, not on Texinfo files.@refill
15122
15123 The @code{makeinfo} program validates pointers automatically, so you
15124 do not need to use the @code{Info-validate} command if you are using
15125 @code{makeinfo}. You only may need to use @code{Info-validate} if you
15126 are unable to run @code{makeinfo} and instead must create an Info file
15127 using @code{texinfo-format-region} or @code{texinfo-format-buffer}, or
15128 if you write an Info file from scratch.@refill
15129
15130 @menu
15131 * Using Info-validate:: How to run @code{Info-validate}.
15132 * Unsplit:: How to create an unsplit file.
15133 * Tagifying:: How to tagify a file.
15134 * Splitting:: How to split a file manually.
15135 @end menu
15136
15137 @node Using Info-validate, Unsplit, Running Info-Validate, Running Info-Validate
15138 @appendixsubsec Running @code{Info-validate}
15139 @cindex Running @code{Info-validate}
15140 @cindex Info validating a large file
15141 @cindex Validating a large file
15142
15143 To use @code{Info-validate}, visit the Info file you wish to check and
15144 type:@refill
15145
15146 @example
15147 M-x Info-validate
15148 @end example
15149
15150 @noindent
15151 (Note that the @code{Info-validate} command requires an upper case
15152 `I'. You may also need to create a tag table before running
15153 @code{Info-validate}. @xref{Tagifying}.)@refill
15154
15155 If your file is valid, you will receive a message that says ``File appears
15156 valid''. However, if you have a pointer that does not point to a node,
15157 error messages will be displayed in a buffer called @samp{*problems in
15158 info file*}.@refill
15159
15160 For example, @code{Info-validate} was run on a test file that contained
15161 only the first node of this manual. One of the messages said:@refill
15162
15163 @example
15164 In node "Overview", invalid Next: Texinfo Mode
15165 @end example
15166
15167 @noindent
15168 This meant that the node called @samp{Overview} had a `Next' pointer that
15169 did not point to anything (which was true in this case, since the test file
15170 had only one node in it).@refill
15171
15172 Now suppose we add a node named @samp{Texinfo Mode} to our test case
15173 but we do not specify a `Previous' for this node. Then we will get
15174 the following error message:@refill
15175
15176 @example
15177 In node "Texinfo Mode", should have Previous: Overview
15178 @end example
15179
15180 @noindent
15181 This is because every `Next' pointer should be matched by a
15182 `Previous' (in the node where the `Next' points) which points back.@refill
15183
15184 @code{Info-validate} also checks that all menu entries and cross references
15185 point to actual nodes.@refill
15186
15187 Note that @code{Info-validate} requires a tag table and does not work
15188 with files that have been split. (The @code{texinfo-format-buffer}
15189 command automatically splits large files.) In order to use
15190 @code{Info-validate} on a large file, you must run
15191 @code{texinfo-format-buffer} with an argument so that it does not split
15192 the Info file; and you must create a tag table for the unsplit
15193 file.@refill
15194
15195 @node Unsplit, Tagifying, Using Info-validate, Running Info-Validate
15196 @comment node-name, next, previous, up
15197 @appendixsubsec Creating an Unsplit File
15198 @cindex Creating an unsplit file
15199 @cindex Unsplit file creation
15200
15201 You can run @code{Info-validate} only on a single Info file that has a
15202 tag table. The command will not work on the indirect subfiles that
15203 are generated when a master file is split. If you have a large file
15204 (longer than 70,000 bytes or so), you need to run the
15205 @code{texinfo-format-buffer} or @code{makeinfo-buffer} command in such
15206 a way that it does not create indirect subfiles. You will also need
15207 to create a tag table for the Info file. After you have done this,
15208 you can run @code{Info-validate} and look for badly referenced
15209 nodes.@refill
15210
15211 The first step is to create an unsplit Info file. To prevent
15212 @code{texinfo-format-buffer} from splitting a Texinfo file into
15213 smaller Info files, give a prefix to the @kbd{M-x
15214 texinfo-format-buffer} command:@refill
15215
15216 @example
15217 C-u M-x texinfo-format-buffer
15218 @end example
15219
15220 @noindent
15221 or else
15222
15223 @example
15224 C-u C-c C-e C-b
15225 @end example
15226
15227 @noindent
15228 When you do this, Texinfo will not split the file and will not create
15229 a tag table for it. @refill
15230 @cindex Making a tag table manually
15231 @cindex Tag table, making manually
15232
15233 @node Tagifying, Splitting, Unsplit, Running Info-Validate
15234 @appendixsubsec Tagifying a File
15235
15236 After creating an unsplit Info file, you must create a tag table for
15237 it. Visit the Info file you wish to tagify and type:@refill
15238
15239 @example
15240 M-x Info-tagify
15241 @end example
15242
15243 @noindent
15244 (Note the upper case @key{I} in @code{Info-tagify}.) This creates an
15245 Info file with a tag table that you can validate.@refill
15246
15247 The third step is to validate the Info file:@refill
15248
15249 @example
15250 M-x Info-validate
15251 @end example
15252
15253 @noindent
15254 (Note the upper case @key{I} in @code{Info-validate}.)
15255 In brief, the steps are:@refill
15256
15257 @example
15258 @group
15259 C-u M-x texinfo-format-buffer
15260 M-x Info-tagify
15261 M-x Info-validate
15262 @end group
15263 @end example
15264
15265 After you have validated the node structure, you can rerun
15266 @code{texinfo-format-buffer} in the normal way so it will construct a
15267 tag table and split the file automatically, or you can make the tag
15268 table and split the file manually.@refill
15269
15270 @node Splitting, , Tagifying, Running Info-Validate
15271 @comment node-name, next, previous, up
15272 @appendixsubsec Splitting a File Manually
15273 @cindex Splitting an Info file manually
15274 @cindex Info file, splitting manually
15275
15276 You should split a large file or else let the
15277 @code{texinfo-format-buffer} or @code{makeinfo-buffer} command do it
15278 for you automatically. (Generally you will let one of the formatting
15279 commands do this job for you. @xref{Create an Info File}.)@refill
15280
15281 The split-off files are called the indirect subfiles.@refill
15282
15283 Info files are split to save memory. With smaller files, Emacs does not
15284 have make such a large buffer to hold the information.@refill
15285
15286 If an Info file has more than 30 nodes, you should also make a tag
15287 table for it. @xref{Using Info-validate}, for information
15288 about creating a tag table. (Again, tag tables are usually created
15289 automatically by the formatting command; you only need to create a tag
15290 table yourself if you are doing the job manually. Most likely, you
15291 will do this for a large, unsplit file on which you have run
15292 @code{Info-validate}.)@refill
15293
15294 @c Info-split is autoloaded in `loaddefs.el' in Emacs 18.51
15295 @ignore
15296 Before running @code{Info-split}, you need to load the @code{info} library
15297 into Emacs by giving the command @kbd{M-x load-library @key{RET} info
15298 @key{RET}}.
15299 @end ignore
15300
15301 Visit the Info file you wish to tagify and split and type the two
15302 commands:@refill
15303
15304 @example
15305 M-x Info-tagify
15306 M-x Info-split
15307 @end example
15308
15309 @noindent
15310 (Note that the @samp{I} in @samp{Info} is upper case.)@refill
15311
15312 When you use the @code{Info-split} command, the buffer is modified into a
15313 (small) Info file which lists the indirect subfiles. This file should be
15314 saved in place of the original visited file. The indirect subfiles are
15315 written in the same directory the original file is in, with names generated
15316 by appending @samp{-} and a number to the original file name.@refill
15317
15318 The primary file still functions as an Info file, but it contains just
15319 the tag table and a directory of subfiles.@refill
15320
15321 @node Refilling Paragraphs, Command Syntax, Catching Mistakes, Top
15322 @comment node-name, next, previous, up
15323 @appendix Refilling Paragraphs
15324 @cindex Refilling paragraphs
15325 @cindex Filling paragraphs
15326 @findex refill
15327
15328 The @code{@@refill} command refills and, optionally, indents the first
15329 line of a paragraph.@footnote{Perhaps the command should have been
15330 called the @code{@@refillandindent} command, but @code{@@refill} is
15331 shorter and the name was chosen before indenting was possible.} The
15332 @code{@@refill} command is no longer important, but we describe it here
15333 because you once needed it. You will see it in many old Texinfo
15334 files.@refill
15335
15336 Without refilling, paragraphs containing long @@-constructs may look
15337 bad after formatting because the formatter removes @@-commands and
15338 shortens some lines more than others. In the past, neither the
15339 @code{texinfo-format-region} command nor the
15340 @code{texinfo-format-buffer} command refilled paragraphs
15341 automatically. The @code{@@refill} command had to be written at the
15342 end of every paragraph to cause these formatters to fill them. (Both
15343 @TeX{} and @code{makeinfo} have always refilled paragraphs
15344 automatically.) Now, all the Info formatters automatically fill and
15345 indent those paragraphs that need to be filled and indented.@refill
15346
15347 The @code{@@refill} command causes @code{texinfo-format-region} and
15348 @code{texinfo-format-buffer} to refill a paragraph in the Info file
15349 @emph{after} all the other processing has been done. For this reason,
15350 you can not use @code{@@refill} with a paragraph containing either
15351 @code{@@*} or @code{@@w@{ @dots{} @}} since the refilling action will
15352 override those two commands.@refill
15353
15354 The @code{texinfo-format-region} and @code{texinfo-format-buffer}
15355 commands now automatically append @code{@@refill} to the end of each
15356 paragraph that should be filled. They do not append @code{@@refill} to
15357 the ends of paragraphs that contain @code{@@*} or @w{@code{@@w@{ @dots{}@}}}
15358 and therefore do not refill or indent them.@refill
15359
15360 @node Command Syntax, Obtaining TeX, Refilling Paragraphs, Top
15361 @comment node-name, next, previous, up
15362 @appendix @@-Command Syntax
15363 @cindex @@-command syntax
15364
15365 The character @samp{@@} is used to start special Texinfo commands.
15366 (It has the same meaning that @samp{\} has in Plain@TeX{}.) Texinfo
15367 has four types of @@-command:@refill
15368
15369 @table @asis
15370 @item 1. Non-alphabetic commands.
15371 These commands consist of an @@ followed by a punctuation mark or other
15372 character that is not part of the alphabet. Non-alphabetic commands
15373 are almost always part of the text within a paragraph, and never take
15374 any argument. The two characters (@@ and the other one) are complete
15375 in themselves; none is followed by braces. The non-alphabetic
15376 commands are: @code{@@.}, @code{@@:}, @code{@@*}, @code{@@@@},
15377 @code{@@@{}, and @code{@@@}}.@refill
15378
15379 @item 2. Alphabetic commands that do not require arguments.
15380 These commands start with @@ followed by a word followed by left- and
15381 right-hand braces. These commands insert special symbols in the
15382 document; they do not require arguments. For example,
15383 @code{@@dots@{@}} @result{} @samp{@dots{}}, @code{@@equiv@{@}}
15384 @result{} @samp{@equiv{}}, @code{@@TeX@{@}} @result{} `@TeX{}',
15385 and @code{@@bullet@{@}} @result{} @samp{@bullet{}}.@refill
15386
15387 @item 3. Alphabetic commands that require arguments within braces.
15388 These commands start with @@ followed by a letter or a word, followed by an
15389 argument within braces. For example, the command @code{@@dfn} indicates
15390 the introductory or defining use of a term; it is used as follows: @samp{In
15391 Texinfo, @@@@-commands are @@dfn@{mark-up@} commands.}@refill
15392
15393 @item 4. Alphabetic commands that occupy an entire line.
15394 These commands occupy an entire line. The line starts with @@,
15395 followed by the name of the command (a word); for example, @code{@@center}
15396 or @code{@@cindex}. If no argument is needed, the word is followed by
15397 the end of the line. If there is an argument, it is separated from
15398 the command name by a space. Braces are not used.@refill
15399 @end table
15400
15401 @cindex Braces and argument syntax
15402 Thus, the alphabetic commands fall into classes that have
15403 different argument syntaxes. You cannot tell to which class a command
15404 belongs by the appearance of its name, but you can tell by the
15405 command's meaning: if the command stands for a glyph, it is in
15406 class 2 and does not require an argument; if it makes sense to use the
15407 command together with other text as part of a paragraph, the command
15408 is in class 3 and must be followed by an argument in braces;
15409 otherwise, it is in class 4 and uses the rest of the line as its
15410 argument.@refill
15411
15412 The purpose of having a different syntax for commands of classes 3 and
15413 4 is to make Texinfo files easier to read, and also to help the GNU
15414 Emacs paragraph and filling commands work properly. There is only one
15415 exception to this rule: the command @code{@@refill}, which is always
15416 used at the end of a paragraph immediately following the final period
15417 or other punctuation character. @code{@@refill} takes no argument and
15418 does @emph{not} require braces. @code{@@refill} never confuses the
15419 Emacs paragraph commands because it cannot appear at the beginning of
15420 a line.@refill
15421
15422 @node Obtaining TeX, New Features, Command Syntax, Top
15423 @appendix How to Obtain @TeX{}
15424 @cindex Obtaining @TeX{}
15425 @cindex @TeX{}, how to obtain
15426
15427 @c !!! Here is information about obtaining TeX. Update it whenever.
15428 @c Last updated by RJC on 1 March 1995, conversation with Mackay.
15429 @TeX{} is freely redistributable. You can obtain @TeX{} for Unix
15430 systems via anonymous ftp or on tape or CD-ROM. The core material
15431 consists of Karl Berry's @code{web2c} @TeX{} package.
15432
15433 On-line retrieval instructions are in @code{ftp.cs.umb.edu}
15434 @t{[158.121.104.33]} in @file{pub/tex/unixtex.ftp}
15435
15436 The Free Software Foundation provides a core distribution on its
15437 Source Code CD-ROM; the University of Washington maintains and
15438 supports a tape distribution.
15439
15440 For the FSF Source Code CD-ROM, please contact:
15441
15442 @iftex
15443 @display
15444 @group
15445 Free Software Foundation, Inc.
15446 59 Temple Place Suite 330
15447 Boston, MA @w{ } 02111-1307
15448 USA
15449
15450 Telephone: @w{@t{+}1--617--542--5942}
15451 Fax: (including Japan) @w{@t{+}1--617--542--2652}
15452 Free Dial Fax (in Japan):
15453 @w{ } @w{ } @w{ } 0031--13--2473 (KDD)
15454 @w{ } @w{ } @w{ } 0066--3382--0158 (IDC)
15455 Electronic mail: @code{gnu@@prep.ai.mit.edu}
15456 @end group
15457 @end display
15458 @end iftex
15459 @ifinfo
15460 @display
15461 @group
15462 Free Software Foundation, Inc.
15463 59 Temple Place Suite 330
15464 Boston, MA @w{ } 02111-1307
15465 USA
15466
15467 Telephone: @w{@t{+}1-617-542-5942}
15468 Fax: (including Japan) @w{@t{+}1-617-542-2652}
15469 Free Dial Fax (in Japan):
15470 @w{ } @w{ } @w{ } 0031-13-2473 (KDD)
15471 @w{ } @w{ } @w{ } 0066-3382-0158 (IDC)
15472 Electronic mail: @code{gnu@@prep.ai.mit.edu}
15473 @end group
15474 @end display
15475 @end ifinfo
15476
15477 To order a full distribution from the University of Washington on either a
15478 1/4@dmn{inch} 4-track QIC-24 cartridge or a 4@dmn{mm} DAT cartridge, send
15479 $210.00 to:
15480
15481 @iftex
15482 @display
15483 @group
15484 Pierre A. MacKay
15485 Department of Classics
15486 DH-10, Denny Hall 218
15487 University of Washington
15488 Seattle, WA @w{ } 98195
15489 USA
15490
15491 Telephone: @t{+}1--206--543--2268
15492 Electronic mail: @code{mackay@@cs.washington.edu}
15493 @end group
15494 @end display
15495 @end iftex
15496 @ifinfo
15497 @display
15498 @group
15499 Pierre A. MacKay
15500 Department of Classics
15501 DH-10, Denny Hall 218
15502 University of Washington
15503 Seattle, WA @w{ } 98195
15504 USA
15505
15506 Telephone: @t{+}1-206-543-2268
15507 Electronic mail: @code{mackay@@cs.washington.edu}
15508 @end group
15509 @end display
15510 @end ifinfo
15511
15512 Please make checks payable to the University of Washington.
15513 Checks must be in U.S.@: dollars, drawn on a U.S.@: bank.
15514
15515 Prepaid orders are the only orders that can now be handled. Overseas
15516 sites: please add to the base cost, if desired, $20.00 for shipment
15517 via air parcel post, or $30.00 for shipment via courier.
15518
15519 Please check with the above for current prices and formats.
15520
15521 @node New Features, Command and Variable Index, Obtaining TeX, Top
15522 @appendix Second Edition Features
15523
15524 @tex
15525 % Widen the space for the first column so three control-character
15526 % strings fit in the first column. Switched back to default .8in
15527 % value at end of chapter.
15528 \global\tableindent=1.0in
15529 @end tex
15530
15531 The second edition of the Texinfo manual describes more than 20 new
15532 Texinfo mode commands and more than 50 previously undocumented Texinfo
15533 @@-commands. This edition is more than twice the length of the first
15534 edition.@refill
15535
15536 Here is a brief description of the new commands.@refill
15537
15538 @menu
15539 * New Texinfo Mode Commands:: The updating commands are especially useful.
15540 * New Commands:: Many newly described @@-commands.
15541 @end menu
15542
15543 @node New Texinfo Mode Commands, New Commands, New Features, New Features
15544 @appendixsec New Texinfo Mode Commands
15545
15546 Texinfo mode provides commands and features especially designed for
15547 working with Texinfo files. More than 20 new commands have been
15548 added, including commands for automatically creating and updating
15549 both nodes and menus. This is a tedious task when done by hand.@refill
15550
15551 The keybindings are intended to be somewhat mnemonic.@refill
15552
15553 @subheading Update all nodes and menus
15554
15555 The @code{texinfo-master-menu} command is the primary command:
15556
15557 @table @kbd
15558 @item C-c C-u m
15559 @itemx M-x texinfo-master-menu
15560 Create or update a master menu.
15561 With @kbd{C-u} as a prefix argument,
15562 first create or update all nodes
15563 and regular menus.
15564 @end table
15565
15566 @subheading Update Pointers
15567
15568 @noindent
15569 Create or update `Next', `Previous', and `Up' node pointers.@refill
15570
15571 @noindent
15572 @xref{Updating Nodes and Menus}.
15573
15574 @table @kbd
15575 @item C-c C-u C-n
15576 @itemx M-x texinfo-update-node
15577 Update a node.
15578
15579 @item C-c C-u C-e
15580 @itemx M-x texinfo-every-node-update
15581 Update every node in the buffer.
15582 @end table
15583
15584 @subheading Update Menus
15585
15586 @noindent
15587 Create or update menus.@refill
15588
15589 @noindent
15590 @xref{Updating Nodes and Menus}.
15591
15592 @table @kbd
15593 @item C-c C-u C-m
15594 @itemx M-x texinfo-make-menu
15595 Make or update a menu.
15596
15597 @item C-c C-u C-a
15598 @itemx M-x texinfo-all-menus-update
15599 Make or update all the menus in a buffer.
15600 With @kbd{C-u} as a prefix argument,
15601 first update all the nodes.
15602 @end table
15603
15604 @subheading Insert Title as Description
15605
15606 @noindent
15607 Insert a node's chapter or section title in the space for the
15608 description in a menu entry line; position point so you can edit the
15609 insert. (This command works somewhat differently than the other
15610 insertion commands, which insert only a predefined string.)@refill
15611
15612 @noindent
15613 @xref{Inserting, Inserting Frequently Used Commands}.
15614
15615 @table @kbd
15616 @item C-c C-c C-d
15617 Insert title.
15618 @end table
15619
15620 @subheading Format for Info
15621
15622 @noindent
15623 Provide keybindings both for the Info formatting commands that are
15624 written in Emacs Lisp and for @code{makeinfo} that is written in
15625 C.@refill
15626
15627 @noindent
15628 @xref{Info Formatting}.
15629
15630 @noindent
15631 Use the Emacs lisp @code{texinfo-format@dots{}} commands:
15632
15633 @table @kbd
15634 @item C-c C-e C-r
15635 Format the region.
15636
15637 @item C-c C-e C-b
15638 Format the buffer.
15639 @end table
15640
15641 @noindent
15642 Use @code{makeinfo}:
15643
15644 @table @kbd
15645 @item C-c C-m C-r
15646 Format the region.
15647
15648 @item C-c C-m C-b
15649 Format the buffer.
15650
15651 @item C-c C-m C-l
15652 Recenter the @code{makeinfo} output buffer.
15653
15654 @item C-c C-m C-k
15655 Kill the @code{makeinfo} formatting job.
15656 @end table
15657
15658 @subheading Typeset and Print
15659
15660 @noindent
15661 Typeset and print Texinfo documents from within Emacs.@refill
15662
15663 @ifinfo
15664 @noindent
15665 @xref{Printing}.
15666 @end ifinfo
15667 @iftex
15668 @noindent
15669 @xref{Printing, , Formatting and Printing}.
15670 @end iftex
15671
15672 @table @kbd
15673 @item C-c C-t C-b
15674 Run @code{texi2dvi} on the buffer.
15675
15676 @item C-c C-t C-r
15677 Run @TeX{} on the region.
15678
15679 @item C-c C-t C-i
15680 Run @code{texindex}.
15681
15682 @item C-c C-t C-p
15683 Print the @sc{dvi} file.
15684
15685 @item C-c C-t C-q
15686 Show the print queue.
15687
15688 @item C-c C-t C-d
15689 Delete a job from the print queue.
15690
15691 @item C-c C-t C-k
15692 Kill the current @TeX{} formatting job.
15693
15694 @item C-c C-t C-x
15695 Quit a currently stopped @TeX{} formatting job.
15696
15697 @item C-c C-t C-l
15698 Recenter the output buffer.
15699 @end table
15700
15701 @subheading Other Updating Commands
15702
15703 @noindent
15704 The ``other updating commands'' do not have standard keybindings because
15705 they are used less frequently.@refill
15706
15707 @noindent
15708 @xref{Other Updating Commands}.
15709
15710 @table @kbd
15711 @item M-x texinfo-insert-node-lines
15712 Insert missing @code{@@node} lines using
15713 section titles as node names.
15714
15715 @item M-x texinfo-multiple-files-update
15716 Update a multi-file document.
15717 With a numeric prefix, such as @kbd{C-u 8},
15718 update @strong{every} pointer and
15719 menu in @strong{all} the files and
15720 then insert a master menu.
15721
15722 @item M-x texinfo-indent-menu-description
15723 Indent descriptions in menus.
15724
15725 @item M-x texinfo-sequential-node-update
15726 Insert node pointers in strict sequence.
15727 @end table
15728
15729 @node New Commands, , New Texinfo Mode Commands, New Features
15730 @appendixsec New Texinfo @@-Commands
15731
15732 The second edition of the Texinfo manual describes more than 50
15733 commands that were not described in the first edition. A third or so
15734 of these commands existed in Texinfo but were not documented in the
15735 manual; the others are new. Here is a listing, with brief
15736 descriptions of them:@refill
15737
15738 @subheading Indexing
15739
15740 @noindent
15741 Create your own index, and merge indices.@refill
15742
15743 @noindent
15744 @xref{Indices}.
15745
15746 @table @kbd
15747 @item @@defindex @var{index-name}
15748 Define a new index and its indexing command.
15749 See also the @code{@@defcodeindex} command.
15750
15751 @c written verbosely to avoid overful hbox
15752 @item @@synindex @var{from-index} @var{into-index}
15753 Merge the @var{from-index} index into the @var{into-index} index.
15754 See also the @code{@@syncodeindex} command.
15755 @end table
15756
15757 @subheading Definitions
15758
15759 @noindent
15760 Describe functions, variables, macros,
15761 commands, user options, special forms, and other such artifacts in a
15762 uniform format.@refill
15763
15764 @noindent
15765 @xref{Definition Commands}.
15766
15767 @table @kbd
15768 @item @@deffn @var{category} @var{name} @var{arguments}@dots{}
15769 Format a description for functions, interactive
15770 commands, and similar entities.
15771
15772 @item @@defvr, @@defop, @dots{}
15773 15 other related commands.
15774 @end table
15775
15776 @subheading Glyphs
15777
15778 @noindent
15779 Indicate the results of evaluation, expansion,
15780 printed output, an error message, equivalence of expressions, and the
15781 location of point.@refill
15782
15783 @noindent
15784 @xref{Glyphs}.
15785
15786 @table @kbd
15787 @item @@equiv@{@}
15788 @itemx @equiv{}
15789 Equivalence:
15790
15791 @item @@error@{@}
15792 @itemx @error{}
15793 Error message
15794
15795 @item @@expansion@{@}
15796 @itemx @expansion{}
15797 Macro expansion
15798
15799 @item @@point@{@}
15800 @itemx @point{}
15801 Position of point
15802
15803 @item @@print@{@}
15804 @itemx @print{}
15805 Printed output
15806
15807 @item @@result@{@}
15808 @itemx @result{}
15809 Result of an expression
15810 @end table
15811
15812 @subheading Page Headings
15813
15814 @noindent
15815 Customize page headings.
15816
15817 @noindent
15818 @xref{Headings}.
15819
15820 @table @kbd
15821 @item @@headings @var{on-off-single-double}
15822 Headings on or off, single, or double-sided.
15823
15824 @item @@evenfooting [@var{left}] @@| [@var{center}] @@| [@var{right}]
15825 Footings for even-numbered (left-hand) pages.
15826
15827 @item @@evenheading, @@everyheading, @@oddheading, @dots{}
15828 Five other related commands.
15829
15830 @item @@thischapter
15831 Insert name of chapter and chapter number.
15832
15833 @item @@thischaptername, @@thisfile, @@thistitle, @@thispage
15834 Related commands.
15835 @end table
15836
15837 @subheading Formatting
15838
15839 @noindent
15840 Format blocks of text.
15841
15842 @noindent
15843 @xref{Quotations and Examples}, and@*
15844 @ref{Lists and Tables, , Making Lists and Tables}.
15845
15846 @table @kbd
15847 @item @@cartouche
15848 Draw rounded box surrounding text (not in Info).
15849
15850 @item @@enumerate @var{optional-arg}
15851 Enumerate a list with letters or numbers.
15852
15853 @item @@exdent @var{line-of-text}
15854 Remove indentation.
15855
15856 @item @@flushleft
15857 Left justify.
15858
15859 @item @@flushright
15860 Right justify.
15861
15862 @item @@format
15863 Do not narrow nor change font.
15864
15865 @item @@ftable @var{formatting-command}
15866 @itemx @@vtable @var{formatting-command}
15867 Two-column table with indexing.
15868
15869 @item @@lisp
15870 For an example of Lisp code.
15871
15872 @item @@smallexample
15873 @itemx @@smalllisp
15874 Like @@table and @@lisp @r{but for} @@smallbook.
15875 @end table
15876
15877 @subheading Conditionals
15878
15879 @noindent
15880 Conditionally format text.
15881
15882 @noindent
15883 @xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill
15884
15885 @table @kbd
15886 @item @@set @var{flag} [@var{string}]
15887 Set a flag. Optionally, set value
15888 of @var{flag} to @var{string}.
15889
15890 @item @@clear @var{flag}
15891 Clear a flag.
15892
15893 @item @@value@{@var{flag}@}
15894 Replace with value to which @var{flag} is set.
15895
15896 @item @@ifset @var{flag}
15897 Format, if @var{flag} is set.
15898
15899 @item @@ifclear @var{flag}
15900 Ignore, if @var{flag} is set.
15901 @end table
15902
15903 @subheading @@heading series for Titles
15904
15905 @noindent
15906 Produce unnumbered headings that do not appear in a table of contents.
15907
15908 @noindent
15909 @xref{Structuring}.
15910
15911 @table @kbd
15912 @item @@heading @var{title}
15913 Unnumbered section-like heading not listed
15914 in the table of contents of a printed manual.
15915
15916 @item @@chapheading, @@majorheading, @@subheading, @@subsubheading
15917 Related commands.
15918 @end table
15919
15920 @need 1000
15921 @subheading Font commands
15922
15923 @need 1000
15924 @noindent
15925 @xref{Smallcaps}, and @*
15926 @ref{Fonts}.
15927
15928 @table @kbd
15929 @item @@r@{@var{text}@}
15930 Print in roman font.
15931
15932 @item @@sc@{@var{text}@}
15933 Print in @sc{small caps} font.
15934 @end table
15935
15936 @subheading Miscellaneous
15937
15938 @noindent
15939 See @ref{title subtitle author, , @code{@@title} @code{@@subtitle} and @code{@@author} Commands},@*
15940 see @ref{Customized Highlighting},@*
15941 see @ref{Overfull hboxes},@*
15942 see @ref{Footnotes},@*
15943 see @ref{dmn, , Format a Dimension},@*
15944 see @ref{Raise/lower sections, , @code{@@raisesections} and @code{@@lowersections}},@*
15945 see @ref{math, , @code{@@math}: Inserting Mathematical Expressions}.@*
15946 see @ref{minus, , Inserting a Minus Sign},@*
15947 see @ref{paragraphindent, , Paragraph Indenting},@*
15948 see @ref{Cross Reference Commands},@*
15949 see @ref{title subtitle author, , @code{@@title} @code{@@subtitle} and @code{@@author}}, and@*
15950 see @ref{Custom Headings, , How to Make Your Own Headings}.
15951
15952 @need 700
15953 @table @kbd
15954 @item @@author @var{author}
15955 Typeset author's name.
15956
15957 @item @@definfoenclose @var{new-command}, @var{before}, @var{after},
15958 Define a highlighting command for Info. (Info only.)
15959
15960 @item @@finalout
15961 Produce cleaner printed output.
15962
15963 @item @@footnotestyle @var{end-or-separate}
15964 Specify footnote style.
15965
15966 @item @@dmn@{@var{dimension}@}
15967 Format a dimension.
15968
15969 @item @@global@@let@var{new-cmd}=@var{existing-cmd}
15970 Define a highlighting command for @TeX{}. (@TeX{} only.)
15971
15972 @item @@lowersections
15973 Reduce hierarchical level of sectioning commands.
15974
15975 @item @@math@{@var{mathematical-expression}@}
15976 Format a mathematical expression.
15977
15978 @item @@minus@{@}
15979 Generate a minus sign.
15980
15981 @item @@paragraphindent @var{asis-or-number}
15982 Specify paragraph indentation.
15983
15984 @item @@raisesections
15985 Raise hierarchical level of sectioning commands.
15986
15987 @item @@ref@{@var{node-name}, @r{[}@var{entry}@r{]}, @r{[}@var{topic-or-title}@r{]}, @r{[}@var{info-file}@r{]}, @r{[}@var{manual}@r{]}@}
15988 Make a reference. In the printed manual, the
15989 reference does not start with the word `see'.
15990
15991 @item @@title @var{title}
15992 Typeset @var{title} in the alternative
15993 title page format.
15994
15995 @item @@subtitle @var{subtitle}
15996 Typeset @var{subtitle} in the alternative
15997 title page format.
15998
15999 @item @@today@{@}
16000 Insert the current date.
16001 @end table
16002 @tex
16003 % Switch width of first column of tables back to default value
16004 \global\tableindent=.8in
16005 @end tex
16006
16007 @node Command and Variable Index, Concept Index, New Features, Top
16008 @comment node-name, next, previous, up
16009 @unnumbered Command and Variable Index
16010
16011 This is an alphabetical list of all the @@-commands and several
16012 variables. To make the list easier to use, the commands are listed
16013 without their preceding @samp{@@}.@refill
16014
16015 @printindex fn
16016
16017 @node Concept Index, , Command and Variable Index, Top
16018 @comment node-name, next, previous, up
16019 @unnumbered Concept Index
16020
16021 @printindex cp
16022
16023 @summarycontents
16024 @contents
16025 @bye