142660Smarkm\input texinfo.tex    @c -*-texinfo-*-
2146515Sru@c $Id: texinfo.txi,v 1.128 2004/12/29 15:06:41 karl Exp $
3116525Sru@c Ordinarily, Texinfo files have the extension .texi.  But texinfo.texi
4100513Sru@c clashes with texinfo.tex on 8.3 filesystems, so we use texinfo.txi.
5100513Sru
6100513Sru@c Everything between the start/end of header lines will be passed by
7100513Sru@c Emacs's {texinfo,makeinfo}-format region commands.  See the `start of
8100513Sru@c header' node for more info.
942660Smarkm@c %**start of header
1042660Smarkm
11100513Sru@c makeinfo and texinfo.tex ignore all text before @setfilename.
12100513Sru@c
13116525Sru@c Ordinarily, the setfilename argument ends with .info.  But
14100513Sru@c texinfo.info-13 is too long for 14-character filesystems.
1542660Smarkm@setfilename texinfo
1642660Smarkm
17100513Sru@c Automake automatically updates version.texi to @set VERSION and
18100513Sru@c @set UPDATED to appropriate values.
1956160Sru@include version.texi
20100513Sru@settitle GNU Texinfo @value{VERSION}
2142660Smarkm
2242660Smarkm@c Define a new index for options.
2342660Smarkm@defcodeindex op
2442660Smarkm@c Put everything except function (command, in this case) names in one
2542660Smarkm@c index (arbitrarily chosen to be the concept index).
2642660Smarkm@syncodeindex op cp
2742660Smarkm@syncodeindex vr cp
2842660Smarkm@syncodeindex pg cp
2942660Smarkm
3042660Smarkm@paragraphindent 2
3193139Sru@c finalout
3256160Sru
3342660Smarkm@comment %**end of header
3442660Smarkm
35100513Sru@copying
36100513SruThis manual is for GNU Texinfo (version @value{VERSION}, @value{UPDATED}),
37100513Srua documentation system that can produce both online information and a
38100513Sruprinted manual from a single source.
39100513Sru
40114472SruCopyright (C) 1988, 1990, 1991, 1992, 1993, 1995, 1996, 1997, 1998,
41146515Sru1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
42100513Sru
43100513Sru@quotation
44100513SruPermission is granted to copy, distribute and/or modify this document
45100513Sruunder the terms of the GNU Free Documentation License, Version 1.1 or
46100513Sruany later version published by the Free Software Foundation; with no
47100513SruInvariant Sections, with the Front-Cover texts being ``A GNU Manual,''
48100513Sruand with the Back-Cover Texts as in (a) below.  A copy of the license is
49100513Sruincluded in the section entitled ``GNU Free Documentation License.''
50100513Sru
51100513Sru(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
52100513Sruthis GNU Manual, like GNU software.  Copies published by the Free
53100513SruSoftware Foundation raise funds for GNU development.''
54100513Sru@end quotation
55100513Sru@end copying
56100513Sru
5742660Smarkm@dircategory Texinfo documentation system
5842660Smarkm@direntry
5942660Smarkm* Texinfo: (texinfo).           The GNU documentation format.
6056160Sru* install-info: (texinfo)Invoking install-info. Update info/dir entries.
6156160Sru* texi2dvi: (texinfo)Format with texi2dvi.      Print Texinfo documents.
62146515Sru* texi2pdf: (texinfo)PDF Output.                PDF output for Texinfo.
6356160Sru* texindex: (texinfo)Format with tex/texindex.  Sort Texinfo index files.
6493139Sru* makeinfo: (texinfo)Invoking makeinfo.         Translate Texinfo source.
6542660Smarkm@end direntry
6642660Smarkm
6756160Sru@c Before release, run C-u C-c C-u C-a (texinfo-all-menus-update with a
6856160Sru@c prefix arg).  This updates the node pointers, which texinfmt.el needs.
6956160Sru
7042660Smarkm@c Set smallbook if printing in smallbook format so the example of the
7142660Smarkm@c smallbook font is actually written using smallbook; in bigbook, a kludge
7242660Smarkm@c is used for TeX output.  Do this through the -t option to texi2dvi,
7342660Smarkm@c so this same source can be used for other paper sizes as well.
7442660Smarkm@c smallbook
7542660Smarkm@c set smallbook
7642660Smarkm@c @@clear smallbook
7742660Smarkm
78100513Sru@c If you like blank pages, add through texi2dvi -t.
7956160Sru@c setchapternewpage odd
8056160Sru
8142660Smarkm@c Currently undocumented command, 5 December 1993:
8242660Smarkm@c nwnode          (Same as node, but no warnings; for `makeinfo'.)
8342660Smarkm
8442660Smarkm
85146515Sru@shorttitlepage GNU Texinfo
8642660Smarkm
8742660Smarkm@titlepage
8842660Smarkm@title Texinfo
8942660Smarkm@subtitle The GNU Documentation Format
9056160Sru@subtitle for Texinfo version @value{VERSION}, @value{UPDATED}
9142660Smarkm
9256160Sru@author Robert J. Chassell
9356160Sru@author Richard M. Stallman
9442660Smarkm
9542660Smarkm@c Include the Distribution inside the titlepage so
9642660Smarkm@c that headings are turned off.
9742660Smarkm
9842660Smarkm@page
9942660Smarkm@vskip 0pt plus 1filll
100100513Sru@insertcopying
10142660Smarkm
102114472Sru@sp 1
10342660SmarkmPublished by the Free Software Foundation @*
10442660Smarkm59 Temple Place Suite 330 @*
10542660SmarkmBoston, MA 02111-1307 @*
10642660SmarkmUSA @*
10756160SruISBN 1-882114-67-1 @c for version 4.0, September 1999.
108100513Sru@c ISBN 1-882114-65-5 is for version 3.12, March 1998.
109100513Sru@c ISBN 1-882114-64-7 is for edition 2.24 of November 1996.
110114472Sru@c ISBN 1-882114-63-9 is for edition 2.20 of 28 February 1995.
11142660Smarkm
112114472Sru@sp 1
11393139SruCover art by Etienne Suvasa.
114100513Sru@end titlepage
11542660Smarkm
11642660Smarkm
11756160Sru@summarycontents
11856160Sru@contents
11956160Sru
120100513Sru
12156160Sru@ifnottex
12256160Sru@node Top
12342660Smarkm@top Texinfo
12442660Smarkm
125100513Sru@insertcopying
12642660Smarkm
12742660SmarkmThe first part of this master menu lists the major nodes in this Info
12842660Smarkmdocument, including the @@-command and concept indices.  The rest of
12956160Sruthe menu lists all the lower level nodes in the document.
13042660Smarkm
13156160Sru@end ifnottex
13242660Smarkm
13342660Smarkm@menu
134146515Sru* Copying Conditions::            Your rights.
135146515Sru* Overview::                      Texinfo in brief.
136146515Sru* Texinfo Mode::                  Using the GNU Emacs Texinfo mode.
137146515Sru* Beginning a File::              What is at the beginning of a Texinfo file?
138146515Sru* Ending a File::                 What is at the end of a Texinfo file?
139146515Sru* Structuring::                   Creating chapters, sections, appendices, etc.
140146515Sru* Nodes::                         Writing nodes, the basic unit of Texinfo.
141146515Sru* Menus::                         Writing menus.
142146515Sru* Cross References::              Writing cross references.
143146515Sru* Marking Text::                  Marking words and phrases as code,
144146515Sru                                    keyboard input, meta-syntactic
145146515Sru                                    variables, and the like.
146146515Sru* Quotations and Examples::       Block quotations, examples, etc.
147146515Sru* Lists and Tables::              Itemized or numbered lists, and tables.
148146515Sru* Special Displays::              Floating figures and footnotes.
149146515Sru* Indices::                       Creating indices.
150146515Sru* Insertions::                    Inserting @@-signs, braces, etc.
151146515Sru* Breaks::                        Forcing or preventing line and page breaks.
152146515Sru* Definition Commands::           Describing functions and the like uniformly.
153146515Sru* Conditionals::                  Specifying text for only some output cases.
154146515Sru* Internationalization::          Supporting languages other than English.
155146515Sru* Defining New Texinfo Commands:: User-defined macros and aliases.
156146515Sru* Hardcopy::                            Output for paper, with @TeX{}.
157146515Sru* Creating and Installing Info Files::  Details on Info output.
158146515Sru* Generating HTML::               Details on HTML output.
15942660Smarkm
160146515Sru* Command List::                  All the Texinfo @@-commands.
161146515Sru* Tips::                          Hints on how to write a Texinfo document.
162146515Sru* Sample Texinfo Files::          Complete examples, including full texts.
163146515Sru* Include Files::                 How to incorporate other Texinfo files.
164146515Sru* Headings::                      How to write page headings and footings.
165146515Sru* Catching Mistakes::             How to find formatting mistakes.
166146515Sru* Copying This Manual::           The GNU Free Documentation License.
167146515Sru* Command and Variable Index::    A menu containing commands and variables.
168146515Sru* Concept Index::                 A menu covering many topics.
169146515Sru
17042660Smarkm@detailmenu
17142660Smarkm --- The Detailed Node Listing ---
17242660Smarkm
17342660SmarkmOverview of Texinfo
17442660Smarkm
17556160Sru* Reporting Bugs::              Submitting effective bug reports.
17656160Sru* Using Texinfo::               Create printed or online output.
177114472Sru* Output Formats::              Overview of the supported output formats.
17842660Smarkm* Info Files::                  What is an Info file?
17942660Smarkm* Printed Books::               Characteristics of a printed book or manual.
18042660Smarkm* Formatting Commands::         @@-commands are used for formatting.
18142660Smarkm* Conventions::                 General rules for writing a Texinfo file.
18256160Sru* Comments::                    Writing comments and ignored text in general.
18342660Smarkm* Minimum::                     What a Texinfo file must have.
18442660Smarkm* Six Parts::                   Usually, a Texinfo file has six parts.
18542660Smarkm* Short Sample::                A short sample Texinfo file.
18693139Sru* History::                     Acknowledgements, contributors and genesis.
18742660Smarkm
18842660SmarkmUsing Texinfo Mode
18942660Smarkm
19042660Smarkm* Texinfo Mode Overview::       How Texinfo mode can help you.
19142660Smarkm* Emacs Editing::               Texinfo mode adds to GNU Emacs' general
19242660Smarkm                                  purpose editing features.
19342660Smarkm* Inserting::                   How to insert frequently used @@-commands.
19442660Smarkm* Showing the Structure::       How to show the structure of a file.
19542660Smarkm* Updating Nodes and Menus::    How to update or create new nodes and menus.
19642660Smarkm* Info Formatting::             How to format for Info.
19742660Smarkm* Printing::                    How to format and print part or all of a file.
19842660Smarkm* Texinfo Mode Summary::        Summary of all the Texinfo mode commands.
19942660Smarkm
20042660SmarkmUpdating Nodes and Menus
20142660Smarkm
20242660Smarkm* Updating Commands::           Five major updating commands.
20342660Smarkm* Updating Requirements::       How to structure a Texinfo file for
20442660Smarkm                                  using the updating command.
20542660Smarkm* Other Updating Commands::     How to indent descriptions, insert
20642660Smarkm                                  missing nodes lines, and update
20742660Smarkm                                  nodes in sequence.
20842660Smarkm
20942660SmarkmBeginning a Texinfo File
21042660Smarkm
211100513Sru* Sample Beginning::            A sample beginning for a Texinfo file.
212114472Sru* Texinfo File Header::         The first lines.
213114472Sru* Document Permissions::        Ensuring your manual is free.
21442660Smarkm* Titlepage & Copyright Page::  Creating the title and copyright pages.
215116525Sru* Contents::                    How to create a table of contents.
21642660Smarkm* The Top Node::                Creating the `Top' node and master menu.
217114472Sru* Global Document Commands::    Affecting formatting throughout.
21842660Smarkm* Software Copying Permissions::  Ensure that you and others continue to
219114472Sru                                   have the right to use and share software.
22042660Smarkm
221100513SruTexinfo File Header
22242660Smarkm
22342660Smarkm* First Line::                  The first line of a Texinfo file.
22442660Smarkm* Start of Header::             Formatting a region requires this.
22542660Smarkm* setfilename::                 Tell Info the name of the Info file.
22642660Smarkm* settitle::                    Create a title for the printed work.
22742660Smarkm* End of Header::               Formatting a region requires this.
22842660Smarkm
229100513SruDocument Permissions
23042660Smarkm
231146515Sru* copying::                     Declare the document's copying permissions.
232146515Sru* insertcopying::               Where to insert the permissions.
233100513Sru
234100513SruTitle and Copyright Pages
235100513Sru
23642660Smarkm* titlepage::                   Create a title for the printed document.
23742660Smarkm* titlefont center sp::         The @code{@@titlefont}, @code{@@center},
238114472Sru                                 and @code{@@sp} commands.
23942660Smarkm* title subtitle author::       The @code{@@title}, @code{@@subtitle},
240114472Sru                                 and @code{@@author} commands.
241100513Sru* Copyright::                   How to write the copyright notice and
242114472Sru                                 include copying permissions.
24342660Smarkm* end titlepage::               Turn on page headings after the title and
244114472Sru                                 copyright pages.
24542660Smarkm* headings on off::             An option for turning headings on and off
246114472Sru                                 and double or single sided printing.
24742660Smarkm
24842660SmarkmThe `Top' Node and Master Menu
24942660Smarkm
250116525Sru* Top Node Example::
251116525Sru* Master Menu Parts::
25242660Smarkm
253100513SruGlobal Document Commands
254100513Sru
255100513Sru* documentdescription::         Document summary for the HTML output.
256100513Sru* setchapternewpage::           Start chapters on right-hand pages.
257100513Sru* paragraphindent::             Specify paragraph indentation.
258116525Sru* firstparagraphindent::        Suppress indentation of the first paragraph.
259100513Sru* exampleindent::               Specify environment indentation.
260100513Sru
26142660SmarkmEnding a Texinfo File
26242660Smarkm
26342660Smarkm* Printing Indices & Menus::    How to print an index in hardcopy and
264114472Sru                                 generate index menus in Info.
26542660Smarkm* File End::                    How to mark the end of a file.
26642660Smarkm
26742660SmarkmChapter Structuring
26842660Smarkm
26942660Smarkm* Tree Structuring::            A manual is like an upside down tree @dots{}
27042660Smarkm* Structuring Command Types::   How to divide a manual into parts.
27142660Smarkm* makeinfo top::                The @code{@@top} command, part of the `Top' node.
272116525Sru* chapter::
273116525Sru* unnumbered & appendix::
274116525Sru* majorheading & chapheading::
275116525Sru* section::
276116525Sru* unnumberedsec appendixsec heading::
277116525Sru* subsection::
278116525Sru* unnumberedsubsec appendixsubsec subheading::
27942660Smarkm* subsubsection::               Commands for the lowest level sections.
28042660Smarkm* Raise/lower sections::        How to change commands' hierarchical level.
28142660Smarkm
28242660SmarkmNodes
28342660Smarkm
28442660Smarkm* Two Paths::                   Different commands to structure
285114472Sru                                 Info output and printed output.
28642660Smarkm* Node Menu Illustration::      A diagram, and sample nodes and menus.
28756160Sru* node::                        Creating nodes, in detail.
28856160Sru* makeinfo Pointer Creation::   Letting makeinfo determine node pointers.
28956160Sru* anchor::                      Defining arbitrary cross-reference targets.
29042660Smarkm
29142660SmarkmThe @code{@@node} Command
29242660Smarkm
29342660Smarkm* Node Names::                  How to choose node and pointer names.
29442660Smarkm* Writing a Node::              How to write an @code{@@node} line.
29542660Smarkm* Node Line Tips::              Keep names short.
29642660Smarkm* Node Line Requirements::      Keep names unique, without @@-commands.
29742660Smarkm* First Node::                  How to write a `Top' node.
29842660Smarkm* makeinfo top command::        How to use the @code{@@top} command.
29942660Smarkm
30042660SmarkmMenus
30142660Smarkm
302146515Sru* Menu Location::               Menus go at the ends of short nodes.
30342660Smarkm* Writing a Menu::              What is a menu?
30442660Smarkm* Menu Parts::                  A menu entry has three parts.
30542660Smarkm* Less Cluttered Menu Entry::   Two part menu entry.
30642660Smarkm* Menu Example::                Two and three part menu entries.
30742660Smarkm* Other Info Files::            How to refer to a different Info file.
30842660Smarkm
30942660SmarkmCross References
31042660Smarkm
31142660Smarkm* References::                  What cross references are for.
31242660Smarkm* Cross Reference Commands::    A summary of the different commands.
31342660Smarkm* Cross Reference Parts::       A cross reference has several parts.
31442660Smarkm* xref::                        Begin a reference with `See' @dots{}
31542660Smarkm* Top Node Naming::             How to refer to the beginning of another file.
31642660Smarkm* ref::                         A reference for the last part of a sentence.
31742660Smarkm* pxref::                       How to write a parenthetical cross reference.
31842660Smarkm* inforef::                     How to refer to an Info-only file.
31942660Smarkm* uref::                        How to refer to a uniform resource locator.
32042660Smarkm
32142660Smarkm@code{@@xref}
32242660Smarkm
32342660Smarkm* Reference Syntax::            What a reference looks like and requires.
32442660Smarkm* One Argument::                @code{@@xref} with one argument.
32542660Smarkm* Two Arguments::               @code{@@xref} with two arguments.
32642660Smarkm* Three Arguments::             @code{@@xref} with three arguments.
32742660Smarkm* Four and Five Arguments::     @code{@@xref} with four and five arguments.
32842660Smarkm
32942660SmarkmMarking Words and Phrases
33042660Smarkm
33142660Smarkm* Indicating::                  How to indicate definitions, files, etc.
33242660Smarkm* Emphasis::                    How to emphasize text.
33342660Smarkm
33442660SmarkmIndicating Definitions, Commands, etc.
33542660Smarkm
33642660Smarkm* Useful Highlighting::         Highlighting provides useful information.
33756160Sru* code::                        Indicating program code.
33856160Sru* kbd::                         Showing keyboard input.
33956160Sru* key::                         Specifying keys.
34093139Sru* samp::                        A literal sequence of characters.
341100513Sru* verb::                        A verbatim sequence of characters.
34256160Sru* var::                         Indicating metasyntactic variables.
34356160Sru* env::                         Indicating environment variables.
34456160Sru* file::                        Indicating file names.
34556160Sru* command::                     Indicating command names.
34656160Sru* option::                      Indicating option names.
34756160Sru* dfn::                         Specifying definitions.
34856160Sru* cite::                        Referring to books not in the  Info system.
349146515Sru* abbr::                        Indicating abbreviations.
35056160Sru* acronym::                     Indicating acronyms.
351146515Sru* indicateurl::                 Indicating a World Wide Web reference.
35256160Sru* email::                       Indicating an electronic mail address.
35342660Smarkm
35442660SmarkmEmphasizing Text
35542660Smarkm
35642660Smarkm* emph & strong::               How to emphasize text in Texinfo.
35742660Smarkm* Smallcaps::                   How to use the small caps font.
35842660Smarkm* Fonts::                       Various font commands for printed output.
35942660Smarkm
36042660SmarkmQuotations and Examples
36142660Smarkm
36293139Sru* Block Enclosing Commands::    Different constructs for different purposes.
36393139Sru* quotation::                   Writing a quotation.
36493139Sru* example::                     Writing an example in a fixed-width font.
36593139Sru* verbatim::                    Writing a verbatim example.
366100513Sru* verbatiminclude::             Including a file verbatim.
36793139Sru* lisp::                        Illustrating Lisp code.
368114472Sru* small::                       Examples in a smaller font.
36993139Sru* display::                     Writing an example in the current font.
37093139Sru* format::                      Writing an example without narrowed margins.
37193139Sru* exdent::                      Undo indentation on a line.
37293139Sru* flushleft & flushright::      Pushing text flush left or flush right.
37393139Sru* noindent::                    Preventing paragraph indentation.
374116525Sru* indent::                      Forcing paragraph indentation.
37593139Sru* cartouche::                   Drawing rounded rectangles around examples.
37642660Smarkm
37742660SmarkmLists and Tables
37842660Smarkm
37942660Smarkm* Introducing Lists::           Texinfo formats lists for you.
38042660Smarkm* itemize::                     How to construct a simple list.
38142660Smarkm* enumerate::                   How to construct a numbered list.
38242660Smarkm* Two-column Tables::           How to construct a two-column table.
38342660Smarkm* Multi-column Tables::         How to construct generalized tables.
38442660Smarkm
38542660SmarkmMaking a Two-column Table
38642660Smarkm
38742660Smarkm* table::                       How to construct a two-column table.
38842660Smarkm* ftable vtable::               Automatic indexing for two-column tables.
38942660Smarkm* itemx::                       How to put more entries in the first column.
39042660Smarkm
391146515Sru@code{@@multitable}: Multi-column Tables
39242660Smarkm
39342660Smarkm* Multitable Column Widths::    Defining multitable column widths.
39442660Smarkm* Multitable Rows::             Defining multitable rows, with examples.
39542660Smarkm
396146515SruSpecial Displays
397146515Sru
398146515Sru* Floats::                      Figures, tables, and the like.
399146515Sru* Images::                      Including graphics and images.
400146515Sru* Footnotes::                   Writing footnotes.
401146515Sru
402146515SruFloats
403146515Sru
404146515Sru* float::                       Producing floating material.
405146515Sru* caption shortcaption::        Specifying descriptions for floats.
406146515Sru* listoffloats::                A table of contents for floats.
407146515Sru
408146515SruInserting Images
409146515Sru
410146515Sru* Image Syntax::
411146515Sru* Image Scaling::
412146515Sru
413146515SruFootnotes
414146515Sru
415146515Sru* Footnote Commands::           How to write a footnote in Texinfo.
416146515Sru* Footnote Styles::             Controlling how footnotes appear in Info.
417146515Sru
41856160SruIndices
41942660Smarkm
42042660Smarkm* Index Entries::               Choose different words for index entries.
42142660Smarkm* Predefined Indices::          Use different indices for different kinds
422146515Sru                                 of entries.
42342660Smarkm* Indexing Commands::           How to make an index entry.
42442660Smarkm* Combining Indices::           How to combine indices.
42542660Smarkm* New Indices::                 How to define your own indices.
42642660Smarkm
42742660SmarkmCombining Indices
42842660Smarkm
42942660Smarkm* syncodeindex::                How to merge two indices, using @code{@@code}
430114472Sru                                 font for the merged-from index.
43142660Smarkm* synindex::                    How to merge two indices, using the
432114472Sru                                 default font of the merged-to index.
43342660Smarkm
43442660SmarkmSpecial Insertions
43542660Smarkm
436146515Sru* Atsign Braces Comma::         Inserting @@ and @{@} and ,.
43742660Smarkm* Inserting Space::             How to insert the right amount of space
438114472Sru                                 within a sentence.
43942660Smarkm* Inserting Accents::           How to insert accents and special characters.
44042660Smarkm* Dots Bullets::                How to insert dots and bullets.
44142660Smarkm* TeX and copyright::           How to insert the @TeX{} logo
442114472Sru                                 and the copyright symbol.
443146515Sru* euro::                        How to insert the Euro currency symbol.
44442660Smarkm* pounds::                      How to insert the pounds currency symbol.
44542660Smarkm* minus::                       How to insert a minus sign.
44642660Smarkm* math::                        How to format a mathematical expression.
44742660Smarkm* Glyphs::                      How to indicate results of evaluation,
448114472Sru                                 expansion of macros, errors, etc.
44942660Smarkm
450146515SruInserting @@ and @{@} and @comma{}
45142660Smarkm
452146515Sru* Inserting an Atsign::
453146515Sru* Inserting Braces::
454146515Sru* Inserting a Comma::
45542660Smarkm
45642660SmarkmInserting Space
45742660Smarkm
45842660Smarkm* Not Ending a Sentence::       Sometimes a . doesn't end a sentence.
45942660Smarkm* Ending a Sentence::           Sometimes it does.
46042660Smarkm* Multiple Spaces::             Inserting multiple spaces.
46142660Smarkm* dmn::                         How to format a dimension.
46242660Smarkm
46393139SruInserting Ellipsis and Bullets
46442660Smarkm
46542660Smarkm* dots::                        How to insert dots @dots{}
46642660Smarkm* bullet::                      How to insert a bullet.
46742660Smarkm
468146515SruInserting @TeX{} and Legal Symbols: @copyright{}, @registeredsymbol{}
46942660Smarkm
470146515Sru* tex::                         The @TeX{} logos.
471146515Sru* copyright symbol::            The copyright symbol (c in a circle).
472146515Sru* registered symbol::           The registered symbol (R in a circle).
47342660Smarkm
47442660SmarkmGlyphs for Examples
47542660Smarkm
476116525Sru* Glyphs Summary::
47742660Smarkm* result::                      How to show the result of expression.
47842660Smarkm* expansion::                   How to indicate an expansion.
47942660Smarkm* Print Glyph::                 How to indicate printed output.
48042660Smarkm* Error Glyph::                 How to indicate an error message.
48142660Smarkm* Equivalence::                 How to indicate equivalence.
48242660Smarkm* Point Glyph::                 How to indicate the location of point.
48342660Smarkm
48442660SmarkmGlyphs Summary
48542660Smarkm
48656160Sru* result::
48756160Sru* expansion::
48856160Sru* Print Glyph::
48956160Sru* Error Glyph::
49056160Sru* Equivalence::
49156160Sru* Point Glyph::
49242660Smarkm
493146515SruForcing and Preventing Breaks
49456160Sru
495114472Sru* Break Commands::              Summary of break-related commands.
496114472Sru* Line Breaks::                 Forcing line breaks.
497114472Sru* - and hyphenation::           Helping @TeX{} with hyphenation points.
498114472Sru* w::                           Preventing unwanted line breaks in text.
499114472Sru* tie::                         Inserting an unbreakable but varying space.
500114472Sru* sp::                          Inserting blank lines.
501114472Sru* page::                        Forcing the start of a new page.
502114472Sru* group::                       Preventing unwanted page breaks.
50342660Smarkm* need::                        Another way to prevent unwanted page breaks.
50442660Smarkm
50542660SmarkmDefinition Commands
50642660Smarkm
507146515Sru* Def Cmd Template::            Writing descriptions using definition commands.
508146515Sru* Def Cmd Continuation Lines::  Continuing the heading over source lines.
509146515Sru* Optional Arguments::          Handling optional and repeated arguments.
510146515Sru* deffnx::                      Group two or more `first' lines.
511146515Sru* Def Cmds in Detail::          Reference for all the definition commands.
51242660Smarkm* Def Cmd Conventions::         Conventions for writing definitions.
513146515Sru* Sample Function Definition::  An example.
51442660Smarkm
51542660SmarkmThe Definition Commands
51642660Smarkm
51742660Smarkm* Functions Commands::          Commands for functions and similar entities.
51842660Smarkm* Variables Commands::          Commands for variables and similar entities.
51942660Smarkm* Typed Functions::             Commands for functions in typed languages.
52042660Smarkm* Typed Variables::             Commands for variables in typed languages.
521146515Sru* Data Types::                  The definition command for data types.
52242660Smarkm* Abstract Objects::            Commands for object-oriented programming.
52342660Smarkm
524146515SruObject-Oriented Programming
525146515Sru
526146515Sru* Variables: Object-Oriented Variables.
527146515Sru* Methods: Object-Oriented Methods.
528146515Sru
52942660SmarkmConditionally Visible Text
53042660Smarkm
531146515Sru* Conditional Commands::        Text for a given format.
532146515Sru* Conditional Not Commands::    Text for any format other than a given one.
533146515Sru* Raw Formatter Commands::      Using raw formatter commands.
534146515Sru* set clear value::             Variable tests and substitutions.
535146515Sru* Conditional Nesting::         Using conditionals inside conditionals.
53642660Smarkm
53742660Smarkm@code{@@set}, @code{@@clear}, and @code{@@value}
53842660Smarkm
53993139Sru* set value::                   Expand a flag variable to a string.
54042660Smarkm* ifset ifclear::               Format a region if a flag is set.
54142660Smarkm* value Example::               An easy way to update edition information.
54242660Smarkm
54356160SruInternationalization
54442660Smarkm
54556160Sru* documentlanguage::            Declaring the current language.
54656160Sru* documentencoding::            Declaring the input encoding.
54756160Sru
54856160SruDefining New Texinfo Commands
54956160Sru
55056160Sru* Defining Macros::             Defining and undefining new commands.
55142660Smarkm* Invoking Macros::             Using a macro, once you've defined it.
552146515Sru* Macro Details::               Limitations of Texinfo macros.
55356160Sru* alias::                       Command aliases.
55456160Sru* definfoenclose::              Customized highlighting.
55542660Smarkm
55656160SruFormatting and Printing Hardcopy
55742660Smarkm
55842660Smarkm* Use TeX::                     Use @TeX{} to format for hardcopy.
55956160Sru* Format with tex/texindex::    How to format with explicit shell commands.
56056160Sru* Format with texi2dvi::        A simpler way to format.
56142660Smarkm* Print with lpr::              How to print.
56242660Smarkm* Within Emacs::                How to format and print from an Emacs shell.
56342660Smarkm* Texinfo Mode Printing::       How to format and print in Texinfo mode.
56442660Smarkm* Compile-Command::             How to print using Emacs's compile command.
56542660Smarkm* Requirements Summary::        @TeX{} formatting requirements summary.
56656160Sru* Preparing for TeX::           What to do before you use @TeX{}.
56742660Smarkm* Overfull hboxes::             What are and what to do with overfull hboxes.
56842660Smarkm* smallbook::                   How to print small format books and manuals.
56993139Sru* A4 Paper::                    How to print on A4 or A5 paper.
57056160Sru* pagesizes::                   How to print with customized page sizes.
571114472Sru* Cropmarks and Magnification:: How to print marks to indicate the size
572116525Sru                                 of pages and how to print scaled up output.
57356160Sru* PDF Output::                  Portable Document Format output.
574146515Sru* Obtaining TeX::               How to Obtain @TeX{}.
57542660Smarkm
57656160SruCreating and Installing Info Files
57756160Sru
578116525Sru* Creating an Info File::
579116525Sru* Installing an Info File::
58056160Sru
58142660SmarkmCreating an Info File
58242660Smarkm
58342660Smarkm* makeinfo advantages::         @code{makeinfo} provides better error checking.
58442660Smarkm* Invoking makeinfo::           How to run @code{makeinfo} from a shell.
58542660Smarkm* makeinfo options::            Specify fill-column and other options.
58642660Smarkm* Pointer Validation::          How to check that pointers point somewhere.
58742660Smarkm* makeinfo in Emacs::           How to run @code{makeinfo} from Emacs.
58842660Smarkm* texinfo-format commands::     Two Info formatting commands written
589114472Sru                                 in Emacs Lisp are an alternative
590114472Sru                                 to @code{makeinfo}.
59142660Smarkm* Batch Formatting::            How to format for Info in Emacs Batch mode.
59242660Smarkm* Tag and Split Files::         How tagged and split files help Info
593114472Sru                                 to run better.
59442660Smarkm
59542660SmarkmInstalling an Info File
59642660Smarkm
59756160Sru* Directory File::              The top level menu for all Info files.
59893139Sru* New Info File::               Listing a new Info file.
59942660Smarkm* Other Info Directories::      How to specify Info files that are
600114472Sru                                 located in other directories.
60142660Smarkm* Installing Dir Entries::      How to specify what menu entry to add
602114472Sru                                 to the Info directory.
60342660Smarkm* Invoking install-info::       @code{install-info} options.
60442660Smarkm
605146515SruGenerating HTML
606146515Sru
607146515Sru* HTML Translation::       Details of the HTML output.
608146515Sru* HTML Splitting::         How HTML output is split.
609146515Sru* HTML CSS::               Influencing HTML output with Cascading Style Sheets.
610146515Sru* HTML Xref::              Cross-references in HTML output.
611146515Sru
612146515SruHTML Cross-references
613146515Sru
614146515Sru* Link Basics:       HTML Xref Link Basics.
615146515Sru* Node Expansion:    HTML Xref Node Name Expansion.
616146515Sru* Command Expansion: HTML Xref Command Expansion.
617146515Sru* 8-bit Expansion:   HTML Xref 8-bit Character Expansion.
618146515Sru* Mismatch:          HTML Xref Mismatch.
619146515Sru
620146515Sru@@-Command List
621146515Sru
622146515Sru* Command Syntax::    General syntax for varieties of @@-commands.
623146515Sru
624100513SruSample Texinfo Files
625100513Sru
626116525Sru* Short Sample Texinfo File::
627116525Sru* GNU Sample Texts::
628116525Sru* Verbatim Copying License::
629116525Sru* All-permissive Copying License::
630100513Sru
631116525SruCopying This Manual
632116525Sru
633116525Sru* GNU Free Documentation License::  License for copying this manual.
634116525Sru
63542660SmarkmInclude Files
63642660Smarkm
63742660Smarkm* Using Include Files::         How to use the @code{@@include} command.
63842660Smarkm* texinfo-multiple-files-update::  How to create and update nodes and
639146515Sru                                     menus when using included files.
640146515Sru* Include Files Requirements::  @code{texinfo-multiple-files-update} needs.
64142660Smarkm* Sample Include File::         A sample outer file with included files
642146515Sru                                     within it; and a sample included file.
64342660Smarkm* Include Files Evolution::     How use of the @code{@@include} command
644146515Sru                                     has changed over time.
64542660Smarkm
64642660SmarkmPage Headings
64742660Smarkm
64842660Smarkm* Headings Introduced::         Conventions for using page headings.
64942660Smarkm* Heading Format::              Standard page heading formats.
65042660Smarkm* Heading Choice::              How to specify the type of page heading.
65142660Smarkm* Custom Headings::             How to create your own headings and footings.
65242660Smarkm
65342660SmarkmFormatting Mistakes
65442660Smarkm
65542660Smarkm* makeinfo Preferred::          @code{makeinfo} finds errors.
65642660Smarkm* Debugging with Info::         How to catch errors with Info formatting.
65742660Smarkm* Debugging with TeX::          How to catch errors with @TeX{} formatting.
65842660Smarkm* Using texinfo-show-structure::  How to use @code{texinfo-show-structure}.
65942660Smarkm* Using occur::                 How to list all lines containing a pattern.
66042660Smarkm* Running Info-Validate::       How to find badly referenced nodes.
66142660Smarkm
66242660SmarkmFinding Badly Referenced Nodes
66342660Smarkm
66442660Smarkm* Using Info-validate::         How to run @code{Info-validate}.
66542660Smarkm* Unsplit::                     How to create an unsplit file.
66642660Smarkm* Tagifying::                   How to tagify a file.
66742660Smarkm* Splitting::                   How to split a file manually.
66893139Sru
669100513SruCopying This Manual
670100513Sru
671100513Sru* GNU Free Documentation License::  License for copying this manual.
672100513Sru
67342660Smarkm@end detailmenu
67442660Smarkm@end menu
67542660Smarkm
67656160Sru@c Reward readers for getting to the end of the menu :).
67756160Sru@c Contributed by Arnold Robbins.
67856160Sru@quotation
67956160SruDocumentation is like sex: when it is good, it is very, very good; and
68056160Sruwhen it is bad, it is better than nothing.
68156160Sru---Dick Brandon
68256160Sru@end quotation
68356160Sru
68456160Sru
685100513Sru@node Copying Conditions
68642660Smarkm@unnumbered Texinfo Copying Conditions
68742660Smarkm@cindex Copying conditions
68842660Smarkm@cindex Conditions for copying Texinfo
68942660Smarkm
69042660SmarkmThe programs currently being distributed that relate to Texinfo include
69193139Sru@code{makeinfo}, @code{info}, @code{texindex}, and @file{texinfo.tex}.
69242660SmarkmThese programs are @dfn{free}; this means that everyone is free to use
69342660Smarkmthem and free to redistribute them on a free basis.  The Texinfo-related
69442660Smarkmprograms are not in the public domain; they are copyrighted and there
69542660Smarkmare restrictions on their distribution, but these restrictions are
69642660Smarkmdesigned to permit everything that a good cooperating citizen would want
69742660Smarkmto do.  What is not allowed is to try to prevent others from further
69893139Srusharing any version of these programs that they might get from you.
69942660Smarkm
70093139SruSpecifically, we want to make sure that you have the right to give away
70193139Srucopies of the programs that relate to Texinfo, that you receive source
70293139Srucode or else can get it if you want it, that you can change these
70342660Smarkmprograms or use pieces of them in new free programs, and that you know
70493139Sruyou can do these things.
70542660Smarkm
70693139SruTo make sure that everyone has such rights, we have to forbid you to
70742660Smarkmdeprive anyone else of these rights.  For example, if you distribute
70842660Smarkmcopies of the Texinfo related programs, you must give the recipients all
70942660Smarkmthe rights that you have.  You must make sure that they, too, receive or
71093139Srucan get the source code.  And you must tell them their rights.
71142660Smarkm
71293139SruAlso, for our own protection, we must make certain that everyone finds
71342660Smarkmout that there is no warranty for the programs that relate to Texinfo.
71442660SmarkmIf these programs are modified by someone else and passed on, we want
71542660Smarkmtheir recipients to know that what they have is not what we distributed,
71642660Smarkmso that any problems introduced by others will not reflect on our
71793139Srureputation.
71842660Smarkm
71993139SruThe precise conditions of the licenses for the programs currently being
72093139Srudistributed that relate to Texinfo are found in the General Public
721100513SruLicenses that accompany them.  This manual specifically is covered by
722100513Sruthe GNU Free Documentation License (@pxref{GNU Free Documentation
723100513SruLicense}).
72442660Smarkm
72556160Sru
72656160Sru@node Overview
72742660Smarkm@chapter Overview of Texinfo
72842660Smarkm@cindex Overview of Texinfo
72942660Smarkm@cindex Texinfo overview
73042660Smarkm
73156160Sru@dfn{Texinfo}@footnote{The first syllable of ``Texinfo'' is pronounced
73256160Srulike ``speck'', not ``hex''.  This odd pronunciation is derived from,
73356160Srubut is not the same as, the pronunciation of @TeX{}.  In the word
73456160Sru@TeX{}, the @samp{X} is actually the Greek letter ``chi'' rather than
73556160Sruthe English letter ``ex''.  Pronounce @TeX{} as if the @samp{X} were the
73656160Srulast sound in the name `Bach'; but pronounce Texinfo as if the @samp{x}
73756160Sruwere a `k'.  Spell ``Texinfo'' with a capital ``T'' and the other
73856160Sruletters in lower case.}  is a documentation system that uses a single
73956160Srusource file to produce both online information and printed output.  This
74056160Srumeans that instead of writing two different documents, one for the
74156160Sruonline information and the other for a printed work, you need write only
74256160Sruone document.  Therefore, when the work is revised, you need revise only
74356160Sruthat one document.
74442660Smarkm
74542660Smarkm@menu
74656160Sru* Reporting Bugs::              Submitting effective bug reports.
74756160Sru* Using Texinfo::               Create printed or online output.
748114472Sru* Output Formats::              Overview of the supported output formats.
74942660Smarkm* Info Files::                  What is an Info file?
75042660Smarkm* Printed Books::               Characteristics of a printed book or manual.
75142660Smarkm* Formatting Commands::         @@-commands are used for formatting.
75242660Smarkm* Conventions::                 General rules for writing a Texinfo file.
75356160Sru* Comments::                    Writing comments and ignored text in general.
75442660Smarkm* Minimum::                     What a Texinfo file must have.
75542660Smarkm* Six Parts::                   Usually, a Texinfo file has six parts.
75642660Smarkm* Short Sample::                A short sample Texinfo file.
75793139Sru* History::                     Acknowledgements, contributors and genesis.
75842660Smarkm@end menu
75942660Smarkm
76042660Smarkm
76156160Sru@node Reporting Bugs
76256160Sru@section Reporting Bugs
76356160Sru
76456160Sru@cindex Bugs, reporting
76556160Sru@cindex Suggestions for Texinfo, making
76656160Sru@cindex Reporting bugs
76793139SruWe welcome bug reports and suggestions for any aspect of the Texinfo system,
76893139Sruprograms, documentation, installation, anything.  Please email them to
76956160Sru@email{bug-texinfo@@gnu.org}.  You can get the latest version of Texinfo
77056160Srufrom @uref{ftp://ftp.gnu.org/gnu/texinfo/} and its mirrors worldwide.
77156160Sru
77256160Sru@cindex Checklist for bug reports
77356160SruFor bug reports, please include enough information for the maintainers
77456160Sruto reproduce the problem.  Generally speaking, that means:
77556160Sru
77656160Sru@itemize @bullet
77756160Sru@item the version number of Texinfo and the program(s) or manual(s) involved.
778100513Sru@item hardware and operating system names and versions.
77956160Sru@item the contents of any input files necessary to reproduce the bug.
78056160Sru@item a description of the problem and samples of any erroneous output.
781100513Sru@item any unusual options you gave to @command{configure}.
78256160Sru@item anything else that you think would be helpful.
78356160Sru@end itemize
78456160Sru
78556160SruWhen in doubt whether something is needed or not, include it.  It's
78656160Srubetter to include too much than to leave out something important.
78756160Sru
788100513Sru@cindex Patches, contributing
78956160SruPatches are most welcome; if possible, please make them with
790146515Sru@samp{@w{diff -c}} (@pxref{Top,, Overview, diff, Comparing and Merging
791146515SruFiles}) and include @file{ChangeLog} entries (@pxref{Change Log,,,
792146515Sruemacs, The GNU Emacs Manual}).
79356160Sru
79493139SruWhen sending patches, if possible please do not encode or split them in
79593139Sruany way; it's much easier to deal with one plain text message, however
79693139Srularge, than many small ones.  @uref{ftp://ftp.gnu.org/gnu/sharutils/,
79793139SruGNU shar} is a convenient way of packaging multiple and/or binary files
79893139Srufor email.
79956160Sru
80056160Sru
80156160Sru@node Using Texinfo
80256160Sru@section Using Texinfo
80356160Sru
80456160Sru@cindex Using Texinfo in general
80556160Sru@cindex Texinfo, introduction to
80656160Sru@cindex Introduction to Texinfo
80756160Sru
808146515SruUsing Texinfo, you can create a printed document (via the @TeX{}
809146515Srutypesetting system) the normal features of a book, including chapters,
810146515Srusections, cross references, and indices.  From the same Texinfo source
811146515Srufile, you can create an Info file with special features to make
812146515Srudocumentation browsing easy.  You can also create from that same
813146515Srusource file an HTML output file suitable for use with a web browser,
814146515Sruor an XML file.  See the next section (@pxref{Output Formats}) for
815146515Srudetails and the exact commands to generate output from the source.
81642660Smarkm
81756160Sru@TeX{} works with virtually all printers; Info works with virtually all
81856160Srucomputer terminals; the HTML output works with virtually all web
81956160Srubrowsers.  Thus Texinfo can be used by almost any computer user.
82056160Sru
821114472Sru@cindex Source file format
822114472SruA Texinfo source file is a plain @sc{ascii} file containing text
823114472Sruinterspersed with @dfn{@@-commands} (words preceded by an @samp{@@})
824146515Sruthat tell the typesetting and formatting programs what to do.  You can
825146515Sruedit a Texinfo file with any text editor, but it is especially
826114472Sruconvenient to use GNU Emacs since that editor has a special mode,
827114472Srucalled Texinfo mode, that provides various Texinfo-related features.
828114472Sru(@xref{Texinfo Mode}.)
82942660Smarkm
83056160SruYou can use Texinfo to create both online help and printed manuals;
83142660Smarkmmoreover, Texinfo is freely redistributable.  For these reasons, Texinfo
83256160Sruis the official documentation format of the GNU project.  More
83356160Sruinformation is available at the @uref{http://www.gnu.org/doc/, GNU
83456160Srudocumentation web page}.
83542660Smarkm
836114472Sru
837114472Sru@node Output Formats
838114472Sru@section Output Formats
839114472Sru@cindex Output formats
840114472Sru@cindex Back-end output formats
841114472Sru
842114472SruHere is a brief overview of the output formats currently supported by
843114472SruTexinfo.
844114472Sru
845114472Sru@table @asis
846114472Sru@item Info
847114472Sru@cindex Info output
848146515Sru(Generated via @command{makeinfo}.)  This format is essentially a
849146515Sruplain text transliteration of the Texinfo source.  It adds a few
850146515Srucontrol characters to separate nodes and provide navigational
851146515Sruinformation for menus, cross-references, indices, and so on.  See the
852114472Srunext section (@pxref{Info Files}) for more details on this format.
853114472SruThe Emacs Info subsystem (@pxref{Top,,Getting Started,info, Info}),
854146515Sruand the standalone @command{info} program (@pxref{Top
855146515Sru,, Info Standalone, info-stnd, GNU Info}), among others, can read these
856114472Srufiles.  @xref{Creating and Installing Info Files}.
857114472Sru
858114472Sru@item Plain text
859114472Sru@cindex Plain text output
860114472Sru(Generated via @command{makeinfo --no-headers}.)  This is almost the
861114472Srusame as Info output, except the navigational control characters are
862146515Sruomitted.  Also, standard output is used by default.
863114472Sru
864114472Sru@item HTML
865114472Sru@cindex HTML output
866114472Sru@cindex W3 consortium
867114472Sru@cindex Mozilla
868114472Sru@cindex Lynx
869114472Sru@cindex Emacs-W3
870114472Sru(Generated via @command{makeinfo --html}.)  This is the Hyper Text
871114472SruMarkup Language that has become the most commonly used language for
872114472Sruwriting documents on the World Wide Web.  Web browsers, such as
873114472SruMozilla, Lynx, and Emacs-W3, can render this language online.  There
874114472Sruare many versions of HTML; @command{makeinfo} tries to use a subset
875114472Sruof the language that can be interpreted by any common browser.  For
876114472Srudetails of the HTML language and much related information, see
877114472Sru@uref{http://www.w3.org/MarkUp/}.  @xref{Generating HTML}.
878114472Sru
879114472Sru@item DVI
880114472Sru@cindex DVI output
881146515Sru@pindex dvips
882146515Sru@pindex xdvi
883114472Sru(Generated via @command{texi2dvi}.)  This DeVice Independent binary
884114472Sruformat is output by the @TeX{} typesetting program
885146515Sru(@uref{http://tug.org}).  This is then read by a DVI `driver', which
886114472Sruwrites the actual device-specific commands that can be viewed or
887146515Sruprinted, notably Dvips for translation to PostScript (@pxref{Invoking
888146515SruDvips,,, dvips, Dvips}) and Xdvi for viewing on an X display
889114472Sru(@uref{http://sourceforge.net/projects/xdvi/}).  @xref{Hardcopy}.
890114472Sru
891146515SruBe aware that the Texinfo language is very different from and much
892146515Srustricter than @TeX{}'s usual languages, plain @TeX{} and @LaTeX{}.
893146515SruFor more information on @TeX{} in general, please see the book
894146515Sru@cite{@TeX{} for the Impatient}, available from
895146515Sru@uref{http://savannah.gnu.org/projects/teximpatient}.
896146515Sru
897114472Sru@item PDF
898114472Sru@cindex PDF output
899114472Sru@cindex Beebe, Nelson
900114472Sru@pindex pdftex
901146515Sru(Generated via @command{texi2dvi --pdf} or @command{texi2pdf}.)  This
902146515Sruwas developed by Adobe Systems for portable document interchange,
903146515Srubased on their previous PostScript language.  It can represent the exact
904146515Sruappearance of a document, including fonts, and supporting arbitrary
905146515Sruscaling.  It is intended to be platform-independent and easily
906146515Sruviewable, among other design goals; for a discussion, see
907146515Sru@uref{http://tug.org/TUGboat/Articles/tb22-3/tb72beebeI.pdf}.  Texinfo
908146515Sruuses the @command{pdftex} program, a variant of @TeX{}, to output PDF;
909114472Srusee @uref{http://tug.org/applications/pdftex}.  @xref{PDF Output}.
910114472Sru
911114472Sru@item XML
912114472Sru@cindex XML output
913114472Sru@cindex DTD, for Texinfo XML
914146515Sru@pindex texinfo.dtd
915114472Sru(Generated via @command{makeinfo --xml}.)  XML is a generic syntax
916114472Sruspecification usable for any sort of content (see, for example,
917114472Sru@uref{http://www.w3.org/XML/}).  The @command{makeinfo} xml output,
918146515Sruunlike all the formats above, interprets very little of the Texinfo
919114472Srusource.  Rather, it merely translates the Texinfo markup commands into
920114472SruXML syntax, for processing by further XML tools.  The particular
921114472Srusyntax output is defined in the file @file{texinfo.dtd} included in
922114472Sruthe Texinfo source distribution.
923114472Sru
924146515Sru@item Docbook
925146515Sru@cindex Docbook output
926146515Sru(Generated via @command{makeinfo --docbook}.)  This is an XML-based
927146515Sruformat developed some years ago, primarily for technical
928146515Srudocumentation.  It therefore bears some resemblance, in broad
929146515Sruoutlines, to Texinfo.  See @uref{http://www.docbook.org}.  If you want
930146515Sruto convert from Docbook @emph{to} Texinfo, please see
931146515Sru@uref{http://docbook2X.sourceforge.net}.
932114472Sru
933114472Sru@end table
934114472Sru
93556160Sru@cindex Man page output, not supported
93656160SruFrom time to time, proposals are made to generate traditional Unix man
937114472Srupages from Texinfo source.  However, because man pages have a very
938114472Srustrict conventional format, generating a good man page requires a
93956160Srucompletely different source than the typical Texinfo applications of
940114472Sruwriting a good user tutorial and/or a good reference manual.  This
941114472Srumakes generating man pages incompatible with the Texinfo design goal
942114472Sruof not having to document the same information in different ways for
943114472Srudifferent output formats.  You might as well just write the man page
944114472Srudirectly.
94556160Sru
946116525Sru@pindex help2man
94756160Sru@cindex O'Dea, Brendan
948114472SruMan pages still have their place, and if you wish to support them, you
949114472Srumay find the program @command{help2man} to be useful; it generates a
950114472Srutraditional man page from the @samp{--help} output of a program.  In
951114472Srufact, this is currently used to generate man pages for the programs in
952114472Sruthe Texinfo distribution.  It is GNU software written by Brendan
953114472SruO'Dea, available from @uref{ftp://ftp.gnu.org/gnu/help2man/}.
95456160Sru
955114472Sru@cindex Output formats, supporting more
956114472Sru@cindex SGML-tools output format
957114472SruIf you are a programmer and would like to contribute to the GNU project
958114472Sruby implementing additional output formats for Texinfo, that would be
959114472Sruexcellent.  But please do not write a separate translator texi2foo for
960114472Sruyour favorite format foo!  That is the hard way to do the job, and makes
961114472Sruextra work in subsequent maintenance, since the Texinfo language is
962114472Srucontinually being enhanced and updated.  Instead, the best approach is
963114472Srumodify @code{makeinfo} to generate the new format.
96456160Sru
965114472Sru
96656160Sru@node Info Files
967114472Sru@section Info Files
96842660Smarkm@cindex Info files
96942660Smarkm
97042660SmarkmAn Info file is a Texinfo file formatted so that the Info documentation
97142660Smarkmreading program can operate on it.  (@code{makeinfo}
97242660Smarkmand @code{texinfo-format-buffer} are two commands that convert a Texinfo file
973100513Sruinto an Info file.)
97442660Smarkm
97542660SmarkmInfo files are divided into pieces called @dfn{nodes}, each of which
97642660Smarkmcontains the discussion of one topic.  Each node has a name, and
97742660Smarkmcontains both text for the user to read and pointers to other nodes,
97842660Smarkmwhich are identified by their names.  The Info program displays one node
97942660Smarkmat a time, and provides commands with which the user can move to other
980100513Srurelated nodes.
98142660Smarkm
982146515Sru@xref{Top,,, info, GNU Info}, for more information about using Info.
98342660Smarkm
98442660SmarkmEach node of an Info file may have any number of child nodes that
98542660Smarkmdescribe subtopics of the node's topic.  The names of child
98642660Smarkmnodes are listed in a @dfn{menu} within the parent node; this
98742660Smarkmallows you to use certain Info commands to move to one of the child
98842660Smarkmnodes.  Generally, an Info file is organized like a book.  If a node
98942660Smarkmis at the logical level of a chapter, its child nodes are at the level
99042660Smarkmof sections; likewise, the child nodes of sections are at the level
991100513Sruof subsections.
99242660Smarkm
99342660SmarkmAll the children of any one parent are linked together in a
99442660Smarkmbidirectional chain of `Next' and `Previous' pointers.  The `Next'
99542660Smarkmpointer provides a link to the next section, and the `Previous' pointer
99642660Smarkmprovides a link to the previous section.  This means that all the nodes
99742660Smarkmthat are at the level of sections within a chapter are linked together.
99842660SmarkmNormally the order in this chain is the same as the order of the
99942660Smarkmchildren in the parent's menu.  Each child node records the parent node
100042660Smarkmname as its `Up' pointer.  The last child has no `Next' pointer, and the
100142660Smarkmfirst child has the parent both as its `Previous' and as its `Up'
100242660Smarkmpointer.@footnote{In some documents, the first child has no `Previous'
100342660Smarkmpointer.  Occasionally, the last child has the node name of the next
1004100513Srufollowing higher level node as its `Next' pointer.}
100542660Smarkm
100642660SmarkmThe book-like structuring of an Info file into nodes that correspond
100742660Smarkmto chapters, sections, and the like is a matter of convention, not a
100842660Smarkmrequirement.  The `Up', `Previous', and `Next' pointers of a node can
100942660Smarkmpoint to any other nodes, and a menu can contain any other nodes.
101042660SmarkmThus, the node structure can be any directed graph.  But it is usually
101142660Smarkmmore comprehensible to follow a structure that corresponds to the
101242660Smarkmstructure of chapters and sections in a printed book or report.@refill
101342660Smarkm
101442660SmarkmIn addition to menus and to `Next', `Previous', and `Up' pointers, Info
101542660Smarkmprovides pointers of another kind, called references, that can be
101642660Smarkmsprinkled throughout the text.  This is usually the best way to
101742660Smarkmrepresent links that do not fit a hierarchical structure.@refill
101842660Smarkm
101942660SmarkmUsually, you will design a document so that its nodes match the
102042660Smarkmstructure of chapters and sections in the printed output.  But
102142660Smarkmoccasionally there are times when this is not right for the material
102242660Smarkmbeing discussed.  Therefore, Texinfo uses separate commands to specify
102342660Smarkmthe node structure for the Info file and the section structure for the
102442660Smarkmprinted output.@refill
102542660Smarkm
102642660SmarkmGenerally, you enter an Info file through a node that by convention is
102742660Smarkmnamed `Top'.  This node normally contains just a brief summary of the
102842660Smarkmfile's purpose, and a large menu through which the rest of the file is
102942660Smarkmreached.  From this node, you can either traverse the file
103042660Smarkmsystematically by going from node to node, or you can go to a specific
103142660Smarkmnode listed in the main menu, or you can search the index menus and then
103242660Smarkmgo directly to the node that has the information you want.  Alternatively,
103342660Smarkmwith the standalone Info program, you can specify specific menu items on
103442660Smarkmthe command line (@pxref{Top,,, info, Info}).
103542660Smarkm
103642660SmarkmIf you want to read through an Info file in sequence, as if it were a
103742660Smarkmprinted manual, you can hit @key{SPC} repeatedly, or you get the whole
1038146515Srufile with the advanced Info command @kbd{g *}.  (@inforef{Advanced,
103942660SmarkmAdvanced Info commands, info}.)@refill
104042660Smarkm
104142660Smarkm@c !!! dir file may be located in one of many places:
104242660Smarkm@c     /usr/local/emacs/info            mentioned in info.c DEFAULT_INFOPATH
104342660Smarkm@c     /usr/local/lib/emacs/info        mentioned in info.c DEFAULT_INFOPATH
104442660Smarkm@c     /usr/gnu/info                    mentioned in info.c DEFAULT_INFOPATH
104542660Smarkm@c     /usr/local/info
104642660Smarkm@c     /usr/local/lib/info
104742660SmarkmThe @file{dir} file in the @file{info} directory serves as the
104842660Smarkmdeparture point for the whole Info system.  From it, you can reach the
104942660Smarkm`Top' nodes of each of the documents in a complete Info system.@refill
105042660Smarkm
105156160Sru@cindex URI syntax for Info
105256160SruIf you wish to refer to an Info file in a URI, you can use the
105356160Sru(unofficial) syntax exemplified in the following.  This works with
105456160SruEmacs/W3, for example:
105556160Sru@example
105656160Sruinfo:///usr/info/emacs#Dissociated%20Press
105756160Sruinfo:emacs#Dissociated%20Press
105856160Sruinfo://localhost/usr/info/emacs#Dissociated%20Press
105956160Sru@end example
106056160Sru
106156160SruThe @command{info} program itself does not follow URI's of any kind.
106256160Sru
106356160Sru
106456160Sru@node Printed Books
106542660Smarkm@section Printed Books
106642660Smarkm@cindex Printed book and manual characteristics
106742660Smarkm@cindex Manual characteristics, printed
106842660Smarkm@cindex Book characteristics, printed
106942660Smarkm@cindex Texinfo printed book characteristics
107042660Smarkm@cindex Characteristics, printed books or manuals
107142660Smarkm
107242660Smarkm@cindex Knuth, Donald
107342660SmarkmA Texinfo file can be formatted and typeset as a printed book or manual.
107442660SmarkmTo do this, you need @TeX{}, a powerful, sophisticated typesetting
107542660Smarkmprogram written by Donald Knuth.@footnote{You can also use the
107656160Sru@pindex texi2roff@r{, unsupported software}
107756160Sru@uref{ftp://tug.org/texi2roff.tar.gz, @code{texi2roff}} program if you
107856160Srudo not have @TeX{}; since Texinfo is designed for use with @TeX{},
107956160Sru@code{texi2roff} is not described here.  @code{texi2roff} is not part of
108056160Sruthe standard GNU distribution and is not maintained or up-to-date with
108156160Sruall the Texinfo features described in this manual.}
108242660Smarkm
108342660SmarkmA Texinfo-based book is similar to any other typeset, printed work: it
108442660Smarkmcan have a title page, copyright page, table of contents, and preface,
108542660Smarkmas well as chapters, numbered or unnumbered sections and subsections,
108642660Smarkmpage headers, cross references, footnotes, and indices.@refill
108742660Smarkm
108842660SmarkmYou can use Texinfo to write a book without ever having the intention
108956160Sruof converting it into online information.  You can use Texinfo for
109042660Smarkmwriting a printed novel, and even to write a printed memo, although
109142660Smarkmthis latter application is not recommended since electronic mail is so
109242660Smarkmmuch easier.@refill
109342660Smarkm
109442660Smarkm@TeX{} is a general purpose typesetting program.  Texinfo provides a
109556160Srufile @file{texinfo.tex} that contains information (definitions or
109642660Smarkm@dfn{macros}) that @TeX{} uses when it typesets a Texinfo file.
109742660Smarkm(@file{texinfo.tex} tells @TeX{} how to convert the Texinfo @@-commands
109842660Smarkmto @TeX{} commands, which @TeX{} can then process to create the typeset
109942660Smarkmdocument.)  @file{texinfo.tex} contains the specifications for printing
110056160Srua document.  You can get the latest version of @file{texinfo.tex} from
1101114472Sru@uref{ftp://ftp.gnu.org/gnu/texinfo/texinfo.tex}.
110242660Smarkm
1103100513SruIn the United States, documents are most often printed on 8.5 inch by 11
1104100513Sruinch pages (216@dmn{mm} by 280@dmn{mm}); this is the default size.  But
1105100513Sruyou can also print for 7 inch by 9.25 inch pages (178@dmn{mm} by
1106100513Sru235@dmn{mm}, the @code{@@smallbook} size; or on A4 or A5 size paper
1107100513Sru(@code{@@afourpaper}, @code{@@afivepaper}).  (@xref{smallbook, ,
1108100513SruPrinting ``Small'' Books}.  Also, see @ref{A4 Paper, ,Printing on A4
1109100513SruPaper}.)
111042660Smarkm
111142660SmarkmBy changing the parameters in @file{texinfo.tex}, you can change the
111242660Smarkmsize of the printed document.  In addition, you can change the style in
111342660Smarkmwhich the printed document is formatted; for example, you can change the
111442660Smarkmsizes and fonts used, the amount of indentation for each paragraph, the
111542660Smarkmdegree to which words are hyphenated, and the like.  By changing the
111642660Smarkmspecifications, you can make a book look dignified, old and serious, or
1117100513Srulight-hearted, young and cheery.
111842660Smarkm
111942660Smarkm@TeX{} is freely distributable.  It is written in a superset of Pascal
112042660Smarkmcalled WEB and can be compiled either in Pascal or (by using a
112142660Smarkmconversion program that comes with the @TeX{} distribution) in C.
112242660Smarkm(@xref{TeX Mode, ,@TeX{} Mode, emacs, The GNU Emacs Manual}, for information
112342660Smarkmabout @TeX{}.)@refill
112442660Smarkm
112542660Smarkm@TeX{} is very powerful and has a great many features.  Because a
112642660SmarkmTexinfo file must be able to present information both on a
112742660Smarkmcharacter-only terminal in Info form and in a typeset book, the
1128100513Sruformatting commands that Texinfo supports are necessarily limited.
112942660Smarkm
113056160SruTo get a copy of @TeX{}, see
113156160Sru@ref{Obtaining TeX, , How to Obtain @TeX{}}.
113242660Smarkm
113342660Smarkm
1134100513Sru@node Formatting Commands
113542660Smarkm@section @@-commands
113642660Smarkm@cindex @@-commands
113742660Smarkm@cindex Formatting commands
113842660Smarkm
113942660SmarkmIn a Texinfo file, the commands that tell @TeX{} how to typeset the
114042660Smarkmprinted manual and tell @code{makeinfo} and
114142660Smarkm@code{texinfo-format-buffer} how to create an Info file are preceded
114242660Smarkmby @samp{@@}; they are called @dfn{@@-commands}.  For example,
114342660Smarkm@code{@@node} is the command to indicate a node and @code{@@chapter}
114442660Smarkmis the command to indicate the start of a chapter.@refill
114542660Smarkm
1146146515Sru@quotation Note
1147146515SruAlmost all @@ command names are entirely lower case.
114842660Smarkm@end quotation
114942660Smarkm
115042660SmarkmThe Texinfo @@-commands are a strictly limited set of constructs.  The
115142660Smarkmstrict limits make it possible for Texinfo files to be understood both
115242660Smarkmby @TeX{} and by the code that converts them into Info files.  You can
115342660Smarkmdisplay Info files on any terminal that displays alphabetic and
115442660Smarkmnumeric characters.  Similarly, you can print the output generated by
115542660Smarkm@TeX{} on a wide variety of printers.@refill
115642660Smarkm
115742660SmarkmDepending on what they do or what arguments@footnote{The word
115856160Sru@dfn{argument} comes from the way it is used in mathematics and does not
115956160Srurefer to a dispute between two people; it refers to the information
116056160Srupresented to the command.  According to the @cite{Oxford English
116156160SruDictionary}, the word derives from the Latin for @dfn{to make clear,
116256160Sruprove}; thus it came to mean `the evidence offered as proof', which is
116356160Sruto say, `the information offered', which led to its mathematical
116456160Srumeaning.  In its other thread of derivation, the word came to mean `to
116556160Sruassert in a manner against which others may make counter assertions',
116656160Sruwhich led to the meaning of `argument' as a dispute.} they take, you
116756160Sruneed to write @@-commands on lines of their own or as part of
116856160Srusentences:
116942660Smarkm
117042660Smarkm@itemize @bullet
117142660Smarkm@item
1172114472SruWrite a command such as @code{@@quotation} at the beginning of a line as
1173114472Sruthe only text on the line.  (@code{@@quotation} begins an indented
1174114472Sruenvironment.)
117542660Smarkm
117642660Smarkm@item
117742660SmarkmWrite a command such as @code{@@chapter} at the beginning of a line
117842660Smarkmfollowed by the command's arguments, in this case the chapter title, on
117942660Smarkmthe rest of the line.  (@code{@@chapter} creates chapter titles.)@refill
118042660Smarkm
118142660Smarkm@item
118242660SmarkmWrite a command such as @code{@@dots@{@}} wherever you wish but usually
118342660Smarkmwithin a sentence. (@code{@@dots@{@}} creates dots @dots{})@refill
118442660Smarkm
118542660Smarkm@item
118642660SmarkmWrite a command such as @code{@@code@{@var{sample-code}@}} wherever you
118742660Smarkmwish (but usually within a sentence) with its argument,
118842660Smarkm@var{sample-code} in this example, between the braces.  (@code{@@code}
118942660Smarkmmarks text as being code.)@refill
119042660Smarkm
119142660Smarkm@item
119256160SruWrite a command such as @code{@@example} on a line of its own; write the
119356160Srubody-text on following lines; and write the matching @code{@@end}
1194114472Srucommand, @code{@@end example} in this case, on a line of its own
119556160Sruafter the body-text. (@code{@@example} @dots{} @code{@@end example}
119656160Sruindents and typesets body-text as an example.)  It's usually ok to
119756160Sruindent environment commands like this, but in complicated and
119856160Sruhard-to-define circumstances the extra spaces cause extra space to
119956160Sruappear in the output, so beware.
120042660Smarkm@end itemize
120142660Smarkm
120242660Smarkm@noindent
120342660Smarkm@cindex Braces, when to use
120442660SmarkmAs a general rule, a command requires braces if it mingles among other
120542660Smarkmtext; but it does not need braces if it starts a line of its own.  The
120642660Smarkmnon-alphabetic commands, such as @code{@@:}, are exceptions to the rule;
120742660Smarkmthey do not need braces.@refill
120842660Smarkm
120942660SmarkmAs you gain experience with Texinfo, you will rapidly learn how to
121042660Smarkmwrite the different commands: the different ways to write commands
1211146515Sruactually make it easier to write and read Texinfo files than if all
1212146515Srucommands followed exactly the same syntax.  @xref{Command Syntax, ,
1213146515Sru@@-Command Syntax}, for all the details.
121442660Smarkm
121593139Sru
1216100513Sru@node Conventions
121742660Smarkm@section General Syntactic Conventions
121842660Smarkm@cindex General syntactic conventions
121942660Smarkm@cindex Syntactic conventions
122042660Smarkm@cindex Conventions, syntactic
1221146515Sru@cindex Characters, basic input
122242660Smarkm
122356160SruThis section describes the general conventions used in all Texinfo documents.
122456160Sru
122556160Sru@itemize @bullet
122656160Sru@item
1227114472Sru@cindex Source files, characters used
122842660SmarkmAll printable @sc{ascii} characters except @samp{@@}, @samp{@{} and
122942660Smarkm@samp{@}} can appear in a Texinfo file and stand for themselves.
1230100513Sru@samp{@@} is the escape character which introduces commands, while
1231100513Sru@samp{@{} and @samp{@}} are used to surround arguments to certain
1232100513Srucommands.  To put one of these special characters into the document, put
1233146515Sruan @samp{@@} character in front of it, like this: @samp{@@@@},
1234100513Sru@samp{@@@{}, and @samp{@@@}}.
123542660Smarkm
123656160Sru@item
1237114472Sru@cindex Paragraph separator
1238114472Sru@cindex Blank lines, as paragraph separator
1239114472Sru@cindex Newlines, as blank lines
1240114472SruSeparate paragraphs with one or more blank lines.  Currently Texinfo
1241114472Sruonly recognizes newline characters as end of line, not the CRLF
1242114472Srusequence used on some systems; so a @dfn{blank line} means exactly two
1243114472Sruconsecutive newlines.  Sometimes blank lines are useful or convenient
1244114472Sruin other cases as well; you can use the @code{@@noindent} to inhibit
1245114472Sruparagraph indentation if required (@pxref{noindent,,@code{@@noindent}}).
1246114472Sru
1247114472Sru@item
1248114472Sru@cindex Quotation characters (`'), in source
1249114472SruUse doubled single-quote characters to begin and end quotations:
1250146515Sru@w{@t{`@w{}`@dots{}'@w{}'}}.  @TeX{} converts two single quotes to
1251146515Sruleft- and right-hand doubled quotation marks,
1252114472Sru@c this comes out as "like this" in Info, which is just confusing.
125342660Smarkm@iftex
1254116525Sru``like this'',
125542660Smarkm@end iftex
1256100513Sruand Info converts doubled single-quote characters to @sc{ascii}
1257100513Srudouble-quotes: @w{@t{`@w{}`@dots{}'@w{}'}} becomes @w{@t{"@dots{}"}}.
125842660Smarkm
1259146515SruYou may occasionally need to produce two consecutive single quotes;
1260146515Srufor example, in documenting a computer language such as Maxima where
1261146515Sru@t{'@w{}'} is a valid command.  You can do this with the input
1262146515Sru@t{'@@w@{@}'}; the empty @code{@@w} command stops the combination into
1263146515Sruthe double-quote characters.
126442660Smarkm
1265146515Sru@cindex Unicode quotation characters
1266146515Sru@cindex Grave accent, vs.@: left quote
1267146515SruThe left quote character (@t{`}, ASCII code 96) used in Texinfo is a
1268146515Srugrave accent in ANSI and ISO character set standards.  We use it as a
1269146515Sruquote character because that is how @TeX{} is set up, by default.  We
1270146515Sruhope to eventually support the various quotation characters in
1271146515SruUnicode.
1272146515Sru
127356160Sru@item
1274146515Sru@cindex Multiple dashes in source
1275146515Sru@cindex Dashes in source
1276146515Sru@cindex Hyphens in source, two or three in a row
1277146515Sru@cindex Em dash, producing
1278146515Sru@cindex En dash, producing
1279146515SruUse three hyphens in a row, @samp{---}, to produce a long dash---like
1280146515Sruthis (called an @dfn{em dash}), used for punctuation in sentences.
1281146515SruUse two hyphens, @samp{--}, to produce a medium dash (called an
1282146515Sru@dfn{en dash}), used primarily for numeric ranges, as in ``June
1283146515Sru25--26''.  Use a single hyphen, @samp{-}, to produce a standard hyphen
1284146515Sruused in compound words.  For display on the screen, Info reduces three
1285146515Sruhyphens to two and two hyphens to one (not transitively!).  Of course,
1286146515Sruany number of hyphens in the source remain as they are in literal
1287146515Srucontexts, such as @code{@@code} and @code{@@example}.
1288100513Sru
1289114472Sru@item
129042660Smarkm@cindex Tabs; don't use!
1291146515Sru@strong{Caution:} Last and most important, do not use tab characters
1292146515Sruin a Texinfo file (except in verbatim modes)!  @TeX{} uses
1293146515Sruvariable-width fonts, which means that it is impractical at best to
1294146515Srudefine a tab to work in all circumstances.  Consequently, @TeX{}
1295146515Srutreats tabs like single spaces, and that is not what they look like in
1296146515Sruthe source.  Furthermore, @code{makeinfo} does nothing special with
1297146515Srutabs, and thus a tab character in your input file will usually appear
1298146515Srudifferently in the output.
129942660Smarkm
130042660Smarkm@noindent
130142660SmarkmTo avoid this problem, Texinfo mode causes GNU Emacs to insert multiple
130293139Sruspaces when you press the @key{TAB} key.
130342660Smarkm
130442660Smarkm@noindent
130542660SmarkmAlso, you can run @code{untabify} in Emacs to convert tabs in a region
1306146515Sruto multiple spaces, or use the @code{unexpand} command from the shell.
1307146515Sru
1308114472Sru@end itemize
130942660Smarkm
1310100513Sru@node Comments
131142660Smarkm@section Comments
131242660Smarkm
1313100513Sru@cindex Comments
1314100513Sru@findex comment
1315100513Sru@findex c @r{(comment)}
1316100513Sru
131742660SmarkmYou can write comments in a Texinfo file that will not appear in
131842660Smarkmeither the Info file or the printed manual by using the
131942660Smarkm@code{@@comment} command (which may be abbreviated to @code{@@c}).
132056160SruSuch comments are for the person who revises the Texinfo file.  All the
132142660Smarkmtext on a line that follows either @code{@@comment} or @code{@@c} is a
132242660Smarkmcomment; the rest of the line does not appear in either the Info file
1323100513Sruor the printed manual.
132442660Smarkm
1325100513SruOften, you can write the @code{@@comment} or @code{@@c} in the middle of
1326100513Srua line, and only the text that follows after the @code{@@comment} or
1327100513Sru@code{@@c} command does not appear; but some commands, such as
1328100513Sru@code{@@settitle} and @code{@@setfilename}, work on a whole line.  You
1329100513Srucannot use @code{@@comment} or @code{@@c} in a line beginning with such
1330100513Srua command.
1331100513Sru
1332100513Sru@cindex Ignored text
1333100513Sru@cindex Unprocessed text
1334100513Sru@findex ignore
133542660SmarkmYou can write long stretches of text that will not appear in either
133642660Smarkmthe Info file or the printed manual by using the @code{@@ignore} and
133742660Smarkm@code{@@end ignore} commands.  Write each of these commands on a line
133842660Smarkmof its own, starting each command at the beginning of the line.  Text
133942660Smarkmbetween these two commands does not appear in the processed output.
134042660SmarkmYou can use @code{@@ignore} and @code{@@end ignore} for writing
134193139Srucomments.
134293139Sru
134342660SmarkmText enclosed by @code{@@ignore} or by failing @code{@@ifset} or
134442660Smarkm@code{@@ifclear} conditions is ignored in the sense that it will not
134593139Srucontribute to the formatted output.  However, @TeX{} and makeinfo must
1346100513Srustill parse the ignored text, in order to understand when to @emph{stop}
1347100513Sruignoring text from the source file; that means that you may still get
1348100513Sruerror messages if you have invalid Texinfo commands within ignored text.
134942660Smarkm
135093139Sru
1351100513Sru@node Minimum
135242660Smarkm@section What a Texinfo File Must Have
135342660Smarkm@cindex Minimal Texinfo file (requirements)
135442660Smarkm@cindex Must have in Texinfo file
135542660Smarkm@cindex Required in Texinfo file
135642660Smarkm@cindex Texinfo file minimum
135742660Smarkm
1358100513SruBy convention, the namea of a Texinfo file ends with (in order of
1359100513Srupreference) one of the extensions @file{.texinfo}, @file{.texi},
1360100513Sru@file{.txi}, or @file{.tex}.  The longer extensions are preferred since
1361100513Sruthey describe more clearly to a human reader the nature of the file.
1362100513SruThe shorter extensions are for operating systems that cannot handle long
1363100513Srufile names.
136442660Smarkm
136542660SmarkmIn order to be made into a printed manual and an Info file, a Texinfo
1366100513Srufile @strong{must} begin with lines like this:
136742660Smarkm
136842660Smarkm@example
136942660Smarkm@group
137042660Smarkm\input texinfo
137142660Smarkm@@setfilename @var{info-file-name}
137242660Smarkm@@settitle @var{name-of-manual}
137342660Smarkm@end group
137442660Smarkm@end example
137542660Smarkm
137642660Smarkm@noindent
1377100513SruThe contents of the file follow this beginning, and then you
1378100513Sru@strong{must} end a Texinfo file with a line like this:
137942660Smarkm
138042660Smarkm@example
138142660Smarkm@@bye
138242660Smarkm@end example
138342660Smarkm
1384100513Sru@findex \input @r{(raw @TeX{} startup)}
138542660Smarkm@noindent
1386100513SruHere's an explanation:
1387100513Sru
1388100513Sru@itemize @bullet
1389100513Sru@item
139042660SmarkmThe @samp{\input texinfo} line tells @TeX{} to use the
139142660Smarkm@file{texinfo.tex} file, which tells @TeX{} how to translate the Texinfo
139242660Smarkm@@-commands into @TeX{} typesetting commands.  (Note the use of the
1393100513Srubackslash, @samp{\}; this is correct for @TeX{}.)
139442660Smarkm
1395100513Sru@item
1396100513SruThe @code{@@setfilename} line provides a name for the Info file and
1397100513Srutells @TeX{} to open auxiliary files.  @strong{All text before
1398100513Sru@code{@@setfilename} is ignored!}
1399100513Sru
1400100513Sru@item
1401100513SruThe @code{@@settitle} line specifies a title for the page headers (or
1402100513Srufooters) of the printed manual, and the default document description for
1403100513Sruthe @samp{<head>} in HTML format.  Strictly speaking, @code{@@settitle}
1404100513Sruis optional---if you don't mind your document being titled `Untitled'.
1405100513Sru
1406100513Sru@item
140742660SmarkmThe @code{@@bye} line at the end of the file on a line of its own tells
1408100513Sruthe formatters that the file is ended and to stop formatting.
140942660Smarkm
1410100513Sru@end itemize
1411100513Sru
1412100513SruTypically, you will not use quite such a spare format, but will include
141342660Smarkmmode setting and start-of-header and end-of-header lines at the
1414100513Srubeginning of a Texinfo file, like this:
141542660Smarkm
141642660Smarkm@example
141742660Smarkm@group
141842660Smarkm\input texinfo   @@c -*-texinfo-*-
141942660Smarkm@@c %**start of header
142042660Smarkm@@setfilename @var{info-file-name}
142142660Smarkm@@settitle @var{name-of-manual}
142242660Smarkm@@c %**end of header
142342660Smarkm@end group
142442660Smarkm@end example
142542660Smarkm
142642660Smarkm@noindent
142742660SmarkmIn the first line, @samp{-*-texinfo-*-} causes Emacs to switch into
142842660SmarkmTexinfo mode when you edit the file.
142942660Smarkm
1430100513SruThe @code{@@c} lines which surround the @code{@@setfilename} and
1431100513Sru@code{@@settitle} lines are optional, but you need them in order to
1432100513Srurun @TeX{} or Info on just part of the file.  (@xref{Start of Header}.)
143342660Smarkm
1434100513SruFurthermore, you will usually provide a Texinfo file with a title page,
1435100513Sruindices, and the like, all of which are explained in this manual.  But
1436100513Sruthe minimum, which can be useful for short documents, is just the three
1437100513Srulines at the beginning and the one line at the end.
143842660Smarkm
1439100513Sru
1440100513Sru@node Six Parts
144142660Smarkm@section Six Parts of a Texinfo File
144242660Smarkm
1443100513SruGenerally, a Texinfo file contains more than the minimal beginning and
1444100513Sruend described in the previous section---it usually contains the six
1445100513Sruparts listed below.  These are described fully in the following sections.
144642660Smarkm
144742660Smarkm@table @r
144842660Smarkm@item 1. Header
1449100513SruThe @dfn{Header} names the file, tells @TeX{} which definitions file to
1450100513Sruuse, and other such housekeeping tasks.
145142660Smarkm
1452100513Sru@item 2. Summary and Copyright
1453100513SruThe @dfn{Summary and Copyright} segment describes the document and
1454100513Srucontains the copyright notice and copying permissions.  This is done
1455100513Sruwith the @code{@@copying} command.
145642660Smarkm
145742660Smarkm@item 3. Title and Copyright
1458100513SruThe @dfn{Title and Copyright} segment contains the title and copyright
1459100513Srupages for the printed manual.  The segment must be enclosed between
1460100513Sru@code{@@titlepage} and @code{@@end titlepage} commands.  The title and
1461100513Srucopyright page appear only in the printed manual.
146242660Smarkm
146342660Smarkm@item 4. `Top' Node and Master Menu
1464100513SruThe `Top' node starts off the online output; it does not appear in the
1465100513Sruprinted manual.  We recommend including the copying permissions here as
1466100513Sruwell as the segments above.  And it contains at least a top-level menu
1467100513Srulisting the chapters, and possibly a @dfn{Master Menu} listing all the
1468100513Srunodes in the entire document.
146942660Smarkm
147042660Smarkm@item 5. Body
1471100513SruThe @dfn{Body} of the document is typically structured like a
1472100513Srutraditional book or encyclopedia, but it may be free form.
147342660Smarkm
147442660Smarkm@item 6. End
1475100513SruThe @dfn{End} segment contains commands for printing indices and
1476100513Srugenerating the table of contents, and the @code{@@bye} command on a line
1477100513Sruof its own.
147842660Smarkm@end table
147942660Smarkm
1480100513Sru
148156160Sru@node Short Sample
148242660Smarkm@section A Short Sample Texinfo File
1483100513Sru@cindex Sample Texinfo file, with comments
148442660Smarkm
1485100513SruHere is a very short but complete Texinfo file, in the six conventional
1486100513Sruparts enumerated in the previous section, so you can see how Texinfo
1487100513Srusource appears in practice.  The first three parts of the file, from
1488100513Sru@samp{\input texinfo} through to @samp{@@end titlepage}, look more
1489100513Sruintimidating than they are: most of the material is standard
1490100513Sruboilerplate; when writing a manual, you simply change the names as
1491100513Sruappropriate.
149242660Smarkm
1493100513Sru@xref{Beginning a File}, for full documentation on the commands listed
1494114472Sruhere.  @xref{GNU Sample Texts}, for the full texts to be used in GNU
1495114472Srumanuals.
1496100513Sru
149742660SmarkmIn the following, the sample text is @emph{indented}; comments on it are
1498100513Srunot.  The complete file, without interspersed comments, is shown in
1499100513Sru@ref{Short Sample Texinfo File}.
150042660Smarkm
150142660Smarkm@subheading Part 1: Header
150242660Smarkm
150342660Smarkm@noindent
150442660SmarkmThe header does not appear in either the Info file or the
150542660Smarkmprinted output.  It sets various parameters, including the
150642660Smarkmname of the Info file and the title used in the header.
150742660Smarkm
150842660Smarkm@example
150942660Smarkm@group
151042660Smarkm\input texinfo   @@c -*-texinfo-*-
151142660Smarkm@@c %**start of header
151242660Smarkm@@setfilename sample.info
1513100513Sru@@settitle Sample Manual 1.0
151442660Smarkm@@c %**end of header
151542660Smarkm@end group
151642660Smarkm@end example
151742660Smarkm
151842660Smarkm@subheading Part 2: Summary Description and Copyright
151942660Smarkm
152042660Smarkm@noindent
1521100513SruA real manual includes more text here, according to the license under
1522100513Sruwhich it is distributed.  @xref{GNU Sample Texts}.
152342660Smarkm
152442660Smarkm@example
152542660Smarkm@group
1526100513Sru@@copying
1527100513SruThis is a short example of a complete Texinfo file, version 1.0.
152842660Smarkm
1529146515SruCopyright @@copyright@{@} 2004 Free Software Foundation, Inc.
1530100513Sru@@end copying
153142660Smarkm@end group
153242660Smarkm@end example
153342660Smarkm
1534100513Sru@subheading Part 3: Titlepage, Contents, Copyright
153542660Smarkm
153642660Smarkm@noindent
1537100513SruThe titlepage segment does not appear in the online output, only in the
1538100513Sruprinted manual.  We use the @code{@@insertcopying} command to
1539100513Sruinclude the permission text from the previous section, instead of
1540100513Sruwriting it out again; it is output on the back of the title page.  The
1541100513Sru@code{@@contents} command generates a table of contents.
154242660Smarkm
154342660Smarkm@example
154442660Smarkm@group
154542660Smarkm@@titlepage
154693139Sru@@title Sample Title
154742660Smarkm@end group
154842660Smarkm
154942660Smarkm@group
155042660Smarkm@@c The following two commands start the copyright page.
155142660Smarkm@@page
155242660Smarkm@@vskip 0pt plus 1filll
1553100513Sru@@insertcopying
155442660Smarkm@@end titlepage
155542660Smarkm@end group
1556100513Sru
1557100513Sru@@c Output the table of contents at the beginning.
1558100513Sru@@contents
155942660Smarkm@end example
156042660Smarkm
156142660Smarkm@subheading Part 4: `Top' Node and Master Menu
156242660Smarkm
156342660Smarkm@noindent
1564114472SruThe `Top' node contains the master menu for the Info file.  Since the
1565114472Sruprinted manual uses a table of contents rather than a menu, it
1566114472Sruexcludes the `Top' node.  We also include the copying text again for
1567114472Sruthe benefit of online readers.  Since the copying text begins with
1568114472Srua brief description of the manual, no other text is needed in this
1569114472Srucase.  The @samp{@@top} command itself helps @command{makeinfo}
1570114472Srudetermine the relationships between nodes.
157142660Smarkm
157242660Smarkm@example
157393139Sru@@ifnottex
157493139Sru@@node Top
1575114472Sru@@top Short Sample
1576114472Sru
1577114472Sru@@insertcopying
157893139Sru@@end ifnottex
157942660Smarkm
158042660Smarkm@group
158142660Smarkm@@menu
158242660Smarkm* First Chapter::    The first chapter is the
1583100513Sru                       only chapter in this sample.
1584100513Sru* Index::            Complete index.
158542660Smarkm@@end menu
158642660Smarkm@end group
158742660Smarkm@end example
158842660Smarkm
158942660Smarkm
1590100513Sru@subheading Part 5: The Body of the Document
1591100513Sru
159242660Smarkm@noindent
159342660SmarkmThe body segment contains all the text of the document, but not the
159442660Smarkmindices or table of contents.  This example illustrates a node and a
1595100513Sruchapter containing an enumerated list.
159642660Smarkm
159742660Smarkm@example
159842660Smarkm@group
159993139Sru@@node First Chapter
160042660Smarkm@@chapter First Chapter
1601100513Sru
1602100513Sru@@cindex chapter, first
160342660Smarkm@end group
160442660Smarkm
160542660Smarkm@group
1606100513SruThis is the first chapter.
1607100513Sru@@cindex index entry, another
160842660Smarkm@end group
160942660Smarkm
161042660Smarkm@group
161142660SmarkmHere is a numbered list.
161242660Smarkm
161342660Smarkm@@enumerate
161442660Smarkm@@item
161542660SmarkmThis is the first item.
161642660Smarkm
161742660Smarkm@@item
161842660SmarkmThis is the second item.
161942660Smarkm@@end enumerate
162042660Smarkm@end group
162142660Smarkm@end example
162242660Smarkm
1623100513Sru
162442660Smarkm@subheading Part 6: The End of the Document
162542660Smarkm
162642660Smarkm@noindent
162756160SruThe end segment contains commands for generating an index in a node and
1628100513Sruunnumbered chapter of its own, and the @code{@@bye} command that marks
1629100513Sruthe end of the document.
163042660Smarkm
163142660Smarkm@example
163242660Smarkm@group
1633100513Sru@@node Index
1634100513Sru@@unnumbered Index
163542660Smarkm@end group
163642660Smarkm
163742660Smarkm@group
163842660Smarkm@@printindex cp
163942660Smarkm
164042660Smarkm@@bye
164142660Smarkm@end group
164242660Smarkm@end example
164342660Smarkm
164442660Smarkm
1645100513Sru@subheading Some Results
1646100513Sru
164742660SmarkmHere is what the contents of the first chapter of the sample look like:
164842660Smarkm
164942660Smarkm@sp 1
165042660Smarkm@need 700
165142660Smarkm@quotation
1652100513SruThis is the first chapter.
165342660Smarkm
165442660SmarkmHere is a numbered list.
165542660Smarkm
165642660Smarkm@enumerate
165742660Smarkm@item
165842660SmarkmThis is the first item.
165942660Smarkm
166042660Smarkm@item
166142660SmarkmThis is the second item.
166242660Smarkm@end enumerate
166342660Smarkm@end quotation
166442660Smarkm
166542660Smarkm
166693139Sru@node History
166793139Sru@section History
166856160Sru
166942660Smarkm@cindex Stallman, Richard M.
167042660Smarkm@cindex Chassell, Robert J.
1671100513Sru@cindex Fox, Brian
167242660Smarkm@cindex Berry, Karl
167356160SruRichard M.@: Stallman invented the Texinfo format, wrote the initial
1674100513Sruprocessors, and created Edition 1.0 of this manual.  @w{Robert J.@:}
1675100513SruChassell greatly revised and extended the manual, starting with Edition
167656160Sru1.1.  Brian Fox was responsible for the standalone Texinfo distribution
167756160Sruuntil version 3.8, and wrote the standalone @command{makeinfo} and
1678100513Sru@command{info} programs.  Karl Berry has continued maintenance since
1679100513SruTexinfo 3.8 (manual edition 2.22).
168042660Smarkm
168142660Smarkm@cindex Pinard, Fran@,{c}ois
168242660Smarkm@cindex Zuhn, David D.
168342660Smarkm@cindex Weisshaus, Melissa
168456160Sru@cindex Zaretskii, Eli
168556160Sru@cindex Schwab, Andreas
168656160Sru@cindex Weinberg, Zack
1687100513SruOur thanks go out to all who helped improve this work, particularly the
1688100513Sruindefatigable Eli Zaretskii and Andreas Schwab, who have provided
1689100513Srupatches beyond counting.  Fran@,{c}ois Pinard and @w{David D.@: Zuhn},
1690100513Srutirelessly recorded and reported mistakes and obscurities.  Zack
1691100513SruWeinberg did the impossible by implementing the macro syntax in
1692100513Sru@file{texinfo.tex}.  Special thanks go to Melissa Weisshaus for her
1693100513Srufrequent reviews of nearly similar editions.  Dozens of others have
1694100513Srucontributed patches and suggestions, they are gratefully acknowledged in
1695100513Sruthe @file{ChangeLog} file.  Our mistakes are our own.
169642660Smarkm
169756160Sru@cindex Scribe
169856160Sru@cindex Reid, Brian
169956160Sru@cindex History of Texinfo
1700100513Sru@cindex Texinfo history
170156160SruA bit of history: in the 1970's at CMU, Brian Reid developed a program
170256160Sruand format named Scribe to mark up documents for printing.  It used the
1703100513Sru@code{@@} character to introduce commands, as Texinfo does.  Much more
1704100513Sruconsequentially, it strived to describe document contents rather than
1705100513Sruformatting, an idea wholeheartedly adopted by Texinfo.
170642660Smarkm
170756160Sru@cindex Bolio
170856160Sru@cindex Bo@TeX{}
170956160SruMeanwhile, people at MIT developed another, not too dissimilar format
171056160Srucalled Bolio.  This then was converted to using @TeX{} as its typesetting
1711100513Srulanguage: Bo@TeX{}.  The earliest Bo@TeX{} version seems to have been
1712100513Sru0.02 on October 31, 1984.
171342660Smarkm
171456160SruBo@TeX{} could only be used as a markup language for documents to be
171556160Sruprinted, not for online documents.  Richard Stallman (RMS) worked on
171656160Sruboth Bolio and Bo@TeX{}.  He also developed a nifty on-line help format
171756160Srucalled Info, and then combined Bo@TeX{} and Info to create Texinfo, a
1718100513Srumark up language for text that is intended to be read both online and
171956160Sruas printed hard copy.
172042660Smarkm
172156160Sru
172256160Sru@node Texinfo Mode
172342660Smarkm@chapter Using Texinfo Mode
172442660Smarkm@cindex Texinfo mode
172542660Smarkm@cindex Mode, using Texinfo
172642660Smarkm@cindex GNU Emacs
172742660Smarkm@cindex Emacs
172842660Smarkm
172942660SmarkmYou may edit a Texinfo file with any text editor you choose.  A Texinfo
173042660Smarkmfile is no different from any other @sc{ascii} file.  However, GNU Emacs
1731100513Srucomes with a special mode, called Texinfo mode, that provides Emacs
1732100513Srucommands and tools to help ease your work.
173342660Smarkm
173442660SmarkmThis chapter describes features of GNU Emacs' Texinfo mode but not any
1735100513Srufeatures of the Texinfo formatting language.  So if you are reading this
173642660Smarkmmanual straight through from the beginning, you may want to skim through
173742660Smarkmthis chapter briefly and come back to it after reading succeeding
1738100513Sruchapters which describe the Texinfo formatting language in detail.
173942660Smarkm
174042660Smarkm@menu
174142660Smarkm* Texinfo Mode Overview::       How Texinfo mode can help you.
174242660Smarkm* Emacs Editing::               Texinfo mode adds to GNU Emacs' general
174342660Smarkm                                  purpose editing features.
174442660Smarkm* Inserting::                   How to insert frequently used @@-commands.
174542660Smarkm* Showing the Structure::       How to show the structure of a file.
174642660Smarkm* Updating Nodes and Menus::    How to update or create new nodes and menus.
174742660Smarkm* Info Formatting::             How to format for Info.
174842660Smarkm* Printing::                    How to format and print part or all of a file.
174942660Smarkm* Texinfo Mode Summary::        Summary of all the Texinfo mode commands.
175042660Smarkm@end menu
175142660Smarkm
1752146515Sru@node Texinfo Mode Overview
1753146515Sru@section Texinfo Mode Overview
175442660Smarkm
1755146515SruTexinfo mode provides special features for working with Texinfo files.
1756146515SruYou can:
175742660Smarkm
175842660Smarkm@itemize @bullet
175942660Smarkm@item
176042660SmarkmInsert frequently used @@-commands. @refill
176142660Smarkm
176242660Smarkm@item
176342660SmarkmAutomatically create @code{@@node} lines.
176442660Smarkm
176542660Smarkm@item
176642660SmarkmShow the structure of a Texinfo source file.@refill
176742660Smarkm
176842660Smarkm@item
176942660SmarkmAutomatically create or update the `Next',
177042660Smarkm`Previous', and `Up' pointers of a node.
177142660Smarkm
177242660Smarkm@item
177342660SmarkmAutomatically create or update menus.@refill
177442660Smarkm
177542660Smarkm@item
177642660SmarkmAutomatically create a master menu.@refill
177742660Smarkm
177842660Smarkm@item
177942660SmarkmFormat a part or all of a file for Info.@refill
178042660Smarkm
178142660Smarkm@item
178242660SmarkmTypeset and print part or all of a file.@refill
178342660Smarkm@end itemize
178442660Smarkm
178542660SmarkmPerhaps the two most helpful features are those for inserting frequently
178642660Smarkmused @@-commands and for creating node pointers and menus.@refill
178742660Smarkm
1788146515Sru@node Emacs Editing
178942660Smarkm@section The Usual GNU Emacs Editing Commands
179042660Smarkm
179142660SmarkmIn most cases, the usual Text mode commands work the same in Texinfo
179242660Smarkmmode as they do in Text mode.  Texinfo mode adds new editing commands
179342660Smarkmand tools to GNU Emacs' general purpose editing features.  The major
179442660Smarkmdifference concerns filling.  In Texinfo mode, the paragraph
179542660Smarkmseparation variable and syntax table are redefined so that Texinfo
179642660Smarkmcommands that should be on lines of their own are not inadvertently
179742660Smarkmincluded in paragraphs.  Thus, the @kbd{M-q} (@code{fill-paragraph})
179842660Smarkmcommand will refill a paragraph but not mix an indexing command on a
179942660Smarkmline adjacent to it into the paragraph.@refill
180042660Smarkm
180142660SmarkmIn addition, Texinfo mode sets the @code{page-delimiter} variable to
180242660Smarkmthe value of @code{texinfo-chapter-level-regexp}; by default, this is
180342660Smarkma regular expression matching the commands for chapters and their
180442660Smarkmequivalents, such as appendices.  With this value for the page
180542660Smarkmdelimiter, you can jump from chapter title to chapter title with the
180642660Smarkm@kbd{C-x ]} (@code{forward-page}) and @kbd{C-x [}
180742660Smarkm(@code{backward-page}) commands and narrow to a chapter with the
180842660Smarkm@kbd{C-x p} (@code{narrow-to-page}) command.  (@xref{Pages, , ,emacs,
180942660SmarkmThe GNU Emacs Manual}, for details about the page commands.)@refill
181042660Smarkm
181142660SmarkmYou may name a Texinfo file however you wish, but the convention is to
181256160Sruend a Texinfo file name with one of the extensions
181356160Sru@file{.texinfo}, @file{.texi}, @file{.txi}, or @file{.tex}.  A longer
181456160Sruextension is preferred, since it is explicit, but a shorter extension
181556160Srumay be necessary for operating systems that limit the length of file
181656160Srunames.  GNU Emacs automatically enters Texinfo mode when you visit a
181756160Srufile with a @file{.texinfo}, @file{.texi} or @file{.txi}
181842660Smarkmextension.  Also, Emacs switches to Texinfo mode
181942660Smarkmwhen you visit a
182042660Smarkmfile that has @samp{-*-texinfo-*-} in its first line.  If ever you are
182142660Smarkmin another mode and wish to switch to Texinfo mode, type @code{M-x
182242660Smarkmtexinfo-mode}.@refill
182342660Smarkm
182442660SmarkmLike all other Emacs features, you can customize or enhance Texinfo
182542660Smarkmmode as you wish.  In particular, the keybindings are very easy to
182642660Smarkmchange.  The keybindings described here are the default or standard
182742660Smarkmones.@refill
182842660Smarkm
1829146515Sru@node Inserting
183042660Smarkm@comment  node-name,  next,  previous,  up
183142660Smarkm@section Inserting Frequently Used Commands
183242660Smarkm@cindex Inserting frequently used commands
183342660Smarkm@cindex Frequently used commands, inserting
183442660Smarkm@cindex Commands, inserting them
183542660Smarkm
183642660SmarkmTexinfo mode provides commands to insert various frequently used
183742660Smarkm@@-commands into the buffer.  You can use these commands to save
183842660Smarkmkeystrokes.@refill
183942660Smarkm
184042660SmarkmThe insert commands are invoked by typing @kbd{C-c} twice and then the
184142660Smarkmfirst letter of the @@-command:@refill
184242660Smarkm
184342660Smarkm@table @kbd
184442660Smarkm@item  C-c C-c c
184542660Smarkm@itemx M-x texinfo-insert-@@code
184642660Smarkm@findex texinfo-insert-@@code
184742660SmarkmInsert @code{@@code@{@}} and put the
184842660Smarkmcursor between the braces.@refill
184942660Smarkm
185042660Smarkm@item  C-c C-c d
185142660Smarkm@itemx M-x texinfo-insert-@@dfn
185242660Smarkm@findex texinfo-insert-@@dfn
185342660SmarkmInsert @code{@@dfn@{@}} and put the
185442660Smarkmcursor between the braces.@refill
185542660Smarkm
185642660Smarkm@item  C-c C-c e
185742660Smarkm@itemx M-x texinfo-insert-@@end
185842660Smarkm@findex texinfo-insert-@@end
185942660SmarkmInsert @code{@@end} and attempt to insert the correct following word,
186042660Smarkmsuch as @samp{example} or @samp{table}.  (This command does not handle
186142660Smarkmnested lists correctly, but inserts the word appropriate to the
186242660Smarkmimmediately preceding list.)@refill
186342660Smarkm
186442660Smarkm@item  C-c C-c i
186542660Smarkm@itemx M-x texinfo-insert-@@item
186642660Smarkm@findex texinfo-insert-@@item
186742660SmarkmInsert @code{@@item} and put the
186842660Smarkmcursor at the beginning of the next line.@refill
186942660Smarkm
187042660Smarkm@item  C-c C-c k
187142660Smarkm@itemx M-x texinfo-insert-@@kbd
187242660Smarkm@findex texinfo-insert-@@kbd
187342660SmarkmInsert @code{@@kbd@{@}} and put the
187442660Smarkmcursor between the braces.@refill
187542660Smarkm
187642660Smarkm@item  C-c C-c n
187742660Smarkm@itemx M-x texinfo-insert-@@node
187842660Smarkm@findex texinfo-insert-@@node
187942660SmarkmInsert @code{@@node} and a comment line
188042660Smarkmlisting the sequence for the `Next',
188142660Smarkm`Previous', and `Up' nodes.
188242660SmarkmLeave point after the @code{@@node}.@refill
188342660Smarkm
188442660Smarkm@item  C-c C-c o
188542660Smarkm@itemx M-x texinfo-insert-@@noindent
188642660Smarkm@findex texinfo-insert-@@noindent
188742660SmarkmInsert @code{@@noindent} and put the
188842660Smarkmcursor at the beginning of the next line.@refill
188942660Smarkm
189042660Smarkm@item  C-c C-c s
189142660Smarkm@itemx M-x texinfo-insert-@@samp
189242660Smarkm@findex texinfo-insert-@@samp
189342660SmarkmInsert @code{@@samp@{@}} and put the
189442660Smarkmcursor between the braces.@refill
189542660Smarkm
189642660Smarkm@item  C-c C-c t
189742660Smarkm@itemx M-x texinfo-insert-@@table
189842660Smarkm@findex texinfo-insert-@@table
189942660SmarkmInsert @code{@@table} followed by a @key{SPC}
190042660Smarkmand leave the cursor after the @key{SPC}.@refill
190142660Smarkm
190242660Smarkm@item  C-c C-c v
190342660Smarkm@itemx M-x texinfo-insert-@@var
190442660Smarkm@findex texinfo-insert-@@var
190542660SmarkmInsert @code{@@var@{@}} and put the
190642660Smarkmcursor between the braces.@refill
190742660Smarkm
190842660Smarkm@item  C-c C-c x
190942660Smarkm@itemx M-x texinfo-insert-@@example
191042660Smarkm@findex texinfo-insert-@@example
191142660SmarkmInsert @code{@@example} and put the
191242660Smarkmcursor at the beginning of the next line.@refill
191342660Smarkm
191442660Smarkm@c M-@{  was the binding for texinfo-insert-braces;
191542660Smarkm@c in Emacs 19, backward-paragraph will take this binding.
191642660Smarkm@item C-c C-c @{
191742660Smarkm@itemx M-x texinfo-insert-braces
191842660Smarkm@findex texinfo-insert-braces
191942660SmarkmInsert @code{@{@}} and put the cursor between the braces.@refill
192042660Smarkm
192142660Smarkm@item C-c C-c @}
192242660Smarkm@itemx C-c C-c ]
192342660Smarkm@itemx M-x up-list
192442660Smarkm@findex up-list
192542660SmarkmMove from between a pair of braces forward past the closing brace.
192642660SmarkmTyping @kbd{C-c C-c ]} is easier than typing @kbd{C-c C-c @}}, which
192742660Smarkmis, however, more mnemonic; hence the two keybindings.  (Also, you can
192842660Smarkmmove out from between braces by typing @kbd{C-f}.)@refill
192942660Smarkm@end table
193042660Smarkm
193142660SmarkmTo put a command such as @w{@code{@@code@{@dots{}@}}} around an
193242660Smarkm@emph{existing} word, position the cursor in front of the word and type
193342660Smarkm@kbd{C-u 1 C-c C-c c}.  This makes it easy to edit existing plain text.
193442660SmarkmThe value of the prefix argument tells Emacs how many words following
193542660Smarkmpoint to include between braces---@samp{1} for one word, @samp{2} for
193642660Smarkmtwo words, and so on.  Use a negative argument to enclose the previous
193742660Smarkmword or words.  If you do not specify a prefix argument, Emacs inserts
193842660Smarkmthe @@-command string and positions the cursor between the braces.  This
193942660Smarkmfeature works only for those @@-commands that operate on a word or words
194042660Smarkmwithin one line, such as @code{@@kbd} and @code{@@var}.@refill
194142660Smarkm
194242660SmarkmThis set of insert commands was created after analyzing the frequency
194342660Smarkmwith which different @@-commands are used in the @cite{GNU Emacs
194442660SmarkmManual} and the @cite{GDB Manual}.  If you wish to add your own insert
194542660Smarkmcommands, you can bind a keyboard macro to a key, use abbreviations,
194642660Smarkmor extend the code in @file{texinfo.el}.@refill
194742660Smarkm
194842660Smarkm@findex texinfo-start-menu-description
194942660Smarkm@cindex Menu description, start
195042660Smarkm@cindex Description for menu, start
195142660Smarkm@kbd{C-c C-c C-d} (@code{texinfo-start-menu-description}) is an insert
195242660Smarkmcommand that works differently from the other insert commands.  It
195342660Smarkminserts a node's section or chapter title in the space for the
195442660Smarkmdescription in a menu entry line.  (A menu entry has three parts, the
195542660Smarkmentry name, the node name, and the description.  Only the node name is
195642660Smarkmrequired, but a description helps explain what the node is about.
195742660Smarkm@xref{Menu Parts, , The Parts of a Menu}.)@refill
195842660Smarkm
195942660SmarkmTo use @code{texinfo-start-menu-description}, position point in a menu
196042660Smarkmentry line and type @kbd{C-c C-c C-d}.  The command looks for and copies
196142660Smarkmthe title that goes with the node name, and inserts the title as a
196242660Smarkmdescription; it positions point at beginning of the inserted text so you
196342660Smarkmcan edit it.  The function does not insert the title if the menu entry
196442660Smarkmline already contains a description.@refill
196542660Smarkm
196642660SmarkmThis command is only an aid to writing descriptions; it does not do the
196742660Smarkmwhole job.  You must edit the inserted text since a title tends to use
196842660Smarkmthe same words as a node name but a useful description uses different
196942660Smarkmwords.@refill
197042660Smarkm
1971146515Sru@node Showing the Structure
197242660Smarkm@comment  node-name,  next,  previous,  up
197342660Smarkm@section Showing the Section Structure of a File
197442660Smarkm@cindex Showing the section structure of a file
197542660Smarkm@cindex Section structure of a file, showing it
197642660Smarkm@cindex Structure of a file, showing it
197742660Smarkm@cindex Outline of file structure, showing it
197842660Smarkm@cindex Contents-like outline of file structure
197942660Smarkm@cindex File section structure, showing it
198042660Smarkm@cindex Texinfo file section structure, showing it
198142660Smarkm
198242660SmarkmYou can show the section structure of a Texinfo file by using the
198342660Smarkm@kbd{C-c C-s} command (@code{texinfo-show-structure}).  This command
198442660Smarkmshows the section structure of a Texinfo file by listing the lines
198542660Smarkmthat begin with the @@-commands for @code{@@chapter},
198642660Smarkm@code{@@section}, and the like.  It constructs what amounts
198742660Smarkmto a table of contents.  These lines are displayed in another buffer
198842660Smarkmcalled the @samp{*Occur*} buffer.  In that buffer, you can position
198942660Smarkmthe cursor over one of the lines and use the @kbd{C-c C-c} command
199042660Smarkm(@code{occur-mode-goto-occurrence}), to jump to the corresponding spot
199142660Smarkmin the Texinfo file.@refill
199242660Smarkm
199342660Smarkm@table @kbd
199442660Smarkm@item  C-c C-s
199542660Smarkm@itemx M-x texinfo-show-structure
199642660Smarkm@findex texinfo-show-structure
199742660SmarkmShow the @code{@@chapter}, @code{@@section}, and such lines of a
199842660SmarkmTexinfo file.@refill
199942660Smarkm
200042660Smarkm@item  C-c C-c
200142660Smarkm@itemx M-x occur-mode-goto-occurrence
200242660Smarkm@findex occur-mode-goto-occurrence
200342660SmarkmGo to the line in the Texinfo file corresponding to the line under the
200442660Smarkmcursor in the @file{*Occur*} buffer.@refill
200542660Smarkm@end table
200642660Smarkm
200742660SmarkmIf you call @code{texinfo-show-structure} with a prefix argument by
200842660Smarkmtyping @w{@kbd{C-u C-c C-s}}, it will list not only those lines with the
200956160Sru@@-commands for @code{@@chapter}, @code{@@section}, and the like, but
201056160Srualso the @code{@@node} lines.  You can use @code{texinfo-show-structure}
201156160Sruwith a prefix argument to check whether the `Next', `Previous', and `Up'
201256160Srupointers of an @code{@@node} line are correct.
201342660Smarkm
201442660SmarkmOften, when you are working on a manual, you will be interested only
201542660Smarkmin the structure of the current chapter.  In this case, you can mark
201642660Smarkmoff the region of the buffer that you are interested in by using the
201742660Smarkm@kbd{C-x n n} (@code{narrow-to-region}) command and
201842660Smarkm@code{texinfo-show-structure} will work on only that region.  To see
201942660Smarkmthe whole buffer again, use @w{@kbd{C-x n w}} (@code{widen}).
202042660Smarkm(@xref{Narrowing, , , emacs, The GNU Emacs Manual}, for more
202142660Smarkminformation about the narrowing commands.)@refill
202242660Smarkm
202342660Smarkm@vindex page-delimiter
202442660Smarkm@cindex Page delimiter in Texinfo mode
202542660SmarkmIn addition to providing the @code{texinfo-show-structure} command,
202642660SmarkmTexinfo mode sets the value of the page delimiter variable to match
202742660Smarkmthe chapter-level @@-commands.  This enables you to use the @kbd{C-x
202842660Smarkm]} (@code{forward-page}) and @kbd{C-x [} (@code{backward-page})
202942660Smarkmcommands to move forward and backward by chapter, and to use the
203042660Smarkm@kbd{C-x p} (@code{narrow-to-page}) command to narrow to a chapter.
203142660Smarkm@xref{Pages, , , emacs, The GNU Emacs Manual}, for more information
203242660Smarkmabout the page commands.@refill
203342660Smarkm
2034146515Sru@node Updating Nodes and Menus
203542660Smarkm@comment  node-name,  next,  previous,  up
203642660Smarkm@section Updating Nodes and Menus
203742660Smarkm@cindex Updating nodes and menus
203842660Smarkm@cindex Create nodes, menus automatically
203942660Smarkm@cindex Insert nodes, menus automatically
204042660Smarkm@cindex Automatically insert nodes, menus
204142660Smarkm
204242660SmarkmTexinfo mode provides commands for automatically creating or updating
204342660Smarkmmenus and node pointers.  The commands are called ``update'' commands
204493139Srubecause their most frequent use is for updating a Texinfo file after you
204593139Sruhave worked on it; but you can use them to insert the `Next',
204693139Sru`Previous', and `Up' pointers into an @code{@@node} line that has none
204793139Sruand to create menus in a file that has none.
204842660Smarkm
204942660SmarkmIf you do not use the updating commands, you need to write menus and
205042660Smarkmnode pointers by hand, which is a tedious task.@refill
205142660Smarkm
205242660Smarkm@menu
205342660Smarkm* Updating Commands::           Five major updating commands.
205442660Smarkm* Updating Requirements::       How to structure a Texinfo file for
205542660Smarkm                                  using the updating command.
205642660Smarkm* Other Updating Commands::     How to indent descriptions, insert
205742660Smarkm                                  missing nodes lines, and update
205842660Smarkm                                  nodes in sequence.
205942660Smarkm@end menu
206042660Smarkm
2061146515Sru@node Updating Commands
2062146515Sru@subsection The Updating Commands
206342660Smarkm
206456160SruYou can use the updating commands to:@refill
206542660Smarkm
206642660Smarkm@itemize @bullet
206742660Smarkm@item
206856160Sruinsert or update the `Next', `Previous', and `Up' pointers of a
206942660Smarkmnode,@refill
207042660Smarkm
207142660Smarkm@item
207256160Sruinsert or update the menu for a section, and@refill
207342660Smarkm
207442660Smarkm@item
207556160Srucreate a master menu for a Texinfo source file.@refill
207642660Smarkm@end itemize
207742660Smarkm
207842660SmarkmYou can also use the commands to update all the nodes and menus in a
207942660Smarkmregion or in a whole Texinfo file.@refill
208042660Smarkm
208142660SmarkmThe updating commands work only with conventional Texinfo files, which
208242660Smarkmare structured hierarchically like books.  In such files, a structuring
208342660Smarkmcommand line must follow closely after each @code{@@node} line, except
208442660Smarkmfor the `Top' @code{@@node} line.  (A @dfn{structuring command line} is
208542660Smarkma line beginning with @code{@@chapter}, @code{@@section}, or other
208642660Smarkmsimilar command.)
208742660Smarkm
208842660SmarkmYou can write the structuring command line on the line that follows
208942660Smarkmimmediately after an @code{@@node} line or else on the line that
209042660Smarkmfollows after a single @code{@@comment} line or a single
209142660Smarkm@code{@@ifinfo} line.  You cannot interpose more than one line between
209242660Smarkmthe @code{@@node} line and the structuring command line; and you may
209342660Smarkminterpose only an @code{@@comment} line or an @code{@@ifinfo} line.
209442660Smarkm
209542660SmarkmCommands which work on a whole buffer require that the `Top' node be
209642660Smarkmfollowed by a node with an @code{@@chapter} or equivalent-level command.
209756160SruThe menu updating commands will not create a main or master menu for a
209856160SruTexinfo file that has only @code{@@chapter}-level nodes!  The menu
209956160Sruupdating commands only create menus @emph{within} nodes for lower level
210042660Smarkmnodes.  To create a menu of chapters, you must provide a `Top'
210156160Srunode.
210242660Smarkm
210342660SmarkmThe menu updating commands remove menu entries that refer to other Info
210442660Smarkmfiles since they do not refer to nodes within the current buffer.  This
210542660Smarkmis a deficiency.  Rather than use menu entries, you can use cross
210642660Smarkmreferences to refer to other Info files.  None of the updating commands
210742660Smarkmaffect cross references.@refill
210842660Smarkm
210942660SmarkmTexinfo mode has five updating commands that are used most often: two
211042660Smarkmare for updating the node pointers or menu of a single node (or a
211142660Smarkmregion); two are for updating every node pointer and menu in a file;
211242660Smarkmand one, the @code{texinfo-master-menu} command, is for creating a
211342660Smarkmmaster menu for a complete file, and optionally, for updating every
211442660Smarkmnode and menu in the whole Texinfo file.@refill
211542660Smarkm
211642660SmarkmThe @code{texinfo-master-menu} command is the primary command:@refill
211742660Smarkm
211842660Smarkm@table @kbd
211942660Smarkm@item C-c C-u m
212042660Smarkm@itemx M-x texinfo-master-menu
212142660Smarkm@findex texinfo-master-menu
212242660SmarkmCreate or update a master menu that includes all the other menus
212342660Smarkm(incorporating the descriptions from pre-existing menus, if
212442660Smarkmany).@refill
212542660Smarkm
212642660SmarkmWith an argument (prefix argument, @kbd{C-u,} if interactive), first create or
212742660Smarkmupdate all the nodes and all the regular menus in the buffer before
212842660Smarkmconstructing the master menu.  (@xref{The Top Node, , The Top Node and
212942660SmarkmMaster Menu}, for more about a master menu.)@refill
213042660Smarkm
213142660SmarkmFor @code{texinfo-master-menu} to work, the Texinfo file must have a
213242660Smarkm`Top' node and at least one subsequent node.@refill
213342660Smarkm
213442660SmarkmAfter extensively editing a Texinfo file, you can type the following:
213542660Smarkm
213642660Smarkm@example
213742660SmarkmC-u M-x texinfo-master-menu
213842660Smarkm@exdent or
213942660SmarkmC-u C-c C-u m
214042660Smarkm@end example
214142660Smarkm
214242660Smarkm@noindent
214342660SmarkmThis updates all the nodes and menus completely and all at once.@refill
214442660Smarkm@end table
214542660Smarkm
214642660SmarkmThe other major updating commands do smaller jobs and are designed for
214756160Sruthe person who updates nodes and menus as he or she writes a Texinfo
214842660Smarkmfile.@refill
214942660Smarkm
215042660Smarkm@need 1000
215142660SmarkmThe commands are:@refill
215242660Smarkm
215342660Smarkm@table @kbd
215442660Smarkm@item C-c C-u C-n
215542660Smarkm@itemx M-x texinfo-update-node
215642660Smarkm@findex texinfo-update-node
215742660SmarkmInsert the `Next', `Previous', and `Up' pointers for the node that point is
215842660Smarkmwithin (i.e., for the @code{@@node} line preceding point).  If the
215942660Smarkm@code{@@node} line has pre-existing `Next', `Previous', or `Up'
216042660Smarkmpointers in it, the old pointers are removed and new ones inserted.
216142660SmarkmWith an argument (prefix argument, @kbd{C-u}, if interactive), this command
216242660Smarkmupdates all @code{@@node} lines in the region (which is the text
216342660Smarkmbetween point and mark).@refill
216442660Smarkm
216542660Smarkm@item C-c C-u C-m
216642660Smarkm@itemx M-x texinfo-make-menu
216742660Smarkm@findex texinfo-make-menu
216842660SmarkmCreate or update the menu in the node that point is within.
216942660SmarkmWith an argument (@kbd{C-u} as prefix argument, if
217042660Smarkminteractive), the command makes or updates menus for the
217142660Smarkmnodes which are either within or a part of the
217242660Smarkmregion.@refill
217342660Smarkm
217442660SmarkmWhenever @code{texinfo-make-menu} updates an existing menu, the
217542660Smarkmdescriptions from that menu are incorporated into the new menu.  This
217642660Smarkmis done by copying descriptions from the existing menu to the entries
217742660Smarkmin the new menu that have the same node names.  If the node names are
217842660Smarkmdifferent, the descriptions are not copied to the new menu.@refill
217942660Smarkm
218042660Smarkm@item C-c C-u C-e
218142660Smarkm@itemx M-x texinfo-every-node-update
218242660Smarkm@findex texinfo-every-node-update
218342660SmarkmInsert or update the `Next', `Previous', and `Up' pointers for every
218442660Smarkmnode in the buffer.@refill
218542660Smarkm
218642660Smarkm@item C-c C-u C-a
218742660Smarkm@itemx M-x texinfo-all-menus-update
218842660Smarkm@findex texinfo-all-menus-update
218942660SmarkmCreate or update all the menus in the buffer.  With an argument
219042660Smarkm(@kbd{C-u} as prefix argument, if interactive), first insert
219142660Smarkmor update all the node
219242660Smarkmpointers before working on the menus.@refill
219342660Smarkm
219442660SmarkmIf a master menu exists, the @code{texinfo-all-menus-update} command
219542660Smarkmupdates it; but the command does not create a new master menu if none
219642660Smarkmalready exists.  (Use the @code{texinfo-master-menu} command for
219742660Smarkmthat.)@refill
219842660Smarkm
219942660SmarkmWhen working on a document that does not merit a master menu, you can
220042660Smarkmtype the following:
220142660Smarkm
220242660Smarkm@example
220342660SmarkmC-u C-c C-u C-a
220442660Smarkm@exdent or
220542660SmarkmC-u M-x texinfo-all-menus-update
220642660Smarkm@end example
220742660Smarkm
220842660Smarkm@noindent
220942660SmarkmThis updates all the nodes and menus.@refill
221042660Smarkm@end table
221142660Smarkm
221242660SmarkmThe @code{texinfo-column-for-description} variable specifies the
221342660Smarkmcolumn to which menu descriptions are indented.  By default, the value
221442660Smarkmis 32 although it is often useful to reduce it to as low as 24.  You
2215146515Srucan set the variable via customization (@pxref{Changing an Option,,,
2216146515Sruemacs, The GNU Emacs Manual}) or with the @kbd{M-x set-variable}
2217146515Srucommand (@pxref{Examining, , Examining and Setting Variables, emacs,
2218146515SruThe GNU Emacs Manual}).
221942660Smarkm
222042660SmarkmAlso, the @code{texinfo-indent-menu-description} command may be used to
222142660Smarkmindent existing menu descriptions to a specified column.  Finally, if
222242660Smarkmyou wish, you can use the @code{texinfo-insert-node-lines} command to
222342660Smarkminsert missing @code{@@node} lines into a file.  (@xref{Other Updating
222442660SmarkmCommands}, for more information.)@refill
222542660Smarkm
2226100513Sru@node Updating Requirements
222742660Smarkm@subsection Updating Requirements
222842660Smarkm@cindex Updating requirements
222942660Smarkm@cindex Requirements for updating commands
223042660Smarkm
223142660SmarkmTo use the updating commands, you must organize the Texinfo file
223242660Smarkmhierarchically with chapters, sections, subsections, and the like.
223342660SmarkmWhen you construct the hierarchy of the manual, do not `jump down'
223442660Smarkmmore than one level at a time: you can follow the `Top' node with a
223542660Smarkmchapter, but not with a section; you can follow a chapter with a
223642660Smarkmsection, but not with a subsection.  However, you may `jump up' any
223742660Smarkmnumber of levels at one time---for example, from a subsection to a
223842660Smarkmchapter.@refill
223942660Smarkm
224042660SmarkmEach @code{@@node} line, with the exception of the line for the `Top'
224142660Smarkmnode, must be followed by a line with a structuring command such as
224242660Smarkm@code{@@chapter}, @code{@@section}, or
224342660Smarkm@code{@@unnumberedsubsec}.@refill
224442660Smarkm
224542660SmarkmEach @code{@@node} line/structuring-command line combination
2246100513Srumust look either like this:
224742660Smarkm
224842660Smarkm@example
224942660Smarkm@group
225042660Smarkm@@node     Comments,  Minimum, Conventions, Overview
225142660Smarkm@@comment  node-name, next,    previous,    up
225242660Smarkm@@section Comments
225342660Smarkm@end group
225442660Smarkm@end example
225542660Smarkm
225642660Smarkmor like this (without the @code{@@comment} line):
225742660Smarkm
225842660Smarkm@example
225942660Smarkm@group
226042660Smarkm@@node Comments, Minimum, Conventions, Overview
226142660Smarkm@@section Comments
226242660Smarkm@end group
226342660Smarkm@end example
226442660Smarkm
2265100513Sruor like this (without the explicit node pointers):
2266100513Sru
2267100513Sru@example
2268100513Sru@group
2269100513Sru@@node Comments
2270100513Sru@@section Comments
2271100513Sru@end group
2272100513Sru@end example
2273100513Sru
227442660Smarkm@noindent
227542660SmarkmIn this example, `Comments' is the name of both the node and the
227642660Smarkmsection.  The next node is called `Minimum' and the previous node is
227742660Smarkmcalled `Conventions'.  The `Comments' section is within the `Overview'
227842660Smarkmnode, which is specified by the `Up' pointer.  (Instead of an
2279100513Sru@code{@@comment} line, you may also write an @code{@@ifinfo} line.)
228042660Smarkm
228142660SmarkmIf a file has a `Top' node, it must be called @samp{top} or @samp{Top}
2282100513Sruand be the first node in the file.
228342660Smarkm
228442660SmarkmThe menu updating commands create a menu of sections within a chapter,
228542660Smarkma menu of subsections within a section, and so on.  This means that
228642660Smarkmyou must have a `Top' node if you want a menu of chapters.@refill
228742660Smarkm
228856160SruIncidentally, the @code{makeinfo} command will create an Info file for a
228956160Sruhierarchically organized Texinfo file that lacks `Next', `Previous' and
229056160Sru`Up' pointers.  Thus, if you can be sure that your Texinfo file will be
229156160Sruformatted with @code{makeinfo}, you have no need for the update node
229256160Srucommands.  (@xref{Creating an Info File}, for more information about
229356160Sru@code{makeinfo}.)  However, both @code{makeinfo} and the
229456160Sru@code{texinfo-format-@dots{}} commands require that you insert menus in
229556160Sruthe file.
229642660Smarkm
2297100513Sru
2298100513Sru@node Other Updating Commands
229942660Smarkm@subsection Other Updating Commands
230042660Smarkm
230142660SmarkmIn addition to the five major updating commands, Texinfo mode
230242660Smarkmpossesses several less frequently used updating commands:@refill
230342660Smarkm
230442660Smarkm@table @kbd
230542660Smarkm@item M-x texinfo-insert-node-lines
230642660Smarkm@findex texinfo-insert-node-lines
230742660SmarkmInsert @code{@@node} lines before the @code{@@chapter},
230842660Smarkm@code{@@section}, and other sectioning commands wherever they are
230942660Smarkmmissing throughout a region in a Texinfo file.@refill
231042660Smarkm
231142660SmarkmWith an argument (@kbd{C-u} as prefix argument, if interactive), the
231242660Smarkm@code{texinfo-insert-node-lines} command not only inserts
231342660Smarkm@code{@@node} lines but also inserts the chapter or section titles as
231442660Smarkmthe names of the corresponding nodes.  In addition, it inserts the
231542660Smarkmtitles as node names in pre-existing @code{@@node} lines that lack
231642660Smarkmnames.  Since node names should be more concise than section or
231742660Smarkmchapter titles, you must manually edit node names so inserted.@refill
231842660Smarkm
231942660SmarkmFor example, the following marks a whole buffer as a region and inserts
232042660Smarkm@code{@@node} lines and titles throughout:@refill
232142660Smarkm
232242660Smarkm@example
232342660SmarkmC-x h C-u M-x texinfo-insert-node-lines
232442660Smarkm@end example
232542660Smarkm
232656160SruThis command inserts titles as node names in @code{@@node} lines; the
232756160Sru@code{texinfo-start-menu-description} command (@pxref{Inserting,
232856160SruInserting Frequently Used Commands}) inserts titles as descriptions in
232956160Srumenu entries, a different action.  However, in both cases, you need to
233056160Sruedit the inserted text.
233142660Smarkm
233242660Smarkm@item M-x texinfo-multiple-files-update
233342660Smarkm@findex texinfo-multiple-files-update @r{(in brief)}
233442660SmarkmUpdate nodes and menus in a document built from several separate files.
233542660SmarkmWith @kbd{C-u} as a prefix argument, create and insert a master menu in
233642660Smarkmthe outer file.  With a numeric prefix argument, such as @kbd{C-u 2}, first
233742660Smarkmupdate all the menus and all the `Next', `Previous', and `Up' pointers
233842660Smarkmof all the included files before creating and inserting a master menu in
233942660Smarkmthe outer file.  The @code{texinfo-multiple-files-update} command is
234042660Smarkmdescribed in the appendix on @code{@@include} files.
2341146515Sru@xref{texinfo-multiple-files-update}.
234242660Smarkm
234342660Smarkm@item M-x texinfo-indent-menu-description
234442660Smarkm@findex texinfo-indent-menu-description
234542660SmarkmIndent every description in the menu following point to the specified
234642660Smarkmcolumn.  You can use this command to give yourself more space for
234742660Smarkmdescriptions.  With an argument (@kbd{C-u} as prefix argument, if
234842660Smarkminteractive), the @code{texinfo-indent-menu-description} command indents
234942660Smarkmevery description in every menu in the region.  However, this command
235042660Smarkmdoes not indent the second and subsequent lines of a multi-line
235142660Smarkmdescription.@refill
235242660Smarkm
235342660Smarkm@item M-x texinfo-sequential-node-update
235442660Smarkm@findex texinfo-sequential-node-update
235542660SmarkmInsert the names of the nodes immediately following and preceding the
235642660Smarkmcurrent node as the `Next' or `Previous' pointers regardless of those
235742660Smarkmnodes' hierarchical level.  This means that the `Next' node of a
235842660Smarkmsubsection may well be the next chapter.  Sequentially ordered nodes are
235942660Smarkmuseful for novels and other documents that you read through
236042660Smarkmsequentially.  (However, in Info, the @kbd{g *} command lets
236142660Smarkmyou look through the file sequentially, so sequentially ordered nodes
236242660Smarkmare not strictly necessary.)  With an argument (prefix argument, if
236342660Smarkminteractive), the @code{texinfo-sequential-node-update} command
236442660Smarkmsequentially updates all the nodes in the region.@refill
236542660Smarkm@end table
236642660Smarkm
2367146515Sru@node Info Formatting
236842660Smarkm@comment  node-name,  next,  previous,  up
236942660Smarkm@section Formatting for Info
237042660Smarkm@cindex Formatting for Info
237142660Smarkm@cindex Running an Info formatter
237242660Smarkm@cindex Info formatting
237342660Smarkm
237442660SmarkmTexinfo mode provides several commands for formatting part or all of a
237542660SmarkmTexinfo file for Info.  Often, when you are writing a document, you
237642660Smarkmwant to format only part of a file---that is, a region.@refill
237742660Smarkm
237842660SmarkmYou can use either the @code{texinfo-format-region} or the
237942660Smarkm@code{makeinfo-region} command to format a region:@refill
238042660Smarkm
238142660Smarkm@table @kbd
238242660Smarkm@findex texinfo-format-region
238342660Smarkm@item  C-c C-e C-r
238442660Smarkm@itemx M-x texinfo-format-region
238542660Smarkm@itemx C-c C-m C-r
238642660Smarkm@itemx M-x makeinfo-region
238742660SmarkmFormat the current region for Info.@refill
238842660Smarkm@end table
238942660Smarkm
239042660SmarkmYou can use either the @code{texinfo-format-buffer} or the
239142660Smarkm@code{makeinfo-buffer} command to format a whole buffer:@refill
239242660Smarkm
239342660Smarkm@table @kbd
239442660Smarkm@findex texinfo-format-buffer
239542660Smarkm@item  C-c C-e C-b
239642660Smarkm@itemx M-x texinfo-format-buffer
239742660Smarkm@itemx C-c C-m C-b
239842660Smarkm@itemx M-x makeinfo-buffer
239942660SmarkmFormat the current buffer for Info.@refill
240042660Smarkm@end table
240142660Smarkm
240242660Smarkm@need 1000
240342660SmarkmFor example, after writing a Texinfo file, you can type the following:
240442660Smarkm
240542660Smarkm@example
240642660SmarkmC-u C-c C-u m
240742660Smarkm@exdent or
240842660SmarkmC-u M-x texinfo-master-menu
240942660Smarkm@end example
241042660Smarkm
241142660Smarkm@noindent
241242660SmarkmThis updates all the nodes and menus.  Then type the following to create
241342660Smarkman Info file:
241442660Smarkm
241542660Smarkm@example
241642660SmarkmC-c C-m C-b
241742660Smarkm@exdent or
241842660SmarkmM-x makeinfo-buffer
241942660Smarkm@end example
242042660Smarkm
242142660SmarkmFor @TeX{} or the Info formatting commands to work, the file @emph{must}
2422100513Sruinclude a line that has @code{@@setfilename} in its header.
242342660Smarkm
242456160Sru@xref{Creating an Info File}, for details about Info formatting.@refill
242542660Smarkm
2426146515Sru@node Printing
242742660Smarkm@comment node-name,  next,  previous,  up
2428146515Sru@section Printing
242942660Smarkm@cindex Formatting for printing
243042660Smarkm@cindex Printing a region or buffer
243142660Smarkm@cindex Region formatting and printing
243242660Smarkm@cindex Buffer formatting and printing
243342660Smarkm@cindex Part of file formatting and printing
243442660Smarkm
243542660SmarkmTypesetting and printing a Texinfo file is a multi-step process in which
243642660Smarkmyou first create a file for printing (called a DVI file), and then
243742660Smarkmprint the file.  Optionally, you may also create indices.  To do this,
243842660Smarkmyou must run the @code{texindex} command after first running the
243942660Smarkm@code{tex} typesetting command; and then you must run the @code{tex}
244042660Smarkmcommand again.  Or else run the @code{texi2dvi} command which
244142660Smarkmautomatically creates indices as needed (@pxref{Format with texi2dvi}).
244242660Smarkm
244342660SmarkmOften, when you are writing a document, you want to typeset and print
244442660Smarkmonly part of a file to see what it will look like.  You can use the
244542660Smarkm@code{texinfo-tex-region} and related commands for this purpose.  Use
244642660Smarkmthe @code{texinfo-tex-buffer} command to format all of a
244742660Smarkmbuffer.@refill
244842660Smarkm
244942660Smarkm@table @kbd
245042660Smarkm@item  C-c C-t C-b
245142660Smarkm@itemx M-x texinfo-tex-buffer
245242660Smarkm@findex texinfo-tex-buffer
245342660SmarkmRun @code{texi2dvi} on the buffer.  In addition to running @TeX{} on the
245442660Smarkmbuffer, this command automatically creates or updates indices as
245542660Smarkmneeded.@refill
245642660Smarkm
245742660Smarkm@item  C-c C-t C-r
245842660Smarkm@itemx M-x texinfo-tex-region
245942660Smarkm@findex texinfo-tex-region
246042660SmarkmRun @TeX{} on the region.@refill
246142660Smarkm
246242660Smarkm@item C-c C-t C-i
246342660Smarkm@itemx M-x texinfo-texindex
246442660SmarkmRun @code{texindex} to sort the indices of a Texinfo file formatted with
246542660Smarkm@code{texinfo-tex-region}.  The @code{texinfo-tex-region} command does
246642660Smarkmnot run @code{texindex} automatically; it only runs the @code{tex}
246742660Smarkmtypesetting command.  You must run the @code{texinfo-tex-region} command
246842660Smarkma second time after sorting the raw index files with the @code{texindex}
246942660Smarkmcommand.  (Usually, you do not format an index when you format a region,
247042660Smarkmonly when you format a buffer.  Now that the @code{texi2dvi} command
247142660Smarkmexists, there is little or no need for this command.)@refill
247242660Smarkm
247342660Smarkm@item C-c C-t C-p
247442660Smarkm@itemx M-x texinfo-tex-print
247542660Smarkm@findex texinfo-tex-print
247642660SmarkmPrint the file (or the part of the file) previously formatted with
247742660Smarkm@code{texinfo-tex-buffer} or @code{texinfo-tex-region}.@refill
247842660Smarkm@end table
247942660Smarkm
248042660SmarkmFor @code{texinfo-tex-region} or @code{texinfo-tex-buffer} to work, the
248142660Smarkmfile @emph{must} start with a @samp{\input texinfo} line and must
248242660Smarkminclude an @code{@@settitle} line.  The file must end with @code{@@bye}
248342660Smarkmon a line by itself.  (When you use @code{texinfo-tex-region}, you must
248442660Smarkmsurround the @code{@@settitle} line with start-of-header and
248542660Smarkmend-of-header lines.)@refill
248642660Smarkm
248756160Sru@xref{Hardcopy}, for a description of the other @TeX{} related
248842660Smarkmcommands, such as @code{tex-show-print-queue}.@refill
248942660Smarkm
2490146515Sru@node Texinfo Mode Summary
249142660Smarkm@comment  node-name,  next,  previous,  up
249242660Smarkm@section Texinfo Mode Summary
249342660Smarkm
249442660SmarkmIn Texinfo mode, each set of commands has default keybindings that
249542660Smarkmbegin with the same keys.  All the commands that are custom-created
249642660Smarkmfor Texinfo mode begin with @kbd{C-c}.  The keys are somewhat
249742660Smarkmmnemonic.@refill
249842660Smarkm
249942660Smarkm@subheading Insert Commands
250042660Smarkm
250142660SmarkmThe insert commands are invoked by typing @kbd{C-c} twice and then the
250242660Smarkmfirst letter of the @@-command to be inserted.  (It might make more
250342660Smarkmsense mnemonically to use @kbd{C-c C-i}, for `custom insert', but
250442660Smarkm@kbd{C-c C-c} is quick to type.)@refill
250542660Smarkm
250642660Smarkm@example
250742660SmarkmC-c C-c c       @r{Insert} @samp{@@code}.
250842660SmarkmC-c C-c d       @r{Insert} @samp{@@dfn}.
250942660SmarkmC-c C-c e       @r{Insert} @samp{@@end}.
251042660SmarkmC-c C-c i       @r{Insert} @samp{@@item}.
251142660SmarkmC-c C-c n       @r{Insert} @samp{@@node}.
251242660SmarkmC-c C-c s       @r{Insert} @samp{@@samp}.
251342660SmarkmC-c C-c v       @r{Insert} @samp{@@var}.
251442660SmarkmC-c C-c @{       @r{Insert braces.}
251542660SmarkmC-c C-c ]
251642660SmarkmC-c C-c @}       @r{Move out of enclosing braces.}
251742660Smarkm
251842660Smarkm@group
251942660SmarkmC-c C-c C-d     @r{Insert a node's section title}
2520114472Sru               @r{in the space for the description}
2521114472Sru               @r{in a menu entry line.}
252242660Smarkm@end group
252342660Smarkm@end example
252442660Smarkm
252542660Smarkm@subheading Show Structure
252642660Smarkm
252742660SmarkmThe @code{texinfo-show-structure} command is often used within a
252842660Smarkmnarrowed region.@refill
252942660Smarkm
253042660Smarkm@example
253142660SmarkmC-c C-s         @r{List all the headings.}
253242660Smarkm@end example
253342660Smarkm
253442660Smarkm@subheading The Master Update Command
253542660Smarkm
253642660SmarkmThe @code{texinfo-master-menu} command creates a master menu; and can
253742660Smarkmbe used to update every node and menu in a file as well.@refill
253842660Smarkm
253956160Sru@c Probably should use @tables in this section.
254042660Smarkm@example
254142660Smarkm@group
254242660SmarkmC-c C-u m
254342660SmarkmM-x texinfo-master-menu
2544114472Sru               @r{Create or update a master menu.}
254542660Smarkm@end group
254642660Smarkm
254742660Smarkm@group
254842660SmarkmC-u C-c C-u m   @r{With @kbd{C-u} as a prefix argument, first}
2549114472Sru               @r{create or update all nodes and regular}
2550114472Sru               @r{menus, and then create a master menu.}
255142660Smarkm@end group
255242660Smarkm@end example
255342660Smarkm
255442660Smarkm@subheading Update Pointers
255542660Smarkm
255642660SmarkmThe update pointer commands are invoked by typing @kbd{C-c C-u} and
255742660Smarkmthen either @kbd{C-n} for @code{texinfo-update-node} or @kbd{C-e} for
255842660Smarkm@code{texinfo-every-node-update}.@refill
255942660Smarkm
256042660Smarkm@example
256142660SmarkmC-c C-u C-n     @r{Update a node.}
256242660SmarkmC-c C-u C-e     @r{Update every node in the buffer.}
256342660Smarkm@end example
256442660Smarkm
256542660Smarkm@subheading Update Menus
256642660Smarkm
256742660SmarkmInvoke the  update menu commands by typing @kbd{C-c C-u}
256842660Smarkmand then either @kbd{C-m} for @code{texinfo-make-menu} or
256942660Smarkm@kbd{C-a} for @code{texinfo-all-menus-update}.  To update
257042660Smarkmboth nodes and menus at the same time, precede @kbd{C-c C-u
257142660SmarkmC-a} with @kbd{C-u}.@refill
257242660Smarkm
257342660Smarkm@example
257442660SmarkmC-c C-u C-m     @r{Make or update a menu.}
257542660Smarkm
257642660Smarkm@group
257742660SmarkmC-c C-u C-a     @r{Make or update all}
2578114472Sru               @r{menus in a buffer.}
257942660Smarkm@end group
258042660Smarkm
258142660Smarkm@group
258242660SmarkmC-u C-c C-u C-a @r{With @kbd{C-u} as a prefix argument,}
2583114472Sru               @r{first create or update all nodes and}
2584114472Sru               @r{then create or update all menus.}
258542660Smarkm@end group
258642660Smarkm@end example
258742660Smarkm
258842660Smarkm@subheading Format for Info
258942660Smarkm
259042660SmarkmThe Info formatting commands that are written in Emacs Lisp are
259142660Smarkminvoked by typing @kbd{C-c C-e} and then either @kbd{C-r} for a region
259242660Smarkmor @kbd{C-b} for the whole buffer.@refill
259342660Smarkm
259442660SmarkmThe Info formatting commands that are written in C and based on the
259542660Smarkm@code{makeinfo} program are invoked by typing @kbd{C-c C-m} and then
259642660Smarkmeither @kbd{C-r} for a region or @kbd{C-b} for the whole buffer.@refill
259742660Smarkm
259842660Smarkm@need 800
259942660Smarkm@noindent
260042660SmarkmUse the @code{texinfo-format@dots{}} commands:
260142660Smarkm
260242660Smarkm@example
260342660Smarkm@group
260442660SmarkmC-c C-e C-r     @r{Format the region.}
260542660SmarkmC-c C-e C-b     @r{Format the buffer.}
260642660Smarkm@end group
260742660Smarkm@end example
260842660Smarkm
260942660Smarkm@need 750
261042660Smarkm@noindent
261142660SmarkmUse @code{makeinfo}:
261242660Smarkm
261342660Smarkm@example
261442660SmarkmC-c C-m C-r     @r{Format the region.}
261542660SmarkmC-c C-m C-b     @r{Format the buffer.}
261642660SmarkmC-c C-m C-l     @r{Recenter the @code{makeinfo} output buffer.}
261742660SmarkmC-c C-m C-k     @r{Kill the @code{makeinfo} formatting job.}
261842660Smarkm@end example
261942660Smarkm
262042660Smarkm@subheading Typeset and Print
262142660Smarkm
262242660SmarkmThe @TeX{} typesetting and printing commands are invoked by typing
262342660Smarkm@kbd{C-c C-t} and then another control command: @kbd{C-r} for
262442660Smarkm@code{texinfo-tex-region}, @kbd{C-b} for @code{texinfo-tex-buffer},
262542660Smarkmand so on.@refill
262642660Smarkm
262742660Smarkm@example
262842660SmarkmC-c C-t C-r     @r{Run @TeX{} on the region.}
262942660SmarkmC-c C-t C-b     @r{Run} @code{texi2dvi} @r{on the buffer.}
263042660SmarkmC-c C-t C-i     @r{Run} @code{texindex}.
263142660SmarkmC-c C-t C-p     @r{Print the DVI file.}
263242660SmarkmC-c C-t C-q     @r{Show the print queue.}
263342660SmarkmC-c C-t C-d     @r{Delete a job from the print queue.}
263442660SmarkmC-c C-t C-k     @r{Kill the current @TeX{} formatting job.}
263542660SmarkmC-c C-t C-x     @r{Quit a currently stopped @TeX{} formatting job.}
263642660SmarkmC-c C-t C-l     @r{Recenter the output buffer.}
263742660Smarkm@end example
263842660Smarkm
263942660Smarkm@subheading Other Updating Commands
264042660Smarkm
264156160SruThe remaining updating commands do not have standard keybindings because
264242660Smarkmthey are rarely used.
264342660Smarkm
264442660Smarkm@example
264542660Smarkm@group
264642660SmarkmM-x texinfo-insert-node-lines
2647114472Sru               @r{Insert missing @code{@@node} lines in region.}
2648114472Sru               @r{With @kbd{C-u} as a prefix argument,}
2649114472Sru               @r{use section titles as node names.}
265042660Smarkm@end group
265142660Smarkm
265242660Smarkm@group
265342660SmarkmM-x texinfo-multiple-files-update
2654114472Sru               @r{Update a multi-file document.}
2655114472Sru               @r{With @kbd{C-u 2} as a prefix argument,}
2656114472Sru               @r{create or update all nodes and menus}
2657114472Sru               @r{in all included files first.}
265842660Smarkm@end group
265942660Smarkm
266042660Smarkm@group
266142660SmarkmM-x texinfo-indent-menu-description
2662114472Sru               @r{Indent descriptions.}
266342660Smarkm@end group
266442660Smarkm
266542660Smarkm@group
266642660SmarkmM-x texinfo-sequential-node-update
2667114472Sru               @r{Insert node pointers in strict sequence.}
266842660Smarkm@end group
266942660Smarkm@end example
267042660Smarkm
2671100513Sru
267293139Sru@node Beginning a File
267342660Smarkm@chapter Beginning a Texinfo File
267442660Smarkm@cindex Beginning a Texinfo file
267542660Smarkm@cindex Texinfo file beginning
267642660Smarkm@cindex File beginning
267742660Smarkm
267842660SmarkmCertain pieces of information must be provided at the beginning of a
2679100513SruTexinfo file, such as the name for the output file(s), the title of the
2680116525Srudocument, and the Top node.  A table of contents is also generally
2681116525Sruproduced here.
268242660Smarkm
2683100513SruThis chapter expands on the minimal complete Texinfo source file
2684146515Srupreviously given (@pxref{Six Parts}).  It describes the numerous
2685146515Srucommands for handling the traditional frontmatter items in Texinfo.
2686100513Sru
2687146515Sru@cindex Frontmatter, text in
2688146515SruStraight text outside of any command before the Top node should be
2689146515Sruavoided.  Such text is treated differently in the different output
2690146515Sruformats: visible in @TeX{} and HTML, by default not shown in Info
2691146515Srureaders, and so on.
2692146515Sru
269342660Smarkm@menu
2694100513Sru* Sample Beginning::            A sample beginning for a Texinfo file.
2695100513Sru* Texinfo File Header::         The first lines.
2696100513Sru* Document Permissions::        Ensuring your manual is free.
269742660Smarkm* Titlepage & Copyright Page::  Creating the title and copyright pages.
2698116525Sru* Contents::                    How to create a table of contents.
269942660Smarkm* The Top Node::                Creating the `Top' node and master menu.
2700100513Sru* Global Document Commands::    Affecting formatting throughout.
270142660Smarkm* Software Copying Permissions::  Ensure that you and others continue to
2702114472Sru                                   have the right to use and share software.
270342660Smarkm@end menu
270442660Smarkm
270542660Smarkm
2706100513Sru@node Sample Beginning
2707100513Sru@section Sample Texinfo File Beginning
270842660Smarkm
2709116525Sru@cindex Example beginning of Texinfo file
271042660Smarkm
2711100513SruThe following sample shows what is needed.  The elements given here are
2712100513Sruexplained in more detail in the following sections.  Other commands are
2713100513Sruoften included at the beginning of Texinfo files, but the ones here are
2714100513Sruthe most critical.
271542660Smarkm
2716100513Sru@xref{GNU Sample Texts}, for the full texts to be used in GNU manuals.
271742660Smarkm
271842660Smarkm@example
271942660Smarkm\input texinfo   @@c -*-texinfo-*-
272042660Smarkm@@c %**start of header
2721100513Sru@@setfilename @var{infoname}.info
2722100513Sru@@settitle @var{name-of-manual} @var{version}
272342660Smarkm@@c %**end of header
272442660Smarkm
2725100513Sru@@copying
2726100513SruThis manual is for @var{program}, version @var{version}.
272742660Smarkm
2728100513SruCopyright @@copyright@{@} @var{years} @var{copyright-owner}.
272942660Smarkm
273042660Smarkm@group
2731100513Sru@@quotation
273242660SmarkmPermission is granted to @dots{}
2733100513Sru@@end quotation
2734100513Sru@@end copying
273542660Smarkm@end group
273642660Smarkm
273742660Smarkm@group
273842660Smarkm@@titlepage
273942660Smarkm@@title @var{name-of-manual-when-printed}
274042660Smarkm@@subtitle @var{subtitle-if-any}
274142660Smarkm@@subtitle @var{second-subtitle}
274242660Smarkm@@author @var{author}
274342660Smarkm@end group
274442660Smarkm
274542660Smarkm@group
274642660Smarkm@@c  The following two commands
274742660Smarkm@@c  start the copyright page.
274842660Smarkm@@page
274942660Smarkm@@vskip 0pt plus 1filll
2750100513Sru@@insertcopying
275142660Smarkm@end group
275242660Smarkm
275342660SmarkmPublished by @dots{}
275442660Smarkm@@end titlepage
275542660Smarkm
2756116525Sru@@c So the toc is printed at the start.
2757100513Sru@@contents
2758100513Sru
275993139Sru@@ifnottex
276093139Sru@@node Top
276193139Sru@@top @var{title}
276242660Smarkm
2763100513Sru@@insertcopying
276493139Sru@@end ifnottex
276542660Smarkm
276642660Smarkm@group
276742660Smarkm@@menu
276842660Smarkm* First Chapter::    Getting started @dots{}
2769100513Sru* Second Chapter::          @dots{}
2770114472Sru @dots{}
2771100513Sru* Copying::          Your rights and freedoms.
277242660Smarkm@@end menu
277342660Smarkm@end group
277442660Smarkm
277542660Smarkm@group
2776100513Sru@@node First Chapter
277742660Smarkm@@chapter First Chapter
2778100513Sru
2779100513Sru@@cindex first chapter
2780100513Sru@@cindex chapter, first
2781100513Sru@dots{}
278242660Smarkm@end group
278342660Smarkm@end example
278442660Smarkm
278593139Sru
2786100513Sru@node Texinfo File Header
2787100513Sru@section Texinfo File Header
278842660Smarkm@cindex Header for Texinfo files
278942660Smarkm@cindex Texinfo file header
279042660Smarkm
279142660SmarkmTexinfo files start with at least three lines that provide Info and
279293139Sru@TeX{} with necessary information.  These are the @code{\input texinfo}
2793100513Sruline, the @code{@@settitle} line, and the @code{@@setfilename} line.
2794100513Sru
2795100513SruAlso, if you want to format just part of the Texinfo file, you must
279693139Sruwrite the @code{@@settitle} and @code{@@setfilename} lines between
2797100513Srustart-of-header and end-of-header lines.  The start- and end-of-header
2798100513Srulines are optional, but they do no harm, so you might as well always
2799100513Sruinclude them.
280042660Smarkm
2801100513SruAny command that affects document formatting as a whole makes sense to
2802100513Sruinclude in the header.  @code{@@synindex} (@pxref{synindex}), for
2803100513Sruinstance, is another command often included in the header.  @xref{GNU
2804100513SruSample Texts}, for complete sample texts.
280542660Smarkm
2806100513SruThus, the beginning of a Texinfo file generally looks like this:
280742660Smarkm
280842660Smarkm@example
280942660Smarkm@group
281042660Smarkm\input texinfo   @@c -*-texinfo-*-
281142660Smarkm@@c %**start of header
281242660Smarkm@@setfilename sample.info
2813100513Sru@@settitle Sample Manual 1.0
281442660Smarkm@@c %**end of header
281542660Smarkm@end group
281642660Smarkm@end example
281742660Smarkm
281842660Smarkm@menu
281942660Smarkm* First Line::                  The first line of a Texinfo file.
282042660Smarkm* Start of Header::             Formatting a region requires this.
282142660Smarkm* setfilename::                 Tell Info the name of the Info file.
282242660Smarkm* settitle::                    Create a title for the printed work.
282342660Smarkm* End of Header::               Formatting a region requires this.
282442660Smarkm@end menu
282542660Smarkm
282656160Sru
282756160Sru@node First Line
282842660Smarkm@subsection The First Line of a Texinfo File
282942660Smarkm@cindex First line of a Texinfo file
283042660Smarkm@cindex Beginning line of a Texinfo file
283142660Smarkm@cindex Header of a Texinfo file
283242660Smarkm
283342660SmarkmEvery Texinfo file that is to be the top-level input to @TeX{} must begin
2834100513Sruwith a line that looks like this:
283542660Smarkm
283642660Smarkm@example
283742660Smarkm\input texinfo   @@c -*-texinfo-*-
283842660Smarkm@end example
283942660Smarkm
284042660Smarkm@noindent
284142660SmarkmThis line serves two functions:
284242660Smarkm
284342660Smarkm@enumerate
284442660Smarkm@item
284542660SmarkmWhen the file is processed by @TeX{}, the @samp{\input texinfo} command
284642660Smarkmtells @TeX{} to load the macros needed for processing a Texinfo file.
2847100513SruThese are in a file called @file{texinfo.tex}, which should have been
2848100513Sruinstalled on your system along with either the @TeX{} or Texinfo
2849100513Srusoftware.  @TeX{} uses the backslash, @samp{\}, to mark the beginning of
2850100513Srua command, exactly as Texinfo uses @samp{@@}.  The @file{texinfo.tex}
2851100513Srufile causes the switch from @samp{\} to @samp{@@}; before the switch
2852100513Sruoccurs, @TeX{} requires @samp{\}, which is why it appears at the
2853100513Srubeginning of the file.
285442660Smarkm
285542660Smarkm@item
285642660SmarkmWhen the file is edited in GNU Emacs, the @samp{-*-texinfo-*-} mode
2857100513Sruspecification tells Emacs to use Texinfo mode.
285842660Smarkm@end enumerate
285942660Smarkm
286093139Sru
286193139Sru@node Start of Header
286242660Smarkm@subsection Start of Header
286342660Smarkm@cindex Start of header line
286442660Smarkm
2865100513SruA start-of-header line is a Texinfo comment that looks like this:
286642660Smarkm
286742660Smarkm@example
286842660Smarkm@@c %**start of header
286942660Smarkm@end example
287042660Smarkm
2871100513SruWrite the start-of-header line on the second line of a Texinfo file.
2872100513SruFollow the start-of-header line with @code{@@setfilename} and
2873100513Sru@code{@@settitle} lines and, optionally, with other commands that
2874100513Sruglobally affect the document formatting, such as @code{@@synindex} or
2875100513Sru@code{@@footnotestyle}; and then by an end-of-header line (@pxref{End of
2876100513SruHeader}).
2877100513Sru
2878100513SruThe start- and end-of-header lines allow you to format only part of a
2879100513SruTexinfo file for Info or printing.  @xref{texinfo-format commands}.
2880100513Sru
288142660SmarkmThe odd string of characters, @samp{%**}, is to ensure that no other
2882100513Srucomment is accidentally taken for a start-of-header line.  You can
2883100513Sruchange it if you wish by setting the @code{tex-start-of-header} and/or
2884100513Sru@code{tex-end-of-header} Emacs variables.  @xref{Texinfo Mode Printing}.
288542660Smarkm
2886100513Sru
288756160Sru@node setfilename
2888100513Sru@subsection @code{@@setfilename}: Set the output file name
288942660Smarkm@findex setfilename
2890100513Sru@cindex Texinfo requires @code{@@setfilename}
289142660Smarkm
289242660SmarkmIn order to serve as the primary input file for either @code{makeinfo}
289342660Smarkmor @TeX{}, a Texinfo file must contain a line that looks like this:
289442660Smarkm
289542660Smarkm@example
289642660Smarkm@@setfilename @var{info-file-name}
289742660Smarkm@end example
289842660Smarkm
289942660SmarkmWrite the @code{@@setfilename} command at the beginning of a line and
290042660Smarkmfollow it on the same line by the Info file name.  Do not write anything
290142660Smarkmelse on the line; anything on the line after the command is considered
290242660Smarkmpart of the file name, including what would otherwise be a
290342660Smarkmcomment.
290442660Smarkm
2905100513Sru@cindex Ignored before @code{@@setfilename}
2906100513Sru@cindex @samp{\input} source line ignored
2907100513SruThe Info formatting commands ignore everything written before the
2908100513Sru@code{@@setfilename} line, which is why the very first line of
2909100513Sruthe file (the @code{\input} line) does not show up in the output.
2910100513Sru
291156160SruThe @code{@@setfilename} line specifies the name of the output file to
2912100513Srube generated.  This name must be different from the name of the Texinfo
2913100513Srufile.  There are two conventions for choosing the name: you can either
2914100513Sruremove the extension (such as @samp{.texi}) entirely from the input file
2915100513Sruname, or, preferably, replace it with the @samp{.info} extension.
291642660Smarkm
2917100513Sru@cindex Length of file names
2918100513Sru@cindex File name collision
2919100513Sru@cindex Info file name, choosing
2920100513SruAlthough an explicit @samp{.info} extension is preferable, some
2921100513Sruoperating systems cannot handle long file names.  You can run into a
2922100513Sruproblem even when the file name you specify is itself short enough.
292342660SmarkmThis occurs because the Info formatters split a long Info file into
292442660Smarkmshort indirect subfiles, and name them by appending @samp{-1},
292542660Smarkm@samp{-2}, @dots{}, @samp{-10}, @samp{-11}, and so on, to the original
2926100513Srufile name.  (@xref{Tag and Split Files}.)  The subfile name
2927100513Sru@file{texinfo.info-10}, for example, is too long for old systems with a
2928100513Sru14-character limit on filenames; so the Info file name for this document
2929100513Sruis @file{texinfo} rather than @file{texinfo.info}.  When @code{makeinfo}
2930100513Sruis running on operating systems such as MS-DOS which impose severe
2931100513Srulimits on file names, it may remove some characters from the original
2932100513Srufile name to leave enough space for the subfile suffix, thus producing
2933100513Srufiles named @file{texin-10}, @file{gcc.i12}, etc.
293442660Smarkm
2935100513SruWhen producing HTML output, @code{makeinfo} will replace any extension
2936100513Sruwith @samp{html}, or add @samp{.html} if the given name has no
2937100513Sruextension.
293842660Smarkm
293942660Smarkm@pindex texinfo.cnf
294042660SmarkmThe @code{@@setfilename} line produces no output when you typeset a
294156160Srumanual with @TeX{}, but it is nevertheless essential: it opens the
294242660Smarkmindex, cross-reference, and other auxiliary files used by Texinfo, and
294342660Smarkmalso reads @file{texinfo.cnf} if that file is present on your system
294456160Sru(@pxref{Preparing for TeX,, Preparing for @TeX{}}).
294542660Smarkm
294642660Smarkm
294793139Sru@node settitle
294893139Sru@subsection @code{@@settitle}: Set the document title
294942660Smarkm@findex settitle
295042660Smarkm
295142660SmarkmIn order to be made into a printed manual, a Texinfo file must contain
295293139Srua line that looks like this:
295342660Smarkm
295442660Smarkm@example
295542660Smarkm@@settitle @var{title}
295642660Smarkm@end example
295742660Smarkm
295842660SmarkmWrite the @code{@@settitle} command at the beginning of a line and
2959100513Srufollow it on the same line by the title.  This tells @TeX{} the title to
2960100513Sruuse in a header or footer.  Do not write anything else on the line;
2961100513Sruanything on the line after the command is considered part of the title,
2962100513Sruincluding what would otherwise be a comment.
296342660Smarkm
2964100513SruThe @code{@@settitle} command should precede everything that generates
2965146515Sruactual output.  The best place for it is right after the
2966146515Sru@code{@@setfilename} command (see the previous section).
2967100513Sru
2968100513Sru@cindex <title> HTML tag
2969146515SruIn the HTML file produced by @command{makeinfo}, @var{title} serves as
2970146515Sruthe document @samp{<title>}.  It also becomes the default document
2971146515Srudescription in the @samp{<head>} part (@pxref{documentdescription}).
2972100513Sru
2973100513SruThe title in the @code{@@settitle} command does not affect the title as
2974100513Sruit appears on the title page.  Thus, the two do not need not match
2975100513Sruexactly.  A practice we recommend is to include the version or edition
2976100513Srunumber of the manual in the @code{@@settitle} title; on the title page,
2977100513Sruthe version number generally appears as a @code{@@subtitle} so it would
2978146515Srube omitted from the @code{@@title}.  @xref{titlepage}.
2979100513Sru
298042660SmarkmConventionally, when @TeX{} formats a Texinfo file for double-sided
298142660Smarkmoutput, the title is printed in the left-hand (even-numbered) page
298242660Smarkmheadings and the current chapter title is printed in the right-hand
298342660Smarkm(odd-numbered) page headings.  (@TeX{} learns the title of each chapter
2984100513Srufrom each @code{@@chapter} command.)  By default, no page footer is
2985100513Sruprinted.
298642660Smarkm
298742660SmarkmEven if you are printing in a single-sided style, @TeX{} looks for an
298842660Smarkm@code{@@settitle} command line, in case you include the manual title
2989100513Sruin the heading.
299042660Smarkm
299142660Smarkm@TeX{} prints page headings only for that text that comes after the
299242660Smarkm@code{@@end titlepage} command in the Texinfo file, or that comes
299342660Smarkmafter an @code{@@headings} command that turns on headings.
299442660Smarkm(@xref{headings on off, , The @code{@@headings} Command}, for more
2995100513Sruinformation.)
299642660Smarkm
2997100513SruYou may, if you wish, create your own, customized headings and footings.
2998100513Sru@xref{Headings}, for a detailed discussion of this.
299942660Smarkm
300056160Sru
3001100513Sru@node End of Header
3002100513Sru@subsection End of Header
3003100513Sru@cindex End of header line
300493139Sru
3005100513SruFollow the header lines with an @w{end-of-header} line, which is a
3006100513SruTexinfo comment that looks like this:
300793139Sru
300893139Sru@example
3009100513Sru@@c %**end of header
301093139Sru@end example
301193139Sru
3012100513Sru@xref{Start of Header}.
301393139Sru
301493139Sru
3015100513Sru@node Document Permissions
3016100513Sru@section Document Permissions
3017100513Sru@cindex Document Permissions
3018100513Sru@cindex Copying Permissions
301993139Sru
3020100513SruThe copyright notice and copying permissions for a document need to
3021100513Sruappear in several places in the various Texinfo output formats.
3022100513SruTherefore, Texinfo provides a command (@code{@@copying}) to declare
3023100513Sruthis text once, and another command (@code{@@insertcopying}) to
3024100513Sruinsert the text at appropriate points.
302593139Sru
3026100513Sru@menu
3027146515Sru* copying::                     Declare the document's copying permissions.
3028146515Sru* insertcopying::               Where to insert the permissions.
3029100513Sru@end menu
303042660Smarkm
303142660Smarkm
3032100513Sru@node copying
3033114472Sru@subsection @code{@@copying}: Declare Copying Permissions
3034100513Sru@findex copying
303542660Smarkm
3036100513SruThe @code{@@copying} command should be given very early in the document;
3037114472Sruthe recommended location is right after the header material
3038114472Sru(@pxref{Texinfo File Header}).  It conventionally consists of a sentence
3039114472Sruor two about what the program is, identification of the documentation
3040114472Sruitself, the legal copyright line, and the copying permissions.  Here is
3041114472Srua skeletal example:
304242660Smarkm
304342660Smarkm@example
3044100513Sru@@copying
3045114472SruThis manual is for @var{program} (version @var{version}, updated
3046114472Sru@var{date}), which @dots{}
304742660Smarkm
3048100513SruCopyright @@copyright@{@} @var{years} @var{copyright-owner}.
304942660Smarkm
3050100513Sru@@quotation
3051100513SruPermission is granted to @dots{}
3052100513Sru@@end quotation
3053100513Sru@@end copying
305442660Smarkm@end example
305542660Smarkm
3056100513SruThe @code{@@quotation} has no legal significance; it's there to improve
3057100513Srureadability in some contexts.
305842660Smarkm
3059100513Sru@xref{GNU Sample Texts}, for the full text to be used in GNU manuals.
3060100513Sru@xref{GNU Free Documentation License}, for the license itself under
3061114472Sruwhich GNU and other free manuals are distributed.  You need to include
3062114472Sruthe license as an appendix to your document.
306342660Smarkm
3064100513SruThe text of @code{@@copying} is output as a comment at the beginning of
3065100513SruInfo, HTML, and XML output files.  It is @emph{not} output implicitly in
3066100513Sruplain text or @TeX{}; it's up to you to use @code{@@insertcopying} to
3067100513Sruemit the copying information.  See the next section for details.
306842660Smarkm
3069100513Sru@findex copyright
3070114472SruThe @code{@@copyright@{@}} command generates a @samp{c} inside a circle
3071114472Sruin output formats that support this (print and HTML).  In the other
3072114472Sruformats (Info and plain text), it generates @samp{(C)}.  The copyright
3073114472Srunotice itself has the following legally defined sequence:
307442660Smarkm
307556160Sru@example
3076100513SruCopyright @copyright{} @var{years} @var{copyright-owner}.
307756160Sru@end example
307856160Sru
3079100513Sru@cindex Copyright word, always in English
3080100513SruThe word `Copyright' must always be written in English, even if the
3081114472Srudocument is otherwise written in another language.  This is due to
3082114472Sruinternational law.
308356160Sru
3084100513Sru@cindex Years, in copyright line
3085100513SruThe list of years should include all years in which a version was
3086100513Srucompleted (even if it was released in a subsequent year).  Ranges are
3087114472Srunot allowed; each year must be written out individually and in full,
3088114472Sruseparated by commas.
308956160Sru
3090114472Sru@cindex Copyright holder for FSF works
3091114472Sru@cindex Holder of copyright for FSF works
3092114472Sru@cindex Owner of copyright for FSF works
3093100513SruThe copyright owner (or owners) is whoever holds legal copyright on the
3094100513Sruwork.  In the case of works assigned to the FSF, the owner is `Free
3095100513SruSoftware Foundation, Inc.'.
309656160Sru
3097114472SruThe copyright `line' may actually be split across multiple
3098114472Srulines, both in the source document and in the output.  This often
3099114472Sruhappens for documents with a long history, having many different years
3100114472Sruof publication.
3101114472Sru
3102100513Sru@xref{Copyright Notices,,,maintain,GNU Maintenance Instructions}, for
3103100513Sruadditional information.
310456160Sru
310556160Sru
3106100513Sru@node insertcopying
3107114472Sru@subsection @code{@@insertcopying}: Include Permissions Text
3108100513Sru@findex insertcopying
3109100513Sru@cindex Copying text, including
3110100513Sru@cindex Permissions text, including
3111100513Sru@cindex Including permissions text
311256160Sru
3113100513SruThe @code{@@insertcopying} command is simply written on a line by
3114100513Sruitself, like this:
311556160Sru
311642660Smarkm@example
3117100513Sru@@insertcopying
311842660Smarkm@end example
311942660Smarkm
3120114472SruThis inserts the text previously defined by @code{@@copying}.  To meet
3121114472Srulegal requirements, it must be used on the copyright page in the printed
3122114472Srumanual (@pxref{Copyright}).
312342660Smarkm
3124114472SruWe also strongly recommend using @code{@@insertcopying} in the Top node
3125114472Sruof your manual (@pxref{The Top Node}), although it is not required
3126114472Srulegally.  Here's why:
312742660Smarkm
3128100513SruThe @code{@@copying} command itself causes the permissions text to
3129100513Sruappear in an Info file @emph{before} the first node.  The text is also
3130100513Srucopied into the beginning of each split Info output file, as is legally
3131100513Srunecessary.  This location implies a human reading the manual using Info
3132100513Srudoes @emph{not} see this text (except when using the advanced Info
3133100513Srucommand @kbd{g *}).  Therefore, an explicit @code{@@insertcopying}
3134100513Sruin the Top node makes it apparent to readers that the manual is free.
313542660Smarkm
3136100513SruSimilarly, the @code{@@copying} text is automatically included at the
3137100513Srubeginning of each HTML output file, as an HTML comment.  Again, this
3138100513Srutext is not visible (unless the reader views the HTML source).  And
3139100513Srutherefore again, the @code{@@insertcopying} in the Top node is valuable
3140100513Srubecause it makes the copying permissions visible and thus promotes
3141100513Srufreedom.
314242660Smarkm
3143100513SruThe permissions text defined by @code{@@copying} also appears
3144100513Sruautomatically at the beginning of the XML output file.
314556160Sru
314642660Smarkm
314756160Sru@node Titlepage & Copyright Page
3148100513Sru@section Title and Copyright Pages
314942660Smarkm
3150100513SruIn hard copy output, the manual's name and author are usually printed on
3151100513Srua title page.  Copyright information is usually printed on the back of
3152100513Sruthe title page.
315342660Smarkm
3154100513SruThe title and copyright pages appear in the printed manual, but not in
3155100513Sruthe Info file.  Because of this, it is possible to use several slightly
315642660Smarkmobscure @TeX{} typesetting commands that cannot be used in an Info file.
3157100513SruIn addition, this part of the beginning of a Texinfo file contains the
3158100513Srutext of the copying permissions that appears in the printed manual.
315942660Smarkm
3160100513Sru@cindex Title page, for plain text
3161100513Sru@cindex Copyright page, for plain text
316256160SruYou may wish to include titlepage-like information for plain text
3163100513Sruoutput.  Simply place any such leading material between
3164100513Sru@code{@@ifplaintext} and @code{@@end ifplaintext}; @command{makeinfo}
3165100513Sruincludes this when writing plain text (@samp{--no-headers}), along with
3166100513Sruan @code{@@insertcopying}.
316756160Sru
316842660Smarkm@menu
316942660Smarkm* titlepage::                   Create a title for the printed document.
317042660Smarkm* titlefont center sp::         The @code{@@titlefont}, @code{@@center},
3171114472Sru                                 and @code{@@sp} commands.
317242660Smarkm* title subtitle author::       The @code{@@title}, @code{@@subtitle},
3173114472Sru                                 and @code{@@author} commands.
3174100513Sru* Copyright::                   How to write the copyright notice and
3175114472Sru                                 include copying permissions.
317642660Smarkm* end titlepage::               Turn on page headings after the title and
3177114472Sru                                 copyright pages.
317842660Smarkm* headings on off::             An option for turning headings on and off
3179114472Sru                                 and double or single sided printing.
318042660Smarkm@end menu
318142660Smarkm
318256160Sru
3183100513Sru@node titlepage
318442660Smarkm@subsection @code{@@titlepage}
318542660Smarkm@cindex Title page
318642660Smarkm@findex titlepage
318742660Smarkm
318842660SmarkmStart the material for the title page and following copyright page
318942660Smarkmwith @code{@@titlepage} on a line by itself and end it with
3190100513Sru@code{@@end titlepage} on a line by itself.
319142660Smarkm
319242660SmarkmThe @code{@@end titlepage} command starts a new page and turns on page
319342660Smarkmnumbering.  (@xref{Headings, , Page Headings}, for details about how to
319456160Srugenerate page headings.)  All the material that you want to appear on
319556160Sruunnumbered pages should be put between the @code{@@titlepage} and
319656160Sru@code{@@end titlepage} commands.  You can force the table of contents to
319756160Sruappear there with the @code{@@setcontentsaftertitlepage} command
319856160Sru(@pxref{Contents}).
319942660Smarkm
320056160Sru@findex page@r{, within @code{@@titlepage}}
320156160SruBy using the @code{@@page} command you can force a page break within the
320256160Sruregion delineated by the @code{@@titlepage} and @code{@@end titlepage}
320356160Srucommands and thereby create more than one unnumbered page.  This is how
320456160Sruthe copyright page is produced.  (The @code{@@titlepage} command might
320556160Sruperhaps have been better named the @code{@@titleandadditionalpages}
320656160Srucommand, but that would have been rather long!)
320756160Sru
320842660SmarkmWhen you write a manual about a computer program, you should write the
320956160Sruversion of the program to which the manual applies on the title page.
321056160SruIf the manual changes more frequently than the program or is independent
321156160Sruof it, you should also include an edition number@footnote{We have found
3212100513Sruthat it is helpful to refer to versions of independent manuals as
3213100513Sru`editions' and versions of programs as `versions'; otherwise, we find we
3214100513Sruare liable to confuse each other in conversation by referring to both
3215100513Sruthe documentation and the software with the same words.} for the manual.
321656160SruThis helps readers keep track of which manual is for which version of
321756160Sruthe program.  (The `Top' node should also contain this information; see
3218100513Sru@ref{The Top Node}.)
321942660Smarkm
322042660SmarkmTexinfo provides two main methods for creating a title page.  One method
322142660Smarkmuses the @code{@@titlefont}, @code{@@sp}, and @code{@@center} commands
322242660Smarkmto generate a title page in which the words on the page are
322356160Srucentered.
322442660Smarkm
322542660SmarkmThe second method uses the @code{@@title}, @code{@@subtitle}, and
322642660Smarkm@code{@@author} commands to create a title page with black rules under
322742660Smarkmthe title and author lines and the subtitle text set flush to the
322842660Smarkmright hand side of the page.  With this method, you do not specify any
322942660Smarkmof the actual formatting of the title page.  You specify the text
323056160Sruyou want, and Texinfo does the formatting.
323142660Smarkm
323256160SruYou may use either method, or you may combine them; see the examples in
323356160Sruthe sections below.
323456160Sru
323542660Smarkm@findex shorttitlepage
323656160Sru@cindex Bastard title page
323756160Sru@cindex Title page, bastard
3238146515SruFor extremely simple documents, and for the bastard title page in
3239146515Srutraditional book frontmatter, Texinfo also provides a command
3240100513Sru@code{@@shorttitlepage} which takes the rest of the line as the title.
3241100513SruThe argument is typeset on a page by itself and followed by a blank
3242100513Srupage.
324342660Smarkm
324442660Smarkm
324556160Sru@node titlefont center sp
324642660Smarkm@subsection @code{@@titlefont}, @code{@@center}, and @code{@@sp}
324742660Smarkm@findex titlefont
324842660Smarkm@findex center
324942660Smarkm@findex sp @r{(titlepage line spacing)}
325042660Smarkm
325142660SmarkmYou can use the @code{@@titlefont}, @code{@@sp}, and @code{@@center}
325242660Smarkmcommands to create a title page for a printed document.  (This is the
3253100513Srufirst of the two methods for creating a title page in Texinfo.)
325442660Smarkm
325542660SmarkmUse the @code{@@titlefont} command to select a large font suitable for
325656160Sruthe title itself.  You can use @code{@@titlefont} more than once if you
325756160Sruhave an especially long title.
325842660Smarkm
3259146515SruFor HTML output, each @code{@@titlefont} command produces an
3260146515Sru@code{<h1>} heading, but the HTML document @code{<title>} is not
3261146515Sruaffected.  For that, you must put an @code{@@settitle} command before
3262146515Sruthe @code{@@titlefont} command (@pxref{settitle}).
3263146515Sru
326442660Smarkm@need 700
326542660SmarkmFor example:
326642660Smarkm
326742660Smarkm@example
326842660Smarkm@@titlefont@{Texinfo@}
326942660Smarkm@end example
327042660Smarkm
327142660SmarkmUse the @code{@@center} command at the beginning of a line to center
3272100513Sruthe remaining text on that line.  Thus,
327342660Smarkm
327442660Smarkm@example
327542660Smarkm@@center @@titlefont@{Texinfo@}
327642660Smarkm@end example
327742660Smarkm
327842660Smarkm@noindent
327942660Smarkmcenters the title, which in this example is ``Texinfo'' printed
3280100513Sruin the title font.
328142660Smarkm
3282100513SruUse the @code{@@sp} command to insert vertical space.  For example:
328342660Smarkm
328442660Smarkm@example
328542660Smarkm@@sp 2
328642660Smarkm@end example
328742660Smarkm
328842660Smarkm@noindent
328942660SmarkmThis inserts two blank lines on the printed page.  (@xref{sp, ,
329042660Smarkm@code{@@sp}}, for more information about the @code{@@sp}
3291100513Srucommand.)
329242660Smarkm
3293100513SruA template for this method looks like this:
329442660Smarkm
329542660Smarkm@example
329642660Smarkm@group
329742660Smarkm@@titlepage
329842660Smarkm@@sp 10
329942660Smarkm@@center @@titlefont@{@var{name-of-manual-when-printed}@}
330042660Smarkm@@sp 2
330142660Smarkm@@center @var{subtitle-if-any}
330242660Smarkm@@sp 2
330342660Smarkm@@center @var{author}
330442660Smarkm@dots{}
330542660Smarkm@@end titlepage
330642660Smarkm@end group
330742660Smarkm@end example
330842660Smarkm
3309100513SruThe spacing of the example fits an 8.5 by 11 inch manual.
331042660Smarkm
3311146515SruYou can in fact use these commands anywhere, not just on a title page,
3312146515Srubut since they are not logical markup commands, we don't recommend
3313146515Sruthem.
331456160Sru
331556160Sru@node title subtitle author
331642660Smarkm@subsection @code{@@title}, @code{@@subtitle}, and @code{@@author}
331742660Smarkm@findex title
331842660Smarkm@findex subtitle
331942660Smarkm@findex author
332042660Smarkm
332142660SmarkmYou can use the @code{@@title}, @code{@@subtitle}, and @code{@@author}
332242660Smarkmcommands to create a title page in which the vertical and horizontal
332342660Smarkmspacing is done for you automatically.  This contrasts with the method
332456160Srudescribed in the previous section, in which the @code{@@sp} command is
332556160Sruneeded to adjust vertical spacing.
332642660Smarkm
332742660SmarkmWrite the @code{@@title}, @code{@@subtitle}, or @code{@@author}
332842660Smarkmcommands at the beginning of a line followed by the title, subtitle,
3329146515Sruor author.  These commands are only effective in @TeX{} output; it's
3330146515Sruan error to use them anywhere except within @code{@@titlepage}.
333142660Smarkm
333242660SmarkmThe @code{@@title} command produces a line in which the title is set
333342660Smarkmflush to the left-hand side of the page in a larger than normal font.
333456160SruThe title is underlined with a black rule.  Only a single line is
333556160Sruallowed; the @code{@@*} command may not be used to break the title into
333656160Srutwo lines.  To handle very long titles, you may find it profitable to
333756160Sruuse both @code{@@title} and @code{@@titlefont}; see the final example in
333856160Sruthis section.
333942660Smarkm
334042660SmarkmThe @code{@@subtitle} command sets subtitles in a normal-sized font
3341100513Sruflush to the right-hand side of the page.
334242660Smarkm
334342660SmarkmThe @code{@@author} command sets the names of the author or authors in
334442660Smarkma middle-sized font flush to the left-hand side of the page on a line
334542660Smarkmnear the bottom of the title page.  The names are underlined with a
334642660Smarkmblack rule that is thinner than the rule that underlines the title.
334742660Smarkm(The black rule only occurs if the @code{@@author} command line is
3348100513Srufollowed by an @code{@@page} command line.)
334942660Smarkm
335042660SmarkmThere are two ways to use the @code{@@author} command: you can write
335142660Smarkmthe name or names on the remaining part of the line that starts with
3352100513Sruan @code{@@author} command:
335342660Smarkm
335442660Smarkm@example
335542660Smarkm@@author by Jane Smith and John Doe
335642660Smarkm@end example
335742660Smarkm
335842660Smarkm@noindent
335942660Smarkmor you can write the names one above each other by using two (or more)
3360100513Sru@code{@@author} commands:
336142660Smarkm
336242660Smarkm@example
336342660Smarkm@group
336442660Smarkm@@author Jane Smith
336542660Smarkm@@author John Doe
336642660Smarkm@end group
336742660Smarkm@end example
336842660Smarkm
336942660Smarkm@noindent
3370100513Sru(Only the bottom name is underlined with a black rule.)
337142660Smarkm
337242660Smarkm@need 950
3373100513SruA template for this method looks like this:
337442660Smarkm
337542660Smarkm@example
337642660Smarkm@group
337742660Smarkm@@titlepage
337842660Smarkm@@title @var{name-of-manual-when-printed}
337942660Smarkm@@subtitle @var{subtitle-if-any}
338042660Smarkm@@subtitle @var{second-subtitle}
338142660Smarkm@@author @var{author}
338242660Smarkm@@page
338342660Smarkm@dots{}
338442660Smarkm@@end titlepage
338542660Smarkm@end group
338642660Smarkm@end example
338742660Smarkm
338856160SruYou may also combine the @code{@@titlefont} method described in the
338956160Sruprevious section and @code{@@title} method described in this one.  This
339056160Srumay be useful if you have a very long title.  Here is a real-life example:
339142660Smarkm
339242660Smarkm@example
339356160Sru@group
339442660Smarkm@@titlepage
339556160Sru@@titlefont@{GNU Software@}
339642660Smarkm@@sp 1
339756160Sru@@title for MS-Windows and MS-DOS
339893139Sru@@subtitle Edition @@value@{e@} for Release @@value@{cde@}
339956160Sru@@author by Daniel Hagerty, Melissa Weisshaus
340056160Sru@@author and Eli Zaretskii
340156160Sru@end group
340242660Smarkm@end example
340342660Smarkm
340456160Sru@noindent
3405100513Sru(The use of @code{@@value} here is explained in @ref{value Example}.
340656160Sru
340756160Sru
3408100513Sru@node Copyright
3409100513Sru@subsection Copyright Page
341042660Smarkm@cindex Copyright page
341142660Smarkm@cindex Printed permissions
341242660Smarkm@cindex Permissions, printed
341342660Smarkm
3414100513SruBy international treaty, the copyright notice for a book must be either
3415100513Sruon the title page or on the back of the title page.  When the copyright
3416100513Srunotice is on the back of the title page, that page is customarily not
3417100513Srunumbered.  Therefore, in Texinfo, the information on the copyright page
3418100513Srushould be within @code{@@titlepage} and @code{@@end titlepage}
3419100513Srucommands.
342042660Smarkm
3421100513Sru@findex vskip @r{@TeX{} vertical skip}
3422100513Sru@findex filll @r{@TeX{} dimension}
342342660SmarkmUse the @code{@@page} command to cause a page break.  To push the
342442660Smarkmcopyright notice and the other text on the copyright page towards the
3425100513Srubottom of the page, use the following incantantion after @code{@@page}:
342642660Smarkm
342742660Smarkm@example
342842660Smarkm@@vskip 0pt plus 1filll
342942660Smarkm@end example
343042660Smarkm
343142660Smarkm@noindent
343242660SmarkmThis is a @TeX{} command that is not supported by the Info formatting
3433100513Srucommands.  The @code{@@vskip} command inserts whitespace.  The @samp{0pt
3434100513Sruplus 1filll} means to put in zero points of mandatory whitespace, and as
3435100513Srumuch optional whitespace as needed to push the following text to the
3436100513Srubottom of the page.  Note the use of three @samp{l}s in the word
3437100513Sru@samp{filll}; this is correct.
343842660Smarkm
3439100513SruTo insert the copyright text itself, write @code{@@insertcopying}
3440100513Srunext (@pxref{Document Permissions}):
344142660Smarkm
344242660Smarkm@example
3443100513Sru@@insertcopying
344442660Smarkm@end example
344542660Smarkm
3446100513SruFollow the copying text by the publisher, ISBN numbers, cover art
3447100513Srucredits, and other such information.
344842660Smarkm
3449100513SruHere is an example putting all this together:
345042660Smarkm
3451100513Sru@example
3452100513Sru@@titlepage
3453100513Sru@dots{}
3454100513Sru@@page
3455100513Sru@@vskip 0pt plus 1filll
3456100513Sru@@insertcopying
345742660Smarkm
3458100513SruPublished by @dots{}
345956160Sru
3460100513SruCover art by @dots{}
3461100513Sru@@end titlepage
3462100513Sru@end example
3463100513Sru
3464100513Sru
346556160Sru@node end titlepage
346642660Smarkm@subsection Heading Generation
346742660Smarkm@findex end titlepage
346842660Smarkm@cindex Headings, page, begin to appear
346942660Smarkm@cindex Titlepage end starts headings
347042660Smarkm@cindex End titlepage starts headings
347142660Smarkm
3472146515SruLike all @code{@@end} commands (@pxref{Quotations and Examples}), the @code{@@end titlepage} command
3473146515Srumust be written at the beginning of a line by itself, with only one
3474146515Sruspace between the @code{@@end} and the @code{titlepage}.  It not only
3475146515Srumarks the end of the title and copyright pages, but also causes @TeX{}
3476146515Sruto start generating page headings and page numbers.
347742660Smarkm
347842660SmarkmTo repeat what is said elsewhere,  Texinfo has two standard page heading
347942660Smarkmformats, one for documents which are printed on one side of each sheet of paper
348042660Smarkm(single-sided printing), and the other for documents which are printed on both
348142660Smarkmsides of each sheet (double-sided printing).
3482100513SruYou can specify these formats in different ways:
348342660Smarkm
348442660Smarkm@itemize @bullet
348542660Smarkm@item
348642660SmarkmThe conventional way is to write an @code{@@setchapternewpage} command
348742660Smarkmbefore the title page commands, and then have the @code{@@end
348842660Smarkmtitlepage} command start generating page headings in the manner desired.
3489100513Sru(@xref{setchapternewpage}.)
349042660Smarkm
349142660Smarkm@item
349242660SmarkmAlternatively, you can use the @code{@@headings} command to prevent page
349342660Smarkmheadings from being generated or to start them for either single or
349442660Smarkmdouble-sided printing.  (Write an @code{@@headings} command immediately
349542660Smarkmafter the @code{@@end titlepage} command.  @xref{headings on off, , The
349642660Smarkm@code{@@headings} Command}, for more information.)@refill
349742660Smarkm
349842660Smarkm@item
349942660SmarkmOr, you may specify your own page heading and footing format.
350042660Smarkm@xref{Headings, , Page Headings}, for detailed
3501100513Sruinformation about page headings and footings.
350242660Smarkm@end itemize
350342660Smarkm
350442660SmarkmMost documents are formatted with the standard single-sided or
350542660Smarkmdouble-sided format, using @code{@@setchapternewpage odd} for
350642660Smarkmdouble-sided printing and no @code{@@setchapternewpage} command for
3507100513Srusingle-sided printing.
350842660Smarkm
3509100513Sru
3510100513Sru@node headings on off
351142660Smarkm@subsection The @code{@@headings} Command
351242660Smarkm@findex headings
351342660Smarkm
351442660SmarkmThe @code{@@headings} command is rarely used.  It specifies what kind of
351542660Smarkmpage headings and footings to print on each page.  Usually, this is
351642660Smarkmcontrolled by the @code{@@setchapternewpage} command.  You need the
351742660Smarkm@code{@@headings} command only if the @code{@@setchapternewpage} command
351842660Smarkmdoes not do what you want, or if you want to turn off pre-defined page
351942660Smarkmheadings prior to defining your own.  Write an @code{@@headings} command
352042660Smarkmimmediately after the @code{@@end titlepage} command.@refill
352142660Smarkm
352242660SmarkmYou can use @code{@@headings} as follows:@refill
352342660Smarkm
352442660Smarkm@table @code
352542660Smarkm@item @@headings off
352642660SmarkmTurn off printing of page headings.@refill
352742660Smarkm
352842660Smarkm@item @@headings single
352942660SmarkmTurn on page headings appropriate for single-sided printing.
353042660Smarkm@refill
353142660Smarkm
353242660Smarkm@item @@headings double
353356160Sru@itemx @@headings on
353442660SmarkmTurn on page headings appropriate for double-sided printing.  The two
353542660Smarkmcommands, @code{@@headings on} and @code{@@headings double}, are
353642660Smarkmsynonymous.@refill
353742660Smarkm
353842660Smarkm@item @@headings singleafter
353942660Smarkm@itemx @@headings doubleafter
354042660SmarkmTurn on @code{single} or @code{double} headings, respectively, after the
354142660Smarkmcurrent page is output.
354242660Smarkm
354342660Smarkm@item @@headings on
354442660SmarkmTurn on page headings: @code{single} if @samp{@@setchapternewpage
354542660Smarkmon}, @code{double} otherwise.
354642660Smarkm@end table
354742660Smarkm
354842660SmarkmFor example, suppose you write @code{@@setchapternewpage off} before the
354942660Smarkm@code{@@titlepage} command to tell @TeX{} to start a new chapter on the
355042660Smarkmsame page as the end of the last chapter.  This command also causes
355142660Smarkm@TeX{} to typeset page headers for single-sided printing.  To cause
355242660Smarkm@TeX{} to typeset for double sided printing, write @code{@@headings
355342660Smarkmdouble} after the @code{@@end titlepage} command.
355442660Smarkm
355542660SmarkmYou can stop @TeX{} from generating any page headings at all by
355642660Smarkmwriting @code{@@headings off} on a line of its own immediately after the
355742660Smarkmline containing the @code{@@end titlepage} command, like this:@refill
355842660Smarkm
355942660Smarkm@example
356042660Smarkm@@end titlepage
356142660Smarkm@@headings off
356242660Smarkm@end example
356342660Smarkm
356442660Smarkm@noindent
356542660SmarkmThe @code{@@headings off} command overrides the @code{@@end titlepage}
356642660Smarkmcommand, which would otherwise cause @TeX{} to print page
356742660Smarkmheadings.@refill
356842660Smarkm
356942660SmarkmYou can also specify your own style of page heading and footing.
357042660Smarkm@xref{Headings, , Page Headings}, for more information.@refill
357142660Smarkm
357256160Sru
3573116525Sru@node Contents
3574116525Sru@section Generating a Table of Contents
3575116525Sru@cindex Table of contents
3576116525Sru@cindex Contents, Table of
3577116525Sru@cindex Short table of contents
3578116525Sru@findex contents
3579116525Sru@findex summarycontents
3580116525Sru@findex shortcontents
3581116525Sru
3582116525SruThe @code{@@chapter}, @code{@@section}, and other structuring commands
3583116525Sru(@pxref{Structuring}) supply the information to make up a
3584116525Srutable of contents, but they do not cause an actual table to appear in
3585116525Sruthe manual.  To do this, you must use the @code{@@contents} and/or
3586116525Sru@code{@@summarycontents} command(s).
3587116525Sru
3588116525Sru@table @code
3589116525Sru@item @@contents
3590116525SruGenerates a table of contents in a printed manual, including all
3591116525Sruchapters, sections, subsections, etc., as well as appendices and
3592146515Sruunnumbered chapters.  Headings generated by @code{@@majorheading},
3593146515Sru@code{@@chapheading}, and the other @code{@@@dots{}heading} commands
3594146515Srudo not appear in the table of contents (@pxref{Structuring Command
3595146515SruTypes}).
3596116525Sru
3597116525Sru@item @@shortcontents
3598116525Sru@itemx @@summarycontents
3599116525Sru(@code{@@summarycontents} is a synonym for @code{@@shortcontents}.)
3600116525Sru
3601116525SruGenerates a short or summary table of contents that lists only the
3602116525Sruchapters, appendices, and unnumbered chapters.  Sections, subsections
3603116525Sruand subsubsections are omitted.  Only a long manual needs a short
3604116525Srutable of contents in addition to the full table of contents.
3605116525Sru
3606116525Sru@end table
3607116525Sru
3608116525SruBoth contents commands should be written on a line by themselves, and
3609116525Sruare best placed near the beginning of the file, after the @code{@@end
3610116525Srutitlepage} (@pxref{titlepage}).  The contents commands automatically
3611116525Srugenerate a chapter-like heading at the top of the first table of
3612116525Srucontents page, so don't include any sectioning command such as
3613116525Sru@code{@@unnumbered} before them.
3614116525Sru
3615116525SruSince an Info file uses menus instead of tables of contents, the Info
3616116525Sruformatting commands ignore the contents commands.  But the contents are
3617116525Sruincluded in plain text output (generated by @code{makeinfo
3618116525Sru--no-headers}), unless @code{makeinfo} is writing its output to standard
3619116525Sruoutput.
3620116525Sru
3621116525SruWhen @code{makeinfo} writes a short table of contents while producing
3622116525Sruhtml output, the links in the short table of contents point to
3623116525Srucorresponding entries in the full table of contents rather than the text
3624116525Sruof the document. The links in the full table of contents point to the
3625116525Srumain text of the document.
3626116525Sru
3627116525SruIn the past, the contents commands were sometimes placed at the end of
3628116525Sruthe file, after any indices and just before the @code{@@bye}, but we
3629116525Sruno longer recommend this.
3630116525Sru
3631116525Sru@findex setcontentsaftertitlepage
3632116525Sru@findex setshortcontentsaftertitlepage
3633116525Sru@cindex Contents, after title page
3634116525Sru@cindex Table of contents, after title page
3635116525SruHowever, since many existing Texinfo documents still do have the
3636116525Sru@code{@@contents} at the end of the manual, if you are a user printing
3637116525Srua manual, you may wish to force the contents to be printed after the
3638116525Srutitle page.  You can do this by specifying
3639116525Sru@code{@@setcontentsaftertitlepage} and/or
3640116525Sru@code{@@setshortcontentsaftertitlepage}.  The first prints only the
3641116525Srumain contents after the @code{@@end titlepage}; the second prints both
3642116525Sruthe short contents and the main contents.  In either case, any
3643116525Srusubsequent @code{@@contents} or @code{@@shortcontents} is ignored
3644116525Sru(unless, erroneously, no @code{@@end titlepage} is ever encountered).
3645116525Sru
3646116525SruYou need to include the @code{@@set@dots{}contentsaftertitlepage}
3647116525Srucommands early in the document (just after @code{@@setfilename}, for
3648116525Sruexample).  We recommend using @command{texi2dvi} (@pxref{Format with
3649116525Srutexi2dvi}) to specify this without altering the source file at all.  For
3650116525Sruexample:
3651116525Sru@example
3652116525Srutexi2dvi --texinfo=@@setcontentsaftertitlepage foo.texi
3653116525Sru@end example
3654116525Sru
3655116525Sru
365656160Sru@node The Top Node
365742660Smarkm@section The `Top' Node and Master Menu
3658100513Sru@cindex Top node
365942660Smarkm@cindex Node, `Top'
366042660Smarkm
3661100513SruThe `Top' node is the node in which a reader enters an Info manual.  As
3662100513Srusuch, it should begin with the @code{@@insertcopying} command
3663100513Sru(@pxref{Document Permissions}) to provide a brief description of the
3664100513Srumanual (including the version number) and copying permissions, and end
3665100513Sruwith a master menu for the whole manual.  Of course you should include
3666100513Sruany other general information you feel a reader would find helpful.
366742660Smarkm
3668100513Sru@findex top
3669100513SruIt is also conventional to write an @code{@@top} sectioning command line
3670100513Srucontaining the title of the document immediately after the @code{@@node
3671100513SruTop} line (@pxref{makeinfo top command, , The @code{@@top} Sectioning
3672100513SruCommand}).
367342660Smarkm
3674100513SruThe contents of the `Top' node should appear only in the online output;
3675100513Srunone of it should appear in printed output, so enclose it between
3676100513Sru@code{@@ifnottex} and @code{@@end ifnottex} commands.  (@TeX{} does not
367742660Smarkmprint either an @code{@@node} line or a menu; they appear only in Info;
367842660Smarkmstrictly speaking, you are not required to enclose these parts between
3679100513Sru@code{@@ifnottex} and @code{@@end ifnottext}, but it is simplest to do
3680100513Sruso.  @xref{Conditionals, , Conditionally Visible Text}.)
368142660Smarkm
368242660Smarkm@menu
3683116525Sru* Top Node Example::
3684116525Sru* Master Menu Parts::
368542660Smarkm@end menu
368642660Smarkm
368742660Smarkm
3688100513Sru@node Top Node Example
3689100513Sru@subsection Top Node Example
369056160Sru
3691100513Sru@cindex Top node example
369242660Smarkm
3693100513SruHere is an example of a Top node.
369442660Smarkm
369542660Smarkm@example
369642660Smarkm@group
369756160Sru@@ifnottex
3698100513Sru@@node Top
3699100513Sru@@top Sample Title
370042660Smarkm
3701100513Sru@@insertcopying
370242660Smarkm@end group
370342660Smarkm
3704100513SruAdditional general information.
370542660Smarkm
370642660Smarkm@group
370742660Smarkm@@menu
3708100513Sru* First Chapter::
3709100513Sru* Second Chapter::
371042660Smarkm@dots{}
3711100513Sru* Index::
371242660Smarkm@end group
371342660Smarkm@@end menu
371442660Smarkm@end example
371542660Smarkm
371642660Smarkm
3717100513Sru@node Master Menu Parts
371842660Smarkm@subsection Parts of a Master Menu
3719100513Sru@cindex Master menu
3720100513Sru@cindex Menu, master
372142660Smarkm@cindex Parts of a master menu
372242660Smarkm
372342660SmarkmA @dfn{master menu} is a detailed main menu listing all the nodes in a
372442660Smarkmfile.
372542660Smarkm
372642660SmarkmA master menu is enclosed in @code{@@menu} and @code{@@end menu}
3727100513Srucommands and does not appear in the printed document.
372842660Smarkm
3729100513SruGenerally, a master menu is divided into parts.
373042660Smarkm
373142660Smarkm@itemize @bullet
373242660Smarkm@item
373342660SmarkmThe first part contains the major nodes in the Texinfo file: the nodes
3734100513Srufor the chapters, chapter-like sections, and the appendices.
373542660Smarkm
373642660Smarkm@item
3737100513SruThe second part contains nodes for the indices.
373842660Smarkm
373942660Smarkm@item
374042660SmarkmThe third and subsequent parts contain a listing of the other, lower
374142660Smarkmlevel nodes, often ordered by chapter.  This way, rather than go
374242660Smarkmthrough an intermediary menu, an inquirer can go directly to a
374342660Smarkmparticular node when searching for specific information.  These menu
374442660Smarkmitems are not required; add them if you think they are a
374542660Smarkmconvenience.  If you do use them, put @code{@@detailmenu} before the
374642660Smarkmfirst one, and @code{@@end detailmenu} after the last; otherwise,
374742660Smarkm@code{makeinfo} will get confused.
374842660Smarkm@end itemize
374942660Smarkm
375042660SmarkmEach section in the menu can be introduced by a descriptive line.  So
375142660Smarkmlong as the line does not begin with an asterisk, it will not be
375242660Smarkmtreated as a menu entry.  (@xref{Writing a Menu}, for more
3753100513Sruinformation.)
375442660Smarkm
375542660SmarkmFor example, the master menu for this manual looks like the following
3756100513Sru(but has many more entries):
375742660Smarkm
375842660Smarkm@example
375942660Smarkm@group
376042660Smarkm@@menu
3761100513Sru* Copying Conditions::  Your rights.
3762100513Sru* Overview::            Texinfo in brief.
376342660Smarkm@dots{}
376442660Smarkm@end group
376542660Smarkm@group
376642660Smarkm* Command and Variable Index::
3767116525Sru* Concept Index::
376842660Smarkm@end group
376942660Smarkm
377042660Smarkm@group
377142660Smarkm@@detailmenu
3772114472Sru--- The Detailed Node Listing ---
377342660Smarkm
377442660SmarkmOverview of Texinfo
377542660Smarkm
3776100513Sru* Reporting Bugs:: @dots{}
377742660Smarkm@dots{}
377842660Smarkm@end group
377942660Smarkm
378042660Smarkm@group
3781100513SruBeginning a Texinfo File
378242660Smarkm
3783100513Sru* Sample Beginning:: @dots{}
378442660Smarkm@dots{}
378542660Smarkm@@end detailmenu
378642660Smarkm@@end menu
378742660Smarkm@end group
378842660Smarkm@end example
378942660Smarkm
3790100513Sru
3791100513Sru@node Global Document Commands
3792100513Sru@section Global Document Commands
3793100513Sru@cindex Global Document Commands
3794100513Sru
3795100513SruBesides the basic commands mentioned in the previous sections, here are
3796100513Sruadditional commands which affect the document as a whole.  They are
3797100513Srugenerally all given before the Top node, if they are given at all.
3798100513Sru
3799100513Sru@menu
3800100513Sru* documentdescription::         Document summary for the HTML output.
3801100513Sru* setchapternewpage::           Start chapters on right-hand pages.
3802100513Sru* paragraphindent::             Specify paragraph indentation.
3803116525Sru* firstparagraphindent::        Suppress indentation of the first paragraph.
3804100513Sru* exampleindent::               Specify environment indentation.
3805100513Sru@end menu
3806100513Sru
3807100513Sru
3808100513Sru@node documentdescription
3809114472Sru@subsection @code{@@documentdescription}: Summary Text
3810100513Sru@cindex Document description
3811100513Sru@cindex Description of document
3812100513Sru@cindex Summary of document
3813100513Sru@cindex Abstract of document
3814100513Sru@cindex <meta> HTML tag, and document description
3815100513Sru@findex documentdescription
3816100513Sru
3817100513SruWhen producing HTML output for a document, @command{makeinfo} writes a
3818100513Sru@samp{<meta>} element in the @samp{<head>} to give some idea of the
3819100513Srucontent of the document.  By default, this @dfn{description} is the title
3820100513Sruof the document, taken from the @code{@@settitle} command
3821100513Sru(@pxref{settitle}).  To change this, use the @code{@@documentdescription}
3822100513Sruenvironment, as in:
3823100513Sru
3824100513Sru@example
3825100513Sru@@documentdescription
3826100513Srudescriptive text.
3827100513Sru@@end documentdescription
3828100513Sru@end example
3829100513Sru
3830100513Sru@noindent
3831100513SruThis will produce the following output in the @samp{<head>} of the HTML:
3832100513Sru
3833100513Sru@example
3834100513Sru<meta name=description content="descriptive text.">
3835100513Sru@end example
3836100513Sru
3837100513Sru@code{@@documentdescription} must be specified before the first node of
3838100513Sruthe document.
3839100513Sru
3840100513Sru
3841100513Sru@node setchapternewpage
3842116525Sru@subsection @code{@@setchapternewpage}:
3843100513Sru@cindex Starting chapters
3844100513Sru@cindex Pages, starting odd
3845100513Sru@findex setchapternewpage
3846100513Sru
3847100513SruIn an officially bound book, text is usually printed on both sides of
3848100513Sruthe paper, chapters start on right-hand pages, and right-hand pages have
3849100513Sruodd numbers.  But in short reports, text often is printed only on one
3850100513Sruside of the paper.  Also in short reports, chapters sometimes do not
3851100513Srustart on new pages, but are printed on the same page as the end of the
3852100513Srupreceding chapter, after a small amount of vertical whitespace.
3853100513Sru
3854100513SruYou can use the @code{@@setchapternewpage} command with various
3855100513Sruarguments to specify how @TeX{} should start chapters and whether it
3856100513Srushould format headers for printing on one or both sides of the paper
3857100513Sru(single-sided or double-sided printing).
3858100513Sru
3859100513SruWrite the @code{@@setchapternewpage} command at the beginning of a
3860100513Sruline followed by its argument.
3861100513Sru
3862100513SruFor example, you would write the following to cause each chapter to
3863100513Srustart on a fresh odd-numbered page:
3864100513Sru
3865100513Sru@example
3866100513Sru@@setchapternewpage odd
3867100513Sru@end example
3868100513Sru
3869100513SruYou can specify one of three alternatives with the
3870100513Sru@code{@@setchapternewpage} command:
3871100513Sru
3872100513Sru@table @asis
3873100513Sru
3874100513Sru@item @code{@@setchapternewpage off}
3875100513SruCause @TeX{} to typeset a new chapter on the same page as the last
3876100513Sruchapter, after skipping some vertical whitespace.  Also, cause @TeX{} to
3877100513Sruformat page headers for single-sided printing.
3878100513Sru
3879100513Sru@item @code{@@setchapternewpage on}
3880100513SruCause @TeX{} to start new chapters on new pages and to format page
3881100513Sruheaders for single-sided printing.  This is the form most often used for
3882100513Srushort reports or personal printing. This is the default.
3883100513Sru
3884100513Sru@item @code{@@setchapternewpage odd}
3885100513SruCause @TeX{} to start new chapters on new, odd-numbered pages
3886100513Sru(right-handed pages) and to typeset for double-sided printing.  This is
3887100513Sruthe form most often used for books and manuals.
3888100513Sru@end table
3889100513Sru
3890100513SruTexinfo does not have an @code{@@setchapternewpage even} command,
3891100513Srubecause there is no printing tradition of starting chapters or books on
3892100513Sruan even-numbered page.
3893100513Sru
3894100513SruIf you don't like the default headers that @code{@@setchapternewpage}
3895100513Srusets, you can explicit control them with the @code{@@headings} command.
3896100513Sru@xref{headings on off, , The @code{@@headings} Command}.
3897100513Sru
3898100513SruAt the beginning of a manual or book, pages are not numbered---for
3899100513Sruexample, the title and copyright pages of a book are not numbered.  By
3900100513Sruconvention, table of contents and frontmatter pages are numbered with
3901100513Sruroman numerals and not in sequence with the rest of the document.
3902100513Sru
3903100513SruSince an Info file does not have pages, the @code{@@setchapternewpage}
3904100513Srucommand has no effect on it.
3905100513Sru
3906100513SruWe recommend not including any @code{@@setchapternewpage} command in
3907100513Sruyour manual sources at all, since the desired output is not intrinsic to
3908100513Sruthe document.  For a particular hard copy run, if you don't want the
3909100513Srudefault option (no blank pages, same headers on all pages) use the
3910100513Sru@option{--texinfo} option to @command{texi2dvi} to specify the output
3911100513Sruyou want.
3912100513Sru
3913100513Sru
3914100513Sru@node paragraphindent
3915116525Sru@subsection @code{@@paragraphindent}: Paragraph Indenting
3916100513Sru@cindex Indenting paragraphs, control of
3917100513Sru@cindex Paragraph indentation control
3918100513Sru@findex paragraphindent
3919100513Sru
3920100513SruThe Texinfo processors may insert whitespace at the beginning of the
3921100513Srufirst line of each paragraph, thereby indenting that paragraph.  You can
3922100513Sruuse the @code{@@paragraphindent} command to specify this indentation.
3923100513SruWrite an @code{@@paragraphindent} command at the beginning of a line
3924100513Srufollowed by either @samp{asis} or a number:
3925100513Sru
3926100513Sru@example
3927100513Sru@@paragraphindent @var{indent}
3928100513Sru@end example
3929100513Sru
3930100513SruThe indentation is according to the value of @var{indent}:
3931100513Sru
3932100513Sru@table @asis
3933100513Sru@item @code{asis}
3934100513SruDo not change the existing indentation (not implemented in @TeX{}).
3935100513Sru
3936100513Sru@item @code{none}
3937100513Sru@itemx 0
3938100513SruOmit all indentation.
3939100513Sru
3940100513Sru@item @var{n}
3941100513SruIndent by @var{n} space characters in Info output, by @var{n} ems in
3942100513Sru@TeX{}.
3943100513Sru
3944100513Sru@end table
3945100513Sru
3946100513SruThe default value of @var{indent} is 3.  @code{@@paragraphindent} is
3947100513Sruignored for HTML output.
3948100513Sru
3949100513SruIt is best to write the @code{@@paragraphindent} command before the
3950100513Sruend-of-header line at the beginning of a Texinfo file, so the region
3951100513Sruformatting commands indent paragraphs as specified.  @xref{Start of
3952100513SruHeader}.
3953100513Sru
3954100513SruA peculiarity of the @code{texinfo-format-buffer} and
3955100513Sru@code{texinfo-format-region} commands is that they do not indent (nor
3956100513Srufill) paragraphs that contain @code{@@w} or @code{@@*} commands.
3957100513Sru
3958100513Sru
3959116525Sru@node firstparagraphindent
3960146515Sru@subsection @code{@@firstparagraphindent}: Indenting After Headings
3961116525Sru@cindex First paragraph, suppressing indentation of
3962116525Sru@cindex Suppressing first paragraph indentation
3963116525Sru@cindex Preventing first paragraph indentation
3964116525Sru@cindex Indenting, suppressing of first paragraph
3965116525Sru@cindex Headings, indentation after
3966116525Sru@findex firstparagraphindent
3967116525Sru
3968116525SruAs you can see in the present manual, the first paragraph in any
3969116525Srusection is not indented by default.  Typographically, indentation is a
3970116525Sruparagraph separator, which means that it is unnecessary when a new
3971116525Srusection begins.  This indentation is controlled with the
3972116525Sru@code{@@firstparagraphindent} command:
3973116525Sru
3974116525Sru@example
3975116525Sru@@firstparagraphindent @var{word}
3976116525Sru@end example
3977116525Sru
3978116525SruThe first paragraph after a heading is indented according to the value
3979116525Sruof @var{word}:
3980116525Sru
3981116525Sru@table @asis
3982116525Sru@item @code{none}
3983116525SruPrevents the first paragraph from being indented (default).
3984116525SruThis option is ignored by @command{makeinfo} if
3985116525Sru@code{@@paragraphindent asis} is in effect.
3986116525Sru
3987116525Sru@item @code{insert}
3988116525SruInclude normal paragraph indentation.  This respects the paragraph
3989116525Sruindentation set by a @code{@@paragraphindent} command
3990116525Sru(@pxref{paragraphindent}).
3991116525Sru@end table
3992116525Sru
3993116525SruFor HTML and XML output, the @code{@@firstparagraphindent} setting is
3994116525Sruignored.
3995116525Sru
3996116525SruIt is best to write the @code{@@paragraphindent} command before the
3997116525Sruend-of-header line at the beginning of a Texinfo file, so the region
3998116525Sruformatting commands indent paragraphs as specified.  @xref{Start of
3999116525SruHeader}.
4000116525Sru
4001116525Sru
4002100513Sru@node exampleindent
4003100513Sru@subsection @code{@@exampleindent}: Environment Indenting
4004100513Sru@cindex Indenting environments
4005100513Sru@cindex Environment indentation
4006100513Sru@cindex Example indentation
4007100513Sru@findex exampleindent
4008100513Sru
4009100513SruThe Texinfo processors indent each line of @code{@@example} and similar
4010100513Sruenvironments.  You can use the @code{@@exampleindent} command to specify
4011100513Sruthis indentation.  Write an @code{@@exampleindent} command at the
4012100513Srubeginning of a line followed by either @samp{asis} or a number:
4013100513Sru
4014100513Sru@example
4015100513Sru@@exampleindent @var{indent}
4016100513Sru@end example
4017100513Sru
4018146515Sru@code{@@exampleindent} is ignored for HTML output.  Otherwise, the
4019146515Sruindentation is according to the value of @var{indent}:
4020100513Sru
4021100513Sru@table @asis
4022100513Sru@item @code{asis}
4023100513SruDo not change the existing indentation (not implemented in @TeX{}).
4024100513Sru
4025100513Sru@item 0
4026100513SruOmit all indentation.
4027100513Sru
4028100513Sru@item @var{n}
4029100513SruIndent environments by @var{n} space characters in Info output, by
4030100513Sru@var{n} ems in @TeX{}.
4031100513Sru
4032100513Sru@end table
4033100513Sru
4034146515SruThe default value of @var{indent} is 5 spaces in Info, and 0.4@dmn{in}
4035146515Sruin @TeX{}, which is somewhat less.  (The reduction is to help @TeX{}
4036146515Srufit more characters onto physical lines.)
4037100513Sru
4038100513SruIt is best to write the @code{@@exampleindent} command before the
4039100513Sruend-of-header line at the beginning of a Texinfo file, so the region
4040100513Sruformatting commands indent paragraphs as specified.  @xref{Start of
4041100513SruHeader}.
4042100513Sru
4043100513Sru
404493139Sru@node Software Copying Permissions
404542660Smarkm@section Software Copying Permissions
404642660Smarkm@cindex Software copying permissions
404742660Smarkm@cindex Copying software
404842660Smarkm@cindex Distribution
404942660Smarkm@cindex License agreement
405042660Smarkm
405142660SmarkmIf the Texinfo file has a section containing the ``General Public
4052100513SruLicense'' and the distribution information and a warranty disclaimer for
4053100513Sruthe software that is documented, we recommend placing this right after
4054100513Sruthe `Top' node.  The General Public License is very important to Project
405542660SmarkmGNU software.  It ensures that you and others will continue to have a
4056100513Sruright to use and share the software.
405742660Smarkm
405893139SruThe copying and distribution information and the disclaimer are followed
4059100513Sruby an introduction or else by the first chapter of the manual.
406042660Smarkm
406142660Smarkm@cindex Introduction, as part of file
406242660SmarkmAlthough an introduction is not a required part of a Texinfo file, it
406342660Smarkmis very helpful.  Ideally, it should state clearly and concisely what
406442660Smarkmthe file is about and who would be interested in reading it.  In
406542660Smarkmgeneral, an introduction would follow the licensing and distribution
406642660Smarkminformation, although sometimes people put it earlier in the document.
406742660Smarkm
4068100513Sru
4069100513Sru@node Ending a File
407042660Smarkm@chapter Ending a Texinfo File
407142660Smarkm@cindex Ending a Texinfo file
407242660Smarkm@cindex Texinfo file ending
407342660Smarkm@cindex File ending
407442660Smarkm@findex bye
407542660Smarkm
4076116525SruThe end of a Texinfo file should include commands to create indices,
4077116525Sruand the @code{@@bye} command to mark the last line to be processed.
407842660Smarkm
407942660SmarkmFor example:
408042660Smarkm
408142660Smarkm@example
4082100513Sru@@node Index
4083100513Sru@@unnumbered Index
408442660Smarkm
408542660Smarkm@@printindex cp
408642660Smarkm
408742660Smarkm@@bye
408842660Smarkm@end example
408942660Smarkm
409042660Smarkm@menu
409142660Smarkm* Printing Indices & Menus::    How to print an index in hardcopy and
4092114472Sru                                 generate index menus in Info.
409342660Smarkm* File End::                    How to mark the end of a file.
409442660Smarkm@end menu
409542660Smarkm
4096100513Sru
4097100513Sru@node Printing Indices & Menus
4098100513Sru@section Printing Indices and Menus
409942660Smarkm@cindex Printing an index
410042660Smarkm@cindex Indices, printing and menus
410142660Smarkm@cindex Generating menus with indices
410242660Smarkm@cindex Menus generated with indices
410342660Smarkm
4104100513SruTo print an index means to include it as part of a manual or Info file.
4105100513SruThis does not happen automatically just because you use @code{@@cindex}
4106100513Sruor other index-entry generating commands in the Texinfo file; those just
4107100513Srucause the raw data for the index to be accumulated.  To generate an
4108100513Sruindex, you must include the @code{@@printindex} command at the place in
4109100513Sruthe document where you want the index to appear.  Also, as part of the
4110100513Sruprocess of creating a printed manual, you must run a program called
4111100513Sru@code{texindex} (@pxref{Hardcopy}) to sort the raw data to produce a
4112100513Srusorted index file.  The sorted index file is what is actually used to
4113100513Sruprint the index.
411442660Smarkm
4115146515SruTexinfo offers six separate types of predefined index, which suffice
4116146515Sruin most cases.  @xref{Indices}, for information on this, as well
4117146515Srudefining your own new indices, combining indices, and, most
4118146515Sruimportantly advice on writing the actual index entries.  This section
4119146515Srufocuses on printing indices, which is done with the
4120146515Sru@code{@@printindex} command.
412142660Smarkm
4122146515Sru@findex printindex
4123146515Sru@code{@@printindex} takes one argument, a two-letter index
4124146515Sruabbreviation.  It reads the corresponding sorted index file (for
4125146515Sruprinted output), and formats it appropriately into an index.
412642660Smarkm
4127146515SruThe @code{@@printindex} command does not generate a chapter heading
4128146515Srufor the index, since different manuals have different needs.
4129146515SruConsequently, you should precede the @code{@@printindex} command with
4130146515Srua suitable section or chapter command (usually @code{@@appendix} or
4131146515Sru@code{@@unnumbered}) to supply the chapter heading and put the index
4132146515Sruinto the table of contents.  Precede the chapter heading with an
4133146515Sru@code{@@node} line as usual.
413442660Smarkm
413542660SmarkmFor example:
413642660Smarkm
413742660Smarkm@smallexample
413842660Smarkm@group
4139100513Sru@@node Variable Index
414042660Smarkm@@unnumbered Variable Index
414142660Smarkm
414242660Smarkm@@printindex vr
414342660Smarkm@end group
414442660Smarkm
414542660Smarkm@group
4146100513Sru@@node Concept Index
414742660Smarkm@@unnumbered Concept Index
414842660Smarkm
414942660Smarkm@@printindex cp
415042660Smarkm@end group
415142660Smarkm@end smallexample
415242660Smarkm
4153146515SruIf you have more than one index, we recommend placing the concept index last.
415442660Smarkm
4155146515Sru@itemize
4156146515Sru@item
4157146515SruIn printed output, @code{@@printindex} produces a traditional
4158146515Srutwo-column index, with dot leaders between the index terms and page
4159146515Srunumbers.
416042660Smarkm
4161146515Sru@item
4162146515SruIn Info output, @code{@@printindex} produces a special menu containing
4163146515Sruthe line number of the entry, relative to the start of the node.  Info
4164146515Srureaders can use this to go to the exact line of an entry, not just the
4165146515Srucontaining node.  (Older Info readers will just go to the node.)
4166146515SruHere's an example:
4167100513Sru
4168146515Sru@smallexample
4169146515Sru* First index entry:   Top.   (line  7)
4170146515Sru@end smallexample
4171146515Sru
4172146515Sru@noindent The actual number of spaces is variable, to right-justify
4173146515Sruthe line number; it's been reduced here to make the line fit in the
4174146515Sruprinted manual.
4175146515Sru
4176146515Sru@item
4177146515SruIn plain text output, @code{@@printindex} produces the same menu, but
4178146515Sruthe line numbers are relative to the start of the file, since that's
4179146515Srumore convenient for that format.
4180146515Sru
4181146515Sru@item
4182146515SruIn HTML and Docbook output, @code{@@printindex} produces links
4183146515Sruto the index entries.
4184146515Sru
4185146515Sru@item
4186146515SruIn XML output, it simply records the index to be printed.
4187146515Sru@end itemize
4188146515Sru
4189146515SruIt's not possible to generate an index when writing to standard
4190146515Sruoutput; @command{makeinfo} generates a warning in this case.
4191146515Sru
4192146515Sru
419356160Sru@node File End
419442660Smarkm@section @code{@@bye} File Ending
419542660Smarkm@findex bye
419642660Smarkm
4197114472SruAn @code{@@bye} command terminates Texinfo processing.  None of the
4198114472Sruformatters read anything following @code{@@bye}.  The @code{@@bye}
4199114472Srucommand should be on a line by itself.
420042660Smarkm
4201100513SruIf you wish, you may follow the @code{@@bye} line with notes. These
4202100513Srunotes will not be formatted and will not appear in either Info or a
4203100513Sruprinted manual; it is as if text after @code{@@bye} were within
4204100513Sru@code{@@ignore} @dots{} @code{@@end ignore}.  Also, you may follow the
4205100513Sru@code{@@bye} line with a local variables list for Emacs.
4206100513Sru@xref{Compile-Command, , Using Local Variables and the Compile Command},
4207100513Srufor more information.
420842660Smarkm
420956160Sru
421056160Sru@node Structuring
421142660Smarkm@chapter Chapter Structuring
421242660Smarkm@cindex Chapter structuring
421342660Smarkm@cindex Structuring of chapters
421442660Smarkm
421542660SmarkmThe @dfn{chapter structuring} commands divide a document into a hierarchy of
421642660Smarkmchapters, sections, subsections, and subsubsections.  These commands
421742660Smarkmgenerate large headings; they also provide information for the table
421842660Smarkmof contents of a printed manual (@pxref{Contents, , Generating a Table
421942660Smarkmof Contents}).@refill
422042660Smarkm
422142660SmarkmThe chapter structuring commands do not create an Info node structure,
422242660Smarkmso normally you should put an @code{@@node} command immediately before
422342660Smarkmeach chapter structuring command (@pxref{Nodes}).  The only time you
422442660Smarkmare likely to use the chapter structuring commands without using the
422542660Smarkmnode structuring commands is if you are writing a document that
422642660Smarkmcontains no cross references and will never be transformed into Info
422742660Smarkmformat.@refill
422842660Smarkm
422942660SmarkmIt is unlikely that you will ever write a Texinfo file that is
423042660Smarkmintended only as an Info file and not as a printable document.  If you
423142660Smarkmdo, you might still use chapter structuring commands to create a
423242660Smarkmheading at the top of each node---but you don't need to.@refill
423342660Smarkm
423442660Smarkm@menu
423542660Smarkm* Tree Structuring::            A manual is like an upside down tree @dots{}
423642660Smarkm* Structuring Command Types::   How to divide a manual into parts.
423742660Smarkm* makeinfo top::                The @code{@@top} command, part of the `Top' node.
4238116525Sru* chapter::
4239116525Sru* unnumbered & appendix::
4240116525Sru* majorheading & chapheading::
4241116525Sru* section::
4242116525Sru* unnumberedsec appendixsec heading::
4243116525Sru* subsection::
4244116525Sru* unnumberedsubsec appendixsubsec subheading::
424542660Smarkm* subsubsection::               Commands for the lowest level sections.
424642660Smarkm* Raise/lower sections::        How to change commands' hierarchical level.
424742660Smarkm@end menu
424842660Smarkm
424956160Sru
425056160Sru@node Tree Structuring
425142660Smarkm@section Tree Structure of Sections
425242660Smarkm@cindex Tree structuring
425342660Smarkm
425442660SmarkmA Texinfo file is usually structured like a book with chapters,
425542660Smarkmsections, subsections, and the like.  This structure can be visualized
425642660Smarkmas a tree (or rather as an upside-down tree) with the root at the top
425742660Smarkmand the levels corresponding to chapters, sections, subsection, and
425842660Smarkmsubsubsections.@refill
425942660Smarkm
426042660SmarkmHere is a diagram that shows a Texinfo file with three chapters,
426142660Smarkmeach of which has two sections.@refill
426242660Smarkm
426342660Smarkm@example
426442660Smarkm@group
4265114472Sru                         Top
4266114472Sru                          |
4267114472Sru        -------------------------------------
4268114472Sru       |                  |                  |
4269114472Sru    Chapter 1          Chapter 2          Chapter 3
4270114472Sru       |                  |                  |
4271114472Sru    --------           --------           --------
4272114472Sru   |        |         |        |         |        |
4273114472SruSection  Section   Section  Section   Section  Section
4274114472Sru  1.1      1.2       2.1      2.2       3.1      3.2
427542660Smarkm
427642660Smarkm@end group
427742660Smarkm@end example
427842660Smarkm
427942660SmarkmIn a Texinfo file that has this structure, the beginning of Chapter 2
428042660Smarkmlooks like this:@refill
428142660Smarkm
428242660Smarkm@example
428342660Smarkm@group
428442660Smarkm@@node    Chapter 2,  Chapter 3, Chapter 1, top
428542660Smarkm@@chapter Chapter 2
428642660Smarkm@end group
428742660Smarkm@end example
428842660Smarkm
428942660SmarkmThe chapter structuring commands are described in the sections that
429042660Smarkmfollow; the @code{@@node} and @code{@@menu} commands are described in
429142660Smarkmfollowing chapters. (@xref{Nodes}, and see @ref{Menus}.)@refill
429242660Smarkm
429342660Smarkm
429456160Sru@node Structuring Command Types
429556160Sru@section Structuring Command Types
429656160Sru
429742660SmarkmThe chapter structuring commands fall into four groups or series, each
429842660Smarkmof which contains structuring commands corresponding to the
429942660Smarkmhierarchical levels of chapters, sections, subsections, and
430042660Smarkmsubsubsections.@refill
430142660Smarkm
430242660SmarkmThe four groups are the @code{@@chapter} series, the
430342660Smarkm@code{@@unnumbered} series, the @code{@@appendix} series, and the
430442660Smarkm@code{@@heading} series.@refill
430542660Smarkm
430642660SmarkmEach command produces titles that have a different appearance on the
430742660Smarkmprinted page or Info file; only some of the commands produce
430842660Smarkmtitles that are listed in the table of contents of a printed book or
430942660Smarkmmanual.@refill
431042660Smarkm
431142660Smarkm@itemize @bullet
431242660Smarkm@item
431342660SmarkmThe @code{@@chapter} and @code{@@appendix} series of commands produce
431442660Smarkmnumbered or lettered entries both in the body of a printed work and in
431542660Smarkmits table of contents.@refill
431642660Smarkm
431742660Smarkm@item
431842660SmarkmThe @code{@@unnumbered} series of commands produce unnumbered entries
431942660Smarkmboth in the body of a printed work and in its table of contents.  The
432042660Smarkm@code{@@top} command, which has a special use, is a member of this
4321146515Sruseries (@pxref{makeinfo top, , @code{@@top}}).  An @code{@@unnumbered}
4322146515Srusection should be associated with a node and be a normal part of the
4323146515Srudocument structure.
432442660Smarkm
432542660Smarkm@item
4326146515SruThe @code{@@heading} series of commands produce simple unnumbered
4327146515Sruheadings that do not appear in a table of contents, are not associated
4328146515Sruwith nodes, and cannot be cross-referenced.  The heading commands
4329146515Srunever start a new page.
433042660Smarkm
433142660Smarkm@item
4332146515SruThe @code{@@majorheading} command is similar to @code{@@chapheading},
4333146515Sruexcept that it generates a larger vertical whitespace before the
4334146515Sruheading.
433542660Smarkm
433642660Smarkm@item
433742660SmarkmWhen an @code{@@setchapternewpage} command says to do so, the
433842660Smarkm@code{@@chapter}, @code{@@unnumbered}, and @code{@@appendix} commands
433942660Smarkmstart new pages in the printed manual; the @code{@@heading} commands
434042660Smarkmdo not.@refill
434142660Smarkm@end itemize
434242660Smarkm
434393139SruHere are the four groups of chapter structuring commands:
434442660Smarkm
434593139Sru@tex
434693139Sru{\globaldefs = 1 \smallfonts}
434793139Sru@end tex
434893139Sru
434956160Sru@multitable @columnfractions .19 .30 .29 .22
435093139Sru@item                        @tab                              @tab                       @tab No new page
435193139Sru@item @i{Numbered}           @tab @i{Unnumbered}               @tab @i{Lettered/numbered} @tab @i{Unnumbered}
4352146515Sru@item In contents            @tab In contents                  @tab In contents           @tab Not in contents
435393139Sru@item                        @tab @code{@@top}                 @tab                       @tab @code{@@majorheading}
435493139Sru@item @code{@@chapter}       @tab @code{@@unnumbered}          @tab @code{@@appendix} @tab @code{@@chapheading}
435593139Sru@item @code{@@section}       @tab @code{@@unnumberedsec}       @tab @code{@@appendixsec} @tab @code{@@heading}
435693139Sru@item @code{@@subsection}    @tab @code{@@unnumberedsubsec}    @tab @code{@@appendixsubsec} @tab @code{@@subheading}
435793139Sru@item @code{@@subsubsection} @tab @code{@@unnumberedsubsubsec} @tab @code{@@appendixsubsubsec} @tab @code{@@subsubheading}
435856160Sru@end multitable
435993139Sru@tex
436093139Sru{\globaldefs = 1 \textfonts}
436193139Sru@end tex
436242660Smarkm
436342660Smarkm
436456160Sru@node makeinfo top
436542660Smarkm@section @code{@@top}
436642660Smarkm
436742660SmarkmThe @code{@@top} command is a special sectioning command that you use
436842660Smarkmonly after an @samp{@@node Top} line at the beginning of a Texinfo file.
436956160SruThe @code{@@top} command tells the @code{makeinfo} formatter which node
437056160Sruis the `Top' node, so it can use it as the root of the node tree if your
4371146515Srumanual uses implicit node pointers.  It has the same typesetting effect as
437256160Sru@code{@@unnumbered} (@pxref{unnumbered & appendix, , @code{@@unnumbered}
437356160Sruand @code{@@appendix}}).  For detailed information, see @ref{makeinfo
437456160Srutop command, , The @code{@@top} Command}.
437542660Smarkm
437656160SruThe @code{@@top} node and its menu (if any) is conventionally wrapped in
437756160Sruan @code{@@ifnottex} conditional so that it will appear only in Info and
437856160SruHTML output, not @TeX{}.
437956160Sru
438056160Sru
4381146515Sru@node chapter
438242660Smarkm@comment  node-name,  next,  previous,  up
438342660Smarkm@section @code{@@chapter}
438442660Smarkm@findex chapter
438542660Smarkm
438642660Smarkm@code{@@chapter} identifies a chapter in the document.  Write the
438742660Smarkmcommand at the beginning of a line and follow it on the same line by
438842660Smarkmthe title of the chapter.@refill
438942660Smarkm
439042660SmarkmFor example, this chapter in this manual is entitled ``Chapter
439142660SmarkmStructuring''; the @code{@@chapter} line looks like this:@refill
439242660Smarkm
439342660Smarkm@example
439442660Smarkm@@chapter Chapter Structuring
439542660Smarkm@end example
439642660Smarkm
439742660SmarkmIn @TeX{}, the @code{@@chapter} command creates a chapter in the
439842660Smarkmdocument, specifying the chapter title.  The chapter is numbered
439942660Smarkmautomatically.@refill
440042660Smarkm
440142660SmarkmIn Info, the @code{@@chapter} command causes the title to appear on a
440242660Smarkmline by itself, with a line of asterisks inserted underneath.  Thus,
440342660Smarkmin Info, the above example produces the following output:@refill
440442660Smarkm
440542660Smarkm@example
440642660SmarkmChapter Structuring
440742660Smarkm*******************
440842660Smarkm@end example
440942660Smarkm
441042660Smarkm@findex centerchap
441142660SmarkmTexinfo also provides a command @code{@@centerchap}, which is analogous
441242660Smarkmto @code{@@unnumbered}, but centers its argument in the printed output.
441342660SmarkmThis kind of stylistic choice is not usually offered by Texinfo.
441442660Smarkm@c but the Hacker's Dictionary wanted it ...
441542660Smarkm
441642660Smarkm
441756160Sru@node unnumbered & appendix
441856160Sru@section @code{@@unnumbered} and @code{@@appendix}
441942660Smarkm@findex unnumbered
442042660Smarkm@findex appendix
442142660Smarkm
442242660SmarkmUse the @code{@@unnumbered} command to create a chapter that appears
442342660Smarkmin a printed manual without chapter numbers of any kind.  Use the
442442660Smarkm@code{@@appendix} command to create an appendix in a printed manual
442542660Smarkmthat is labelled by letter instead of by number.@refill
442642660Smarkm
442742660SmarkmFor Info file output, the @code{@@unnumbered} and @code{@@appendix}
442842660Smarkmcommands are equivalent to @code{@@chapter}: the title is printed on a
442942660Smarkmline by itself with a line of asterisks underneath.  (@xref{chapter, ,
443042660Smarkm@code{@@chapter}}.)@refill
443142660Smarkm
443242660SmarkmTo create an appendix or an unnumbered chapter, write an
443342660Smarkm@code{@@appendix} or @code{@@unnumbered} command at the beginning of a
443442660Smarkmline and follow it on the same line by the title, as you would if you
443542660Smarkmwere creating a chapter.@refill
443642660Smarkm
443742660Smarkm
4438146515Sru@node majorheading & chapheading
443942660Smarkm@section @code{@@majorheading}, @code{@@chapheading}
444042660Smarkm@findex majorheading
444142660Smarkm@findex chapheading
444242660Smarkm
444342660SmarkmThe @code{@@majorheading} and @code{@@chapheading} commands put
444442660Smarkmchapter-like headings in the body of a document.@refill
444542660Smarkm
444642660SmarkmHowever, neither command causes @TeX{} to produce a numbered heading
444742660Smarkmor an entry in the table of contents; and neither command causes
444842660Smarkm@TeX{} to start a new page in a printed manual.@refill
444942660Smarkm
445042660SmarkmIn @TeX{}, an @code{@@majorheading} command generates a larger vertical
445142660Smarkmwhitespace before the heading than an @code{@@chapheading} command but
4452146515Sruis otherwise the same.
445342660Smarkm
445442660SmarkmIn Info,
445542660Smarkmthe @code{@@majorheading} and
445642660Smarkm@code{@@chapheading} commands are equivalent to
445742660Smarkm@code{@@chapter}: the title is printed on a line by itself with a line
445842660Smarkmof asterisks underneath.  (@xref{chapter, , @code{@@chapter}}.)@refill
445942660Smarkm
4460146515Sru
4461146515Sru@node section
446242660Smarkm@comment  node-name,  next,  previous,  up
446342660Smarkm@section @code{@@section}
446442660Smarkm@findex section
446542660Smarkm
446642660SmarkmIn a printed manual, an @code{@@section} command identifies a
446742660Smarkmnumbered section within a chapter.  The section title appears in the
446842660Smarkmtable of contents.  In Info, an @code{@@section} command provides a
446942660Smarkmtitle for a segment of text, underlined with @samp{=}.@refill
447042660Smarkm
447142660SmarkmThis section is headed with an @code{@@section} command and looks like
447242660Smarkmthis in the Texinfo file:@refill
447342660Smarkm
447442660Smarkm@example
447542660Smarkm@@section @@code@{@@@@section@}
447642660Smarkm@end example
447742660Smarkm
447842660SmarkmTo create a section, write the @code{@@section} command at the
447942660Smarkmbeginning of a line and follow it on the same line by the section
448042660Smarkmtitle.@refill
448142660Smarkm
448242660SmarkmThus,
448342660Smarkm
448442660Smarkm@example
448542660Smarkm@@section This is a section
448642660Smarkm@end example
448742660Smarkm
448842660Smarkm@noindent
448942660Smarkmproduces
449042660Smarkm
449142660Smarkm@example
449242660Smarkm@group
449342660SmarkmThis is a section
449442660Smarkm=================
449542660Smarkm@end group
449642660Smarkm@end example
449742660Smarkm
449842660Smarkm@noindent
449942660Smarkmin Info.
450042660Smarkm
4501146515Sru
4502146515Sru@node unnumberedsec appendixsec heading
450342660Smarkm@comment  node-name,  next,  previous,  up
450442660Smarkm@section @code{@@unnumberedsec}, @code{@@appendixsec}, @code{@@heading}
450542660Smarkm@findex unnumberedsec
450642660Smarkm@findex appendixsec
450742660Smarkm@findex heading
450842660Smarkm
450942660SmarkmThe @code{@@unnumberedsec}, @code{@@appendixsec}, and @code{@@heading}
451042660Smarkmcommands are, respectively, the unnumbered, appendix-like, and
451142660Smarkmheading-like equivalents of the @code{@@section} command.
451242660Smarkm(@xref{section, , @code{@@section}}.)@refill
451342660Smarkm
451442660Smarkm@table @code
451542660Smarkm@item @@unnumberedsec
451642660SmarkmThe @code{@@unnumberedsec} command may be used within an
451742660Smarkmunnumbered chapter or within a regular chapter or appendix to
451842660Smarkmprovide an unnumbered section.@refill
451942660Smarkm
452042660Smarkm@item @@appendixsec
452142660Smarkm@itemx @@appendixsection
452242660Smarkm@code{@@appendixsection} is a longer spelling of the
452342660Smarkm@code{@@appendixsec} command; the two are synonymous.@refill
452442660Smarkm@findex appendixsection
452542660Smarkm
452642660SmarkmConventionally, the @code{@@appendixsec} or @code{@@appendixsection}
452742660Smarkmcommand is used only within appendices.@refill
452842660Smarkm
452942660Smarkm@item @@heading
453042660SmarkmYou may use the @code{@@heading} command anywhere you wish for a
453142660Smarkmsection-style heading that will not appear in the table of contents.@refill
453242660Smarkm@end table
453342660Smarkm
4534146515Sru
4535146515Sru@node subsection
453642660Smarkm@comment  node-name,  next,  previous,  up
453742660Smarkm@section The @code{@@subsection} Command
453842660Smarkm@findex subsection
453942660Smarkm
454042660SmarkmSubsections are to sections as sections are to chapters.
454142660Smarkm(@xref{section, , @code{@@section}}.)  In Info, subsection titles are
454242660Smarkmunderlined with @samp{-}.  For example,@refill
454342660Smarkm
454442660Smarkm@example
454542660Smarkm@@subsection This is a subsection
454642660Smarkm@end example
454742660Smarkm
454842660Smarkm@noindent
454942660Smarkmproduces
455042660Smarkm
455142660Smarkm@example
455242660Smarkm@group
455342660SmarkmThis is a subsection
455442660Smarkm--------------------
455542660Smarkm@end group
455642660Smarkm@end example
455742660Smarkm
455842660SmarkmIn a printed manual, subsections are listed in the table of contents
455942660Smarkmand are numbered three levels deep.@refill
456042660Smarkm
4561146515Sru@node unnumberedsubsec appendixsubsec subheading
456242660Smarkm@comment  node-name,  next,  previous,  up
456342660Smarkm@section The @code{@@subsection}-like Commands
456442660Smarkm@cindex Subsection-like commands
456542660Smarkm@findex unnumberedsubsec
456642660Smarkm@findex appendixsubsec
456742660Smarkm@findex subheading
456842660Smarkm
456942660SmarkmThe @code{@@unnumberedsubsec}, @code{@@appendixsubsec}, and
457042660Smarkm@code{@@subheading} commands are, respectively, the unnumbered,
457142660Smarkmappendix-like, and heading-like equivalents of the @code{@@subsection}
457242660Smarkmcommand.  (@xref{subsection, , @code{@@subsection}}.)@refill
457342660Smarkm
457442660SmarkmIn Info, the @code{@@subsection}-like commands generate a title
457542660Smarkmunderlined with hyphens.  In a printed manual, an @code{@@subheading}
457642660Smarkmcommand produces a heading like that of a subsection except that it is
457742660Smarkmnot numbered and does not appear in the table of contents.  Similarly,
457842660Smarkman @code{@@unnumberedsubsec} command produces an unnumbered heading like
457942660Smarkmthat of a subsection and an @code{@@appendixsubsec} command produces a
458042660Smarkmsubsection-like heading labelled with a letter and numbers; both of
458142660Smarkmthese commands produce headings that appear in the table of
458242660Smarkmcontents.@refill
458342660Smarkm
4584146515Sru@node subsubsection
458542660Smarkm@section The `subsub' Commands
458642660Smarkm@cindex Subsub commands
458742660Smarkm@findex subsubsection
458842660Smarkm@findex unnumberedsubsubsec
458942660Smarkm@findex appendixsubsubsec
459042660Smarkm@findex subsubheading
459142660Smarkm
459242660SmarkmThe fourth and lowest level sectioning commands in Texinfo are the
459342660Smarkm`subsub' commands.  They are:@refill
459442660Smarkm
459542660Smarkm@table @code
459642660Smarkm@item @@subsubsection
459742660SmarkmSubsubsections are to subsections as subsections are to sections.
459842660Smarkm(@xref{subsection, , @code{@@subsection}}.)  In a printed manual,
459942660Smarkmsubsubsection titles appear in the table of contents and are numbered
460042660Smarkmfour levels deep.@refill
460142660Smarkm
460242660Smarkm@item @@unnumberedsubsubsec
460342660SmarkmUnnumbered subsubsection titles appear in the table of contents of a
460442660Smarkmprinted manual, but lack numbers.  Otherwise, unnumbered
460542660Smarkmsubsubsections are the same as subsubsections.  In Info, unnumbered
460642660Smarkmsubsubsections look exactly like ordinary subsubsections.@refill
460742660Smarkm
460842660Smarkm@item @@appendixsubsubsec
460942660SmarkmConventionally, appendix commands are used only for appendices and are
461042660Smarkmlettered and numbered appropriately in a printed manual.  They also
461142660Smarkmappear in the table of contents.  In Info, appendix subsubsections look
461242660Smarkmexactly like ordinary subsubsections.@refill
461342660Smarkm
461442660Smarkm@item @@subsubheading
461542660SmarkmThe @code{@@subsubheading} command may be used anywhere that you need
461642660Smarkma small heading that will not appear in the table of contents.  In
461742660SmarkmInfo, subsubheadings look exactly like ordinary subsubsection
461842660Smarkmheadings.@refill
461942660Smarkm@end table
462042660Smarkm
462142660SmarkmIn Info,  `subsub' titles are underlined with periods.
462242660SmarkmFor example,@refill
462342660Smarkm
462442660Smarkm@example
462542660Smarkm@@subsubsection This is a subsubsection
462642660Smarkm@end example
462742660Smarkm
462842660Smarkm@noindent
462942660Smarkmproduces
463042660Smarkm
463142660Smarkm@example
463242660Smarkm@group
463342660SmarkmThis is a subsubsection
463442660Smarkm.......................
463542660Smarkm@end group
463642660Smarkm@end example
463742660Smarkm
4638146515Sru
4639146515Sru@node Raise/lower sections
464042660Smarkm@section @code{@@raisesections} and @code{@@lowersections}
464142660Smarkm@findex raisesections
464242660Smarkm@findex lowersections
464342660Smarkm@cindex Raising and lowering sections
4644146515Sru@cindex Lowering and raising sections
464542660Smarkm@cindex Sections, raising and lowering
464642660Smarkm
4647146515SruThe @code{@@raisesections} and @code{@@lowersections} commands
4648146515Sruimplicitly raise and lower the hierarchical level of following
4649146515Sruchapters, sections and the other sectioning commands.
465042660Smarkm
4651146515SruThat is, the @code{@@raisesections} command changes sections to
4652146515Sruchapters, subsections to sections, and so on.  Conversely, the
4653146515Sru@code{@@lowersections} command changes chapters to sections, sections
4654146515Sruto subsections, and so on.  Thus, an @code{@@lowersections} command
4655146515Srucancels an @code{@@raisesections} command, and vice versa.
4656146515Sru
465742660Smarkm@cindex Include files, and section levels
4658146515SruYou can use @code{@@lowersections} to include text written as an outer
4659146515Sruor standalone Texinfo file in another Texinfo file as an inner,
4660146515Sruincluded file.  Typical usage looks like this:
466142660Smarkm
466242660Smarkm@example
4663146515Sru@@lowersections
4664146515Sru@@include somefile.texi
4665146515Sru@@raisesections
466642660Smarkm@end example
466742660Smarkm
4668146515Sru@noindent (Without the @code{@@raisesections}, all the subsequent
4669146515Srusections in the document would be lowered.)
467042660Smarkm
4671146515SruIf the included file being lowered has a @code{@@top} node, you'll
4672146515Sruneed to conditionalize its inclusion with a flag (@pxref{set value}).
467342660Smarkm
4674146515SruAnother difficulty can arise with documents that use the (recommended)
4675146515Srufeature of @command{makeinfo} for implicitly determining node
4676146515Srupointers.  Since @command{makeinfo} must assume a hierarchically
4677146515Sruorganized document to determine the pointers, you cannot just
4678146515Sruarbitrarily sprinkle @code{@@raisesections} and @code{@@lowersections}
4679146515Srucommands in the document.  The final result has to have menus that
4680146515Srutake the raising and lowering into account.  Therefore, as a practical
4681146515Srumatter, you generally only want to raise or lower large chunks,
4682146515Sruusually in external files as shown above.
468342660Smarkm
4684146515SruRepeated use of the commands continue to raise or lower the
4685146515Sruhierarchical level a step at a time.  An attempt to raise above
4686146515Sru`chapter' reproduces chapter commands; an attempt to lower below
4687146515Sru`subsubsection' reproduces subsubsection commands.  Also, lowered
4688146515Srusubsubsections and raised chapters will not work with
4689146515Sru@command{makeinfo}'s feature of implicitly determining node pointers,
4690146515Srusince the menu structure won't be correct.
469142660Smarkm
4692146515SruWrite each @code{@@raisesections} and @code{@@lowersections} command
4693146515Sruon a line of its own.
469442660Smarkm
469542660Smarkm
469656160Sru@node Nodes
469742660Smarkm@chapter Nodes
469842660Smarkm
469942660Smarkm@dfn{Nodes} are the primary segments of a Texinfo file.  They do not
4700146515Sruin and of themselves impose a hierarchical or any other kind of
4701146515Srustructure on a file.  Nodes contain @dfn{node pointers} that name
4702146515Sruother nodes, and can contain @dfn{menus} which are lists of nodes.  In
4703146515SruInfo, the movement commands can carry you to a pointed-to node or to a
4704146515Srunode listed in a menu.
470542660Smarkm
4706146515SruNode pointers and menus provide structure for Info files just as
4707146515Sruchapters, sections, subsections, and the like, provide structure for
4708146515Sruprinted books.
4709146515Sru
4710146515SruBecause node names are used in cross-references, it is not desirable
4711146515Sruto casually change them.  Such name changes invalidate references from
4712146515Sruother manuals, from mail archives, and so on.
4713146515Sru
471442660Smarkm@menu
471542660Smarkm* Two Paths::                   Different commands to structure
4716114472Sru                                 Info output and printed output.
471742660Smarkm* Node Menu Illustration::      A diagram, and sample nodes and menus.
471856160Sru* node::                        Creating nodes, in detail.
471956160Sru* makeinfo Pointer Creation::   Letting makeinfo determine node pointers.
472056160Sru* anchor::                      Defining arbitrary cross-reference targets.
472142660Smarkm@end menu
472242660Smarkm
472342660Smarkm
472456160Sru@node Two Paths
472556160Sru@section Two Paths
472656160Sru
472742660SmarkmThe node and menu commands and the chapter structuring commands are
472856160Srutechnically independent of each other:
472942660Smarkm
473042660Smarkm@itemize @bullet
473142660Smarkm@item
473242660SmarkmIn Info, node and menu commands provide structure.  The chapter
473342660Smarkmstructuring commands generate headings with different kinds of
473442660Smarkmunderlining---asterisks for chapters, hyphens for sections, and so on;
473542660Smarkmthey do nothing else.@refill
473642660Smarkm
473742660Smarkm@item
473842660SmarkmIn @TeX{}, the chapter structuring commands generate chapter and section
473942660Smarkmnumbers and tables of contents.  The node and menu commands provide
474042660Smarkminformation for cross references; they do nothing else.@refill
474142660Smarkm@end itemize
474242660Smarkm
474342660SmarkmYou can use node pointers and menus to structure an Info file any way
474442660Smarkmyou want; and you can write a Texinfo file so that its Info output has a
474556160Srudifferent structure than its printed output.  However, virtually all
474656160SruTexinfo files are written such that the structure for the Info output
474756160Srucorresponds to the structure for the printed output.  It is neither
474856160Sruconvenient nor understandable to the reader to do otherwise.@refill
474942660Smarkm
475042660SmarkmGenerally, printed output is structured in a tree-like hierarchy in
475142660Smarkmwhich the chapters are the major limbs from which the sections branch
475242660Smarkmout.  Similarly, node pointers and menus are organized to create a
475342660Smarkmmatching structure in the Info output.@refill
475442660Smarkm
475556160Sru
475656160Sru@node Node Menu Illustration
475742660Smarkm@section Node and Menu Illustration
475842660Smarkm
475942660SmarkmHere is a copy of the diagram shown earlier that illustrates a Texinfo
476042660Smarkmfile with three chapters, each of which contains two sections.@refill
476142660Smarkm
476256160SruThe ``root'' is at the top of the diagram and the ``leaves'' are at the
476356160Srubottom.  This is how such a diagram is drawn conventionally; it
476456160Sruillustrates an upside-down tree.  For this reason, the root node is
476542660Smarkmcalled the `Top' node, and `Up' node pointers carry you closer to the
476642660Smarkmroot.@refill
476742660Smarkm
476842660Smarkm@example
476942660Smarkm@group
4770114472Sru                         Top
4771114472Sru                          |
4772114472Sru        -------------------------------------
4773114472Sru       |                  |                  |
4774114472Sru    Chapter 1          Chapter 2          Chapter 3
4775114472Sru       |                  |                  |
4776114472Sru    --------           --------           --------
4777114472Sru   |        |         |        |         |        |
4778114472SruSection  Section   Section  Section   Section  Section
4779114472Sru  1.1      1.2       2.1      2.2       3.1      3.2
478042660Smarkm@end group
478142660Smarkm@end example
478242660Smarkm
478356160SruThe fully-written command to start Chapter 2 would be this:
478442660Smarkm
478542660Smarkm@example
478642660Smarkm@group
478756160Sru@@node     Chapter 2,  Chapter 3, Chapter 1, Top
478842660Smarkm@@comment  node-name,  next,      previous,  up
478942660Smarkm@end group
479042660Smarkm@end example
479142660Smarkm
479242660Smarkm@noindent
479356160SruThis @code{@@node} line says that the name of this node is ``Chapter
479456160Sru2'', the name of the `Next' node is ``Chapter 3'', the name of the
479556160Sru`Previous' node is ``Chapter 1'', and the name of the `Up' node is
479656160Sru``Top''.  You can omit writing out these node names if your document is
479756160Sruhierarchically organized (@pxref{makeinfo Pointer Creation}), but the
479856160Srupointer relationships still obtain.
479942660Smarkm
4800146515Sru@quotation Note
480142660Smarkm@strong{Please Note:} `Next' refers to the next node at the same
480242660Smarkmhierarchical level in the manual, not necessarily to the next node
480342660Smarkmwithin the Texinfo file.  In the Texinfo file, the subsequent node may
480456160Srube at a lower level---a section-level node most often follows a
480556160Sruchapter-level node, for example.  `Next' and `Previous' refer to nodes
480656160Sruat the @emph{same} hierarchical level.  (The `Top' node contains the
480756160Sruexception to this rule.  Since the `Top' node is the only node at that
480856160Srulevel, `Next' refers to the first following node, which is almost always
480956160Srua chapter or chapter-level node.)@refill
481042660Smarkm@end quotation
481142660Smarkm
481242660SmarkmTo go to Sections 2.1 and 2.2 using Info, you need a menu inside Chapter
481342660Smarkm2.  (@xref{Menus}.)  You would write the menu just
481442660Smarkmbefore the beginning of Section 2.1, like this:@refill
481542660Smarkm
481642660Smarkm@example
481742660Smarkm@group
4818114472Sru   @@menu
4819114472Sru   * Sect. 2.1::    Description of this section.
4820114472Sru   * Sect. 2.2::
4821114472Sru   @@end menu
482242660Smarkm@end group
482342660Smarkm@end example
482442660Smarkm
482542660SmarkmWrite the node for Sect. 2.1 like this:@refill
482642660Smarkm
482742660Smarkm@example
482842660Smarkm@group
4829114472Sru   @@node     Sect. 2.1, Sect. 2.2, Chapter 2, Chapter 2
4830114472Sru   @@comment  node-name, next,      previous,  up
483142660Smarkm@end group
483242660Smarkm@end example
483342660Smarkm
483442660SmarkmIn Info format, the `Next' and `Previous' pointers of a node usually
483542660Smarkmlead to other nodes at the same level---from chapter to chapter or from
483642660Smarkmsection to section (sometimes, as shown, the `Previous' pointer points
483742660Smarkmup); an `Up' pointer usually leads to a node at the level above (closer
483842660Smarkmto the `Top' node); and a `Menu' leads to nodes at a level below (closer
483942660Smarkmto `leaves').  (A cross reference can point to a node at any level;
484042660Smarkmsee @ref{Cross References}.)@refill
484142660Smarkm
484242660SmarkmUsually, an @code{@@node} command and a chapter structuring command are
484342660Smarkmused in sequence, along with indexing commands.  (You may follow the
484442660Smarkm@code{@@node} line with a comment line that reminds you which pointer is
484542660Smarkmwhich.)@refill
484642660Smarkm
484742660SmarkmHere is the beginning of the chapter in this manual called ``Ending a
484842660SmarkmTexinfo File''.  This shows an @code{@@node} line followed by a comment
484942660Smarkmline, an @code{@@chapter} line, and then by indexing lines.@refill
485042660Smarkm
485142660Smarkm@example
485242660Smarkm@group
485342660Smarkm@@node    Ending a File, Structuring, Beginning a File, Top
485442660Smarkm@@comment node-name,     next,        previous,         up
485542660Smarkm@@chapter Ending a Texinfo File
485642660Smarkm@@cindex Ending a Texinfo file
485742660Smarkm@@cindex Texinfo file ending
485842660Smarkm@@cindex File ending
485942660Smarkm@end group
486042660Smarkm@end example
486142660Smarkm
486256160Sru
486356160Sru@node node
486442660Smarkm@section The @code{@@node} Command
486542660Smarkm
486642660Smarkm@cindex Node, defined
486756160Sru@findex node
486856160Sru
486942660SmarkmA @dfn{node} is a segment of text that begins at an @code{@@node}
487042660Smarkmcommand and continues until the next @code{@@node} command.  The
487142660Smarkmdefinition of node is different from that for chapter or section.  A
487242660Smarkmchapter may contain sections and a section may contain subsections;
487342660Smarkmbut a node cannot contain subnodes; the text of a node continues only
487442660Smarkmuntil the next @code{@@node} command in the file.  A node usually
487542660Smarkmcontains only one chapter structuring command, the one that follows
487642660Smarkmthe @code{@@node} line.  On the other hand, in printed output nodes
487742660Smarkmare used only for cross references, so a chapter or section may
487842660Smarkmcontain any number of nodes.  Indeed, a chapter usually contains
487942660Smarkmseveral nodes, one for each section, subsection, and
4880114472Srusubsubsection.
488142660Smarkm
488242660SmarkmTo create a node, write an @code{@@node} command at the beginning of a
488356160Sruline, and follow it with up to four arguments, separated by commas, on
488456160Sruthe rest of the same line.  The first argument is required; it is the
488556160Sruname of this node.  The subsequent arguments are the names of the
488656160Sru`Next', `Previous', and `Up' pointers, in that order, and may be omitted
488756160Sruif your Texinfo document is hierarchically organized (@pxref{makeinfo
488856160SruPointer Creation}).
488956160Sru
489056160SruYou may insert spaces before each name if you wish; the spaces are
4891114472Sruignored.  You must write the name of the node and (if present) the names
4892114472Sruof the `Next', `Previous', and `Up' pointers all on the same line.
4893114472SruOtherwise, the formatters fail.  (@inforef{Top, info, info}, for more
4894114472Sruinformation about nodes in Info.)
489542660Smarkm
489642660SmarkmUsually, you write one of the chapter-structuring command lines
489742660Smarkmimmediately after an @code{@@node} line---for example, an
489842660Smarkm@code{@@section} or @code{@@subsection} line.  (@xref{Structuring
489956160SruCommand Types}.)
490042660Smarkm
4901146515Sru@quotation Note
4902146515SruThe GNU Emacs Texinfo mode updating commands work
490342660Smarkmonly with Texinfo files in which @code{@@node} lines are followed by chapter
4904114472Srustructuring lines.  @xref{Updating Requirements}.
490542660Smarkm@end quotation
490642660Smarkm
490742660Smarkm@TeX{} uses @code{@@node} lines to identify the names to use for cross
490842660Smarkmreferences.  For this reason, you must write @code{@@node} lines in a
490942660SmarkmTexinfo file that you intend to format for printing, even if you do not
491042660Smarkmintend to format it for Info.  (Cross references, such as the one at the
491156160Sruend of this sentence, are made with @code{@@xref} and related commands;
4912114472Srusee @ref{Cross References}.)
491342660Smarkm
491442660Smarkm@menu
491542660Smarkm* Node Names::                  How to choose node and pointer names.
491642660Smarkm* Writing a Node::              How to write an @code{@@node} line.
491742660Smarkm* Node Line Tips::              Keep names short.
491842660Smarkm* Node Line Requirements::      Keep names unique, without @@-commands.
491942660Smarkm* First Node::                  How to write a `Top' node.
492042660Smarkm* makeinfo top command::        How to use the @code{@@top} command.
492142660Smarkm@end menu
492242660Smarkm
492342660Smarkm
492456160Sru@node Node Names
492556160Sru@subsection Choosing Node and Pointer Names
492656160Sru
492756160Sru@cindex Node names, choosing
492842660SmarkmThe name of a node identifies the node.  The pointers enable
4929114472Sruyou to reach other nodes and consist simply of the names of those nodes.
493042660Smarkm
493142660SmarkmNormally, a node's `Up' pointer contains the name of the node whose menu
493242660Smarkmmentions that node.  The node's `Next' pointer contains the name of the
493342660Smarkmnode that follows that node in that menu and its `Previous' pointer
493442660Smarkmcontains the name of the node that precedes it in that menu.  When a
493542660Smarkmnode's `Previous' node is the same as its `Up' node, both node pointers
4936114472Sruname the same node.
493742660Smarkm
493842660SmarkmUsually, the first node of a Texinfo file is the `Top' node, and its
493942660Smarkm`Up' and `Previous' pointers point to the @file{dir} file, which
4940114472Srucontains the main menu for all of Info.
494142660Smarkm
494242660SmarkmThe `Top' node itself contains the main or master menu for the manual.
494342660SmarkmAlso, it is helpful to include a brief description of the manual in the
494442660Smarkm`Top' node.  @xref{First Node}, for information on how to write the
4945114472Srufirst node of a Texinfo file.
494642660Smarkm
494756160SruEven when you explicitly specify all pointers, that does not mean you
494856160Srucan write the nodes in the Texinfo source file in an arbitrary order!
494956160SruBecause @TeX{} processes the file sequentially, irrespective of node
495056160Srupointers, you must write the nodes in the order you wish them to appear
495156160Sruin the printed output.
495256160Sru
495356160Sru
495456160Sru@node Writing a Node
495542660Smarkm@subsection How to Write an @code{@@node} Line
495642660Smarkm@cindex Writing an @code{@@node} line
495742660Smarkm@cindex @code{@@node} line writing
495842660Smarkm@cindex Node line writing
495942660Smarkm
496042660SmarkmThe easiest way to write an @code{@@node} line is to write @code{@@node}
496142660Smarkmat the beginning of a line and then the name of the node, like
496242660Smarkmthis:@refill
496342660Smarkm
496442660Smarkm@example
496542660Smarkm@@node @var{node-name}
496642660Smarkm@end example
496742660Smarkm
496842660SmarkmIf you are using GNU Emacs, you can use the update node commands
496942660Smarkmprovided by Texinfo mode to insert the names of the pointers; or you
497042660Smarkmcan leave the pointers out of the Texinfo file and let @code{makeinfo}
497142660Smarkminsert node pointers into the Info file it creates.  (@xref{Texinfo
497242660SmarkmMode}, and @ref{makeinfo Pointer Creation}.)@refill
497342660Smarkm
497442660SmarkmAlternatively, you can insert the `Next', `Previous', and `Up'
497542660Smarkmpointers yourself.  If you do this, you may find it helpful to use the
497642660SmarkmTexinfo mode keyboard command @kbd{C-c C-c n}.  This command inserts
497742660Smarkm@samp{@@node} and a comment line listing the names of the pointers in
497842660Smarkmtheir proper order.  The comment line helps you keep track of which
497942660Smarkmarguments are for which pointers.  This comment line is especially useful
498042660Smarkmif you are not familiar with Texinfo.@refill
498142660Smarkm
498256160SruThe template for a fully-written-out node line with `Next', `Previous',
498356160Sruand `Up' pointers looks like this:@refill
498442660Smarkm
498542660Smarkm@example
498642660Smarkm@@node @var{node-name}, @var{next}, @var{previous}, @var{up}
498742660Smarkm@end example
498842660Smarkm
498942660SmarkmIf you wish, you can ignore @code{@@node} lines altogether in your first
499042660Smarkmdraft and then use the @code{texinfo-insert-node-lines} command to
499156160Srucreate @code{@@node} lines for you.  However, we do not recommend this
499256160Srupractice.  It is better to name the node itself at the same time that
499356160Sruyou write a segment so you can easily make cross references.  A large
499456160Srunumber of cross references are an especially important feature of a good
499556160SruInfo file.
499642660Smarkm
499742660SmarkmAfter you have inserted an @code{@@node} line, you should immediately
499842660Smarkmwrite an @@-command for the chapter or section and insert its name.
499942660SmarkmNext (and this is important!), put in several index entries.  Usually,
500042660Smarkmyou will find at least two and often as many as four or five ways of
500142660Smarkmreferring to the node in the index.  Use them all.  This will make it
500256160Srumuch easier for people to find the node.
500342660Smarkm
500456160Sru
500556160Sru@node Node Line Tips
500642660Smarkm@subsection @code{@@node} Line Tips
500742660Smarkm
500842660SmarkmHere are three suggestions:
500942660Smarkm
501042660Smarkm@itemize @bullet
501142660Smarkm@item
501242660SmarkmTry to pick node names that are informative but short.@refill
501342660Smarkm
501442660SmarkmIn the Info file, the file name, node name, and pointer names are all
501542660Smarkminserted on one line, which may run into the right edge of the window.
501642660Smarkm(This does not cause a problem with Info, but is ugly.)@refill
501742660Smarkm
501842660Smarkm@item
501942660SmarkmTry to pick node names that differ from each other near the beginnings
502042660Smarkmof their names.  This way, it is easy to use automatic name completion in
502142660SmarkmInfo.@refill
502242660Smarkm
502342660Smarkm@item
502442660SmarkmBy convention, node names are capitalized just as they would be for
502542660Smarkmsection or chapter titles---initial and significant words are
502642660Smarkmcapitalized; others are not.@refill
502742660Smarkm@end itemize
502842660Smarkm
502956160Sru
5030114472Sru@node Node Line Requirements
503142660Smarkm@subsection @code{@@node} Line Requirements
503242660Smarkm
503342660Smarkm@cindex Node line requirements
503493139Sru@cindex Restrictions on node names
503542660SmarkmHere are several requirements for @code{@@node} lines:
503642660Smarkm
503742660Smarkm@itemize @bullet
503842660Smarkm@cindex Unique nodename requirement
503956160Sru@cindex Node name must be unique
504042660Smarkm@item
5041114472SruAll the node names for a single Info file must be unique.
504242660Smarkm
504342660SmarkmDuplicates confuse the Info movement commands.  This means, for
504442660Smarkmexample, that if you end every chapter with a summary, you must name
504542660Smarkmeach summary node differently.  You cannot just call each one
504642660Smarkm``Summary''.  You may, however, duplicate the titles of chapters, sections,
504742660Smarkmand the like.  Thus you can end each chapter in a book with a section
504842660Smarkmcalled ``Summary'', so long as the node names for those sections are all
5049114472Srudifferent.
505042660Smarkm
505142660Smarkm@item
5052114472SruA pointer name must be the name of a node.
505342660Smarkm
505442660SmarkmThe node to which a pointer points may come before or after the
505556160Srunode containing the pointer.
505642660Smarkm
505756160Sru@cindex @@-commands in nodename
505856160Sru@cindex Node name, should not contain @@-commands
505942660Smarkm@item
5060114472Sru@@-commands in node names are not allowed.  This includes punctuation
5061114472Srucharacters that are escaped with a @samp{@@}, such as @code{@@} and
5062146515Sru@code{@{}, and accent commands such as @samp{@@'}.  (For a few cases
5063146515Sruwhen this is useful, Texinfo has limited support for using
5064146515Sru@w{@@-commands} in node names; see @ref{Pointer Validation}.)  Perhaps
5065146515Sruthis limitation will be removed some day.
506642660Smarkm
506756160Sru@item
506856160Sru@cindex Colon in nodename
506942660Smarkm@cindex Comma in nodename
5070114472Sru@cindex Parentheses in nodename
507156160Sru@cindex Period in nodename
507256160Sru@cindex Characters, invalid in node name
507356160Sru@cindex Invalid characters in node names
5074114472Sru@cindex Node names, invalid characters in
5075114472SruUnfortunately, you cannot use periods, commas, colons or parentheses
5076146515Sruwithin a node name; these confuse the Texinfo processors.  Perhaps
5077146515Sruthis limitation will be removed some day, too.
507842660Smarkm
507942660Smarkm@need 700
5080114472SruFor example, the following is a section title in this manual:
508142660Smarkm
508242660Smarkm@smallexample
508342660Smarkm@@code@{@@@@unnumberedsec@}, @@code@{@@@@appendixsec@}, @@code@{@@@@heading@}
508442660Smarkm@end smallexample
508542660Smarkm
508642660Smarkm@noindent
5087114472SruBut the corresponding node name lacks the commas and the @@'s:
508842660Smarkm
508942660Smarkm@smallexample
509042660Smarkmunnumberedsec appendixsec heading
509142660Smarkm@end smallexample
509242660Smarkm
5093100513Sru@cindex Case in node name
509442660Smarkm@item
5095146515SruCase is significant in node names.
5096146515Sru
5097146515Sru@cindex White space in node name
5098146515Sru@cindex Spaces in node name
5099146515SruSpaces before and after names on the @samp{@@node} line are ignored,
5100146515Srubut spaces ``inside'' a name are significant.  For example:
5101146515Sru
5102146515Sru@example
5103146515Sru@@node  foo bar,
5104146515Sru@@node foo bar ,
5105146515Sru@@node  foo bar ,
5106146515Sru@end example
5107146515Sru
5108146515Sru@noindent all define the same node, @samp{foo bar}.  References to the
5109146515Srunode should all use that name, without the leading or trailing spaces,
5110146515Srubut with the internal spaces.
511142660Smarkm@end itemize
511242660Smarkm
511342660Smarkm
5114100513Sru@node First Node
511542660Smarkm@subsection The First Node
511642660Smarkm@cindex Top node is first
511742660Smarkm@cindex First node
511842660Smarkm
511942660SmarkmThe first node of a Texinfo file is the @dfn{Top} node, except in an
5120100513Sruincluded file (@pxref{Include Files}).  The Top node should contain a
5121100513Srushort summary, copying permissions, and a master menu.  @xref{The Top
5122100513SruNode}, for more information on the Top node contents and examples.
512342660Smarkm
5124100513SruHere is a description of the node pointers to be used in the Top node:
5125100513Sru
5126100513Sru@itemize @bullet
5127100513Sru
5128100513Sru@item
512942660Smarkm@cindex Up node of Top node
513042660Smarkm@cindex (dir) as Up node of Top node
513142660SmarkmThe Top node (which must be named @samp{top} or @samp{Top}) should have
513242660Smarkmas its `Up' node the name of a node in another file, where there is a
5133100513Srumenu that leads to this file.  Specify the file name in parentheses.
513442660Smarkm
5135100513SruUsually, all Info files are installed in the same Info directory tree;
5136100513Sruin this case, use @samp{(dir)} as the parent of the Top node; this is
5137100513Srushort for @samp{(dir)top}, and specifies the Top node in the @file{dir}
5138116525Srufile, which contains the main menu for the Info system as a whole.
513942660Smarkm
5140100513Sru@item
514142660Smarkm@cindex Previous node of Top node
5142100513SruOn the other hand, do not define the `Previous' node of the Top node to
5143100513Srube @samp{(dir)}, as it causes confusing behavior for users: if you are
5144100513Sruin the Top node and hits @key{DEL} to go backwards, you wind up in the
5145100513Srumiddle of the some other entry in the @file{dir} file, which has nothing
5146100513Sruto do with what you were reading.
514742660Smarkm
5148100513Sru@item
5149100513Sru@cindex Next node of Top node
5150100513SruThe `Next' node of the Top node should be the first chapter in your
5151100513Srudocument.
5152100513Sru
5153100513Sru@end itemize
5154100513Sru
515593139Sru@xref{Installing an Info File}, for more information about installing
515642660Smarkman Info file in the @file{info} directory.
515742660Smarkm
5158100513SruFor concreteness, here is an example with explicit pointers (which you
5159100513Srucan maintain automatically with the texinfo mode commands):
516042660Smarkm
5161100513SruOr you can leave the pointers off entirely and let the tools implicitly
5162100513Srudefine them.  This is recommended.  Thus:
5163100513Sru
5164100513Sru@example
5165100513Sru@@node Top
5166100513Sru@end example
5167100513Sru
5168100513Sru
5169100513Sru@node makeinfo top command
517042660Smarkm@subsection The @code{@@top} Sectioning Command
517142660Smarkm@findex top @r{(@@-command)}
517242660Smarkm
5173100513SruA special sectioning command, @code{@@top} should be used with the
5174100513Sru@code{@@node Top} line.  The @code{@@top} sectioning command tells
517542660Smarkm@code{makeinfo} that it marks the `Top' node in the file.  It provides
5176100513Sruthe information that @code{makeinfo} needs to insert node pointers
5177100513Sruautomatically.  Write the @code{@@top} command at the beginning of the
5178100513Sruline immediately following the @code{@@node Top} line.  Write the title
5179100513Sruon the remaining part of the same line as the @code{@@top} command.
518042660Smarkm
5181100513SruIn Info, the @code{@@top} sectioning command causes the title to appear
5182100513Sruon a line by itself, with a line of asterisks inserted underneath, as
5183100513Sruother sectioning commands do.
518442660Smarkm
518542660SmarkmIn @TeX{} and @code{texinfo-format-buffer}, the @code{@@top}
518642660Smarkmsectioning command is merely a synonym for @code{@@unnumbered}.
518742660SmarkmNeither of these formatters require an @code{@@top} command, and do
518842660Smarkmnothing special with it.  You can use @code{@@chapter} or
518942660Smarkm@code{@@unnumbered} after the @code{@@node Top} line when you use
519042660Smarkmthese formatters.  Also, you can use @code{@@chapter} or
519142660Smarkm@code{@@unnumbered} when you use the Texinfo updating commands to
5192100513Srucreate or update pointers and menus.
519342660Smarkm
5194100513SruThus, in practice, a Top node starts like this:
519542660Smarkm
5196100513Sru@example
5197100513Sru@@node Top
5198100513Sru@@top Your Manual Title
5199100513Sru@end example
520042660Smarkm
520142660Smarkm
520256160Sru@node makeinfo Pointer Creation
520342660Smarkm@section Creating Pointers with @code{makeinfo}
520442660Smarkm@cindex Creating pointers with @code{makeinfo}
520542660Smarkm@cindex Pointer creation with @code{makeinfo}
520642660Smarkm@cindex Automatic pointer creation with @code{makeinfo}
520742660Smarkm
5208146515SruThe @code{makeinfo} program has a feature for automatically determining
5209146515Srunode pointers for a hierarchically organized document.
521042660Smarkm
521142660SmarkmWhen you take advantage of this feature, you do not need to write the
521242660Smarkm`Next', `Previous', and `Up' pointers after the name of a node.
521342660SmarkmHowever, you must write a sectioning command, such as @code{@@chapter}
521442660Smarkmor @code{@@section}, on the line immediately following each truncated
521556160Sru@code{@@node} line (except that comment lines may intervene).
521642660Smarkm
521756160SruIn addition, you must follow the `Top' @code{@@node} line with a line
521856160Srubeginning with @code{@@top} to mark the `Top' node in the
521956160Srufile.  @xref{makeinfo top, , @code{@@top}}.
522042660Smarkm
522142660SmarkmFinally, you must write the name of each node (except for the `Top'
522242660Smarkmnode) in a menu that is one or more hierarchical levels above the
522356160Srunode's hierarchical level.
522442660Smarkm
5225146515SruThis implicit node pointer insertion feature in @code{makeinfo}
5226146515Srurelieves you from the need to update menus and pointers manually or
5227146515Sruwith Texinfo mode commands.  (@xref{Updating Nodes and Menus}.)
522842660Smarkm
522993139SruIn most cases, you will want to take advantage of this feature and not
523093139Sruredundantly specify node pointers.  However, Texinfo documents are not
5231146515Srurequired to be organized hierarchically or in fact to contain
5232146515Srusectioning commands at all (for example, if you never intend the
5233146515Srudocument to be printed).  The special procedure for handling the short
5234146515Srutext before a menu (@pxref{Menus}) also disables this
5235146515Srufeature, for that group of nodes.  In those cases, you will need to
5236146515Sruexplicitly specify the pointers.
523756160Sru
523893139Sru
523956160Sru@node anchor
524056160Sru@section @code{@@anchor}: Defining Arbitrary Cross-reference Targets
524156160Sru
524256160Sru@findex anchor
524356160Sru@cindex Anchors
524456160Sru@cindex Cross-reference targets, arbitrary
524556160Sru@cindex Targets for cross-references, arbitrary
524656160Sru
524756160SruAn @dfn{anchor} is a position in your document, labeled so that
524856160Srucross-references can refer to it, just as they can to nodes.  You create
524956160Sruan anchor with the @code{@@anchor} command, and give the label as a
525056160Srunormal brace-delimited argument.  For example:
525156160Sru
525256160Sru@example
525356160SruThis marks the @@anchor@{x-spot@}spot.
525456160Sru@dots{}
525556160Sru@@xref@{x-spot,,the spot@}.
525656160Sru@end example
525756160Sru
525856160Sru@noindent produces:
525956160Sru
526056160Sru@example
526156160SruThis marks the spot.
526256160Sru@dots{}
526356160SruSee [the spot], page 1.
526456160Sru@end example
526556160Sru
526656160SruAs you can see, the @code{@@anchor} command itself produces no output.
526756160SruThis example defines an anchor `x-spot' just before the word `spot'.
526856160SruYou can refer to it later with an @code{@@xref} or other cross-reference
526956160Srucommand, as shown.  @xref{Cross References}, for details on the
527056160Srucross-reference commands.
527156160Sru
527256160SruIt is best to put @code{@@anchor} commands just before the position you
527356160Sruwish to refer to; that way, the reader's eye is led on to the correct
527456160Srutext when they jump to the anchor.  You can put the @code{@@anchor}
527556160Srucommand on a line by itself if that helps readability of the source.
527656160SruSpaces are always ignored after @code{@@anchor}.
527756160Sru
527856160SruAnchor names and node names may not conflict.  Anchors and nodes are
527956160Srugiven similar treatment in some ways; for example, the @code{goto-node}
528056160Srucommand in standalone Info takes either an anchor name or a node name as
528156160Sruan argument.  (@xref{goto-node,,,info-stnd,GNU Info}.)
528256160Sru
528356160Sru
528456160Sru@node Menus
528542660Smarkm@chapter Menus
528642660Smarkm@cindex Menus
528742660Smarkm@findex menu
528842660Smarkm
5289146515Sru@dfn{Menus} contain pointers to subordinate nodes.  In online output,
5290146515Sruyou use menus to go to such nodes.  Menus have no effect in printed
5291146515Srumanuals and do not appear in them.
529242660Smarkm
5293146515SruA node with a menu should not contain much text.  If you find yourself
5294146515Sruwriting a lot of before a menu, we generally recommend moving most of
5295146515Sruthe text into a new subnode---all but a paragraph or two.  Otherwise,
5296146515Srua reader with a terminal that displays only a few lines may miss the
5297146515Srumenu and its associated text.  As a practical matter, it is best to
5298146515Srulocate a menu within 20 or so lines of the beginning of the node.
529942660Smarkm
530042660Smarkm@menu
5301146515Sru* Menu Location::               Menus go at the ends of short nodes.
530242660Smarkm* Writing a Menu::              What is a menu?
530342660Smarkm* Menu Parts::                  A menu entry has three parts.
530442660Smarkm* Less Cluttered Menu Entry::   Two part menu entry.
530542660Smarkm* Menu Example::                Two and three part menu entries.
530642660Smarkm* Other Info Files::            How to refer to a different Info file.
530742660Smarkm@end menu
530842660Smarkm
530956160Sru
5310146515Sru@node Menu Location
5311146515Sru@section Menu Location
531242660Smarkm@cindex Menu location
531342660Smarkm@cindex Location of menus
531442660Smarkm
5315146515SruA menu must be located at the end of a node, without any regular text
5316146515Sruor additional commands between the @code{@@end menu} and the beginning
5317146515Sruof the next node.  (As a consequence, there may be at most one menu in
5318146515Srua node.)
531942660Smarkm
5320146515Sru@cindex Info format, and menus
5321146515SruThis is actually a useful restriction, since a reader who uses the
5322146515Srumenu could easily miss any such text.  Technically, it is necessary
5323146515Srubecause in Info format, there is no marker for the end of a menu, so
5324146515SruInfo-reading programs would have no way to know when the menu ends and
5325146515Srunormal text resumes.
532642660Smarkm
5327146515Sru@cindex Hierarchical documents, and menus
5328146515SruTechnically, menus can carry you to any node, regardless of the
5329146515Srustructure of the document; even to nodes in a different Info file.
5330146515SruHowever, we do not recommend ever making use of this, because the
5331146515Sru@command{makeinfo} implicit pointer creation feature (@pxref{makeinfo
5332146515SruPointer Creation}) and GNU Emacs Texinfo mode updating commands work
5333146515Sruonly to create menus of subordinate nodes in a hierarchically
5334146515Srustructured document.  Instead, use cross references to refer to
5335146515Sruarbitrary nodes.
533642660Smarkm
5337146515SruIn the past, we recommended using a @samp{@@heading} command within an
5338146515Sru@code{@@ifinfo} conditional instead of the normal sectioning commands
5339146515Sruafter a very short node with a menu.  This had the advantage of making
5340146515Sruthe printed output look better, because there was no very short text
5341146515Srubetween two headings on the page.  But aside from not working with
5342146515Sru@command{makeinfo}'s implicit pointer creation, it also makes the XML
5343146515Sruoutput incorrect, since it does not reflect the true document
5344146515Srustructure.  So, unfortunately we can no longer recommend this.
534542660Smarkm
534642660Smarkm
5347146515Sru@node Writing a Menu
534842660Smarkm@section Writing a Menu
534942660Smarkm@cindex Writing a menu
535042660Smarkm@cindex Menu writing
535142660Smarkm
5352146515SruA menu consists of an @code{@@menu} command on a line by itself
5353146515Srufollowed by menu entry lines or menu comment lines and then by an
5354146515Sru@code{@@end menu} command on a line by itself.
535542660Smarkm
5356146515SruA menu looks like this:
535742660Smarkm
535842660Smarkm@example
535942660Smarkm@group
536042660Smarkm@@menu
536142660SmarkmLarger Units of Text
536242660Smarkm
536342660Smarkm* Files::                       All about handling files.
536442660Smarkm* Multiples: Buffers.           Multiple buffers; editing
5365114472Sru                                 several files at once.
536642660Smarkm@@end menu
536742660Smarkm@end group
536842660Smarkm@end example
536942660Smarkm
537056160SruIn a menu, every line that begins with an @w{@samp{* }} is a @dfn{menu
537156160Sruentry}.  (Note the space after the asterisk.)  A line that does not
537256160Srustart with an @w{@samp{* }} may also appear in a menu.  Such a line is
537356160Srunot a menu entry but is a menu comment line that appears in the Info
537456160Srufile.  In the example above, the line @samp{Larger Units of Text} is a
537556160Srumenu comment line; the two lines starting with @w{@samp{* }} are menu
537656160Sru@cindex Spaces, in menus
537756160Sruentries.  Space characters in a menu are preserved as-is; this allows
537856160Sruyou to format the menu as you wish.
537942660Smarkm
538056160Sru
5381146515Sru@node Menu Parts
538242660Smarkm@section The Parts of a Menu
538342660Smarkm@cindex Parts of a menu
538442660Smarkm@cindex Menu parts
538542660Smarkm@cindex @code{@@menu} parts
538642660Smarkm
538742660SmarkmA menu entry has three parts, only the second of which is required:
538842660Smarkm
538942660Smarkm@enumerate
539042660Smarkm@item
539142660SmarkmThe menu entry name (optional).
539242660Smarkm
539342660Smarkm@item
539442660SmarkmThe name of the node (required).
539542660Smarkm
539642660Smarkm@item
539742660SmarkmA description of the item (optional).
539842660Smarkm@end enumerate
539942660Smarkm
540042660SmarkmThe template for a menu entry looks like this:@refill
540142660Smarkm
540242660Smarkm@example
540342660Smarkm* @var{menu-entry-name}: @var{node-name}.   @var{description}
540442660Smarkm@end example
540542660Smarkm
540642660SmarkmFollow the menu entry name with a single colon and follow the node name
540742660Smarkmwith tab, comma, period, or newline.@refill
540842660Smarkm
540942660SmarkmIn Info, a user selects a node with the @kbd{m} (@code{Info-menu})
541042660Smarkmcommand.  The menu entry name is what the user types after the @kbd{m}
541142660Smarkmcommand.@refill
541242660Smarkm
541342660SmarkmThe third part of a menu entry is a descriptive phrase or sentence.
541442660SmarkmMenu entry names and node names are often short; the description
541542660Smarkmexplains to the reader what the node is about.  A useful description
541642660Smarkmcomplements the node name rather than repeats it.  The description,
541742660Smarkmwhich is optional, can spread over two or more lines; if it does, some
541842660Smarkmauthors prefer to indent the second line while others prefer to align it
541942660Smarkmwith the first (and all others).  It's up to you.
542042660Smarkm
542142660Smarkm
5422146515Sru@node Less Cluttered Menu Entry
542342660Smarkm@comment  node-name,  next,  previous,  up
542442660Smarkm@section Less Cluttered Menu Entry
542542660Smarkm@cindex Two part menu entry
542642660Smarkm@cindex Double-colon menu entries
542742660Smarkm@cindex Menu entries with two colons
542842660Smarkm@cindex Less cluttered menu entry
542942660Smarkm@cindex Uncluttered menu entry
543042660Smarkm
543142660SmarkmWhen the menu entry name and node name are the same, you can write
543242660Smarkmthe name immediately after the asterisk and space at the beginning of
543342660Smarkmthe line and follow the name with two colons.@refill
543442660Smarkm
543542660Smarkm@need 800
543642660SmarkmFor example, write
543742660Smarkm
543842660Smarkm@example
543942660Smarkm* Name::                                    @var{description}
544042660Smarkm@end example
544142660Smarkm
544242660Smarkm@need 800
544342660Smarkm@noindent
544442660Smarkminstead of
544542660Smarkm
544642660Smarkm@example
544742660Smarkm* Name: Name.                               @var{description}
544842660Smarkm@end example
544942660Smarkm
545042660SmarkmYou should use the node name for the menu entry name whenever possible,
545142660Smarkmsince it reduces visual clutter in the menu.@refill
545242660Smarkm
5453146515Sru@node Menu Example
545442660Smarkm@comment  node-name,  next,  previous,  up
545542660Smarkm@section A Menu Example
545642660Smarkm@cindex Menu example
545742660Smarkm@cindex Example menu
545842660Smarkm
545942660SmarkmA menu looks like this in Texinfo:@refill
546042660Smarkm
546142660Smarkm@example
546242660Smarkm@group
546342660Smarkm@@menu
546442660Smarkm* menu entry name: Node name.   A short description.
546542660Smarkm* Node name::                   This form is preferred.
546642660Smarkm@@end menu
546742660Smarkm@end group
546842660Smarkm@end example
546942660Smarkm
547042660Smarkm@need 800
547142660Smarkm@noindent
547242660SmarkmThis produces:
547342660Smarkm
547442660Smarkm@example
547542660Smarkm@group
547642660Smarkm* menu:
547742660Smarkm
547842660Smarkm* menu entry name: Node name.   A short description.
547942660Smarkm* Node name::                   This form is preferred.
548042660Smarkm@end group
548142660Smarkm@end example
548242660Smarkm
548342660Smarkm@need 700
548442660SmarkmHere is an example as you might see it in a Texinfo file:@refill
548542660Smarkm
548642660Smarkm@example
548742660Smarkm@group
548842660Smarkm@@menu
548942660SmarkmLarger Units of Text
549042660Smarkm
549142660Smarkm* Files::                       All about handling files.
549242660Smarkm* Multiples: Buffers.           Multiple buffers; editing
5493114472Sru                                 several files at once.
549442660Smarkm@@end menu
549542660Smarkm@end group
549642660Smarkm@end example
549742660Smarkm
549842660Smarkm@need 800
549942660Smarkm@noindent
550042660SmarkmThis produces:
550142660Smarkm
550242660Smarkm@example
550342660Smarkm@group
550442660Smarkm* menu:
550542660SmarkmLarger Units of Text
550642660Smarkm
550742660Smarkm* Files::                       All about handling files.
550842660Smarkm* Multiples: Buffers.           Multiple buffers; editing
5509114472Sru                                 several files at once.
551042660Smarkm@end group
551142660Smarkm@end example
551242660Smarkm
551342660SmarkmIn this example, the menu has two entries.  @samp{Files} is both a menu
551442660Smarkmentry name and the name of the node referred to by that name.
551542660Smarkm@samp{Multiples} is the menu entry name; it refers to the node named
551642660Smarkm@samp{Buffers}. The line @samp{Larger Units of Text} is a comment; it
551742660Smarkmappears in the menu, but is not an entry.@refill
551842660Smarkm
551942660SmarkmSince no file name is specified with either @samp{Files} or
552042660Smarkm@samp{Buffers}, they must be the names of nodes in the same Info file
552142660Smarkm(@pxref{Other Info Files, , Referring to Other Info Files}).@refill
552242660Smarkm
5523146515Sru@node Other Info Files
552442660Smarkm@comment  node-name,  next,  previous,  up
552542660Smarkm@section Referring to Other Info Files
552642660Smarkm@cindex Referring to other Info files
552742660Smarkm@cindex Nodes in other Info files
552842660Smarkm@cindex Other Info files' nodes
552942660Smarkm@cindex Going to other Info files' nodes
553042660Smarkm@cindex Info; other files' nodes
553142660Smarkm
553242660SmarkmYou can create a menu entry that enables a reader in Info to go to a
553342660Smarkmnode in another Info file by writing the file name in parentheses just
553442660Smarkmbefore the node name.  In this case, you should use the three-part menu
553542660Smarkmentry format, which saves the reader from having to type the file
553642660Smarkmname.@refill
553742660Smarkm
553842660Smarkm@need 800
553942660SmarkmThe format looks like this:@refill
554042660Smarkm
554142660Smarkm@example
554242660Smarkm@group
554342660Smarkm@@menu
554442660Smarkm* @var{first-entry-name}:(@var{filename})@var{nodename}.     @var{description}
554542660Smarkm* @var{second-entry-name}:(@var{filename})@var{second-node}. @var{description}
554642660Smarkm@@end menu
554742660Smarkm@end group
554842660Smarkm@end example
554942660Smarkm
555042660SmarkmFor example, to refer directly to the @samp{Outlining} and
555142660Smarkm@samp{Rebinding} nodes in the @cite{Emacs Manual}, you would write a
555242660Smarkmmenu like this:@refill
555342660Smarkm
555442660Smarkm@example
555542660Smarkm@group
555642660Smarkm@@menu
555742660Smarkm* Outlining: (emacs)Outline Mode. The major mode for
5558114472Sru                                 editing outlines.
555942660Smarkm* Rebinding: (emacs)Rebinding.    How to redefine the
5560114472Sru                                 meaning of a key.
556142660Smarkm@@end menu
556242660Smarkm@end group
556342660Smarkm@end example
556442660Smarkm
556542660SmarkmIf you do not list the node name, but only name the file, then Info
556642660Smarkmpresumes that you are referring to the `Top' node.@refill
556742660Smarkm
556842660SmarkmThe @file{dir} file that contains the main menu for Info has menu
556942660Smarkmentries that list only file names.  These take you directly to the `Top'
557093139Srunodes of each Info document.  (@xref{Installing an Info File}.)
557142660Smarkm
557242660Smarkm@need 700
557342660SmarkmFor example:
557442660Smarkm
557542660Smarkm@example
557642660Smarkm@group
557742660Smarkm* Info: (info).         Documentation browsing system.
557842660Smarkm* Emacs: (emacs).       The extensible, self-documenting
5579114472Sru                       text editor.
558042660Smarkm@end group
558142660Smarkm@end example
558242660Smarkm
558342660Smarkm@noindent
558442660Smarkm(The @file{dir} top level directory for the Info system is an Info file,
558542660Smarkmnot a Texinfo file, but a menu entry looks the same in both types of
558642660Smarkmfile.)@refill
558742660Smarkm
558856160SruThe GNU Emacs Texinfo mode menu updating commands only work with nodes
558956160Sruwithin the current buffer, so you cannot use them to create menus that
559056160Srurefer to other files.  You must write such menus by hand.
559142660Smarkm
559256160Sru
559356160Sru@node Cross References
559442660Smarkm@chapter Cross References
559542660Smarkm@cindex Making cross references
559642660Smarkm@cindex Cross references
559742660Smarkm@cindex References
559842660Smarkm
559942660Smarkm@dfn{Cross references} are used to refer the reader to other parts of the
560056160Srusame or different Texinfo files.  In Texinfo, nodes and anchors are the
560156160Sruplaces to which cross references can refer.
560242660Smarkm
560342660Smarkm@menu
560442660Smarkm* References::                  What cross references are for.
560542660Smarkm* Cross Reference Commands::    A summary of the different commands.
560642660Smarkm* Cross Reference Parts::       A cross reference has several parts.
560742660Smarkm* xref::                        Begin a reference with `See' @dots{}
560842660Smarkm* Top Node Naming::             How to refer to the beginning of another file.
560942660Smarkm* ref::                         A reference for the last part of a sentence.
561042660Smarkm* pxref::                       How to write a parenthetical cross reference.
561142660Smarkm* inforef::                     How to refer to an Info-only file.
561242660Smarkm* uref::                        How to refer to a uniform resource locator.
561342660Smarkm@end menu
561442660Smarkm
5615146515Sru@node References
5616146515Sru@section What References Are For
561742660Smarkm
561842660SmarkmOften, but not always, a printed document should be designed so that
561942660Smarkmit can be read sequentially.  People tire of flipping back and forth
562042660Smarkmto find information that should be presented to them as they need
562142660Smarkmit.@refill
562242660Smarkm
562342660SmarkmHowever, in any document, some information will be too detailed for
562442660Smarkmthe current context, or incidental to it; use cross references to
562556160Sruprovide access to such information.  Also, an online help system or a
562642660Smarkmreference manual is not like a novel; few read such documents in
562742660Smarkmsequence from beginning to end.  Instead, people look up what they
562842660Smarkmneed.  For this reason, such creations should contain many cross
562942660Smarkmreferences to help readers find other information that they may not
563042660Smarkmhave read.@refill
563142660Smarkm
563242660SmarkmIn a printed manual, a cross reference results in a page reference,
563342660Smarkmunless it is to another manual altogether, in which case the cross
563442660Smarkmreference names that manual.@refill
563542660Smarkm
5636146515SruIn Info, a cross reference results in an entry that you can follow
5637146515Sruusing the Info @samp{f} command.  (@inforef{Help-Xref, Following
5638146515Srucross-references, info}.)
563942660Smarkm
564056160SruThe various cross reference commands use nodes (or anchors,
564156160Sru@pxref{anchor,,@code{@@anchor}}) to define cross reference locations.
564256160SruThis is evident in Info, in which a cross reference takes you to the
564356160Sruspecified location.  @TeX{} also uses nodes to define cross reference
564456160Srulocations, but the action is less obvious.  When @TeX{} generates a DVI
564556160Srufile, it records each node's page number and uses the page numbers in making
564656160Srureferences.  Thus, if you are writing a manual that will only be
564756160Sruprinted, and will not be used online, you must nonetheless write
564856160Sru@code{@@node} lines to name the places to which you make cross
564956160Srureferences.@refill
565042660Smarkm
565142660Smarkm@need 800
5652146515Sru@node Cross Reference Commands
565342660Smarkm@comment  node-name,  next,  previous,  up
565442660Smarkm@section Different Cross Reference Commands
565542660Smarkm@cindex Different cross reference commands
565642660Smarkm
565742660SmarkmThere are four different cross reference commands:@refill
565842660Smarkm
565942660Smarkm@table @code
566042660Smarkm@item @@xref
566142660SmarkmUsed to start a sentence in the printed manual saying @w{`See @dots{}'}
566242660Smarkmor an Info cross-reference saying @samp{*Note @var{name}: @var{node}.}.
566342660Smarkm
566442660Smarkm@item @@ref
566542660SmarkmUsed within or, more often, at the end of a sentence; same as
566642660Smarkm@code{@@xref} for Info; produces just the reference in the printed
566742660Smarkmmanual without a preceding `See'.@refill
566842660Smarkm
566942660Smarkm@item @@pxref
567042660SmarkmUsed within parentheses to make a reference that suits both an Info
567142660Smarkmfile and a printed book.  Starts with a lower case `see' within the
567242660Smarkmprinted manual. (@samp{p} is for `parenthesis'.)@refill
567342660Smarkm
567442660Smarkm@item @@inforef
567542660SmarkmUsed to make a reference to an Info file for which there is no printed
567642660Smarkmmanual.@refill
567742660Smarkm@end table
567842660Smarkm
567942660Smarkm@noindent
568042660Smarkm(The @code{@@cite} command is used to make references to books and
568142660Smarkmmanuals for which there is no corresponding Info file and, therefore,
568242660Smarkmno node to which to point.   @xref{cite, , @code{@@cite}}.)@refill
568342660Smarkm
5684146515Sru@node Cross Reference Parts
568542660Smarkm@comment  node-name,  next,  previous,  up
568642660Smarkm@section Parts of a Cross Reference
568742660Smarkm@cindex Cross reference parts
568842660Smarkm@cindex Parts of a cross reference
568942660Smarkm
569042660SmarkmA cross reference command requires only one argument, which is the
569142660Smarkmname of the node to which it refers.  But a cross reference command
569242660Smarkmmay contain up to four additional arguments.  By using these
569342660Smarkmarguments, you can provide a cross reference name for Info, a topic
569442660Smarkmdescription or section title for the printed output, the name of a
569542660Smarkmdifferent Info file, and the name of a different printed
569642660Smarkmmanual.@refill
569742660Smarkm
569842660SmarkmHere is a simple cross reference example:@refill
569942660Smarkm
570042660Smarkm@example
570142660Smarkm@@xref@{Node name@}.
570242660Smarkm@end example
570342660Smarkm
570442660Smarkm@noindent
570542660Smarkmwhich produces
570642660Smarkm
570742660Smarkm@example
570842660Smarkm*Note Node name::.
570942660Smarkm@end example
571042660Smarkm
571142660Smarkm@noindent
571242660Smarkmand
571342660Smarkm
571442660Smarkm@quotation
571542660SmarkmSee Section @var{nnn} [Node name], page @var{ppp}.
571642660Smarkm@end quotation
571742660Smarkm
571842660Smarkm@need 700
571942660SmarkmHere is an example of a full five-part cross reference:@refill
572042660Smarkm
572142660Smarkm@example
572242660Smarkm@group
572342660Smarkm@@xref@{Node name, Cross Reference Name, Particular Topic,
572442660Smarkminfo-file-name, A Printed Manual@}, for details.
572542660Smarkm@end group
572642660Smarkm@end example
572742660Smarkm
572842660Smarkm@noindent
572942660Smarkmwhich produces
573042660Smarkm
573142660Smarkm@example
573242660Smarkm*Note Cross Reference Name: (info-file-name)Node name,
573342660Smarkmfor details.
573442660Smarkm@end example
573542660Smarkm
573642660Smarkm@noindent
573742660Smarkmin Info and
573842660Smarkm
573942660Smarkm@quotation
574042660SmarkmSee section ``Particular Topic'' in @i{A Printed Manual}, for details.
574142660Smarkm@end quotation
574242660Smarkm
574342660Smarkm@noindent
574442660Smarkmin a printed book.
574542660Smarkm
574642660SmarkmThe five possible arguments for a cross reference are:@refill
574742660Smarkm
574842660Smarkm@enumerate
574942660Smarkm@item
575056160SruThe node or anchor name (required).  This is the location to which the
575142660Smarkmcross reference takes you.  In a printed document, the location of the
575242660Smarkmnode provides the page reference only for references within the same
575342660Smarkmdocument.@refill
575442660Smarkm
575542660Smarkm@item
575642660SmarkmThe cross reference name for the Info reference, if it is to be different
575742660Smarkmfrom the node name.  If you include this argument, it becomes
575842660Smarkmthe first part of the cross reference.  It is usually omitted.@refill
575942660Smarkm
576042660Smarkm@item
576142660SmarkmA topic description or section name.  Often, this is the title of the
576242660Smarkmsection.  This is used as the name of the reference in the printed
576342660Smarkmmanual.  If omitted, the node name is used.@refill
576442660Smarkm
576542660Smarkm@item
576642660SmarkmThe name of the Info file in which the reference is located, if it is
576742660Smarkmdifferent from the current file.  You need not include any @samp{.info}
576842660Smarkmsuffix on the file name, since Info readers try appending it
576942660Smarkmautomatically.
577042660Smarkm
577142660Smarkm@item
577242660SmarkmThe name of a printed manual from a different Texinfo file.@refill
577342660Smarkm@end enumerate
577442660Smarkm
577542660SmarkmThe template for a full five argument cross reference looks like
577642660Smarkmthis:@refill
577742660Smarkm
577842660Smarkm@example
577942660Smarkm@group
578042660Smarkm@@xref@{@var{node-name}, @var{cross-reference-name}, @var{title-or-topic},
578142660Smarkm@var{info-file-name}, @var{printed-manual-title}@}.
578242660Smarkm@end group
578342660Smarkm@end example
578442660Smarkm
578542660SmarkmCross references with one, two, three, four, and five arguments are
578642660Smarkmdescribed separately following the description of @code{@@xref}.@refill
578742660Smarkm
578842660SmarkmWrite a node name in a cross reference in exactly the same way as in
578942660Smarkmthe @code{@@node} line, including the same capitalization; otherwise, the
579042660Smarkmformatters may not find the reference.@refill
579142660Smarkm
579242660SmarkmYou can write cross reference commands within a paragraph, but note
579342660Smarkmhow Info and @TeX{} format the output of each of the various commands:
579442660Smarkmwrite @code{@@xref} at the beginning of a sentence; write
579542660Smarkm@code{@@pxref} only within parentheses, and so on.@refill
579642660Smarkm
5797146515Sru@node xref
579842660Smarkm@comment  node-name,  next,  previous,  up
579942660Smarkm@section @code{@@xref}
580042660Smarkm@findex xref
580142660Smarkm@cindex Cross references using @code{@@xref}
580242660Smarkm@cindex References using @code{@@xref}
580342660Smarkm
580442660SmarkmThe @code{@@xref} command generates a cross reference for the
580542660Smarkmbeginning of a sentence.  The Info formatting commands convert it into
580642660Smarkman Info cross reference, which the Info @samp{f} command can use to
580742660Smarkmbring you directly to another node.  The @TeX{} typesetting commands
580842660Smarkmconvert it into a page reference, or a reference to another book or
580942660Smarkmmanual.@refill
581042660Smarkm
581142660Smarkm@menu
581242660Smarkm* Reference Syntax::            What a reference looks like and requires.
581342660Smarkm* One Argument::                @code{@@xref} with one argument.
581442660Smarkm* Two Arguments::               @code{@@xref} with two arguments.
581542660Smarkm* Three Arguments::             @code{@@xref} with three arguments.
581642660Smarkm* Four and Five Arguments::     @code{@@xref} with four and five arguments.
581742660Smarkm@end menu
581842660Smarkm
5819146515Sru@node Reference Syntax
5820146515Sru@subsection What a Reference Looks Like and Requires
582142660Smarkm
582242660SmarkmMost often, an Info cross reference looks like this:@refill
582342660Smarkm
582442660Smarkm@example
582542660Smarkm*Note @var{node-name}::.
582642660Smarkm@end example
582742660Smarkm
582842660Smarkm@noindent
582942660Smarkmor like this
583042660Smarkm
583142660Smarkm@example
583242660Smarkm*Note @var{cross-reference-name}: @var{node-name}.
583342660Smarkm@end example
583442660Smarkm
583542660Smarkm@noindent
583642660SmarkmIn @TeX{}, a cross reference looks like this:
583742660Smarkm
583856160Sru@quotation
583942660SmarkmSee Section @var{section-number} [@var{node-name}], page @var{page}.
584056160Sru@end quotation
584142660Smarkm
584242660Smarkm@noindent
584342660Smarkmor like this
584442660Smarkm
584556160Sru@quotation
584642660SmarkmSee Section @var{section-number} [@var{title-or-topic}], page @var{page}.
584756160Sru@end quotation
584842660Smarkm
584942660SmarkmThe @code{@@xref} command does not generate a period or comma to end
585042660Smarkmthe cross reference in either the Info file or the printed output.
585142660SmarkmYou must write that period or comma yourself; otherwise, Info will not
585242660Smarkmrecognize the end of the reference.  (The @code{@@pxref} command works
585342660Smarkmdifferently.  @xref{pxref, , @code{@@pxref}}.)@refill
585442660Smarkm
5855146515Sru@quotation Caution
5856146515SruA period or comma @strong{must} follow the closing
585742660Smarkmbrace of an @code{@@xref}.  It is required to terminate the cross
585842660Smarkmreference.  This period or comma will appear in the output, both in
585942660Smarkmthe Info file and in the printed manual.@refill
586042660Smarkm@end quotation
586142660Smarkm
586242660Smarkm@code{@@xref} must refer to an Info node by name.  Use @code{@@node}
586342660Smarkmto define the node (@pxref{Writing a Node}).@refill
586442660Smarkm
586542660Smarkm@code{@@xref} is followed by several arguments inside braces, separated by
586642660Smarkmcommas.  Whitespace before and after these commas is ignored.@refill
586742660Smarkm
586842660SmarkmA cross reference requires only the name of a node; but it may contain
586942660Smarkmup to four additional arguments.  Each of these variations produces a
587042660Smarkmcross reference that looks somewhat different.@refill
587142660Smarkm
5872146515Sru@quotation Note
5873146515SruCommas separate arguments in a cross reference;
587442660Smarkmavoid including them in the title or other part lest the formatters
587542660Smarkmmistake them for separators.@refill
587642660Smarkm@end quotation
587742660Smarkm
5878146515Sru@node One Argument
587942660Smarkm@subsection @code{@@xref} with One Argument
588042660Smarkm
588142660SmarkmThe simplest form of @code{@@xref} takes one argument, the name of
588242660Smarkmanother node in the same Info file.    The Info formatters produce
588342660Smarkmoutput that the Info readers can use to jump to the reference; @TeX{}
588442660Smarkmproduces output that specifies the page and section number for you.@refill
588542660Smarkm
588642660Smarkm@need 700
588742660Smarkm@noindent
588842660SmarkmFor example,
588942660Smarkm
589042660Smarkm@example
589142660Smarkm@@xref@{Tropical Storms@}.
589242660Smarkm@end example
589342660Smarkm
589442660Smarkm@noindent
589542660Smarkmproduces
589642660Smarkm
589742660Smarkm@example
589842660Smarkm*Note Tropical Storms::.
589942660Smarkm@end example
590042660Smarkm
590142660Smarkm@noindent
590242660Smarkmand
590342660Smarkm
590442660Smarkm@quotation
590542660SmarkmSee Section 3.1 [Tropical Storms], page 24.
590642660Smarkm@end quotation
590742660Smarkm
590842660Smarkm@noindent
590942660Smarkm(Note that in the preceding example the closing brace is followed by a
591042660Smarkmperiod.)@refill
591142660Smarkm
591242660SmarkmYou can write a clause after the cross reference, like this:@refill
591342660Smarkm
591442660Smarkm@example
591542660Smarkm@@xref@{Tropical Storms@}, for more info.
591642660Smarkm@end example
591742660Smarkm
591842660Smarkm@noindent
591942660Smarkmwhich produces
592042660Smarkm
592142660Smarkm@example
592242660Smarkm*Note Tropical Storms::, for more info.
592342660Smarkm@end example
592442660Smarkm
592556160Sru@noindent
592656160Sruand
592756160Sru
592842660Smarkm@quotation
592942660SmarkmSee Section 3.1 [Tropical Storms], page 24, for more info.
593042660Smarkm@end quotation
593142660Smarkm
593242660Smarkm@noindent
593342660Smarkm(Note that in the preceding example the closing brace is followed by a
593442660Smarkmcomma, and then by the clause, which is followed by a period.)@refill
593542660Smarkm
5936146515Sru@node Two Arguments
593742660Smarkm@subsection @code{@@xref} with Two Arguments
593842660Smarkm
593942660SmarkmWith two arguments, the second is used as the name of the Info cross
594042660Smarkmreference, while the first is still the name of the node to which the
594142660Smarkmcross reference points.@refill
594242660Smarkm
594342660Smarkm@need 750
594442660Smarkm@noindent
594542660SmarkmThe template is like this:
594642660Smarkm
594742660Smarkm@example
594842660Smarkm@@xref@{@var{node-name}, @var{cross-reference-name}@}.
594942660Smarkm@end example
595042660Smarkm
595142660Smarkm@need 700
595242660Smarkm@noindent
595342660SmarkmFor example,
595442660Smarkm
595542660Smarkm@example
595642660Smarkm@@xref@{Electrical Effects, Lightning@}.
595742660Smarkm@end example
595842660Smarkm
595942660Smarkm@noindent
596042660Smarkmproduces:
596142660Smarkm
596242660Smarkm@example
596342660Smarkm*Note Lightning: Electrical Effects.
596442660Smarkm@end example
596542660Smarkm
596642660Smarkm@noindent
596742660Smarkmand
596842660Smarkm
596942660Smarkm@quotation
597042660SmarkmSee Section 5.2 [Electrical Effects], page 57.
597142660Smarkm@end quotation
597242660Smarkm
597342660Smarkm@noindent
597442660Smarkm(Note that in the preceding example the closing brace is followed by a
597556160Sruperiod; and that the node name is printed, not the cross reference name.)
597642660Smarkm
597742660SmarkmYou can write a clause after the cross reference, like this:@refill
597842660Smarkm
597942660Smarkm@example
598042660Smarkm@@xref@{Electrical Effects, Lightning@}, for more info.
598142660Smarkm@end example
598242660Smarkm
598342660Smarkm@noindent
598442660Smarkmwhich produces
598542660Smarkm@example
598642660Smarkm*Note Lightning: Electrical Effects, for more info.
598742660Smarkm@end example
598842660Smarkm
598942660Smarkm@noindent
599042660Smarkmand
599142660Smarkm
599242660Smarkm@quotation
599342660SmarkmSee Section 5.2 [Electrical Effects], page 57, for more info.
599442660Smarkm@end quotation
599542660Smarkm
599642660Smarkm@noindent
599742660Smarkm(Note that in the preceding example the closing brace is followed by a
599842660Smarkmcomma, and then by the clause, which is followed by a period.)@refill
599942660Smarkm
6000146515Sru@node Three Arguments
600142660Smarkm@subsection @code{@@xref} with Three Arguments
600242660Smarkm
600342660SmarkmA third argument replaces the node name in the @TeX{} output.  The third
600442660Smarkmargument should be the name of the section in the printed output, or
600542660Smarkmelse state the topic discussed by that section.  Often, you will want to
600642660Smarkmuse initial upper case letters so it will be easier to read when the
600742660Smarkmreference is printed.  Use a third argument when the node name is
600842660Smarkmunsuitable because of syntax or meaning.@refill
600942660Smarkm
601042660SmarkmRemember to avoid placing a comma within the title or topic section of
601142660Smarkma cross reference, or within any other section.  The formatters divide
601242660Smarkmcross references into arguments according to the commas; a comma
601342660Smarkmwithin a title or other section will divide it into two arguments.  In
601442660Smarkma reference, you need to write a title such as ``Clouds, Mist, and
601542660SmarkmFog'' without the commas.@refill
601642660Smarkm
601756160SruAlso, remember to write a comma or period after the closing brace of an
601842660Smarkm@code{@@xref} to terminate the cross reference.  In the following
601942660Smarkmexamples, a clause follows a terminating comma.@refill
602042660Smarkm
602142660Smarkm
602242660Smarkm@need 750
602342660Smarkm@noindent
602442660SmarkmThe template is like this:
602542660Smarkm
602642660Smarkm@example
602742660Smarkm@group
602842660Smarkm@@xref@{@var{node-name}, @var{cross-reference-name}, @var{title-or-topic}@}.
602942660Smarkm@end group
603042660Smarkm@end example
603142660Smarkm
603242660Smarkm@need 700
603342660Smarkm@noindent
603442660SmarkmFor example,
603542660Smarkm
603642660Smarkm@example
603742660Smarkm@group
603842660Smarkm@@xref@{Electrical Effects, Lightning, Thunder and Lightning@},
603942660Smarkmfor details.
604042660Smarkm@end group
604142660Smarkm@end example
604242660Smarkm
604342660Smarkm@noindent
604442660Smarkmproduces
604542660Smarkm
604642660Smarkm@example
604742660Smarkm*Note Lightning: Electrical Effects, for details.
604842660Smarkm@end example
604942660Smarkm
605042660Smarkm@noindent
605142660Smarkmand
605242660Smarkm
605342660Smarkm@quotation
605442660SmarkmSee Section 5.2 [Thunder and Lightning], page 57, for details.
605542660Smarkm@end quotation
605642660Smarkm
605742660SmarkmIf a third argument is given and the second one is empty, then the
605842660Smarkmthird argument serves both.  (Note how two commas, side by side, mark
605942660Smarkmthe empty second argument.)@refill
606042660Smarkm
606142660Smarkm@example
606242660Smarkm@group
606342660Smarkm@@xref@{Electrical Effects, , Thunder and Lightning@},
606442660Smarkmfor details.
606542660Smarkm@end group
606642660Smarkm@end example
606742660Smarkm
606842660Smarkm@noindent
606942660Smarkmproduces
607042660Smarkm
607142660Smarkm@example
607242660Smarkm*Note Thunder and Lightning: Electrical Effects, for details.
607342660Smarkm@end example
607442660Smarkm
607542660Smarkm@noindent
607642660Smarkmand
607742660Smarkm
607842660Smarkm@quotation
607942660SmarkmSee Section 5.2 [Thunder and Lightning], page 57, for details.
608042660Smarkm@end quotation
608142660Smarkm
608242660SmarkmAs a practical matter, it is often best to write cross references with
608342660Smarkmjust the first argument if the node name and the section title are the
608442660Smarkmsame, and with the first and third arguments if the node name and title
608542660Smarkmare different.@refill
608642660Smarkm
608742660SmarkmHere are several examples from @cite{The GNU Awk User's Guide}:@refill
608842660Smarkm
608942660Smarkm@smallexample
609042660Smarkm@@xref@{Sample Program@}.
609142660Smarkm@@xref@{Glossary@}.
609242660Smarkm@@xref@{Case-sensitivity, ,Case-sensitivity in Matching@}.
609342660Smarkm@@xref@{Close Output, , Closing Output Files and Pipes@},
6094114472Sru  for more information.
609542660Smarkm@@xref@{Regexp, , Regular Expressions as Patterns@}.
609642660Smarkm@end smallexample
609742660Smarkm
6098146515Sru@node Four and Five Arguments
609942660Smarkm@subsection @code{@@xref} with Four and Five Arguments
610042660Smarkm
610142660SmarkmIn a cross reference, a fourth argument specifies the name of another
610242660SmarkmInfo file, different from the file in which the reference appears, and
610342660Smarkma fifth argument specifies its title as a printed manual.@refill
610442660Smarkm
610542660SmarkmRemember that a comma or period must follow the closing brace of an
610642660Smarkm@code{@@xref} command to terminate the cross reference.  In the
610742660Smarkmfollowing examples, a clause follows a terminating comma.@refill
610842660Smarkm
610942660Smarkm@need 800
611042660Smarkm@noindent
611142660SmarkmThe template is:
611242660Smarkm
611342660Smarkm@example
611442660Smarkm@group
611542660Smarkm@@xref@{@var{node-name}, @var{cross-reference-name}, @var{title-or-topic},
611642660Smarkm@var{info-file-name}, @var{printed-manual-title}@}.
611742660Smarkm@end group
611842660Smarkm@end example
611942660Smarkm
612042660Smarkm@need 700
612142660Smarkm@noindent
612242660SmarkmFor example,
612342660Smarkm
612442660Smarkm@example
612542660Smarkm@@xref@{Electrical Effects, Lightning, Thunder and Lightning,
612642660Smarkmweather, An Introduction to Meteorology@}, for details.
612742660Smarkm@end example
612842660Smarkm
612942660Smarkm@noindent
613042660Smarkmproduces
613142660Smarkm
613242660Smarkm@example
613342660Smarkm*Note Lightning: (weather)Electrical Effects, for details.
613442660Smarkm@end example
613542660Smarkm
613642660Smarkm@noindent
613742660SmarkmThe name of the Info file is enclosed in parentheses and precedes
613842660Smarkmthe name of the node.
613942660Smarkm
614042660Smarkm@noindent
614142660SmarkmIn a printed manual, the reference looks like this:@refill
614242660Smarkm
614342660Smarkm@quotation
614442660SmarkmSee section ``Thunder and Lightning'' in @i{An Introduction to
614542660SmarkmMeteorology}, for details.
614642660Smarkm@end quotation
614742660Smarkm
614842660Smarkm@noindent
614942660SmarkmThe title of the printed manual is typeset in italics; and the
615042660Smarkmreference lacks a page number since @TeX{} cannot know to which page a
615142660Smarkmreference refers when that reference is to another manual.@refill
615242660Smarkm
615342660SmarkmOften, you will leave out the second argument when you use the long
615442660Smarkmversion of @code{@@xref}.  In this case, the third argument, the topic
615542660Smarkmdescription, will be used as the cross reference name in Info.@refill
615642660Smarkm
615742660Smarkm@noindent
615842660SmarkmThe template looks like this:
615942660Smarkm
616042660Smarkm@example
616142660Smarkm@@xref@{@var{node-name}, , @var{title-or-topic}, @var{info-file-name},
616242660Smarkm@var{printed-manual-title}@}, for details.
616342660Smarkm@end example
616442660Smarkm
616542660Smarkm@noindent
616642660Smarkmwhich produces
616742660Smarkm
616842660Smarkm@example
616942660Smarkm*Note @var{title-or-topic}: (@var{info-file-name})@var{node-name}, for details.
617042660Smarkm@end example
617142660Smarkm
617242660Smarkm@noindent
617342660Smarkmand
617442660Smarkm
617542660Smarkm@quotation
617642660SmarkmSee section @var{title-or-topic} in @var{printed-manual-title}, for details.
617742660Smarkm@end quotation
617842660Smarkm
617942660Smarkm@need 700
618042660Smarkm@noindent
618142660SmarkmFor example,
618242660Smarkm
618342660Smarkm@example
618442660Smarkm@@xref@{Electrical Effects, , Thunder and Lightning,
618542660Smarkmweather, An Introduction to Meteorology@}, for details.
618642660Smarkm@end example
618742660Smarkm
618842660Smarkm@noindent
618942660Smarkmproduces
619042660Smarkm
619142660Smarkm@example
619242660Smarkm@group
619342660Smarkm*Note Thunder and Lightning: (weather)Electrical Effects,
619442660Smarkmfor details.
619542660Smarkm@end group
619642660Smarkm@end example
619742660Smarkm
619842660Smarkm@noindent
619942660Smarkmand
620042660Smarkm
620142660Smarkm@quotation
620242660SmarkmSee section ``Thunder and Lightning'' in @i{An Introduction to
620342660SmarkmMeteorology}, for details.
620442660Smarkm@end quotation
620542660Smarkm
620642660SmarkmOn rare occasions, you may want to refer to another Info file that
620742660Smarkmis within a single printed manual---when multiple Texinfo files are
620842660Smarkmincorporated into the same @TeX{} run but make separate Info files.
620942660SmarkmIn this case, you need to specify only the fourth argument, and not
621042660Smarkmthe fifth.@refill
621142660Smarkm
6212146515Sru@node Top Node Naming
621342660Smarkm@section Naming a `Top' Node
621442660Smarkm@cindex Naming a `Top' Node in references
621542660Smarkm@cindex @samp{@r{Top}} node naming for references
621642660Smarkm
621742660SmarkmIn a cross reference, you must always name a node.  This means that in
621842660Smarkmorder to refer to a whole manual, you must identify the `Top' node by
621942660Smarkmwriting it as the first argument to the @code{@@xref} command.  (This
622042660Smarkmis different from the way you write a menu entry; see @ref{Other Info
622142660SmarkmFiles, , Referring to Other Info Files}.)  At the same time, to
622242660Smarkmprovide a meaningful section topic or title in the printed cross
622342660Smarkmreference (instead of the word `Top'), you must write an appropriate
622442660Smarkmentry for the third argument to the @code{@@xref} command.
622542660Smarkm@refill
622642660Smarkm
622742660Smarkm@noindent
622842660SmarkmThus, to make a cross reference to @cite{The GNU Make Manual},
622942660Smarkmwrite:@refill
623042660Smarkm
623142660Smarkm@example
623242660Smarkm@@xref@{Top, , Overview, make, The GNU Make Manual@}.
623342660Smarkm@end example
623442660Smarkm
623542660Smarkm@noindent
623642660Smarkmwhich produces
623742660Smarkm
623842660Smarkm@example
623942660Smarkm*Note Overview: (make)Top.
624042660Smarkm@end example
624142660Smarkm
624242660Smarkm@noindent
624342660Smarkmand
624442660Smarkm
624542660Smarkm@quotation
624642660SmarkmSee section ``Overview'' in @i{The GNU Make Manual}.
624742660Smarkm@end quotation
624842660Smarkm
624942660Smarkm@noindent
625042660SmarkmIn this example, @samp{Top} is the name of the first node, and
6251146515Sru@samp{Overview} is the name of the first section of the manual.
6252146515Sru
6253146515Sru
6254146515Sru@node ref
625542660Smarkm@section @code{@@ref}
625642660Smarkm@cindex Cross references using @code{@@ref}
625742660Smarkm@cindex References using @code{@@ref}
625842660Smarkm@findex ref
625942660Smarkm
626042660Smarkm@code{@@ref} is nearly the same as @code{@@xref} except that it does
626142660Smarkmnot generate a `See' in the printed output, just the reference itself.
6262146515SruThis makes it useful as the last part of a sentence.
626342660Smarkm
6264146515Sru@noindent For example,
626542660Smarkm
626656160Sru@cindex Hurricanes
626742660Smarkm@example
626842660SmarkmFor more information, see @@ref@{Hurricanes@}.
626942660Smarkm@end example
627042660Smarkm
6271146515Sru@noindent produces (in Info):
627242660Smarkm
627342660Smarkm@example
627456160SruFor more information, see *Note Hurricanes::.
627542660Smarkm@end example
627642660Smarkm
6277146515Sru@noindent and (in printed output):
627842660Smarkm
627942660Smarkm@quotation
628042660SmarkmFor more information, see Section 8.2 [Hurricanes], page 123.
628142660Smarkm@end quotation
628242660Smarkm
6283146515SruThe @code{@@ref} command sometimes tempts writers to express
6284146515Sruthemselves in a manner that is suitable for a printed manual but looks
6285146515Sruawkward in the Info format.  Bear in mind that your audience will be
6286146515Sruusing both the printed and the Info format.  For example:
628742660Smarkm
628856160Sru@cindex Sea surges
628942660Smarkm@example
629042660SmarkmSea surges are described in @@ref@{Hurricanes@}.
629142660Smarkm@end example
629242660Smarkm
6293146515Sru@noindent looks ok in the printed output:
629442660Smarkm
629542660Smarkm@quotation
629642660SmarkmSea surges are described in Section 6.7 [Hurricanes], page 72.
629742660Smarkm@end quotation
629842660Smarkm
6299146515Sru@noindent but is awkward to read in Info:
630042660Smarkm
630142660Smarkm@example
630242660SmarkmSea surges are described in *Note Hurricanes::.
630342660Smarkm@end example
630442660Smarkm
6305146515SruAs a general rule, you should write a period or comma immediately
6306146515Sruafter an @code{@@ref} command with two or more arguments.
630742660Smarkm
6308146515SruIf there is no such following punctuation, @command{makeinfo} will
6309146515Srugenerate a (grammatically incorrect) period in the Info output;
6310146515Sruotherwise, the cross-reference would fail completely, due to the
6311146515Srucurrent syntax of Info format.
6312146515Sru
6313146515Sru
6314146515Sru@node pxref
631542660Smarkm@section @code{@@pxref}
631642660Smarkm@cindex Cross references using @code{@@pxref}
631742660Smarkm@cindex References using @code{@@pxref}
631842660Smarkm@findex pxref
631942660Smarkm
632042660SmarkmThe parenthetical reference command, @code{@@pxref}, is nearly the
632142660Smarkmsame as @code{@@xref}, but you use it @emph{only} inside parentheses
6322146515Sruand you do @emph{not} type a comma or period (or anything else) after
6323146515Sruthe command's closing brace.  The command differs from @code{@@xref}
6324146515Sruin two ways:
632542660Smarkm
632642660Smarkm@enumerate
632742660Smarkm@item
632842660Smarkm@TeX{} typesets the reference for the printed manual with a lower case
632942660Smarkm`see' rather than an upper case `See'.@refill
633042660Smarkm
633142660Smarkm@item
633242660SmarkmThe Info formatting commands automatically end the reference with a
633342660Smarkmclosing colon or period.@refill
633442660Smarkm@end enumerate
633542660Smarkm
633642660SmarkmBecause one type of formatting automatically inserts closing
633742660Smarkmpunctuation and the other does not, you should use @code{@@pxref}
633842660Smarkm@emph{only} inside parentheses as part of another sentence.  Also, you
6339146515Sruyourself should not insert punctuation after the reference (or any
6340146515Sruother text), as you do with @code{@@xref}.  In the Info
6341146515Sruoutput, such text would follow a period, which is grammatically wrong.
634242660Smarkm
634342660Smarkm@code{@@pxref} is designed so that the output looks right and works
634442660Smarkmright between parentheses both in printed output and in an Info file.
634542660SmarkmIn a printed manual, a closing comma or period should not follow a
634642660Smarkmcross reference within parentheses; such punctuation is wrong.  But in
634742660Smarkman Info file, suitable closing punctuation must follow the cross
634842660Smarkmreference so Info can recognize its end.  @code{@@pxref} spares you
634942660Smarkmthe need to use complicated methods to put a terminator into one form
635042660Smarkmof the output and not the other.@refill
635142660Smarkm
635242660Smarkm@noindent
635342660SmarkmWith one argument, a parenthetical cross reference looks like
635442660Smarkmthis:@refill
635542660Smarkm
635656160Sru@cindex Flooding
635742660Smarkm@example
635842660Smarkm@dots{} storms cause flooding (@@pxref@{Hurricanes@}) @dots{}
635942660Smarkm@end example
636042660Smarkm
636142660Smarkm@need 800
636242660Smarkm@noindent
636342660Smarkmwhich produces
636442660Smarkm
636542660Smarkm@example
636642660Smarkm@group
636742660Smarkm@dots{} storms cause flooding (*Note Hurricanes::) @dots{}
636842660Smarkm@end group
636942660Smarkm@end example
637042660Smarkm
637142660Smarkm@noindent
637242660Smarkmand
637342660Smarkm
637442660Smarkm@quotation
637542660Smarkm@dots{} storms cause flooding (see Section 6.7 [Hurricanes], page 72) @dots{}
637642660Smarkm@end quotation
637742660Smarkm
637842660SmarkmWith two arguments, a parenthetical cross reference has this
637942660Smarkmtemplate:@refill
638042660Smarkm
638142660Smarkm@example
638242660Smarkm@dots{} (@@pxref@{@var{node-name}, @var{cross-reference-name}@}) @dots{}
638342660Smarkm@end example
638442660Smarkm
638542660Smarkm@noindent
638642660Smarkmwhich produces
638742660Smarkm
638842660Smarkm@example
638942660Smarkm@dots{} (*Note @var{cross-reference-name}: @var{node-name}.) @dots{}
639042660Smarkm@end example
639142660Smarkm
639242660Smarkm@noindent
639342660Smarkmand
639442660Smarkm
639542660Smarkm@need 1500
639642660Smarkm@quotation
639742660Smarkm@dots{} (see Section @var{nnn} [@var{node-name}], page @var{ppp}) @dots{}
639842660Smarkm@end quotation
639942660Smarkm
640042660Smarkm@code{@@pxref} can be used with up to five arguments just like
640142660Smarkm@code{@@xref} (@pxref{xref, , @code{@@xref}}).@refill
640242660Smarkm
6403146515Sru@quotation Caution
6404146515SruUse @code{@@pxref} only as a parenthetical
640542660Smarkmreference.  Do not try to use @code{@@pxref} as a clause in a sentence.
640642660SmarkmIt will look bad in either the Info file, the printed output, or
640742660Smarkmboth.@refill
640842660Smarkm@end quotation
640942660Smarkm
6410146515SruParenthetical cross references look best at the ends of sentences.
6411146515SruAlthough they technically work in the middle of a sentence, that
6412146515Srulocation breaks up the flow of reading.
6413146515Sru
6414146515Sru
6415146515Sru@node inforef
641642660Smarkm@section @code{@@inforef}
641742660Smarkm@cindex Cross references using @code{@@inforef}
641842660Smarkm@cindex References using @code{@@inforef}
641942660Smarkm@findex inforef
642042660Smarkm
6421146515Sru@code{@@inforef} is used for making cross references to Info
6422146515Srudocuments---even from a printed manual.  This might be because you
6423146515Sruwant to refer to conditional @code{@@ifinfo} text
6424146515Sru(@pxref{Conditionals}), or because printed output is not available
6425146515Sru(perhaps because there is no Texinfo source), among other
6426146515Srupossibilities.
642742660Smarkm
642842660SmarkmThe command takes either two or three arguments, in the following
642942660Smarkmorder:@refill
643042660Smarkm
643142660Smarkm@enumerate
643242660Smarkm@item
643342660SmarkmThe node name.
643442660Smarkm
643542660Smarkm@item
643642660SmarkmThe cross reference name (optional).
643742660Smarkm
643842660Smarkm@item
643942660SmarkmThe Info file name.
644042660Smarkm@end enumerate
644142660Smarkm
644242660Smarkm@noindent
644342660SmarkmSeparate the arguments with commas, as with @code{@@xref}.  Also, you
644442660Smarkmmust terminate the reference with a comma or period after the
644542660Smarkm@samp{@}}, as you do with @code{@@xref}.@refill
644642660Smarkm
644742660Smarkm@noindent
644842660SmarkmThe template is:
644942660Smarkm
645042660Smarkm@example
645142660Smarkm@@inforef@{@var{node-name}, @var{cross-reference-name}, @var{info-file-name}@},
645242660Smarkm@end example
645342660Smarkm
645442660Smarkm@need 800
645542660Smarkm@noindent
6456146515SruFor example,
645742660Smarkm
645842660Smarkm@example
645942660Smarkm@group
6460146515Sru@@inforef@{Advanced, Advanced Info commands, info@},
646142660Smarkmfor more information.
646242660Smarkm@end group
646342660Smarkm@end example
646442660Smarkm
646542660Smarkm@need 800
646642660Smarkm@noindent
6467146515Sruproduces (in Info):
646842660Smarkm
646942660Smarkm@example
647042660Smarkm@group
6471146515Sru*Note Advanced Info commands: (info)Advanced,
647242660Smarkmfor more information.
647342660Smarkm@end group
647442660Smarkm@end example
647542660Smarkm
647642660Smarkm@need 800
647742660Smarkm@noindent
6478146515Sruand (in the printed output):
647942660Smarkm
648042660Smarkm@quotation
6481146515SruSee Info file @file{info}, node @samp{Advanced}, for more information.
648242660Smarkm@end quotation
648342660Smarkm
6484146515Sru(This particular example is not realistic, since the Info manual is
6485146515Sruwritten in Texinfo, so all formats are available.)
648642660Smarkm
648742660SmarkmThe converse of @code{@@inforef} is @code{@@cite}, which is used to
648842660Smarkmrefer to printed works for which no Info form exists.  @xref{cite, ,
6489146515Sru@code{@@cite}}.
649042660Smarkm
649142660Smarkm
649256160Sru@node uref
6493146515Sru@section @code{@@url}, @code{@@uref@{@var{url}[, @var{text}][, @var{replacement}]@}}
649442660Smarkm@findex uref
649542660Smarkm@cindex Uniform resource locator, referring to
649642660Smarkm@cindex URL, referring to
649742660Smarkm
649856160Sru@cindex @code{href}, producing HTML
649956160Sru@code{@@uref} produces a reference to a uniform resource locator (url).
650056160SruIt takes one mandatory argument, the url, and two optional arguments
650156160Sruwhich control the text that is displayed.  In HTML output, @code{@@uref}
650256160Sruproduces a link you can follow.
650342660Smarkm
6504146515Sru@code{@@url} is a synonym for @code{@@uref}.  Originally, @code{@@url}
6505146515Sruhad the meaning of @code{@@indicateurl}
6506146515Sru(@pxref{indicateurl,,@code{@@indicateurl}}), but in actual practice it
6507146515Sruwas misused the vast majority of the time.  So we've changed the
6508146515Srudefinitions.
6509146515Sru
651056160SruThe second argument, if specified, is the text to display (the default
651156160Sruis the url itself); in Info and DVI output, but not in HTML output, the
651256160Sruurl is also output.
651356160Sru
651456160Sru@cindex Man page, reference to
6515116525SruThe third argument, if specified, is the text to display, but in this
6516116525Srucase the url is @emph{not} output in any format.  This is useful when
6517116525Sruthe text is already sufficiently referential, as in a man page.  If
651856160Sruthe third argument is given, the second argument is ignored.
651956160Sru
6520116525SruIf the url is long enough to cause problems with line breaking, you
6521116525Srumay find it useful to insert @code{@@/} at places where a line break
6522116525Sruwould be acceptable (after @samp{/} characters, for instance).  This
6523116525Srutells @TeX{} to allow (but not force) a line break at those places.
6524116525Sru@xref{Line Breaks}.
652556160Sru
6526116525SruHere is an example of the simple one argument form, where the url is
6527116525Sruboth the target and the text of the link:
6528116525Sru
652942660Smarkm@example
653056160SruThe official GNU ftp site is @@uref@{ftp://ftp.gnu.org/gnu@}.
653142660Smarkm@end example
653242660Smarkm
653356160Sru@noindent produces:
653442660Smarkm@display
653556160SruThe official GNU ftp site is @uref{ftp://ftp.gnu.org/gnu}.
653642660Smarkm@end display
653742660Smarkm
653856160Sru
653956160SruAn example of the two-argument form:
654042660Smarkm@example
654193139SruThe official @@uref@{ftp://ftp.gnu.org/gnu, GNU ftp site@}
654293139Sruholds programs and texts.
654342660Smarkm@end example
654442660Smarkm
654556160Sru@noindent produces:
654642660Smarkm@display
654793139SruThe official @uref{ftp://ftp.gnu.org/gnu, GNU ftp site}
654893139Sruholds programs and texts.
654942660Smarkm@end display
655042660Smarkm
655156160Sru@noindent that is, the Info output is this:
655242660Smarkm@example
655393139SruThe official GNU ftp site (ftp://ftp.gnu.org/gnu)
655493139Sruholds programs and texts.
655542660Smarkm@end example
655642660Smarkm
655756160Sru@noindent and the HTML output is this:
655856160Sru@example
655993139SruThe official <a href="ftp://ftp.gnu.org/gnu">GNU ftp site</a>
656093139Sruholds programs and texts.
656156160Sru@end example
656242660Smarkm
656342660Smarkm
656456160SruAn example of the three-argument form:
656556160Sru@example
656693139SruThe @@uref@{/man.cgi/1/ls,,ls(1)@} program @dots{}
656756160Sru@end example
656856160Sru
656956160Sru@noindent produces:
657056160Sru@display
657193139SruThe @uref{/man.cgi/1/ls,,ls(1)} program @dots{}
657256160Sru@end display
657356160Sru
657456160Sru@noindent but with HTML:
657556160Sru@example
657693139SruThe <a href="/man.cgi/1/ls">ls(1)</a> program @dots{}
657756160Sru@end example
657856160Sru
657956160SruTo merely indicate a url without creating a link people can follow, use
6580146515Sru@code{@@indicateurl} (@pxref{indicateurl, @code{@@indicateurl}}).
658156160Sru
658256160SruSome people prefer to display url's in the unambiguous format:
658356160Sru
658456160Sru@display
658556160Sru<URL:http://@var{host}/@var{path}>
658656160Sru@end display
658756160Sru
658856160Sru@noindent
6589116525Sru@cindex <URL: convention, not used
659056160SruYou can use this form in the input file if you wish.  We feel it's not
6591116525Srunecessary to include the @samp{<URL:} and @samp{>} in the output,
6592116525Srusince any software that tries to detect url's in text already has to
6593116525Srudetect them without the @samp{<URL:} to be useful.
659456160Sru
659556160Sru
659656160Sru@node Marking Text
659742660Smarkm@chapter Marking Words and Phrases
659842660Smarkm@cindex Paragraph, marking text within
659942660Smarkm@cindex Marking words and phrases
660042660Smarkm@cindex Words and phrases, marking them
660142660Smarkm@cindex Marking text within a paragraph
660256160Sru@cindex Text, marking up
660342660Smarkm
660442660SmarkmIn Texinfo, you can mark words and phrases in a variety of ways.
660542660SmarkmThe Texinfo formatters use this information to determine how to
660642660Smarkmhighlight the text.
660742660SmarkmYou can specify, for example, whether a word or phrase is a
660842660Smarkmdefining occurrence, a metasyntactic variable, or a symbol used in a
660956160Sruprogram.  Also, you can emphasize text, in several different ways.
661042660Smarkm
661142660Smarkm@menu
661242660Smarkm* Indicating::                  How to indicate definitions, files, etc.
661342660Smarkm* Emphasis::                    How to emphasize text.
661442660Smarkm@end menu
661542660Smarkm
661693139Sru
6617146515Sru@node Indicating
661842660Smarkm@section Indicating Definitions, Commands, etc.
661942660Smarkm@cindex Highlighting text
662042660Smarkm@cindex Indicating commands, definitions, etc.
662142660Smarkm
662242660SmarkmTexinfo has commands for indicating just what kind of object a piece of
662342660Smarkmtext refers to.  For example, metasyntactic variables are marked by
662442660Smarkm@code{@@var}, and code by @code{@@code}.  Since the pieces of text are
662542660Smarkmlabelled by commands that tell what kind of object they are, it is easy
662642660Smarkmto change the way the Texinfo formatters prepare such text.  (Texinfo is
662742660Smarkman @emph{intentional} formatting language rather than a @emph{typesetting}
662842660Smarkmformatting language.)@refill
662942660Smarkm
663042660SmarkmFor example, in a printed manual,
663142660Smarkmcode is usually illustrated in a typewriter font;
663242660Smarkm@code{@@code} tells @TeX{} to typeset this text in this font.  But it
663342660Smarkmwould be easy to change the way @TeX{} highlights code to use another
663456160Srufont, and this change would not affect how keystroke examples are
663542660Smarkmhighlighted.  If straight typesetting commands were used in the body
663642660Smarkmof the file and you wanted to make a change, you would need to check
663742660Smarkmevery single occurrence to make sure that you were changing code and
663842660Smarkmnot something else that should not be changed.@refill
663942660Smarkm
664042660Smarkm@menu
664142660Smarkm* Useful Highlighting::         Highlighting provides useful information.
664256160Sru* code::                        Indicating program code.
664356160Sru* kbd::                         Showing keyboard input.
664456160Sru* key::                         Specifying keys.
6645146515Sru* samp::                        Indicating a literal sequence of characters.
6646146515Sru* verb::                        Indicating a verbatim sequence of characters.
664756160Sru* var::                         Indicating metasyntactic variables.
664856160Sru* env::                         Indicating environment variables.
664956160Sru* file::                        Indicating file names.
665056160Sru* command::                     Indicating command names.
665156160Sru* option::                      Indicating option names.
665256160Sru* dfn::                         Specifying definitions.
6653146515Sru* cite::                        Referring to books not in the Info system.
6654146515Sru* abbr::                        Indicating abbreviations.
665556160Sru* acronym::                     Indicating acronyms.
6656146515Sru* indicateurl::                 Indicating an example URL.
665756160Sru* email::                       Indicating an electronic mail address.
665842660Smarkm@end menu
665942660Smarkm
666056160Sru
6661146515Sru@node Useful Highlighting
6662146515Sru@subsection Highlighting Commands are Useful
666342660Smarkm
666456160SruThe highlighting commands can be used to extract useful information
666542660Smarkmfrom the file, such as lists of functions or file names.  It is
666642660Smarkmpossible, for example, to write a program in Emacs Lisp (or a keyboard
666742660Smarkmmacro) to insert an index entry after every paragraph that contains
666842660Smarkmwords or phrases marked by a specified command.  You could do this to
666942660Smarkmconstruct an index of functions if you had not already made the
667042660Smarkmentries.@refill
667142660Smarkm
667242660SmarkmThe commands serve a variety of purposes:@refill
667342660Smarkm
667442660Smarkm@table @code
667542660Smarkm@item @@code@{@var{sample-code}@}
6676146515SruIndicate text that is a literal example of a piece of a program.
6677146515Sru@xref{code,,@code{@@code}}.
667842660Smarkm
667942660Smarkm@item @@kbd@{@var{keyboard-characters}@}
6680146515SruIndicate keyboard input.
6681146515Sru@xref{kbd,,@code{@@kbd}}.
668242660Smarkm
668342660Smarkm@item @@key@{@var{key-name}@}
6684146515SruIndicate the conventional name for a key on a keyboard.
6685146515Sru@xref{key,,@code{@@key}}.
668642660Smarkm
668742660Smarkm@item @@samp@{@var{text}@}
6688146515SruIndicate text that is a literal example of a sequence of characters.
6689146515Sru@xref{samp,,@code{@@samp}}.
669042660Smarkm
6691146515Sru@item @@verb@{@var{text}@}
6692146515SruWrite a verbatim sequence of characters.
6693146515Sru@xref{verb,,@code{@@verb}}.
6694146515Sru
669542660Smarkm@item @@var@{@var{metasyntactic-variable}@}
6696146515SruIndicate a metasyntactic variable.
6697146515Sru@xref{var,,@code{@@var}}.
669842660Smarkm
669956160Sru@item @@env@{@var{environment-variable}@}
6700146515SruIndicate an environment variable.
6701146515Sru@xref{env,,@code{@@kenv}}.
670242660Smarkm
670342660Smarkm@item @@file@{@var{file-name}@}
6704146515SruIndicate the name of a file.
6705146515Sru@xref{file,,@code{@@file}}.
670642660Smarkm
670756160Sru@item @@command@{@var{command-name}@}
6708146515SruIndicate the name of a command.
6709146515Sru@xref{command,,@code{@@command}}.
671042660Smarkm
671156160Sru@item @@option@{@var{option}@}
6712146515SruIndicate a command-line option.
6713146515Sru@xref{option,,@code{@@option}}.
671456160Sru
671542660Smarkm@item @@dfn@{@var{term}@}
6716146515SruIndicate the introductory or defining use of a term.
6717146515Sru@xref{dfn,,@code{@@dfn}}.
671842660Smarkm
671942660Smarkm@item @@cite@{@var{reference}@}
6720146515SruIndicate the name of a book.
6721146515Sru@xref{cite,,@code{@@cite}}.
672242660Smarkm
6723146515Sru@item @@abbr@{@var{abbreviation}@}
6724146515SruIndicate an abbreviation.
6725146515Sru
672656160Sru@item @@acronym@{@var{acronym}@}
6727146515SruIndicate an acronym.
6728146515Sru@xref{acronym,,@code{@@acronym}}.
672956160Sru
6730146515Sru@item @@indicateurl@{@var{uniform-resource-locator}@}
6731146515SruIndicate an example (that is, nonfunctional) uniform resource locator.
6732146515Sru@xref{indicateurl,,@code{@@indicateurl}}.  (Use @code{@@url}
6733146515Sru(@pxref{uref,,@code{@@url}}) for live url's.)
673456160Sru
673556160Sru@item @@email@{@var{email-address}[, @var{displayed-text}]@}
673656160SruIndicate an electronic mail address.
6737146515Sru@xref{email,,@code{@@email}}.
673856160Sru
673942660Smarkm@ignore
674042660Smarkm@item @@ctrl@{@var{ctrl-char}@}
674142660SmarkmUse for an @sc{ascii} control character.@refill
674242660Smarkm@end ignore
674342660Smarkm@end table
674442660Smarkm
674556160Sru
674656160Sru@node code
674742660Smarkm@subsection @code{@@code}@{@var{sample-code}@}
674842660Smarkm@findex code
674942660Smarkm
675056160Sru@cindex Syntactic tokens, indicating
675142660SmarkmUse the @code{@@code} command to indicate text that is a piece of a
675242660Smarkmprogram and which consists of entire syntactic tokens.  Enclose the
675356160Srutext in braces.
675442660Smarkm
675556160Sru@cindex Expressions in a program, indicating
675656160Sru@cindex Keywords, indicating
675756160Sru@cindex Reserved words, indicating
675842660SmarkmThus, you should use @code{@@code} for an expression in a program, for
675942660Smarkmthe name of a variable or function used in a program, or for a
676056160Srukeyword in a programming language.
676142660Smarkm
676256160SruUse @code{@@code} for command names in languages that resemble
676356160Sruprogramming languages, such as Texinfo.  For example, @code{@@code} and
676456160Sru@code{@@samp} are produced by writing @samp{@@code@{@@@@code@}} and
676556160Sru@samp{@@code@{@@@@samp@}} in the Texinfo source, respectively.
676642660Smarkm
676756160Sru@cindex Case, not altering in @code{@@code}
676842660SmarkmIt is incorrect to alter the case of a word inside an @code{@@code}
676942660Smarkmcommand when it appears at the beginning of a sentence.  Most computer
677042660Smarkmlanguages are case sensitive.  In C, for example, @code{Printf} is
677142660Smarkmdifferent from the identifier @code{printf}, and most likely is a
677242660Smarkmmisspelling of it.  Even in languages which are not case sensitive, it
677342660Smarkmis confusing to a human reader to see identifiers spelled in different
677442660Smarkmways.  Pick one spelling and always use that.  If you do not want to
677556160Srustart a sentence with a command name written all in lower case, you
677656160Srushould rearrange the sentence.
677742660Smarkm
677842660SmarkmIn the printed manual, @code{@@code} causes @TeX{} to typeset the
677942660Smarkmargument in a typewriter face.  In the Info file, it causes the Info
678042660Smarkmformatting commands to use single quotation marks around the text.
678142660Smarkm
678242660Smarkm@need 700
678342660SmarkmFor example,
678442660Smarkm
678542660Smarkm@example
678656160SruThe function returns @@code@{nil@}.
678742660Smarkm@end example
678842660Smarkm
678942660Smarkm@noindent
679056160Sruproduces this in the printed manual:
679142660Smarkm
679242660Smarkm@quotation
679356160SruThe function returns @code{nil}.
679442660Smarkm@end quotation
679556160Sru
679642660Smarkm@iftex
679742660Smarkm@noindent
679856160Sruand this in the Info file:
679942660Smarkm@example
680056160SruThe function returns `nil'.
680142660Smarkm@end example
680242660Smarkm@end iftex
680342660Smarkm
680456160SruHere are some cases for which it is preferable not to use @code{@@code}:
680542660Smarkm
680656160Sru@itemize @bullet
680756160Sru@item
680856160SruFor shell command names such as @command{ls} (use @code{@@command}).
680956160Sru
681056160Sru@item
681156160SruFor shell options such as @samp{-c} when such options stand alone (use
681256160Sru@code{@@option}).
681356160Sru
681456160Sru@item
681556160SruAlso, an entire shell command often looks better if written using
681656160Sru@code{@@samp} rather than @code{@@code}.  In this case, the rule is to
681756160Sruchoose the more pleasing format.
681856160Sru
681956160Sru@item
682056160SruFor environment variable such as @env{TEXINPUTS} (use @code{@@env}).
682156160Sru
682256160Sru@item
682356160SruFor a string of characters shorter than a syntactic token.  For example,
682456160Sruif you are writing about @samp{goto-ch}, which is just a part of the
682556160Sruname for the @code{goto-char} Emacs Lisp function, you should use
682656160Sru@code{@@samp}.
682756160Sru
682856160Sru@item
682956160SruIn general, when writing about the characters used in a token; for
683056160Sruexample, do not use @code{@@code} when you are explaining what letters
683156160Sruor printable symbols can be used in the names of functions.  (Use
683256160Sru@code{@@samp}.)  Also, you should not use @code{@@code} to mark text
683356160Sruthat is considered input to programs unless the input is written in a
683456160Srulanguage that is like a programming language.  For example, you should
683556160Srunot use @code{@@code} for the keystroke commands of GNU Emacs (use
683656160Sru@code{@@kbd} instead) although you may use @code{@@code} for the names
683756160Sruof the Emacs Lisp functions that the keystroke commands invoke.
683856160Sru
683956160Sru@end itemize
684056160Sru
684156160SruSince @code{@@command}, @code{@@option}, and @code{@@env} were
684256160Sruintroduced relatively recently, it is acceptable to use @code{@@code} or
684356160Sru@code{@@samp} for command names, options, and environment variables.
684456160SruThe new commands allow you to express the markup more precisely, but
684556160Sruthere is no real harm in using the older commands, and of course the
684656160Srulong-standing manuals do so.
684756160Sru
684856160Sru
684956160Sru@node kbd
685042660Smarkm@subsection @code{@@kbd}@{@var{keyboard-characters}@}
685142660Smarkm@findex kbd
685256160Sru@cindex Keyboard input
685342660Smarkm
685442660SmarkmUse the @code{@@kbd} command for characters of input to be typed by
6855146515Sruusers.  For example, to refer to the characters @kbd{M-a}, write:
685642660Smarkm
685742660Smarkm@example
685842660Smarkm@@kbd@{M-a@}
685942660Smarkm@end example
686042660Smarkm
686142660Smarkm@noindent
6862146515Sruand to refer to the characters @kbd{M-x shell}, write:
686342660Smarkm
686442660Smarkm@example
686542660Smarkm@@kbd@{M-x shell@}
686642660Smarkm@end example
686742660Smarkm
6868146515Sru@cindex User input
6869146515Sru@cindex Slanted typewriter font, for @code{@@kbd}
6870146515SruBy default, the @code{@@kbd} command produces a different font
6871146515Sru(slanted typewriter instead of normal typewriter) in the printed
6872146515Srumanual, so users can distinguish the characters that they are supposed
6873146515Sruto type from those that the computer outputs.
687442660Smarkm
6875146515SruIn Info output, @code{@@kbd} is usually the same as @code{@@code},
6876146515Sruproducing `quotes' around its argument.  However, in typewriter-like
6877146515Srucontexts such as the @code{@@example} environment (@pxref{example})
6878146515Sruand @code{@@code} command itself, the quotes are omitted, since Info
6879146515Sruformat cannot use distinguishing fonts.
6880146515Sru
688142660Smarkm@findex kbdinputstyle
688242660SmarkmSince the usage of @code{@@kbd} varies from manual to manual, you can
688342660Smarkmcontrol the font switching with the @code{@@kbdinputstyle} command.
688442660SmarkmThis command has no effect on Info output.  Write this command at the
688542660Smarkmbeginning of a line with a single word as an argument, one of the
688642660Smarkmfollowing:
6887146515Sru
6888146515Sru@vindex distinct@r{, value for @code{@@kbdinputstyle}}
6889146515Sru@vindex example@r{, value for @code{@@kbdinputstyle}}
6890146515Sru@vindex code@r{, value for @code{@@kbdinputstyle}}
689142660Smarkm@table @samp
689242660Smarkm@item code
689342660SmarkmAlways use the same font for @code{@@kbd} as @code{@@code}.
689442660Smarkm@item example
689542660SmarkmUse the distinguishing font for @code{@@kbd} only in @code{@@example}
689642660Smarkmand similar environments.
689756160Sru@item distinct
689842660Smarkm(the default) Always use the distinguishing font for @code{@@kbd}.
689942660Smarkm@end table
690042660Smarkm
690142660SmarkmYou can embed another @@-command inside the braces of an @code{@@kbd}
690242660Smarkmcommand.  Here, for example, is the way to describe a command that
6903146515Sruwould be described more verbosely as ``press the @samp{r} key and then
6904146515Srupress the @key{RETURN} key'':
690542660Smarkm
690642660Smarkm@example
690742660Smarkm@@kbd@{r @@key@{RET@}@}
690842660Smarkm@end example
690942660Smarkm
691042660Smarkm@noindent
6911146515SruThis produces: @kbd{r @key{RET}}.  (The present manual accepts the
6912146515Srudefault for @code{@@kbdinputstyle}.)
691342660Smarkm
691442660SmarkmYou also use the @code{@@kbd} command if you are spelling out the letters
6915146515Sruyou type; for example:
691642660Smarkm
691742660Smarkm@example
691842660SmarkmTo give the @@code@{logout@} command,
691942660Smarkmtype the characters @@kbd@{l o g o u t @@key@{RET@}@}.
692042660Smarkm@end example
692142660Smarkm
692242660Smarkm@noindent
692342660SmarkmThis produces:
692442660Smarkm
692542660Smarkm@quotation
692642660SmarkmTo give the @code{logout} command,
692742660Smarkmtype the characters @kbd{l o g o u t @key{RET}}.
692842660Smarkm@end quotation
692942660Smarkm
693042660Smarkm(Also, this example shows that you can add spaces for clarity.  If you
6931146515Sruexplicitly want to mention a space character as one of the characters of
693242660Smarkminput, write @kbd{@@key@{SPC@}} for it.)@refill
693342660Smarkm
693442660Smarkm
6935146515Sru@node key
693642660Smarkm@comment  node-name,  next,  previous,  up
693742660Smarkm@subsection @code{@@key}@{@var{key-name}@}
693842660Smarkm@findex key
693942660Smarkm
694042660SmarkmUse the @code{@@key} command for the conventional name for a key on a
694142660Smarkmkeyboard, as in:@refill
694242660Smarkm
694342660Smarkm@example
694442660Smarkm@@key@{RET@}
694542660Smarkm@end example
694642660Smarkm
694742660SmarkmYou can use the @code{@@key} command within the argument of an
694842660Smarkm@code{@@kbd} command when the sequence of characters to be typed
694942660Smarkmincludes one or more keys that are described by name.@refill
695042660Smarkm
695142660Smarkm@need 700
695242660SmarkmFor example, to produce @kbd{C-x @key{ESC}} you would type:@refill
695342660Smarkm
695442660Smarkm@example
695542660Smarkm@@kbd@{C-x @@key@{ESC@}@}
695642660Smarkm@end example
695742660Smarkm
695842660SmarkmHere is a list of the recommended names for keys:
695942660Smarkm@cindex Recommended names for keys
696042660Smarkm@cindex Keys, recommended names
696142660Smarkm@cindex Names recommended for keys
696242660Smarkm@cindex Abbreviations for keys
696342660Smarkm
696442660Smarkm@quotation
696542660Smarkm@table @t
696642660Smarkm@item SPC
696742660SmarkmSpace
696842660Smarkm@item RET
696942660SmarkmReturn
697042660Smarkm@item LFD
697142660SmarkmLinefeed (however, since most keyboards nowadays do not have a Linefeed key,
697242660Smarkmit might be better to call this character @kbd{C-j}.
697342660Smarkm@item TAB
697442660SmarkmTab
697542660Smarkm@item BS
697642660SmarkmBackspace
697742660Smarkm@item ESC
697842660SmarkmEscape
697942660Smarkm@item DEL
698042660SmarkmDelete
698142660Smarkm@item SHIFT
698242660SmarkmShift
698342660Smarkm@item CTRL
698442660SmarkmControl
698542660Smarkm@item META
698642660SmarkmMeta
698742660Smarkm@end table
698842660Smarkm@end quotation
698942660Smarkm
699042660Smarkm@cindex META key
699142660SmarkmThere are subtleties to handling words like `meta' or `ctrl' that are
699242660Smarkmnames of modifier keys.  When mentioning a character in which the
699342660Smarkmmodifier key is used, such as @kbd{Meta-a}, use the @code{@@kbd} command
699442660Smarkmalone; do not use the @code{@@key} command; but when you are referring
699542660Smarkmto the modifier key in isolation, use the @code{@@key} command.  For
699642660Smarkmexample, write @samp{@@kbd@{Meta-a@}} to produce @kbd{Meta-a} and
699742660Smarkm@samp{@@key@{META@}} to produce @key{META}.
699842660Smarkm
699942660Smarkm@c I don't think this is a good explanation.
700042660Smarkm@c I think it will puzzle readers more than it clarifies matters.  -- rms.
700142660Smarkm@c In other words, use @code{@@kbd} for what you do, and use @code{@@key}
700242660Smarkm@c for what you talk about: ``Press @code{@@kbd@{M-a@}} to move point to
700342660Smarkm@c the beginning of the sentence.  The @code{@@key@{META@}} key is often in
700442660Smarkm@c the lower left of the keyboard.''@refill
700542660Smarkm
700693139Sru@node samp
700742660Smarkm@subsection @code{@@samp}@{@var{text}@}
700842660Smarkm@findex samp
700942660Smarkm
701042660SmarkmUse the @code{@@samp} command to indicate text that is a literal example
701142660Smarkmor `sample' of a sequence of characters in a file, string, pattern, etc.
701242660SmarkmEnclose the text in braces.  The argument appears within single
701342660Smarkmquotation marks in both the Info file and the printed manual; in
701442660Smarkmaddition, it is printed in a fixed-width font.@refill
701542660Smarkm
701642660Smarkm@example
701742660SmarkmTo match @@samp@{foo@} at the end of the line,
701842660Smarkmuse the regexp @@samp@{foo$@}.
701942660Smarkm@end example
702042660Smarkm
702142660Smarkm@noindent
702242660Smarkmproduces
702342660Smarkm
702442660Smarkm@quotation
702542660SmarkmTo match @samp{foo} at the end of the line, use the regexp
702642660Smarkm@samp{foo$}.@refill
702742660Smarkm@end quotation
702842660Smarkm
702942660SmarkmAny time you are referring to single characters, you should use
703042660Smarkm@code{@@samp} unless @code{@@kbd} or @code{@@key} is more appropriate.
703156160SruAlso, you may use @code{@@samp} for entire statements in C and for entire
703242660Smarkmshell commands---in this case, @code{@@samp} often looks better than
703342660Smarkm@code{@@code}.  Basically, @code{@@samp} is a catchall for whatever is
703442660Smarkmnot covered by @code{@@code}, @code{@@kbd}, or @code{@@key}.@refill
703542660Smarkm
703642660SmarkmOnly include punctuation marks within braces if they are part of the
703742660Smarkmstring you are specifying.  Write punctuation marks outside the braces
703842660Smarkmif those punctuation marks are part of the English text that surrounds
703942660Smarkmthe string.  In the following sentence, for example, the commas and
704042660Smarkmperiod are outside of the braces:@refill
704142660Smarkm
704242660Smarkm@example
704342660Smarkm@group
704442660SmarkmIn English, the vowels are @@samp@{a@}, @@samp@{e@},
704542660Smarkm@@samp@{i@}, @@samp@{o@}, @@samp@{u@}, and sometimes
704642660Smarkm@@samp@{y@}.
704742660Smarkm@end group
704842660Smarkm@end example
704942660Smarkm
705042660Smarkm@noindent
705142660SmarkmThis produces:
705242660Smarkm
705342660Smarkm@quotation
705442660SmarkmIn English, the vowels are @samp{a}, @samp{e},
705542660Smarkm@samp{i}, @samp{o}, @samp{u},  and sometimes
705642660Smarkm@samp{y}.
705742660Smarkm@end quotation
705842660Smarkm
705956160Sru
706093139Sru@node verb
706193139Sru@subsection @code{@@verb}@{<char>@var{text}<char>@}
706293139Sru@findex verb
706393139Sru@cindex Verbatim in-line text
706493139Sru
7065116525Sru@cindex Delimiter character, for verbatim
706693139SruUse the @code{@@verb} command to print a verbatim sequence of
706793139Srucharacters.
706893139Sru
7069146515SruLike @LaTeX{}'s @code{\verb} command, the verbatim text can be quoted using
707093139Sruany unique delimiter character.  Enclose the verbatim text, including the
707193139Srudelimiters, in braces.  Text is printed in a fixed-width font:
707293139Sru
707393139Sru@example
707493139SruHow many @@verb@{|@@|@}-escapes does one need to print this
707593139Sru@@verb@{.@@a @@b @@c.@} string or @@verb@{+@@'e@?`@!`@{@}\+@} this?
707693139Sru@end example
707793139Sru
707893139Sru@noindent
707993139Sruproduces
708093139Sru
708193139Sru@example
708293139SruHow many @verb{|@|}-escapes does one need to print this
708393139Sru@verb{.@a @b @c.} string or these @verb{+@'e?`{}!`\+} this?
708493139Sru@end example
708593139Sru
7086146515SruThis is in contrast to @code{@@samp} (see the previous section),
7087146515Sru@code{@@code}, and similar commands; in those cases, the argument is
7088146515Srunormal Texinfo text, where the three characters @code{@@@{@}} are
7089146515Sruspecial.  With @code{@@verb}, nothing is special except the delimiter
7090146515Srucharacter you choose.
709193139Sru
7092146515SruIt is not reliable to use @code{@@verb} inside other Texinfo
7093146515Sruconstructs.  In particular, it does not work to use @code{@@verb} in
7094146515Sruanything related to cross-referencing, such as section titles or
7095146515Srufigure captions.
709693139Sru
7097146515Sru
709856160Sru@node var
709942660Smarkm@subsection @code{@@var}@{@var{metasyntactic-variable}@}
710042660Smarkm@findex var
710142660Smarkm
710242660SmarkmUse the @code{@@var} command to indicate metasyntactic variables.  A
710342660Smarkm@dfn{metasyntactic variable} is something that stands for another piece of
710442660Smarkmtext.  For example, you should use a metasyntactic variable in the
710542660Smarkmdocumentation of a function to describe the arguments that are passed
710642660Smarkmto that function.@refill
710742660Smarkm
710842660SmarkmDo not use @code{@@var} for the names of particular variables in
710942660Smarkmprogramming languages.  These are specific names from a program, so
711056160Sru@code{@@code} is correct for them (@pxref{code}).  For example, the
711156160SruEmacs Lisp variable @code{texinfo-tex-command} is not a metasyntactic
711256160Sruvariable; it is properly formatted using @code{@@code}.
711342660Smarkm
711456160SruDo not use @code{@@var} for environment variables either; @code{@@env}
711556160Sruis correct for them (see the next section).
711642660Smarkm
711756160SruThe effect of @code{@@var} in the Info file is to change the case of the
711856160Sruargument to all upper case.  In the printed manual and HTML output, the
7119116525Sruargument is printed in slanted type.
712056160Sru
712142660Smarkm@need 700
712242660SmarkmFor example,
712342660Smarkm
712442660Smarkm@example
712542660SmarkmTo delete file @@var@{filename@},
712656160Srutype @@samp@{rm @@var@{filename@}@}.
712742660Smarkm@end example
712842660Smarkm
712942660Smarkm@noindent
713042660Smarkmproduces
713142660Smarkm
713242660Smarkm@quotation
713356160SruTo delete file @var{filename}, type @samp{rm @var{filename}}.
713442660Smarkm@end quotation
713542660Smarkm
713642660Smarkm@noindent
713742660Smarkm(Note that @code{@@var} may appear inside @code{@@code},
713842660Smarkm@code{@@samp}, @code{@@file}, etc.)@refill
713942660Smarkm
714042660SmarkmWrite a metasyntactic variable all in lower case without spaces, and
714142660Smarkmuse hyphens to make it more readable.  Thus, the Texinfo source for
714242660Smarkmthe illustration of how to begin a Texinfo manual looks like
714342660Smarkmthis:@refill
714442660Smarkm
714542660Smarkm@example
714642660Smarkm@group
714742660Smarkm\input texinfo
714842660Smarkm@@@@setfilename @@var@{info-file-name@}
714942660Smarkm@@@@settitle @@var@{name-of-manual@}
715042660Smarkm@end group
715142660Smarkm@end example
715242660Smarkm
715342660Smarkm@noindent
715442660SmarkmThis produces:
715542660Smarkm
715642660Smarkm@example
715742660Smarkm@group
715842660Smarkm\input texinfo
715942660Smarkm@@setfilename @var{info-file-name}
716042660Smarkm@@settitle @var{name-of-manual}
716142660Smarkm@end group
716242660Smarkm@end example
716342660Smarkm
716442660SmarkmIn some documentation styles, metasyntactic variables are shown with
716542660Smarkmangle brackets, for example:@refill
716642660Smarkm
716742660Smarkm@example
716842660Smarkm@dots{}, type rm <filename>
716942660Smarkm@end example
717042660Smarkm
717142660Smarkm@noindent
717242660SmarkmHowever, that is not the style that Texinfo uses.  (You can, of
717356160Srucourse, modify the sources to @file{texinfo.tex} and the Info formatting commands
717442660Smarkmto output the @code{<@dots{}>} format if you wish.)@refill
717542660Smarkm
717656160Sru
717756160Sru@node env
717856160Sru@subsection @code{@@env}@{@var{environment-variable}@}
717956160Sru@findex env
718056160Sru
718156160SruUse the @code{@@env} command to indicate environment variables, as used
718256160Sruby many operating systems, including GNU.  Do not use it for
718356160Srumetasyntactic variables; use @code{@@var} instead (see the previous
718456160Srusection).
718556160Sru
718656160Sru@code{@@env} is equivalent to @code{@@code} in its effects.
718756160SruFor example:
718856160Sru
718956160Sru@example
719093139SruThe @@env@{PATH@} environment variable @dots{}
719156160Sru@end example
719256160Sru@noindent produces
719356160Sru@quotation
719493139SruThe @env{PATH} environment variable @dots{}
719556160Sru@end quotation
719656160Sru
719756160Sru
719856160Sru@node file
719942660Smarkm@subsection @code{@@file}@{@var{file-name}@}
720042660Smarkm@findex file
720142660Smarkm
720242660SmarkmUse the @code{@@file} command to indicate text that is the name of a
720342660Smarkmfile, buffer, or directory, or is the name of a node in Info.  You can
720442660Smarkmalso use the command for file name suffixes.  Do not use @code{@@file}
720542660Smarkmfor symbols in a programming language; use @code{@@code}.
720642660Smarkm
720742660SmarkmCurrently, @code{@@file} is equivalent to @code{@@samp} in its effects.
720842660SmarkmFor example,@refill
720942660Smarkm
721042660Smarkm@example
721142660SmarkmThe @@file@{.el@} files are in
721242660Smarkmthe @@file@{/usr/local/emacs/lisp@} directory.
721342660Smarkm@end example
721442660Smarkm
721542660Smarkm@noindent
721642660Smarkmproduces
721742660Smarkm
721842660Smarkm@quotation
721942660SmarkmThe @file{.el} files are in
722042660Smarkmthe @file{/usr/local/emacs/lisp} directory.
722142660Smarkm@end quotation
722242660Smarkm
722356160Sru
722456160Sru@node command
722556160Sru@subsection @code{@@command}@{@var{command-name}@}
722656160Sru@findex command
722756160Sru@cindex Command names, indicating
722856160Sru@cindex Program names, indicating
722956160Sru
723056160SruUse the @code{@@command} command to indicate command names, such as
723156160Sru@command{ls} or @command{cc}.
723256160Sru
723356160Sru@code{@@command} is equivalent to @code{@@code} in its effects.
723456160SruFor example:
723556160Sru
723656160Sru@example
723756160SruThe command @@command@{ls@} lists directory contents.
723856160Sru@end example
723956160Sru@noindent produces
724056160Sru@quotation
724156160SruThe command @command{ls} lists directory contents.
724256160Sru@end quotation
724356160Sru
724456160SruYou should write the name of a program in the ordinary text font, rather
724556160Sruthan using @code{@@command}, if you regard it as a new English word,
724656160Srusuch as `Emacs' or `Bison'.
724756160Sru
724856160SruWhen writing an entire shell command invocation, as in @samp{ls -l},
724956160Sruyou should use either @code{@@samp} or @code{@@code} at your discretion.
725056160Sru
725156160Sru
725256160Sru@node option
725356160Sru@subsection @code{@@option}@{@var{option-name}@}
725456160Sru@findex option
725556160Sru
725656160SruUse the @code{@@option} command to indicate a command-line option; for
725756160Sruexample, @option{-l} or @option{--version} or
725856160Sru@option{--output=@var{filename}}.
725956160Sru
726056160Sru@code{@@option} is equivalent to @code{@@samp} in its effects.
726156160SruFor example:
726256160Sru
726356160Sru@example
726456160SruThe option @@option@{-l@} produces a long listing.
726556160Sru@end example
726656160Sru@noindent produces
726756160Sru@quotation
726856160SruThe option @option{-l} produces a long listing.
726956160Sru@end quotation
727056160Sru
727156160SruIn tables, putting options inside @code{@@code} produces a
727256160Srumore pleasing effect.
727356160Sru
727456160Sru@node dfn
727542660Smarkm@comment  node-name,  next,  previous,  up
727642660Smarkm@subsection @code{@@dfn}@{@var{term}@}
727742660Smarkm@findex dfn
727842660Smarkm
727942660SmarkmUse the @code{@@dfn} command to identify the introductory or defining
728042660Smarkmuse of a technical term.  Use the command only in passages whose
728142660Smarkmpurpose is to introduce a term which will be used again or which the
728242660Smarkmreader ought to know.  Mere passing mention of a term for the first
728342660Smarkmtime does not deserve @code{@@dfn}.  The command generates italics in
728442660Smarkmthe printed manual, and double quotation marks in the Info file.  For
728542660Smarkmexample:@refill
728642660Smarkm
728742660Smarkm@example
728842660SmarkmGetting rid of a file is called @@dfn@{deleting@} it.
728942660Smarkm@end example
729042660Smarkm
729142660Smarkm@noindent
729242660Smarkmproduces
729342660Smarkm
729442660Smarkm@quotation
729542660SmarkmGetting rid of a file is called @dfn{deleting} it.
729642660Smarkm@end quotation
729742660Smarkm
729842660SmarkmAs a general rule, a sentence containing the defining occurrence of a
729942660Smarkmterm should be a definition of the term.  The sentence does not need
730042660Smarkmto say explicitly that it is a definition, but it should contain the
730142660Smarkminformation of a definition---it should make the meaning clear.
730242660Smarkm
730356160Sru@node cite
730442660Smarkm@subsection @code{@@cite}@{@var{reference}@}
730542660Smarkm@findex cite
730642660Smarkm
730742660SmarkmUse the @code{@@cite} command for the name of a book that lacks a
730856160Srucompanion Info file.  The command produces italics in the printed
730956160Srumanual, and quotation marks in the Info file.
731042660Smarkm
731156160SruIf a book is written in Texinfo, it is better to use a cross reference
731242660Smarkmcommand since a reader can easily follow such a reference in Info.
731356160Sru@xref{xref, , @code{@@xref}}.
731442660Smarkm
731556160Sru
731642660Smarkm@ignore
731742660Smarkm@c node ctrl, , cite, Indicating
731842660Smarkm@comment  node-name,  next,  previous,  up
731942660Smarkm@c subsection @code{@@ctrl}@{@var{ctrl-char}@}
732042660Smarkm@findex ctrl
732142660Smarkm
732242660SmarkmThe @code{@@ctrl} command is seldom used.  It describes an @sc{ascii}
732342660Smarkmcontrol character by inserting the actual character into the Info
732442660Smarkmfile.
732542660Smarkm
732642660SmarkmUsually, in Texinfo, you talk what you type as keyboard entry by
732742660Smarkmdescribing it with @code{@@kbd}: thus, @samp{@@kbd@{C-a@}} for
732842660Smarkm@kbd{C-a}.  Use @code{@@kbd} in this way when talking about a control
732942660Smarkmcharacter that is typed on the keyboard by the user.  When talking
733042660Smarkmabout a control character appearing in a file or a string, do not use
733142660Smarkm@code{@@kbd} since the control character is not typed.  Also, do not
733242660Smarkmuse @samp{C-} but spell out @code{control-}, as in @samp{control-a},
733342660Smarkmto make it easier for a reader to understand.@refill
733442660Smarkm
733542660Smarkm@code{@@ctrl} is an idea from the beginnings of Texinfo which may not
733642660Smarkmreally fit in to the scheme of things.  But there may be times when
733742660Smarkmyou want to use the command.  The pattern is
733842660Smarkm@code{@@ctrl@{@var{ch}@}}, where @var{ch} is an @sc{ascii} character
733942660Smarkmwhose control-equivalent is wanted.  For example, to specify
734042660Smarkm@samp{control-f}, you would enter@refill
734142660Smarkm
734242660Smarkm@example
734342660Smarkm@@ctrl@{f@}
734442660Smarkm@end example
734542660Smarkm
734642660Smarkm@noindent
734742660Smarkmproduces
734842660Smarkm
734942660Smarkm@quotation
735042660Smarkm@ctrl{f}
735142660Smarkm@end quotation
735242660Smarkm
735342660SmarkmIn the Info file, this generates the specified control character, output
735442660Smarkmliterally into the file.  This is done so a user can copy the specified
735542660Smarkmcontrol character (along with whatever else he or she wants) into another
735642660SmarkmEmacs buffer and use it.  Since the `control-h',`control-i', and
735742660Smarkm`control-j' characters are formatting characters, they should not be
735842660Smarkmindicated with @code{@@ctrl}.@refill
735942660Smarkm
736042660SmarkmIn a printed manual, @code{@@ctrl} generates text to describe or
736142660Smarkmidentify that control character: an uparrow followed by the character
736242660Smarkm@var{ch}.@refill
736342660Smarkm@end ignore
736442660Smarkm
736542660Smarkm
7366146515Sru@node abbr
7367146515Sru@subsection @code{@@abbr}@{@var{abbreviation}[, @var{meaning}]@}
7368146515Sru@findex abbr
7369146515Sru
7370146515Sru@cindex Abbreviations, tagging
7371146515SruYou can use the @code{@@abbr} command for general abbreviations.  The
7372146515Sruabbreviation is given as the single argument in braces, as in
7373146515Sru@samp{@@abbr@{Comput.@}}.  As a matter of style, or for particular
7374146515Sruabbreviations, you may prefer to omit periods, as in
7375146515Sru@samp{@@abbr@{Mr@} Stallman}.
7376146515Sru
7377146515Sru@code{@@abbr} accepts an optional second argument, intended to be used
7378146515Srufor the meaning of the abbreviation.
7379146515Sru
7380146515SruIf the abbreviation ends with a lowercase letter and a period, and is
7381146515Srunot at the end of a sentence, and has no second argument, remember to
7382146515Sruuse the @code{@@.} command (@pxref{Not Ending a
7383146515SruSentence}) to get the correct spacing.  However, you do not have to
7384146515Sruuse @code{@@.} within the abbreviation itself; Texinfo automatically
7385146515Sruassumes periods within the abbreivation do not end a sentence.
7386146515Sru
7387146515Sru@cindex <abbr> tag
7388146515SruIn @TeX{} and in the Info output, the first argument is printed as-is;
7389146515Sruif the second argument is present, it is printed in parentheses after
7390146515Sruthe abbreviation.  In HTML and XML, the @code{<abbr>} tag is
7391146515Sruused; in Docbook, the @code{<abbrev>} tag is used.  For instance:
7392146515Sru
7393146515Sru@example
7394146515Sru@@abbr@{Comput. J., Computer Journal@}
7395146515Sru@end example
7396146515Sru
7397146515Sru@noindent produces:
7398146515Sru
7399146515Sru@display
7400146515Sru@abbr{Comput. J., Computer Journal}
7401146515Sru@end display
7402146515Sru
7403146515SruFor abbreviations consisting of all capital letters, you may prefer to
7404146515Sruuse the @code{@@acronym} command instead.  See the next section for
7405146515Srumore on the usage of these two commands.
7406146515Sru
7407146515Sru
740856160Sru@node acronym
7409146515Sru@subsection @code{@@acronym}@{@var{acronym}[, @var{meaning}]@}
741056160Sru@findex acronym
741156160Sru
741256160Sru@cindex NASA, as acronym
741356160Sru@cindex Acronyms, tagging
741456160SruUse the @code{@@acronym} command for abbreviations written in all
741556160Srucapital letters, such as `@acronym{NASA}'.  The abbreviation is given as
741656160Sruthe single argument in braces, as in @samp{@@acronym@{NASA@}}.  As
7417146515Srua matter of style, or for particular acronyms, you may prefer to
7418146515Sruuse periods, as in @samp{@@acronym@{N.A.S.A.@}}.
741956160Sru
7420146515Sru@code{@@acronym} accepts an optional second argument, intended to be
7421146515Sruused for the meaning of the acronym.
742256160Sru
7423146515SruIf the acronym is at the end of a sentence, and if there is no second
7424146515Sruargument, remember to use the @code{@@.} or similar command
7425146515Sru(@pxref{Ending a Sentence}) to get the correct spacing.
742656160Sru
7427146515Sru@cindex <acronym> tag
7428146515SruIn @TeX{}, the acronym is printed in slightly smaller font.  In the
7429146515SruInfo output, the argument is printed as-is.  In either format, if the
7430146515Srusecond argument is present, it is printed in parentheses after the
7431146515Sruacronym.  In HTML, Docbook, and XML, the @code{<acronym>} tag is
7432146515Sruused.  
7433146515Sru
7434146515SruFor instance (since GNU is a recursive acronym, we use
7435146515Sru@code{@@acronym} recursively):
7436146515Sru
7437146515Sru@example
7438146515Sru@@acronym@{GNU, @@acronym@{GNU@}'s Not Unix@}
7439146515Sru@end example
7440146515Sru
7441146515Sru@noindent produces:
7442146515Sru
7443146515Sru@display
7444146515Sru@acronym{GNU, @acronym{GNU}'s Not Unix}
7445146515Sru@end display
7446146515Sru
7447146515SruIn some circumstances, it is conventional to print family names in all
7448146515Srucapitals.  Don't use @code{@@acronym} for this, since a name is not an
7449146515Sruacronym.  Use @code{@@sc} instead (@pxref{Smallcaps}).
7450146515Sru
7451146515Sru@code{@@abbr} and @code{@@acronym} are closely related commands: they
7452146515Sruboth signal to the reader that a shortened form is being used, and
7453146515Srupossibly give a meaning.  When choosing whether to use these two
7454146515Srucommands, please bear the following in mind.
7455146515Sru
7456146515Sru@itemize @minus
7457146515Sru@item
7458146515SruIn standard English usage, acronyms are a subset of abbreviations:
7459146515Sruthey include pronounceable words like `@acronym{NATO}', `radar', and
7460146515Sru`snafu', and some sources also include syllable acronyms like
7461146515Sru`Usenet', hybrids like `@acronym{SIGGRAPH}', and unpronounceable
7462146515Sruinitialisms like `@acronym{FBI}'.
7463146515Sru
7464146515Sru@item
7465146515SruIn Texinfo, an acronym (but not an abbreviation) should consist only
7466146515Sruof capital letters and periods, no lowercase.
7467146515Sru
7468146515Sru@item
7469146515SruIn @TeX{}, an acronym (but not an abbreviation) is printed in a
7470146515Sruslightly smaller font.
7471146515Sru
7472146515Sru@item
7473146515SruSome browsers place a dotted bottom border under abbreviations but not
7474146515Sruacronyms.
7475146515Sru
7476146515Sru@item
7477146515SruIt's not essential to use these commands for all abbreviations.  Text
7478146515Sruis perfectly readable without them, and for common abbreviations like
7479146515Sru`etc.@:', we consider them to be overkill.
7480146515Sru
7481146515Sru@end itemize
7482146515Sru
7483146515Sru
7484146515Sru@node indicateurl
7485146515Sru@subsection @code{@@indicateurl}@{@var{uniform-resource-locator}@}
7486146515Sru@findex indicateurl
748742660Smarkm@cindex Uniform resource locator, indicating
748842660Smarkm@cindex URL, indicating
748942660Smarkm
7490146515SruUse the @code{@@indicateurl} command to indicate a uniform resource
7491146515Srulocator on the World Wide Web.  This is analogous to @code{@@file},
7492146515Sru@code{@@var}, etc., and is purely for markup purposes.  It does not
7493146515Sruproduce a link you can follow in HTML output (use the @code{@@uref}
7494146515Srucommand for that, @pxref{uref,, @code{@@uref}}).  It is useful for
7495146515Sruurl's which do not actually exist.  For example:
749642660Smarkm
749742660Smarkm@example
7498146515SruFor example, the url might be @@indicateurl@{http://example.org/path@}.
749942660Smarkm@end example
750042660Smarkm
750156160Sru@noindent which produces:
750242660Smarkm
750356160Sru@display
7504146515SruFor example, the url might be @indicateurl{http://example.org/path}.
750556160Sru@end display
750656160Sru
750756160Sru
750856160Sru@node email
750942660Smarkm@subsection @code{@@email}@{@var{email-address}[, @var{displayed-text}]@}
751042660Smarkm@findex email
751142660Smarkm
751242660SmarkmUse the @code{@@email} command to indicate an electronic mail address.
751342660SmarkmIt takes one mandatory argument, the address, and one optional argument, the
751442660Smarkmtext to display (the default is the address itself).
751542660Smarkm
7516146515Sru@cindex Mailto link
7517146515SruIn Info, the address is shown in angle brackets, preceded by the text
7518146515Sruto display if any.  In @TeX{}, the angle brackets are omitted.  In
7519146515SruHTML output, @code{@@email} produces a @samp{mailto} link that usually
7520146515Srubrings up a mail composition window.  For example:
752142660Smarkm
752242660Smarkm@example
752393139SruSend bug reports to @@email@{bug-texinfo@@@@gnu.org@},
752493139Srusuggestions to the @@email@{bug-texinfo@@@@gnu.org, same place@}.
752542660Smarkm@end example
752642660Smarkm@noindent produces
752756160Sru@display
752893139SruSend bug reports to @email{bug-texinfo@@gnu.org},
752993139Srusuggestions to the @email{bug-texinfo@@gnu.org, same place}.
753056160Sru@end display
753142660Smarkm
753242660Smarkm
753393139Sru@node Emphasis
753442660Smarkm@comment node-name,  next,  previous,  up
753542660Smarkm@section Emphasizing Text
753642660Smarkm@cindex Emphasizing text
753742660Smarkm
753842660SmarkmUsually, Texinfo changes the font to mark words in the text according to
753942660Smarkmwhat category the words belong to; an example is the @code{@@code} command.
754042660SmarkmMost often, this is the best way to mark words.
754142660SmarkmHowever, sometimes you will want to emphasize text without indicating a
754242660Smarkmcategory.  Texinfo has two commands to do this.  Also, Texinfo has
754342660Smarkmseveral commands that specify the font in which @TeX{} will typeset
754456160Srutext.  These commands have no effect on Info and only one of them,
754542660Smarkmthe @code{@@r} command, has any regular use.@refill
754642660Smarkm
754742660Smarkm@menu
754842660Smarkm* emph & strong::               How to emphasize text in Texinfo.
754942660Smarkm* Smallcaps::                   How to use the small caps font.
755042660Smarkm* Fonts::                       Various font commands for printed output.
755142660Smarkm@end menu
755242660Smarkm
755356160Sru@node emph & strong
755442660Smarkm@subsection @code{@@emph}@{@var{text}@} and @code{@@strong}@{@var{text}@}
755542660Smarkm@cindex Emphasizing text, font for
755642660Smarkm@findex emph
755742660Smarkm@findex strong
755842660Smarkm
755942660SmarkmThe @code{@@emph} and @code{@@strong} commands are for emphasis;
756056160Sru@code{@@strong} is stronger.  In printed output, @code{@@emph} produces
756156160Sru@emph{italics} and @code{@@strong} produces @strong{bold}.
756242660Smarkm
756342660SmarkmFor example,
756442660Smarkm
756542660Smarkm@example
756642660Smarkm@group
7567146515Sru@@strong@{Caution:@} @@samp@{rm * .[^.]*@}
7568146515Sruremoves @@emph@{all@} files in the directory.
756942660Smarkm@end group
757042660Smarkm@end example
757142660Smarkm
757242660Smarkm@noindent
7573146515Sruproduces the following in printed output and HTML:
757442660Smarkm
757542660Smarkm@quotation
7576146515Sru@strong{Caution}: @samp{rm * .[^.]*}
7577146515Sruremoves @emph{all} files in the directory.
757842660Smarkm@end quotation
757942660Smarkm
758042660Smarkm@noindent
758142660Smarkmand the following in Info:
758242660Smarkm
758342660Smarkm@example
7584146515Sru*Caution:* `rm * .[^.]*' removes _all_
7585146515Srufiles in the directory.
758642660Smarkm@end example
758742660Smarkm
758842660SmarkmThe @code{@@strong} command is seldom used except to mark what is, in
758942660Smarkmeffect, a typographical element, such as the word `Caution' in the
759042660Smarkmpreceding example.
759142660Smarkm
759256160SruIn the Info output, @code{@@emph} surrounds the text with underscores
759356160Sru(@samp{_}), and @code{@@strong} puts asterisks around the text.
759442660Smarkm
7595146515Sru@quotation Caution
7596146515SruDo not use @code{@@strong} with the word @samp{Note}; Info will
7597146515Srumistake the combination for a cross reference.  (It's usually
7598146515Sruredundant, anyway.)  Use a phrase such as @strong{Please notice} or
7599146515Sru@strong{Caution} instead, or the optional argument to
7600146515Sru@code{@@quotation}---@samp{Note} is allowable there.
760142660Smarkm@end quotation
760242660Smarkm
760356160Sru
760456160Sru@node Smallcaps
760542660Smarkm@subsection @code{@@sc}@{@var{text}@}: The Small Caps Font
760642660Smarkm@cindex Small caps font
760742660Smarkm@findex sc @r{(small caps font)}
760842660Smarkm
7609146515SruUse the @samp{@@sc} command to set text in @sc{a small caps font}
7610146515Sru(where possible).  Write the text you want to be in small caps between
7611146515Srubraces in lower case, like this:
761242660Smarkm
761342660Smarkm@example
7614146515SruRichard @@sc@{Stallman@} founded @@acronym@{GNU@}.
761542660Smarkm@end example
761642660Smarkm
761742660Smarkm@noindent
761842660SmarkmThis produces:
761942660Smarkm
762042660Smarkm@display
7621146515SruRichard @sc{Stallman} founded @acronym{GNU}.
762242660Smarkm@end display
762342660Smarkm
7624146515SruAs shown here, we recommend using @code{@@acronym} for actual
7625146515Sruacronyms (@pxref{acronym}), and reserving @code{@@sc} for special
7626146515Srucases where you want small caps.  The output is not the same
7627146515Sru(@code{@@acronym} prints in a smaller text font, not the small caps
7628146515Srufont), but more importantly it describes the actual text more
7629146515Sruaccurately.
763042660Smarkm
7631146515SruFamily names are one case where small capitals are sometimes desirable,
7632146515Srualso as shown here.
763342660Smarkm
7634146515Sru@cindex <small> tag
7635146515Sru@TeX{} typesets any uppercase letters between the braces of an
7636146515Sru@code{@@sc} command in full-size capitals; only lowercase letters are
7637146515Sruprinted in the small caps font.  In the Info output, the argument to
7638146515Sru@code{@@sc} is printed in all upper case.  In HTML, the argument is
7639146515Sruuppercased and the output marked with the @code{<small>} tag to reduce
7640146515Sruthe font size.
764142660Smarkm
7642146515SruSince it's redundant to mark all-uppercase text with @code{@@sc},
7643146515Sru@command{makeinfo} warns about such usage.
764442660Smarkm
7645146515SruWe recommend using regular mixed case wherever possible.
764656160Sru
7647146515Sru
764856160Sru@node Fonts
764942660Smarkm@subsection Fonts for Printing, Not Info
7650146515Sru@cindex Fonts for printing, not Info
7651146515Sru
7652146515SruTexinfo provides a number of font commands that specify font changes
7653146515Sruin the printed manual and (where possible) in the HTML output, but
7654146515Sruhave no effect in the Info file.  All the commands apply to an
7655146515Sruargument that follows, surrounded by braces.
7656146515Sru
7657146515Sru@table @code
7658146515Sru@item @@b
7659146515Sru@findex b @r{(bold font)}
7660146515Sru@cindex Bold font
7661146515Sruselects @b{bold} face;
7662146515Sru
7663146515Sru@item @@i
766442660Smarkm@findex i @r{(italic font)}
7665146515Sru@cindex Italic font
7666146515Sruselects an @i{italic} font;
7667146515Sru
7668146515Sru@item @@r
7669146515Sru@findex r @r{(roman font)}
7670146515Sru@cindex Roman font
7671146515Sru@cindex Default font
7672146515Sruselects a @r{roman} font, which is the usual font in which text is
7673146515Sruprinted.  It may or may not be seriffed.
7674146515Sru
7675146515Sru@item @@sansserif
7676146515Sru@findex sansserif @r{(sans serif font)}
7677146515Sru@cindex Sans serif font
7678146515Sruselects a @sansserif{sans serif} font;
7679146515Sru
7680146515Sru@item @@slanted
7681146515Sru@findex slanted @r{(slanted font)}
7682146515Sru@cindex Slanted font
7683146515Sru@cindex Oblique font
7684146515Srurselects a @slanted{slanted} font;
7685146515Sru
7686146515Sru@item @@t
768742660Smarkm@findex t @r{(typewriter font)}
7688146515Sru@cindex Monospace font
7689146515Sru@cindex Fixed-width font
7690146515Sru@cindex Typewriter font
7691146515Sruselects the @t{fixed-width}, typewriter-style font used by @code{@@code};
769242660Smarkm
7693146515Sru@end table
769442660Smarkm
7695146515Sru(The commands with longer names were invented much later than the
7696146515Sruothers, when it did not seem desirable to use very short names for
7697146515Srusuch an infrequently needed feature.)
769842660Smarkm
7699146515Sru@cindex <lineannotation> Docbook tag
7700146515SruOnly the @code{@@r} command has much use: in example-like
7701146515Sruenvironments, you can use the @code{@@r} command to write comments in
7702146515Sruthe standard roman font instead of the fixed-width font.  This looks
7703146515Srubetter in printed output, and produces a @code{<lineannotation>} tag
7704146515Sruin Docbook output.
7705146515Sru
770642660SmarkmFor example,
770742660Smarkm
770842660Smarkm@example
770942660Smarkm@group
771042660Smarkm@@lisp
771142660Smarkm(+ 2 2)    ; @@r@{Add two plus two.@}
771242660Smarkm@@end lisp
771342660Smarkm@end group
771442660Smarkm@end example
771542660Smarkm
771642660Smarkm@noindent
771742660Smarkmproduces
771842660Smarkm
771942660Smarkm@lisp
772042660Smarkm(+ 2 2)    ; @r{Add two plus two.}
772142660Smarkm@end lisp
772242660Smarkm
7723146515SruIn general, you should avoid using the other font commands.  Some of
7724146515Sruthem are only useful when documenting functionality with specific font
7725146515Srueffects, such as in \TeX\ and related packages.
772642660Smarkm
772793139Sru
772856160Sru@node Quotations and Examples
772942660Smarkm@chapter Quotations and Examples
773042660Smarkm
773142660SmarkmQuotations and examples are blocks of text consisting of one or more
773242660Smarkmwhole paragraphs that are set off from the bulk of the text and
7733146515Srutreated differently.  They are usually indented in the output.
773442660Smarkm
7735146515Sru@findex end
773642660SmarkmIn Texinfo, you always begin a quotation or example by writing an
773742660Smarkm@@-command at the beginning of a line by itself, and end it by writing
773842660Smarkman @code{@@end} command that is also at the beginning of a line by
773942660Smarkmitself.  For instance, you begin an example by writing @code{@@example}
774042660Smarkmby itself at the beginning of a line and end the example by writing
774142660Smarkm@code{@@end example} on a line by itself, at the beginning of that
7742146515Sruline, and with only one space between the @code{@@end} and the
7743146515Sru@code{example}.
774442660Smarkm
774542660Smarkm@menu
774693139Sru* Block Enclosing Commands::    Different constructs for different purposes.
774793139Sru* quotation::                   Writing a quotation.
774893139Sru* example::                     Writing an example in a fixed-width font.
774993139Sru* verbatim::                    Writing a verbatim example.
7750100513Sru* verbatiminclude::             Including a file verbatim.
775193139Sru* lisp::                        Illustrating Lisp code.
7752114472Sru* small::                       Examples in a smaller font.
775393139Sru* display::                     Writing an example in the current font.
775493139Sru* format::                      Writing an example without narrowed margins.
775593139Sru* exdent::                      Undo indentation on a line.
775693139Sru* flushleft & flushright::      Pushing text flush left or flush right.
775793139Sru* noindent::                    Preventing paragraph indentation.
7758116525Sru* indent::                      Forcing paragraph indentation.
775993139Sru* cartouche::                   Drawing rounded rectangles around examples.
776042660Smarkm@end menu
776142660Smarkm
776293139Sru
776356160Sru@node Block Enclosing Commands
776456160Sru@section Block Enclosing Commands
776542660Smarkm
776656160SruHere are commands for quotations and examples, explained further in the
776756160Srufollowing sections:
776842660Smarkm
776942660Smarkm@table @code
777042660Smarkm@item @@quotation
7771146515SruIndicate text that is quoted. The text is filled, indented (from both
7772146515Srumargins), and printed in a roman font by default.
777342660Smarkm
777442660Smarkm@item @@example
777542660SmarkmIllustrate code, commands, and the like. The text is printed
777693139Sruin a fixed-width font, and indented but not filled.
777742660Smarkm
777893139Sru@item @@verbatim
7779116525SruMark a piece of text that is to be printed verbatim; no character
778093139Srusubstitutions are made and all commands are ignored, until the next
7781116525Sru@code{@@end verbatim}.  The text is printed in a fixed-width font,
7782116525Sruand not indented or filled.  Extra spaces and blank lines are
778393139Srusignificant, and tabs are expanded.
778493139Sru
778556160Sru@item @@smallexample
778656160SruSame as @code{@@example}, except that in @TeX{} this command typesets
778793139Srutext in a smaller font.
778856160Sru
778942660Smarkm@item @@lisp
779056160SruLike @code{@@example}, but specifically for illustrating Lisp code. The
779156160Srutext is printed in a fixed-width font, and indented but not filled.
779242660Smarkm
779342660Smarkm@item @@smalllisp
779456160SruIs to @code{@@lisp} as @code{@@smallexample} is to @code{@@example}.
779542660Smarkm
779642660Smarkm@item @@display
779742660SmarkmDisplay illustrative text.  The text is indented but not filled, and
779856160Sruno font is selected (so, by default, the font is roman).@refill
779942660Smarkm
780056160Sru@item @@smalldisplay
780156160SruIs to @code{@@display} as @code{@@smallexample} is to @code{@@example}.
780256160Sru
780342660Smarkm@item @@format
780456160SruLike @code{@@display} (the text is not filled and no font is selected),
780556160Srubut the text is not indented.
780656160Sru
780756160Sru@item @@smallformat
780856160SruIs to @code{@@format} as @code{@@smallexample} is to @code{@@example}.
780942660Smarkm@end table
781042660Smarkm
781142660SmarkmThe @code{@@exdent} command is used within the above constructs to
781242660Smarkmundo the indentation of a line.
781342660Smarkm
781442660SmarkmThe @code{@@flushleft} and @code{@@flushright} commands are used to line
781542660Smarkmup the left or right margins of unfilled text.@refill
781642660Smarkm
781742660SmarkmThe @code{@@noindent} command may be used after one of the above
781842660Smarkmconstructs to prevent the following text from being indented as a new
781993139Sruparagraph.
782042660Smarkm
7821146515SruYou can use the @code{@@cartouche} environment around one of the above
782242660Smarkmconstructs to highlight the example or quotation by drawing a box with
782356160Srurounded corners around it.  @xref{cartouche, , Drawing Cartouches Around
782456160SruExamples}.
782542660Smarkm
782656160Sru
782756160Sru@node quotation
7828146515Sru@section @code{@@quotation}: Block quotations
782942660Smarkm@cindex Quotations
783042660Smarkm@findex quotation
783142660Smarkm
7832146515SruThe text of a quotation is processed normally (regular font, text is
7833146515Srufilled) except that:
783442660Smarkm
783542660Smarkm@itemize @bullet
783642660Smarkm@item
783742660Smarkmthe margins are closer to the center of the page, so the whole of the
7838146515Sruquotation is indented;
783942660Smarkm
784042660Smarkm@item
7841146515Sruand the first lines of paragraphs are indented no more than other lines.
784242660Smarkm
784342660Smarkm@end itemize
784442660Smarkm
784542660Smarkm@quotation
784642660SmarkmThis is an example of text written between an @code{@@quotation}
784742660Smarkmcommand and an @code{@@end quotation} command.  An @code{@@quotation}
784842660Smarkmcommand is most often used to indicate text that is excerpted from
7849146515Sruanother (real or hypothetical) printed work.
785042660Smarkm@end quotation
785142660Smarkm
785242660SmarkmWrite an @code{@@quotation} command as text on a line by itself.  This
785342660Smarkmline will disappear from the output.  Mark the end of the quotation
785442660Smarkmwith a line beginning with and containing only @code{@@end quotation}.
785542660SmarkmThe @code{@@end quotation} line will likewise disappear from the
7856146515Sruoutput.
785742660Smarkm
7858146515Sru@code{@@quotation} takes one optional argument, given on the remainder
7859146515Sruof the line.  This text, if present, is included at the beginning of
7860146515Sruthe quotation in bold or otherwise emphasized, and followed with a
7861146515Sru@samp{:}.  For example:
7862146515Sru
786342660Smarkm@example
7864146515Sru@@quotation Note
786542660SmarkmThis is
786642660Smarkma foo.
786742660Smarkm@@end quotation
786842660Smarkm@end example
786942660Smarkm
787042660Smarkm@noindent
787142660Smarkmproduces
787242660Smarkm
7873146515Sru@quotation Note
7874146515SruThis is
7875146515Srua foo.
787642660Smarkm@end quotation
787742660Smarkm
7878146515SruIf the @code{@@quotation} argument is exactly one of these words:
787956160Sru
7880146515Sru@example
7881146515SruCaution  Important  Note  Tip  Warning
7882146515Sru@end example
7883146515Sru
7884146515Sru@cindex <note> Docbook tag
7885146515Sru@cindex <blockquote> HTML tag
7886146515Sru@noindent then the Docbook output uses corresponding special tags
7887146515Sru(@code{<note>}, etc.) instead of the default @code{<blockquote>}.
7888146515SruHTML output always uses @code{<blockquote>}.
7889146515Sru
7890146515Sru
789156160Sru@node example
789293139Sru@section @code{@@example}: Example Text
789342660Smarkm@cindex Examples, formatting them
789442660Smarkm@cindex Formatting examples
789542660Smarkm@findex example
789642660Smarkm
7897114472SruThe @code{@@example} environment is used to indicate an example that
7898114472Sruis not part of the running text, such as computer input or output.
7899114472SruWrite an @code{@@example} command at the beginning of a line by
7900114472Sruitself.  Mark the end of the example with an @code{@@end example}
7901114472Srucommand, also written at the beginning of a line by itself.
790242660Smarkm
7903114472SruAn @code{@@example} environment has the following characteristics:
790442660Smarkm
7905114472Sru@itemize
7906114472Sru@item Each line in the input file is a line in the output; that is,
7907114472Sruthe source text is not filled as it normally is.
7908114472Sru@item Extra spaces and blank lines are significant.
7909114472Sru@item The output is indented.
7910146515Sru@item The output uses a fixed-width font.
7911146515Sru@item Texinfo commands @emph{are} expanded; if you want the output to
7912146515Srube the input verbatim, use the @code{@@verbatim} environment instead
7913114472Sru(@pxref{verbatim,,@code{@@verbatim}}).
7914114472Sru@end itemize
791542660Smarkm
791642660SmarkmFor example,
791742660Smarkm
791842660Smarkm@example
791942660Smarkm@@example
7920114472Srucp foo @@var@{dest1@}; \
7921114472Sru cp foo @@var@{dest2@}
792242660Smarkm@@end example
792342660Smarkm@end example
792442660Smarkm
792542660Smarkm@noindent
792642660Smarkmproduces
792742660Smarkm
792842660Smarkm@example
7929114472Srucp foo @var{dest1}; \
7930114472Sru cp foo @var{dest2}
793142660Smarkm@end example
793242660Smarkm
7933114472SruThe lines containing @code{@@example} and @code{@@end example} will
7934114472Srudisappear from the output.  To make the output look good, you should
7935114472Sruput a blank line before the @code{@@example} and another blank line
7936114472Sruafter the @code{@@end example}.  Blank lines inside the beginning
7937114472Sru@code{@@example} and the ending @code{@@end example}, on the other
7938114472Sruhand, do appear in the output.
793942660Smarkm
7940146515Sru@quotation Caution
7941146515SruDo not use tabs in the lines of an example!  (Or anywhere else in
7942146515SruTexinfo, except in verbatim environments.)  @TeX{} treats tabs as
7943146515Srusingle spaces, and that is not what they look like.  In Emacs, you can
7944146515Sruuse @kbd{M-x untabify} to convert tabs in a region to multiple spaces.
794542660Smarkm@end quotation
794642660Smarkm
794742660SmarkmExamples are often, logically speaking, ``in the middle'' of a
7948114472Sruparagraph, and the text that continues afterwards should not be
7949114472Sruindented, as in the example above.  The @code{@@noindent} command
7950114472Sruprevents a piece of text from being indented as if it were a new
7951114472Sruparagraph (@pxref{noindent,,@code{@@noindent}}.
795242660Smarkm
7953114472SruIf you want to embed code fragments within sentences, instead of
7954114472Srudisplaying them, use the @code{@@code} command or its relatives
7955114472Sru(@pxref{code,,@code{@@code}}).
795642660Smarkm
7957146515SruIf you wish to write a ``comment'' on a line of an example in the
7958146515Srunormal roman font, you can use the @code{@@r} command (@pxref{Fonts}).
795956160Sru
7960146515Sru
796193139Sru@node verbatim
796293139Sru@section @code{@@verbatim}: Literal Text
796393139Sru@findex verbatim
796493139Sru@cindex Verbatim environment
796542660Smarkm
796693139SruUse the @code{@@verbatim} environment for printing of text that may
796793139Srucontain special characters or commands that should not be interpreted,
796893139Srusuch as computer input or output (@code{@@example} interprets its text
796993139Sruas regular Texinfo commands).  This is especially useful for including
797093139Sruautomatically generated output in a Texinfo manual.  Here is an example;
797193139Sruthe output you see is just the same as the input, with a line
797293139Sru@code{@@verbatim} before and a line @code{@@end verbatim} after.
797342660Smarkm
797493139Sru@verbatim
797593139SruThis is an example of text written in a @verbatim
7976100513Srublock.  No character substitutions are made.  All commands
7977100513Sruare ignored, until `<at>end verbatim'.
797893139Sru
797993139SruIn the printed manual, the text is typeset in a
798093139Srufixed-width font, and not indented or filled.  All
798193139Sruspaces and blank lines are significant, including tabs.
798293139Sru@end verbatim
798393139Sru
798493139SruWrite a @code{@@verbatim} command at the beginning of a line by itself.
798593139SruThis line will disappear from the output.  Mark the end of the verbatim
798693139Srublock with a @code{@@end verbatim} command, also written at the
798793139Srubeginning of a line by itself.  The @code{@@end verbatim} will also
798893139Srudisappear from the output.
798993139Sru
799042660SmarkmFor example:
7991100513Sru@c oops, got to trick this a bit: can't use @end verbatim inside @verbatim
799242660Smarkm
799342660Smarkm@example
7994146515Sru@exdent @t{@@verbatim}
7995146515Sru@exdent @t{@{}
7996146515Sru@exdent @key{TAB}@t{@@command with strange characters: @@'e}
7997146515Sru@exdent @t{expand@key{TAB}me}
7998146515Sru@exdent @t{@}}
7999146515Sru@exdent @t{@@end verbatim}
800042660Smarkm@end example
800142660Smarkm
800242660Smarkm@noindent
800342660Smarkmproduces
800442660Smarkm
800593139Sru@verbatim
800693139Sru{
8007146515Sru        @command with strange characters: @'e
800893139Sruexpand	me
800993139Sru}
801093139Sru@end verbatim
801142660Smarkm
801293139SruSince the lines containing @code{@@verbatim} and @code{@@end verbatim}
8013146515Sruproduce no output, typically you should put a blank line before the
801493139Sru@code{@@verbatim} and another blank line after the @code{@@end
8015146515Sruverbatim}.  Blank lines between the beginning @code{@@verbatim} and
8016146515Sruthe ending @code{@@end verbatim} will appear in the output.
801742660Smarkm
8018146515SruIt is not reliable to use @code{@@verbatim} inside other Texinfo constructs.
801942660Smarkm
8020146515Sru
802193139Sru@node verbatiminclude
802293139Sru@section @code{@@verbatiminclude} @var{file}: Include a File Verbatim
802393139Sru@cindex Verbatim, include file
802493139Sru@cindex Including a file verbatim
802593139Sru@findex verbatiminclude
802642660Smarkm
802793139SruYou can include the exact contents of a file in the document with the
802893139Sru@code{@@verbatiminclude} command:
802942660Smarkm
803093139Sru@example
803193139Sru@@verbatiminclude @var{filename}
803293139Sru@end example
803356160Sru
803493139SruThe contents of @var{filename} is printed in a verbatim environment
803593139Sru(@pxref{verbatim,,@code{@@verbatim}}).  Generally, the file is printed
8036146515Sruexactly as it is, with all special characters and white space
8037146515Sruretained.  No indentation is added; if you want indentation, enclose
8038146515Sruthe @code{@@verbatiminclude} within @code{@@example}
8039146515Sru(@pxref{example,,@code{@@example}}).
804093139Sru
8041114472SruThe name of the file is taken literally, with a single exception:
8042114472Sru@code{@@value@{@var{var}@}} references are expanded.  This makes it
8043114472Srupossible to reliably include files in other directories in a
8044114472Srudistribution, for instance:
804593139Sru
8046114472Sru@example
8047114472Sru@@include @@value@{top_srcdir@}/NEWS
8048114472Sru@end example
8049114472Sru
8050114472Sru@noindent (You still have to get @code{top_srcdir} defined in the
8051114472Srufirst place.)
8052114472Sru
8053114472Sru
805456160Sru@node lisp
805593139Sru@section @code{@@lisp}: Marking a Lisp Example
805656160Sru@findex lisp
805742660Smarkm@cindex Lisp example
805842660Smarkm
805942660SmarkmThe @code{@@lisp} command is used for Lisp code.  It is synonymous
806042660Smarkmwith the @code{@@example} command.
806142660Smarkm
806242660Smarkm@lisp
806342660SmarkmThis is an example of text written between an
806442660Smarkm@code{@@lisp} command and an @code{@@end lisp} command.
806542660Smarkm@end lisp
806642660Smarkm
806742660SmarkmUse @code{@@lisp} instead of @code{@@example} to preserve information
806842660Smarkmregarding the nature of the example.  This is useful, for example, if
806942660Smarkmyou write a function that evaluates only and all the Lisp code in a
807042660SmarkmTexinfo file.  Then you can use the Texinfo file as a Lisp
807142660Smarkmlibrary.@footnote{It would be straightforward to extend Texinfo to work
807256160Sruin a similar fashion for C, Fortran, or other languages.}
807342660Smarkm
807442660SmarkmMark the end of @code{@@lisp} with @code{@@end lisp} on a line by
8075114472Sruitself.
807642660Smarkm
807756160Sru
807856160Sru@node small
807956160Sru@section @code{@@small@dots{}} Block Commands
808093139Sru@cindex Small examples
808193139Sru@cindex Examples in smaller fonts
808293139Sru@cindex Lisp examples in smaller fonts
808356160Sru@findex smalldisplay
808442660Smarkm@findex smallexample
808556160Sru@findex smallformat
808642660Smarkm@findex smalllisp
808742660Smarkm
808842660SmarkmIn addition to the regular @code{@@example} and @code{@@lisp} commands,
808956160SruTexinfo has ``small'' example-style commands.  These are
809056160Sru@code{@@smalldisplay}, @code{@@smallexample}, @code{@@smallformat}, and
809193139Sru@code{@@smalllisp}.
809242660Smarkm
809393139SruIn Info, the @code{@@small@dots{}} commands are equivalent to their
809456160Srunon-small companion commands.
809542660Smarkm
8096114472SruIn @TeX{}, however, the @code{@@small@dots{}} commands typeset text in
8097114472Srua smaller font than the non-small example commands.  Consequently,
8098114472Srumany examples containing long lines fit on a page without needing to
8099114472Srube shortened.
8100114472Sru
810156160SruMark the end of an @code{@@small@dots{}} block with a corresponding
810256160Sru@code{@@end small@dots{}}.  For example, pair @code{@@smallexample} with
810356160Sru@code{@@end smallexample}.
810442660Smarkm
8105114472SruHere is an example of the font used by the @code{@@small@dots{}}
8106114472Srucommands (in Info, the output will be the same as usual):
810742660Smarkm
8108114472Sru@smallexample
8109114472Sru@dots{} to make sure that you have the freedom to
811042660Smarkmdistribute copies of free software (and charge for
811142660Smarkmthis service if you wish), that you receive source
811242660Smarkmcode or can get it if you want it, that you can
811342660Smarkmchange the software or use pieces of it in new free
8114114472Sruprograms; and that you know you can do these things.
811542660Smarkm@end smallexample
811642660Smarkm
811793139SruThe @code{@@small@dots{}} commands make it easier to prepare manuals
811893139Sruwithout forcing you to edit examples by hand to fit them onto narrower
811993139Srupages.
812042660Smarkm
8121114472SruAs a general rule, a printed document looks much better if you use
8122114472Sruonly one of (for instance) @code{@@example} or @code{@@smallexample}
8123116525Sruconsistently within a chapter.
812442660Smarkm
812542660Smarkm
812656160Sru@node display
812756160Sru@section @code{@@display} and @code{@@smalldisplay}
812842660Smarkm@cindex Display formatting
812942660Smarkm@findex display
813042660Smarkm
8131146515SruThe @code{@@display} command begins a kind of example, where each line
8132146515Sruof input produces a line of output, and the output is indented.  It is
8133146515Sruthus like the @code{@@example} command except that, in a printed
8134146515Srumanual, @code{@@display} does not select the fixed-width font.  In
8135146515Srufact, it does not specify the font at all, so that the text appears in
8136146515Sruthe same font it would have appeared in without the @code{@@display}
8137146515Srucommand.
813842660Smarkm
813942660Smarkm@display
814042660SmarkmThis is an example of text written between an @code{@@display} command
814142660Smarkmand an @code{@@end display} command.  The @code{@@display} command
814242660Smarkmindents the text, but does not fill it.
814342660Smarkm@end display
814442660Smarkm
814556160Sru@findex smalldisplay
814656160SruTexinfo also provides a command @code{@@smalldisplay}, which is like
814756160Sru@code{@@display} but uses a smaller font in @code{@@smallbook} format.
814856160Sru@xref{small}.
814956160Sru
8150146515SruThe @code{@@table} command (@pxref{table}) does not work inside
8151146515Sru@code{@@display}.  Since @code{@@display} is line-oriented, it doesn't
8152146515Srumake sense to use them together.  If you want to indent a table, try
8153146515Sru@code{@@quotation} (@pxref{quotation}).
815456160Sru
8155146515Sru
815656160Sru@node format
815756160Sru@section @code{@@format} and @code{@@smallformat}
815842660Smarkm@findex format
815942660Smarkm
816042660SmarkmThe @code{@@format} command is similar to @code{@@example} except
816142660Smarkmthat, in the printed manual, @code{@@format} does not select the
816242660Smarkmfixed-width font and does not narrow the margins.@refill
816342660Smarkm
816442660Smarkm@format
816542660SmarkmThis is an example of text written between an @code{@@format} command
816642660Smarkmand an @code{@@end format} command.  As you can see
816742660Smarkmfrom this example,
816842660Smarkmthe @code{@@format} command does not fill the text.
816942660Smarkm@end format
817042660Smarkm
817156160Sru@findex smallformat
817256160SruTexinfo also provides a command @code{@@smallformat}, which is like
817356160Sru@code{@@format} but uses a smaller font in @code{@@smallbook} format.
817456160Sru@xref{small}.
817556160Sru
817656160Sru
817756160Sru
817856160Sru@node exdent
817942660Smarkm@section @code{@@exdent}: Undoing a Line's Indentation
818042660Smarkm@cindex Indentation undoing
818142660Smarkm@findex exdent
818242660Smarkm
818342660SmarkmThe @code{@@exdent} command removes any indentation a line might have.
818442660SmarkmThe command is written at the beginning of a line and applies only to
818542660Smarkmthe text that follows the command that is on the same line.  Do not use
818642660Smarkmbraces around the text.  In a printed manual, the text on an
818742660Smarkm@code{@@exdent} line is printed in the roman font.@refill
818842660Smarkm
818942660Smarkm@code{@@exdent} is usually used within examples.  Thus,@refill
819042660Smarkm
819142660Smarkm@example
819242660Smarkm@group
819342660Smarkm@@example
819442660SmarkmThis line follows an @@@@example command.
819542660Smarkm@@exdent This line is exdented.
819642660SmarkmThis line follows the exdented line.
819742660SmarkmThe @@@@end example comes on the next line.
819842660Smarkm@@end group
819942660Smarkm@end group
820042660Smarkm@end example
820142660Smarkm
820242660Smarkm@noindent
820342660Smarkmproduces
820442660Smarkm
820542660Smarkm@example
820642660Smarkm@group
820742660SmarkmThis line follows an @@example command.
820842660Smarkm@exdent This line is exdented.
820942660SmarkmThis line follows the exdented line.
821042660SmarkmThe @@end example comes on the next line.
821142660Smarkm@end group
821242660Smarkm@end example
821342660Smarkm
821442660SmarkmIn practice, the @code{@@exdent} command is rarely used.
821542660SmarkmUsually, you un-indent text by ending the example and
821642660Smarkmreturning the page to its normal width.@refill
821742660Smarkm
821893139Sru
821993139Sru@node flushleft & flushright
822042660Smarkm@section @code{@@flushleft} and @code{@@flushright}
822142660Smarkm@findex flushleft
822242660Smarkm@findex flushright
8223146515Sru@cindex Ragged right
8224146515Sru@cindex Ragged left
822542660Smarkm
822642660SmarkmThe @code{@@flushleft} and @code{@@flushright} commands line up the
822742660Smarkmends of lines on the left and right margins of a page,
822842660Smarkmbut do not fill the text.  The commands are written on lines of their
822942660Smarkmown, without braces.  The @code{@@flushleft} and @code{@@flushright}
823042660Smarkmcommands are ended by @code{@@end flushleft} and @code{@@end
823142660Smarkmflushright} commands on lines of their own.@refill
823242660Smarkm
823342660Smarkm@need 1500
823442660SmarkmFor example,
823542660Smarkm
823642660Smarkm@example
823742660Smarkm@group
823842660Smarkm@@flushleft
823942660SmarkmThis text is
824042660Smarkmwritten flushleft.
824142660Smarkm@@end flushleft
824242660Smarkm@end group
824342660Smarkm@end example
824442660Smarkm
824542660Smarkm@noindent
824642660Smarkmproduces
824742660Smarkm
824842660Smarkm@quotation
824942660Smarkm@flushleft
825042660SmarkmThis text is
825142660Smarkmwritten flushleft.
825242660Smarkm@end flushleft
825342660Smarkm@end quotation
825442660Smarkm
825542660Smarkm
825642660Smarkm@code{@@flushright} produces the type of indentation often used in the
825742660Smarkmreturn address of letters.  For example,
825842660Smarkm
825942660Smarkm@example
826042660Smarkm@group
826142660Smarkm@@flushright
826242660SmarkmHere is an example of text written
826342660Smarkmflushright.  The @@code@{@@flushright@} command
826442660Smarkmright justifies every line but leaves the
826542660Smarkmleft end ragged.
826642660Smarkm@@end flushright
826742660Smarkm@end group
826842660Smarkm@end example
826942660Smarkm
827042660Smarkm@noindent
827142660Smarkmproduces
827242660Smarkm
827342660Smarkm@flushright
827442660SmarkmHere is an example of text written
827542660Smarkmflushright.  The @code{@@flushright} command
827642660Smarkmright justifies every line but leaves the
827742660Smarkmleft end ragged.
827842660Smarkm@end flushright
827942660Smarkm
828093139Sru
828193139Sru@node noindent
828293139Sru@section @code{@@noindent}: Omitting Indentation
8283116525Sru@cindex Omitting indentation
8284116525Sru@cindex Suppressing indentation
8285116525Sru@cindex Indentation, omitting
828693139Sru@findex noindent
828793139Sru
828893139SruAn example or other inclusion can break a paragraph into segments.
828993139SruOrdinarily, the formatters indent text that follows an example as a new
8290114472Sruparagraph.  You can prevent this on a case-by-case basis by writing
8291114472Sru@code{@@noindent} at the beginning of a line, preceding the continuation
8292114472Srutext.  You can also disable indentation for all paragraphs globally with
8293114472Sru@code{@@paragraphindent} (@pxref{paragraphindent, Paragraph Indenting}).
829493139Sru
8295114472SruIt is best to write @code{@@noindent} on a line by itself, since in most
8296114472Sruenvironments, spaces following the command will not be ignored.  It's ok
8297114472Sruto use it at the beginning of a line, with text following, outside of
8298114472Sruany environment.
8299114472Sru
830093139Sru@need 1500
830193139SruFor example:
830293139Sru
830393139Sru@example
830493139Sru@group
830593139Sru@@example
830693139SruThis is an example
830793139Sru@@end example
830893139Sru
830993139Sru@@noindent
831093139SruThis line is not indented.  As you can see, the
831193139Srubeginning of the line is fully flush left with the line
831293139Sruthat follows after it.  (This whole example is between
831393139Sru@@code@{@@@@display@} and @@code@{@@@@end display@}.)
831493139Sru@end group
831593139Sru@end example
831693139Sru
8317114472Sru@noindent produces:
831893139Sru
831993139Sru@display
8320114472Sru
832193139Sru@example
832293139SruThis is an example
832393139Sru@end example
832493139Sru
832593139Sru@noindent
832693139SruThis line is not indented.  As you can see, the
832793139Srubeginning of the line is fully flush left with the line
832893139Sruthat follows after it.  (This whole example is between
832993139Sru@code{@@display} and @code{@@end display}.)
8330114472Sru
833193139Sru@end display
833293139Sru
833393139SruTo adjust the number of blank lines properly in the Info file output,
833493139Sruremember that the line containing @code{@@noindent} does not generate a
8335114472Srublank line, and neither does the @code{@@end example} line.
833693139Sru
833793139SruIn the Texinfo source file for this manual, each line that says
8338114472Sru`produces' is preceded by @code{@@noindent}.
833993139Sru
834093139SruDo not put braces after an @code{@@noindent} command; they are not
834193139Srunecessary, since @code{@@noindent} is a command used outside of
8342114472Sruparagraphs (@pxref{Command Syntax}).
834393139Sru
834493139Sru
8345116525Sru@node indent
8346116525Sru@section @code{@@indent}: Forcing Indentation
8347116525Sru@cindex Forcing indentation
8348116525Sru@cindex Inserting indentation
8349116525Sru@cindex Indentation, forcing
8350116525Sru@findex indent
8351116525Sru
8352116525Sru@indent
8353116525SruTo complement the @code{@@noindent} command (see the previous
8354116525Srusection), Texinfo provides the @code{@@indent} command that forces a
8355116525Sruparagraph to be indented.  This paragraph, for instance, is indented
8356116525Sruusing an @code{@@indent} command.  The first paragraph of a section is
8357116525Sruthe most likely place to use @code{@@indent}, to override the normal
8358116525Srubehavior of no indentation there (@pxref{paragraphindent}).
8359116525Sru
8360116525SruIt is best to write @code{@@indent} on a line by itself, since in most
8361116525Sruenvironments, spaces following the command will not be ignored.  The
8362116525Sru@code{@@indent} line will not generate a blank line in the Info output
8363116525Sruwithin an environment.
8364116525Sru
8365116525SruHowever, it is ok to use it at the beginning of a line, with text
8366116525Srufollowing, outside of any environment.
8367116525Sru
8368116525SruDo not put braces after an @code{@@indent} command; they are not
8369116525Srunecessary, since @code{@@indent} is a command used outside of
8370116525Sruparagraphs (@pxref{Command Syntax}).
8371116525Sru
8372116525Sru
837393139Sru@node cartouche
837493139Sru@section @code{@@cartouche}: Rounded Rectangles Around Examples
837542660Smarkm@findex cartouche
837642660Smarkm@cindex Box with rounded corners
837793139Sru@cindex Rounded rectangles, around examples
837842660Smarkm
837942660SmarkmIn a printed manual, the @code{@@cartouche} command draws a box with
8380146515Srurounded corners around its contents.  In HTML, a normal rectangle is
8381146515Srudrawn (that's the best HTML can do).  @code{@@cartouche} has no effect
8382146515Sruin Info output.
838342660Smarkm
8384146515SruYou can use this command to further highlight an example or quotation.
8385146515SruFor instance, you could write a manual in which one type of example is
8386146515Srusurrounded by a cartouche for emphasis.
838742660Smarkm
838842660SmarkmFor example,
838942660Smarkm
839042660Smarkm@example
8391146515Sru@@cartouche
839242660Smarkm@@example
839342660Smarkm% pwd
839442660Smarkm/usr/local/share/emacs
8395146515Sru@@end example
839642660Smarkm@@end cartouche
839742660Smarkm@end example
839842660Smarkm
839942660Smarkm@noindent
840042660Smarkmsurrounds the two-line example with a box with rounded corners, in the
840142660Smarkmprinted manual.
840242660Smarkm
8403146515SruThe output from the example looks like this (if you're reading this in
8404146515SruInfo, you'll see the @code{@@cartouche} had no effect):
840542660Smarkm
8406146515Sru@cartouche
840742660Smarkm@example
840842660Smarkm% pwd
8409146515Sru/usr/local/info
8410146515Sru@end example
841142660Smarkm@end cartouche
841242660Smarkm
8413146515SruFor proper output in HTML, it's necessary to put the
8414146515Sru@code{@@cartouche} around the @code{@@example}, and not the other way
8415146515Sruaround.  This limitation of @command{makeinfo} may be removed one day.
841642660Smarkm
8417146515Sru@code{@@cartouche} also implies @code{@@group} (@pxref{group}).
8418146515Sru
841993139Sru@node Lists and Tables
842042660Smarkm@chapter Lists and Tables
842142660Smarkm@cindex Making lists and tables
842242660Smarkm@cindex Lists and tables, making
842342660Smarkm@cindex Tables and lists, making
842442660Smarkm
842542660SmarkmTexinfo has several ways of making lists and tables.  Lists can be
842642660Smarkmbulleted or numbered; two-column tables can highlight the items in
842742660Smarkmthe first column; multi-column tables are also supported.
842842660Smarkm
842942660Smarkm@menu
843042660Smarkm* Introducing Lists::           Texinfo formats lists for you.
843142660Smarkm* itemize::                     How to construct a simple list.
843242660Smarkm* enumerate::                   How to construct a numbered list.
843342660Smarkm* Two-column Tables::           How to construct a two-column table.
843442660Smarkm* Multi-column Tables::         How to construct generalized tables.
843542660Smarkm@end menu
843642660Smarkm
8437146515Sru@node Introducing Lists
8438146515Sru@section Introducing Lists
843942660Smarkm
844042660SmarkmTexinfo automatically indents the text in lists or tables, and numbers
844142660Smarkman enumerated list.  This last feature is useful if you modify the
844242660Smarkmlist, since you do not need to renumber it yourself.@refill
844342660Smarkm
844442660SmarkmNumbered lists and tables begin with the appropriate @@-command at the
844542660Smarkmbeginning of a line, and end with the corresponding @code{@@end}
844642660Smarkmcommand on a line by itself.  The table and itemized-list commands
844742660Smarkmalso require that you write formatting information on the same line as
844842660Smarkmthe beginning @@-command.@refill
844942660Smarkm
845042660SmarkmBegin an enumerated list, for example, with an @code{@@enumerate}
845142660Smarkmcommand and end the list with an @code{@@end enumerate} command.
845242660SmarkmBegin an itemized list with an @code{@@itemize} command, followed on
845342660Smarkmthe same line by a formatting command such as @code{@@bullet}, and end
845442660Smarkmthe list with an @code{@@end itemize} command.@refill
845542660Smarkm@findex end
845642660Smarkm
845742660SmarkmPrecede each element of a list with an @code{@@item} or @code{@@itemx}
845842660Smarkmcommand.@refill
845942660Smarkm
846042660Smarkm@sp 1
846142660Smarkm@noindent
846242660SmarkmHere is an itemized list of the different kinds of table and lists:@refill
846342660Smarkm
846442660Smarkm@itemize @bullet
846542660Smarkm@item
846642660SmarkmItemized lists with and without bullets.
846742660Smarkm
846842660Smarkm@item
846942660SmarkmEnumerated lists, using numbers or letters.
847042660Smarkm
847142660Smarkm@item
847242660SmarkmTwo-column tables with highlighting.
847342660Smarkm@end itemize
847442660Smarkm
847542660Smarkm@sp 1
847642660Smarkm@noindent
847742660SmarkmHere is an enumerated list with the same items:@refill
847842660Smarkm
847942660Smarkm@enumerate
848042660Smarkm@item
848142660SmarkmItemized lists with and without bullets.
848242660Smarkm
848342660Smarkm@item
848442660SmarkmEnumerated lists, using numbers or letters.
848542660Smarkm
848642660Smarkm@item
848742660SmarkmTwo-column tables with highlighting.
848842660Smarkm@end enumerate
848942660Smarkm
849042660Smarkm@sp 1
849142660Smarkm@noindent
849242660SmarkmAnd here is a two-column table with the same items and their
849342660Smarkm@w{@@-commands}:@refill
849442660Smarkm
849542660Smarkm@table @code
849642660Smarkm@item @@itemize
849742660SmarkmItemized lists with and without bullets.
849842660Smarkm
849942660Smarkm@item @@enumerate
850042660SmarkmEnumerated lists, using numbers or letters.
850142660Smarkm
850242660Smarkm@item @@table
850342660Smarkm@itemx @@ftable
850442660Smarkm@itemx @@vtable
850556160SruTwo-column tables, optionally with indexing.
850642660Smarkm@end table
850742660Smarkm
850856160Sru
850956160Sru@node itemize
851056160Sru@section @code{@@itemize}: Making an Itemized List
851142660Smarkm@cindex Itemization
851242660Smarkm@findex itemize
851342660Smarkm
851442660SmarkmThe @code{@@itemize} command produces sequences of indented
851542660Smarkmparagraphs, with a bullet or other mark inside the left margin
851642660Smarkmat the beginning of each paragraph for which such a mark is desired.@refill
851742660Smarkm
851856160Sru@cindex @code{@@w}, for blank items
851942660SmarkmBegin an itemized list by writing @code{@@itemize} at the beginning of
852042660Smarkma line.  Follow the command, on the same line, with a character or a
852142660SmarkmTexinfo command that generates a mark.  Usually, you will write
852242660Smarkm@code{@@bullet} after @code{@@itemize}, but you can use
852356160Sru@code{@@minus}, or any command or character that results in a single
852456160Srucharacter in the Info file.  If you don't want any mark at all, use
852556160Sru@code{@@w}.  (When you write the mark command such as
852656160Sru@code{@@bullet} after an @code{@@itemize} command, you may omit the
852756160Sru@samp{@{@}}.)  If you don't specify a mark command, the default is
852856160Sru@code{@@bullet}.
852942660Smarkm
853042660SmarkmWrite the text of the indented paragraphs themselves after the
853142660Smarkm@code{@@itemize}, up to another line that says @code{@@end
853242660Smarkmitemize}.@refill
853342660Smarkm
853442660Smarkm@findex item
8535116525SruAt the beginning of each paragraph for which a mark in the margin is
8536116525Srudesired, write a line that starts with @code{@@item}.  It is ok to
8537116525Sruhave text following the @code{@@item}.
853842660Smarkm
853942660SmarkmUsually, you should put a blank line before an @code{@@item}.  This
854042660Smarkmputs a blank line in the Info file. (@TeX{} inserts the proper
854142660Smarkminterline whitespace in either case.)  Except when the entries are
854242660Smarkmvery brief, these blank lines make the list look better.@refill
854342660Smarkm
854442660SmarkmHere is an example of the use of @code{@@itemize}, followed by the
854556160Sruoutput it produces.  @code{@@bullet} produces an @samp{*} in Info and a
854656160Sruround dot in @TeX{}.
854742660Smarkm
854842660Smarkm@example
854942660Smarkm@group
855042660Smarkm@@itemize @@bullet
855142660Smarkm@@item
855242660SmarkmSome text for foo.
855342660Smarkm
855442660Smarkm@@item
855542660SmarkmSome text
855642660Smarkmfor bar.
855742660Smarkm@@end itemize
855842660Smarkm@end group
855942660Smarkm@end example
856042660Smarkm
856142660Smarkm@noindent
856242660SmarkmThis produces:
856342660Smarkm
856442660Smarkm@quotation
856542660Smarkm@itemize @bullet
856642660Smarkm@item
856742660SmarkmSome text for foo.
856842660Smarkm
856942660Smarkm@item
857042660SmarkmSome text
857142660Smarkmfor bar.
857242660Smarkm@end itemize
857342660Smarkm@end quotation
857442660Smarkm
857542660SmarkmItemized lists may be embedded within other itemized lists.  Here is a
857642660Smarkmlist marked with dashes embedded in a list marked with bullets:@refill
857742660Smarkm
857842660Smarkm@example
857942660Smarkm@group
858042660Smarkm@@itemize @@bullet
858142660Smarkm@@item
858242660SmarkmFirst item.
858342660Smarkm
858442660Smarkm@@itemize @@minus
858542660Smarkm@@item
858642660SmarkmInner item.
858742660Smarkm
858842660Smarkm@@item
858942660SmarkmSecond inner item.
859042660Smarkm@@end itemize
859142660Smarkm
859242660Smarkm@@item
859342660SmarkmSecond outer item.
859442660Smarkm@@end itemize
859542660Smarkm@end group
859642660Smarkm@end example
859742660Smarkm
859842660Smarkm@noindent
859942660SmarkmThis produces:
860042660Smarkm
860142660Smarkm@quotation
860242660Smarkm@itemize @bullet
860342660Smarkm@item
860442660SmarkmFirst item.
860542660Smarkm
860642660Smarkm@itemize @minus
860742660Smarkm@item
860842660SmarkmInner item.
860942660Smarkm
861042660Smarkm@item
861142660SmarkmSecond inner item.
861242660Smarkm@end itemize
861342660Smarkm
861442660Smarkm@item
861542660SmarkmSecond outer item.
861642660Smarkm@end itemize
861742660Smarkm@end quotation
861842660Smarkm
861956160Sru
862056160Sru@node enumerate
862156160Sru@section @code{@@enumerate}: Making a Numbered or Lettered List
862242660Smarkm@cindex Enumeration
862342660Smarkm@findex enumerate
862442660Smarkm
862542660Smarkm@code{@@enumerate} is like @code{@@itemize} (@pxref{itemize,,
862642660Smarkm@code{@@itemize}}), except that the labels on the items are
862742660Smarkmsuccessive integers or letters instead of bullets.
862842660Smarkm
862942660SmarkmWrite the @code{@@enumerate} command at the beginning of a line.  The
863042660Smarkmcommand does not require an argument, but accepts either a number or a
863142660Smarkmletter as an option.  Without an argument, @code{@@enumerate} starts the
863242660Smarkmlist with the number @samp{1}.  With a numeric argument, such as
863342660Smarkm@samp{3}, the command starts the list with that number.  With an upper
863442660Smarkmor lower case letter, such as @samp{a} or @samp{A}, the command starts
863556160Sruthe list with that letter.
863642660Smarkm
8637116525SruWrite the text of the enumerated list in the same way as an itemized
8638116525Srulist: write a line starting with @code{@@item} at the beginning of
8639116525Srueach paragraph that you want enumerated.  It is ok to have text
8640116525Srufollowing the @code{@@item}.
864142660Smarkm
864242660SmarkmYou should put a blank line between entries in the list.
864356160SruThis generally makes it easier to read the Info file.
864442660Smarkm
864542660Smarkm@need 1500
864656160SruHere is an example of @code{@@enumerate} without an argument:
864742660Smarkm
864842660Smarkm@example
864942660Smarkm@group
865042660Smarkm@@enumerate
865142660Smarkm@@item
865242660SmarkmUnderlying causes.
865342660Smarkm
865442660Smarkm@@item
865542660SmarkmProximate causes.
865642660Smarkm@@end enumerate
865742660Smarkm@end group
865842660Smarkm@end example
865942660Smarkm
866042660Smarkm@noindent
866142660SmarkmThis produces:
866242660Smarkm
866342660Smarkm@enumerate
866442660Smarkm@item
866542660SmarkmUnderlying causes.
866642660Smarkm
866742660Smarkm@item
866842660SmarkmProximate causes.
866942660Smarkm@end enumerate
867042660Smarkm@sp 1
867142660SmarkmHere is an example with an argument of @kbd{3}:@refill
867242660Smarkm@sp 1
867342660Smarkm@example
867442660Smarkm@group
867542660Smarkm@@enumerate 3
867642660Smarkm@@item
867742660SmarkmPredisposing causes.
867842660Smarkm
867942660Smarkm@@item
868042660SmarkmPrecipitating causes.
868142660Smarkm
868242660Smarkm@@item
868342660SmarkmPerpetuating causes.
868442660Smarkm@@end enumerate
868542660Smarkm@end group
868642660Smarkm@end example
868742660Smarkm
868842660Smarkm@noindent
868942660SmarkmThis produces:
869042660Smarkm
869142660Smarkm@enumerate 3
869242660Smarkm@item
869342660SmarkmPredisposing causes.
869442660Smarkm
869542660Smarkm@item
869642660SmarkmPrecipitating causes.
869742660Smarkm
869842660Smarkm@item
869942660SmarkmPerpetuating causes.
870042660Smarkm@end enumerate
870142660Smarkm@sp 1
870242660SmarkmHere is a brief summary of the alternatives.  The summary is constructed
870342660Smarkmusing @code{@@enumerate} with an argument of @kbd{a}.@refill
870442660Smarkm@sp 1
870542660Smarkm@enumerate a
870642660Smarkm@item
870742660Smarkm@code{@@enumerate}
870842660Smarkm
870942660SmarkmWithout an argument, produce a numbered list, starting with the number
871042660Smarkm1.@refill
871142660Smarkm
871242660Smarkm@item
871342660Smarkm@code{@@enumerate @var{positive-integer}}
871442660Smarkm
871542660SmarkmWith a (positive) numeric argument, start a numbered list with that
871642660Smarkmnumber.  You can use this to continue a list that you interrupted with
871742660Smarkmother text.@refill
871842660Smarkm
871942660Smarkm@item
872042660Smarkm@code{@@enumerate @var{upper-case-letter}}
872142660Smarkm
872242660SmarkmWith an upper case letter as argument, start a list
872342660Smarkmin which each item is marked
872442660Smarkmby a letter, beginning with that upper case letter.@refill
872542660Smarkm
872642660Smarkm@item
872742660Smarkm@code{@@enumerate @var{lower-case-letter}}
872842660Smarkm
872942660SmarkmWith a lower case letter as argument, start a list
873042660Smarkmin which each item is marked by
873142660Smarkma letter, beginning with that lower case letter.@refill
873242660Smarkm@end enumerate
873342660Smarkm
873442660SmarkmYou can also nest enumerated lists, as in an outline.@refill
873542660Smarkm
8736114472Sru@node Two-column Tables
873742660Smarkm@section Making a Two-column Table
873842660Smarkm@cindex Tables, making two-column
873942660Smarkm@findex table
874042660Smarkm
874142660Smarkm@code{@@table} is similar to @code{@@itemize} (@pxref{itemize,,
874242660Smarkm@code{@@itemize}}), but allows you to specify a name or heading line for
874342660Smarkmeach item.  The @code{@@table} command is used to produce two-column
874442660Smarkmtables, and is especially useful for glossaries, explanatory
874542660Smarkmexhibits, and command-line option summaries.
874642660Smarkm
874742660Smarkm@menu
874842660Smarkm* table::                       How to construct a two-column table.
874942660Smarkm* ftable vtable::               Automatic indexing for two-column tables.
875042660Smarkm* itemx::                       How to put more entries in the first column.
875142660Smarkm@end menu
875242660Smarkm
8753114472Sru@node table
8754114472Sru@subsection Using the @code{@@table} Command
875542660Smarkm
8756114472Sru@cindex Definition lists, typesetting
8757114472SruUse the @code{@@table} command to produce two-column tables.  It is
8758114472Sruusually listed for ``definition lists'' of various sorts, where you
8759114472Sruhave a list of terms and a brief text with each one.
876042660Smarkm
8761114472SruWrite the @code{@@table} command at the beginning of a line, after a
8762114472Srublank line, and follow it on the same line with an argument that is a
8763114472SruTexinfo ``indicating'' command such as @code{@@code}, @code{@@samp},
8764114472Sru@code{@@var}, @code{@@option}, or @code{@@kbd} (@pxref{Indicating}).
876542660Smarkm
8766114472SruThis command will be applied to the text that goes into the first
8767114472Srucolumn of each item and thus determines how it will be highlighted.
8768114472SruFor example, @code{@@table @@code} will cause the text in the first
8769114472Srucolumn to be output as if it @code{@@code} command.
8770114472Sru
877142660Smarkm@findex asis
8772114472SruYou may also use the @code{@@asis} command as an argument to
877342660Smarkm@code{@@table}.  @code{@@asis} is a command that does nothing; if you
8774114472Sruuse this command after @code{@@table}, the first column entries are
8775114472Sruoutput without added highlighting (``as is'').
877642660Smarkm
8777114472SruThe @code{@@table} command works with other commands besides those
8778114472Sruexplicitly mentioned here.  However, you can only use commands that
8779114472Srunormally take arguments in braces.  (In this case, however, you use
8780114472Sruthe command name without an argument, because the subsequent
8781114472Sru@code{@@item}'s will supply the argument.)
878242660Smarkm
878356160Sru@findex item
878442660SmarkmBegin each table entry with an @code{@@item} command at the beginning
878542660Smarkmof a line.  Write the first column text on the same line as the
878642660Smarkm@code{@@item} command.  Write the second column text on the line
878742660Smarkmfollowing the @code{@@item} line and on subsequent lines.  (You do not
878842660Smarkmneed to type anything for an empty second column entry.)  You may
878942660Smarkmwrite as many lines of supporting text as you wish, even several
8790114472Sruparagraphs.  But only the text on the same line as the @code{@@item}
8791114472Sruwill be placed in the first column (including any footnotes).
879242660Smarkm
879342660SmarkmNormally, you should put a blank line before an @code{@@item} line.
8794114472SruThis puts a blank line in the Info file.  Except when the entries are
8795114472Sruvery brief, a blank line looks better.
879642660Smarkm
8797114472SruEnd the table with a line consisting of @code{@@end table}, followed
8798114472Sruby a blank line.  @TeX{} will always start a new paragraph after the
8799114472Srutable, so the blank line is needed for the Info output to be analogous.
8800114472Sru
880142660Smarkm@need 1500
880242660SmarkmThe following table, for example, highlights the text in the first
8803114472Srucolumn with an @code{@@samp} command:
880442660Smarkm
880542660Smarkm@example
880642660Smarkm@group
880742660Smarkm@@table @@samp
880842660Smarkm@@item foo
880942660SmarkmThis is the text for
881042660Smarkm@@samp@{foo@}.
881142660Smarkm
881242660Smarkm@@item bar
881342660SmarkmText for @@samp@{bar@}.
881442660Smarkm@@end table
881542660Smarkm@end group
881642660Smarkm@end example
881742660Smarkm
881842660Smarkm@noindent
881942660SmarkmThis produces:
882042660Smarkm
882142660Smarkm@table @samp
882242660Smarkm@item foo
882342660SmarkmThis is the text for
882442660Smarkm@samp{foo}.
882542660Smarkm@item bar
882642660SmarkmText for @samp{bar}.
882742660Smarkm@end table
882842660Smarkm
882942660SmarkmIf you want to list two or more named items with a single block of
8830114472Srutext, use the @code{@@itemx} command.  (@xref{itemx,,@code{@@itemx}}.)
883142660Smarkm
883256160Sru
883356160Sru@node ftable vtable
883442660Smarkm@subsection @code{@@ftable} and @code{@@vtable}
883542660Smarkm@cindex Tables with indexes
883642660Smarkm@cindex Indexing table entries automatically
883742660Smarkm@findex ftable
883842660Smarkm@findex vtable
883942660Smarkm
884042660SmarkmThe @code{@@ftable} and @code{@@vtable} commands are the same as the
884142660Smarkm@code{@@table} command except that @code{@@ftable} automatically enters
884242660Smarkmeach of the items in the first column of the table into the index of
884342660Smarkmfunctions and @code{@@vtable} automatically enters each of the items in
884442660Smarkmthe first column of the table into the index of variables.  This
884542660Smarkmsimplifies the task of creating indices.  Only the items on the same
884642660Smarkmline as the @code{@@item} commands are indexed, and they are indexed in
884756160Sruexactly the form that they appear on that line.  @xref{Indices},
884856160Srufor more information about indices.@refill
884942660Smarkm
885042660SmarkmBegin a two-column table using @code{@@ftable} or @code{@@vtable} by
885142660Smarkmwriting the @@-command at the beginning of a line, followed on the same
885242660Smarkmline by an argument that is a Texinfo command such as @code{@@code},
885342660Smarkmexactly as you would for an @code{@@table} command; and end the table
885442660Smarkmwith an @code{@@end ftable} or @code{@@end vtable} command on a line by
885542660Smarkmitself.
885642660Smarkm
885742660SmarkmSee the example for @code{@@table} in the previous section.
885842660Smarkm
885956160Sru@node itemx
886042660Smarkm@subsection @code{@@itemx}
886142660Smarkm@cindex Two named items for @code{@@table}
886242660Smarkm@findex itemx
886342660Smarkm
886442660SmarkmUse the @code{@@itemx} command inside a table when you have two or more
886542660Smarkmfirst column entries for the same item, each of which should appear on a
8866146515Sruline of its own.
886742660Smarkm
8868146515SruUse @code{@@item} for the first entry, and @code{@@itemx} for all
8869146515Srusubsequent entries; @code{@@itemx} must always follow an @code{@@item}
8870146515Srucommand, with no blank line intervening.
8871146515Sru
8872146515SruThe @code{@@itemx} command works exactly like @code{@@item} except
8873146515Sruthat it does not generate extra vertical space above the first column
8874146515Srutext.  If you have multiple consecutive @code{@@itemx} commands, do
8875146515Srunot insert any blank lines between them.
8876146515Sru
887742660SmarkmFor example,
887842660Smarkm
887942660Smarkm@example
888042660Smarkm@group
888142660Smarkm@@table @@code
888242660Smarkm@@item upcase
888342660Smarkm@@itemx downcase
888442660SmarkmThese two functions accept a character or a string as
888542660Smarkmargument, and return the corresponding upper case (lower
888642660Smarkmcase) character or string.
888742660Smarkm@@end table
888842660Smarkm@end group
888942660Smarkm@end example
889042660Smarkm
889142660Smarkm@noindent
889242660SmarkmThis produces:
889342660Smarkm
889442660Smarkm@table @code
889542660Smarkm@item upcase
889642660Smarkm@itemx downcase
889742660SmarkmThese two functions accept a character or a string as
889842660Smarkmargument, and return the corresponding upper case (lower
889942660Smarkmcase) character or string.@refill
890042660Smarkm@end table
890142660Smarkm
890242660Smarkm@noindent
890342660Smarkm(Note also that this example illustrates multi-line supporting text in
890442660Smarkma two-column table.)@refill
890542660Smarkm
890642660Smarkm
8907146515Sru@node Multi-column Tables
8908146515Sru@section @code{@@multitable}: Multi-column Tables
890942660Smarkm@cindex Tables, making multi-column
891042660Smarkm@findex multitable
891142660Smarkm
891242660Smarkm@code{@@multitable} allows you to construct tables with any number of
891342660Smarkmcolumns, with each column having any width you like.
891442660Smarkm
891542660SmarkmYou define the column widths on the @code{@@multitable} line itself, and
891642660Smarkmwrite each row of the actual table following an @code{@@item} command,
891742660Smarkmwith columns separated by an @code{@@tab} command.  Finally, @code{@@end
891842660Smarkmmultitable} completes the table.  Details in the sections below.
891942660Smarkm
892042660Smarkm@menu
892142660Smarkm* Multitable Column Widths::    Defining multitable column widths.
892242660Smarkm* Multitable Rows::             Defining multitable rows, with examples.
892342660Smarkm@end menu
892442660Smarkm
892556160Sru@node Multitable Column Widths
892642660Smarkm@subsection Multitable Column Widths
892742660Smarkm@cindex Multitable column widths
892842660Smarkm@cindex Column widths, defining for multitables
892942660Smarkm@cindex Widths, defining multitable column
893042660Smarkm
893142660SmarkmYou can define the column widths for a multitable in two ways: as
893242660Smarkmfractions of the line length; or with a prototype row.  Mixing the two
893342660Smarkmmethods is not supported.  In either case, the widths are defined
893442660Smarkmentirely on the same line as the @code{@@multitable} command.
893542660Smarkm
893642660Smarkm@enumerate
893742660Smarkm@item
893842660Smarkm@findex columnfractions
893942660Smarkm@cindex Line length, column widths as fraction of
894042660SmarkmTo specify column widths as fractions of the line length, write
894142660Smarkm@code{@@columnfractions} and the decimal numbers (presumably less than
8942146515Sru1; a leading zero is allowed and ignored) after the
8943146515Sru@code{@@multitable} command, as in:
894442660Smarkm
894542660Smarkm@example
894642660Smarkm@@multitable @@columnfractions .33 .33 .33
894742660Smarkm@end example
894842660Smarkm
8949146515SruThe fractions need not add up exactly to 1.0, as these do not.  This
8950146515Sruallows you to produce tables that do not need the full line length.
895142660Smarkm
895242660Smarkm@item
895342660Smarkm@cindex Prototype row, column widths defined by
895442660SmarkmTo specify a prototype row, write the longest entry for each column
895542660Smarkmenclosed in braces after the @code{@@multitable} command.  For example:
895642660Smarkm
895742660Smarkm@example
895842660Smarkm@@multitable @{some text for column one@} @{for column two@}
895942660Smarkm@end example
896042660Smarkm
896142660Smarkm@noindent
896242660SmarkmThe first column will then have the width of the typeset `some text for
896342660Smarkmcolumn one', and the second column the width of `for column two'.
896442660Smarkm
896542660SmarkmThe prototype entries need not appear in the table itself.
896642660Smarkm
896742660SmarkmAlthough we used simple text in this example, the prototype entries can
896842660Smarkmcontain Texinfo commands; markup commands such as @code{@@code} are
896942660Smarkmparticularly likely to be useful.
897042660Smarkm
897142660Smarkm@end enumerate
897242660Smarkm
897342660Smarkm
8974146515Sru@node Multitable Rows
897542660Smarkm@subsection Multitable Rows
897642660Smarkm@cindex Multitable rows
897742660Smarkm@cindex Rows, of a multitable
897842660Smarkm
897942660Smarkm@findex item
898056160Sru@findex tab
898142660SmarkmAfter the @code{@@multitable} command defining the column widths (see
898242660Smarkmthe previous section), you begin each row in the body of a multitable
898342660Smarkmwith @code{@@item}, and separate the column entries with @code{@@tab}.
898442660SmarkmLine breaks are not special within the table body, and you may break
898542660Smarkminput lines in your source file as necessary.
898642660Smarkm
8987146515Sru@findex headitem
8988146515Sru@cindex Heading row, in table
8989146515Sru@cindex <thead> HTML tag
8990146515SruYou can also use @code{@@headitem} instead of @code{@@item} to produce
8991146515Srua @dfn{heading row}.  The @TeX{} output for such a row is in bold, and
8992146515Sruthe HTML, XML, and Docbook output uses the @code{<thead>} tag.
8993146515Sru
899442660SmarkmHere is a complete example of a multi-column table (the text is from
899542660Smarkm@cite{The GNU Emacs Manual}, @pxref{Split Window,, Splitting Windows,
899642660Smarkmemacs, The GNU Emacs Manual}):
899742660Smarkm
899842660Smarkm@example
899942660Smarkm@@multitable @@columnfractions .15 .45 .4
9000146515Sru@@headitem Key @@tab Command @@tab Description
900142660Smarkm@@item C-x 2
900242660Smarkm@@tab @@code@{split-window-vertically@}
900342660Smarkm@@tab Split the selected window into two windows,
900442660Smarkmwith one above the other.
900542660Smarkm@@item C-x 3
900642660Smarkm@@tab @@code@{split-window-horizontally@}
900742660Smarkm@@tab Split the selected window into two windows
900842660Smarkmpositioned side by side.
900942660Smarkm@@item C-Mouse-2
901042660Smarkm@@tab
901142660Smarkm@@tab In the mode line or scroll bar of a window,
901242660Smarkmsplit that window.
901342660Smarkm@@end multitable
901442660Smarkm@end example
901542660Smarkm
901642660Smarkm@noindent produces:
901742660Smarkm
901842660Smarkm@multitable @columnfractions .15 .45 .4
9019146515Sru@headitem Key @tab Command @tab Description
902042660Smarkm@item C-x 2
902142660Smarkm@tab @code{split-window-vertically}
902242660Smarkm@tab Split the selected window into two windows,
902342660Smarkmwith one above the other.
902442660Smarkm@item C-x 3
902542660Smarkm@tab @code{split-window-horizontally}
902642660Smarkm@tab Split the selected window into two windows
902742660Smarkmpositioned side by side.
902842660Smarkm@item C-Mouse-2
902942660Smarkm@tab
903042660Smarkm@tab In the mode line or scroll bar of a window,
903142660Smarkmsplit that window.
903242660Smarkm@end multitable
903342660Smarkm
903442660Smarkm
9035146515Sru@node Special Displays
9036146515Sru@chapter Special Displays
9037146515Sru@cindex Special displays
9038146515Sru
9039146515SruThe commands in this chapter allow you to write text that is specially
9040146515Srudisplayed (output format permitting), outside of the normal document
9041146515Sruflow.
9042146515Sru
9043146515SruOne set of such commands is for creating ``floats'', that is, figures,
9044146515Srutables, and the like, set off from the main text, possibly numbered,
9045146515Srucaptioned, and/or referred to from elsewhere in the document.  Images
9046146515Sruare often included in these displays.
9047146515Sru
9048146515SruAnother group of commands is for creating footnotes in Texinfo.
9049146515Sru
9050146515Sru@menu
9051146515Sru* Floats::                      Figures, tables, and the like.
9052146515Sru* Images::                      Including graphics and images.
9053146515Sru* Footnotes::                   Writing footnotes.
9054146515Sru@end menu
9055146515Sru
9056146515Sru
9057146515Sru@node Floats
9058146515Sru@section Floats
9059146515Sru@cindex Floats, in general
9060146515Sru
9061146515SruA @dfn{float} is a display which is set off from the main text.  It is
9062146515Srutypically labelled as being a ``Figure'', ``Table'', ``Example'', or
9063146515Srusome similar type.
9064146515Sru
9065146515Sru@cindex Floating, not yet implemented
9066146515SruA float is so-named because, in principle, it can be moved to the
9067146515Srubottom or top of the current page, or to a following page, in the
9068146515Sruprinted output.  (Floating does not make sense in other output
9069146515Sruformats.)  In the present version of Texinfo, however, this floating
9070146515Sruis unfortunately not yet implemented.  Instead, the floating material
9071146515Sruis simply output at the current location, more or less as if it were
9072146515Sruan @code{@@group} (@pxref{group,,@code{@@group}}).
9073146515Sru
9074146515Sru@menu
9075146515Sru* float::                       Producing floating material.
9076146515Sru* caption shortcaption::        Specifying descriptions for floats.
9077146515Sru* listoffloats::                A table of contents for floats.
9078146515Sru@end menu
9079146515Sru
9080146515Sru
9081146515Sru@node float
9082146515Sru@subsection @code{@@float} [@var{type}][,@var{label}]: Floating material
9083146515Sru@findex float
9084146515Sru@cindex Float environment
9085146515Sru
9086146515SruTo produce floating material, enclose the material you want to be
9087146515Srudisplayed separate between @code{@@float} and @code{@@end float}
9088146515Srucommands, on lines by themselves.
9089146515Sru
9090146515SruFloating material uses @code{@@image} to display an already-existing
9091146515Srugraphic (@pxref{Images}), or @code{@@multitable} to display a table
9092146515Sru(@pxref{Multi-column Tables}).  However, the contents of the float can
9093146515Srube anything.  Here's an example with simple text:
9094146515Sru
9095146515Sru@example
9096146515Sru@@float Figure,fig:ex1
9097146515SruThis is an example float.
9098146515Sru@@end float
9099146515Sru@end example
9100146515Sru
9101146515Sru@noindent And the output:
9102146515Sru
9103146515Sru@float Figure,fig:ex1
9104146515SruThis is an example float.
9105146515Sru@end float
9106146515Sru
9107146515SruAs shown in the example, @code{@@float} takes two arguments (separated
9108146515Sruby a comma), @var{type} and @var{label}.  Both are optional.
9109146515Sru
9110146515Sru@table @var
9111146515Sru@item type
9112146515SruSpecifies the sort of float this is; typically a word such as
9113146515Sru``Figure'', ``Table'', etc.  If not given, and @var{label} is, any
9114146515Srucross-referencing will simply use a bare number.
9115146515Sru
9116146515Sru@item label
9117146515SruSpecifies a cross-reference label for this float.  If given, this
9118146515Srufloat is automatically given a number, and will appear in any
9119146515Sru@code{@@listofloats} output (@pxref{listoffloats}).  Cross-references
9120146515Sruto @var{label} are allowed.
9121146515Sru
9122146515Sru@cindex Floats, making unnumbered
9123146515Sru@cindex Unnumbered float, creating
9124146515SruOn the other hand, if @var{label} is not given, then the float will
9125146515Srunot be numbered and consequently will not appear in the
9126146515Sru@code{@@listoffloats} output or be cross-referenceable.
9127146515Sru@end table
9128146515Sru
9129146515Sru@noindent Normally, you specify both @var{type} and @var{label}, to get a
9130146515Srulabeled and numbered float.
9131146515Sru
9132146515Sru@cindex Floats, numbering of
9133146515Sru@cindex Numbering of floats
9134146515SruIn Texinfo, all floats are numbered the same way: with the chapter
9135146515Srunumber (or appendix letter), a period, and the float number, which
9136146515Srusimply counts 1, 2, 3, @dots{}, and is reset at each chapter.  Each
9137146515Srufloat type is counted independently.  
9138146515Sru
9139146515SruFloats within an @code{@@unnumbered} are numbered, or outside of any
9140146515Sruchapter, are simply numbered consecutively from 1.
9141146515Sru
9142146515SruThese numbering conventions are not, at present, changeable.
9143146515Sru
9144146515Sru
9145146515Sru@node caption shortcaption
9146146515Sru@subsection @code{@@caption} & @code{@@shortcaption}
9147146515Sru@findex caption
9148146515Sru@findex shortcaption
9149146515Sru@cindex Captions, for floats
9150146515Sru@cindex Short captions, for lists of floats
9151146515Sru
9152146515SruYou may write an @code{@@caption} anywhere within a @code{@@float}
9153146515Sruenvironment, to define a caption for the float.  It is not allowed in
9154146515Sruany other context.  @code{@@caption} takes a single argument, enclosed
9155146515Sruin braces.  Here's an example:
9156146515Sru
9157146515Sru@example
9158146515Sru@@float
9159146515SruAn example float, with caption.
9160146515Sru@@caption@{Caption for example float.@}
9161146515Sru@@end float
9162146515Sru@end example
9163146515Sru
9164146515Sru@noindent The output is:
9165146515Sru
9166146515Sru@float
9167146515SruAn example float, with caption.
9168146515Sru@caption{Caption for example float.}
9169146515Sru@end float
9170146515Sru
9171146515Sru@code{@@caption} can appear anywhere within the float; it is not
9172146515Sruprocessed until the @code{@@end float}.  The caption text is usually a
9173146515Srusentence or two, but may consist of several paragraphs if necessary.
9174146515Sru
9175146515SruIn the output, the caption always appears below the float; this is not
9176146515Srucurrently changeable.  It is preceded by the float type and/or number,
9177146515Sruas specified to the @code{@@float} command (see the previous section).
9178146515Sru
9179146515SruThe @code{@@shortcaption} command likewise may be used only within
9180146515Sru@code{@@float}, and takes a single argument in braces.  The short
9181146515Srucaption text is used instead of the caption text in a list of floats
9182146515Sru(see the next section).  Thus, you can write a long caption for the
9183146515Srumain document, and a short title to appear in the list of floats.  For
9184146515Sruexample:
9185146515Sru
9186146515Sru@example
9187146515Sru@@float
9188146515Sru... as above ...
9189146515Sru@@shortcaption@{Text for list of floats.@}
9190146515Sru@@end float
9191146515Sru@end example
9192146515Sru
9193146515SruThe text for @code{@@caption} and @code{@@shortcaption} may not
9194146515Srucontain comments (@code{@@c}), verbatim text (@code{@@verb}),
9195146515Sruenvironments such as @code{@@example}, or other complex constructs.
9196146515Sru
9197146515Sru
9198146515Sru@node listoffloats
9199146515Sru@subsection @code{@@listoffloats}: Tables of contents for floats
9200146515Sru@findex listoffloats
9201146515Sru@cindex List of floats
9202146515Sru@cindex Floats, list of
9203146515Sru@cindex Table of contents, for floats
9204146515Sru
9205146515SruYou can write a @code{@@listoffloats} command to generate a list of
9206146515Srufloats for a given float type (@pxref{float}), analogous to the
9207146515Srudocument's overall table of contents.  Typically, it is written in its
9208146515Sruown @code{@@unnumbered} node to provide a heading and structure,
9209146515Srurather like @code{@@printindex} (@pxref{Printing Indices & Menus}).
9210146515Sru
9211146515Sru@code{@@listoffloats} takes one optional argument, the float type.
9212146515SruHere's an example:
9213146515Sru
9214146515Sru@example
9215146515Sru@@node List of Figures
9216146515Sru@@unnumbered List of Figures
9217146515Sru@@listoffloats Figure
9218146515Sru@end example
9219146515Sru
9220146515Sru@noindent And the output from @code{@@listoffloats}:
9221146515Sru
9222146515Sru@display
9223146515Sru@listoffloats Figure
9224146515Sru@end display
9225146515Sru
9226146515SruWithout any argument, @code{@@listoffloats} generates a list of
9227146515Srufloats for which no float type was specified, i.e., no first argument
9228146515Sruto the @code{@@float} command (@pxref{float}).
9229146515Sru
9230146515SruEach line in the list of floats contains the float type (if any),
9231146515Sruthe float number, and the caption, if any---the @code{@@shortcaption}
9232146515Sruargument, if it was specified, else the @code{@@caption} argument.
9233146515SruIn Info, the result is a menu where each float can be selected.  In
9234146515SruHTML, each line is a link to the float.  In printed output, the page
9235146515Srunumber is included.
9236146515Sru
9237146515SruUnnumbered floats (those without cross-reference labels) are omitted
9238146515Srufrom the list of floats.
9239146515Sru
9240146515Sru
9241146515Sru@node Images
9242146515Sru@section Inserting Images
9243146515Sru
9244146515Sru@cindex Images, inserting
9245146515Sru@cindex Pictures, inserting
9246146515Sru@findex image
9247146515Sru
9248146515SruYou can insert an image given in an external file with the
9249146515Sru@code{@@image} command.  Although images can be used anywhere,
9250146515Sruincluding the middle of a paragraph, we describe them in this chapter
9251146515Srusince they are most often part of a displayed figure or example.
9252146515Sru
9253146515Sru@menu
9254146515Sru* Image Syntax::
9255146515Sru* Image Scaling::
9256146515Sru@end menu
9257146515Sru
9258146515Sru
9259146515Sru@node Image Syntax
9260146515Sru@subsection Image Syntax
9261146515Sru
9262146515SruHere is the basic synopsis of the @code{@@image} command:
9263146515Sru
9264146515Sru@example
9265146515Sru@@image@{@var{filename}@r{[,} @var{width}@r{[,} @var{height}@r{[,} @var{alttext}@r{[, }@var{extension}@r{]]]]}@}
9266146515Sru@end example
9267146515Sru
9268146515Sru@cindex Formats for images
9269146515Sru@cindex Image formats
9270146515SruThe @var{filename} argument is mandatory, and must not have an
9271146515Sruextension, because the different processors support different formats:
9272146515Sru
9273146515Sru@itemize @bullet
9274146515Sru@item
9275146515Sru@TeX{} reads the file @file{@var{filename}.eps} (Encapsulated PostScript
9276146515Sruformat).
9277146515Sru@item
9278146515Sru@pindex pdftex@r{, and images}
9279146515SruPDF@TeX{} reads @file{@var{filename}.pdf} (Adobe's Portable Document Format).
9280146515Sru@item
9281146515Sru@code{makeinfo} includes @file{@var{filename}.txt} verbatim for
9282146515SruInfo output (more or less as if it was an @code{@@example}).
9283146515Sru@item
9284146515Sru@code{makeinfo} uses the optional fifth argument @var{extension} to
9285146515Sru@code{@@image} for the filename extension, if it is specified.  For example:
9286146515Sru
9287146515Sru@pindex XPM image format
9288146515Sru@example
9289146515Sru@@image@{foo,,,,.xpm@}
9290146515Sru@end example
9291146515Sru
9292146515Sru@noindent
9293146515Sruwill cause @code{makeinfo} to look for @file{foo.xpm} before any others.
9294146515Sru
9295146515Sru@end itemize
9296146515Sru
9297146515SruThe @var{width} and @var{height} arguments are described in the next
9298146515Srusection.
9299146515Sru
9300146515SruFor @TeX{} output, if an image is the first thing in a paragraph, for
9301146515Sruexample if you want two images side-by-side, you must precede it with
9302146515Sru@code{@@noindent} (@pxref{noindent,,@code{@@noindent}}).  Otherwise it
9303146515Sruwill be displayed on a line by itself.  If you want it centered, 
9304146515Sruuse @code{@@center} (@pxref{titlefont center sp,,@code{@@titlefont
9305146515Sru@@center @@sp}}).
9306146515Sru
9307146515Sru@cindex Alt attribute for images
9308146515Sru@cindex Images, alternate text for
9309146515SruWhen producing html, @code{makeinfo} sets the @dfn{alt attribute} for
9310146515Sruinline images to the optional @var{alttext} (fourth) argument to
9311146515Sru@code{@@image}, if supplied.  If not supplied, @code{makeinfo} uses
9312146515Sruthe full file name of the image being displayed.  If you want an empty
9313146515Sru@code{alt} string, use @code{@@-}.  The @var{alttext} is taken as
9314146515SruTexinfo text, so special characters such as @samp{"} and @samp{<} and
9315146515Sru@samp{&} are escaped in the HTML and XML output.
9316146515Sru
9317146515Sru@cindex GIF images, unsupported due to patents
9318146515Sru@cindex PNG image format
9319146515Sru@cindex JPG image format
9320146515SruIf you do not supply the optional @var{extension} (fifth) argument,
9321146515Sru@code{makeinfo} first tries @file{@var{filename}.png}; if that does
9322146515Srunot exist, it tries @file{@var{filename}.jpg}.  If that does not exist
9323146515Srueither, it complains.  (We cannot support GIF format directly due to
9324146515Srusoftware patents.)
9325146515Sru
9326146515SruIn Info output, @code{makeinfo} writes a reference to the binary image
9327146515Srufile (trying @var{filename} suffixed with @file{@var{extension}},
9328146515Sru@file{@var{.extension}}, @file{.png}, or @file{.jpg}, in that order)
9329146515Sruif one exists.  It also literally includes the @file{.txt} file if one
9330146515Sruexists.  This way, Info readers which can display images (such as the
9331146515SruEmacs Info browser, running under X) can do so, whereas Info readers
9332146515Sruwhich can only use text (such as the standalone Info reader) can
9333146515Srudisplay the textual version.
9334146515Sru
9335146515SruThe implementation of this is to put the following construct into the
9336146515SruInfo output:
9337146515Sru
9338146515Sru@example
9339146515Sru^@@^H[image src="@var{binaryfile}" text="@var{txtfile}"
9340146515Sru           alt="@var{alttext} ... ^@@^H]
9341146515Sru@end example
9342146515Sru
9343146515Sru@noindent where @samp{^@@} and @samp{^H} stand for the actual null and
9344146515Srubackspace control characters.  If one of the files is not present, the
9345146515Srucorresponding argument is omitted.
9346146515Sru
9347146515SruThe reason for mentioning this here is that older Info browsers (this
9348146515Srufeature was introduced in Texinfo version 4.6) will display the above
9349146515Sruliterally, which, although not pretty, should not be harmful.
9350146515Sru
9351146515Sru
9352146515Sru@node Image Scaling
9353146515Sru@subsection Image Scaling
9354146515Sru
9355146515Sru@cindex Images, scaling
9356146515Sru@cindex Scaling images
9357146515Sru@cindex Width of images
9358146515Sru@cindex Height of images
9359146515Sru@cindex Aspect ratio of images
9360146515Sru@cindex Distorting images
9361146515SruThe optional @var{width} and @var{height} arguments to the
9362146515Sru@code{@@image} command (see the previous section) specify the size to
9363146515Sruscale the image to.  They are ignored for Info output.  If neither is
9364146515Sruspecified, the image is presented in its natural size (given in the
9365146515Srufile); if only one is specified, the other is scaled proportionately;
9366146515Sruand if both are specified, both are respected, thus possibly distorting
9367146515Sruthe original image by changing its aspect ratio.
9368146515Sru
9369146515Sru@cindex Dimensions and image sizes
9370146515SruThe @var{width} and @var{height} may be specified using any valid @TeX{}
9371146515Srudimension, namely:
9372146515Sru
9373146515Sru@table @asis
9374146515Sru@item pt
9375146515Sru@cindex Points (dimension)
9376146515Srupoint (72.27pt = 1in)
9377146515Sru@item pc
9378146515Sru@cindex Picas
9379146515Srupica (1pc = 12pt)
9380146515Sru@item bp
9381146515Sru@cindex Big points
9382146515Srubig point (72bp = 1in)
9383146515Sru@item in
9384146515Sru@cindex Inches
9385146515Sruinch
9386146515Sru@item cm
9387146515Sru@cindex Centimeters
9388146515Srucentimeter (2.54cm = 1in)
9389146515Sru@item mm
9390146515Sru@cindex Millimeters
9391146515Srumillimeter (10mm = 1cm)
9392146515Sru@item dd
9393146515Sru@cindex Did@^ot points
9394146515Srudid@^ot point (1157dd = 1238pt)
9395146515Sru@item cc
9396146515Sru@cindex Ciceros
9397146515Srucicero (1cc = 12dd)
9398146515Sru@item sp
9399146515Sru@cindex Scaled points
9400146515Sruscaled point (65536sp = 1pt)
9401146515Sru@end table
9402146515Sru
9403146515Sru@pindex ridt.eps
9404146515SruFor example, the following will scale a file @file{ridt.eps} to one
9405146515Sruinch vertically, with the width scaled proportionately:
9406146515Sru
9407146515Sru@example
9408146515Sru@@image@{ridt,,1in@}
9409146515Sru@end example
9410146515Sru
9411146515Sru@pindex epsf.tex
9412146515SruFor @code{@@image} to work with @TeX{}, the file @file{epsf.tex} must be
9413146515Sruinstalled somewhere that @TeX{} can find it.  (The standard location is
9414146515Sru@file{@var{texmf}/tex/generic/dvips/epsf.tex}, where @var{texmf} is a
9415146515Sruroot of your @TeX{} directory tree.)  This file is included in the
9416146515SruTexinfo distribution and is also available from
9417146515Sru@uref{ftp://tug.org/tex/epsf.tex}, among other places.
9418146515Sru
9419146515Sru@code{@@image} can be used within a line as well as for displayed
9420146515Srufigures.  Therefore, if you intend it to be displayed, be sure to leave
9421146515Srua blank line before the command, or the output will run into the
9422146515Srupreceding text.
9423146515Sru
9424146515SruImage scaling is presently implemented only in @TeX{}, not in HTML or
9425146515Sruany other sort of output.
9426146515Sru
9427146515Sru
9428146515Sru@node Footnotes
9429146515Sru@section Footnotes
9430146515Sru@cindex Footnotes
9431146515Sru@findex footnote
9432146515Sru
9433146515SruA @dfn{footnote} is for a reference that documents or elucidates the
9434146515Sruprimary text.@footnote{A footnote should complement or expand upon
9435146515Sruthe primary text, but a reader should not need to read a footnote to
9436146515Sruunderstand the primary text.  For a thorough discussion of footnotes,
9437146515Srusee @cite{The Chicago Manual of Style}, which is published by the
9438146515SruUniversity of Chicago Press.}  Footnotes are distracting; use them
9439146515Srusparingly, if at all.  Standard bibliographical references are better
9440146515Sruplaced in a bibliography at the end of a document than in footnotes
9441146515Sruthroughout.
9442146515Sru
9443146515Sru@menu
9444146515Sru* Footnote Commands::           How to write a footnote in Texinfo.
9445146515Sru* Footnote Styles::             Controlling how footnotes appear in Info.
9446146515Sru@end menu
9447146515Sru
9448146515Sru
9449146515Sru@node Footnote Commands
9450146515Sru@subsection Footnote Commands
9451146515Sru
9452146515SruIn Texinfo, footnotes are created with the @code{@@footnote} command.
9453146515SruThis command is followed immediately by a left brace, then by the text
9454146515Sruof the footnote, and then by a terminating right brace.  Footnotes may
9455146515Srube of any length (they will be broken across pages if necessary), but
9456146515Sruare usually short.  The template is:
9457146515Sru
9458146515Sru@example
9459146515Sruordinary text@@footnote@{@var{text of footnote}@}
9460146515Sru@end example
9461146515Sru
9462146515SruAs shown here, the @code{@@footnote} command should come right after the
9463146515Srutext being footnoted, with no intervening space; otherwise, the footnote
9464146515Srumarker might end up starting a line.
9465146515Sru
9466146515SruFor example, this clause is followed by a sample footnote@footnote{Here
9467146515Sruis the sample footnote.}; in the Texinfo source, it looks like
9468146515Sruthis:
9469146515Sru
9470146515Sru@example
9471146515Sru@dots{}a sample footnote@@footnote@{Here is the sample
9472146515Srufootnote.@}; in the Texinfo source@dots{}
9473146515Sru@end example
9474146515Sru
9475146515SruAs you can see, the source includes two punctuation marks next to each
9476146515Sruother; in this case, @samp{.@};} is the sequence.  This is normal (the
9477146515Srufirst ends the footnote and the second belongs to the sentence being
9478146515Srufootnoted), so don't worry that it looks odd.
9479146515Sru
9480146515SruIn a printed manual or book, the reference mark for a footnote is a
9481146515Srusmall, superscripted number; the text of the footnote appears at the
9482146515Srubottom of the page, below a horizontal line.
9483146515Sru
9484146515SruIn Info, the reference mark for a footnote is a pair of parentheses
9485146515Sruwith the footnote number between them, like this: @samp{(1)}.  The
9486146515Srureference mark is followed by a cross-reference link to the footnote's
9487146515Srutext.
9488146515Sru
9489146515SruIn the HTML output, footnote references are marked with a small,
9490146515Srusuperscripted number which is rendered as a hypertext link to the
9491146515Srufootnote text.
9492146515Sru
9493146515SruBy the way, footnotes in the argument of an @code{@@item} command for a
9494146515Sru@code{@@table} must be on the same line as the @code{@@item}
9495146515Sru(as usual).  @xref{Two-column Tables}.
9496146515Sru
9497146515Sru
9498146515Sru@node Footnote Styles
9499146515Sru@subsection Footnote Styles
9500146515Sru
9501146515SruInfo has two footnote styles, which determine where the text of the
9502146515Srufootnote is located:
9503146515Sru
9504146515Sru@itemize @bullet
9505146515Sru@cindex @samp{@r{End}} node footnote style
9506146515Sru@item
9507146515SruIn the `End' node style, all the footnotes for a single node
9508146515Sruare placed at the end of that node.  The footnotes are separated from
9509146515Sruthe rest of the node by a line of dashes with the word
9510146515Sru@samp{Footnotes} within it.  Each footnote begins with an
9511146515Sru@samp{(@var{n})} reference mark.
9512146515Sru
9513146515Sru@need 700
9514146515Sru@noindent
9515146515SruHere is an example of a single footnote in the end of node style:@refill
9516146515Sru
9517146515Sru@example
9518146515Sru@group
9519146515Sru--------- Footnotes ---------
9520146515Sru
9521146515Sru(1)  Here is a sample footnote.
9522146515Sru@end group
9523146515Sru@end example
9524146515Sru
9525146515Sru@cindex @samp{@r{Separate}} footnote style
9526146515Sru@item
9527146515SruIn the `Separate' node style, all the footnotes for a single
9528146515Srunode are placed in an automatically constructed node of
9529146515Srutheir own.  In this style, a ``footnote reference'' follows
9530146515Srueach @samp{(@var{n})} reference mark in the body of the
9531146515Srunode.  The footnote reference is actually a cross reference
9532146515Sruwhich you use to reach the footnote node.
9533146515Sru
9534146515SruThe name of the node with the footnotes is constructed
9535146515Sruby appending @w{@samp{-Footnotes}} to the name of the node
9536146515Sruthat contains the footnotes. (Consequently, the footnotes'
9537146515Srunode for the @file{Footnotes} node is
9538146515Sru@w{@file{Footnotes-Footnotes}}!)  The footnotes' node has an
9539146515Sru`Up' node pointer that leads back to its parent node.
9540146515Sru
9541146515Sru@noindent
9542146515SruHere is how the first footnote in this manual looks after being
9543146515Sruformatted for Info in the separate node style:
9544146515Sru
9545146515Sru@smallexample
9546146515Sru@group
9547146515SruFile: texinfo.info  Node: Overview-Footnotes, Up: Overview
9548146515Sru
9549146515Sru(1) The first syllable of "Texinfo" is pronounced like "speck", not
9550146515Sru"hex". @dots{}
9551146515Sru@end group
9552146515Sru@end smallexample
9553146515Sru@end itemize
9554146515Sru
9555146515SruUnless your document has long and important footnotes (as in, say,
9556146515SruGibbon's @cite{Decline and Fall @dots{}}), we recommend the @samp{end}
9557146515Srustyle, as it is simpler for readers to follow.
9558146515Sru
9559146515Sru@findex footnotestyle
9560146515SruUse the @code{@@footnotestyle} command to specify an Info file's
9561146515Srufootnote style.  Write this command at the beginning of a line followed
9562146515Sruby an argument, either @samp{end} for the end node style or
9563146515Sru@samp{separate} for the separate node style.
9564146515Sru
9565146515Sru@need 700
9566146515SruFor example,
9567146515Sru
9568146515Sru@example
9569146515Sru@@footnotestyle end
9570146515Sru@end example
9571146515Sru@noindent
9572146515Sruor
9573146515Sru@example
9574146515Sru@@footnotestyle separate
9575146515Sru@end example
9576146515Sru
9577146515SruWrite an @code{@@footnotestyle} command before or shortly after the
9578146515Sruend-of-header line at the beginning of a Texinfo file.  (If you
9579146515Sruinclude the @code{@@footnotestyle} command between the start-of-header
9580146515Sruand end-of-header lines, the region formatting commands will format
9581146515Srufootnotes as specified.)@refill
9582146515Sru
9583146515SruIf you do not specify a footnote style, the formatting commands use
9584146515Srutheir default style.  Currently, @code{texinfo-format-buffer} and
9585146515Sru@code{texinfo-format-region} use the `separate' style and
9586146515Sru@code{makeinfo} uses the `end' style.
9587146515Sru
9588146515Sru
9589146515Sru@node Indices
959056160Sru@chapter Indices
959142660Smarkm@cindex Indices
959242660Smarkm
959342660SmarkmUsing Texinfo, you can generate indices without having to sort and
959442660Smarkmcollate entries manually.  In an index, the entries are listed in
959542660Smarkmalphabetical order, together with information on how to find the
959642660Smarkmdiscussion of each entry.  In a printed manual, this information
959742660Smarkmconsists of page numbers.  In an Info file, this information is a menu
9598146515Sruentry leading to the first node referenced.
959942660Smarkm
960042660SmarkmTexinfo provides several predefined kinds of index: an index
960142660Smarkmfor functions, an index for variables, an index for concepts, and so
960242660Smarkmon.  You can combine indices or use them for other than their
9603146515Srucanonical purpose.  Lastly, you can define your own new indices.
960442660Smarkm
9605146515Sru@xref{Printing Indices & Menus}, for information on how to print
9606146515Sruindices.
9607146515Sru
960842660Smarkm@menu
960942660Smarkm* Index Entries::               Choose different words for index entries.
961042660Smarkm* Predefined Indices::          Use different indices for different kinds
9611146515Sru                                 of entries.
961242660Smarkm* Indexing Commands::           How to make an index entry.
961342660Smarkm* Combining Indices::           How to combine indices.
961442660Smarkm* New Indices::                 How to define your own indices.
961542660Smarkm@end menu
961642660Smarkm
9617146515Sru
9618146515Sru@node Index Entries
961942660Smarkm@section Making Index Entries
962042660Smarkm@cindex Index entries, making
962142660Smarkm@cindex Entries, making index
962242660Smarkm
962342660SmarkmWhen you are making index entries, it is good practice to think of the
962442660Smarkmdifferent ways people may look for something.  Different people
962542660Smarkm@emph{do not} think of the same words when they look something up.  A
962642660Smarkmhelpful index will have items indexed under all the different words
962742660Smarkmthat people may use.  For example, one reader may think it obvious that
962842660Smarkmthe two-letter names for indices should be listed under ``Indices,
962942660Smarkmtwo-letter names'', since the word ``Index'' is the general concept.
963042660SmarkmBut another reader may remember the specific concept of two-letter
963142660Smarkmnames and search for the entry listed as ``Two letter names for
963242660Smarkmindices''.  A good index will have both entries and will help both
963342660Smarkmreaders.@refill
963442660Smarkm
963542660SmarkmLike typesetting, the construction of an index is a highly skilled,
963642660Smarkmprofessional art, the subtleties of which are not appreciated until you
963742660Smarkmneed to do it yourself.@refill
963842660Smarkm
963942660Smarkm@xref{Printing Indices & Menus}, for information about printing an index
964042660Smarkmat the end of a book or creating an index menu in an Info file.@refill
964142660Smarkm
9642146515Sru
9643146515Sru@node Predefined Indices
964442660Smarkm@section Predefined Indices
964542660Smarkm
9646146515SruTexinfo provides six predefined indices.  Here are their nominal
9647146515Srumeanings, abbreviations, and the corresponding index entry commands:
964842660Smarkm
9649146515Sru@table @samp
9650146515Sru@item cp
9651146515Sru@cindex @code{cp} (concept) index
9652146515Sru(@code{@@cindex}) concept index, for general concepts.
9653146515Sru@item fn
9654146515Sru@cindex @code{fn} (function) index
9655146515Sru(@code{@@findex}) function index, for function and function-like
9656146515Srunames (such as entry points of libraries).
9657146515Sru@item ky
9658146515Sru@cindex @code{ky} (keystroke) index
9659146515Sru(@code{@@kindex}) keystroke index, for keyboard commands.
9660146515Sru@item pg
9661146515Sru@cindex @code{pg} (program) index
9662146515Sru(@code{@@pindex}) program index, for names of programs.
9663146515Sru@item tp
9664146515Sru@cindex @code{tp} (data type) index
9665146515Sru(@code{@@tindex}) data type index, for type names (such as structures
9666146515Srudefined in header files).
9667146515Sru@item vr
9668146515Sru@cindex @code{vr} (variable) index
9669146515Sru(@code{@@vindex}) variable index, for variable names (such as global
9670146515Sruvariables of libraries).
9671146515Sru@end table
967242660Smarkm
9673146515Sru@noindent
9674146515SruNot every manual needs all of these, and most manuals use only two or
9675146515Sruthree at most.  The present manual, for example, has two indices: a
9676146515Sruconcept index and an @@-command index (that is actually the function
9677146515Sruindex but is called a command index in the chapter heading).
967842660Smarkm
9679146515SruYou are not required to use the predefined indices strictly for their
9680146515Srucanonical purposes.  For example, suppose you wish to index some C
9681146515Srupreprocessor macros.  You could put them in the function index along
9682146515Sruwith actual functions, just by writing @code{@@findex} commands for
9683146515Sruthem; then, when you print the ``Function Index'' as an unnumbered
9684146515Sruchapter, you could give it the title `Function and Macro Index' and
9685146515Sruall will be consistent for the reader.
968642660Smarkm
9687146515SruOn the other hand, it is best not to stray too far from the meaning of
9688146515Sruthe predefined indices.  Otherwise, in the event that your text is
9689146515Srucombined with other text from other manuals, the index entries will
9690146515Srunot match up.  Instead, define your own new index (@pxref{New
9691146515SruIndices}).
969242660Smarkm
9693146515SruWe recommend having a single index in the final document whenever
9694146515Srupossible, however many source indices you use, since then readers have
9695146515Sruonly one place to look.  Two or more source indices can be combined
9696146515Sruinto one output index using the @code{@@synindex} or
9697146515Sru@code{@@syncodeindex} commands (@pxref{Combining Indices}).
969842660Smarkm
969942660Smarkm
9700146515Sru@node Indexing Commands
970142660Smarkm@section Defining the Entries of an Index
970242660Smarkm@cindex Defining indexing entries
970342660Smarkm@cindex Index entries
970442660Smarkm@cindex Entries for an index
970542660Smarkm@cindex Specifying index entries
970642660Smarkm@cindex Creating index entries
970742660Smarkm
970842660SmarkmThe data to make an index come from many individual indexing commands
970942660Smarkmscattered throughout the Texinfo source file.  Each command says to add
971042660Smarkmone entry to a particular index; after formatting, the index will give
971142660Smarkmthe current page number or node name as the reference.@refill
971242660Smarkm
971342660SmarkmAn index entry consists of an indexing command at the beginning of a
971442660Smarkmline followed, on the rest of the line, by the entry.@refill
971542660Smarkm
971642660SmarkmFor example, this section begins with the following five entries for
971742660Smarkmthe concept index:@refill
971842660Smarkm
971942660Smarkm@example
972042660Smarkm@@cindex Defining indexing entries
9721146515Sru@@cindex Index entries, defining
972242660Smarkm@@cindex Entries for an index
972342660Smarkm@@cindex Specifying index entries
972442660Smarkm@@cindex Creating index entries
972542660Smarkm@end example
972642660Smarkm
972742660SmarkmEach predefined index has its own indexing command---@code{@@cindex}
972842660Smarkmfor the concept index, @code{@@findex} for the function index, and so
9729146515Sruon, as listed in the previous section.
973042660Smarkm
973142660Smarkm@cindex Writing index entries
973242660Smarkm@cindex Index entry writing
973342660SmarkmConcept index entries consist of text.  The best way to write an index
973442660Smarkmis to choose entries that are terse yet clear.  If you can do this,
973542660Smarkmthe index often looks better if the entries are not capitalized, but
973642660Smarkmwritten just as they would appear in the middle of a sentence.
973742660Smarkm(Capitalize proper names and acronyms that always call for upper case
973842660Smarkmletters.)  This is the case convention we use in most GNU manuals'
973942660Smarkmindices.
974042660Smarkm
974142660SmarkmIf you don't see how to make an entry terse yet clear, make it longer
974242660Smarkmand clear---not terse and confusing.  If many of the entries are several
974342660Smarkmwords long, the index may look better if you use a different convention:
974442660Smarkmto capitalize the first word of each entry.  But do not capitalize a
974542660Smarkmcase-sensitive name such as a C or Lisp function name or a shell
974642660Smarkmcommand; that would be a spelling error.
974742660Smarkm
974842660SmarkmWhichever case convention you use, please use it consistently!
974942660Smarkm
975042660SmarkmEntries in indices other than the concept index are symbol names in
975142660Smarkmprogramming languages, or program names; these names are usually
975242660Smarkmcase-sensitive, so use upper and lower case as required for them.
975342660Smarkm
9754146515Sru@cindex Index font types
975542660SmarkmBy default, entries for a concept index are printed in a small roman
975642660Smarkmfont and entries for the other indices are printed in a small
975742660Smarkm@code{@@code} font.  You may change the way part of an entry is
975842660Smarkmprinted with the usual Texinfo commands, such as @code{@@file} for
9759146515Srufile names (@pxref{Marking Text}), and @code{@@r} for the normal roman
9760146515Srufont (@pxref{Fonts}).
976142660Smarkm
9762146515Sru@quotation Caution
9763146515SruDo not use a colon in an index entry.  In Info, a colon separates the
9764146515Srumenu entry name from the node name, so a colon in the entry itself
9765146515Sruconfuses Info.  @xref{Menu Parts}, for more information about the
9766146515Srustructure of a menu entry.
976742660Smarkm@end quotation
976842660Smarkm
976942660Smarkm
9770146515Sru@node Combining Indices
977142660Smarkm@section Combining Indices
977242660Smarkm@cindex Combining indices
977342660Smarkm@cindex Indices, combining them
977442660Smarkm
9775146515SruSometimes you will want to combine two disparate indices such as
9776146515Srufunctions and concepts, perhaps because you have few enough entries
9777146515Sruthat a separate index would look silly.
977842660Smarkm
977942660SmarkmYou could put functions into the concept index by writing
978042660Smarkm@code{@@cindex} commands for them instead of @code{@@findex} commands,
978142660Smarkmand produce a consistent manual by printing the concept index with the
978242660Smarkmtitle `Function and Concept Index' and not printing the `Function
978342660SmarkmIndex' at all; but this is not a robust procedure.  It works only if
9784146515Sruyour document is never included as part of another document that is
9785146515Srudesigned to have a separate function index; if your document were to
9786146515Srube included with such a document, the functions from your document and
9787146515Sruthose from the other would not end up together.  Also, to make your
9788146515Srufunction names appear in the right font in the concept index, you
9789146515Sruwould need to enclose every one of them between the braces of
9790146515Sru@code{@@code}.
979142660Smarkm
979242660Smarkm@menu
979342660Smarkm* syncodeindex::                How to merge two indices, using @code{@@code}
9794114472Sru                                 font for the merged-from index.
979542660Smarkm* synindex::                    How to merge two indices, using the
9796114472Sru                                 default font of the merged-to index.
979742660Smarkm@end menu
979842660Smarkm
9799100513Sru@node syncodeindex
980042660Smarkm@subsection @code{@@syncodeindex}
980142660Smarkm@findex syncodeindex
980242660Smarkm
980342660SmarkmWhen you want to combine functions and concepts into one index, you
980442660Smarkmshould index the functions with @code{@@findex} and index the concepts
980542660Smarkmwith @code{@@cindex}, and use the @code{@@syncodeindex} command to
980642660Smarkmredirect the function index entries into the concept index.@refill
980742660Smarkm
980842660SmarkmThe @code{@@syncodeindex} command takes two arguments; they are the name
980942660Smarkmof the index to redirect, and the name of the index to redirect it to.
981042660SmarkmThe template looks like this:@refill
981142660Smarkm
981242660Smarkm@example
981342660Smarkm@@syncodeindex @var{from} @var{to}
981442660Smarkm@end example
981542660Smarkm
981642660Smarkm@cindex Predefined names for indices
981742660Smarkm@cindex Two letter names for indices
981842660Smarkm@cindex Indices, two letter names
981942660Smarkm@cindex Names for indices
982042660SmarkmFor this purpose, the indices are given two-letter names:@refill
982142660Smarkm
982242660Smarkm@table @samp
982342660Smarkm@item cp
982442660Smarkmconcept index
982542660Smarkm@item fn
982642660Smarkmfunction index
982742660Smarkm@item vr
982842660Smarkmvariable index
982942660Smarkm@item ky
983042660Smarkmkey index
983142660Smarkm@item pg
983242660Smarkmprogram index
983342660Smarkm@item tp
983442660Smarkmdata type index
983542660Smarkm@end table
983642660Smarkm
983742660SmarkmWrite an @code{@@syncodeindex} command before or shortly after the
983842660Smarkmend-of-header line at the beginning of a Texinfo file.  For example,
983942660Smarkmto merge a function index with a concept index, write the
984042660Smarkmfollowing:@refill
984142660Smarkm
984242660Smarkm@example
984342660Smarkm@@syncodeindex fn cp
984442660Smarkm@end example
984542660Smarkm
984642660Smarkm@noindent
984742660SmarkmThis will cause all entries designated for the function index to merge
984842660Smarkmin with the concept index instead.@refill
984942660Smarkm
985042660SmarkmTo merge both a variables index and a function index into a concept
985142660Smarkmindex, write the following:@refill
985242660Smarkm
985342660Smarkm@example
985442660Smarkm@group
985542660Smarkm@@syncodeindex vr cp
985642660Smarkm@@syncodeindex fn cp
985742660Smarkm@end group
985842660Smarkm@end example
985942660Smarkm
986042660Smarkm@cindex Fonts for indices
986142660SmarkmThe @code{@@syncodeindex} command puts all the entries from the `from'
986242660Smarkmindex (the redirected index) into the @code{@@code} font, overriding
986342660Smarkmwhatever default font is used by the index to which the entries are
986442660Smarkmnow directed.  This way, if you direct function names from a function
986542660Smarkmindex into a concept index, all the function names are printed in the
986642660Smarkm@code{@@code} font as you would expect.@refill
986742660Smarkm
9868146515Sru@node synindex
986942660Smarkm@subsection @code{@@synindex}
987042660Smarkm@findex synindex
987142660Smarkm
987242660SmarkmThe @code{@@synindex} command is nearly the same as the
987342660Smarkm@code{@@syncodeindex} command, except that it does not put the
987442660Smarkm`from' index  entries into the @code{@@code} font; rather it puts
987542660Smarkmthem in the roman font.  Thus, you use @code{@@synindex} when you
987642660Smarkmmerge a concept index into a function index.@refill
987742660Smarkm
987842660Smarkm@xref{Printing Indices & Menus}, for information about printing an index
987942660Smarkmat the end of a book or creating an index menu in an Info file.@refill
988042660Smarkm
9881146515Sru
9882146515Sru@node New Indices
988342660Smarkm@section Defining New Indices
988442660Smarkm@cindex Defining new indices
988542660Smarkm@cindex Indices, defining new
988642660Smarkm@cindex New index defining
988742660Smarkm@findex defindex
988842660Smarkm@findex defcodeindex
988942660Smarkm
989042660SmarkmIn addition to the predefined indices, you may use the
989142660Smarkm@code{@@defindex} and @code{@@defcodeindex} commands to define new
989242660Smarkmindices.  These commands create new indexing @@-commands with which
9893146515Sruyou mark index entries.  The @code{@@defindex} command is used like
9894146515Sruthis:
989542660Smarkm
989642660Smarkm@example
989742660Smarkm@@defindex @var{name}
989842660Smarkm@end example
989942660Smarkm
990042660SmarkmThe name of an index should be a two letter word, such as @samp{au}.
9901146515SruFor example:
990242660Smarkm
990342660Smarkm@example
990442660Smarkm@@defindex au
990542660Smarkm@end example
990642660Smarkm
990742660SmarkmThis defines a new index, called the @samp{au} index.  At the same
990842660Smarkmtime, it creates a new indexing command, @code{@@auindex}, that you
9909146515Srucan use to make index entries.  Use this new indexing command just as
9910146515Sruyou would use a predefined indexing command.
991142660Smarkm
991242660SmarkmFor example, here is a section heading followed by a concept index
9913146515Sruentry and two @samp{au} index entries.
991442660Smarkm
991542660Smarkm@example
991642660Smarkm@@section Cognitive Semantics
991742660Smarkm@@cindex kinesthetic image schemas
991842660Smarkm@@auindex Johnson, Mark
991942660Smarkm@@auindex Lakoff, George
992042660Smarkm@end example
992142660Smarkm
992242660Smarkm@noindent
992342660Smarkm(Evidently, @samp{au} serves here as an abbreviation for ``author''.)
992442660Smarkm
9925146515SruIn general, Texinfo constructs the new indexing command by
9926146515Sruconcatenating the name of the index with @samp{index}; thus, defining
9927146515Sruan @samp{xy} index leads to the automatic creation of an
9928146515Sru@code{@@xyindex} command.
9929146515Sru
993042660SmarkmUse the @code{@@printindex} command to print the index, as you do with
9931146515Sruthe predefined indices.  For example:
993242660Smarkm
993342660Smarkm@example
993442660Smarkm@group
9935146515Sru@@node Author Index
993642660Smarkm@@unnumbered Author Index
993742660Smarkm
993842660Smarkm@@printindex au
993942660Smarkm@end group
994042660Smarkm@end example
994142660Smarkm
9942146515SruThe @code{@@defcodeindex} is like the @code{@@defindex} command,
9943146515Sruexcept that, in the printed output, it prints entries in an
9944146515Sru@code{@@code} font by default instead of a roman font.  
994542660Smarkm
9946146515SruYou should define new indices before the end-of-header line of a
9947146515SruTexinfo file, and (of course) before any @code{@@synindex} or
9948100513Sru@code{@@syncodeindex} commands (@pxref{Texinfo File Header}).
994942660Smarkm
9950100513Sru
995156160Sru@node Insertions
995242660Smarkm@chapter Special Insertions
995342660Smarkm@cindex Inserting special characters and symbols
995442660Smarkm@cindex Special insertions
995542660Smarkm
995642660SmarkmTexinfo provides several commands for inserting characters that have
995742660Smarkmspecial meaning in Texinfo, such as braces, and for other graphic
995842660Smarkmelements that do not correspond to simple characters you can type.
995942660Smarkm
996042660Smarkm@iftex
996142660SmarkmThese are:
996242660Smarkm
996342660Smarkm@itemize @bullet
9964146515Sru@item @samp{@@} and braces and commas.
996542660Smarkm@item Whitespace within and around a sentence.
996642660Smarkm@item Accents.
996742660Smarkm@item Dots and bullets.
996842660Smarkm@item The @TeX{} logo and the copyright symbol.
996956160Sru@item The pounds currency symbol.
997056160Sru@item The minus sign.
997142660Smarkm@item Mathematical expressions.
997256160Sru@item Glyphs for evaluation, macros, errors, etc.
997356160Sru@item Footnotes.
997456160Sru@item Images.
997542660Smarkm@end itemize
997642660Smarkm@end iftex
997742660Smarkm
997842660Smarkm@menu
9979146515Sru* Atsign Braces Comma::         Inserting @@ and @{@} and ,.
998042660Smarkm* Inserting Space::             How to insert the right amount of space
9981114472Sru                                 within a sentence.
998242660Smarkm* Inserting Accents::           How to insert accents and special characters.
998342660Smarkm* Dots Bullets::                How to insert dots and bullets.
998442660Smarkm* TeX and copyright::           How to insert the @TeX{} logo
9985114472Sru                                 and the copyright symbol.
9986146515Sru* euro::                        How to insert the Euro currency symbol.
998742660Smarkm* pounds::                      How to insert the pounds currency symbol.
998842660Smarkm* minus::                       How to insert a minus sign.
998942660Smarkm* math::                        How to format a mathematical expression.
999042660Smarkm* Glyphs::                      How to indicate results of evaluation,
9991114472Sru                                 expansion of macros, errors, etc.
999242660Smarkm@end menu
999342660Smarkm
999442660Smarkm
9995146515Sru@node Atsign Braces Comma
9996146515Sru@section Inserting @@ and @{@} and @comma{}
9997146515Sru@cindex Special characters, inserting
999842660Smarkm@cindex Commands to insert special characters
999942660Smarkm
1000042660Smarkm@samp{@@} and curly braces are special characters in Texinfo.  To insert
1000142660Smarkmthese characters so they appear in text, you must put an @samp{@@} in
1000242660Smarkmfront of these characters to prevent Texinfo from misinterpreting
1000342660Smarkmthem.
1000442660Smarkm
10005146515SruThe comma `,' is a special character only in one uncommon context:
10006146515Sruit separates arguments to commands that take multiple arguments.
1000742660Smarkm
1000842660Smarkm@menu
10009146515Sru* Inserting an Atsign::
10010146515Sru* Inserting Braces::
10011146515Sru* Inserting a Comma::
1001242660Smarkm@end menu
1001342660Smarkm
10014146515Sru
10015146515Sru@node Inserting an Atsign
10016146515Sru@subsection Inserting `@@' with @code{@@@@}
10017100513Sru@findex @@ @r{(literal @samp{@@})}
10018146515Sru@cindex Inserting @@ @r{(literal @samp{@@})}
1001942660Smarkm
1002042660Smarkm@code{@@@@} stands for a single @samp{@@} in either printed or Info
1002142660Smarkmoutput.
1002242660Smarkm
1002342660SmarkmDo not put braces after an @code{@@@@} command.
1002442660Smarkm
1002556160Sru
1002656160Sru@node Inserting Braces
10027146515Sru@subsection Inserting `@{' and `@}' with @code{@@@{} and @code{@@@}}
10028146515Sru@cindex Braces, inserting
10029100513Sru@findex @{ @r{(literal @samp{@{})}
10030100513Sru@findex @} @r{(literal @samp{@}})}
1003142660Smarkm
1003242660Smarkm@code{@@@{} stands for a single @samp{@{} in either printed or Info
1003342660Smarkmoutput.
1003442660Smarkm
1003542660Smarkm@code{@@@}} stands for a single @samp{@}} in either printed or Info
1003642660Smarkmoutput.
1003742660Smarkm
1003842660SmarkmDo not put braces after either an @code{@@@{} or an @code{@@@}}
10039146515Srucommand.ppp
1004042660Smarkm
1004142660Smarkm
10042146515Sru@node Inserting a Comma
10043146515Sru@subsection Inserting `,' with @code{@@comma@{@}}
10044146515Sru@cindex Commas, inserting
10045146515Sru@findex comma
10046146515Sru
10047146515SruOrdinarily, a comma `,' is a normal character that can be simply typed
10048146515Sruin your input where you need it.
10049146515Sru
10050146515SruHowever, Texinfo uses the comma as a special character in one uncommon
10051146515Srucontext: some commands, such as @code{@@acronym} (@pxref{acronym}) and
10052146515Sru@code{@@xref} (@pxref{Cross References}), as well as user-defined
10053146515Srumacros (@pxref{Defining Macros}), can take more than one argument.  In
10054146515Sruthese cases, the comma character is used to separate arguments.
10055146515Sru
10056146515SruSince a comma chacter would confuse Texinfo's parsing for these
10057146515Srucommands, you must use the command @samp{@comma{}} instead if you want
10058146515Sruto have an actual comma in the output.  Here are some examples:
10059146515Sru
10060146515Sru@example
10061146515Sru@@acronym@{ABC, A Bizarre @@comma@{@}@}
10062146515Sru@@xref@{Comma,, The @@comma@{@} symbol@}
10063146515Sru@@mymac@{One argument@@comma@{@} containing a comma@}
10064146515Sru@end example
10065146515Sru
10066146515SruAlthough @comma{} can be used anywhere, there is no need for it
10067146515Sruanywhere except in this unusual case.
10068146515Sru
10069146515Sru
1007056160Sru@node Inserting Space
1007142660Smarkm@section Inserting Space
1007242660Smarkm
1007342660Smarkm@cindex Inserting space
1007442660Smarkm@cindex Spacing, inserting
1007542660SmarkmThe following sections describe commands that control spacing of various
1007642660Smarkmkinds within and after sentences.
1007742660Smarkm
1007842660Smarkm@menu
1007942660Smarkm* Not Ending a Sentence::       Sometimes a . doesn't end a sentence.
1008042660Smarkm* Ending a Sentence::           Sometimes it does.
1008142660Smarkm* Multiple Spaces::             Inserting multiple spaces.
1008242660Smarkm* dmn::                         How to format a dimension.
1008342660Smarkm@end menu
1008442660Smarkm
1008556160Sru
1008656160Sru@node Not Ending a Sentence
1008742660Smarkm@subsection Not Ending a Sentence
1008842660Smarkm
1008942660Smarkm@cindex Not ending a sentence
1009042660Smarkm@cindex Sentence non-ending punctuation
1009142660Smarkm@cindex Periods, inserting
1009242660SmarkmDepending on whether a period or exclamation point or question mark is
1009342660Smarkminside or at the end of a sentence, less or more space is inserted after
1009456160Srua period in a typeset manual.  Since it is not always possible
1009556160Sruto determine when a period ends a sentence and when it is used
1009642660Smarkmin an abbreviation, special commands are needed in some circumstances.
1009756160SruUsually, Texinfo can guess how to handle periods, so you do not need to
1009842660Smarkmuse the special commands; you just enter a period as you would if you
1009942660Smarkmwere using a typewriter, which means you put two spaces after the
1010056160Sruperiod, question mark, or exclamation mark that ends a sentence.
1010142660Smarkm
10102146515Sru@findex <colon> @r{(suppress end-of-sentence space)}
1010342660SmarkmUse the @code{@@:}@: command after a period, question mark,
1010442660Smarkmexclamation mark, or colon that should not be followed by extra space.
1010542660SmarkmFor example, use @code{@@:}@: after periods that end abbreviations
1010642660Smarkmwhich are not at the ends of sentences.
1010742660Smarkm
1010842660SmarkmFor example,
1010942660Smarkm
1011042660Smarkm@example
1011142660SmarkmThe s.o.p.@@: has three parts @dots{}
1011242660SmarkmThe s.o.p. has three parts @dots{}
1011342660Smarkm@end example
1011442660Smarkm
1011542660Smarkm@noindent
10116146515Sru@ifnottex
1011742660Smarkmproduces
10118146515Sru@end ifnottex
1011942660Smarkm@iftex
1012042660Smarkmproduces the following.  If you look carefully at this printed output,
10121146515Sruyou will see a little extraneous space after @samp{s.o.p.} in the second
10122146515Sruline.
1012342660Smarkm@end iftex
1012442660Smarkm
1012542660Smarkm@quotation
1012642660SmarkmThe s.o.p.@: has three parts @dots{}@*
1012742660SmarkmThe s.o.p. has three parts @dots{}
1012842660Smarkm@end quotation
1012942660Smarkm
1013042660Smarkm@noindent
1013142660Smarkm(Incidentally, @samp{s.o.p.} is an abbreviation for ``Standard Operating
1013242660SmarkmProcedure''.)
1013342660Smarkm
10134146515Sru@code{@@:} has no effect on the Info and HTML output.  In Docbook and
10135146515SruXML, the previous punctuation character (.?!:) is output as an entity
10136146515Sruinstead of as the normal character: @samp{&period; &quest; &excl;
10137146515Sru&colon;}.  This gives further processors a chance to notice and not
10138146515Sruadd the usual extra space.
1013942660Smarkm
10140146515SruDo not put braces after @code{@@:} (or any non-alphabetic command).
1014142660Smarkm
10142146515Sru
10143146515Sru@node Ending a Sentence
1014442660Smarkm@subsection Ending a Sentence
1014542660Smarkm
1014642660Smarkm@cindex Ending a Sentence
1014742660Smarkm@cindex Sentence ending punctuation
1014842660Smarkm
1014942660Smarkm@findex .  @r{(end of sentence)}
1015042660Smarkm@findex ! @r{(end of sentence)}
1015142660Smarkm@findex ? @r{(end of sentence)}
1015242660SmarkmUse @code{@@.}@: instead of a period, @code{@@!}@: instead of an
1015342660Smarkmexclamation point, and @code{@@?}@: instead of a question mark at the end
10154146515Sruof a sentence that ends with a capital letter.  Otherwise, @TeX{}
1015542660Smarkmwill think the letter is an abbreviation and will not insert the correct
1015642660Smarkmend-of-sentence spacing.  Here is an example:
1015742660Smarkm
1015842660Smarkm@example
1015942660SmarkmGive it to M.I.B. and to M.E.W@@.  Also, give it to R.J.C@@.
1016042660SmarkmGive it to M.I.B. and to M.E.W.  Also, give it to R.J.C.
1016142660Smarkm@end example
1016242660Smarkm
1016342660Smarkm@noindent
10164146515Sru@ifnottex
1016542660Smarkmproduces
10166146515Sru@end ifnottex
1016742660Smarkm@iftex
1016842660Smarkmproduces the following.  If you look carefully at this printed output,
1016942660Smarkmyou will see a little more whitespace after the @samp{W} in the first
1017042660Smarkmline.
1017142660Smarkm@end iftex
1017242660Smarkm
1017342660Smarkm@quotation
1017442660SmarkmGive it to M.I.B. and to M.E.W@.  Also, give it to R.J.C@.@*
1017542660SmarkmGive it to M.I.B. and to M.E.W.  Also, give it to R.J.C.
1017642660Smarkm@end quotation
1017742660Smarkm
1017842660SmarkmIn the Info file output, @code{@@.}@: is equivalent to a simple
1017942660Smarkm@samp{.}; likewise for @code{@@!}@: and @code{@@?}@:.
1018042660Smarkm
1018142660SmarkmThe meanings of @code{@@:} and @code{@@.}@: in Texinfo are designed to
1018242660Smarkmwork well with the Emacs sentence motion commands (@pxref{Sentences,,,
1018356160Sruemacs, The GNU Emacs Manual}).
1018442660Smarkm
1018542660SmarkmDo not put braces after any of these commands.
1018642660Smarkm
1018742660Smarkm
10188114472Sru@node Multiple Spaces
1018942660Smarkm@subsection Multiple Spaces
1019042660Smarkm
1019142660Smarkm@cindex Multiple spaces
1019242660Smarkm@cindex Whitespace, inserting
1019356160Sru@cindex Space, inserting horizontal
10194146515Sru@findex <space>
10195146515Sru@findex <tab>
10196146515Sru@findex <newline>
1019742660Smarkm
1019842660SmarkmOrdinarily, @TeX{} collapses multiple whitespace characters (space, tab,
1019942660Smarkmand newline) into a single space.  Info output, on the other hand,
1020042660Smarkmpreserves whitespace as you type it, except for changing a newline into
1020142660Smarkma space; this is why it is important to put two spaces at the end of
1020242660Smarkmsentences in Texinfo documents.
1020342660Smarkm
1020442660SmarkmOccasionally, you may want to actually insert several consecutive
1020542660Smarkmspaces, either for purposes of example (what your program does with
1020642660Smarkmmultiple spaces as input), or merely for purposes of appearance in
1020742660Smarkmheadings or lists.  Texinfo supports three commands:
1020842660Smarkm@code{@@@kbd{SPACE}}, @code{@@@kbd{TAB}}, and @code{@@@kbd{NL}}, all of
1020942660Smarkmwhich insert a single space into the output.  (Here,
1021042660Smarkm@code{@@@kbd{SPACE}} represents an @samp{@@} character followed by a
1021142660Smarkmspace, i.e., @samp{@@ }, and @kbd{TAB} and @kbd{NL} represent the tab
1021242660Smarkmcharacter and end-of-line, i.e., when @samp{@@} is the last character on
1021342660Smarkma line.)
1021442660Smarkm
1021542660SmarkmFor example,
1021642660Smarkm@example
1021742660SmarkmSpacey@@ @@ @@ @@
1021842660Smarkmexample.
1021942660Smarkm@end example
1022042660Smarkm
1022142660Smarkm@noindent produces
1022242660Smarkm
1022342660Smarkm@example
1022442660SmarkmSpacey@ @ @ @
1022542660Smarkmexample.
1022642660Smarkm@end example
1022742660Smarkm
1022842660SmarkmOther possible uses of @code{@@@kbd{SPACE}} have been subsumed by
1022942660Smarkm@code{@@multitable} (@pxref{Multi-column Tables}).
1023042660Smarkm
1023142660SmarkmDo not follow any of these commands with braces.
1023242660Smarkm
10233114472SruTo produce a non-breakable space, see @ref{tie, @code{@@tie}}.
1023442660Smarkm
1023593139Sru
1023656160Sru@node dmn
1023742660Smarkm@subsection @code{@@dmn}@{@var{dimension}@}: Format a Dimension
1023842660Smarkm@cindex Thin space between number, dimension
1023942660Smarkm@cindex Dimension formatting
1024042660Smarkm@cindex Format a dimension
1024142660Smarkm@findex dmn
1024242660Smarkm
1024342660SmarkmAt times, you may want to write @samp{12@dmn{pt}} or
1024442660Smarkm@samp{8.5@dmn{in}} with little or no space between the number and the
1024542660Smarkmabbreviation for the dimension.  You can use the @code{@@dmn} command
1024642660Smarkmto do this.  On seeing the command, @TeX{} inserts just enough space
1024742660Smarkmfor proper typesetting; the Info formatting commands insert no space
1024856160Sruat all, since the Info file does not require it.
1024942660Smarkm
1025042660SmarkmTo use the @code{@@dmn} command, write the number and then follow it
1025142660Smarkmimmediately, with no intervening space, by @code{@@dmn}, and then by
1025242660Smarkmthe dimension within braces.  For example,
1025342660Smarkm
1025442660Smarkm@example
1025542660SmarkmA4 paper is 8.27@@dmn@{in@} wide.
1025642660Smarkm@end example
1025742660Smarkm
1025842660Smarkm@noindent
1025942660Smarkmproduces
1026042660Smarkm
1026142660Smarkm@quotation
1026242660SmarkmA4 paper is 8.27@dmn{in} wide.
1026342660Smarkm@end quotation
1026442660Smarkm
1026542660SmarkmNot everyone uses this style.  Some people prefer @w{@samp{8.27 in.@@:}}
1026642660Smarkmor @w{@samp{8.27 inches}} to @samp{8.27@@dmn@{in@}} in the Texinfo file.
1026742660SmarkmIn these cases, however, the formatters may insert a line break between
1026842660Smarkmthe number and the dimension, so use @code{@@w} (@pxref{w}).  Also, if
1026942660Smarkmyou write a period after an abbreviation within a sentence, you should
1027042660Smarkmwrite @samp{@@:} after the period to prevent @TeX{} from inserting extra
1027156160Sruwhitespace, as shown here.  @xref{Not Ending a Sentence}.
1027242660Smarkm
1027342660Smarkm
1027456160Sru@node Inserting Accents
1027542660Smarkm@section Inserting Accents
1027642660Smarkm
1027742660Smarkm@cindex Inserting accents
1027842660Smarkm@cindex Accents, inserting
1027942660Smarkm@cindex Floating accents, inserting
1028042660Smarkm
1028142660SmarkmHere is a table with the commands Texinfo provides for inserting
1028242660Smarkmfloating accents.  The commands with non-alphabetic names do not take
1028342660Smarkmbraces around their argument (which is taken to be the next character).
1028442660Smarkm(Exception: @code{@@,} @emph{does} take braces around its argument.)
1028542660SmarkmThis is so as to make the source as convenient to type and read as
1028642660Smarkmpossible, since accented characters are very common in some languages.
1028742660Smarkm
10288116525SruTo get the true accented characters output in Info, and not just the
10289116525SruASCII transliterations, you can use the @option{--enable-encoding}
10290116525Sruoption to @command{makeinfo} (@pxref{makeinfo options}).
10291116525Sru
10292100513Sru@findex " @r{(umlaut accent)}
1029342660Smarkm@cindex Umlaut accent
10294100513Sru@findex ' @r{(umlaut accent)}
1029542660Smarkm@cindex Acute accent
10296100513Sru@findex = @r{(macron accent)}
1029742660Smarkm@cindex Macron accent
10298100513Sru@findex ^ @r{(circumflex accent)}
1029942660Smarkm@cindex Circumflex accent
10300100513Sru@findex ` @r{(grave accent)}
1030142660Smarkm@cindex Grave accent
10302100513Sru@findex ~ @r{(tilde accent)}
1030342660Smarkm@cindex Tilde accent
10304100513Sru@findex , @r{(cedilla accent)}
1030542660Smarkm@cindex Cedilla accent
1030642660Smarkm@findex dotaccent
1030742660Smarkm@cindex Dot accent
10308100513Sru@findex H @r{(Hungarian umlaut accent)}
1030956160Sru@cindex Hungarian umlaut accent
1031042660Smarkm@findex ringaccent
1031142660Smarkm@cindex Ring accent
1031242660Smarkm@findex tieaccent
1031342660Smarkm@cindex Tie-after accent
10314100513Sru@findex u @r{(breve accent)}
1031542660Smarkm@cindex Breve accent
1031642660Smarkm@findex ubaraccent
1031742660Smarkm@cindex Underbar accent
1031842660Smarkm@findex udotaccent
1031942660Smarkm@cindex Underdot accent
10320100513Sru@findex v @r{(check accent)}
10321146515Sru@cindex Hacek accent
1032242660Smarkm@cindex Check accent
10323146515Sru@cindex Caron accent
10324146515Sru@multitable {@@questiondown@{@}} {Output} {hacek/check/caron accent}
1032542660Smarkm@item Command               @tab Output         @tab What
1032642660Smarkm@item @t{@@"o}              @tab @"o            @tab umlaut accent
1032742660Smarkm@item @t{@@'o}              @tab @'o            @tab acute accent
1032842660Smarkm@item @t{@@,@{c@}}          @tab @,{c}          @tab cedilla accent
1032942660Smarkm@item @t{@@=o}              @tab @=o            @tab macron/overbar accent
1033042660Smarkm@item @t{@@^o}              @tab @^o            @tab circumflex accent
1033142660Smarkm@item @t{@@`o}              @tab @`o            @tab grave accent
1033242660Smarkm@item @t{@@~o}              @tab @~o            @tab tilde accent
1033342660Smarkm@item @t{@@dotaccent@{o@}}  @tab @dotaccent{o}  @tab overdot accent
1033442660Smarkm@item @t{@@H@{o@}}          @tab @H{o}          @tab long Hungarian umlaut
1033542660Smarkm@item @t{@@ringaccent@{o@}} @tab @ringaccent{o} @tab ring accent
1033642660Smarkm@item @t{@@tieaccent@{oo@}} @tab @tieaccent{oo} @tab tie-after accent
1033742660Smarkm@item @t{@@u@{o@}}          @tab @u{o}          @tab breve accent
1033842660Smarkm@item @t{@@ubaraccent@{o@}} @tab @ubaraccent{o} @tab underbar accent
1033942660Smarkm@item @t{@@udotaccent@{o@}} @tab @udotaccent{o} @tab underdot accent
10340146515Sru@item @t{@@v@{o@}}          @tab @v{o}          @tab hacek/check/caron accent
1034142660Smarkm@end multitable
1034242660Smarkm
1034342660SmarkmThis table lists the Texinfo commands for inserting other characters
1034442660Smarkmcommonly used in languages other than English.
1034542660Smarkm
1034642660Smarkm@findex questiondown
1034742660Smarkm@cindex @questiondown{}
1034842660Smarkm@findex exclamdown
1034942660Smarkm@cindex @exclamdown{}
1035042660Smarkm@findex aa
1035142660Smarkm@cindex @aa{}
1035242660Smarkm@findex AA
1035342660Smarkm@cindex @AA{}
1035442660Smarkm@findex ae
1035542660Smarkm@cindex @ae{}
1035642660Smarkm@findex AE
1035742660Smarkm@cindex @AE{}
1035842660Smarkm@findex dotless
10359146515Sru@cindex @dotless{i} (dotless i)
10360146515Sru@cindex @dotless{j} (dotless j)
1036142660Smarkm@cindex Dotless i, j
1036242660Smarkm@findex l
1036342660Smarkm@cindex @l{}
1036442660Smarkm@findex L
1036542660Smarkm@cindex @L{}
1036642660Smarkm@findex o
1036742660Smarkm@cindex @o{}
1036842660Smarkm@findex O
1036942660Smarkm@cindex @O{}
1037042660Smarkm@findex oe
1037142660Smarkm@cindex @oe{}
1037242660Smarkm@findex OE
1037342660Smarkm@cindex @OE{}
10374146515Sru@cindex Romance ordinals
10375146515Sru@cindex Ordinals, Romance
10376146515Sru@cindex Feminine ordinal
10377146515Sru@findex ordf
10378146515Sru@cindex @ordf{}
10379146515Sru@cindex Masculine ordinal
10380146515Sru@findex ordm
10381146515Sru@cindex @ordm{}
1038242660Smarkm@findex ss
1038342660Smarkm@cindex @ss{}
1038442660Smarkm@cindex Es-zet
1038542660Smarkm@cindex Sharp S
1038642660Smarkm@cindex German S
10387146515Sru@multitable {x@@questiondown@{@}} {oe OE} {es-zet or sharp S}
1038842660Smarkm@item @t{@@exclamdown@{@}}   @tab @exclamdown{}   @tab upside-down !
1038942660Smarkm@item @t{@@questiondown@{@}} @tab @questiondown{} @tab upside-down ?
10390146515Sru@item @t{@@aa@{@} @@AA@{@}}  @tab @aa{} @AA{}     @tab a,A with circle
10391146515Sru@item @t{@@ae@{@} @@AE@{@}}  @tab @ae{} @AE{}     @tab ae,AE ligatures
1039242660Smarkm@item @t{@@dotless@{i@}}     @tab @dotless{i}     @tab dotless i
1039342660Smarkm@item @t{@@dotless@{j@}}     @tab @dotless{j}     @tab dotless j
10394146515Sru@item @t{@@l@{@} @@L@{@}}    @tab @l{} @L{}       @tab suppressed-L,l
10395146515Sru@item @t{@@o@{@} @@O@{@}}    @tab @o{} @O{}       @tab O,o with slash
10396146515Sru@item @t{@@oe@{@} @@OE@{@}}  @tab @oe{} @OE{}     @tab oe,OE ligatures
10397146515Sru@item @t{@@ordf@{@} @@ordm@{@}}  @tab @ordf{} @ordm{}     @tab Spanish ordinals
1039842660Smarkm@item @t{@@ss@{@}}           @tab @ss{}           @tab es-zet or sharp S
1039942660Smarkm@end multitable
1040042660Smarkm
1040142660Smarkm
1040256160Sru@node Dots Bullets
1040356160Sru@section Inserting Ellipsis and Bullets
1040442660Smarkm@cindex Dots, inserting
1040542660Smarkm@cindex Bullets, inserting
1040642660Smarkm@cindex Ellipsis, inserting
1040742660Smarkm@cindex Inserting ellipsis
1040842660Smarkm@cindex Inserting dots
1040942660Smarkm@cindex Special typesetting commands
1041042660Smarkm@cindex Typesetting commands for dots, etc.
1041142660Smarkm
1041242660SmarkmAn @dfn{ellipsis} (a line of dots) is not typeset as a string of
1041342660Smarkmperiods, so a special command is used for ellipsis in Texinfo.  The
1041442660Smarkm@code{@@bullet} command is special, too.  Each of these commands is
1041542660Smarkmfollowed by a pair of braces, @samp{@{@}}, without any whitespace
1041642660Smarkmbetween the name of the command and the braces.  (You need to use braces
1041742660Smarkmwith these commands because you can use them next to other text; without
1041842660Smarkmthe braces, the formatters would be confused.  @xref{Command Syntax, ,
1041942660Smarkm@@-Command Syntax}, for further information.)@refill
1042042660Smarkm
1042142660Smarkm@menu
1042242660Smarkm* dots::                        How to insert dots @dots{}
1042342660Smarkm* bullet::                      How to insert a bullet.
1042442660Smarkm@end menu
1042542660Smarkm
1042642660Smarkm
1042756160Sru@node dots
1042856160Sru@subsection @code{@@dots}@{@} (@dots{}) and @code{@@enddots}@{@} (@enddots{})
1042942660Smarkm@findex dots
1043056160Sru@findex enddots
1043142660Smarkm@cindex Inserting dots
1043242660Smarkm@cindex Dots, inserting
1043342660Smarkm
1043442660SmarkmUse the @code{@@dots@{@}} command to generate an ellipsis, which is
10435146515Sruthree dots in a row, appropriately spaced @dots{} like so.  Do
1043642660Smarkmnot simply write three periods in the input file; that would work for
1043742660Smarkmthe Info file output, but would produce the wrong amount of space
1043842660Smarkmbetween the periods in the printed manual.
1043942660Smarkm
1044042660SmarkmSimilarly, the @code{@@enddots@{@}} command generates an
10441146515Sruend-of-sentence ellipsis, which has different spacing afterwards,
10442146515Sru@enddots{}  Look closely to see the difference.
1044342660Smarkm
1044442660Smarkm@iftex
1044542660SmarkmHere is an ellipsis: @dots{}
1044642660SmarkmHere are three periods in a row: ...
1044742660Smarkm
1044842660SmarkmIn printed output, the three periods in a row are closer together than
1044942660Smarkmthe dots in the ellipsis.
1045042660Smarkm@end iftex
1045142660Smarkm
1045242660Smarkm
1045356160Sru@node bullet
1045442660Smarkm@subsection @code{@@bullet}@{@} (@bullet{})
1045542660Smarkm@findex bullet
1045642660Smarkm
1045742660SmarkmUse the @code{@@bullet@{@}} command to generate a large round dot, or
1045842660Smarkmthe closest possible thing to one.  In Info, an asterisk is used.@refill
1045942660Smarkm
1046042660SmarkmHere is a bullet: @bullet{}
1046142660Smarkm
1046242660SmarkmWhen you use @code{@@bullet} in @code{@@itemize}, you do not need to
1046342660Smarkmtype the braces, because @code{@@itemize} supplies them.
1046442660Smarkm(@xref{itemize, , @code{@@itemize}}.)@refill
1046542660Smarkm
1046642660Smarkm
10467146515Sru@node TeX and copyright
10468146515Sru@section Inserting @TeX{} and Legal Symbols: @copyright{}, @registeredsymbol{}
1046942660Smarkm
1047042660SmarkmThe logo `@TeX{}' is typeset in a special fashion and it needs an
10471146515Sru@@-command.  The copyright and registered symbols, `@copyright{}' and
10472146515Sru`@registeredsymbol{}', is also special.  Each of these commands is
10473146515Srufollowed by a pair of braces, @samp{@{@}}, without any whitespace
10474146515Srubetween the name of the command and the braces.
1047542660Smarkm
1047642660Smarkm@menu
10477146515Sru* tex::                         The @TeX{} logos.
10478146515Sru* copyright symbol::            The copyright symbol (c in a circle).
10479146515Sru* registered symbol::           The registered symbol (R in a circle).
1048042660Smarkm@end menu
1048142660Smarkm
1048242660Smarkm
1048356160Sru@node tex
10484146515Sru@subsection @code{@@TeX}@{@} (@TeX{}) and @code{@@LaTeX}@{@} (@LaTeX{})
10485146515Sru@findex TeX
10486146515Sru@findex LaTeX
1048742660Smarkm
1048842660SmarkmUse the @code{@@TeX@{@}} command to generate `@TeX{}'.  In a printed
1048942660Smarkmmanual, this is a special logo that is different from three ordinary
10490146515Sruletters.  In Info, it just looks like @samp{TeX}.
1049142660Smarkm
10492146515SruSimilarly, use the @code{@@LaTeX@{@}} command to generate `@LaTeX{}',
10493146515Sruwhich is even more special in printed manuals (and different from the
10494146515Sruincorrect @code{La@@TeX@{@}}.  In Info, the result is just
10495146515Sru@samp{LaTeX}.  (@LaTeX{} is another macro package built on top of
10496146515Sru@TeX{}, very loosely analogous to Texinfo in that it emphasizes
10497146515Srulogical structure, but much (much) larger.)
1049842660Smarkm
10499146515SruThe spelling of these commands are unusual among Texinfo commands in
10500146515Sruthat they use both uppercase and lowercase letters.
10501146515Sru
10502146515Sru
1050356160Sru@node copyright symbol
10504114472Sru@subsection @code{@@copyright@{@}} (@copyright{})
1050542660Smarkm@findex copyright
1050642660Smarkm
10507146515SruUse the @code{@@copyright@{@}} command to generate the copyright
10508146515Srusymbol, `@copyright{}'.  Where possible, this is a @samp{c}
10509146515Sruinside a circle; in Info, this is @samp{(C)}.
1051042660Smarkm
1051142660Smarkm
10512146515Sru@node registered symbol
10513146515Sru@subsection @code{@@registeredsymbol@{@}} (@registeredsymbol{})
10514146515Sru@findex registeredsymbol
10515146515Sru
10516146515SruUse the @code{@@registeredsymbol@{@}} command to generate the
10517146515Sruregistered symbol, `@registeredsymbol{}'.  Where possible, this is an
10518146515Sru@samp{R} inside a circle; in Info, this is @samp{(R)}.
10519146515Sru
10520146515Sru
10521146515Sru@node euro
10522146515Sru@section @code{@@euro}@{@} (@euro{}): Euro currency symbol
10523146515Sru@findex euro
10524146515Sru
10525146515SruUse the @code{@@euro@{@}} command to generate `@euro{}'.  Where
10526146515Srupossible, this is the symbol for the Euro currency, invented as part
10527146515Sruof the European economic unification relatively recently.  In plain
10528146515SruInfo, it is the word @samp{Euro }.  (The space is included in the text
10529146515Srutransliteration since typically there would be no space after the
10530146515Srusymbol, so it would be inappropriate to have a space in the source document.)
10531146515Sru
10532146515SruTexinfo cannot magically synthesize support for the Euro symbol where
10533146515Sruthe underlying system (fonts, software, whatever) does not support
10534146515Sruit.  Therefore, in many cases it is preferable to use the word
10535146515Sru``Euro''.  (In banking circles, the abbreviation for the Euro is EUR.)
10536146515Sru
10537146515Sru@cindex ISO 8859-15
10538146515Sru@cindex Latin 9
10539146515SruIn order to get the Euro symbol in encoded Info output, for example,
10540146515Sruit is necessary to specify @code{@@documentencoding ISO-8859-15}.
10541146515Sru(@xref{documentencoding,,@code{@@documentencoding}}.)  The Euro symbol
10542146515Sruis in ISO 8859-15 (aka Latin@tie{}9), and is @emph{not} in the more
10543146515Sruwidely-used and supported ISO 8859-1 (Latin@tie{}1).
10544146515Sru
10545146515Sru
10546146515Sru@node pounds
1054742660Smarkm@section @code{@@pounds}@{@} (@pounds{}): Pounds Sterling
1054842660Smarkm@findex pounds
1054942660Smarkm
10550146515SruUse the @code{@@pounds@{@}} command to generate `@pounds{}'.  Where
10551146515Srupossible, this is the symbol for the currency pounds sterling.  In
10552146515SruInfo, it is a @samp{#}.
1055342660Smarkm
1055442660Smarkm
10555146515Sru@node minus
1055642660Smarkm@section @code{@@minus}@{@} (@minus{}): Inserting a Minus Sign
1055742660Smarkm@findex minus
1055842660Smarkm
10559146515Sru@cindex Em dash, compared to minus sign
10560146515Sru@cindex Hyphen, compared to minus
1056142660SmarkmUse the @code{@@minus@{@}} command to generate a minus sign.  In a
1056242660Smarkmfixed-width font, this is a single hyphen, but in a proportional font,
1056342660Smarkmthe symbol is the customary length for a minus sign---a little longer
1056442660Smarkmthan a hyphen, shorter than an em-dash:
1056542660Smarkm
1056642660Smarkm@display
1056742660Smarkm@samp{@minus{}} is a minus sign generated with @samp{@@minus@{@}},
1056842660Smarkm
1056942660Smarkm`-' is a hyphen generated with the character @samp{-},
1057042660Smarkm
1057142660Smarkm`---' is an em-dash for text.
1057242660Smarkm@end display
1057342660Smarkm
1057442660Smarkm@noindent
1057542660SmarkmIn the fixed-width font used by Info, @code{@@minus@{@}} is the same
1057642660Smarkmas a hyphen.
1057742660Smarkm
1057842660SmarkmYou should not use @code{@@minus@{@}} inside @code{@@code} or
1057942660Smarkm@code{@@example} because the width distinction is not made in the
1058042660Smarkmfixed-width font they use.
1058142660Smarkm
1058242660SmarkmWhen you use @code{@@minus} to specify the mark beginning each entry in
1058342660Smarkman itemized list, you do not need to type the braces
10584146515Sru(@pxref{itemize, , @code{@@itemize}}).
1058542660Smarkm
1058642660Smarkm
1058793139Sru@node math
1058842660Smarkm@section @code{@@math}: Inserting Mathematical Expressions
1058942660Smarkm@findex math
1059042660Smarkm@cindex Mathematical expressions
1059193139Sru@cindex Formulas, mathematical
1059242660Smarkm
1059342660SmarkmYou can write a short mathematical expression with the @code{@@math}
1059442660Smarkmcommand.  Write the mathematical expression between braces, like this:
1059542660Smarkm
1059642660Smarkm@example
1059742660Smarkm@@math@{(a + b)(a + b) = a^2 + 2ab + b^2@}
1059842660Smarkm@end example
1059942660Smarkm
1060042660Smarkm@iftex
1060193139Sru@noindent This produces the following in @TeX{}:
1060242660Smarkm
1060342660Smarkm@display
1060442660Smarkm@math{(a + b)(a + b) = a^2 + 2ab + b^2}
1060542660Smarkm@end display
1060642660Smarkm
10607146515Sru@noindent and the following in other formats:
1060842660Smarkm@end iftex
10609146515Sru@ifnottex
10610146515Sru@noindent This produces the following in Info and HTML:
10611146515Sru@end ifnottex
1061242660Smarkm
1061342660Smarkm@example
1061442660Smarkm(a + b)(a + b) = a^2 + 2ab + b^2
1061542660Smarkm@end example
1061642660Smarkm
10617146515SruThus, the @code{@@math} command has no effect on the Info and HTML
10618146515Sruoutput; @command{makeinfo} just reproduces the input, it does not try
10619146515Sruto interpret the mathematics in any way.
1062042660Smarkm
1062193139Sru@code{@@math} implies @code{@@tex}.  This not only makes it possible to
1062293139Sruwrite superscripts and subscripts (as in the above example), but also
1062393139Sruallows you to use any of the plain @TeX{} math control sequences.  It's
10624100513Sruconventional to use @samp{\} instead of @samp{@@} for these commands.
10625100513SruAs in:
1062693139Sru@example
1062793139Sru@@math@{\sin 2\pi \equiv \cos 3\pi@}
1062893139Sru@end example
1062942660Smarkm
1063093139Sru@iftex
1063193139Sru@noindent which looks like this in @TeX{}:
1063293139Sru@display
1063393139Sru@math{\sin 2\pi \equiv \cos 3\pi}
1063493139Sru@end display
1063542660Smarkm
1063693139Sru@noindent and
1063793139Sru@end iftex
1063893139Sru@noindent which looks like the input in Info and HTML:
1063993139Sru@example
1064093139Sru\sin 2\pi \equiv \cos 3\pi
1064193139Sru@end example
1064293139Sru
10643100513Sru@findex \ @r{(literal \ in @code{@@math})}
10644100513SruSince @samp{\} is an escape character inside @code{@@math}, you can use
10645100513Sru@code{@@\} to get a literal backslash (@code{\\} will work in @TeX{},
10646100513Srubut you'll get the literal @samp{\\} in Info).  @code{@@\} is not
10647100513Srudefined outside of @code{@@math}, since a @samp{\} ordinarily produces a
10648100513Sruliteral @samp{\}.
10649100513Sru
10650100513Sru
1065193139Sru@cindex Displayed equations
1065293139Sru@cindex Equations, displayed
1065393139SruFor displayed equations, you must at present use @TeX{} directly
10654116525Sru(@pxref{Raw Formatter Commands}).
1065593139Sru
1065693139Sru
1065756160Sru@node Glyphs
1065842660Smarkm@section Glyphs for Examples
1065942660Smarkm@cindex Glyphs
1066093139Sru@cindex Examples, glyphs for
1066142660Smarkm
1066242660SmarkmIn Texinfo, code is often illustrated in examples that are delimited
1066342660Smarkmby @code{@@example} and @code{@@end example}, or by @code{@@lisp} and
1066442660Smarkm@code{@@end lisp}.  In such examples, you can indicate the results of
1066542660Smarkmevaluation or an expansion using @samp{@result{}} or
1066642660Smarkm@samp{@expansion{}}.  Likewise, there are commands to insert glyphs
1066742660Smarkmto indicate
1066842660Smarkmprinted output, error messages, equivalence of expressions, and the
1066942660Smarkmlocation of point.@refill
1067042660Smarkm
1067142660SmarkmThe glyph-insertion commands do not need to be used within an example, but
1067242660Smarkmmost often they are.  Every  glyph-insertion command is followed by a pair of
1067342660Smarkmleft- and right-hand braces.@refill
1067442660Smarkm
1067542660Smarkm@menu
10676116525Sru* Glyphs Summary::
1067742660Smarkm* result::                      How to show the result of expression.
1067842660Smarkm* expansion::                   How to indicate an expansion.
1067942660Smarkm* Print Glyph::                 How to indicate printed output.
1068042660Smarkm* Error Glyph::                 How to indicate an error message.
1068142660Smarkm* Equivalence::                 How to indicate equivalence.
1068242660Smarkm* Point Glyph::                 How to indicate the location of point.
1068342660Smarkm@end menu
1068442660Smarkm
1068542660Smarkm
1068693139Sru@node Glyphs Summary
1068793139Sru@subsection Glyphs Summary
1068893139Sru
1068942660SmarkmHere are the different glyph commands:@refill
1069042660Smarkm
1069142660Smarkm@table @asis
1069242660Smarkm@item @result{}
1069342660Smarkm@code{@@result@{@}} points to the result of an expression.@refill
1069442660Smarkm
1069542660Smarkm@item @expansion{}
1069642660Smarkm@code{@@expansion@{@}} shows the results of a macro expansion.@refill
1069742660Smarkm
1069842660Smarkm@item @print{}
1069942660Smarkm@code{@@print@{@}} indicates printed output.@refill
1070042660Smarkm
1070142660Smarkm@item @error{}
1070242660Smarkm@code{@@error@{@}} indicates that the following text is an error
1070342660Smarkmmessage.@refill
1070442660Smarkm
1070542660Smarkm@item @equiv{}
1070642660Smarkm@code{@@equiv@{@}} indicates the exact equivalence of two forms.@refill
1070742660Smarkm
1070842660Smarkm@item @point{}
1070942660Smarkm@code{@@point@{@}} shows the location of point.@refill
1071042660Smarkm@end table
1071142660Smarkm
1071242660Smarkm@menu
1071356160Sru* result::
1071456160Sru* expansion::
1071556160Sru* Print Glyph::
1071656160Sru* Error Glyph::
1071756160Sru* Equivalence::
1071856160Sru* Point Glyph::
1071942660Smarkm@end menu
1072042660Smarkm
1072193139Sru
1072293139Sru@node result
1072342660Smarkm@subsection @code{@@result@{@}} (@result{}): Indicating Evaluation
1072442660Smarkm@cindex Result of an expression
1072542660Smarkm@cindex Indicating evaluation
1072642660Smarkm@cindex Evaluation glyph
1072742660Smarkm@cindex Value of an expression, indicating
1072856160Sru@findex result
1072942660Smarkm
1073042660SmarkmUse the @code{@@result@{@}} command to indicate the result of
1073142660Smarkmevaluating an expression.@refill
1073242660Smarkm
1073342660Smarkm@iftex
10734146515SruThe @code{@@result@{@}} command is displayed as @samp{@result{}} in
10735146515Sruthe printed output and as @samp{=>} in other formats.
1073642660Smarkm@end iftex
10737146515Sru@ifnottex
10738146515SruThe @code{@@result@{@}} command is displayed as @samp{@result{}} in
10739146515SruInfo and HTML and as a true double stemmed arrow in the printed output.
10740146515Sru@end ifnottex
1074142660Smarkm
1074242660SmarkmThus, the following,
1074342660Smarkm
1074442660Smarkm@lisp
1074542660Smarkm(cdr '(1 2 3))
10746114472Sru    @result{} (2 3)
1074742660Smarkm@end lisp
1074842660Smarkm
1074942660Smarkm@noindent
1075042660Smarkmmay be read as ``@code{(cdr '(1 2 3))} evaluates to @code{(2 3)}''.
1075142660Smarkm
1075242660Smarkm
10753146515Sru@node expansion
1075442660Smarkm@subsection @code{@@expansion@{@}} (@expansion{}): Indicating an Expansion
10755146515Sru@cindex Expansion, indicating
10756146515Sru@cindex Macro expansion, indicating
1075756160Sru@findex expansion
1075842660Smarkm
1075942660SmarkmWhen an expression is a macro call, it expands into a new expression.
1076042660SmarkmYou can indicate the result of the expansion with the
1076142660Smarkm@code{@@expansion@{@}} command.@refill
1076242660Smarkm
1076342660Smarkm@iftex
10764146515SruThe @code{@@expansion@{@}} command is displayed as @samp{@expansion{}}
10765146515Sruin the printed output.  and as @samp{==>} in other formats.
1076642660Smarkm@end iftex
10767146515Sru@ifnottex
1076842660SmarkmThe @code{@@expansion@{@}} command is displayed as @samp{@expansion{}}
10769146515Sruin Info and HTML, and as a long arrow with a flat base in the printed
10770146515Sruoutput.
10771146515Sru@end ifnottex
1077242660Smarkm
1077342660Smarkm@need 700
1077442660SmarkmFor example, the following
1077542660Smarkm
1077642660Smarkm@example
1077742660Smarkm@group
1077842660Smarkm@@lisp
1077942660Smarkm(third '(a b c))
10780114472Sru    @@expansion@{@} (car (cdr (cdr '(a b c))))
10781114472Sru    @@result@{@} c
1078242660Smarkm@@end lisp
1078342660Smarkm@end group
1078442660Smarkm@end example
1078542660Smarkm
1078642660Smarkm@noindent
1078742660Smarkmproduces
1078842660Smarkm
1078942660Smarkm@lisp
1079042660Smarkm@group
1079142660Smarkm(third '(a b c))
10792114472Sru    @expansion{} (car (cdr (cdr '(a b c))))
10793114472Sru    @result{} c
1079442660Smarkm@end group
1079542660Smarkm@end lisp
1079642660Smarkm
1079742660Smarkm@noindent
1079842660Smarkmwhich may be read as:
1079942660Smarkm
1080042660Smarkm@quotation
1080142660Smarkm@code{(third '(a b c))} expands to @code{(car (cdr (cdr '(a b c))))};
1080242660Smarkmthe result of evaluating the expression is @code{c}.
1080342660Smarkm@end quotation
1080442660Smarkm
1080542660Smarkm@noindent
1080642660SmarkmOften, as in this case, an example looks better if the
10807146515Sru@code{@@expansion@{@}} and @code{@@result@{@}} commands are indented.
1080842660Smarkm
1080942660Smarkm
10810146515Sru@node Print Glyph
1081142660Smarkm@subsection @code{@@print@{@}} (@print{}): Indicating Printed Output
10812146515Sru@cindex Printed output, indicating
1081356160Sru@findex print
1081442660Smarkm
1081542660SmarkmSometimes an expression will print output during its execution.  You
1081642660Smarkmcan indicate the printed output with the @code{@@print@{@}} command.@refill
1081742660Smarkm
1081842660Smarkm@iftex
1081942660SmarkmThe @code{@@print@{@}} command is displayed as @samp{-|} in Info and
10820146515SruHTML and as @samp{@print{}} in the printed output.
1082142660Smarkm@end iftex
10822146515Sru@ifnottex
1082342660SmarkmThe @code{@@print@{@}} command is displayed as @samp{@print{}} in Info
10824146515Sruand HTML and (similarly) as a horizontal dash butting against a
10825146515Sruvertical bar in the printed output.
10826146515Sru@end ifnottex
1082742660Smarkm
1082842660SmarkmIn the following example, the printed text is indicated with
1082942660Smarkm@samp{@print{}}, and the value of the expression follows on the
10830146515Srulast line.
1083142660Smarkm
1083242660Smarkm@lisp
1083342660Smarkm@group
1083442660Smarkm(progn (print 'foo) (print 'bar))
10835114472Sru    @print{} foo
10836114472Sru    @print{} bar
10837114472Sru    @result{} bar
1083842660Smarkm@end group
1083942660Smarkm@end lisp
1084042660Smarkm
1084142660Smarkm@noindent
1084242660SmarkmIn a Texinfo source file, this example is written as follows:
1084342660Smarkm
1084442660Smarkm@lisp
1084542660Smarkm@group
1084642660Smarkm@@lisp
1084742660Smarkm(progn (print 'foo) (print 'bar))
10848114472Sru    @@print@{@} foo
10849114472Sru    @@print@{@} bar
10850114472Sru    @@result@{@} bar
1085142660Smarkm@@end lisp
1085242660Smarkm@end group
1085342660Smarkm@end lisp
1085442660Smarkm
1085542660Smarkm
10856146515Sru@node Error Glyph
1085742660Smarkm@subsection @code{@@error@{@}} (@error{}): Indicating an Error Message
10858146515Sru@cindex Error message, indicating
1085956160Sru@findex error
1086042660Smarkm
1086142660SmarkmA piece of code may cause an error when you evaluate it.  You can
1086242660Smarkmdesignate the error message with the @code{@@error@{@}} command.@refill
1086342660Smarkm
1086442660Smarkm@iftex
1086542660SmarkmThe @code{@@error@{@}} command is displayed as @samp{error-->} in Info
10866146515Sruand HTML and as @samp{@error{}} in the printed output.
1086742660Smarkm@end iftex
10868146515Sru@ifnottex
1086942660SmarkmThe @code{@@error@{@}} command is displayed as @samp{@error{}} in Info
10870146515Sruand HTML and as the word `error' in a box in the printed output.
10871146515Sru@end ifnottex
1087242660Smarkm
1087342660Smarkm@need 700
1087442660SmarkmThus,
1087542660Smarkm
1087642660Smarkm@example
1087742660Smarkm@@lisp
1087842660Smarkm(+ 23 'x)
1087942660Smarkm@@error@{@} Wrong type argument: integer-or-marker-p, x
1088042660Smarkm@@end lisp
1088142660Smarkm@end example
1088242660Smarkm
1088342660Smarkm@noindent
1088442660Smarkmproduces
1088542660Smarkm
1088642660Smarkm@lisp
1088742660Smarkm(+ 23 'x)
1088842660Smarkm@error{} Wrong type argument: integer-or-marker-p, x
1088942660Smarkm@end lisp
1089042660Smarkm
1089142660Smarkm@noindent
1089242660SmarkmThis indicates that the following error message is printed
1089342660Smarkmwhen you evaluate the expression:
1089442660Smarkm
1089542660Smarkm@lisp
1089642660SmarkmWrong type argument: integer-or-marker-p, x
1089742660Smarkm@end lisp
1089842660Smarkm
1089942660Smarkm@samp{@error{}} itself is not part of the error message.
1090042660Smarkm
1090142660Smarkm
10902146515Sru@node Equivalence
1090342660Smarkm@subsection @code{@@equiv@{@}} (@equiv{}): Indicating Equivalence
10904146515Sru@cindex Equivalence, indicating
1090556160Sru@findex equiv
1090642660Smarkm
1090742660SmarkmSometimes two expressions produce identical results.  You can indicate the
1090842660Smarkmexact equivalence of two forms with the @code{@@equiv@{@}} command.@refill
1090942660Smarkm
1091042660Smarkm@iftex
1091142660SmarkmThe @code{@@equiv@{@}} command is displayed as @samp{==} in Info and
10912146515SruHTML and as @samp{@equiv{}} in the printed output.
1091342660Smarkm@end iftex
10914146515Sru@ifnottex
1091542660SmarkmThe @code{@@equiv@{@}} command is displayed as @samp{@equiv{}} in Info
10916146515Sruand HTML and as a standard mathematical equivalence sign (three
10917146515Sruparallel horizontal lines) in the printed output.
10918146515Sru@end ifnottex
1091942660Smarkm
1092042660SmarkmThus,
1092142660Smarkm
1092242660Smarkm@example
1092342660Smarkm@@lisp
1092442660Smarkm(make-sparse-keymap) @@equiv@{@} (list 'keymap)
1092542660Smarkm@@end lisp
1092642660Smarkm@end example
1092742660Smarkm
1092842660Smarkm@noindent
1092942660Smarkmproduces
1093042660Smarkm
1093142660Smarkm@lisp
1093242660Smarkm(make-sparse-keymap) @equiv{} (list 'keymap)
1093342660Smarkm@end lisp
1093442660Smarkm
1093542660Smarkm@noindent
1093642660SmarkmThis indicates that evaluating @code{(make-sparse-keymap)} produces
1093742660Smarkmidentical results to evaluating @code{(list 'keymap)}.
1093842660Smarkm
1093942660Smarkm
1094056160Sru@node Point Glyph
1094142660Smarkm@subsection @code{@@point@{@}} (@point{}): Indicating Point in a Buffer
1094256160Sru@cindex Point, indicating in a buffer
1094356160Sru@findex point
1094442660Smarkm
1094542660SmarkmSometimes you need to show an example of text in an Emacs buffer.  In
1094642660Smarkmsuch examples, the convention is to include the entire contents of the
1094742660Smarkmbuffer in question between two lines of dashes containing the buffer
1094842660Smarkmname.@refill
1094942660Smarkm
1095042660SmarkmYou can use the @samp{@@point@{@}} command to show the location of point
1095142660Smarkmin the text in the buffer.  (The symbol for point, of course, is not
1095242660Smarkmpart of the text in the buffer; it indicates the place @emph{between}
1095342660Smarkmtwo characters where point is located.)@refill
1095442660Smarkm
1095542660Smarkm@iftex
1095642660SmarkmThe @code{@@point@{@}} command is displayed as @samp{-!-} in Info and
10957146515SruHTML and as @samp{@point{}} in the printed output.
1095842660Smarkm@end iftex
10959146515Sru@ifnottex
1096042660SmarkmThe @code{@@point@{@}} command is displayed as @samp{@point{}} in Info
10961146515Sruand HTML and as a small five pointed star in the printed
10962146515Sruoutput.
10963146515Sru@end ifnottex
1096442660Smarkm
1096542660SmarkmThe following example shows the contents of buffer @file{foo} before
1096642660Smarkmand after evaluating a Lisp command to insert the word @code{changed}.@refill
1096742660Smarkm
1096842660Smarkm@example
1096942660Smarkm@group
1097042660Smarkm---------- Buffer: foo ----------
1097142660SmarkmThis is the @point{}contents of foo.
1097242660Smarkm---------- Buffer: foo ----------
1097342660Smarkm
1097442660Smarkm@end group
1097542660Smarkm@end example
1097642660Smarkm
1097742660Smarkm@example
1097842660Smarkm@group
1097942660Smarkm(insert "changed ")
10980114472Sru    @result{} nil
1098142660Smarkm---------- Buffer: foo ----------
1098242660SmarkmThis is the changed @point{}contents of foo.
1098342660Smarkm---------- Buffer: foo ----------
1098442660Smarkm
1098542660Smarkm@end group
1098642660Smarkm@end example
1098742660Smarkm
1098842660SmarkmIn a Texinfo source file, the example is written like this:@refill
1098942660Smarkm
1099042660Smarkm@example
1099142660Smarkm@@example
1099242660Smarkm---------- Buffer: foo ----------
1099342660SmarkmThis is the @@point@{@}contents of foo.
1099442660Smarkm---------- Buffer: foo ----------
1099542660Smarkm
1099642660Smarkm(insert "changed ")
10997114472Sru    @@result@{@} nil
1099842660Smarkm---------- Buffer: foo ----------
1099942660SmarkmThis is the changed @@point@{@}contents of foo.
1100042660Smarkm---------- Buffer: foo ----------
1100142660Smarkm@@end example
1100242660Smarkm@end example
1100342660Smarkm
1100442660Smarkm
1100556160Sru@node Breaks
11006146515Sru@chapter Forcing and Preventing Breaks
11007146515Sru@cindex Forcing line and page breaks
1100842660Smarkm@cindex Making line and page breaks
1100942660Smarkm@cindex Preventing line and page breaks
1101042660Smarkm
1101193139Sru@cindex Line breaks
1101242660SmarkmUsually, a Texinfo file is processed both by @TeX{} and by one of the
1101342660SmarkmInfo formatting commands.  Line, paragraph, or page breaks sometimes
1101442660Smarkmoccur in the `wrong' place in one or other form of output.  You must
1101542660Smarkmensure that text looks right both in the printed manual and in the
1101693139SruInfo file.
1101742660Smarkm
1101893139Sru@cindex White space, excessive
1101993139Sru@cindex Page breaks
1102042660SmarkmFor example, in a printed manual, page breaks may occur awkwardly in
1102142660Smarkmthe middle of an example; to prevent this, you can hold text together
1102242660Smarkmusing a grouping command that keeps the text from being split across
1102342660Smarkmtwo pages.  Conversely, you may want to force a page break where none
1102442660Smarkmwould occur normally.  Fortunately, problems like these do not often
1102542660Smarkmarise.  When they do, use the break, break prevention, or pagination
1102693139Srucommands.
1102742660Smarkm
1102842660Smarkm@menu
11029114472Sru* Break Commands::              Summary of break-related commands.
11030114472Sru* Line Breaks::                 Forcing line breaks.
11031114472Sru* - and hyphenation::           Helping @TeX{} with hyphenation points.
11032114472Sru* w::                           Preventing unwanted line breaks in text.
11033114472Sru* tie::                         Inserting an unbreakable but varying space.
11034114472Sru* sp::                          Inserting blank lines.
11035114472Sru* page::                        Forcing the start of a new page.
11036114472Sru* group::                       Preventing unwanted page breaks.
1103742660Smarkm* need::                        Another way to prevent unwanted page breaks.
1103842660Smarkm@end menu
1103942660Smarkm
1104093139Sru
11041114472Sru@node Break Commands
11042114472Sru@section Break Commands
1104342660Smarkm
11044114472SruThe break commands create or allow line and paragraph breaks:
1104542660Smarkm
1104642660Smarkm@table @code
1104742660Smarkm@item @@*
1104842660SmarkmForce a line break.
1104942660Smarkm
1105042660Smarkm@item @@sp @var{n}
11051114472SruSkip @var{n} blank lines.
1105242660Smarkm
1105342660Smarkm@item @@-
1105442660SmarkmInsert a discretionary hyphen.
1105542660Smarkm
1105642660Smarkm@item @@hyphenation@{@var{hy-phen-a-ted words}@}
1105742660SmarkmDefine hyphen points in @var{hy-phen-a-ted words}.
1105842660Smarkm@end table
1105942660Smarkm
11060114472SruThese commands hold text together on a single line:
1106142660Smarkm
1106242660Smarkm@table @code
1106342660Smarkm@item @@w@{@var{text}@}
11064114472SruPrevent @var{text} from being split and hyphenated across two lines.
11065114472Sru@item @@tie@{@}
11066114472SruInsert a normal interword space at which a line break may not occur.
1106742660Smarkm@end table
1106842660Smarkm@iftex
1106942660Smarkm@sp 1
1107042660Smarkm@end iftex
1107142660Smarkm
1107242660SmarkmThe pagination commands apply only to printed output, since Info
11073114472Srufiles do not have pages.
1107442660Smarkm
1107542660Smarkm@table @code
1107642660Smarkm@item @@page
11077114472SruStart a new page in the printed manual.
1107842660Smarkm
1107942660Smarkm@item @@group
11080114472SruHold text together that must appear on one printed page.
1108142660Smarkm
1108242660Smarkm@item @@need @var{mils}
11083114472SruStart a new printed page if not enough space on this one.
1108442660Smarkm@end table
1108542660Smarkm
11086114472Sru
1108793139Sru@node Line Breaks
11088116525Sru@section @code{@@*} and @code{@@/}: Generate and Allow Line Breaks
1108942660Smarkm@findex * @r{(force line break)}
11090116525Sru@findex / @r{(allow line break)}
1109142660Smarkm@cindex Line breaks
1109242660Smarkm@cindex Breaks in a line
11093116525Sru@cindex Force line break
11094116525Sru@cindex Allow line break
1109542660Smarkm
1109642660SmarkmThe @code{@@*} command forces a line break in both the printed manual and
11097116525Sruin Info.  The @code{@@/} command allows a line break (printed manual only).
1109842660Smarkm
11099116525SruHere is an example with @code{@@*}:
1110042660Smarkm
1110142660Smarkm@example
1110242660SmarkmThis line @@* is broken @@*in two places.
1110342660Smarkm@end example
1110442660Smarkm
11105116525Sru@noindent produces
1110642660Smarkm
1110742660Smarkm@example
1110842660Smarkm@group
1110942660SmarkmThis line
11110114472Sruis broken
1111142660Smarkmin two places.
1111242660Smarkm@end group
1111342660Smarkm@end example
1111442660Smarkm
11115116525SruThe @code{@@/} command can be useful within a url
11116116525Sru(@pxref{uref,,@code{@@uref}}), which tend to be long and are otherwise
11117116525Sruunbreakable.  For example:
11118116525Sru
1111942660Smarkm@example
11120116525SruThe official Texinfo home page is on the GNU web site:
11121116525Sru@@uref@{http://www.gnu.org/@@/software/@@/gnu/@@/texinfo@}.
1112242660Smarkm@end example
1112342660Smarkm
11124116525Sru@noindent produces
1112542660Smarkm
11126116525Sru@display
11127116525SruThe official Texinfo home page is on the GNU web site:
11128116525Sru@uref{http://www.gnu.org/@/software/@/gnu/@/texinfo}.
11129116525Sru@end display
1113042660Smarkm
11131116525Sru@noindent Without the @code{@@/} commands, @TeX{} would have nowhere to
11132116525Srubreak the line.  @code{@@/} has no effect in the online output.
1113393139Sru
11134116525Sru
1113593139Sru@node - and hyphenation
11136114472Sru@section @code{@@-} and @code{@@hyphenation}: Helping @TeX{} Hyphenate
1113742660Smarkm
11138100513Sru@findex - @r{(discretionary hyphen)}
1113942660Smarkm@findex hyphenation
1114042660Smarkm@cindex Hyphenation, helping @TeX{} do
1114142660Smarkm@cindex Fine-tuning, and hyphenation
1114242660Smarkm
1114342660SmarkmAlthough @TeX{}'s hyphenation algorithm is generally pretty good, it
1114442660Smarkmdoes miss useful hyphenation points from time to time.  (Or, far more
1114542660Smarkmrarely, insert an incorrect hyphenation.)  So, for documents with an
1114642660Smarkmunusual vocabulary or when fine-tuning for a printed edition, you may
1114742660Smarkmwish to help @TeX{} out.  Texinfo supports two commands for this:
1114842660Smarkm
1114942660Smarkm@table @code
1115042660Smarkm@item @@-
1115142660SmarkmInsert a discretionary hyphen, i.e., a place where @TeX{} can (but does
11152100513Srunot have to) hyphenate.  This is especially useful when you notice an
11153100513Sruoverfull hbox is due to @TeX{} missing a hyphenation (@pxref{Overfull
11154100513Sruhboxes}).  @TeX{} will not insert any hyphenation points itself into a
11155100513Sruword containing @code{@@-}.
1115642660Smarkm
1115742660Smarkm@item @@hyphenation@{@var{hy-phen-a-ted words}@}
1115842660SmarkmTell @TeX{} how to hyphenate @var{hy-phen-a-ted words}.  As shown, you
1115942660Smarkmput a @samp{-} at each hyphenation point.  For example:
1116042660Smarkm@example
1116142660Smarkm@@hyphenation@{man-u-script man-u-scripts@}
1116242660Smarkm@end example
1116342660Smarkm@noindent @TeX{} only uses the specified hyphenation points when the
1116442660Smarkmwords match exactly, so give all necessary variants.
1116542660Smarkm@end table
1116642660Smarkm
1116742660SmarkmInfo output is not hyphenated, so these commands have no effect there.
1116842660Smarkm
11169146515Sru
1117056160Sru@node w
1117142660Smarkm@section @code{@@w}@{@var{text}@}: Prevent Line Breaks
1117242660Smarkm@findex w @r{(prevent line break)}
1117342660Smarkm@cindex Line breaks, preventing
1117442660Smarkm
1117542660Smarkm@code{@@w@{@var{text}@}} outputs @var{text} and prohibits line breaks
11176146515Sruwithin @var{text}, for both @TeX{} and @command{makeinfo}.
1117742660Smarkm
11178114472Sru@cindex Non-breakable space, fixed
11179114472Sru@cindex Unbreakable space, fixed
11180146515SruThus, you can use @code{@@w} to produce a non-breakable space, fixed at
11181114472Sruthe width of a normal interword space:
11182114472Sru
11183114472Sru@example
11184114472Sru@@w@{ @} @@w@{ @} @@w@{ @} indentation.
11185114472Sru@end example
11186114472Sru
11187114472Sru@noindent produces:
11188114472Sru
11189114472Sru@display
11190114472Sru@w{ } @w{ } @w{ } indentation.
11191114472Sru@end display
11192114472Sru
11193146515SruThe space from @code{@@w@{@w{ }@}}, as well as being non-breakable,
11194146515Srualso will not stretch or shrink.  Sometimes that is what you want, for
11195146515Sruinstance if you're doing indenting manual.  However, usually you want
11196146515Srua normal interword space that does stretch and shrink (in the printed
11197146515Sruoutput); see the @code{@@tie} command in the next section.
11198114472Sru
11199146515Sru@cindex Hyphenation, preventing
11200146515SruYou can also use the @code{@@w} command to prevent @TeX{} from
11201146515Sruautomatically hyphenating a long name or phrase that happens to fall
11202146515Srunear the end of a line.  @command{makeinfo} does not ever hyphenate
11203146515Sruwords.
11204114472Sru
11205146515Sru@cindex Keyword expansion, preventing
11206146515Sru@cindex Version control keywords, preventing expansion of
11207146515Sru@cindex $Id expansion, preventing
11208146515SruYou can also use @code{@@w} to avoid unwanted keyword expansion in
11209146515Srusource control systems.  For example, to literally write @t{@w{$}Id$}
11210146515Sruin your document, use @code{@@w@{$@}Id$}.
11211146515Sru
11212146515Sru
11213114472Sru@node tie
11214114472Sru@section @code{@@tie@{@}}: Inserting an Unbreakable Space
11215114472Sru@findex tie @r{(unbreakable interword space)}
1121656160Sru@cindex Tied space
11217114472Sru@cindex Non-breakable space, variable
11218114472Sru@cindex Unbreakable space, variable
1121942660Smarkm
11220114472SruThe @code{@@tie@{@}} command produces a normal interword space at which
11221114472Srua line break may not occur.  Always write it with following (empty)
11222114472Srubraces, as usual for commands used within a paragraph.  Here's an
11223114472Sruexample:
11224114472Sru
1122556160Sru@example
11226114472Sru@@TeX@{@} was written by Donald E.@@tie@{@}Knuth.
1122756160Sru@end example
1122856160Sru
11229114472Sru@noindent produces:
1123056160Sru
11231114472Sru@display
11232114472Sru@TeX{} was written by Donald E.@tie{}Knuth.
11233114472Sru@end display
11234114472Sru
11235114472SruThere are two important differences between @code{@@tie@{@}} and
11236114472Sru@code{@@w@{@w{ }@}}:
11237114472Sru
11238114472Sru@itemize
11239114472Sru@item
11240114472SruThe space produced by @code{@@tie@{@}} will stretch and shrink slightly
11241114472Srualong with the normal interword spaces in the paragraph; the space
11242114472Sruproduced by @code{@@w@{@w{ }@}} will not vary.
11243114472Sru
11244114472Sru@item
11245114472Sru@code{@@tie@{@}} allows hyphenation of the surrounding words, while
11246114472Sru@code{@@w@{@w{ }@}} inhibits hyphenation of those words (for @TeX{}nical
11247114472Srureasons, namely that it produces an @samp{\hbox}).
11248114472Sru
11249114472Sru@end itemize
11250114472Sru
11251114472Sru
1125256160Sru@node sp
1125342660Smarkm@section @code{@@sp} @var{n}: Insert Blank Lines
1125442660Smarkm@findex sp @r{(line spacing)}
1125556160Sru@cindex Space, inserting vertical
1125642660Smarkm@cindex Blank lines
1125742660Smarkm@cindex Line spacing
1125842660Smarkm
1125942660SmarkmA line beginning with and containing only @code{@@sp @var{n}}
1126042660Smarkmgenerates @var{n} blank lines of space in both the printed manual and
1126142660Smarkmthe Info file.  @code{@@sp} also forces a paragraph break.  For
1126256160Sruexample,
1126342660Smarkm
1126442660Smarkm@example
1126542660Smarkm@@sp 2
1126642660Smarkm@end example
1126742660Smarkm
1126842660Smarkm@noindent
1126942660Smarkmgenerates two blank lines.
1127042660Smarkm
1127142660SmarkmThe @code{@@sp} command is most often used in the title page.@refill
1127242660Smarkm
1127342660Smarkm@ignore
1127442660Smarkm@c node br, page, sp, Breaks
1127542660Smarkm@comment  node-name,  next,  previous,  up
1127642660Smarkm@c section @code{@@br}: Generate Paragraph Breaks
1127742660Smarkm@findex br @r{(paragraph breaks)}
1127842660Smarkm@cindex Paragraph breaks
1127942660Smarkm@cindex Breaks in a paragraph
1128042660Smarkm
1128142660SmarkmThe @code{@@br} command forces a paragraph break.  It inserts a blank
1128242660Smarkmline.  You can use the command within or at the end of a line.  If
1128342660Smarkmused within a line, the @code{@@br@{@}} command must be followed by
1128442660Smarkmleft and right braces (as shown here) to mark the end of the
1128542660Smarkmcommand.@refill
1128642660Smarkm
1128742660Smarkm@need 700
1128842660SmarkmFor example,
1128942660Smarkm
1129042660Smarkm@example
1129142660Smarkm@group
1129242660SmarkmThis line @@br@{@}contains and is ended by paragraph breaks@@br
1129342660Smarkmand is followed by another line.
1129442660Smarkm@end group
1129542660Smarkm@end example
1129642660Smarkm
1129742660Smarkm@noindent
1129842660Smarkmproduces
1129942660Smarkm
1130042660Smarkm@example
1130142660Smarkm@group
1130242660SmarkmThis line
1130342660Smarkm
1130442660Smarkmcontains and is ended by paragraph breaks
1130542660Smarkm
1130642660Smarkmand is followed by another line.
1130742660Smarkm@end group
1130842660Smarkm@end example
1130942660Smarkm
1131042660SmarkmThe @code{@@br} command is seldom used.
1131142660Smarkm@end ignore
1131242660Smarkm
1131393139Sru
1131493139Sru@node page
1131542660Smarkm@section @code{@@page}: Start a New Page
1131642660Smarkm@cindex Page breaks
1131742660Smarkm@findex page
1131842660Smarkm
1131942660SmarkmA line containing only @code{@@page} starts a new page in a printed
1132042660Smarkmmanual.  The command has no effect on Info files since they are not
1132142660Smarkmpaginated.  An @code{@@page} command is often used in the @code{@@titlepage}
1132293139Srusection of a Texinfo file to start the copyright page.
1132342660Smarkm
1132493139Sru
11325146515Sru@node group
1132642660Smarkm@comment  node-name,  next,  previous,  up
1132742660Smarkm@section @code{@@group}: Prevent Page Breaks
1132842660Smarkm@cindex Group (hold text together vertically)
1132942660Smarkm@cindex Holding text together vertically
1133042660Smarkm@cindex Vertically holding text together
1133142660Smarkm@findex group
1133242660Smarkm
1133342660SmarkmThe @code{@@group} command (on a line by itself) is used inside an
1133442660Smarkm@code{@@example} or similar construct to begin an unsplittable vertical
1133542660Smarkmgroup, which will appear entirely on one page in the printed output.
1133642660SmarkmThe group is terminated by a line containing only @code{@@end group}.
1133742660SmarkmThese two lines produce no output of their own, and in the Info file
1133842660Smarkmoutput they have no effect at all.@refill
1133942660Smarkm
1134042660Smarkm@c Once said that these environments
1134142660Smarkm@c turn off vertical spacing between ``paragraphs''.
1134242660Smarkm@c Also, quotation used to work, but doesn't in texinfo-2.72
1134342660SmarkmAlthough @code{@@group} would make sense conceptually in a wide
1134442660Smarkmvariety of contexts, its current implementation works reliably only
1134542660Smarkmwithin @code{@@example} and variants, and within @code{@@display},
1134642660Smarkm@code{@@format}, @code{@@flushleft} and @code{@@flushright}.
1134742660Smarkm@xref{Quotations and Examples}.  (What all these commands have in
1134842660Smarkmcommon is that each line of input produces a line of output.)  In
1134942660Smarkmother contexts, @code{@@group} can cause anomalous vertical
1135042660Smarkmspacing.@refill
1135142660Smarkm
1135242660Smarkm@need 750
1135342660SmarkmThis formatting requirement means that you should write:
1135442660Smarkm
1135542660Smarkm@example
1135642660Smarkm@group
1135742660Smarkm@@example
1135842660Smarkm@@group
1135942660Smarkm@dots{}
1136042660Smarkm@@end group
1136142660Smarkm@@end example
1136242660Smarkm@end group
1136342660Smarkm@end example
1136442660Smarkm
1136542660Smarkm@noindent
1136642660Smarkmwith the @code{@@group} and @code{@@end group} commands inside the
1136742660Smarkm@code{@@example} and @code{@@end example} commands.
1136842660Smarkm
1136942660SmarkmThe @code{@@group} command is most often used to hold an example
1137042660Smarkmtogether on one page.  In this Texinfo manual, more than 100 examples
1137142660Smarkmcontain text that is enclosed between @code{@@group} and @code{@@end
1137242660Smarkmgroup}.
1137342660Smarkm
1137442660SmarkmIf you forget to end a group, you may get strange and unfathomable
1137542660Smarkmerror messages when you run @TeX{}.  This is because @TeX{} keeps
1137642660Smarkmtrying to put the rest of the Texinfo file onto the one page and does
1137742660Smarkmnot start to generate error messages until it has processed
1137842660Smarkmconsiderable text.  It is a good rule of thumb to look for a missing
1137942660Smarkm@code{@@end group} if you get incomprehensible error messages in
1138042660Smarkm@TeX{}.@refill
1138142660Smarkm
11382146515Sru@node need
1138342660Smarkm@comment  node-name,  next,  previous,  up
1138442660Smarkm@section @code{@@need @var{mils}}: Prevent Page Breaks
1138542660Smarkm@cindex Need space at page bottom
1138642660Smarkm@findex need
1138742660Smarkm
1138842660SmarkmA line containing only @code{@@need @var{n}} starts
1138942660Smarkma new page in a printed manual if fewer than @var{n} mils (thousandths
1139042660Smarkmof an inch) remain on the current page.  Do not use
1139142660Smarkmbraces around the argument @var{n}.  The @code{@@need} command has no
1139242660Smarkmeffect on Info files since they are not paginated.@refill
1139342660Smarkm
1139442660Smarkm@need 800
1139542660SmarkmThis paragraph is preceded by an @code{@@need} command that tells
1139642660Smarkm@TeX{} to start a new page if fewer than 800 mils (eight-tenths
1139742660Smarkminch) remain on the page.  It looks like this:@refill
1139842660Smarkm
1139942660Smarkm@example
1140042660Smarkm@group
1140142660Smarkm@@need 800
1140242660SmarkmThis paragraph is preceded by @dots{}
1140342660Smarkm@end group
1140442660Smarkm@end example
1140542660Smarkm
1140642660SmarkmThe @code{@@need} command is useful for preventing orphans (single
1140742660Smarkmlines at the bottoms of printed pages).@refill
1140842660Smarkm
1140956160Sru
1141056160Sru@node Definition Commands
1141142660Smarkm@chapter Definition Commands
1141242660Smarkm@cindex Definition commands
1141342660Smarkm
1141442660SmarkmThe @code{@@deffn} command and the other @dfn{definition commands}
1141542660Smarkmenable you to describe functions, variables, macros, commands, user
1141642660Smarkmoptions, special forms and other such artifacts in a uniform
1141742660Smarkmformat.@refill
1141842660Smarkm
1141942660SmarkmIn the Info file, a definition causes the entity
1142042660Smarkmcategory---`Function', `Variable', or whatever---to appear at the
1142142660Smarkmbeginning of the first line of the definition, followed by the
1142242660Smarkmentity's name and arguments.  In the printed manual, the command
1142342660Smarkmcauses @TeX{} to print the entity's name and its arguments on the left
1142442660Smarkmmargin and print the category next to the right margin.  In both
1142542660Smarkmoutput formats, the body of the definition is indented.  Also, the
1142642660Smarkmname of the entity is entered into the appropriate index:
1142742660Smarkm@code{@@deffn} enters the name into the index of functions,
1142842660Smarkm@code{@@defvr} enters it into the index of variables, and so
11429146515Sruon (@pxref{Predefined Indices}).
1143042660Smarkm
1143142660SmarkmA manual need not and should not contain more than one definition for
1143242660Smarkma given name.  An appendix containing a summary should use
1143342660Smarkm@code{@@table} rather than the definition commands.@refill
1143442660Smarkm
1143542660Smarkm@menu
11436146515Sru* Def Cmd Template::            Writing descriptions using definition commands.
11437146515Sru* Def Cmd Continuation Lines::  Continuing the heading over source lines.
11438146515Sru* Optional Arguments::          Handling optional and repeated arguments.
11439146515Sru* deffnx::                      Group two or more `first' lines.
11440146515Sru* Def Cmds in Detail::          Reference for all the definition commands.
1144142660Smarkm* Def Cmd Conventions::         Conventions for writing definitions.
11442146515Sru* Sample Function Definition::  An example.
1144342660Smarkm@end menu
1144442660Smarkm
11445146515Sru
11446146515Sru@node Def Cmd Template
1144742660Smarkm@section The Template for a Definition
1144842660Smarkm@cindex Definition template
1144942660Smarkm@cindex Template for a definition
1145042660Smarkm
1145142660SmarkmThe @code{@@deffn} command is used for definitions of entities that
1145242660Smarkmresemble functions.  To write a definition using the @code{@@deffn}
1145342660Smarkmcommand, write the @code{@@deffn} command at the beginning of a line
1145442660Smarkmand follow it on the same line by the category of the entity, the name
1145542660Smarkmof the entity itself, and its arguments (if any).  Then write the body
1145642660Smarkmof the definition on succeeding lines.  (You may embed examples in the
1145742660Smarkmbody.)  Finally, end the definition with an @code{@@end deffn} command
11458146515Sruwritten on a line of its own.
1145942660Smarkm
11460146515SruThe other definition commands follow the same format: a line with the
11461146515Sru@code{@@def@dots{}} command and whatever arguments are appropriate for
11462146515Sruthat command; the body of the definition; and a corresponding
11463146515Sru@code{@@end} line.
11464146515Sru
1146542660SmarkmThe template for a definition looks like this:
1146642660Smarkm
1146742660Smarkm@example
1146842660Smarkm@group
1146942660Smarkm@@deffn @var{category} @var{name} @var{arguments}@dots{}
1147042660Smarkm@var{body-of-definition}
1147142660Smarkm@@end deffn
1147242660Smarkm@end group
1147342660Smarkm@end example
1147442660Smarkm
1147542660Smarkm@need 700
1147642660Smarkm@noindent
1147742660SmarkmFor example,
1147842660Smarkm
1147942660Smarkm@example
1148042660Smarkm@group
1148142660Smarkm@@deffn Command forward-word count
1148242660SmarkmThis command moves point forward @@var@{count@} words
1148342660Smarkm(or backward if @@var@{count@} is negative). @dots{}
1148442660Smarkm@@end deffn
1148542660Smarkm@end group
1148642660Smarkm@end example
1148742660Smarkm
1148842660Smarkm@noindent
1148942660Smarkmproduces
1149042660Smarkm
1149142660Smarkm@quotation
1149242660Smarkm@deffn Command forward-word count
1149342660SmarkmThis function moves point forward @var{count} words
1149442660Smarkm(or backward if @var{count} is negative). @dots{}
1149542660Smarkm@end deffn
1149642660Smarkm@end quotation
1149742660Smarkm
1149842660SmarkmCapitalize the category name like a title.  If the name of the
1149942660Smarkmcategory contains spaces, as in the phrase `Interactive Command',
11500146515Sruenclose it in braces.  For example:
1150142660Smarkm
1150242660Smarkm@example
1150342660Smarkm@group
1150442660Smarkm@@deffn @{Interactive Command@} isearch-forward
1150542660Smarkm@dots{}
1150642660Smarkm@@end deffn
1150742660Smarkm@end group
1150842660Smarkm@end example
1150942660Smarkm
1151042660Smarkm@noindent
1151142660SmarkmOtherwise, the second word will be mistaken for the name of the
11512146515Sruentity.  As a general rule, when any of the arguments in the heading
11513146515Sruline @emph{except} the last one are more than one word, you need to
11514146515Sruenclose them in braces.
1151542660Smarkm
1151642660SmarkmSome of the definition commands are more general than others.  The
1151742660Smarkm@code{@@deffn} command, for example, is the general definition command
11518146515Srufor functions and the like---for entities that may take arguments.
11519146515SruWhen you use this command, you specify the category to which the
11520146515Sruentity belongs.  Three predefined, specialized variations
11521146515Sru(@code{@@defun}, @code{@@defmac}, and @code{@@defspec}) specify the
11522146515Srucategory for you: ``Function'', ``Macro'', and ``Special Form''
11523146515Srurespectively.  (In Lisp, a special form is an entity much like a
11524146515Srufunction.)  Similarly, the general @code{@@defvr} command is
11525146515Sruaccompanied by several specialized variations for describing
11526146515Sruparticular kinds of variables.
1152742660Smarkm
11528146515Sru@xref{Sample Function Definition}, for a detailed example of a
11529146515Srufunction definition, including the use of @code{@@example} inside the
11530146515Srudefinition.
1153142660Smarkm
11532146515Sru@cindex Macros in definition commands
11533146515SruUnfortunately, due to implementation difficulties, macros are not expanded
11534146515Sruin @code{@@deffn} and all the other definition commands.
1153542660Smarkm
1153642660Smarkm
11537146515Sru@node Def Cmd Continuation Lines
11538146515Sru@section Definition Command Continuation Lines
11539146515Sru@cindex Continuation lines in definition commands
11540146515Sru@cindex Definition command headings, continuing
11541146515Sru@cindex @samp{@@} as continuation in definition commands
11542146515Sru
11543146515SruThe heading line of a definition command can get very long.
11544146515SruTherefore, Texinfo has a special syntax allowing them to be continued
11545146515Sruover multiple lines of the source file: a lone @samp{@@} at the end of
11546146515Srueach line to be continued.  Here's an example:
11547146515Sru
1154842660Smarkm@example
11549146515Sru@@defun fn-name @@
11550146515Sru  arg1 arg2 arg3
11551146515SruThis is the basic continued defun.
1155242660Smarkm@@end defun
1155342660Smarkm@end example
1155442660Smarkm
11555146515Sru@noindent produces:
1155642660Smarkm
11557146515Sru@defun fn-name @
11558146515Sru  arg1 arg2 arg3
11559146515SruThis is the basic continued defun.
1156042660Smarkm@end defun
1156142660Smarkm
1156242660Smarkm@noindent
11563146515SruAs you can see, the continued lines are combined, as if they had been
11564146515Srutyped on one source line.
1156542660Smarkm
11566146515SruAlthough this example only shows a one-line continuation,
11567146515Srucontinuations may extend over any number of lines; simply put an
11568146515Sru@code{@@} at the end of each line to be continued.
1156942660Smarkm
11570146515SruThe @code{@@} character does not have to be the last character on the
11571146515Sruphysical line: whitespace is allowed (and ignored) afterwards.
1157293139Sru
11573146515Sru@cindex Whitespace, collapsed around continuations
11574146515Sru@cindex Collapsing whitespace around continuations
11575146515SruIn general, any number of spaces or tabs around the @code{@@}
11576146515Srucontinuation character, both on the line with the @code{@@} and on the
11577146515Srucontinued line, are collapsed into a single space.  There is one
11578146515Sruexception: the Texinfo processors will not fully collapse whitespace
11579146515Sruaround a continuation inside braces.  For example:
11580146515Sru
11581146515Sru@example
11582146515Sru@@deffn @{Category @@
11583146515Sru  Name@} @dots{}
11584146515Sru@end example
11585146515Sru
11586146515Sru@noindent The output (not shown) has excess space between `Category'
11587146515Sruand `Name'.  In this case, simply elide any unwanted whitespace in
11588146515Sruyour input, or put the continuation @code{@@} outside braces.
11589146515Sru
11590146515Sru@code{@@} does not (currently) function as a continuation character in
11591146515Sru@emph{any} other context.  Ordinarily, @samp{@@} followed by a
11592146515Sruwhitespace character (space, tab, newline) produces a normal interword
11593146515Sruspace (@pxref{Multiple Spaces}).
11594146515Sru
11595146515Sru
11596146515Sru@node Optional Arguments
1159742660Smarkm@section Optional and Repeated Arguments
1159842660Smarkm@cindex Optional and repeated arguments
1159942660Smarkm@cindex Repeated and optional arguments
1160042660Smarkm@cindex Arguments, repeated and optional
1160142660Smarkm@cindex Syntax, optional & repeated arguments
1160242660Smarkm@cindex Meta-syntactic chars for arguments
1160342660Smarkm
1160442660SmarkmSome entities take optional or repeated arguments, which may be
1160542660Smarkmspecified by a distinctive glyph that uses square brackets and
1160642660Smarkmellipses.  For @w{example}, a special form often breaks its argument list
1160742660Smarkminto separate arguments in more complicated ways than a
11608146515Srustraightforward function.
1160942660Smarkm
1161042660Smarkm@c This is consistent with Emacs Lisp Reference manual
1161142660SmarkmAn argument enclosed within square brackets is optional.
1161242660SmarkmThus, [@var{optional-arg}] means that @var{optional-arg} is optional.
1161342660SmarkmAn argument followed by an ellipsis is optional
1161442660Smarkmand may be repeated more than once.
1161542660Smarkm@c This is consistent with Emacs Lisp Reference manual
11616146515SruThus, @var{repeated-args}@samp{@dots{}} stands for zero or more
11617146515Sruarguments.  Parentheses are used when several arguments are grouped
1161842660Smarkminto additional levels of list structure in Lisp.
1161942660Smarkm
1162042660SmarkmHere is the @code{@@defspec} line of an example of an imaginary
11621146515Sruspecial form:
1162242660Smarkm
1162342660Smarkm@quotation
1162442660Smarkm@defspec foobar (@var{var} [@var{from} @var{to} [@var{inc}]]) @var{body}@dots{}
1162542660Smarkm@end defspec
1162642660Smarkm@tex
1162742660Smarkm\vskip \parskip
1162842660Smarkm@end tex
1162942660Smarkm@end quotation
1163042660Smarkm
1163142660Smarkm@noindent
1163242660SmarkmIn this example, the arguments @var{from} and @var{to} are optional,
1163342660Smarkmbut must both be present or both absent.  If they are present,
1163442660Smarkm@var{inc} may optionally be specified as well.  These arguments are
1163542660Smarkmgrouped with the argument @var{var} into a list, to distinguish them
1163642660Smarkmfrom @var{body}, which includes all remaining elements of the
1163742660Smarkmform.@refill
1163842660Smarkm
1163942660SmarkmIn a Texinfo source file, this @code{@@defspec} line is written like
1164042660Smarkmthis (except it would not be split over two lines, as it is in this
1164142660Smarkmexample).@refill
1164242660Smarkm
1164342660Smarkm@example
1164442660Smarkm@group
1164542660Smarkm@@defspec foobar (@@var@{var@} [@@var@{from@} @@var@{to@}
11646114472Sru    [@@var@{inc@}]]) @@var@{body@}@@dots@{@}
1164742660Smarkm@end group
1164842660Smarkm@end example
1164942660Smarkm
1165042660Smarkm@noindent
1165142660SmarkmThe function is listed in the Command and Variable Index under
1165242660Smarkm@samp{foobar}.@refill
1165342660Smarkm
11654146515Sru
11655146515Sru@node deffnx
1165642660Smarkm@section Two or More `First' Lines
1165742660Smarkm@cindex Two `First' Lines for @code{@@deffn}
1165842660Smarkm@cindex Grouping two definitions together
1165942660Smarkm@cindex Definitions grouped together
1166042660Smarkm@findex deffnx
1166142660Smarkm
1166242660SmarkmTo create two or more `first' or header lines for a definition, follow
1166342660Smarkmthe first @code{@@deffn} line by a line beginning with @code{@@deffnx}.
1166442660SmarkmThe @code{@@deffnx} command works exactly like @code{@@deffn}
1166542660Smarkmexcept that it does not generate extra vertical white space between it
1166642660Smarkmand the preceding line.@refill
1166742660Smarkm
1166842660Smarkm@need 1000
1166942660SmarkmFor example,
1167042660Smarkm
1167142660Smarkm@example
1167242660Smarkm@group
1167342660Smarkm@@deffn @{Interactive Command@} isearch-forward
1167442660Smarkm@@deffnx @{Interactive Command@} isearch-backward
1167542660SmarkmThese two search commands are similar except @dots{}
1167642660Smarkm@@end deffn
1167742660Smarkm@end group
1167842660Smarkm@end example
1167942660Smarkm
1168042660Smarkm@noindent
1168142660Smarkmproduces
1168242660Smarkm
1168342660Smarkm@deffn {Interactive Command} isearch-forward
1168442660Smarkm@deffnx {Interactive Command} isearch-backward
1168542660SmarkmThese two search commands are similar except @dots{}
1168642660Smarkm@end deffn
1168742660Smarkm
1168856160SruEach definition command has an `x' form: @code{@@defunx},
1168942660Smarkm@code{@@defvrx}, @code{@@deftypefunx}, etc.
1169042660Smarkm
11691146515SruThe `x' forms work similarly to @code{@@itemx} (@pxref{itemx}).
1169242660Smarkm
11693146515Sru
11694146515Sru@node Def Cmds in Detail
1169542660Smarkm@section The Definition Commands
1169642660Smarkm
1169742660SmarkmTexinfo provides more than a dozen definition commands, all of which
1169842660Smarkmare described in this section.@refill
1169942660Smarkm
1170042660SmarkmThe definition commands automatically enter the name of the entity in
1170142660Smarkmthe appropriate index: for example, @code{@@deffn}, @code{@@defun},
1170242660Smarkmand @code{@@defmac} enter function names in the index of functions;
1170342660Smarkm@code{@@defvr} and @code{@@defvar} enter variable names in the index
1170442660Smarkmof variables.@refill
1170542660Smarkm
1170642660SmarkmAlthough the examples that follow mostly illustrate Lisp, the commands
1170742660Smarkmcan be used for other programming languages.@refill
1170842660Smarkm
1170942660Smarkm@menu
1171042660Smarkm* Functions Commands::          Commands for functions and similar entities.
1171142660Smarkm* Variables Commands::          Commands for variables and similar entities.
1171242660Smarkm* Typed Functions::             Commands for functions in typed languages.
1171342660Smarkm* Typed Variables::             Commands for variables in typed languages.
11714146515Sru* Data Types::                  The definition command for data types.
1171542660Smarkm* Abstract Objects::            Commands for object-oriented programming.
1171642660Smarkm@end menu
1171742660Smarkm
11718146515Sru@node Functions Commands
1171942660Smarkm@subsection Functions and Similar Entities
1172042660Smarkm
1172142660SmarkmThis section describes the commands for describing functions and similar
1172242660Smarkmentities:@refill
1172342660Smarkm
1172442660Smarkm@table @code
1172542660Smarkm@findex deffn
1172642660Smarkm@item @@deffn @var{category} @var{name} @var{arguments}@dots{}
1172742660SmarkmThe @code{@@deffn} command is the general definition command for
1172842660Smarkmfunctions, interactive commands, and similar entities that may take
1172942660Smarkmarguments.  You must choose a term to describe the category of entity
1173042660Smarkmbeing defined; for example, ``Function'' could be used if the entity is
1173142660Smarkma function.  The @code{@@deffn} command is written at the beginning of a
1173242660Smarkmline and is followed on the same line by the category of entity being
1173342660Smarkmdescribed, the name of this particular entity, and its arguments, if
1173442660Smarkmany.  Terminate the definition with @code{@@end deffn} on a line of its
1173542660Smarkmown.@refill
1173642660Smarkm
1173742660Smarkm@need 750
1173842660SmarkmFor example, here is a definition:
1173942660Smarkm
1174042660Smarkm@example
1174142660Smarkm@group
1174242660Smarkm@@deffn Command forward-char nchars
1174342660SmarkmMove point forward @@var@{nchars@} characters.
1174442660Smarkm@@end deffn
1174542660Smarkm@end group
1174642660Smarkm@end example
1174742660Smarkm
1174842660Smarkm@noindent
1174942660SmarkmThis shows a rather terse definition for a ``command'' named
1175042660Smarkm@code{forward-char} with one argument, @var{nchars}.
1175142660Smarkm
11752146515Sru@code{@@deffn} and prints argument names such as @var{nchars} in slanted
11753146515Srutype in the printed output, because we think of these names as
11754146515Srumetasyntactic variables---they stand for the actual argument values.
11755146515SruWithin the text of the description, however, write an argument name
11756146515Sruexplicitly with @code{@@var} to refer to the value of the argument.
11757146515SruIn the example above, we used @samp{@@var@{nchars@}} in this way.
1175842660Smarkm
11759146515SruIn the unusual case when an argument name contains @samp{--}, or
11760146515Sruanother character sequence which is treated specially
11761146515Sru(@pxref{Conventions}), use @code{@@var} around the argument.  This
11762146515Srucauses the name to be printed in slanted typewriter, instead of the
11763146515Sruregular slanted font, exactly as input.
11764146515Sru@c except for ?` and !`, but we won't explain that.
11765146515Sru
1176642660SmarkmThe template for @code{@@deffn} is:
1176742660Smarkm
1176842660Smarkm@example
1176942660Smarkm@group
1177042660Smarkm@@deffn @var{category} @var{name} @var{arguments}@dots{}
1177142660Smarkm@var{body-of-definition}
1177242660Smarkm@@end deffn
1177342660Smarkm@end group
1177442660Smarkm@end example
1177542660Smarkm
1177642660Smarkm@findex defun
1177742660Smarkm@item @@defun @var{name} @var{arguments}@dots{}
1177842660SmarkmThe @code{@@defun} command is the definition command for functions.
11779146515Sru@code{@@defun} is equivalent to @samp{@@deffn Function @dots{}}.
11780146515SruTerminate the definition with @code{@@end defun} on a line of its own.
11781146515SruThus, the template is:
1178242660Smarkm
1178342660Smarkm@example
1178442660Smarkm@group
1178542660Smarkm@@defun @var{function-name} @var{arguments}@dots{}
1178642660Smarkm@var{body-of-definition}
1178742660Smarkm@@end defun
1178842660Smarkm@end group
1178942660Smarkm@end example
1179042660Smarkm
1179142660Smarkm@findex defmac
1179242660Smarkm@item @@defmac @var{name} @var{arguments}@dots{}
1179342660SmarkmThe @code{@@defmac} command is the definition command for macros.
1179442660Smarkm@code{@@defmac} is equivalent to @samp{@@deffn Macro @dots{}} and
11795146515Sruworks like @code{@@defun}.
1179642660Smarkm
1179742660Smarkm@findex defspec
1179842660Smarkm@item @@defspec @var{name} @var{arguments}@dots{}
1179942660SmarkmThe @code{@@defspec} command is the definition command for special
1180042660Smarkmforms.  (In Lisp, a special form is an entity much like a function,
1180142660Smarkm@pxref{Special Forms,,, elisp, GNU Emacs Lisp Reference Manual}.)
1180242660Smarkm@code{@@defspec} is equivalent to @samp{@@deffn @{Special Form@}
11803146515Sru@dots{}} and works like @code{@@defun}.
1180442660Smarkm@end table
1180542660Smarkm
11806146515SruAll these commands create entries in the index of functions.
11807146515Sru
11808146515Sru
11809146515Sru@node Variables Commands
1181042660Smarkm@subsection Variables and Similar Entities
1181142660Smarkm
1181242660SmarkmHere are the commands for defining variables and similar
1181342660Smarkmentities:@refill
1181442660Smarkm
1181542660Smarkm@table @code
1181642660Smarkm@findex defvr
1181742660Smarkm@item @@defvr @var{category} @var{name}
1181842660SmarkmThe @code{@@defvr} command is a general definition command for
1181942660Smarkmsomething like a variable---an entity that records a value.  You must
1182042660Smarkmchoose a term to describe the category of entity being defined; for
1182142660Smarkmexample, ``Variable'' could be used if the entity is a variable.
1182242660SmarkmWrite the @code{@@defvr} command at the beginning of a line and
1182356160Srufollow it on the same line by the category of the entity and the
1182456160Sruname of the entity.
1182542660Smarkm
1182642660SmarkmCapitalize the category name like a title.  If the name of the category
1182742660Smarkmcontains spaces, as in the name ``User Option'', enclose it in braces.
1182842660SmarkmOtherwise, the second word will be mistaken for the name of the entity.
1182942660SmarkmFor example,
1183042660Smarkm
1183142660Smarkm@example
1183242660Smarkm@group
1183342660Smarkm@@defvr @{User Option@} fill-column
1183442660SmarkmThis buffer-local variable specifies
1183542660Smarkmthe maximum width of filled lines.
1183642660Smarkm@dots{}
1183742660Smarkm@@end defvr
1183842660Smarkm@end group
1183942660Smarkm@end example
1184042660Smarkm
1184142660SmarkmTerminate the definition with @code{@@end defvr} on a line of its
1184242660Smarkmown.@refill
1184342660Smarkm
1184442660SmarkmThe template is:
1184542660Smarkm
1184642660Smarkm@example
1184742660Smarkm@group
1184842660Smarkm@@defvr @var{category} @var{name}
1184942660Smarkm@var{body-of-definition}
1185042660Smarkm@@end defvr
1185142660Smarkm@end group
1185242660Smarkm@end example
1185342660Smarkm
1185442660Smarkm@code{@@defvr} creates an entry in the index of variables for @var{name}.
1185542660Smarkm
1185642660Smarkm@findex defvar
1185742660Smarkm@item @@defvar @var{name}
1185842660SmarkmThe @code{@@defvar} command is the definition command for variables.
1185942660Smarkm@code{@@defvar} is equivalent to @samp{@@defvr Variable
1186042660Smarkm@dots{}}.@refill
1186142660Smarkm
1186242660Smarkm@need 750
1186342660SmarkmFor example:
1186442660Smarkm
1186542660Smarkm@example
1186642660Smarkm@group
1186742660Smarkm@@defvar kill-ring
1186842660Smarkm@dots{}
1186942660Smarkm@@end defvar
1187042660Smarkm@end group
1187142660Smarkm@end example
1187242660Smarkm
1187342660SmarkmThe template is:
1187442660Smarkm
1187542660Smarkm@example
1187642660Smarkm@group
1187742660Smarkm@@defvar @var{name}
1187842660Smarkm@var{body-of-definition}
1187942660Smarkm@@end defvar
1188042660Smarkm@end group
1188142660Smarkm@end example
1188242660Smarkm
1188342660Smarkm@code{@@defvar} creates an entry in the index of variables for
1188442660Smarkm@var{name}.@refill
1188542660Smarkm
1188642660Smarkm@findex defopt
1188742660Smarkm@item @@defopt @var{name}
1188842660Smarkm@cindex User options, marking
1188942660SmarkmThe @code{@@defopt} command is the definition command for @dfn{user
1189042660Smarkmoptions}, i.e., variables intended for users to change according to
1189142660Smarkmtaste; Emacs has many such (@pxref{Variables,,, emacs, The GNU Emacs
1189242660SmarkmManual}).  @code{@@defopt} is equivalent to @samp{@@defvr @{User
11893146515SruOption@} @dots{}} and works like @code{@@defvar}.  It creates an entry
11894146515Sruin the index of variables.
1189542660Smarkm@end table
1189642660Smarkm
1189742660Smarkm
11898146515Sru@node Typed Functions
1189942660Smarkm@subsection Functions in Typed Languages
1190042660Smarkm
1190142660SmarkmThe @code{@@deftypefn} command and its variations are for describing
1190242660Smarkmfunctions in languages in which you must declare types of variables and
1190342660Smarkmfunctions, such as C and C++.
1190442660Smarkm
1190542660Smarkm@table @code
1190642660Smarkm@findex deftypefn
1190742660Smarkm@item @@deftypefn @var{category} @var{data-type} @var{name} @var{arguments}@dots{}
1190842660SmarkmThe @code{@@deftypefn} command is the general definition command for
1190942660Smarkmfunctions and similar entities that may take arguments and that are
1191042660Smarkmtyped.  The @code{@@deftypefn} command is written at the beginning of
1191142660Smarkma line and is followed on the same line by the category of entity
1191242660Smarkmbeing described, the type of the returned value, the name of this
1191342660Smarkmparticular entity, and its arguments, if any.@refill
1191442660Smarkm
1191542660Smarkm@need 800
1191642660Smarkm@noindent
1191742660SmarkmFor example,
1191842660Smarkm
1191942660Smarkm@example
1192042660Smarkm@group
1192142660Smarkm@@deftypefn @{Library Function@} int foobar
11922114472Sru  (int @@var@{foo@}, float @@var@{bar@})
1192342660Smarkm@dots{}
1192442660Smarkm@@end deftypefn
1192542660Smarkm@end group
1192642660Smarkm@end example
1192742660Smarkm
1192842660Smarkm@need 1000
1192942660Smarkm@noindent
1193042660Smarkm(where the text before the ``@dots{}'', shown above as two lines, would
1193142660Smarkmactually be a single line in a real Texinfo file) produces the following
1193242660Smarkmin Info:
1193342660Smarkm
1193442660Smarkm@smallexample
1193542660Smarkm@group
1193642660Smarkm-- Library Function: int foobar (int FOO, float BAR)
1193742660Smarkm@dots{}
1193842660Smarkm@end group
1193942660Smarkm@end smallexample
1194042660Smarkm@iftex
1194142660Smarkm
1194242660SmarkmIn a printed manual, it produces:
1194342660Smarkm
1194442660Smarkm@quotation
1194542660Smarkm@deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
1194642660Smarkm@dots{}
1194742660Smarkm@end deftypefn
1194842660Smarkm@end quotation
1194942660Smarkm@end iftex
1195042660Smarkm
1195142660SmarkmThis means that @code{foobar} is a ``library function'' that returns an
1195242660Smarkm@code{int}, and its arguments are @var{foo} (an @code{int}) and
1195342660Smarkm@var{bar} (a @code{float}).@refill
1195442660Smarkm
11955146515SruSince in typed languages, the actual names of the arguments are
11956146515Srutypically scattered among data type names and keywords, Texinfo cannot
11957146515Srufind them without help.  You can either (a)@tie{}write everything
11958146515Sruas straight text, and it will be printed in slanted type; (b)@tie{}use
11959146515Sru@code{@@var} for the variable names, which will uppercase the
11960146515Sruvariable names in Info and use the slanted typewriter font in printed
11961146515Sruoutput; (c)@tie{}use @code{@@var} for the variable names and
11962146515Sru@code{@@code} for the type names and keywords, which will be dutifully
11963146515Sruobeyed.
1196442660Smarkm
1196542660SmarkmThe template for @code{@@deftypefn} is:@refill
1196642660Smarkm
1196742660Smarkm@example
1196842660Smarkm@group
1196942660Smarkm@@deftypefn @var{category} @var{data-type} @var{name} @var{arguments} @dots{}
1197042660Smarkm@var{body-of-description}
1197142660Smarkm@@end deftypefn
1197242660Smarkm@end group
1197342660Smarkm@end example
1197442660Smarkm
1197542660Smarkm@noindent
1197642660SmarkmNote that if the @var{category} or @var{data type} is more than one
1197742660Smarkmword then it must be enclosed in braces to make it a single argument.@refill
1197842660Smarkm
1197942660SmarkmIf you are describing a procedure in a language that has packages,
1198042660Smarkmsuch as Ada, you might consider using @code{@@deftypefn} in a manner
1198142660Smarkmsomewhat contrary to the convention described in the preceding
11982146515Sruparagraphs.  For example:
1198342660Smarkm
1198442660Smarkm@example
1198542660Smarkm@group
11986146515Sru@@deftypefn stacks private push @@
11987146515Sru       (@@var@{s@}:in out stack; @@
11988114472Sru       @@var@{n@}:in integer)
1198942660Smarkm@dots{}
1199042660Smarkm@@end deftypefn
1199142660Smarkm@end group
1199242660Smarkm@end example
1199342660Smarkm
1199442660Smarkm@noindent
11995146515Sru(The @code{@@deftypefn} arguments are shown using continuations
11996146515Sru(@pxref{Def Cmd Continuation Lines}), but could be on a single line in
11997146515Srua real Texinfo file.)
1199842660Smarkm
1199942660SmarkmIn this instance, the procedure is classified as belonging to the
1200042660Smarkmpackage @code{stacks} rather than classified as a `procedure' and its
1200142660Smarkmdata type is described as @code{private}.  (The name of the procedure
1200242660Smarkmis @code{push}, and its arguments are @var{s} and @var{n}.)@refill
1200342660Smarkm
1200442660Smarkm@code{@@deftypefn} creates an entry in the index of functions for
12005146515Sru@var{name}.
1200642660Smarkm
1200742660Smarkm@item @@deftypefun @var{data-type} @var{name} @var{arguments}@dots{}
1200842660Smarkm@findex deftypefun
1200942660SmarkmThe @code{@@deftypefun} command is the specialized definition command
1201042660Smarkmfor functions in typed languages.  The command is equivalent to
12011146515Sru@samp{@@deftypefn Function @dots{}}.  The template is:
1201242660Smarkm
1201342660Smarkm@example
1201442660Smarkm@group
1201542660Smarkm@@deftypefun @var{type} @var{name} @var{arguments}@dots{}
1201642660Smarkm@var{body-of-description}
1201742660Smarkm@@end deftypefun
1201842660Smarkm@end group
1201942660Smarkm@end example
1202042660Smarkm
1202142660Smarkm@code{@@deftypefun} creates an entry in the index of functions for
12022146515Sru@var{name}.
1202342660Smarkm
1202442660Smarkm@end table
1202542660Smarkm
1202642660Smarkm
12027146515Sru@node Typed Variables
1202842660Smarkm@subsection Variables in Typed Languages
1202942660Smarkm
1203042660SmarkmVariables in typed languages are handled in a manner similar to
1203142660Smarkmfunctions in typed languages.  @xref{Typed Functions}.  The general
1203242660Smarkmdefinition command @code{@@deftypevr} corresponds to
1203342660Smarkm@code{@@deftypefn} and the specialized definition command
1203442660Smarkm@code{@@deftypevar} corresponds to @code{@@deftypefun}.@refill
1203542660Smarkm
1203642660Smarkm@table @code
1203742660Smarkm@findex deftypevr
1203842660Smarkm@item @@deftypevr @var{category} @var{data-type} @var{name}
1203942660SmarkmThe @code{@@deftypevr} command is the general definition command for
1204042660Smarkmsomething like a variable in a typed language---an entity that records
1204142660Smarkma value.  You must choose a term to describe the category of the
1204242660Smarkmentity being defined; for example, ``Variable'' could be used if the
1204342660Smarkmentity is a variable.@refill
1204442660Smarkm
1204542660SmarkmThe @code{@@deftypevr} command is written at the beginning of a line
1204642660Smarkmand is followed on the same line by the category of the entity
1204742660Smarkmbeing described, the data type, and the name of this particular
1204842660Smarkmentity.@refill
1204942660Smarkm
1205042660Smarkm@need 800
1205142660Smarkm@noindent
1205242660SmarkmFor example:
1205342660Smarkm
1205442660Smarkm@example
1205542660Smarkm@group
1205642660Smarkm@@deftypevr @{Global Flag@} int enable
1205742660Smarkm@dots{}
1205842660Smarkm@@end deftypevr
1205942660Smarkm@end group
1206042660Smarkm@end example
1206142660Smarkm
1206242660Smarkm@noindent
1206342660Smarkmproduces the following in Info:
1206442660Smarkm
1206542660Smarkm@example
1206642660Smarkm@group
1206742660Smarkm-- Global Flag: int enable
1206842660Smarkm@dots{}
1206942660Smarkm@end group
1207042660Smarkm@end example
1207142660Smarkm@iftex
1207242660Smarkm
1207342660Smarkm@noindent
1207442660Smarkmand the following in a printed manual:
1207542660Smarkm
1207642660Smarkm@quotation
1207742660Smarkm@deftypevr {Global Flag} int enable
1207842660Smarkm@dots{}
1207942660Smarkm@end deftypevr
1208042660Smarkm@end quotation
1208142660Smarkm@end iftex
1208242660Smarkm
1208342660Smarkm@need 800
1208442660SmarkmThe template is:
1208542660Smarkm
1208642660Smarkm@example
1208742660Smarkm@@deftypevr @var{category} @var{data-type} @var{name}
1208842660Smarkm@var{body-of-description}
1208942660Smarkm@@end deftypevr
1209042660Smarkm@end example
1209142660Smarkm
1209242660Smarkm@findex deftypevar
1209342660Smarkm@item @@deftypevar @var{data-type} @var{name}
1209442660SmarkmThe @code{@@deftypevar} command is the specialized definition command
1209542660Smarkmfor variables in typed languages.  @code{@@deftypevar} is equivalent
12096146515Sruto @samp{@@deftypevr Variable @dots{}}.  The template is:
1209742660Smarkm
1209842660Smarkm@example
1209942660Smarkm@group
12100146515Sru@@deftypevar @var{data-type} @var{name}
12101146515Sru@var{body-of-description}
1210242660Smarkm@@end deftypevar
1210342660Smarkm@end group
1210442660Smarkm@end example
12105146515Sru@end table
1210642660Smarkm
12107146515SruThese commands create entries in the index of variables.
1210842660Smarkm
12109146515Sru@node Data Types
12110146515Sru@subsection Data Types
12111146515Sru
12112146515SruHere is the command for data types:@refill
12113146515Sru
12114146515Sru@table @code
12115146515Sru@findex deftp
12116146515Sru@item @@deftp @var{category} @var{name} @var{attributes}@dots{}
12117146515SruThe @code{@@deftp} command is the generic definition command for data
12118146515Srutypes.  The command is written at the beginning of a line and is
12119146515Srufollowed on the same line by the category, by the name of the type
12120146515Sru(which is a word like @code{int} or @code{float}), and then by names of
12121146515Sruattributes of objects of that type.  Thus, you could use this command
12122146515Srufor describing @code{int} or @code{float}, in which case you could use
12123146515Sru@code{data type} as the category.  (A data type is a category of
12124146515Srucertain objects for purposes of deciding which operations can be
12125146515Sruperformed on them.)@refill
12126146515Sru
12127146515SruIn Lisp, for example,  @dfn{pair} names a particular data
12128146515Srutype, and an object of that type has two slots called the
12129146515Sru@sc{car} and the @sc{cdr}.  Here is how you would write the first line
12130146515Sruof a definition of @code{pair}.@refill
12131146515Sru
1213242660Smarkm@example
1213342660Smarkm@group
12134146515Sru@@deftp @{Data type@} pair car cdr
1213542660Smarkm@dots{}
12136146515Sru@@end deftp
1213742660Smarkm@end group
1213842660Smarkm@end example
1213942660Smarkm
12140146515Sru@need 950
1214142660SmarkmThe template is:
1214242660Smarkm
1214342660Smarkm@example
1214442660Smarkm@group
12145146515Sru@@deftp @var{category} @var{name-of-type} @var{attributes}@dots{}
12146146515Sru@var{body-of-definition}
12147146515Sru@@end deftp
1214842660Smarkm@end group
1214942660Smarkm@end example
1215042660Smarkm
12151146515Sru@code{@@deftp} creates an entry in the index of data types.
1215242660Smarkm@end table
1215342660Smarkm
12154146515Sru
1215556160Sru@node Abstract Objects
1215642660Smarkm@subsection Object-Oriented Programming
1215742660Smarkm
12158146515Sru@cindex Object-oriented programming
12159146515Sru
1216042660SmarkmHere are the commands for formatting descriptions about abstract
1216142660Smarkmobjects, such as are used in object-oriented programming.  A class is
1216242660Smarkma defined type of abstract object.  An instance of a class is a
1216342660Smarkmparticular object that has the type of the class.  An instance
1216442660Smarkmvariable is a variable that belongs to the class but for which each
12165146515Sruinstance has its own value.
1216642660Smarkm
12167146515Sru@menu
12168146515Sru* Variables: Object-Oriented Variables.
12169146515Sru* Methods: Object-Oriented Methods.
12170146515Sru@end menu
1217142660Smarkm
12172146515Sru
12173146515Sru@node Object-Oriented Variables
12174146515Sru@subsubsection Object-Oriented Variables
12175146515Sru
12176146515Sru@cindex Variables, object-oriented
12177146515Sru
12178146515SruThese commands allow you to define different sorts of variables in
12179146515Sruobject-oriented programming languages.
12180146515Sru
1218142660Smarkm@table @code
12182146515Sru@item @@defcv @var{category} @var{class} @var{name}
1218342660Smarkm@findex defcv
1218442660SmarkmThe @code{@@defcv} command is the general definition command for
1218542660Smarkmvariables associated with classes in object-oriented programming.  The
1218642660Smarkm@code{@@defcv} command is followed by three arguments: the category of
1218742660Smarkmthing being defined, the class to which it belongs, and its
12188146515Sruname.  For instance:
1218942660Smarkm
1219042660Smarkm@example
1219142660Smarkm@group
1219242660Smarkm@@defcv @{Class Option@} Window border-pattern
1219342660Smarkm@dots{}
1219442660Smarkm@@end defcv
1219542660Smarkm@end group
1219642660Smarkm@end example
1219742660Smarkm
12198146515Sru@noindent produces:
12199146515Sru@defcv {Class Option} Window border-pattern
12200146515Sru@dots{}
12201146515Sru@end defcv
1220242660Smarkm
12203146515Sru@code{@@defcv} creates an entry in the index of variables.
12204146515Sru
12205146515Sru@item @@deftypecv @var{category} @var{class} @var{data-type} @var{name}
12206146515Sru@findex deftypecv
12207146515SruThe @code{@@deftypecv} command is the definition command for typed
12208146515Sruclass variables in object-oriented programming.  It is analogous to
12209146515Sru@code{@@defcv} with the addition of the @var{data-type} parameter to
12210146515Sruspecify the type of the instance variable.  Ordinarily, the data type
12211146515Sruis a programming language construct that should be marked with
12212146515Sru@code{@@code}. For instance:
12213146515Sru
1221442660Smarkm@example
1221542660Smarkm@group
12216146515Sru@@deftypecv @{Class Option@} Window @@code@{int@} border-pattern
1221742660Smarkm@dots{}
12218146515Sru@@end deftypecv
1221942660Smarkm@end group
1222042660Smarkm@end example
1222142660Smarkm
12222146515Sru@noindent produces:
1222342660Smarkm
12224146515Sru@deftypecv {Class Option} Window @code{int} border-pattern
12225146515Sru@dots{}
12226146515Sru@end deftypecv
12227146515Sru
12228146515Sru@code{@@deftypecv} creates an entry in the index of variables.
12229146515Sru
12230146515Sru@item @@defivar @var{class} @var{name}
1223142660Smarkm@findex defivar
1223242660SmarkmThe @code{@@defivar} command is the definition command for instance
1223342660Smarkmvariables in object-oriented programming.  @code{@@defivar} is
12234146515Sruequivalent to @samp{@@defcv @{Instance Variable@} @dots{}}.  For
12235146515Sruinstance:
1223642660Smarkm
1223742660Smarkm@example
1223842660Smarkm@group
12239146515Sru@@defivar Window border-pattern
12240146515Sru@dots{}
1224142660Smarkm@@end defivar
1224242660Smarkm@end group
1224342660Smarkm@end example
1224442660Smarkm
12245146515Sru@noindent produces:
12246146515Sru
12247146515Sru@defivar Window border-pattern
12248146515Sru@dots{}
12249146515Sru@end defivar
12250146515Sru
1225142660Smarkm@code{@@defivar} creates an entry in the index of variables.
1225242660Smarkm
12253146515Sru@item @@deftypeivar @var{class} @var{data-type} @var{name}
1225456160Sru@findex deftypeivar
1225556160SruThe @code{@@deftypeivar} command is the definition command for typed
12256146515Sruinstance variables in object-oriented programming.  It is analogous to
1225756160Sru@code{@@defivar} with the addition of the @var{data-type} parameter to
12258146515Sruspecify the type of the instance variable.  Ordinarily, the data type
12259146515Sruis a programming language construct that should be marked with
12260146515Sru@code{@@code}. For instance:
1226156160Sru
12262146515Sru@example
12263146515Sru@group
12264146515Sru@@deftypeivar Window @@code@{int@} border-pattern
12265146515Sru@dots{}
12266146515Sru@@end deftypeivar
12267146515Sru@end group
12268146515Sru@end example
12269146515Sru
12270146515Sru@noindent produces:
12271146515Sru
12272146515Sru@deftypeivar Window @code{int} border-pattern
12273146515Sru@dots{}
12274146515Sru@end deftypeivar
12275146515Sru
12276146515Sru@code{@@deftypeivar} creates an entry in the index of variables.
12277146515Sru
12278146515Sru@end table
12279146515Sru
12280146515Sru@node Object-Oriented Methods
12281146515Sru@subsubsection Object-Oriented Methods
12282146515Sru
12283146515Sru@cindex Methods, object-oriented
12284146515Sru
12285146515SruThese commands allow you to define different sorts of function-like
12286146515Sruentities resembling methods in object-oriented programming languages.
12287146515SruThese entities take arguments, as functions do, but are associated with
12288146515Sruparticular classes of objects.
12289146515Sru
12290146515Sru@table @code
12291146515Sru
1229242660Smarkm@findex defop
1229342660Smarkm@item @@defop @var{category} @var{class} @var{name} @var{arguments}@dots{}
12294146515SruThe @code{@@defop} command is the general definition command for these
12295146515Srumethod-like entities.
1229642660Smarkm
1229742660SmarkmFor example, some systems have constructs called @dfn{wrappers} that
1229842660Smarkmare associated with classes as methods are, but that act more like
1229942660Smarkmmacros than like functions.  You could use @code{@@defop Wrapper} to
1230042660Smarkmdescribe one of these.@refill
1230142660Smarkm
1230242660SmarkmSometimes it is useful to distinguish methods and @dfn{operations}.
1230342660SmarkmYou can think of an operation as the specification for a method.
1230442660SmarkmThus, a window system might specify that all window classes have a
1230542660Smarkmmethod named @code{expose}; we would say that this window system
1230642660Smarkmdefines an @code{expose} operation on windows in general.  Typically,
1230742660Smarkmthe operation has a name and also specifies the pattern of arguments;
1230842660Smarkmall methods that implement the operation must accept the same
1230942660Smarkmarguments, since applications that use the operation do so without
1231042660Smarkmknowing which method will implement it.@refill
1231142660Smarkm
1231242660SmarkmOften it makes more sense to document operations than methods.  For
1231342660Smarkmexample, window application developers need to know about the
1231442660Smarkm@code{expose} operation, but need not be concerned with whether a
1231542660Smarkmgiven class of windows has its own method to implement this operation.
1231642660SmarkmTo describe this operation, you would write:@refill
1231742660Smarkm
1231842660Smarkm@example
1231942660Smarkm@@defop Operation windows expose
1232042660Smarkm@end example
1232142660Smarkm
1232242660SmarkmThe @code{@@defop} command is written at the beginning of a line and
1232342660Smarkmis followed on the same line by the overall name of the category of
1232442660Smarkmoperation, the name of the class of the operation, the name of the
1232542660Smarkmoperation, and its arguments, if any.@refill
1232642660Smarkm
1232742660SmarkmThe template is:
1232842660Smarkm@example
1232942660Smarkm@group
1233042660Smarkm@@defop @var{category} @var{class} @var{name} @var{arguments}@dots{}
1233142660Smarkm@var{body-of-definition}
1233242660Smarkm@@end defop
1233342660Smarkm@end group
1233442660Smarkm@end example
1233542660Smarkm
1233642660Smarkm@code{@@defop} creates an entry, such as `@code{expose} on
1233742660Smarkm@code{windows}', in the index of functions.@refill
1233842660Smarkm
1233956160Sru@findex deftypeop
1234056160Sru@item @@deftypeop @var{category} @var{class} @var{data-type} @var{name} @var{arguments}@dots{}
1234156160SruThe @code{@@deftypeop} command is the definition command for typed
1234256160Sruoperations in object-oriented programming.  It is similar to
1234356160Sru@code{@@defop} with the addition of the @var{data-type} parameter to
1234456160Sruspecify the return type of the method.  @code{@@deftypeop} creates an
1234556160Sruentry in the index of functions.
1234656160Sru
1234742660Smarkm@item @@defmethod @var{class} @var{name} @var{arguments}@dots{}
1234842660Smarkm@findex defmethod
1234942660SmarkmThe @code{@@defmethod} command is the definition command for methods
1235042660Smarkmin object-oriented programming.  A method is a kind of function that
1235142660Smarkmimplements an operation for a particular class of objects and its
1235256160Srusubclasses.
1235356160Sru@ignore
1235456160Sru@c ADR: Who cares?!?
1235556160Sru@c KB: Oh, I don't know, I think this info is crucial!
1235656160SruIn the Lisp Machine, methods actually were functions, but
1235742660Smarkmthey were usually defined with @code{defmethod}.
1235856160Sru@end ignore
1235942660Smarkm
1236042660Smarkm@code{@@defmethod} is equivalent to @samp{@@defop Method @dots{}}.
1236142660SmarkmThe command is written at the beginning of a line and is followed by
1236242660Smarkmthe name of the class of the method, the name of the method, and its
1236342660Smarkmarguments, if any.@refill
1236442660Smarkm
1236542660Smarkm@noindent
1236656160SruFor example:
1236742660Smarkm@example
1236842660Smarkm@group
1236942660Smarkm@@defmethod @code{bar-class} bar-method argument
1237042660Smarkm@dots{}
1237142660Smarkm@@end defmethod
1237242660Smarkm@end group
1237342660Smarkm@end example
1237442660Smarkm
1237542660Smarkm@noindent
1237642660Smarkmillustrates the definition for a method called @code{bar-method} of
12377146515Sruthe class @code{bar-class}.  The method takes an argument.
1237842660Smarkm
12379146515Sru@code{@@defmethod} creates an entry in the index of functions.
1238042660Smarkm
1238142660Smarkm@item @@deftypemethod @var{class} @var{data-type} @var{name} @var{arguments}@dots{}
1238242660Smarkm@findex defmethod
1238342660SmarkmThe @code{@@deftypemethod} command is the definition command for methods
1238442660Smarkmin object-oriented typed languages, such as C++ and Java.  It is similar
1238542660Smarkmto the @code{@@defmethod} command with the addition of the
1238642660Smarkm@var{data-type} parameter to specify the return type of the method.
12387146515Sru@code{@@deftypemethod} creates an entry in the index of functions.
1238842660Smarkm
1238942660Smarkm@end table
1239042660Smarkm
1239142660Smarkm
12392146515Sru@node Def Cmd Conventions
1239342660Smarkm@section Conventions for Writing Definitions
1239442660Smarkm@cindex Definition conventions
1239542660Smarkm@cindex Conventions for writing definitions
1239642660Smarkm
1239742660SmarkmWhen you write a definition using @code{@@deffn}, @code{@@defun}, or
1239842660Smarkmone of the other definition commands, please take care to use
1239942660Smarkmarguments that indicate the meaning, as with the @var{count} argument
1240042660Smarkmto the @code{forward-word} function.  Also, if the name of an argument
1240142660Smarkmcontains the name of a type, such as @var{integer}, take care that the
1240242660Smarkmargument actually is of that type.@refill
1240342660Smarkm
12404146515Sru
12405146515Sru@node Sample Function Definition
1240642660Smarkm@section A Sample Function Definition
1240742660Smarkm@cindex Function definitions
1240842660Smarkm@cindex Command definitions
1240942660Smarkm@cindex Macro definitions
1241042660Smarkm@cindex Sample function definition
1241142660Smarkm
1241242660SmarkmA function definition uses the @code{@@defun} and @code{@@end defun}
1241342660Smarkmcommands.  The name of the function follows immediately after the
1241442660Smarkm@code{@@defun} command and it is followed, on the same line, by the
1241542660Smarkmparameter list.@refill
1241642660Smarkm
1241742660SmarkmHere is a definition from @ref{Calling Functions,,, elisp, The GNU Emacs
1241842660SmarkmLisp Reference Manual}.
1241942660Smarkm
1242042660Smarkm@quotation
1242142660Smarkm@defun apply function &rest arguments
1242242660Smarkm@code{apply} calls @var{function} with @var{arguments}, just
1242342660Smarkmlike @code{funcall} but with one difference: the last of
1242442660Smarkm@var{arguments} is a list of arguments to give to
1242542660Smarkm@var{function}, rather than a single argument.  We also say
1242642660Smarkmthat this list is @dfn{appended} to the other arguments.
1242742660Smarkm
1242842660Smarkm@code{apply} returns the result of calling @var{function}.
1242942660SmarkmAs with @code{funcall}, @var{function} must either be a Lisp
1243042660Smarkmfunction or a primitive function; special forms and macros
1243142660Smarkmdo not make sense in @code{apply}.
1243242660Smarkm
1243342660Smarkm@example
1243442660Smarkm(setq f 'list)
12435114472Sru    @result{} list
1243642660Smarkm(apply f 'x 'y 'z)
1243742660Smarkm@error{} Wrong type argument: listp, z
1243842660Smarkm(apply '+ 1 2 '(3 4))
12439114472Sru    @result{} 10
1244042660Smarkm(apply '+ '(1 2 3 4))
12441114472Sru    @result{} 10
1244242660Smarkm
1244342660Smarkm(apply 'append '((a b c) nil (x y z) nil))
12444114472Sru    @result{} (a b c x y z)
1244542660Smarkm@end example
1244642660Smarkm
1244742660SmarkmAn interesting example of using @code{apply} is found in the description
1244842660Smarkmof @code{mapcar}.@refill
1244942660Smarkm@end defun
1245042660Smarkm@end quotation
1245142660Smarkm
1245242660Smarkm@need 1200
1245342660SmarkmIn the Texinfo source file, this example looks like this:
1245442660Smarkm
1245542660Smarkm@example
1245642660Smarkm@group
1245742660Smarkm@@defun apply function &rest arguments
1245842660Smarkm@@code@{apply@} calls @@var@{function@} with
1245942660Smarkm@@var@{arguments@}, just like @@code@{funcall@} but with one
1246042660Smarkmdifference: the last of @@var@{arguments@} is a list of
1246142660Smarkmarguments to give to @@var@{function@}, rather than a single
1246242660Smarkmargument.  We also say that this list is @@dfn@{appended@}
1246342660Smarkmto the other arguments.
1246442660Smarkm@end group
1246542660Smarkm
1246642660Smarkm@group
1246742660Smarkm@@code@{apply@} returns the result of calling
1246842660Smarkm@@var@{function@}.  As with @@code@{funcall@},
1246942660Smarkm@@var@{function@} must either be a Lisp function or a
1247042660Smarkmprimitive function; special forms and macros do not make
1247142660Smarkmsense in @@code@{apply@}.
1247242660Smarkm@end group
1247342660Smarkm
1247442660Smarkm@group
1247542660Smarkm@@example
1247642660Smarkm(setq f 'list)
12477114472Sru    @@result@{@} list
1247842660Smarkm(apply f 'x 'y 'z)
1247942660Smarkm@@error@{@} Wrong type argument: listp, z
1248042660Smarkm(apply '+ 1 2 '(3 4))
12481114472Sru    @@result@{@} 10
1248242660Smarkm(apply '+ '(1 2 3 4))
12483114472Sru    @@result@{@} 10
1248442660Smarkm
1248542660Smarkm(apply 'append '((a b c) nil (x y z) nil))
12486114472Sru    @@result@{@} (a b c x y z)
1248742660Smarkm@@end example
1248842660Smarkm@end group
1248942660Smarkm
1249042660Smarkm@group
1249142660SmarkmAn interesting example of using @@code@{apply@} is found
1249256160Sruin the description of @@code@{mapcar@}.
1249342660Smarkm@@end defun
1249442660Smarkm@end group
1249542660Smarkm@end example
1249642660Smarkm
1249742660Smarkm@noindent
1249842660SmarkmIn this manual, this function is listed in the Command and Variable
1249942660SmarkmIndex under @code{apply}.@refill
1250042660Smarkm
1250142660SmarkmOrdinary variables and user options are described using a format like
1250242660Smarkmthat for functions except that variables do not take arguments.
1250342660Smarkm
1250442660Smarkm
1250556160Sru@node Conditionals
1250656160Sru@chapter Conditionally Visible Text
1250756160Sru@cindex Conditionally visible text
1250856160Sru@cindex Text, conditionally visible
1250956160Sru@cindex Visibility of conditional text
1251056160Sru@cindex If text conditionally visible
1251142660Smarkm
12512146515SruThe @dfn{conditional commands} allow you to use different text for
12513146515Srudifferent output formats, or for general conditions that you define.
12514146515SruFor example, you can use them to specify different text for the
12515146515Sruprinted manual and the Info output.
1251642660Smarkm
1251756160SruThe conditional commands comprise the following categories.
1251842660Smarkm
1251942660Smarkm@itemize @bullet
1252042660Smarkm@item
12521146515SruCommands specific to an output format (Info, @TeX{}, HTML, @dots{}).
12522146515Sru
12523146515Sru@item
12524146515SruCommands specific to any output format @emph{other} than a given
12525146515Sruone (not Info, not @TeX{}, @dots{}).
12526146515Sru
12527146515Sru@item
12528146515Sru`Raw' formatter text for any output format, passed straight
12529146515Sruthrough with no interpretation of @@-commands.
12530146515Sru
12531146515Sru@item
12532146515SruFormat-independent variable substitutions, and testing if a variable
12533146515Sruis set or clear.
12534146515Sru
1253542660Smarkm@end itemize
1253642660Smarkm
1253742660Smarkm@menu
12538146515Sru* Conditional Commands::        Text for a given format.
12539146515Sru* Conditional Not Commands::    Text for any format other than a given one.
12540146515Sru* Raw Formatter Commands::      Using raw formatter commands.
12541146515Sru* set clear value::             Variable tests and substitutions.
12542146515Sru* Conditional Nesting::         Using conditionals inside conditionals.
1254342660Smarkm@end menu
1254442660Smarkm
1254542660Smarkm
1254656160Sru@node Conditional Commands
1254756160Sru@section Conditional Commands
1254856160Sru
12549146515SruTexinfo has an @code{@@if@var{format}} environment for each output
12550146515Sruformat, to allow conditional inclusion of text for a particular output
12551146515Sruformat.
12552100513Sru
1255342660Smarkm@findex ifinfo
12554146515Sru@code{@@ifinfo} begins segments of text that should be ignored by
12555146515Sru@TeX{} when it typesets the printed manual, and by @command{makeinfo}
12556146515Sruwhen not producing Info output.  The segment of text appears only in
12557146515Sruthe Info file and, for historical compatibility, the plain text
12558146515Sruoutput.
1255942660Smarkm
12560146515Sru@findex ifdocbook
1256142660Smarkm@findex ifhtml
12562100513Sru@findex ifplaintext
12563114472Sru@findex iftex
12564114472Sru@findex ifxml
12565146515SruThe environments for the other formats are analogous:
1256642660Smarkm
12567146515Sru@table @code
12568146515Sru@item @@ifdocbook @dots{} @@end ifdocbook
12569146515SruText to appear only in the Docbook output.
1257042660Smarkm
12571146515Sru@item @@ifhtml @dots{} @@end ifhtml
12572146515SruText to appear only in the HTML output.
12573146515Sru
12574146515Sru@item @@ifplaintext @dots{} @@end ifplaintext
12575146515SruText to appear only in the plain text output.
12576146515Sru
12577146515Sru@item @@iftex @dots{} @@end iftex
12578146515SruText to appear only in the printed manual.
12579146515Sru
12580146515Sru@item @@ifxml @dots{} @@end ifxml
12581146515SruText to appear only in the XML output.
12582146515Sru@end table
12583146515Sru
12584146515SruThe @code{@@if@dots{}} and @code{@@end if@dots{}} commands must appear
12585146515Sruon lines by themselves in your source file.
12586146515Sru
12587146515SruHere is an example showing all these conditionals:
12588146515Sru
1258942660Smarkm@example
1259042660Smarkm@@iftex
1259142660SmarkmThis text will appear only in the printed manual.
1259242660Smarkm@@end iftex
1259342660Smarkm@@ifinfo
12594146515SruHowever, this text will appear only in Info and plain text.
1259542660Smarkm@@end ifinfo
1259656160Sru@@ifhtml
1259756160SruAnd this text will only appear in HTML.
1259856160Sru@@end ifhtml
12599100513Sru@@ifplaintext
12600100513SruWhereas this text will only appear in plain text.
12601100513Sru@@end ifplaintext
12602114472Sru@@ifxml
12603146515SruNotwithstanding that this will only appear in XML.
12604114472Sru@@end ifxml
12605146515Sru@@ifdocbook
12606146515SruNevertheless, this will only appear in Docbook.
12607146515Sru@@end ifdocbook
1260842660Smarkm@end example
1260942660Smarkm
1261042660Smarkm@noindent
1261142660SmarkmThe preceding example produces the following line:
12612146515Sru
1261342660Smarkm@iftex
1261442660SmarkmThis text will appear only in the printed manual.
1261542660Smarkm@end iftex
1261642660Smarkm@ifinfo
12617146515SruHowever, this text will appear only in Info and plain text.
1261842660Smarkm@end ifinfo
1261956160Sru@ifhtml
1262056160SruAnd this text will only appear in HTML.
1262156160Sru@end ifhtml
12622100513Sru@ifplaintext
12623100513SruWhereas this text will only appear in plain text.
12624100513Sru@end ifplaintext
12625114472Sru@ifxml
12626146515SruNotwithstanding that this will only appear in XML.
12627114472Sru@end ifxml
12628146515Sru@ifdocbook
12629146515SruNevertheless, this will only appear in Docbook.
12630146515Sru@end ifdocbook
1263142660Smarkm
1263242660Smarkm@noindent
1263356160SruNotice that you only see one of the input lines, depending on which
1263456160Sruversion of the manual you are reading.
1263542660Smarkm
1263642660Smarkm
1263756160Sru@node Conditional Not Commands
1263842660Smarkm@section Conditional Not Commands
12639146515Sru@findex ifnotdocbook
1264042660Smarkm@findex ifnothtml
1264142660Smarkm@findex ifnotinfo
12642100513Sru@findex ifnotplaintext
1264342660Smarkm@findex ifnottex
12644114472Sru@findex ifnotxml
1264542660Smarkm
1264642660SmarkmYou can specify text to be included in any output format @emph{other}
12647146515Sruthan a given one with the @code{@@ifnot@dots{}} environments:
12648146515Sru
1264942660Smarkm@example
12650146515Sru@@ifnotdocbook @dots{} @@end ifnotdocbook
1265142660Smarkm@@ifnothtml @dots{} @@end ifnothtml
1265242660Smarkm@@ifnotinfo @dots{} @@end ifnotinfo
12653100513Sru@@ifnotplaintext @dots{} @@end ifnotplaintext
1265442660Smarkm@@ifnottex @dots{} @@end ifnottex
12655114472Sru@@ifnotxml @dots{} @@end ifnotxml
1265642660Smarkm@end example
12657146515Sru
1265842660Smarkm@noindent
12659114472SruThe @code{@@ifnot@dots{}} command and the @code{@@end} command must
12660114472Sruappear on lines by themselves in your actual source file.
1266142660Smarkm
12662114472SruIf the output file is being made in the given format, the
12663114472Sruregion is @emph{ignored}.  Otherwise, it is included.
1266442660Smarkm
12665146515SruThere is one exception (for historical compatibility):
12666146515Sru@code{@@ifnotinfo} text is omitted for both Info and plain text
12667146515Sruoutput, not just Info.  To specify text which appears only in Info and
12668146515Srunot in plain text, use @code{@@ifnotplaintext}, like this:
12669146515Sru
12670100513Sru@example
12671114472Sru@@ifinfo
12672114472Sru@@ifnotplaintext
12673100513SruThis will be in Info, but not plain text.
12674114472Sru@@end ifnotplaintext
12675114472Sru@@end ifinfo
12676100513Sru@end example
12677100513Sru
1267842660SmarkmThe regions delimited by these commands are ordinary Texinfo source as
1267956160Sruwith @code{@@iftex}, not raw formatter source as with @code{@@tex}
1268056160Sru(@pxref{Raw Formatter Commands}).
1268142660Smarkm
1268242660Smarkm
1268393139Sru@node Raw Formatter Commands
1268442660Smarkm@section Raw Formatter Commands
12685114472Sru@cindex Raw formatter commands
1268642660Smarkm@cindex @TeX{} commands, using ordinary
1268742660Smarkm@cindex Ordinary @TeX{} commands, using
1268842660Smarkm@cindex Commands using raw @TeX{}
12689146515Sru@cindex Docbook, including raw
12690114472Sru@cindex HTML, including raw
12691114472Sru@cindex XML, including raw
12692146515Sru@cindex Plain @TeX{}
1269342660Smarkm
12694116525SruInside a region delineated by @code{@@iftex} and @code{@@end iftex},
12695116525Sruyou can embed some raw @TeX{} commands.  The Texinfo processors will
12696116525Sruignore such a region unless @TeX{} output is being produced.  You can
12697116525Sruwrite the @TeX{} commands as you would write them in a normal @TeX{}
12698116525Srufile, except that you must replace the @samp{\} used by @TeX{} with an
12699116525Sru@samp{@@}.  For example, in the @code{@@titlepage} section of a
1270042660SmarkmTexinfo file, you can use the @TeX{} command @code{@@vskip} to format
1270142660Smarkmthe copyright page.  (The @code{@@titlepage} command causes Info to
1270242660Smarkmignore the region automatically, as it does with the @code{@@iftex}
1270342660Smarkmcommand.)
1270442660Smarkm
12705116525SruHowever, most features of plain @TeX{} will not work within
12706116525Sru@code{@@iftex}, as they are overridden by Texinfo features.  The
12707116525Srupurpose of @code{@@iftex} is to provide conditional processing for the
12708116525SruTexinfo source, not provide access to underlying formatting features.
1270942660Smarkm
1271042660Smarkm@findex tex
1271142660SmarkmYou can enter plain @TeX{} completely, and use @samp{\} in the @TeX{}
1271242660Smarkmcommands, by delineating a region with the @code{@@tex} and @code{@@end
12713116525Srutex} commands.  All plain @TeX{} commands and category codes are
12714116525Srurestored within an @code{@@tex} region.  The sole exception is that the
1271556160Sru@code{@@} character still introduces a command, so that @code{@@end tex}
12716116525Srucan be recognized properly.  As with @code{@@iftex}, Texinfo
12717116525Sruprocessors will ignore such a region unless @TeX{} output is being produced.
1271842660Smarkm
12719116525Sru@findex \gdef @r{within @code{@@tex}}
12720116525SruIn complex cases, you may wish to define new @TeX{} macros within
12721116525Sru@code{@@tex}.  You must use @code{\gdef} to do this, not @code{\def},
12722116525Srubecause @code{@@tex} regions are processed in a @TeX{} group.
12723116525Sru
1272442660Smarkm@cindex Mathematical expressions
12725116525SruAs an example, here is a mathematical expression written in plain @TeX{}:
1272642660Smarkm
1272742660Smarkm@example
1272842660Smarkm@@tex
1272942660Smarkm$$ \chi^2 = \sum_@{i=1@}^N
12730114472Sru         \left (y_i - (a + b x_i)
12731114472Sru         \over \sigma_i\right)^2 $$
1273242660Smarkm@@end tex
1273342660Smarkm@end example
1273442660Smarkm
1273542660Smarkm@noindent
1273642660SmarkmThe output of this example will appear only in a printed manual.  If
1273742660Smarkmyou are reading this in Info, you will not see the equation that appears
1273842660Smarkmin the printed manual.
1273942660Smarkm@iftex
1274042660SmarkmIn a printed manual, the above expression looks like
1274142660Smarkmthis:
1274242660Smarkm@end iftex
1274342660Smarkm
1274442660Smarkm@tex
1274542660Smarkm$$ \chi^2 = \sum_{i=1}^N
12746114472Sru         \left(y_i - (a + b x_i)
12747114472Sru         \over \sigma_i\right)^2 $$
1274842660Smarkm@end tex
1274942660Smarkm
1275042660Smarkm@findex ifhtml
1275142660Smarkm@findex html
1275242660SmarkmAnalogously, you can use @code{@@ifhtml @dots{} @@end ifhtml} to delimit
1275342660Smarkma region to be included in HTML output only, and @code{@@html @dots{}
12754146515Sru@@end html} for a region of raw HTML.
1275542660Smarkm
12756114472Sru@findex ifxml
12757114472Sru@findex xml
12758146515SruLikewise, you can use @code{@@ifxml @dots{} @@end ifxml} to delimit
12759114472Srua region to be included in XML output only, and @code{@@xml @dots{}
12760146515Sru@@end xml} for a region of raw XML.
1276142660Smarkm
12762146515Sru@findex ifdocbook
12763146515Sru@findex docbook
12764146515SruAgain likewise, you can use @code{@@ifdocbook @dots{} @@end ifdocbook}
12765146515Sruto delimit a region to be included in Docbook output only, and
12766146515Sru@code{@@docbook @dots{} @@end docbook} for a region of raw Docbook.
12767114472Sru
12768146515SruIn all cases, the exception to the raw processing is that @code{@@} is
12769146515Srustill an escape character, so the @code{@@end} command can be
12770146515Srurecognized.
12771146515Sru
12772146515Sru
1277356160Sru@node set clear value
1277442660Smarkm@section @code{@@set}, @code{@@clear}, and @code{@@value}
1277542660Smarkm
1277642660SmarkmYou can direct the Texinfo formatting commands to format or ignore parts
1277742660Smarkmof a Texinfo file with the @code{@@set}, @code{@@clear}, @code{@@ifset},
12778146515Sruand @code{@@ifclear} commands.
1277942660Smarkm
12780146515SruHere are brief descriptions of these commands, see the following
12781146515Srusections for more details:
1278242660Smarkm
1278342660Smarkm@table @code
1278493139Sru@item @@set @var{flag} [@var{value}]
1278593139SruSet the variable @var{flag}, to the optional @var{value} if specifed.
1278642660Smarkm
1278742660Smarkm@item @@clear @var{flag}
1278893139SruUndefine the variable @var{flag}, whether or not it was previously defined.
1278942660Smarkm
1279042660Smarkm@item @@ifset @var{flag}
1279193139SruIf @var{flag} is set, text through the next @code{@@end ifset} command
1279293139Sruis formatted.  If @var{flag} is clear, text through the following
1279393139Sru@code{@@end ifset} command is ignored.
1279442660Smarkm
1279542660Smarkm@item @@ifclear @var{flag}
1279693139SruIf @var{flag} is set, text through the next @code{@@end ifclear} command
1279793139Sruis ignored.  If @var{flag} is clear, text through the following
1279893139Sru@code{@@end ifclear} command is formatted.
1279942660Smarkm@end table
1280042660Smarkm
1280193139Sru@menu
1280293139Sru* set value::                   Expand a flag variable to a string.
1280393139Sru* ifset ifclear::               Format a region if a flag is set.
1280493139Sru* value Example::               An easy way to update edition information.
1280593139Sru@end menu
1280656160Sru
1280793139Sru
1280856160Sru@node set value
1280956160Sru@subsection @code{@@set} and @code{@@value}
1281042660Smarkm@findex value
1281142660Smarkm
12812146515SruYou use the @code{@@set} command to specify a value for a flag, which
12813146515Sruis later expanded by the @code{@@value} command.
1281442660Smarkm
12815146515SruA @dfn{flag} (aka @dfn{variable}) is an identifier.  It is best to use
12816146515Sruonly letters and numerals in a flag name, not @samp{-} or
12817146515Sru@samp{_}---they will work in some contexts, but not all, due to
12818146515Srulimitations in @TeX{}.
1281993139Sru
1282093139SruThe value is the remainder of the input line, and can contain anything.
1282193139Sru
1282242660SmarkmWrite the @code{@@set} command like this:
1282342660Smarkm
1282442660Smarkm@example
1282542660Smarkm@@set foo This is a string.
1282642660Smarkm@end example
1282742660Smarkm
1282842660Smarkm@noindent
1282956160SruThis sets the value of the flag @code{foo} to ``This is a string.''.
1283042660Smarkm
1283156160SruThe Texinfo formatters then replace an @code{@@value@{@var{flag}@}}
1283256160Srucommand with the string to which @var{flag} is set.  Thus, when
1283393139Sru@code{foo} is set as shown above, the Texinfo formatters convert this:
1283442660Smarkm
1283542660Smarkm@example
1283642660Smarkm@group
1283742660Smarkm@@value@{foo@}
1283893139Sru@exdent @r{to this:}
1283942660SmarkmThis is a string.
1284042660Smarkm@end group
1284142660Smarkm@end example
1284242660Smarkm
1284342660SmarkmYou can write an @code{@@value} command within a paragraph; but you
1284442660Smarkmmust write an @code{@@set} command on a line of its own.
1284542660Smarkm
1284642660SmarkmIf you write the @code{@@set} command like this:
1284742660Smarkm
1284842660Smarkm@example
1284942660Smarkm@@set foo
1285042660Smarkm@end example
1285142660Smarkm
1285242660Smarkm@noindent
1285393139Sruwithout specifying a string, the value of @code{foo} is the empty string.
1285442660Smarkm
1285556160SruIf you clear a previously set flag with @code{@@clear @var{flag}}, a
1285693139Srusubsequent @code{@@value@{flag@}} command will report an error.
1285742660Smarkm
12858146515SruFor example, if you set @code{foo} as follows:
1285942660Smarkm
1286042660Smarkm@example
12861146515Sru@@set howmuch very, very, very
1286242660Smarkm@end example
1286342660Smarkm
1286442660Smarkm@noindent
1286542660Smarkmthen the formatters transform
1286642660Smarkm
1286742660Smarkm@example
1286842660Smarkm@group
12869146515SruIt is a @@value@{howmuch@} wet day.
1287042660Smarkm@exdent @r{into}
1287142660SmarkmIt is a very, very, very wet day.
1287242660Smarkm@end group
1287342660Smarkm@end example
1287442660Smarkm
1287542660SmarkmIf you write
1287642660Smarkm
1287742660Smarkm@example
12878146515Sru@@clear howmuch
1287942660Smarkm@end example
1288042660Smarkm
1288142660Smarkm@noindent
1288242660Smarkmthen the formatters transform
1288342660Smarkm
1288442660Smarkm@example
1288542660Smarkm@group
12886146515SruIt is a @@value@{howmuch@} wet day.
1288742660Smarkm@exdent @r{into}
12888146515SruIt is a @{No value for "howmuch"@} wet day.
1288942660Smarkm@end group
1289042660Smarkm@end example
1289142660Smarkm
1289256160Sru
1289393139Sru@node ifset ifclear
1289493139Sru@subsection @code{@@ifset} and @code{@@ifclear}
1289593139Sru
1289693139Sru@findex ifset
1289793139SruWhen a @var{flag} is set, the Texinfo formatting commands format text
1289893139Srubetween subsequent pairs of @code{@@ifset @var{flag}} and @code{@@end
1289993139Sruifset} commands.  When the @var{flag} is cleared, the Texinfo formatting
1290093139Srucommands do @emph{not} format the text.  @code{@@ifclear} operates
1290193139Sruanalogously.
1290293139Sru
1290393139SruWrite the conditionally formatted text between @code{@@ifset @var{flag}}
1290493139Sruand @code{@@end ifset} commands, like this:
1290593139Sru
1290693139Sru@example
1290793139Sru@group
1290893139Sru@@ifset @var{flag}
1290993139Sru@var{conditional-text}
1291093139Sru@@end ifset
1291193139Sru@end group
1291293139Sru@end example
1291393139Sru
1291493139SruFor example, you can create one document that has two variants, such as
1291593139Srua manual for a `large' and `small' model:
1291693139Sru
12917146515Sru@cindex Shrubbery
1291893139Sru@example
1291993139SruYou can use this machine to dig up shrubs
1292093139Sruwithout hurting them.
1292193139Sru
1292293139Sru@@set large
1292393139Sru
1292493139Sru@@ifset large
1292593139SruIt can also dig up fully grown trees.
1292693139Sru@@end ifset
1292793139Sru
1292893139SruRemember to replant promptly @dots{}
1292993139Sru@end example
1293093139Sru
1293193139Sru@noindent
1293293139SruIn the example, the formatting commands will format the text between
1293393139Sru@code{@@ifset large} and @code{@@end ifset} because the @code{large}
1293493139Sruflag is set.
1293593139Sru
1293693139SruWhen @var{flag} is cleared, the Texinfo formatting commands do
1293793139Sru@emph{not} format the text between @code{@@ifset @var{flag}} and
1293893139Sru@code{@@end ifset}; that text is ignored and does not appear in either
1293993139Sruprinted or Info output.
1294093139Sru
1294193139SruFor example, if you clear the flag of the preceding example by writing
1294293139Sruan @code{@@clear large} command after the @code{@@set large} command
1294393139Sru(but before the conditional text), then the Texinfo formatting commands
1294493139Sruignore the text between the @code{@@ifset large} and @code{@@end ifset}
1294593139Srucommands.  In the formatted output, that text does not appear; in both
1294693139Sruprinted and Info output, you see only the lines that say, ``You can use
1294793139Sruthis machine to dig up shrubs without hurting them.  Remember to replant
1294893139Srupromptly @dots{}''.
1294993139Sru
1295093139Sru@findex ifclear
1295193139SruIf a flag is cleared with an @code{@@clear @var{flag}} command, then
1295293139Sruthe formatting commands format text between subsequent pairs of
1295393139Sru@code{@@ifclear} and @code{@@end ifclear} commands.  But if the flag
1295493139Sruis set with @code{@@set @var{flag}}, then the formatting commands do
1295593139Sru@emph{not} format text between an @code{@@ifclear} and an @code{@@end
1295693139Sruifclear} command; rather, they ignore that text.  An @code{@@ifclear}
1295793139Srucommand looks like this:
1295893139Sru
1295993139Sru@example
1296093139Sru@@ifclear @var{flag}
1296193139Sru@end example
1296293139Sru
1296393139Sru
1296456160Sru@node value Example
1296542660Smarkm@subsection @code{@@value} Example
1296642660Smarkm
12967146515SruYou can use the @code{@@value} command to minimize the number of
12968146515Sruplaces you need to change when you record an update to a manual.
12969146515Sru@xref{GNU Sample Texts}, for the full text of an example of using this
12970146515Sruto work with Automake distributions.
1297142660Smarkm
12972146515SruThis example is adapted from @ref{Top,, Overview, make, The GNU Make
12973146515SruManual}.
12974100513Sru
1297556160Sru@enumerate
1297656160Sru@item
1297742660SmarkmSet the flags:
1297842660Smarkm
1297942660Smarkm@example
1298042660Smarkm@group
1298142660Smarkm@@set EDITION 0.35 Beta
1298242660Smarkm@@set VERSION 3.63 Beta
1298342660Smarkm@@set UPDATED 14 August 1992
1298442660Smarkm@@set UPDATE-MONTH August 1992
1298542660Smarkm@end group
1298642660Smarkm@end example
1298742660Smarkm
1298856160Sru@item
12989100513SruWrite text for the @code{@@copying} section (@pxref{copying}):
1299042660Smarkm
1299142660Smarkm@example
1299242660Smarkm@group
12993100513Sru@@copying
1299442660SmarkmThis is Edition @@value@{EDITION@},
1299542660Smarkmlast updated @@value@{UPDATED@},
1299642660Smarkmof @@cite@{The GNU Make Manual@},
1299756160Srufor @@code@{make@}, version @@value@{VERSION@}.
12998100513Sru
12999100513SruCopyright @dots{}
13000100513Sru
13001100513SruPermission is granted @dots{}
13002100513Sru@@end copying
1300342660Smarkm@end group
1300442660Smarkm@end example
1300542660Smarkm
1300656160Sru@item
1300742660SmarkmWrite text for the title page, for people reading the printed manual:
1300842660Smarkm
1300942660Smarkm@example
1301042660Smarkm@group
13011100513Sru@@titlepage
1301242660Smarkm@@title GNU Make
1301342660Smarkm@@subtitle A Program for Directing Recompilation
1301442660Smarkm@@subtitle Edition @@value@{EDITION@}, @dots{}
1301542660Smarkm@@subtitle @@value@{UPDATE-MONTH@}
13016100513Sru@@page
13017100513Sru@@insertcopying
13018100513Sru@dots{}
13019100513Sru@@end titlepage
1302042660Smarkm@end group
1302142660Smarkm@end example
1302242660Smarkm
1302342660Smarkm@noindent
1302442660Smarkm(On a printed cover, a date listing the month and the year looks less
1302542660Smarkmfussy than a date listing the day as well as the month and year.)
1302642660Smarkm
1302756160Sru@item
1302842660SmarkmWrite text for the Top node, for people reading the Info file:
1302942660Smarkm
1303042660Smarkm@example
1303142660Smarkm@group
13032100513Sru@@ifnottex
13033100513Sru@@node Top
13034100513Sru@@top Make
13035100513Sru
13036100513Sru@@insertcopying
13037100513Sru@dots{}
13038100513Sru@@end ifnottex
1303942660Smarkm@end group
1304042660Smarkm@end example
1304142660Smarkm
13042100513SruAfter you format the manual, the @code{@@value} constructs have been
13043100513Sruexpanded, so the output contains text like this:
1304442660Smarkm
1304542660Smarkm@example
1304642660Smarkm@group
1304742660SmarkmThis is Edition 0.35 Beta, last updated 14 August 1992,
1304842660Smarkmof `The GNU Make Manual', for `make', Version 3.63 Beta.
1304942660Smarkm@end group
1305042660Smarkm@end example
1305156160Sru@end enumerate
1305242660Smarkm
13053100513SruWhen you update the manual, you change only the values of the flags; you
13054100513Srudo not need to edit the three sections.
1305542660Smarkm
1305642660Smarkm
13057146515Sru@node Conditional Nesting
13058146515Sru@section Conditional Nesting
13059146515Sru@cindex Conditionals, nested
13060146515Sru@cindex Nesting conditionals
13061146515Sru
13062146515SruConditionals can be nested; however, the details are a little tricky.
13063146515SruThe difficulty comes with failing conditionals, such as
13064146515Sru@code{@@ifhtml} when HTML is not being produced, where the included
13065146515Srutext is to be ignored.  However, it is not to be @emph{completely}
13066146515Sruignored, since it is useful to have one @code{@@ifset} inside another,
13067146515Srufor example---that is a way to include text only if two conditions are
13068146515Srumet.  Here's an example:
13069146515Sru
13070146515Sru@example
13071146515Sru@@ifset somevar
13072146515Sru@@ifset anothervar
13073146515SruBoth somevar and anothervar are set.
13074146515Sru@@end ifset
13075146515Sru@@ifclear anothervar
13076146515SruSomevar is set, anothervar is not.
13077146515Sru@@end ifclear
13078146515Sru@@end ifset
13079146515Sru@end example
13080146515Sru
13081146515SruTechnically, Texinfo requires that for a failing conditional, the
13082146515Sruignored text must be properly nested with respect to that failing
13083146515Sruconditional.  Unfortunately, it's not always feasible to check that
13084146515Sru@emph{all} conditionals are properly nested, because then the
13085146515Sruprocessors could have to fully interpret the ignored text, which
13086146515Srudefeats the purpose of the command.  Here's an example illustrating
13087146515Sruthese rules:
13088146515Sru
13089146515Sru@example
13090146515Sru@@ifset a
13091146515Sru@@ifset b
13092146515Sru@@ifclear ok  - ok, ignored
13093146515Sru@@end junky   - ok, ignored
13094146515Sru@@end ifset
13095146515Sru@@c WRONG - missing @@end ifset.
13096146515Sru@end example
13097146515Sru
13098146515SruFinally, as mentioned above, all conditional commands must be on lines
13099146515Sruby themselves, with no text (even spaces) before or after.  Otherwise,
13100146515Sruthe processors cannot reliably determine which commands to consider
13101146515Srufor nesting purposes.
13102146515Sru
13103146515Sru
1310456160Sru@node Internationalization
1310556160Sru@chapter Internationalization
1310656160Sru
1310756160Sru@cindex Internationalization
1310856160SruTexinfo has some support for writing in languages other than English,
1310956160Srualthough this area still needs considerable work.
1311056160Sru
1311156160SruFor a list of the various accented and special characters Texinfo
1311256160Srusupports, see @ref{Inserting Accents}.
1311356160Sru
1311456160Sru@menu
1311556160Sru* documentlanguage::            Declaring the current language.
1311656160Sru* documentencoding::            Declaring the input encoding.
1311756160Sru@end menu
1311856160Sru
1311956160Sru
1312056160Sru@node documentlanguage
1312156160Sru@section @code{@@documentlanguage @var{cc}}: Set the Document Language
1312256160Sru
1312356160Sru@findex documentlanguage
1312456160Sru@cindex Language, declaring
1312556160Sru@cindex Document language, declaring
1312656160Sru
1312756160SruThe @code{@@documentlanguage} command declares the current document
1312856160Srulanguage.  Write it on a line by itself, with a two-letter ISO-639
1312956160Srulanguage code following (list is included below).  If you have a
1313056160Srumultilingual document, the intent is to be able to use this command
1313156160Srumultiple times, to declare each language change.  If the command is not
1313256160Sruused at all, the default is @code{en} for English.
1313356160Sru
1313456160Sru@cindex @file{txi-@var{cc}.tex}
1313556160SruAt present, this command is ignored in Info and HTML output.  For
1313656160Sru@TeX{}, it causes the file @file{txi-@var{cc}.tex} to be read (if it
1313756160Sruexists).  Such a file appropriately redefines the various English words
1313856160Sruused in @TeX{} output, such as `Chapter', `See', and so on.
1313956160Sru
1314056160Sru@cindex Hyphenation patterns, language-dependent
1314156160SruIt would be good if this command also changed @TeX{}'s ideas of the
1314256160Srucurrent hyphenation patterns (via the @TeX{} primitive
1314356160Sru@code{\language}), but this is unfortunately not currently implemented.
1314456160Sru
1314556160Sru@cindex ISO 639 codes
1314656160Sru@cindex Language codes
1314793139SruHereare the valid language codes, from ISO-639.
1314856160Sru
1314993139Sru@multitable @columnfractions .07 .26 .07 .26 .07 .26
1315056160Sru@item
1315156160Sru@code{aa} @tab Afar @tab
1315256160Sru@code{ab} @tab Abkhazian @tab
1315356160Sru@code{af} @tab Afrikaans
1315456160Sru@item
1315556160Sru@code{am} @tab Amharic @tab
1315656160Sru@code{ar} @tab Arabic @tab
1315756160Sru@code{as} @tab Assamese
1315856160Sru@item
1315956160Sru@code{ay} @tab Aymara @tab
1316056160Sru@code{az} @tab Azerbaijani @tab
1316156160Sru@code{ba} @tab Bashkir
1316256160Sru@item
1316356160Sru@code{be} @tab Byelorussian @tab
1316456160Sru@code{bg} @tab Bulgarian @tab
1316556160Sru@code{bh} @tab Bihari
1316656160Sru@item
1316756160Sru@code{bi} @tab Bislama @tab
1316856160Sru@code{bn} @tab Bengali; Bangla @tab
1316956160Sru@code{bo} @tab Tibetan
1317056160Sru@item
1317156160Sru@code{br} @tab Breton @tab
1317256160Sru@code{ca} @tab Catalan @tab
1317356160Sru@code{co} @tab Corsican
1317456160Sru@item
1317556160Sru@code{cs} @tab Czech @tab
1317656160Sru@code{cy} @tab Welsh @tab
1317756160Sru@code{da} @tab Danish
1317856160Sru@item
1317956160Sru@code{de} @tab German @tab
1318056160Sru@code{dz} @tab Bhutani @tab
1318156160Sru@code{el} @tab Greek
1318256160Sru@item
1318356160Sru@code{en} @tab English @tab
1318456160Sru@code{eo} @tab Esperanto @tab
1318556160Sru@code{es} @tab Spanish
1318656160Sru@item
1318756160Sru@code{et} @tab Estonian @tab
1318856160Sru@code{eu} @tab Basque @tab
1318956160Sru@code{fa} @tab Persian
1319056160Sru@item
1319156160Sru@code{fi} @tab Finnish @tab
1319256160Sru@code{fj} @tab Fiji @tab
1319356160Sru@code{fo} @tab Faroese
1319456160Sru@item
1319556160Sru@code{fr} @tab French @tab
1319656160Sru@code{fy} @tab Frisian @tab
1319756160Sru@code{ga} @tab Irish
1319856160Sru@item
1319956160Sru@code{gd} @tab Scots Gaelic @tab
1320056160Sru@code{gl} @tab Galician @tab
1320156160Sru@code{gn} @tab Guarani
1320256160Sru@item
1320356160Sru@code{gu} @tab Gujarati @tab
1320456160Sru@code{ha} @tab Hausa @tab
1320556160Sru@code{he} @tab Hebrew
1320656160Sru@item
1320756160Sru@code{hi} @tab Hindi @tab
1320856160Sru@code{hr} @tab Croatian @tab
1320956160Sru@code{hu} @tab Hungarian
1321056160Sru@item
1321156160Sru@code{hy} @tab Armenian @tab
1321256160Sru@code{ia} @tab Interlingua @tab
1321356160Sru@code{id} @tab Indonesian
1321456160Sru@item
1321556160Sru@code{ie} @tab Interlingue @tab
1321656160Sru@code{ik} @tab Inupiak @tab
1321756160Sru@code{is} @tab Icelandic
1321856160Sru@item
1321956160Sru@code{it} @tab Italian @tab
1322056160Sru@code{iu} @tab Inuktitut @tab
1322156160Sru@code{ja} @tab Japanese
1322256160Sru@item
1322356160Sru@code{jw} @tab Javanese @tab
1322456160Sru@code{ka} @tab Georgian @tab
1322556160Sru@code{kk} @tab Kazakh
1322656160Sru@item
1322756160Sru@code{kl} @tab Greenlandic @tab
1322856160Sru@code{km} @tab Cambodian @tab
1322956160Sru@code{kn} @tab Kannada
1323056160Sru@item
1323156160Sru@code{ks} @tab Kashmiri @tab
1323256160Sru@code{ko} @tab Korean @tab
1323356160Sru@code{ku} @tab Kurdish
1323456160Sru@item
1323556160Sru@code{ky} @tab Kirghiz @tab
1323656160Sru@code{la} @tab Latin @tab
1323756160Sru@code{ln} @tab Lingala
1323856160Sru@item
1323956160Sru@code{lt} @tab Lithuanian @tab
1324056160Sru@code{lo} @tab Laothian @tab
1324156160Sru@code{lv} @tab Latvian, Lettish
1324256160Sru@item
1324356160Sru@code{mg} @tab Malagasy @tab
1324456160Sru@code{mi} @tab Maori @tab
1324556160Sru@code{mk} @tab Macedonian
1324656160Sru@item
1324756160Sru@code{ml} @tab Malayalam @tab
1324856160Sru@code{mn} @tab Mongolian @tab
1324956160Sru@code{mo} @tab Moldavian
1325056160Sru@item
1325156160Sru@code{mr} @tab Marathi @tab
1325256160Sru@code{ms} @tab Malay @tab
1325356160Sru@code{mt} @tab Maltese
1325456160Sru@item
1325556160Sru@code{my} @tab Burmese @tab
1325656160Sru@code{na} @tab Nauru @tab
1325756160Sru@code{ne} @tab Nepali
1325856160Sru@item
1325956160Sru@code{nl} @tab Dutch @tab
1326056160Sru@code{no} @tab Norwegian @tab
1326156160Sru@code{oc} @tab Occitan
1326256160Sru@item
1326356160Sru@code{om} @tab (Afan) Oromo @tab
1326456160Sru@code{or} @tab Oriya @tab
1326556160Sru@code{pa} @tab Punjabi
1326656160Sru@item
1326756160Sru@code{pl} @tab Polish @tab
1326856160Sru@code{ps} @tab Pashto, Pushto @tab
1326956160Sru@code{pt} @tab Portuguese
1327056160Sru@item
1327156160Sru@code{qu} @tab Quechua @tab
1327256160Sru@code{rm} @tab Rhaeto-Romance @tab
1327356160Sru@code{rn} @tab Kirundi
1327456160Sru@item
1327556160Sru@code{ro} @tab Romanian @tab
1327656160Sru@code{ru} @tab Russian @tab
1327756160Sru@code{rw} @tab Kinyarwanda
1327856160Sru@item
1327956160Sru@code{sa} @tab Sanskrit @tab
1328056160Sru@code{sd} @tab Sindhi @tab
1328156160Sru@code{sg} @tab Sangro
1328256160Sru@item
1328356160Sru@code{sh} @tab Serbo-Croatian @tab
1328456160Sru@code{si} @tab Sinhalese @tab
1328556160Sru@code{sk} @tab Slovak
1328656160Sru@item
1328756160Sru@code{sl} @tab Slovenian @tab
1328856160Sru@code{sm} @tab Samoan @tab
1328956160Sru@code{sn} @tab Shona
1329056160Sru@item
1329156160Sru@code{so} @tab Somali @tab
1329256160Sru@code{sq} @tab Albanian @tab
1329356160Sru@code{sr} @tab Serbian
1329456160Sru@item
1329556160Sru@code{ss} @tab Siswati @tab
1329656160Sru@code{st} @tab Sesotho @tab
1329756160Sru@code{su} @tab Sundanese
1329856160Sru@item
1329956160Sru@code{sv} @tab Swedish @tab
1330056160Sru@code{sw} @tab Swahili @tab
1330156160Sru@code{ta} @tab Tamil
1330256160Sru@item
1330356160Sru@code{te} @tab Telugu @tab
1330456160Sru@code{tg} @tab Tajik @tab
1330556160Sru@code{th} @tab Thai
1330656160Sru@item
1330756160Sru@code{ti} @tab Tigrinya @tab
1330856160Sru@code{tk} @tab Turkmen @tab
1330956160Sru@code{tl} @tab Tagalog
1331056160Sru@item
1331156160Sru@code{tn} @tab Setswana @tab
1331256160Sru@code{to} @tab Tonga @tab
1331356160Sru@code{tr} @tab Turkish
1331456160Sru@item
1331556160Sru@code{ts} @tab Tsonga @tab
1331656160Sru@code{tt} @tab Tatar @tab
1331756160Sru@code{tw} @tab Twi
1331856160Sru@item
1331956160Sru@code{ug} @tab Uighur @tab
1332056160Sru@code{uk} @tab Ukrainian @tab
1332156160Sru@code{ur} @tab Urdu
1332256160Sru@item
1332356160Sru@code{uz} @tab Uzbek @tab
1332456160Sru@code{vi} @tab Vietnamese @tab
1332556160Sru@code{vo} @tab Volapuk
1332656160Sru@item
1332756160Sru@code{wo} @tab Wolof @tab
1332856160Sru@code{xh} @tab Xhosa @tab
1332956160Sru@code{yi} @tab Yiddish
1333056160Sru@item
1333156160Sru@code{yo} @tab Yoruba @tab
1333256160Sru@code{za} @tab Zhuang @tab
1333356160Sru@code{zh} @tab Chinese
1333456160Sru@item
1333556160Sru@code{zu} @tab Zulu
1333656160Sru@end multitable
1333756160Sru
1333856160Sru
1333956160Sru@node documentencoding
1334056160Sru@section @code{@@documentencoding @var{enc}}: Set Input Encoding
1334156160Sru
1334256160Sru@findex documentencoding
1334356160Sru@cindex Encoding, declaring
1334456160Sru@cindex Input encoding, declaring
13345116525Sru@cindex Character set, declaring
1334656160Sru@cindex Document input encoding
1334756160Sru
1334856160SruThe @code{@@documentencoding} command declares the input document
1334956160Sruencoding.  Write it on a line by itself, with a valid encoding
13350116525Sruspecification following.
1335156160Sru
13352146515SruAt present, Texinfo supports only these encodings:
1335356160Sru
13354116525Sru@table @code
13355116525Sru@item US-ASCII
13356116525SruThis has no particular effect, but it's included for completeness.
13357146515Sru
13358116525Sru@itemx ISO-8859-1
13359146515Sru@itemx ISO-8859-15
13360116525Sru@item ISO-8859-2
13361146515SruThese specify the standard encodings for Western European (the first
13362146515Srutwo) and Eastern European languages (the third), respectively.  ISO
13363146515Sru8859-15 replaces some little-used characters from 8859-1 (e.g.,
13364146515Sruprecomposed fractions) with more commonly needed ones, such as the
13365146515SruEuro symbol.
13366146515Sru
13367146515SruA full description of the encodings is beyond our scope here;
13368146515Sruone useful reference is @uref{http://czyborra.com/charsets/iso8859.html}.
13369116525Sru@end table
13370116525Sru
13371116525SruSpecifying an encoding @var{enc} has the following effects:
13372116525Sru
13373116525Sru@opindex --enable-encoding
13374116525Sru@cindex Local Variables: section, for encoding
13375116525Sru@cindex Info output, and encoding
13376146515SruIn Info output, if the option @option{--enable-encoding} is given
13377116525Sruto @command{makeinfo}, a so-called `Local Variables' section
13378116525Sru(@pxref{File Variables,,,emacs,The GNU Emacs Manual}) is output
13379116525Sruincluding @var{enc}.  This allows Info readers to set the encoding
13380146515Sruappropriately.
13381116525Sru
1338256160Sru@example
13383116525SruLocal Variables:
13384116525Srucoding: @var{enc}
13385116525SruEnd:
13386116525Sru@end example
13387116525Sru
13388116525Sru@cindex HTML output, and encodings
13389146515Sru@cindex @code{http-equiv}, and charset specification
13390146515Sru@cindex @code{<meta>} HTML tag, and charset specification
13391116525SruIn HTML output, a @samp{<meta>} tag is output, in the @samp{<head>}
13392116525Srusection of the HTML, that specifies @var{enc}.  Web servers and
13393116525Srubrowsers cooperate to use this information so the correct encoding is
13394146515Sruused to display the page, if supported by the system.
13395116525Sru
13396116525Sru@example
1339793139Sru<meta http-equiv="Content-Type" content="text/html;
13398114472Sru     charset=@var{enc}">
1339956160Sru@end example
1340056160Sru
13401116525SruIn all other cases, it is recognized but ignored.
1340256160Sru
13403116525Sru
1340456160Sru@node Defining New Texinfo Commands
1340556160Sru@chapter Defining New Texinfo Commands
1340642660Smarkm@cindex Macros
1340742660Smarkm@cindex Defining new Texinfo commands
1340842660Smarkm@cindex New Texinfo commands, defining
1340942660Smarkm@cindex Texinfo commands, defining new
1341042660Smarkm@cindex User-defined Texinfo commands
1341142660Smarkm
1341256160SruTexinfo provides several ways to define new commands:
1341356160Sru
1341456160Sru@itemize @bullet
1341556160Sru@item
1341642660SmarkmA Texinfo @dfn{macro} allows you to define a new Texinfo command as any
1341742660Smarkmsequence of text and/or existing commands (including other macros).  The
1341842660Smarkmmacro can have any number of @dfn{parameters}---text you supply each
1341956160Srutime you use the macro.
1342042660Smarkm
1342156160SruIncidentally, these macros have nothing to do with the @code{@@defmac}
1342256160Srucommand, which is for documenting macros in the subject of the manual
1342356160Sru(@pxref{Def Cmd Template}).
1342456160Sru
1342556160Sru@item
1342656160Sru@samp{@@alias} is a convenient way to define a new name for an existing
1342756160Srucommand.
1342856160Sru
1342956160Sru@item
1343056160Sru@samp{@@definfoenclose} allows you to define new commands with
1343156160Srucustomized output in the Info file.
1343256160Sru
1343356160Sru@end itemize
1343456160Sru
1343542660Smarkm@menu
1343656160Sru* Defining Macros::             Defining and undefining new commands.
1343742660Smarkm* Invoking Macros::             Using a macro, once you've defined it.
13438146515Sru* Macro Details::               Limitations of Texinfo macros.
1343956160Sru* alias::                       Command aliases.
1344056160Sru* definfoenclose::              Customized highlighting.
1344142660Smarkm@end menu
1344242660Smarkm
1344342660Smarkm
1344456160Sru@node Defining Macros
1344542660Smarkm@section Defining Macros
1344642660Smarkm@cindex Defining macros
1344742660Smarkm@cindex Macro definitions
1344842660Smarkm
1344942660Smarkm@findex macro
1345056160SruYou use the Texinfo @code{@@macro} command to define a macro, like this:
1345142660Smarkm
1345242660Smarkm@example
1345356160Sru@@macro @var{macroname}@{@var{param1}, @var{param2}, @dots{}@}
1345442660Smarkm@var{text} @dots{} \@var{param1}\ @dots{}
1345542660Smarkm@@end macro
1345642660Smarkm@end example
1345742660Smarkm
1345842660SmarkmThe @dfn{parameters} @var{param1}, @var{param2}, @dots{} correspond to
1345942660Smarkmarguments supplied when the macro is subsequently used in the document
1346056160Sru(described in the next section).
1346142660Smarkm
13462116525Sru@cindex Macro names, valid characters in
13463116525Sru@cindex Names of macros, valid characters of
13464116525SruFor a macro to work consistently with @TeX{}, @var{macroname} must
13465116525Sruconsist entirely of letters: no digits, hyphens, underscores, or other
13466116525Sruspecial characters.  So, we recommend using only letters.  However,
13467116525Sru@command{makeinfo} will accept anything except @samp{@{@}_^=};
13468116525Sru@samp{_} and @samp{^} are excluded so that macros can be called in
13469116525Sru@code{@@math} mode without a following space
13470116525Sru(@pxref{math,,@code{@@math}}).
1347156160Sru
1347242660SmarkmIf a macro needs no parameters, you can define it either with an empty
1347342660Smarkmlist (@samp{@@macro foo @{@}}) or with no braces at all (@samp{@@macro
1347442660Smarkmfoo}).
1347542660Smarkm
1347642660Smarkm@cindex Body of a macro
1347742660Smarkm@cindex Mutually recursive macros
1347842660Smarkm@cindex Recursion, mutual
1347956160SruThe definition or @dfn{body} of the macro can contain most Texinfo
1348056160Srucommands, including previously-defined macros.  Not-yet-defined macro
1348156160Sruinvocations are not allowed; thus, it is not possible to have mutually
1348256160Srurecursive Texinfo macros.  Also, a macro definition that defines another
1348356160Srumacro does not work in @TeX{} due to limitations in the design of
1348456160Sru@code{@@macro}.
1348542660Smarkm
1348656160Sru@cindex Parameters to macros
1348756160SruIn the macro body, instances of a parameter name surrounded by
1348856160Srubackslashes, as in @samp{\@var{param1}\} in the example above, are
1348956160Srureplaced by the corresponding argument from the macro invocation.  You
1349056160Srucan use parameter names any number of times in the body, including zero.
1349156160Sru
1349256160Sru@cindex Backslash in macros
1349356160SruTo get a single @samp{\} in the macro expansion, use @samp{\\}.  Any
1349456160Sruother use of @samp{\} in the body yields a warning.
1349556160Sru
1349656160Sru@cindex Spaces in macros
1349756160Sru@cindex Whitespace in macros
1349856160SruThe newlines after the @code{@@macro} line and before the @code{@@end
1349956160Srumacro} line are ignored, that is, not included in the macro body.  All
1350056160Sruother whitespace is treated according to the usual Texinfo rules.
1350156160Sru
1350256160Sru@cindex Recursive macro invocations
1350356160Sru@findex rmacro
1350456160SruTo allow a macro to be used recursively, that is, in an argument to a
1350556160Srucall to itself, you must define it with @samp{@@rmacro}, like this:
1350656160Sru
1350756160Sru@example
1350893139Sru@@rmacro rmac @{arg@}
1350956160Srua\arg\b
1351056160Sru@@end rmacro
1351156160Sru@dots{}
1351256160Sru@@rmac@{1@@rmac@{text@}2@}
1351356160Sru@end example
1351456160Sru
1351556160SruThis produces the output `a1atextb2b'.  With @samp{@@macro} instead of
1351656160Sru@samp{@@rmacro}, an error message is given.
1351756160Sru
1351842660Smarkm@findex unmacro
1351942660Smarkm@cindex Macros, undefining
1352042660Smarkm@cindex Undefining macros
1352142660SmarkmYou can undefine a macro @var{foo} with @code{@@unmacro @var{foo}}.
1352242660SmarkmIt is not an error to undefine a macro that is already undefined.
1352342660SmarkmFor example:
1352442660Smarkm
1352542660Smarkm@example
1352642660Smarkm@@unmacro foo
1352742660Smarkm@end example
1352842660Smarkm
1352942660Smarkm
1353056160Sru@node Invoking Macros
1353142660Smarkm@section Invoking Macros
1353242660Smarkm@cindex Invoking macros
1353356160Sru@cindex Expanding macros
1353456160Sru@cindex Running macros
1353542660Smarkm@cindex Macro invocation
1353642660Smarkm
1353742660SmarkmAfter a macro is defined (see the previous section), you can use
1353842660Smarkm(@dfn{invoke}) it in your document like this:
1353942660Smarkm
1354042660Smarkm@example
1354156160Sru@@@var{macroname} @{@var{arg1}, @var{arg2}, @dots{}@}
1354242660Smarkm@end example
1354342660Smarkm
1354442660Smarkm@noindent and the result will be just as if you typed the body of
1354556160Sru@var{macroname} at that spot.  For example:
1354642660Smarkm
1354742660Smarkm@example
1354842660Smarkm@@macro foo @{p, q@}
1354942660SmarkmTogether: \p\ & \q\.
1355042660Smarkm@@end macro
1355142660Smarkm@@foo@{a, b@}
1355242660Smarkm@end example
1355342660Smarkm
1355442660Smarkm@noindent produces:
1355542660Smarkm
1355642660Smarkm@display
1355742660SmarkmTogether: a & b.
1355842660Smarkm@end display
1355942660Smarkm
1356042660Smarkm@cindex Backslash, and macros
1356142660SmarkmThus, the arguments and parameters are separated by commas and delimited
1356256160Sruby braces; any whitespace after (but not before) a comma is ignored.
1356356160SruThe braces are required in the invocation (but not the definition), even
1356456160Sruwhen the macro takes no arguments, consistent with all other Texinfo
1356556160Srucommands.  For example:
1356642660Smarkm
1356742660Smarkm@example
1356856160Sru@@macro argless @{@}
1356956160SruNo arguments here.
1357056160Sru@@end macro
1357156160Sru@@argless@{@}
1357242660Smarkm@end example
1357342660Smarkm
1357456160Sru@noindent produces:
1357556160Sru
1357656160Sru@display
1357756160SruNo arguments here.
1357856160Sru@end display
1357956160Sru
1358093139Sru@cindex Comma, in macro arguments
1358193139Sru@cindex Braces, in macro arguments
1358256160SruTo insert a comma, brace, or backslash in an argument, prepend a
1358356160Srubackslash, as in
1358456160Sru
1358556160Sru@example
1358656160Sru@@@var{macname} @{\\\@{\@}\,@}
1358756160Sru@end example
1358856160Sru
1358942660Smarkm@noindent
1359042660Smarkmwhich will pass the (almost certainly error-producing) argument
1359193139Sru@samp{\@{@},} to @var{macname}.  However, commas in parameters, even
1359293139Sruif escaped by a backslash, might cause trouble in @TeX{}.
1359342660Smarkm
1359442660SmarkmIf the macro is defined to take a single argument, and is invoked
1359542660Smarkmwithout any braces, the entire rest of the line after the macro name is
1359642660Smarkmsupplied as the argument.  For example:
1359742660Smarkm
1359842660Smarkm@example
1359942660Smarkm@@macro bar @{p@}
1360056160SruTwice: \p\ & \p\.
1360142660Smarkm@@end macro
1360242660Smarkm@@bar aah
1360342660Smarkm@end example
1360442660Smarkm
1360542660Smarkm@noindent produces:
1360642660Smarkm
1360756160Sru@c Sorry for cheating, but let's not require macros to process the manual.
1360842660Smarkm@display
1360956160SruTwice: aah & aah.
1361042660Smarkm@end display
1361142660Smarkm
1361256160SruIf the macro is defined to take a single argument, and is invoked with
1361356160Srubraces, the braced text is passed as the argument, regardless of
1361456160Srucommas.  For example:
1361542660Smarkm
1361656160Sru@example
1361756160Sru@@macro bar @{p@}
1361856160SruTwice: \p\ & \p\.
1361956160Sru@@end macro
1362056160Sru@@bar@{a,b@}
1362156160Sru@end example
1362256160Sru
1362356160Sru@noindent produces:
1362456160Sru
1362556160Sru@display
1362656160SruTwice: a,b & a,b.
1362756160Sru@end display
1362856160Sru
1362956160Sru
1363056160Sru@node Macro Details
13631146515Sru@section Macro Details and Caveats
1363256160Sru@cindex Macro details
1363356160Sru@cindex Details of macro usage
13634146515Sru@cindex Caveats for macro usage
1363556160Sru
13636114472SruDue to unavoidable limitations, certain macro-related constructs cause
13637114472Sruproblems with @TeX{}.  If you get macro-related errors when producing
13638114472Sruthe printed version of a manual, try expanding the macros with
13639114472Sru@command{makeinfo} by invoking @command{texi2dvi} with the @samp{-E}
13640146515Sruoption (@pxref{Format with texi2dvi}).
1364156160Sru
1364256160Sru@itemize @bullet
1364356160Sru@item
13644146515SruAs mentioned earlier, macro names must consist entirely of letters.
13645146515Sru
13646146515Sru@item
13647146515SruIt is not advisable to redefine any @TeX{} primitive, plain, or
13648146515SruTexinfo command name as a macro. Unfortunately this is a very large
13649146515Sruset of names, and the possible resulting errors are unpredictable.
13650146515Sru
13651146515Sru@item
1365256160SruAll macros are expanded inside at least one @TeX{} group.  This means
13653114472Sruthat @code{@@set} and other such commands have no effect inside a
1365493139Srumacro.
1365556160Sru
1365656160Sru@item
1365793139SruCommas in macro arguments, even if escaped by a backslash, don't
1365893139Srualways work.
1365993139Sru
1366093139Sru@item
13661146515SruMacro arguments cannot cross lines.
1366256160Sru
13663114472Sru@item
13664146515SruIt is (usually) best to avoid comments inside macro definitions, but
13665146515Srusee the next item.
13666114472Sru
13667114472Sru@item
13668146515SruMacros containing a command which must be on a line by itself, such as
13669146515Srua conditional, cannot be invoked in the middle of a line.  In general,
13670146515Sruthe interaction of newlines in the macro definitions and invocations
13671146515Srudepends on the precise commands and context.  You may be able to work
13672146515Sruaround some problems with judicious use of @code{@@c}.  Suppose you
13673146515Srudefine a macro that is always intended to be used on a line by itself:
13674146515Sru
13675146515Sru@example
13676146515Sru@@macro linemac
13677146515Sru@@cindex whatever
13678146515Sru@@c
13679146515Sru@@end macro
13680146515Sru...
13681146515Srufoo
13682146515Sru@@linemac
13683146515Srubar
13684146515Sru@end example
13685146515Sru
13686146515SruWithout the @code{@@c}, there will be an unwanted blank line between
13687146515Sruthe @samp{@@cindex whatever} and the @samp{bar} (one newline comes
13688146515Srufrom the macro definition, one from after the invocation), causing a
13689146515Sruparagraph break.
13690146515Sru
13691146515SruOn the other hand, you wouldn't want the @code{@@c} if the macro was
13692146515Srusometimes invoked in the middle of a line (the text after the
13693146515Sruinvocation would be treated as a comment).
13694146515Sru
13695146515Sru@item
13696146515SruIn general, you can't arbitrarily substitute a macro call for Texinfo
13697146515Srucommand arguments, even when the text is the same.  It might work with
13698146515Srusome commands, it fails with others.  Best not to do it at all.  For
13699146515Sruinstance, this fails:
13700146515Sru
13701146515Sru@example
13702146515Sru@@macro offmacro
13703146515Sruoff
13704146515Sru@@end macro
13705146515Sru@@headings @@offmacro
13706146515Sru@end example
13707146515Sru
13708146515Sru@noindent
13709146515SruYou would expect this to be equivalent to @code{@@headings off}, but
13710146515Srufor @TeX{}nical reasons, it fails with a mysterious error message
13711146515Sru(@code{Paragraph ended before @@headings was complete}).
13712146515Sru
13713146515Sru@item
13714114472SruMacros cannot define macros in the natural way.  To do this, you must
13715114472Sruuse conditionals and raw @TeX{}.  For example:
13716114472Sru
1371756160Sru@example
13718100513Sru@@ifnottex
1371956160Sru@@macro ctor @{name, arg@}
1372056160Sru@@macro \name\
1372156160Srusomething involving \arg\ somehow
1372256160Sru@@end macro
1372356160Sru@@end macro
13724100513Sru@@end ifnottex
1372556160Sru@@tex
1372656160Sru\gdef\ctor#1@{\ctorx#1,@}
1372756160Sru\gdef\ctorx#1,#2,@{\def#1@{something involving #2 somehow@}@}
1372856160Sru@@end tex
1372956160Sru@end example
1373056160Sru
1373156160Sru@end itemize
1373256160Sru
13733146515SruThe @command{makeinfo} implementation also has limitations:
1373456160Sru
13735146515Sru@itemize
13736146515Sru@item
13737146515Sru@code{@@verbatim} and macros do not mix; for instance, you can't start
13738146515Srua verbatim block inside a macro and end it outside.
13739146515Sru(@xref{verbatim}.)  Starting any environment inside a macro and ending
13740146515Sruit outside may or may not work, for that matter.
13741146515Sru
13742146515Sru@item
13743146515SruMacros that completely define macros are ok, but it's not possible to
13744146515Sruhave incorrectly nested macro definitions.  That is, @code{@@macro}
13745146515Sruand @code{@@end macro} (likewise for @code{@@rmacro}) must be
13746146515Srucorrectly paired.  For example, you cannot start a macro definition
13747146515Sruwithin a macro, and then end the nested definition outside the macro.
13748146515Sru
13749146515Sru@item
13750146515Sru@code{@@rmacro} is a kludge.
13751146515Sru
13752146515Sru@end itemize
13753146515Sru
13754146515SruOne more limitation is common to both implementations: white space is
13755146515Sruignored at the beginnings of lines.
13756146515Sru
13757146515SruFuture major revisions of Texinfo may ease some of these limitations
13758146515Sru(by introducing a new macro syntax).
13759146515Sru
13760146515Sru
1376156160Sru@node alias
1376256160Sru@section @samp{@@alias @var{new}=@var{existing}}
1376356160Sru@cindex Aliases, command
1376456160Sru@cindex Command aliases
1376556160Sru@findex alias
1376656160Sru
1376756160SruThe @samp{@@alias} command defines a new command to be just like an
1376856160Sruexisting one.  This is useful for defining additional markup names, thus
1376956160Srupreserving semantic information in the input even though the output
1377056160Sruresult may be the same.
1377156160Sru
1377256160SruWrite the @samp{@@alias} command on a line by itself, followed by the
1377356160Srunew command name, an equals sign, and the existing command name.
1377456160SruWhitespace around the equals sign is ignored.  Thus:
1377556160Sru@example
1377656160Sru@@alias @var{new} = @var{existing}
1377756160Sru@end example
1377856160Sru
1377956160SruFor example, if your document contains citations for both books and
1378056160Srusome other media (movies, for example), you might like to define a
1378156160Srumacro @code{@@moviecite@{@}} that does the same thing as an ordinary
1378256160Sru@code{@@cite@{@}} but conveys the extra semantic information as well.
1378356160SruYou'd do this as follows:
1378456160Sru
1378556160Sru@example
1378656160Sru@@alias moviecite = cite
1378756160Sru@end example
1378856160Sru
13789146515SruMacros do not always have the same effect as aliases, due to vagaries
13790146515Sruof argument parsing.  Also, aliases are much simpler to define than
13791146515Srumacros.  So the command is not redundant.  (It was also heavily used
13792146515Sruin the Jargon File!)
1379356160Sru
1379456160SruAliases must not be recursive, directly or indirectly.
1379556160Sru
13796146515SruIt is not advisable to redefine any @TeX{} primitive, plain, or
13797146515SruTexinfo command name as an alias.  Unfortunately this is a very large
13798146515Sruset of names, and the possible resulting errors are completely random.
13799146515Sru
13800146515Sru
1380156160Sru@node definfoenclose
1380256160Sru@section @samp{definfoenclose}: Customized Highlighting
1380356160Sru@cindex Highlighting, customized
1380456160Sru@cindex Customized highlighting
1380556160Sru@findex definfoenclose
1380656160Sru
1380756160SruA @code{@@definfoenclose} command may be used to define a highlighting
1380893139Srucommand for Info, but not for @TeX{}.  A command defined using
1380956160Sru@code{@@definfoenclose} marks text by enclosing it in strings that
1381056160Sruprecede and follow the text.  You can use this to get closer control of
1381156160Sruyour Info output.
13812114472Sru
1381356160SruPresumably, if you define a command with @code{@@definfoenclose} for Info,
1381456160Sruyou will create a corresponding command for @TeX{}, either in
1381556160Sru@file{texinfo.tex}, @file{texinfo.cnf}, or within an @samp{@@iftex} in
1381656160Sruyour document.
1381756160Sru
1381856160SruWrite a @code{@@definfoenclose} command on a line and follow it with
1381956160Sruthree arguments separated by commas.  The first argument to
1382056160Sru@code{@@definfoenclose} is the @@-command name (without the @code{@@});
1382156160Sruthe second argument is the Info start delimiter string; and the third
1382256160Sruargument is the Info end delimiter string.  The latter two arguments
1382356160Sruenclose the highlighted text in the Info file.  A delimiter string may
1382456160Srucontain spaces.  Neither the start nor end delimiter is required.  If
1382556160Sruyou do not want a start delimiter but do want an end delimiter, you must
1382656160Srufollow the command name with two commas in a row; otherwise, the Info
1382756160Sruformatting commands will naturally misinterpret the end delimiter string
1382856160Sruyou intended as the start delimiter string.
1382956160Sru
1383056160SruIf you do a @code{@@definfoenclose} on the name of a pre-defined macro
1383156160Sru(such as @code{@@emph}, @code{@@strong}, @code{@@t}, or @code{@@i}), the
1383256160Sruenclosure definition will override the built-in definition.
13833114472Sru
1383456160SruAn enclosure command defined this way takes one argument in braces; this
1383556160Sruis intended for new markup commands (@pxref{Marking Text}).
1383656160Sru
1383756160Sru@findex phoo
1383856160SruFor example, you can write:
1383956160Sru
1384056160Sru@example
1384156160Sru@@definfoenclose phoo,//,\\
1384256160Sru@end example
1384356160Sru
1384456160Sru@noindent
1384556160Srunear the beginning of a Texinfo file to define @code{@@phoo} as an Info
1384656160Sruformatting command that inserts `//' before and `\\' after the argument
1384756160Sruto @code{@@phoo}.  You can then write @code{@@phoo@{bar@}} wherever you
1384856160Sruwant `//bar\\' highlighted in Info.
1384956160Sru
13850116525SruAlso, for @TeX{} formatting, you could write
1385156160Sru
1385256160Sru@example
1385356160Sru@@iftex
1385456160Sru@@global@@let@@phoo=@@i
1385556160Sru@@end iftex
1385656160Sru@end example
1385756160Sru
1385856160Sru@noindent
1385993139Sruto define @code{@@phoo} as a command that causes @TeX{} to typeset the
1386056160Sruargument to @code{@@phoo} in italics.
1386156160Sru
1386293139SruEach definition applies to its own formatter: one for @TeX{}, the other
1386393139Srufor @code{texinfo-format-buffer} or @code{texinfo-format-region}.  The
1386493139Sru@code{@@definfoenclose} command need not be within @samp{@@ifinfo}, but
1386593139Sruthe raw @TeX{} commands do need to be in @samp{@@iftex}.
1386656160Sru
1386756160Sru@findex headword
1386856160SruHere is another example: write
1386956160Sru
1387056160Sru@example
1387156160Sru@@definfoenclose headword, , :
1387256160Sru@end example
1387356160Sru
1387456160Sru@noindent
1387556160Srunear the beginning of the file, to define @code{@@headword} as an Info
1387656160Sruformatting command that inserts nothing before and a colon after the
1387756160Sruargument to @code{@@headword}.
1387856160Sru
1387956160Sru@samp{@@definfoenclose} definitions must not be recursive, directly or
1388056160Sruindirectly.
1388156160Sru
1388256160Sru
1388356160Sru@node Hardcopy
1388456160Sru@chapter Formatting and Printing Hardcopy
1388542660Smarkm@cindex Format and print hardcopy
1388656160Sru@cindex Printing hardcopy
1388742660Smarkm@cindex Hardcopy, printing it
1388842660Smarkm@cindex Making a printed manual
1388942660Smarkm@cindex Sorting indices
1389042660Smarkm@cindex Indices, sorting
1389142660Smarkm@cindex @TeX{} index sorting
1389242660Smarkm@pindex texindex
1389342660Smarkm
1389442660SmarkmThere are three major shell commands for making a printed manual from a
1389542660SmarkmTexinfo file: one for converting the Texinfo file into a file that will be
1389642660Smarkmprinted, a second for sorting indices, and a third for printing the
1389742660Smarkmformatted document.  When you use the shell commands, you can either
1389842660Smarkmwork directly in the operating system shell or work within a shell
1389956160Sruinside GNU Emacs.
1390042660Smarkm
1390142660SmarkmIf you are using GNU Emacs, you can use commands provided by Texinfo
1390242660Smarkmmode instead of shell commands.  In addition to the three commands to
1390342660Smarkmformat a file, sort the indices, and print the result, Texinfo mode
1390442660Smarkmoffers key bindings for commands to recenter the output buffer, show the
1390556160Sruprint queue, and delete a job from the print queue.
1390642660Smarkm
1390742660Smarkm@menu
1390842660Smarkm* Use TeX::                     Use @TeX{} to format for hardcopy.
1390956160Sru* Format with tex/texindex::    How to format with explicit shell commands.
1391056160Sru* Format with texi2dvi::        A simpler way to format.
1391142660Smarkm* Print with lpr::              How to print.
1391242660Smarkm* Within Emacs::                How to format and print from an Emacs shell.
1391342660Smarkm* Texinfo Mode Printing::       How to format and print in Texinfo mode.
1391442660Smarkm* Compile-Command::             How to print using Emacs's compile command.
1391542660Smarkm* Requirements Summary::        @TeX{} formatting requirements summary.
1391656160Sru* Preparing for TeX::           What to do before you use @TeX{}.
1391742660Smarkm* Overfull hboxes::             What are and what to do with overfull hboxes.
1391842660Smarkm* smallbook::                   How to print small format books and manuals.
1391993139Sru* A4 Paper::                    How to print on A4 or A5 paper.
1392056160Sru* pagesizes::                   How to print with customized page sizes.
13921114472Sru* Cropmarks and Magnification:: How to print marks to indicate the size
13922114472Sru                                 of pages and how to print scaled up output.
1392356160Sru* PDF Output::                  Portable Document Format output.
13924146515Sru* Obtaining TeX::               How to Obtain @TeX{}.
1392542660Smarkm@end menu
1392642660Smarkm
1392756160Sru@node Use TeX
1392856160Sru@section Use @TeX{}
1392942660Smarkm
1393042660SmarkmThe typesetting program called @TeX{} is used for formatting a Texinfo
1393156160Srufile.  @TeX{} is a very powerful typesetting program and, if used correctly,
1393242660Smarkmdoes an exceptionally good job.  (@xref{Obtaining TeX, , How to Obtain
1393342660Smarkm@TeX{}}, for information on how to obtain @TeX{}.)
1393442660Smarkm
1393593139SruThe standalone @code{makeinfo} program and Emacs functions
1393693139Sru@code{texinfo-format-region} and @code{texinfo-format-buffer} commands
1393793139Sruread the very same @@-commands in the Texinfo file as does @TeX{}, but
1393893139Sruprocess them differently to make an Info file (@pxref{Creating an Info
1393993139SruFile}).
1394042660Smarkm
1394156160Sru
1394256160Sru@node Format with tex/texindex
1394356160Sru@section Format with @code{tex} and @code{texindex}
1394442660Smarkm@cindex Shell formatting with @code{tex} and @code{texindex}
1394542660Smarkm@cindex Formatting with @code{tex} and @code{texindex}
1394642660Smarkm@cindex DVI file
1394742660Smarkm
13948146515SruYou can format the Texinfo file with the shell command @code{tex}
13949146515Srufollowed by the name of the Texinfo file.  For example:
1395042660Smarkm
1395142660Smarkm@example
1395242660Smarkmtex foo.texi
1395342660Smarkm@end example
1395442660Smarkm
1395542660Smarkm@noindent @TeX{} will produce a @dfn{DVI file} as well as several auxiliary
1395642660Smarkmfiles containing information for indices, cross references, etc.  The
1395742660SmarkmDVI file (for @dfn{DeVice Independent} file) can be printed on virtually
1395856160Sruany device (see the following sections).
1395942660Smarkm
1396042660Smarkm@pindex texindex
1396142660SmarkmThe @code{tex} formatting command itself does not sort the indices; it
13962146515Sruwrites an output file of unsorted index data.  To generate a printed
13963146515Sruindex after running the @command{tex} command, you first need a sorted
13964146515Sruindex to work from.  The @command{texindex} command sorts indices.
13965146515Sru(The source file @file{texindex.c} comes as part of the standard
13966146515SruTexinfo distribution, among other places.)  (@command{texi2dvi} runs
13967146515Sru@command{tex} and @command{texindex} as necessary.)
1396842660Smarkm
1396942660Smarkm@cindex Names of index files
1397056160Sru@cindex Index file names
1397142660SmarkmThe @code{tex} formatting command outputs unsorted index files under
1397242660Smarkmnames that obey a standard convention: the name of your main input file
1397342660Smarkmwith any @samp{.tex} (or similar, @pxref{tex invocation,,, web2c,
1397442660SmarkmWeb2c}) extension removed, followed by the two letter names of indices.
1397542660SmarkmFor example, the raw index output files for the input file
1397642660Smarkm@file{foo.texinfo} would be @file{foo.cp}, @file{foo.vr}, @file{foo.fn},
1397742660Smarkm@file{foo.tp}, @file{foo.pg} and @file{foo.ky}.  Those are exactly the
1397856160Sruarguments to give to @code{texindex}.
1397942660Smarkm
1398042660Smarkm@need 1000
1398142660Smarkm@cindex Wildcards
1398242660Smarkm@cindex Globbing
1398342660SmarkmInstead of specifying all the unsorted index file names explicitly, you
1398442660Smarkmcan use @samp{??} as shell wildcards and give the command in this
1398556160Sruform:
1398642660Smarkm
1398742660Smarkm@example
1398842660Smarkmtexindex foo.??
1398942660Smarkm@end example
1399042660Smarkm
1399142660Smarkm@noindent
1399242660SmarkmThis command will run @code{texindex} on all the unsorted index files,
1399342660Smarkmincluding any that you have defined yourself using @code{@@defindex}
1399442660Smarkmor @code{@@defcodeindex}.  (You may execute @samp{texindex foo.??}
1399542660Smarkmeven if there are similarly named files with two letter extensions
1399642660Smarkmthat are not index files, such as @samp{foo.el}.  The @code{texindex}
1399756160Srucommand reports but otherwise ignores such files.)
1399842660Smarkm
1399942660SmarkmFor each file specified, @code{texindex} generates a sorted index file
1400042660Smarkmwhose name is made by appending @samp{s} to the input file name.  The
1400156160Sru@code{@@printindex} command looks for a file with that name
1400242660Smarkm(@pxref{Printing Indices & Menus}).  @code{texindex} does not alter the
1400356160Sruraw index output file.
1400442660Smarkm
14005146515SruAfter you have sorted the indices, you need to rerun @code{tex} on the
14006146515SruTexinfo file.  This regenerates the DVI file, this time with
14007146515Sruup-to-date index entries.
1400842660Smarkm
1400942660SmarkmFinally, you may need to run @code{tex} one more time, to get the page
1401042660Smarkmnumbers in the cross-references correct.
1401142660Smarkm
1401256160SruTo summarize, this is a five step process:
1401342660Smarkm
1401442660Smarkm@enumerate
1401542660Smarkm@item
1401642660SmarkmRun @code{tex} on your Texinfo file.  This generates a DVI file (with
1401742660Smarkmundefined cross-references and no indices), and the raw index files
1401842660Smarkm(with two letter extensions).
1401942660Smarkm
1402042660Smarkm@item
1402142660SmarkmRun @code{texindex} on the raw index files.  This creates the
1402242660Smarkmcorresponding sorted index files (with three letter extensions).
1402342660Smarkm
1402442660Smarkm@item
1402542660SmarkmRun @code{tex} again on your Texinfo file.  This regenerates the DVI
1402642660Smarkmfile, this time with indices and defined cross-references, but with page
1402742660Smarkmnumbers for the cross-references from last time, generally incorrect.
1402842660Smarkm
1402942660Smarkm@item
1403056160SruSort the indices again, with @code{texindex}.
1403156160Sru
1403256160Sru@item
1403342660SmarkmRun @code{tex} one last time.  This time the correct page numbers are
1403442660Smarkmwritten for the cross-references.
1403542660Smarkm@end enumerate
1403642660Smarkm
1403742660Smarkm@pindex texi2dvi
1403856160SruAlternatively, it's a one-step process: run @code{texi2dvi}
1403956160Sru(@pxref{Format with texi2dvi}).
1404042660Smarkm
1404142660SmarkmYou need not run @code{texindex} each time after you run @code{tex}.  If
1404242660Smarkmyou do not, on the next run, the @code{tex} formatting command will use
1404342660Smarkmwhatever sorted index files happen to exist from the previous use of
1404456160Sru@code{texindex}.  This is usually ok while you are debugging.
1404542660Smarkm
1404656160Sru@cindex Auxiliary files, avoiding
1404756160Sru@findex novalidate
1404856160Sru@cindex Pointer validation, suppressing
1404956160Sru@cindex Chapters, formatting one at a time
1405056160SruSometimes you may wish to print a document while you know it is
1405156160Sruincomplete, or to print just one chapter of a document.  In that case,
1405256160Sruthe usual auxiliary files that @TeX{} creates and warnings @TeX{} gives
1405356160Sruwhen cross-references are not satisfied are just nuisances.  You can
1405456160Sruavoid them with the @code{@@novalidate} command, which you must give
1405556160Sru@emph{before} the @code{@@setfilename} command
1405656160Sru(@pxref{setfilename,,@code{@@setfilename}}).  Thus, the beginning of
1405756160Sruyour file would look approximately like this:
1405842660Smarkm
1405956160Sru@example
1406056160Sru\input texinfo
1406156160Sru@@novalidate
1406256160Sru@@setfilename myfile.info
1406356160Sru@dots{}
1406456160Sru@end example
1406556160Sru
1406656160Sru@noindent @code{@@novalidate} also turns off validation in
1406756160Sru@code{makeinfo}, just like its @code{--no-validate} option
1406856160Sru(@pxref{Pointer Validation}).
1406956160Sru
1407056160Sru
1407156160Sru@node Format with texi2dvi
1407256160Sru@section Format with @code{texi2dvi}
1407342660Smarkm@pindex texi2dvi @r{(shell script)}
1407442660Smarkm
14075146515SruThe @code{texi2dvi} command automatically runs both @TeX{} and
14076146515Sru@command{texindex} as many times as necessary to produce a DVI file
14077146515Sruwith sorted indices and all cross-references resolved.  It is
14078146515Srutherefore simpler than manually executing the
1407956160Sru@code{tex}---@code{texindex}---@code{tex}---@code{tex} sequence
1408056160Srudescribed in the previous section.
1408142660Smarkm
1408256160SruTo run @code{texi2dvi} on an input file @file{foo.texi}, do this (where
1408356160Sru@samp{prompt$ } is your shell prompt):
1408442660Smarkm
1408542660Smarkm@example
1408656160Sruprompt$ @kbd{texi2dvi foo.texi}
1408742660Smarkm@end example
1408842660Smarkm
1408956160SruAs shown in this example, the input filenames to @code{texi2dvi} must
1409056160Sruinclude any extension (@samp{.texi}, @samp{.texinfo}, etc.).  Under
1409156160SruMS-DOS and perhaps in other circumstances, you may need to run @samp{sh
1409256160Srutexi2dvi foo.texi} instead of relying on the operating system to invoke
1409356160Sruthe shell on the @samp{texi2dvi} script.
1409442660Smarkm
1409556160SruPerhaps the most useful option to @code{texi2dvi} is
14096116525Sru@samp{--command=@var{cmd}}.  This inserts @var{cmd} on a line by itself
1409756160Sruafter the @code{@@setfilename} in a temporary copy of the input file
1409856160Srubefore running @TeX{}.  With this, you can specify different printing
1409956160Sruformats, such as @code{@@smallbook} (@pxref{smallbook}),
1410093139Sru@code{@@afourpaper} (@pxref{A4 Paper}), or @code{@@pagesizes}
1410156160Sru(@pxref{pagesizes}), without actually changing the document source.
1410256160Sru(You can also do this on a site-wide basis with @file{texinfo.cnf};
1410356160Sru@pxref{Preparing for TeX,,Preparing for @TeX{}}).
1410442660Smarkm
14105146515SruWith the @option{--pdf} option, @command{texi2dvi} produces PDF output
14106146515Sruinstead of DVI (@pxref{PDF Output}), by running @command{pdftex}
14107146515Sruinstead of @command{tex}.  Alternatively, the command
14108146515Sru@command{texi2pdf} is an abbreviation for running @samp{texi2dvi --pdf}.
14109116525Sru
14110146515Sru@cindex @LaTeX{}, processing with @command{texi2dvi}
14111146515Sru@command{texi2dvi} can also be used to process @LaTeX{} files; simply
14112146515Srurun @samp{texi2dvi filename.ext}.
14113146515Sru
14114146515Sru@command{texi2dvi} will use @command{etex} (or @command{pdfetex}) if
14115146515Sruthey are available; these extended versions of @TeX{} are not
14116146515Srurequired, and the DVI (or PDF) output is identical, but they simplify
14117146515Sruthe @TeX{} programming in some cases, and provide additional tracing
14118146515Sruinformation when debugging @file{texinfo.tex}.
14119146515Sru
1412056160SruFor a list of other options, run @samp{texi2dvi --help}.
1412156160Sru
1412256160Sru
1412393139Sru@node Print with lpr
1412442660Smarkm@section Shell Print Using @code{lpr -d}
1412542660Smarkm@pindex lpr @r{(DVI print command)}
1412642660Smarkm
1412742660SmarkmThe precise command to print a DVI file depends on your system
1412893139Sruinstallation.  Two common ones are @samp{dvips foo.dvi -o} and @samp{lpr
14129116525Sru-d foo.dvi}.
1413042660Smarkm
1413193139SruFor example, the following commands will (perhaps) suffice to sort the
1413242660Smarkmindices, format, and print the @cite{Bison Manual}:
1413342660Smarkm
1413442660Smarkm@example
1413542660Smarkm@group
1413642660Smarkmtex bison.texinfo
1413742660Smarkmtexindex bison.??
1413842660Smarkmtex bison.texinfo
1413942660Smarkmlpr -d bison.dvi
1414042660Smarkm@end group
1414142660Smarkm@end example
1414242660Smarkm
1414342660Smarkm@noindent
1414442660Smarkm(Remember that the shell commands may be different at your site; but
1414593139Sruthese are commonly used versions.)
1414642660Smarkm
1414793139SruUsing the @code{texi2dvi} shell script (see the previous section):
1414842660Smarkm
1414942660Smarkm@example
1415042660Smarkm@group
1415142660Smarkmtexi2dvi bison.texinfo
1415242660Smarkmlpr -d bison.dvi
1415393139Sru# or perhaps dvips bison.dvi -o
1415442660Smarkm@end group
1415542660Smarkm@end example
1415642660Smarkm
1415756160Sru@cindex Shell printing, on MS-DOS/MS-Windows
1415856160Sru@cindex Printing DVI files, on MS-DOS/MS-Windows
1415956160Sru@pindex lpr@r{-d, replacements on MS-DOS/MS-Windows}
1416056160Sru@code{lpr} is a standard program on Unix systems, but it is usually
1416156160Sruabsent on MS-DOS/MS-Windows.  Some network packages come with a
1416256160Sruprogram named @code{lpr}, but these are usually limited to sending files
1416356160Sruto a print server over the network, and generally don't support the
1416456160Sru@samp{-d} option.  If you are unfortunate enough to work on one of these
1416556160Srusystems, you have several alternative ways of printing DVI files:
1416656160Sru
1416756160Sru@itemize @bullet{}
1416856160Sru@item Find and install a Unix-like @code{lpr} program, or its clone.
1416956160SruIf you can do that, you will be able to print DVI files just like
1417056160Srudescribed above.
1417156160Sru
1417256160Sru@item Send the DVI files to a network printer queue for DVI files.
1417356160SruSome network printers have special queues for printing DVI files.  You
1417456160Srushould be able to set up your network software to send files to that
1417556160Sruqueue.  In some cases, the version of @code{lpr} which comes with your
1417656160Srunetwork software will have a special option to send a file to specific
1417756160Sruqueues, like this:
1417856160Sru
1417956160Sru@example
1418056160Srulpr -Qdvi -hprint.server.domain bison.dvi
1418156160Sru@end example
1418256160Sru
1418356160Sru@item Convert the DVI file to a Postscript or PCL file and send it to your
14184146515Srulocal printer.  @xref{Invoking Dvips,,, dvips, Dvips}, and the man
1418556160Srupages for @code{dvilj}, for detailed description of these tools.  Once
1418656160Sruthe DVI file is converted to the format your local printer understands
1418756160Srudirectly, just send it to the appropriate port, usually @samp{PRN}.
1418856160Sru@end itemize
1418956160Sru
1419056160Sru
1419156160Sru@node Within Emacs
1419242660Smarkm@section From an Emacs Shell
1419342660Smarkm@cindex Print, format from Emacs shell
1419442660Smarkm@cindex Format, print from Emacs shell
1419542660Smarkm@cindex Shell, format, print from
1419642660Smarkm@cindex Emacs shell, format, print from
1419742660Smarkm@cindex GNU Emacs shell, format, print from
1419842660Smarkm
1419942660SmarkmYou can give formatting and printing commands from a shell within GNU
1420042660SmarkmEmacs.  To create a shell within Emacs, type @kbd{M-x shell}.  In this
1420156160Srushell, you can format and print the document.  @xref{Hardcopy, , Format
1420256160Sruand Print Hardcopy}, for details.
1420342660Smarkm
1420442660SmarkmYou can switch to and from the shell buffer while @code{tex} is
1420542660Smarkmrunning and do other editing.  If you are formatting a long document
1420642660Smarkmon a slow machine, this can be very convenient.@refill
1420742660Smarkm
1420842660SmarkmYou can also use @code{texi2dvi} from an Emacs shell.  For example,
1420942660Smarkmhere is how to use @code{texi2dvi} to format and print @cite{Using and
1421042660SmarkmPorting GNU CC} from a shell within Emacs:
1421142660Smarkm
1421242660Smarkm@example
1421342660Smarkm@group
1421442660Smarkmtexi2dvi gcc.texinfo
1421542660Smarkmlpr -d gcc.dvi
1421642660Smarkm@end group
1421742660Smarkm@end example
1421842660Smarkm
14219146515SruSee the next section for more information about formatting
14220146515Sruand printing in Texinfo mode.
1422142660Smarkm
1422256160Sru
14223146515Sru@node Texinfo Mode Printing
1422442660Smarkm@section Formatting and Printing in Texinfo Mode
1422542660Smarkm@cindex Region printing in Texinfo mode
1422642660Smarkm@cindex Format and print in Texinfo mode
1422742660Smarkm@cindex Print and format in Texinfo mode
1422842660Smarkm
1422942660SmarkmTexinfo mode provides several predefined key commands for @TeX{}
1423042660Smarkmformatting and printing.  These include commands for sorting indices,
1423142660Smarkmlooking at the printer queue, killing the formatting job, and
1423242660Smarkmrecentering the display of the buffer in which the operations
1423342660Smarkmoccur.@refill
1423442660Smarkm
1423542660Smarkm@table @kbd
1423642660Smarkm@item C-c C-t C-b
1423742660Smarkm@itemx M-x texinfo-tex-buffer
1423842660SmarkmRun @code{texi2dvi} on the current buffer.@refill
1423942660Smarkm
1424042660Smarkm@item C-c C-t C-r
1424142660Smarkm@itemx M-x texinfo-tex-region
1424242660SmarkmRun @TeX{} on the current region.@refill
1424342660Smarkm
1424442660Smarkm@item C-c C-t C-i
1424542660Smarkm@itemx M-x texinfo-texindex
1424642660SmarkmSort the indices of a Texinfo file formatted with
1424742660Smarkm@code{texinfo-tex-region}.@refill
1424842660Smarkm
1424942660Smarkm@item C-c C-t C-p
1425042660Smarkm@itemx M-x texinfo-tex-print
1425142660SmarkmPrint a DVI file that was made with @code{texinfo-tex-region} or
1425242660Smarkm@code{texinfo-tex-buffer}.@refill
1425342660Smarkm
1425442660Smarkm@item C-c C-t C-q
1425542660Smarkm@itemx M-x tex-show-print-queue
1425642660SmarkmShow the print queue.@refill
1425742660Smarkm
1425842660Smarkm@item C-c C-t C-d
1425942660Smarkm@itemx M-x texinfo-delete-from-print-queue
1426042660SmarkmDelete a job from the print queue; you will be prompted for the job
1426142660Smarkmnumber shown by a preceding @kbd{C-c C-t C-q} command
1426242660Smarkm(@code{texinfo-show-tex-print-queue}).@refill
1426342660Smarkm
1426442660Smarkm@item C-c C-t C-k
1426542660Smarkm@itemx M-x tex-kill-job
1426656160SruKill the currently running @TeX{} job started by either
1426742660Smarkm@code{texinfo-tex-region} or @code{texinfo-tex-buffer}, or any other
1426842660Smarkmprocess running in the Texinfo shell buffer.@refill
1426942660Smarkm
1427042660Smarkm@item C-c C-t C-x
1427142660Smarkm@itemx M-x texinfo-quit-job
1427242660SmarkmQuit a @TeX{} formatting job that has stopped because of an error by
1427342660Smarkmsending an @key{x} to it.  When you do this, @TeX{} preserves a record
1427442660Smarkmof what it did in a @file{.log} file.@refill
1427542660Smarkm
1427642660Smarkm@item C-c C-t C-l
1427742660Smarkm@itemx M-x tex-recenter-output-buffer
1427842660SmarkmRedisplay the shell buffer in which the @TeX{} printing and formatting
1427942660Smarkmcommands are run to show its most recent output.@refill
1428042660Smarkm@end table
1428142660Smarkm
1428242660Smarkm@need 1000
1428342660SmarkmThus, the usual sequence of commands for formatting a buffer is as
1428442660Smarkmfollows (with comments to the right):@refill
1428542660Smarkm
1428642660Smarkm@example
1428742660Smarkm@group
1428842660SmarkmC-c C-t C-b             @r{Run @code{texi2dvi} on the buffer.}
1428942660SmarkmC-c C-t C-p             @r{Print the DVI file.}
1429042660SmarkmC-c C-t C-q             @r{Display the printer queue.}
1429142660Smarkm@end group
1429242660Smarkm@end example
1429342660Smarkm
1429442660SmarkmThe Texinfo mode @TeX{} formatting commands start a subshell in Emacs
1429542660Smarkmcalled the @file{*tex-shell*}.  The @code{texinfo-tex-command},
1429642660Smarkm@code{texinfo-texindex-command}, and @code{tex-dvi-print-command}
1429742660Smarkmcommands are all run in this shell.
1429842660Smarkm
1429942660SmarkmYou can watch the commands operate in the @samp{*tex-shell*} buffer,
1430042660Smarkmand you can switch to and from and use the @samp{*tex-shell*} buffer
1430142660Smarkmas you would any other shell buffer.@refill
1430242660Smarkm
1430342660Smarkm@need 1500
1430442660SmarkmThe formatting and print commands depend on the values of several variables.
1430542660SmarkmThe default values are:@refill
1430642660Smarkm
1430742660Smarkm@example
1430842660Smarkm@group
14309114472Sru    @r{Variable}                              @r{Default value}
1431042660Smarkm
1431142660Smarkmtexinfo-texi2dvi-command                  "texi2dvi"
1431242660Smarkmtexinfo-tex-command                       "tex"
1431342660Smarkmtexinfo-texindex-command                  "texindex"
1431442660Smarkmtexinfo-delete-from-print-queue-command   "lprm"
1431542660Smarkmtexinfo-tex-trailer                       "@@bye"
1431642660Smarkmtex-start-of-header                       "%**start"
1431742660Smarkmtex-end-of-header                         "%**end"
1431842660Smarkmtex-dvi-print-command                     "lpr -d"
1431942660Smarkmtex-show-queue-command                    "lpq"
1432042660Smarkm@end group
1432142660Smarkm@end example
1432242660Smarkm
1432342660SmarkmYou can change the values of these variables with the @kbd{M-x
14324146515Sruset-variable} command (@pxref{Examining, , Examining and Setting
14325146515SruVariables, emacs, The GNU Emacs Manual}), or with your @file{.emacs}
14326146515Sruinitialization file (@pxref{Init File, , , emacs, The GNU Emacs
14327146515SruManual}).
1432842660Smarkm
14329100513Sru@cindex Customize Emacs package (@t{Development/Docs/Texinfo})
1433056160SruBeginning with version 20, GNU Emacs offers a user-friendly interface,
1433156160Srucalled @dfn{Customize}, for changing values of user-definable variables.
1433256160Sru@xref{Easy Customization, , Easy Customization Interface, emacs, The GNU
1433356160SruEmacs Manual}, for more details about this.  The Texinfo variables can
1433456160Srube found in the @samp{Development/Docs/Texinfo} group, once you invoke
1433556160Sruthe @kbd{M-x customize} command.
1433656160Sru
1433756160Sru
14338100513Sru@node Compile-Command
1433942660Smarkm@section Using the Local Variables List
1434042660Smarkm@cindex Local variables
1434142660Smarkm@cindex Compile command for formatting
1434242660Smarkm@cindex Format with the compile command
1434342660Smarkm
1434442660SmarkmYet another way to apply the @TeX{} formatting command to a Texinfo file
1434542660Smarkmis to put that command in a @dfn{local variables list} at the end of the
1434642660SmarkmTexinfo file.  You can then specify the @code{tex} or @code{texi2dvi}
1434742660Smarkmcommands as a @code{compile-command} and have Emacs run it by typing
1434842660Smarkm@kbd{M-x compile}.  This creates a special shell called the
1434942660Smarkm@file{*compilation*} buffer in which Emacs runs the compile command.
1435042660SmarkmFor example, at the end of the @file{gdb.texinfo} file, after the
1435142660Smarkm@code{@@bye}, you could put the following:@refill
1435242660Smarkm
1435342660Smarkm@example
1435442660Smarkm@group
1435542660SmarkmLocal Variables:
1435642660Smarkmcompile-command: "texi2dvi gdb.texinfo"
1435742660SmarkmEnd:
1435842660Smarkm@end group
1435942660Smarkm@end example
1436042660Smarkm
1436142660Smarkm@noindent
1436242660SmarkmThis technique is most often used by programmers who also compile programs
1436342660Smarkmthis way; see @ref{Compilation, , , emacs, The GNU Emacs Manual}.@refill
1436442660Smarkm
1436542660Smarkm
1436656160Sru@node Requirements Summary
1436742660Smarkm@section @TeX{} Formatting Requirements Summary
1436842660Smarkm@cindex Requirements for formatting
1436942660Smarkm@cindex Minimal requirements for formatting
1437042660Smarkm@cindex Formatting requirements
1437142660Smarkm
1437242660SmarkmEvery Texinfo file that is to be input to @TeX{} must begin with a
1437342660Smarkm@code{\input} command and must contain an @code{@@setfilename} command:
1437442660Smarkm
1437542660Smarkm@example
1437642660Smarkm\input texinfo
1437742660Smarkm@@setfilename @var{arg-not-used-by-@TeX{}}
1437842660Smarkm@end example
1437942660Smarkm
1438042660Smarkm@noindent
1438142660SmarkmThe first command instructs @TeX{} to load the macros it needs to
1438242660Smarkmprocess a Texinfo file and the second command opens auxiliary files.
1438342660Smarkm
1438442660SmarkmEvery Texinfo file must end with a line that terminates @TeX{}'s
1438542660Smarkmprocessing and forces out unfinished pages:
1438642660Smarkm
1438742660Smarkm@example
1438842660Smarkm@@bye
1438942660Smarkm@end example
1439042660Smarkm
1439142660SmarkmStrictly speaking, these lines are all a Texinfo file needs to be
1439256160Sruprocessed successfully by @TeX{}.
1439342660Smarkm
1439442660SmarkmUsually, however, the beginning includes an @code{@@settitle} command to
1439542660Smarkmdefine the title of the printed manual, an @code{@@setchapternewpage}
1439642660Smarkmcommand, a title page, a copyright page, and permissions.  Besides an
1439742660Smarkm@code{@@bye}, the end of a file usually includes indices and a table of
1439842660Smarkmcontents.  (And of course most manuals contain a body of text as well.)
1439942660Smarkm
1440056160SruFor more information, see:
14401146515Sru
1440256160Sru@itemize @bullet
14403146515Sru@item @ref{settitle, , @code{@@settitle}}.
14404146515Sru@item @ref{setchapternewpage, , @code{@@setchapternewpage}}.
14405146515Sru@item @ref{Headings, ,Page Headings}.
14406146515Sru@item @ref{Titlepage & Copyright Page}.
14407146515Sru@item @ref{Printing Indices & Menus}.
14408146515Sru@item @ref{Contents}.
1440956160Sru@end itemize
1441042660Smarkm
1441142660Smarkm
1441256160Sru@node Preparing for TeX
1441356160Sru@section Preparing for @TeX{}
1441456160Sru@cindex Preparing for @TeX{}
1441542660Smarkm@cindex @TeX{} input initialization
1441642660Smarkm@cindex @b{.profile} initialization file
1441742660Smarkm@cindex @b{.cshrc} initialization file
1441842660Smarkm@cindex Initialization file for @TeX{} input
1441942660Smarkm
1442093139Sru@TeX{} needs to know where to find the @file{texinfo.tex} file that the
1442193139Sru@samp{\input texinfo} command on the first line reads.  The
1442293139Sru@file{texinfo.tex} file tells @TeX{} how to handle @@-commands; it is
14423116525Sruincluded in all standard GNU distributions.  The latest version is
14424146515Srualways available from the Texinfo source repository:
14425146515Sru@smalldisplay
14426146515Sru@uref{http://savannah.gnu.org/cgi-bin/viewcvs/texinfo/texinfo/doc/texinfo.tex?rev=HEAD}
14427146515Sru@end smalldisplay
1442842660Smarkm
1442942660Smarkm@pindex texinfo.tex@r{, installing}
1443042660Smarkm
1443193139SruUsually, the installer has put the @file{texinfo.tex} file in the
1443293139Srudefault directory that contains @TeX{} macros when GNU Texinfo, Emacs or
1443393139Sruother GNU software is installed.  In this case, @TeX{} will find the
1443493139Srufile and you do not need to do anything special.  If this has not been
1443593139Srudone, you can put @file{texinfo.tex} in the current directory when you
1443693139Srurun @TeX{}, and @TeX{} will find it there.
1443793139Sru
1443842660Smarkm@pindex epsf.tex@r{, installing}
1443993139SruAlso, you should install @file{epsf.tex}, if it is not already installed
1444093139Srufrom another distribution.  More details are at the end of the description
1444193139Sruof the @code{@@image} command (@pxref{Images}).
1444242660Smarkm
1444393139Sru@pindex pdfcolor.tex@r{, installing}
1444493139SruLikewise for @file{pdfcolor.tex}, if it is not already installed and you
1444593139Sruuse pdftex.
1444693139Sru
1444742660Smarkm@pindex texinfo.cnf @r{installation}
1444842660Smarkm@cindex Customizing of @TeX{} for Texinfo
1444942660Smarkm@cindex Site-wide Texinfo configuration file
1445042660SmarkmOptionally, you may create an additional @file{texinfo.cnf}, and install
1445156160Sruit as well.  This file is read by @TeX{} when the @code{@@setfilename}
1445256160Srucommand is executed (@pxref{setfilename,, @code{@@setfilename}}).  You can put any
1445356160Srucommands you like there, according to local site-wide conventions.  They
1445456160Sruwill be read by @TeX{} when processing any Texinfo document.  For
1445556160Sruexample, if @file{texinfo.cnf} contains the line @samp{@@afourpaper}
1445656160Sru(@pxref{A4 Paper}), then all Texinfo documents will be processed with
1445756160Sruthat page size in effect.  If you have nothing to put in
1445856160Sru@file{texinfo.cnf}, you do not need to create it.
1445942660Smarkm
14460146515Sru@cindex Environment variable @code{TEXINPUTS}
1446142660Smarkm@vindex TEXINPUTS
1446242660SmarkmIf neither of the above locations for these system files suffice for
1446342660Smarkmyou, you can specify the directories explicitly.  For
1446442660Smarkm@file{texinfo.tex}, you can do this by writing the complete path for the
1446542660Smarkmfile after the @code{\input} command.  Another way, that works for both
1446642660Smarkm@file{texinfo.tex} and @file{texinfo.cnf} (and any other file @TeX{}
1446742660Smarkmmight read), is to set the @code{TEXINPUTS} environment variable in your
1446842660Smarkm@file{.cshrc} or @file{.profile} file.
1446942660Smarkm
1447042660SmarkmWhich you use of @file{.cshrc} or @file{.profile} depends on
1447142660Smarkmwhether you use a Bourne shell-compatible (@code{sh}, @code{bash},
1447242660Smarkm@code{ksh}, @dots{}) or C shell-compatible (@code{csh}, @code{tcsh})
1447342660Smarkmcommand interpreter.  The latter read the @file{.cshrc} file for
1447442660Smarkminitialization information, and the former read @file{.profile}.
1447542660Smarkm
1447642660SmarkmIn a @file{.cshrc} file, you could use the following @code{csh} command
1447742660Smarkmsequence:
1447842660Smarkm
1447942660Smarkm@example
14480116525Srusetenv TEXINPUTS .:/home/me/mylib:
1448142660Smarkm@end example
1448242660Smarkm
1448342660Smarkm@need 1000
1448442660SmarkmIn a @file{.profile} file, you could use the following @code{sh} command
1448542660Smarkmsequence:
1448642660Smarkm
1448742660Smarkm@example
1448842660Smarkm@group
14489116525SruTEXINPUTS=.:/home/me/mylib:
1449042660Smarkmexport TEXINPUTS
1449142660Smarkm@end group
1449242660Smarkm@end example
1449342660Smarkm
1449456160SruOn MS-DOS/MS-Windows, you would say it like this@footnote{Note the use
1449556160Sruof the @samp{;} character, instead of @samp{:}, as directory separator
1449656160Sruon these systems.}:
1449756160Sru
1449856160Sru@example
1449956160Sru@group
14500116525Sruset TEXINPUTS=.;d:/home/me/mylib;c:
1450156160Sru@end group
1450256160Sru@end example
1450356160Sru
1450442660Smarkm@noindent
1450556160SruIt is customary for DOS/Windows users to put such commands in the
14506116525Sru@file{autoexec.bat} file, or in the Windows Registry.
1450742660Smarkm
1450856160Sru@noindent
1450956160SruThese settings would cause @TeX{} to look for @file{\input} file first
1451056160Sruin the current directory, indicated by the @samp{.}, then in a
14511116525Sruhypothetical user @samp{me}'s @file{mylib} directory, and finally in
14512116525Sruthe system directories.  (A leading, trailing, or doubled @samp{:}
14513116525Sruindicates searching the system directories at that point.)
1451442660Smarkm
1451556160Sru@cindex Dumping a .fmt file
1451656160Sru@cindex Format file, dumping
1451756160SruFinally, you may wish to dump a @file{.fmt} file (@pxref{Memory dumps,,,
1451856160Sruweb2c, Web2c}) so that @TeX{} can load Texinfo faster.  (The
1451956160Srudisadvantage is that then updating @file{texinfo.tex} requires
1452056160Sruredumping.)  You can do this by running this command, assuming
1452156160Sru@file{epsf.tex} is findable by @TeX{}:
1452256160Sru
1452356160Sru@example
1452456160Sruinitex texinfo @@dump
1452556160Sru@end example
1452656160Sru
1452793139Sru(@code{dump} is a @TeX{} primitive.)  Then, move @file{texinfo.fmt} to
1452893139Sruwherever your @code{.fmt} files are found; typically, this will be in the
1452993139Srusubdirectory @file{web2c} of your @TeX{} installation.
1453056160Sru
1453156160Sru
1453256160Sru@node Overfull hboxes
1453342660Smarkm@section Overfull ``hboxes''
1453442660Smarkm@cindex Overfull @samp{hboxes}
1453542660Smarkm@cindex @samp{hboxes}, overfull
1453642660Smarkm@cindex Final output
1453742660Smarkm
1453842660Smarkm@TeX{} is sometimes unable to typeset a line without extending it into
1453942660Smarkmthe right margin.  This can occur when @TeX{} comes upon what it
1454042660Smarkminterprets as a long word that it cannot hyphenate, such as an
1454142660Smarkmelectronic mail network address or a very long title.  When this
1454256160Sruhappens, @TeX{} prints an error message like this:
1454342660Smarkm
1454442660Smarkm@example
1454556160SruOverfull @@hbox (20.76302pt too wide)
1454642660Smarkm@end example
1454742660Smarkm
1454856160Sru@findex hbox
1454942660Smarkm@noindent
1455042660Smarkm(In @TeX{}, lines are in ``horizontal boxes'', hence the term, ``hbox''.
1455156160Sru@samp{@@hbox} is a @TeX{} primitive not needed in the Texinfo language.)
1455242660Smarkm
1455342660Smarkm@TeX{} also provides the line number in the Texinfo source file and
1455442660Smarkmthe text of the offending line, which is marked at all the places that
1455556160Sru@TeX{} considered hyphenation.
1455642660Smarkm@xref{Debugging with TeX, , Catching Errors with @TeX{} Formatting},
1455756160Srufor more information about typesetting errors.
1455842660Smarkm
1455942660SmarkmIf the Texinfo file has an overfull hbox, you can rewrite the sentence
1456042660Smarkmso the overfull hbox does not occur, or you can decide to leave it.  A
1456142660Smarkmsmall excursion into the right margin often does not matter and may not
1456256160Srueven be noticeable.
1456342660Smarkm
1456456160SruIf you have many overfull boxes and/or an antipathy to rewriting, you
1456556160Srucan coerce @TeX{} into greatly increasing the allowable interword
1456656160Sruspacing, thus (if you're lucky) avoiding many of the bad line breaks,
1456756160Srulike this:
1456856160Sru
1456956160Sru@findex \emergencystretch
1457056160Sru@example
1457156160Sru@@tex
1457256160Sru\global\emergencystretch = .9\hsize
1457356160Sru@@end tex
1457456160Sru@end example
1457556160Sru
1457656160Sru@noindent
1457793139Sru(You should adjust the fraction as needed.)  This huge value for
1457856160Sru@code{\emergencystretch} cannot be the default, since then the typeset
1457993139Sruoutput would generally be of noticeably lower quality; the default
1458093139Sruis @samp{.15\hsize}.  @code{\hsize} is the @TeX{} dimension
1458156160Srucontaining the current line width.
1458256160Sru
1458342660Smarkm@cindex Black rectangle in hardcopy
1458456160Sru@cindex Rectangle, black in hardcopy
1458556160Sru@cindex Box, ugly black in hardcopy
1458656160Sru@cindex Ugly black rectangles in hardcopy
1458756160SruFor what overfull boxes you have, however, @TeX{} will print a large,
1458856160Sruugly, black rectangle beside the line that contains the overfull hbox
1458956160Sruunless told otherwise.  This is so you will notice the location of the
1459056160Sruproblem if you are correcting a draft.
1459142660Smarkm
1459242660Smarkm@findex finalout
1459342660SmarkmTo prevent such a monstrosity from marring your final printout, write
1459442660Smarkmthe following in the beginning of the Texinfo file on a line of its own,
1459556160Srubefore the @code{@@titlepage} command:
1459642660Smarkm
1459742660Smarkm@example
1459842660Smarkm@@finalout
1459942660Smarkm@end example
1460042660Smarkm
1460156160Sru
1460256160Sru@node smallbook
1460342660Smarkm@section Printing ``Small'' Books
1460442660Smarkm@findex smallbook
1460542660Smarkm@cindex Small book size
1460642660Smarkm@cindex Book, printing small
1460742660Smarkm@cindex Page sizes for books
1460842660Smarkm@cindex Size of printed book
1460942660Smarkm
1461042660SmarkmBy default, @TeX{} typesets pages for printing in an 8.5 by 11 inch
1461142660Smarkmformat.  However, you can direct @TeX{} to typeset a document in a 7 by
1461242660Smarkm9.25 inch format that is suitable for bound books by inserting the
1461342660Smarkmfollowing command on a line by itself at the beginning of the Texinfo
1461442660Smarkmfile, before the title page:@refill
1461542660Smarkm
1461642660Smarkm@example
1461742660Smarkm@@smallbook
1461842660Smarkm@end example
1461942660Smarkm
1462042660Smarkm@noindent
1462156160Sru(Since many books are about 7 by 9.25 inches, this command might better
1462256160Sruhave been called the @code{@@regularbooksize} command, but it came to be
14623114472Srucalled the @code{@@smallbook} command by comparison to the 8.5 by 11
14624114472Sruinch format.)
1462542660Smarkm
1462642660SmarkmIf you write the @code{@@smallbook} command between the
1462742660Smarkmstart-of-header and end-of-header lines, the Texinfo mode @TeX{}
1462842660Smarkmregion formatting command, @code{texinfo-tex-region}, will format the
1462942660Smarkmregion in ``small'' book size (@pxref{Start of Header}).@refill
1463042660Smarkm
1463156160Sru@xref{small}, for information about
1463256160Srucommands that make it easier to produce examples for a smaller manual.
1463342660Smarkm
1463456160Sru@xref{Format with texi2dvi}, and @ref{Preparing for TeX,,Preparing for
1463556160Sru@TeX{}}, for other ways to format with @code{@@smallbook} that do not
1463656160Srurequire changing the source file.
1463742660Smarkm
1463842660Smarkm
1463956160Sru@node A4 Paper
1464042660Smarkm@section Printing on A4 Paper
1464142660Smarkm@cindex A4 paper, printing on
1464293139Sru@cindex A5 paper, printing on
1464393139Sru@cindex Paper size, A4
1464442660Smarkm@cindex European A4 paper
1464542660Smarkm@findex afourpaper
1464642660Smarkm
1464756160SruYou can tell @TeX{} to format a document for printing on European size
1464893139SruA4 paper (or A5) with the @code{@@afourpaper} (or @code{@@afivepaper})
1464993139Srucommand.  Write the command on a line by itself near the beginning of
1465093139Sruthe Texinfo file, before the title page.  For example, this is how you
1465193139Sruwould write the header for this manual:
1465242660Smarkm
1465342660Smarkm@example
1465442660Smarkm@group
1465542660Smarkm\input texinfo    @@c -*-texinfo-*-
1465642660Smarkm@@c %**start of header
1465742660Smarkm@@setfilename texinfo
1465842660Smarkm@@settitle Texinfo
1465942660Smarkm@@afourpaper
1466042660Smarkm@@c %**end of header
1466142660Smarkm@end group
1466242660Smarkm@end example
1466342660Smarkm
1466456160Sru@xref{Format with texi2dvi}, and @ref{Preparing for TeX,,Preparing for
1466593139Sru@TeX{}}, for other ways to format for different paper sizes that do not
1466656160Srurequire changing the source file.
1466742660Smarkm
1466856160Sru@findex afourlatex
1466993139Sru@findex afourwide
1467056160SruYou may or may not prefer the formatting that results from the command
1467156160Sru@code{@@afourlatex}.  There's also @code{@@afourwide} for A4 paper in
1467256160Sruwide format.
1467342660Smarkm
1467456160Sru@node pagesizes
14675114472Sru@section @code{@@pagesizes} [@var{width}][, @var{height}]: Custom Page Sizes
1467656160Sru@findex pagesizes
1467756160Sru@cindex Custom page sizes
1467856160Sru@cindex Page sizes, customized
1467956160Sru@cindex Text width and height
1468056160Sru@cindex Width of text area
1468156160Sru@cindex Height of text area
1468256160Sru@cindex Depth of text area
1468356160Sru
1468456160SruYou can explicitly specify the height and (optionally) width of the main
1468556160Srutext area on the page with the @code{@@pagesizes} command.  Write this
1468656160Sruon a line by itself near the beginning of the Texinfo file, before the
1468756160Srutitle page.  The height comes first, then the width if desired,
1468856160Sruseparated by a comma.  Examples:
1468956160Sru
1469056160Sru@example
1469156160Sru@@pagesizes 200mm,150mm  @c for b5 paper
1469256160Sru@end example
1469356160Sru@noindent and
1469456160Sru@example
1469556160Sru@@pagesizes 11.5in      @c for legal paper
1469656160Sru@end example
1469756160Sru
1469856160Sru@cindex B5 paper, printing on
1469956160Sru@cindex Legal paper, printing on
1470056160SruThis would be reasonable for printing on B5-size paper.  To emphasize,
1470156160Sruthis command specifies the size of the @emph{text area}, not the size of
1470256160Sruthe paper (which is 250@dmn{mm} by 177@dmn{mm} for B5, 14@dmn{in} by
1470356160Sru8.5@dmn{in} for legal).
1470456160Sru
1470556160Sru@cindex Margins on page, not controllable
1470656160SruTo make more elaborate changes, such as changing any of the page
1470756160Srumargins, you must define a new command in @file{texinfo.tex} (or
1470856160Sru@file{texinfo.cnf}, @pxref{Preparing for TeX,,Preparing for @TeX{}}).
1470956160Sru
1471056160Sru@xref{Format with texi2dvi}, and @ref{Preparing for TeX,,Preparing for
1471156160Sru@TeX{}}, for other ways to specify @code{@@pagesizes} that do not
1471256160Srurequire changing the source file.
1471356160Sru
1471456160Sru@code{@@pagesizes} is ignored by @code{makeinfo}.
1471556160Sru
1471656160Sru
1471756160Sru@node Cropmarks and Magnification
1471842660Smarkm@section Cropmarks and Magnification
1471942660Smarkm@findex cropmarks
1472042660Smarkm@cindex Cropmarks for printing
1472142660Smarkm@cindex Printing cropmarks
1472256160SruYou can (attempt to) direct @TeX{} to print cropmarks at the corners of
1472342660Smarkmpages with the @code{@@cropmarks} command.  Write the @code{@@cropmarks}
1472442660Smarkmcommand on a line by itself between @code{@@iftex} and @code{@@end
1472542660Smarkmiftex} lines near the beginning of the Texinfo file, before the title
1472642660Smarkmpage, like this:@refill
1472742660Smarkm
1472842660Smarkm@example
1472942660Smarkm@group
1473042660Smarkm@@iftex
1473142660Smarkm@@cropmarks
1473242660Smarkm@@end iftex
1473342660Smarkm@end group
1473442660Smarkm@end example
1473542660Smarkm
1473642660SmarkmThis command is mainly for printers that typeset several pages on one
1473742660Smarkmsheet of film; but you can attempt to use it to mark the corners of a
1473842660Smarkmbook set to 7 by 9.25 inches with the @code{@@smallbook} command.
1473942660Smarkm(Printers will not produce cropmarks for regular sized output that is
1474042660Smarkmprinted on regular sized paper.)  Since different printing machines work
1474142660Smarkmin different ways, you should explore the use of this command with a
1474256160Sruspirit of adventure.  You may have to redefine the command in
1474356160Sru@file{texinfo.tex}.
1474442660Smarkm
14745100513Sru@findex \mag @r{(raw @TeX{} magnification)}
1474642660Smarkm@cindex Magnified printing
1474742660Smarkm@cindex Larger or smaller pages
1474842660SmarkmYou can attempt to direct @TeX{} to typeset pages larger or smaller than
1474942660Smarkmusual with the @code{\mag} @TeX{} command.  Everything that is typeset
1475042660Smarkmis scaled proportionally larger or smaller.  (@code{\mag} stands for
1475142660Smarkm``magnification''.)  This is @emph{not} a Texinfo @@-command, but is a
1475242660Smarkmplain @TeX{} command that is prefixed with a backslash.  You have to
1475342660Smarkmwrite this command between @code{@@tex} and @code{@@end tex}
1475442660Smarkm(@pxref{Raw Formatter Commands}).
1475542660Smarkm
1475642660SmarkmFollow the @code{\mag} command with an @samp{=} and then a number that
1475742660Smarkmis 1000 times the magnification you desire.  For example, to print pages
1475842660Smarkmat 1.2 normal size, write the following near the beginning of the
1475956160SruTexinfo file, before the title page:
1476042660Smarkm
1476142660Smarkm@example
1476242660Smarkm@group
1476342660Smarkm@@tex
1476442660Smarkm\mag=1200
1476542660Smarkm@@end tex
1476642660Smarkm@end group
1476742660Smarkm@end example
1476842660Smarkm
1476942660SmarkmWith some printing technologies, you can print normal-sized copies that
1477056160Srulook better than usual by giving a larger-than-normal master to your
1477156160Sruprint shop.  They do the reduction, thus effectively increasing the
1477256160Sruresolution.
1477342660Smarkm
1477456160SruDepending on your system, DVI files prepared with a
1477556160Srunonstandard-@code{\mag} may not print or may print only with certain
1477656160Srumagnifications.  Be prepared to experiment.
1477742660Smarkm
1477856160Sru
1477956160Sru@node PDF Output
1478056160Sru@section PDF Output
1478156160Sru@cindex PDF output
1478256160Sru
1478356160Sru@pindex pdftex
14784146515SruThe simplest way to generate PDF output from Texinfo source is to run
14785146515Sruthe convenience script @command{texi2pdf}; this simply executes the
14786146515Sru@command{texi2dvi} script with the @option{--pdf} option
14787146515Sru(@pxref{Format with texi2dvi}).  If for some reason you want to
14788146515Sruprocess by hand, simply run the @command{pdftex} program instead of
14789146515Sruplain @command{tex}.  That is, run @samp{pdftex foo.texi} instead of
14790146515Sru@samp{tex foo.texi}.
1479156160Sru
1479293139Sru@dfn{PDF} stands for `Portable Document Format'. It was invented by
1479393139SruAdobe Systems some years ago for document interchange, based on their
14794146515SruPostScript language.  Related links:
1479556160Sru
14796146515Sru@itemize
14797146515Sru@item
14798146515SruGNU GV, a @uref{http://www.foolabs.com/xpdf/, Ghostscript-based PDF
14799146515Srureader}.  (It can also preview PostScript documents.)
1480056160Sru
14801146515Sru@item
14802146515SruA freely available standalone @uref{http://www.foolabs.com/xpdf/,
14803146515SruPDF reader} for the X window system.
1480456160Sru
14805146515Sru@item
14806146515Sru@uref{http://partners.adobe.com/asn/acrobat/sdk/public/docs/, PDF definition}.
1480756160Sru
14808146515Sru@end itemize
14809146515Sru
14810146515SruAt present, Texinfo does not provide
14811146515Sru@samp{@@ifpdf} or @samp{@@pdf} commands as for the other output
14812146515Sruformats, since PDF documents contain many internal links that would be
14813146515Sruhard or impossible to get right at the Texinfo source level.
14814146515Sru
14815146515SruPDF files require special software to be displayed, unlike the plain
14816146515SruASCII formats (Info, HTML) that Texinfo supports.  They also tend to
14817146515Srube much larger than the DVI files output by @TeX{} by default.
14818146515SruNevertheless, a PDF file does define an actual typeset document in a
14819146515Sruself-contained file, so it has its place.
14820146515Sru
14821146515Sru
14822146515Sru@node Obtaining TeX
14823146515Sru@section How to Obtain @TeX{}
14824146515Sru@cindex Obtaining @TeX{}
14825146515Sru@cindex @TeX{}, how to obtain
14826146515Sru
14827146515Sru@c !!! Here is information about obtaining TeX.  Update it whenever.
14828146515Sru@c !!! Also consider updating TeX.README on ftp.gnu.org.
14829146515Sru@c     Updated by RJC on 1 March 1995, conversation with MacKay.
14830146515Sru@c     Updated by kb@cs.umb.edu on 29 July 1996.
14831146515Sru@c     Updated by kb@cs.umb.edu on 25 April 1997.
14832146515Sru@c     Updated by kb@cs.umb.edu on 27 February 1998.
14833146515Sru@TeX{} is freely redistributable.  You can obtain @TeX{} for Unix
14834146515Srusystems via anonymous ftp or on physical media.  The core material
14835146515Sruconsists of the Web2c @TeX{} distribution (@uref{http://tug.org/web2c}).
14836146515Sru
14837146515SruInstructions for retrieval by anonymous ftp and information on other
14838146515Sruavailable distributions:
14839146515Sru@uref{http://tug.org/unixtex.ftp}.
14840146515Sru
14841146515SruThe Free Software Foundation provides a core distribution on its Source
14842146515SruCode CD-ROM suitable for printing Texinfo manuals.  To order it, contact:
14843146515Sru
14844146515Sru@display
14845146515Sru@group
14846146515SruFree Software Foundation, Inc.
14847146515Sru59 Temple Place Suite 330
14848146515SruBoston, MA @ @ 02111-1307
14849146515SruUSA
14850146515SruTelephone: @w{+1-617-542-5942}
14851146515SruFax: (including Japan) @w{+1-617-542-2652}
14852146515SruFree Dial Fax (in Japan):
14853146515Sru@w{ } @w{ } @w{ } 0031-13-2473 (KDD)
14854146515Sru@w{ } @w{ } @w{ } 0066-3382-0158 (IDC)
14855146515SruElectronic mail: @code{gnu@@gnu.org}
14856146515Sru@end group
14857146515Sru@end display
14858146515Sru
14859146515SruMany other @TeX{} distributions are available; see
14860146515Sru@uref{http://tug.org/}.
14861146515Sru
14862146515Sru
1486356160Sru@node Creating and Installing Info Files
1486456160Sru@chapter Creating and Installing Info Files
1486556160Sru
1486693139SruThis chapter describes how to create and install Info files.  @xref{Info
1486756160SruFiles}, for general information about the file format itself.
1486856160Sru
1486956160Sru@menu
14870116525Sru* Creating an Info File::
14871116525Sru* Installing an Info File::
1487256160Sru@end menu
1487356160Sru
1487493139Sru
1487556160Sru@node Creating an Info File
1487656160Sru@section Creating an Info File
1487742660Smarkm@cindex Creating an Info file
1487856160Sru@cindex Info, creating an online file
1487942660Smarkm@cindex Formatting a file for Info
1488042660Smarkm
1488156160Sru@code{makeinfo} is a program that converts a Texinfo file into an Info
1488256160Srufile, HTML file, or plain text.  @code{texinfo-format-region} and
1488356160Sru@code{texinfo-format-buffer} are GNU Emacs functions that convert
1488456160SruTexinfo to Info.
1488542660Smarkm
1488656160SruFor information on installing the Info file in the Info system,
1488793139Sru@pxref{Installing an Info File}.
1488842660Smarkm
1488942660Smarkm@menu
1489042660Smarkm* makeinfo advantages::         @code{makeinfo} provides better error checking.
1489142660Smarkm* Invoking makeinfo::           How to run @code{makeinfo} from a shell.
1489242660Smarkm* makeinfo options::            Specify fill-column and other options.
1489342660Smarkm* Pointer Validation::          How to check that pointers point somewhere.
1489442660Smarkm* makeinfo in Emacs::           How to run @code{makeinfo} from Emacs.
1489542660Smarkm* texinfo-format commands::     Two Info formatting commands written
14896114472Sru                                 in Emacs Lisp are an alternative
14897114472Sru                                 to @code{makeinfo}.
1489842660Smarkm* Batch Formatting::            How to format for Info in Emacs Batch mode.
1489942660Smarkm* Tag and Split Files::         How tagged and split files help Info
14900114472Sru                                 to run better.
1490142660Smarkm@end menu
1490242660Smarkm
1490342660Smarkm
1490456160Sru@node makeinfo advantages
1490556160Sru@subsection @code{makeinfo} Preferred
1490656160Sru
1490742660SmarkmThe @code{makeinfo} utility creates an Info file from a Texinfo source
1490842660Smarkmfile more quickly than either of the Emacs formatting commands and
1490942660Smarkmprovides better error messages.  We recommend it.  @code{makeinfo} is a
1491042660SmarkmC program that is independent of Emacs.  You do not need to run Emacs to
1491142660Smarkmuse @code{makeinfo}, which means you can use @code{makeinfo} on machines
1491256160Sruthat are too small to run Emacs.  You can run @code{makeinfo} in any one
1491356160Sruof three ways: from an operating system shell, from a shell inside
1491456160SruEmacs, or by typing the @kbd{C-c C-m C-r} or the @kbd{C-c C-m C-b}
1491556160Srucommand in Texinfo mode in Emacs.
1491642660Smarkm
1491742660SmarkmThe @code{texinfo-format-region} and the @code{texinfo-format-buffer}
1491842660Smarkmcommands are useful if you cannot run @code{makeinfo}.  Also, in some
1491942660Smarkmcircumstances, they format short regions or buffers more quickly than
14920146515Sru@code{makeinfo}.
1492142660Smarkm
14922146515Sru
1492356160Sru@node Invoking makeinfo
1492456160Sru@subsection Running @code{makeinfo} from a Shell
14925146515Sru@pindex makeinfo
1492642660Smarkm
14927146515SruTo create an Info file from a Texinfo file, invoke @command{makeinfo}
1492842660Smarkmfollowed by the name of the Texinfo file.  Thus, to create the Info
1492942660Smarkmfile for Bison, type the following to the shell:
1493042660Smarkm
1493142660Smarkm@example
1493242660Smarkmmakeinfo bison.texinfo
1493342660Smarkm@end example
1493442660Smarkm
14935146515Sru(You can run a shell inside Emacs by typing @kbd{M-x shell}.)
1493642660Smarkm
14937146515Sru@command{makeinfo} has many options to control its actions and output;
14938146515Srusee the next section.
1493942660Smarkm
1494042660Smarkm
1494156160Sru@node makeinfo options
1494256160Sru@subsection Options for @code{makeinfo}
1494342660Smarkm@cindex @code{makeinfo} options
1494442660Smarkm@cindex Options for @code{makeinfo}
1494542660Smarkm
14946146515SruThe @command{makeinfo} program accepts many options.  Perhaps the most
14947146515Srucommonly needed are those that change the output format.  By default,
14948146515Sru@command{makeinfo} outputs Info files.
1494942660Smarkm
14950146515SruEach command line option is a word preceded by @samp{--} or a letter
14951146515Srupreceded by @samp{-}.  You can use abbreviations for the long option
14952146515Srunames as long as they are unique.
14953146515Sru
1495442660SmarkmFor example, you could use the following shell command to create an Info
1495542660Smarkmfile for @file{bison.texinfo} in which each line is filled to only 68
14956146515Srucolumns:
1495742660Smarkm
1495842660Smarkm@example
1495942660Smarkmmakeinfo --fill-column=68 bison.texinfo
1496042660Smarkm@end example
1496142660Smarkm
1496242660SmarkmYou can write two or more options in sequence, like this:@refill
1496342660Smarkm
1496442660Smarkm@example
1496542660Smarkmmakeinfo --no-split --fill-column=70 @dots{}
1496642660Smarkm@end example
1496742660Smarkm
1496842660Smarkm@noindent
1496942660SmarkmThis would keep the Info file together as one possibly very long
14970146515Srufile and would also set the fill column to 70.
1497142660Smarkm
1497242660SmarkmThe options are:
1497342660Smarkm
1497442660Smarkm@table @code
1497542660Smarkm
1497642660Smarkm@item -D @var{var}
1497742660Smarkm@opindex -D @var{var}
1497842660SmarkmCause the variable @var{var} to be defined.  This is equivalent to
1497942660Smarkm@code{@@set @var{var}} in the Texinfo file (@pxref{set clear value}).
1498042660Smarkm
1498156160Sru@item --commands-in-node-names
1498256160Sru@opindex --commands-in-node-names
1498356160SruAllow @code{@@}-commands in node names.  This is not recommended, as it
1498456160Srucan probably never be implemented in @TeX{}.  It also makes
1498556160Sru@code{makeinfo} much slower.  Also, this option is ignored when
1498656160Sru@samp{--no-validate} is used.  @xref{Pointer Validation}, for more
1498756160Srudetails.
1498856160Sru
14989116525Sru@item --css-include=@var{file}
14990116525Sru@opindex --css-include
14991116525SruInclude the contents of @var{file}, which should contain cascading
14992116525Srustyle sheets specifications, in the @samp{<style>} block of the HTML
14993116525Sruoutput.  @xref{HTML CSS}.  If @var{file} is @samp{-}, read standard
14994116525Sruinput.
14995116525Sru
1499693139Sru@item --docbook
1499793139Sru@opindex --docbook
14998146515SruGenerate Docbook output rather than Info.
1499993139Sru
15000114472Sru@item --enable-encoding
15001114472Sru@opindex --enable-encoding
15002114472SruOutput accented and special characters in Info or plain text output
15003114472Srubased on @samp{@@documentencoding}.
15004116525Sru@xref{documentencoding,,@code{documentencoding}}, and @ref{Inserting Accents}.
15005114472Sru
1500642660Smarkm@item --error-limit=@var{limit}
1500756160Sru@itemx -e @var{limit}
1500842660Smarkm@opindex --error-limit=@var{limit}
1500956160Sru@opindex -e @var{limit}
1501042660SmarkmSet the maximum number of errors that @code{makeinfo} will report
1501142660Smarkmbefore exiting (on the assumption that continuing would be useless);
1501242660Smarkmdefault 100.
1501342660Smarkm
1501442660Smarkm@item --fill-column=@var{width}
1501556160Sru@itemx -f @var{width}
1501642660Smarkm@opindex --fill-column=@var{width}
1501756160Sru@opindex -f @var{width}
1501842660SmarkmSpecify the maximum number of columns in a line; this is the right-hand
1501942660Smarkmedge of a line.  Paragraphs that are filled will be filled to this
1502042660Smarkmwidth.  (Filling is the process of breaking up and connecting lines so
1502142660Smarkmthat lines are the same length as or shorter than the number specified
1502242660Smarkmas the fill column.  Lines are broken between words.) The default value
1502356160Sruis 72.  Ignored with @samp{--html}.
1502442660Smarkm
1502542660Smarkm@item --footnote-style=@var{style}
1502656160Sru@itemx -s @var{style}
1502742660Smarkm@opindex --footnote-style=@var{style}
1502856160Sru@opindex -s @var{style}
1502942660SmarkmSet the footnote style to @var{style}, either @samp{end} for the end
1503042660Smarkmnode style (the default) or @samp{separate} for the separate node style.
1503142660SmarkmThe value set by this option overrides the value set in a Texinfo file
1503242660Smarkmby an @code{@@footnotestyle} command (@pxref{Footnotes}).  When the
1503342660Smarkmfootnote style is @samp{separate}, @code{makeinfo} makes a new node
1503442660Smarkmcontaining the footnotes found in the current node.  When the footnote
1503542660Smarkmstyle is @samp{end}, @code{makeinfo} places the footnote references at
1503656160Sruthe end of the current node.  Ignored with @samp{--html}.
1503742660Smarkm
1503842660Smarkm@item --force
1503956160Sru@itemx -F
1504042660Smarkm@opindex --force
1504156160Sru@opindex -F
1504242660SmarkmOrdinarily, if the input file has errors, the output files are not
1504342660Smarkmcreated.  With this option, they are preserved.
1504442660Smarkm
1504542660Smarkm@item --help
1504656160Sru@itemx -h
1504742660Smarkm@opindex --help
1504856160Sru@opindex -h
1504942660SmarkmPrint a usage message listing all available options, then exit successfully.
1505042660Smarkm
1505156160Sru@item --html
1505293139Sru@opindex --html
15053114472SruGenerate HTML output rather than Info.  @xref{Generating HTML}.  By
15054116525Srudefault, the HTML output is split into one output file per Texinfo
15055116525Srusource node, and the split output is written into a subdirectory with
15056116525Sruthe name of the top-level info file.
1505756160Sru
1505842660Smarkm@item -I @var{dir}
1505942660Smarkm@opindex -I @var{dir}
1506056160SruAppend @var{dir} to the directory search list for finding files that
1506156160Sruare included using the @code{@@include} command.  By default,
1506256160Sru@code{makeinfo} searches only the current directory.  If @var{dir} is
1506356160Srunot given, the current directory @file{.} is appended.  Note that
1506456160Sru@var{dir} can actually be a list of several directories separated by the
1506556160Sruusual path separator character (@samp{:} on Unix, @samp{;} on
1506656160SruMS-DOS/MS-Windows).
1506742660Smarkm
15068146515Sru@item --ifdocbook
15069146515Sru@opindex --ifdocbook
15070146515Sru@itemx --ifhtml
15071146515Sru@opindex --ifhtml
15072114472Sru@itemx --ifinfo
15073146515Sru@opindex --ifinfo
15074114472Sru@itemx --ifplaintext
15075146515Sru@opindex --ifplaintext
15076114472Sru@itemx --iftex
15077146515Sru@opindex --iftex
15078114472Sru@itemx --ifxml
15079114472Sru@opindex --ifxml
15080114472SruFor the specified format, process @samp{@@if@var{format}} and
15081114472Sru@samp{@@@var{format}} commands even if not generating the given output
15082114472Sruformat.  For instance, if @option{--iftex} is specified, then
15083146515Sru@samp{@@iftex} and @samp{@@tex} blocks will be read.  
15084114472Sru
1508556160Sru@item --macro-expand=@var{file}
1508656160Sru@itemx -E @var{file}
15087114472Sru@opindex --macro-expand=@var{file}
15088114472Sru@opindex -E @var{file}
1508956160SruOutput the Texinfo source with all the macros expanded to the named
1509056160Srufile.  Normally, the results of macro expansion are used internally by
1509156160Sru@code{makeinfo} and then discarded.  This option is used by
15092146515Sru@command{texi2dvi}.
1509356160Sru
1509442660Smarkm@item --no-headers
15095146515Sru@item --plaintext
1509642660Smarkm@opindex --no-headers
15097146515Sru@opindex --plaintext
1509856160Sru@cindex Plain text output
1509956160Sru@cindex ASCII text output
1510056160Sru@cindex Generating plain text files
1510156160Sru@cindex @file{INSTALL} file, generating
15102100513Sru@cindex Node separators, omitting
15103100513Sru@cindex Menus, omitting
15104146515SruDo not include menus or node separator lines in the output, and
15105146515Sruimplicitly @option{--enable-encoding} (see above).  This results in a
15106146515Srusimple plain text file that you can (for example) send in email
15107146515Sruwithout complications, or include in a distribution (as in an
15108146515Sru@file{INSTALL} file).
1510942660Smarkm
1511056160Sru@cindex Navigation links, omitting
15111100513SruFor HTML output, likewise omit menus.  And if @samp{--no-split} is also
15112100513Sruspecified, do not include a navigation links at the top of each node
15113100513Sru(these are never included in the default case of split output).
15114114472Sru@xref{Generating HTML}.
1511556160Sru
15116146515SruIn both cases, ignore @code{@@setfilename} and write to standard
15117146515Sruoutput by default---can be overridden with @option{-o}.
15118100513Sru
15119146515Sru@item --no-ifdocbook
15120146515Sru@opindex --no-ifdocbook
15121146515Sru@itemx --no-ifhtml
15122146515Sru@opindex --no-ifhtml
15123114472Sru@itemx --no-ifinfo
15124146515Sru@opindex --no-ifinfo
15125114472Sru@itemx --no-ifplaintext
15126146515Sru@opindex --no-ifplaintext
15127114472Sru@itemx --no-iftex
15128146515Sru@opindex --no-iftex
15129114472Sru@itemx --no-ifxml
15130114472Sru@opindex --no-ifxml
15131114472SruDo not process @samp{@@if@var{format}} and @samp{@@@var{format}}
15132146515Srucommands, and do process @samp{@@ifnot@var{format}}, even if
15133146515Srugenerating the given format.  For instance, if @option{--no-ifhtml} is
15134146515Sruspecified, then @samp{@@ifhtml} and @samp{@@html} blocks will not be
15135146515Sruread, and @samp{@@ifnothtml} blocks will be.
15136114472Sru
15137146515Sru@item --no-number-footnotes
15138146515Sru@opindex --no-number-footnotes
15139146515SruSuppress automatic footnote numbering.  By default, @code{makeinfo}
15140146515Srunumbers each footnote sequentially in a single node, resetting the
15141146515Srucurrent footnote number to 1 at the start of each node.
15142146515Sru
15143146515Sru@item --no-number-sections
15144146515Sru@opindex --no-number-sections
15145146515SruDo not output chapter, section, and appendix numbers.
15146146515SruYou need to specify this if your manual is not hierarchically-structured.
15147146515Sru
1514842660Smarkm@item --no-split
1514942660Smarkm@opindex --no-split
1515056160Sru@cindex Splitting of output files
1515156160Sru@cindex Output file splitting
1515242660SmarkmSuppress the splitting stage of @code{makeinfo}.  By default, large
1515342660Smarkmoutput files (where the size is greater than 70k bytes) are split into
1515456160Srusmaller subfiles.  For Info output, each one is approximately 50k bytes.
15155114472SruFor HTML output, each file contains one node (@pxref{Generating HTML}).
1515642660Smarkm
1515742660Smarkm@item --no-pointer-validate
1515842660Smarkm@itemx --no-validate
1515942660Smarkm@opindex --no-pointer-validate
1516042660Smarkm@opindex --no-validate
1516156160Sru@cindex Pointer validation, suppressing
15162146515SruSuppress the pointer-validation phase of @code{makeinfo}---a dangerous
15163146515Sruthing to do.  This can also be done with the @code{@@novalidate}
15164146515Srucommand (@pxref{Use TeX,,Use @TeX{}}).  Normally, after a Texinfo file
15165146515Sruis processed, some consistency checks are made to ensure that cross
15166146515Srureferences can be resolved, etc.  @xref{Pointer Validation}.
1516742660Smarkm
1516842660Smarkm@item --no-warn
1516942660Smarkm@opindex --no-warn
15170146515SruSuppress warning messages (but @emph{not} error messages).
1517142660Smarkm
1517256160Sru@item --number-sections
1517356160Sru@opindex --number-sections
1517456160SruOutput chapter, section, and appendix numbers as in printed manuals.
15175146515SruThis is the default.  It works only with hierarchically-structured
15176146515Srumanuals.
1517756160Sru
1517842660Smarkm@item --output=@var{file}
1517942660Smarkm@itemx -o @var{file}
1518042660Smarkm@opindex --output=@var{file}
1518142660Smarkm@opindex -o @var{file}
1518242660SmarkmSpecify that the output should be directed to @var{file} and not to the
1518342660Smarkmfile name specified in the @code{@@setfilename} command found in the
1518442660SmarkmTexinfo source (@pxref{setfilename}).  If @var{file} is @samp{-}, output
1518556160Srugoes to standard output and @samp{--no-split} is implied.  For split
1518693139SruHTML output, @var{file} is the name for the directory into which all
15187114472SruHTML nodes are written (@pxref{Generating HTML}).
1518842660Smarkm
1518942660Smarkm@item -P @var{dir}
1519042660Smarkm@opindex -P @var{dir}
1519156160SruPrepend @var{dir} to the directory search list for @code{@@include}.
1519256160SruIf @var{dir} is not given, the current directory @file{.} is prepended.
1519342660SmarkmSee @samp{-I} for more details.
1519442660Smarkm
1519542660Smarkm@item --paragraph-indent=@var{indent}
1519656160Sru@itemx -p @var{indent}
1519742660Smarkm@opindex --paragraph-indent=@var{indent}
1519856160Sru@opindex -p @var{indent}
1519942660SmarkmSet the paragraph indentation style to @var{indent}.  The value set by
1520042660Smarkmthis option overrides the value set in a Texinfo file by an
1520142660Smarkm@code{@@paragraphindent} command (@pxref{paragraphindent}).  The value
1520242660Smarkmof @var{indent} is interpreted as follows:
1520342660Smarkm
1520442660Smarkm@table @asis
1520542660Smarkm@item @samp{asis}
1520642660SmarkmPreserve any existing indentation at the starts of paragraphs.
1520742660Smarkm
1520842660Smarkm@item @samp{0} or @samp{none}
1520942660SmarkmDelete any existing indentation.
1521042660Smarkm
1521142660Smarkm@item @var{num}
1521256160SruIndent each paragraph by @var{num} spaces.
1521342660Smarkm@end table
1521442660Smarkm
1521542660Smarkm@item --reference-limit=@var{limit}
1521656160Sru@itemx -r @var{limit}
1521742660Smarkm@opindex --reference-limit=@var{limit}
1521856160Sru@opindex -r @var{limit}
1521942660SmarkmSet the value of the number of references to a node that
1522042660Smarkm@code{makeinfo} will make without reporting a warning.  If a node has more
1522142660Smarkmthan this number of references in it, @code{makeinfo} will make the
1522242660Smarkmreferences but also report a warning.  The default is 1000.
1522342660Smarkm
15224114472Sru@item --split-size=@var{num}
15225114472Sru@opindex --split-size=@var{num}
15226116525SruKeep Info files to at most @var{num} characters; default is 300,000.
15227114472Sru
1522842660Smarkm@item -U @var{var}
1522942660SmarkmCause @var{var} to be undefined.  This is equivalent to
1523042660Smarkm@code{@@clear @var{var}} in the Texinfo file (@pxref{set clear value}).
1523142660Smarkm
1523242660Smarkm@item --verbose
1523342660Smarkm@opindex --verbose
1523442660SmarkmCause @code{makeinfo} to display messages saying what it is doing.
1523542660SmarkmNormally, @code{makeinfo} only outputs messages if there are errors or
1523642660Smarkmwarnings.
1523742660Smarkm
1523842660Smarkm@item --version
1523956160Sru@itemx -V
1524042660Smarkm@opindex --version
1524156160Sru@opindex -V
1524242660SmarkmPrint the version number, then exit successfully.
1524342660Smarkm
1524493139Sru@item --xml
1524593139Sru@opindex --xml
15246116525SruGenerate XML output rather than Info.
1524793139Sru
1524842660Smarkm@end table
1524942660Smarkm
15250146515Sru@vindex TEXINFO_OUTPUT_FORMAT
15251146515Sru@cindex Environment variable @code{TEXINFO_OUTPUT_FORMAT}
15252146515Sru@command{makeinfo} also reads the environment variable
15253146515Sru@env{TEXINFO_OUTPUT_FORMAT} to determine the output format, if not
15254146515Sruoverridden by a command line option.  The possible values are:
1525542660Smarkm
15256146515Sru@example
15257146515Srudocbook  html  info  plaintext  xml
15258146515Sru@end example
15259146515Sru
15260146515SruIf not set, Info output is the default.
15261146515Sru
15262146515Sru
1526356160Sru@node Pointer Validation
1526456160Sru@subsection Pointer Validation
1526542660Smarkm@cindex Pointer validation with @code{makeinfo}
1526642660Smarkm@cindex Validation of pointers
1526742660Smarkm
1526856160SruIf you do not suppress pointer validation with the @samp{--no-validate}
1526956160Sruoption or the @code{@@novalidate} command in the source file (@pxref{Use
1527056160SruTeX,,Use @TeX{}}), @code{makeinfo} will check the validity of the final
1527156160SruInfo file.  Mostly, this means ensuring that nodes you have referenced
1527256160Srureally exist.  Here is a complete list of what is checked:
1527342660Smarkm
1527442660Smarkm@enumerate
1527542660Smarkm@item
1527642660SmarkmIf a `Next', `Previous', or `Up' node reference is a reference to a
1527742660Smarkmnode in the current file and is not an external reference such as to
1527842660Smarkm@file{(dir)}, then the referenced node must exist.@refill
1527942660Smarkm
1528042660Smarkm@item
1528142660SmarkmIn every node, if the `Previous' node is different from the `Up' node,
1528256160Sruthen the node pointed to by the `Previous' field must have a `Next'
1528356160Srufield which points back to this node.@refill
1528442660Smarkm
1528542660Smarkm@item
1528642660SmarkmEvery node except the `Top' node must have an `Up' pointer.@refill
1528742660Smarkm
1528842660Smarkm@item
1528956160SruThe node referenced by an `Up' pointer must itself reference the current
1529056160Srunode through a menu item, unless the node referenced by `Up'
1529156160Sruhas the form `(@var{file})'.
1529242660Smarkm
1529342660Smarkm@item
1529442660SmarkmIf the `Next' reference of a node is not the same as the `Next' reference
1529542660Smarkmof the `Up' reference, then the node referenced by the `Next' pointer
1529642660Smarkmmust have a `Previous' pointer that points back to the current node.
1529742660SmarkmThis rule allows the last node in a section to point to the first node
1529842660Smarkmof the next chapter.@refill
1529956160Sru
1530056160Sru@item
1530156160SruEvery node except `Top' should be referenced by at least one other node,
1530256160Srueither via the `Previous' or `Next' links, or via a menu or a
1530356160Srucross-reference.@refill
1530442660Smarkm@end enumerate
1530542660Smarkm
1530656160Sru@cindex @@-commands in @@node, limited support
1530756160SruSome Texinfo documents might fail during the validation phase because
1530856160Sruthey use commands like @code{@@value} and @code{@@definfoenclose} in
15309146515Srunode definitions and cross-references inconsistently.  (Your best bet
15310146515Sruis to avoid using @@-commands in node names.)  Consider the
1531156160Srufollowing example:
1531256160Sru
1531356160Sru@example
1531456160Sru@group
1531556160Sru@@set nodename Node 1
1531656160Sru
1531756160Sru@@node @@value@{nodename@}, Node 2, Top, Top
1531856160Sru
1531956160SruThis is node 1.
1532056160Sru
1532156160Sru@@node Node 2, , Node 1, Top
1532256160Sru
1532356160SruThis is node 2.
1532456160Sru@end group
1532556160Sru@end example
1532656160Sru
1532756160Sru@noindent
1532856160SruHere, the node ``Node 1'' was referenced both verbatim and through
1532956160Sru@code{@@value}.
1533056160Sru
1533156160SruBy default, @code{makeinfo} fails such cases, because node names are not
1533256160Srufully expanded until they are written to the output file.  You should
1533356160Srualways try to reference nodes consistently; e.g., in the above example,
1533456160Sruthe second @code{@@node} line should have also used @code{@@value}.
1533556160SruHowever, if, for some reason, you @emph{must} reference node names
1533656160Sruinconsistently, and @code{makeinfo} fails to validate the file, you can
1533756160Sruuse the @samp{--commands-in-node-names} option to force @code{makeinfo}
1533856160Sruto perform the expensive expansion of all node names it finds in the
1533956160Srudocument.  This might considerably slow down the program, though;
1534056160Srutwofold increase in conversion time was measured for large documents
1534156160Srusuch as the Jargon file.
1534256160Sru
1534356160Sru@cindex @@value in @@node lines
1534456160SruThe support for @code{@@}-commands in @code{@@node} directives is not
1534556160Srugeneral enough to be freely used.  For example, if the example above
1534656160Sruredefined @code{nodename} somewhere in the document, @code{makeinfo}
1534756160Sruwill fail to convert it, even if invoked with the
1534856160Sru@samp{--commands-in-node-names} option.
1534956160Sru
1535056160Sru@samp{--commands-in-node-names} has no effect if the @samp{--no-validate}
1535156160Sruoption is given.
1535256160Sru
1535356160Sru
1535456160Sru@node makeinfo in Emacs
15355114472Sru@subsection Running @code{makeinfo} Within Emacs
1535642660Smarkm@cindex Running @code{makeinfo} in Emacs
1535742660Smarkm@cindex @code{makeinfo} inside Emacs
1535842660Smarkm@cindex Shell, running @code{makeinfo} in
1535942660Smarkm
1536042660SmarkmYou can run @code{makeinfo} in GNU Emacs Texinfo mode by using either the
1536142660Smarkm@code{makeinfo-region} or the @code{makeinfo-buffer} commands.  In
1536242660SmarkmTexinfo mode, the commands are bound to @kbd{C-c C-m C-r} and @kbd{C-c
1536342660SmarkmC-m C-b} by default.@refill
1536442660Smarkm
1536542660Smarkm@table @kbd
1536642660Smarkm@item C-c C-m C-r
1536742660Smarkm@itemx M-x makeinfo-region
1536842660SmarkmFormat the current region for Info.@refill
1536942660Smarkm@findex makeinfo-region
1537042660Smarkm
1537142660Smarkm@item C-c C-m C-b
1537242660Smarkm@itemx M-x makeinfo-buffer
1537342660SmarkmFormat the current buffer for Info.@refill
1537442660Smarkm@findex makeinfo-buffer
1537542660Smarkm@end table
1537642660Smarkm
15377114472SruWhen you invoke @code{makeinfo-region} the output goes to a temporary
15378114472Srubuffer.  When you invoke @code{makeinfo-buffer} output goes to the
15379114472Srufile set with @code{@@setfilename} (@pxref{setfilename}).
1538042660Smarkm
1538142660SmarkmThe Emacs @code{makeinfo-region} and @code{makeinfo-buffer} commands
1538242660Smarkmrun the @code{makeinfo} program in a temporary shell buffer.  If
1538342660Smarkm@code{makeinfo} finds any errors, Emacs displays the error messages in
1538442660Smarkmthe temporary buffer.@refill
1538542660Smarkm
1538642660Smarkm@cindex Errors, parsing
1538742660Smarkm@cindex Parsing errors
1538842660Smarkm@findex next-error
1538942660SmarkmYou can parse the error messages by typing @kbd{C-x `}
1539042660Smarkm(@code{next-error}).  This causes Emacs to go to and position the
1539142660Smarkmcursor on the line in the Texinfo source that @code{makeinfo} thinks
1539242660Smarkmcaused the error.  @xref{Compilation, , Running @code{make} or
1539342660SmarkmCompilers Generally, emacs, The GNU Emacs Manual}, for more
1539442660Smarkminformation about using the @code{next-error} command.@refill
1539542660Smarkm
1539642660SmarkmIn addition, you can kill the shell in which the @code{makeinfo}
1539742660Smarkmcommand is running or make the shell buffer display its most recent
1539842660Smarkmoutput.@refill
1539942660Smarkm
1540042660Smarkm@table @kbd
1540142660Smarkm@item C-c C-m C-k
1540242660Smarkm@itemx M-x makeinfo-kill-job
1540342660Smarkm@findex makeinfo-kill-job
1540456160SruKill the current running @code{makeinfo} job
1540556160Sru(from @code{makeinfo-region} or @code{makeinfo-buffer}).@refill
1540642660Smarkm
1540742660Smarkm@item C-c C-m C-l
1540842660Smarkm@itemx M-x makeinfo-recenter-output-buffer
1540942660Smarkm@findex makeinfo-recenter-output-buffer
1541042660SmarkmRedisplay the @code{makeinfo} shell buffer to display its most recent
1541142660Smarkmoutput.@refill
1541242660Smarkm@end table
1541342660Smarkm
1541442660Smarkm@noindent
1541542660Smarkm(Note that the parallel commands for killing and recentering a @TeX{}
1541642660Smarkmjob are @kbd{C-c C-t C-k} and @kbd{C-c C-t C-l}.  @xref{Texinfo Mode
1541742660SmarkmPrinting}.)@refill
1541842660Smarkm
1541942660SmarkmYou can specify options for @code{makeinfo} by setting the
1542042660Smarkm@code{makeinfo-options} variable with either the @kbd{M-x
15421146515Srucustomize} or the @kbd{M-x set-variable} command, or by setting the
15422146515Sruvariable in your @file{.emacs} initialization file.
1542342660Smarkm
1542442660SmarkmFor example, you could write the following in your @file{.emacs} file:@refill
1542542660Smarkm
1542642660Smarkm@example
1542742660Smarkm@group
1542842660Smarkm(setq makeinfo-options
15429114472Sru     "--paragraph-indent=0 --no-split
15430114472Sru      --fill-column=70 --verbose")
1543142660Smarkm@end group
1543242660Smarkm@end example
1543342660Smarkm
15434146515Sru@noindent
1543542660Smarkm@c If you write these three cross references using xref, you see
1543642660Smarkm@c three references to the same named manual, which looks strange.
1543742660Smarkm@iftex
1543842660SmarkmFor more information, see @ref{makeinfo options, , Options for
15439146515Sru@code{makeinfo}}, as well as ``Easy Customization Interface,'' ``Examining
1544056160Sruand Setting Variables,'' and ``Init File'' in @cite{The GNU Emacs
1544142660SmarkmManual}.
1544242660Smarkm@end iftex
15443146515Sru@ifnottex
1544442660SmarkmFor more information, see@*
15445146515Sru@ref{Easy Customization, , Easy Customization Interface, emacs, The GNU Emacs Manual},@*
1544642660Smarkm@ref{Examining, , Examining and Setting Variables, emacs, The GNU Emacs Manual},@*
1544742660Smarkm@ref{Init File, , , emacs, The GNU Emacs Manual}, and@*
1544842660Smarkm@ref{makeinfo options, , Options for @code{makeinfo}}.
15449146515Sru@end ifnottex
1545042660Smarkm
1545156160Sru@node texinfo-format commands
1545256160Sru@subsection The @code{texinfo-format@dots{}} Commands
1545342660Smarkm
1545442660SmarkmIn GNU Emacs in Texinfo mode, you can format part or all of a Texinfo
1545542660Smarkmfile with the @code{texinfo-format-region} command.  This formats the
1545642660Smarkmcurrent region and displays the formatted text in a temporary buffer
1545742660Smarkmcalled @samp{*Info Region*}.@refill
1545842660Smarkm
1545942660SmarkmSimilarly, you can format a buffer with the
1546042660Smarkm@code{texinfo-format-buffer} command.  This command creates a new
1546142660Smarkmbuffer and generates the Info file in it.  Typing @kbd{C-x C-s} will
1546242660Smarkmsave the Info file under the name specified by the
1546342660Smarkm@code{@@setfilename} line which must be near the beginning of the
1546442660SmarkmTexinfo file.@refill
1546542660Smarkm
1546642660Smarkm@table @kbd
1546742660Smarkm@item C-c C-e C-r
1546842660Smarkm@itemx @code{texinfo-format-region}
15469146515Sru@findex texinfo-format-region
1547042660SmarkmFormat the current region for Info.
1547142660Smarkm
1547242660Smarkm@item C-c C-e C-b
1547342660Smarkm@itemx @code{texinfo-format-buffer}
15474146515Sru@findex texinfo-format-buffer
1547542660SmarkmFormat the current buffer for Info.
1547642660Smarkm@end table
1547742660Smarkm
1547842660SmarkmThe @code{texinfo-format-region} and @code{texinfo-format-buffer}
1547942660Smarkmcommands provide you with some error checking, and other functions can
1548042660Smarkmprovide you with further help in finding formatting errors.  These
1548142660Smarkmprocedures are described in an appendix; see @ref{Catching Mistakes}.
1548242660SmarkmHowever, the @code{makeinfo} program is often faster and
1548342660Smarkmprovides better error checking (@pxref{makeinfo in Emacs}).@refill
1548442660Smarkm
1548556160Sru@node Batch Formatting
1548642660Smarkm@comment  node-name,  next,  previous,  up
1548756160Sru@subsection Batch Formatting
1548842660Smarkm@cindex Batch formatting for Info
1548942660Smarkm@cindex Info batch formatting
1549042660Smarkm
1549142660SmarkmYou can format Texinfo files for Info using @code{batch-texinfo-format}
1549242660Smarkmand Emacs Batch mode.  You can run Emacs in Batch mode from any shell,
15493146515Sruincluding a shell inside of Emacs.  (@xref{Command Arguments,,,
15494146515Sruemacs, The GNU Emacs Manual}.)
1549542660Smarkm
1549642660SmarkmHere is a shell command to format all the files that end in
1549742660Smarkm@file{.texinfo} in the current directory:
1549842660Smarkm
1549942660Smarkm@example
1550042660Smarkmemacs -batch -funcall batch-texinfo-format *.texinfo
1550142660Smarkm@end example
1550242660Smarkm
1550342660Smarkm@noindent
1550442660SmarkmEmacs processes all the files listed on the command line, even if an
1550542660Smarkmerror occurs while attempting to format some of them.@refill
1550642660Smarkm
1550742660SmarkmRun @code{batch-texinfo-format} only with Emacs in Batch mode as shown;
1550842660Smarkmit is not interactive.  It kills the Batch mode Emacs on completion.@refill
1550942660Smarkm
1551042660Smarkm@code{batch-texinfo-format} is convenient if you lack @code{makeinfo}
1551142660Smarkmand want to format several Texinfo files at once.  When you use Batch
1551242660Smarkmmode, you create a new Emacs process.  This frees your current Emacs, so
1551342660Smarkmyou can continue working in it.  (When you run
1551442660Smarkm@code{texinfo-format-region} or @code{texinfo-format-buffer}, you cannot
1551542660Smarkmuse that Emacs for anything else until the command finishes.)@refill
1551642660Smarkm
1551756160Sru@node Tag and Split Files
1551842660Smarkm@comment  node-name,  next,  previous,  up
1551956160Sru@subsection Tag Files and Split Files
1552042660Smarkm@cindex Making a tag table automatically
1552142660Smarkm@cindex Tag table, making automatically
1552242660Smarkm
1552342660SmarkmIf a Texinfo file has more than 30,000 bytes,
1552442660Smarkm@code{texinfo-format-buffer} automatically creates a tag table
1552542660Smarkmfor its Info file;  @code{makeinfo} always creates a tag table.  With
1552642660Smarkma @dfn{tag table}, Info can jump to new nodes more quickly than it can
1552742660Smarkmotherwise.@refill
1552842660Smarkm
1552942660Smarkm@cindex Indirect subfiles
15530116525SruIn addition, if the Texinfo file contains more than about 300,000
1553142660Smarkmbytes, @code{texinfo-format-buffer} and @code{makeinfo} split the
15532116525Srularge Info file into shorter @dfn{indirect} subfiles of about 300,000
1553342660Smarkmbytes each.  Big files are split into smaller files so that Emacs does
1553442660Smarkmnot need to make a large buffer to hold the whole of a large Info
1553556160Srufile; instead, Emacs allocates just enough memory for the small, split-off
1553656160Srufile that is needed at the time.  This way, Emacs avoids wasting
1553742660Smarkmmemory when you run Info.  (Before splitting was implemented, Info
1553842660Smarkmfiles were always kept short and @dfn{include files} were designed as
1553942660Smarkma way to create a single, large printed manual out of the smaller Info
1554042660Smarkmfiles.  @xref{Include Files}, for more information.  Include files are
1554142660Smarkmstill used for very large documents, such as @cite{The Emacs Lisp
1554242660SmarkmReference Manual}, in which each chapter is a separate file.)@refill
1554342660Smarkm
1554442660SmarkmWhen a file is split, Info itself makes use of a shortened version of
1554542660Smarkmthe original file that contains just the tag table and references to
1554656160Sruthe files that were split off.  The split-off files are called
1554742660Smarkm@dfn{indirect} files.@refill
1554842660Smarkm
1554956160SruThe split-off files have names that are created by appending @w{@samp{-1}},
1555042660Smarkm@w{@samp{-2}}, @w{@samp{-3}} and so on to the file name specified by the
1555142660Smarkm@code{@@setfilename} command.  The shortened version of the original file
1555242660Smarkmcontinues to have the name specified by @code{@@setfilename}.@refill
1555342660Smarkm
1555442660SmarkmAt one stage in writing this document, for example, the Info file was saved
1555556160Sruas the file @file{test-texinfo} and that file looked like this:@refill
1555642660Smarkm
1555742660Smarkm@example
1555842660Smarkm@group
1555942660SmarkmInfo file: test-texinfo,    -*-Text-*-
1556042660Smarkmproduced by texinfo-format-buffer
1556142660Smarkmfrom file: new-texinfo-manual.texinfo
1556242660Smarkm
1556342660Smarkm^_
1556442660SmarkmIndirect:
1556542660Smarkmtest-texinfo-1: 102
1556642660Smarkmtest-texinfo-2: 50422
1556742660Smarkm@end group
1556842660Smarkm@group
1556942660Smarkmtest-texinfo-3: 101300
1557042660Smarkm^_^L
1557142660SmarkmTag table:
1557242660Smarkm(Indirect)
1557342660SmarkmNode: overview^?104
1557442660SmarkmNode: info file^?1271
1557542660Smarkm@end group
1557642660Smarkm@group
1557742660SmarkmNode: printed manual^?4853
1557842660SmarkmNode: conventions^?6855
1557942660Smarkm@dots{}
1558042660Smarkm@end group
1558142660Smarkm@end example
1558242660Smarkm
1558342660Smarkm@noindent
1558442660Smarkm(But @file{test-texinfo} had far more nodes than are shown here.)  Each of
1558556160Sruthe split-off, indirect files, @file{test-texinfo-1},
1558642660Smarkm@file{test-texinfo-2}, and @file{test-texinfo-3}, is listed in this file
1558742660Smarkmafter the line that says @samp{Indirect:}.  The tag table is listed after
1558842660Smarkmthe line that says @samp{Tag table:}. @refill
1558942660Smarkm
1559042660SmarkmIn the list of indirect files, the number following the file name
1559142660Smarkmrecords the cumulative number of bytes in the preceding indirect files,
1559242660Smarkmnot counting the file list itself, the tag table, or the permissions
1559342660Smarkmtext in each file.  In the tag table, the number following the node name
1559442660Smarkmrecords the location of the beginning of the node, in bytes from the
1559556160Srubeginning of the (unsplit) output.
1559642660Smarkm
1559742660SmarkmIf you are using @code{texinfo-format-buffer} to create Info files,
1559842660Smarkmyou may want to run the @code{Info-validate} command.  (The
1559942660Smarkm@code{makeinfo} command does such a good job on its own, you do not
1560042660Smarkmneed @code{Info-validate}.)  However, you cannot run the @kbd{M-x
1560142660SmarkmInfo-validate} node-checking command on indirect files.  For
1560242660Smarkminformation on how to prevent files from being split and how to
15603146515Sruvalidate the structure of the nodes, see @ref{Using Info-validate}.
1560442660Smarkm
1560542660Smarkm
1560693139Sru@node Installing an Info File
1560756160Sru@section Installing an Info File
1560842660Smarkm@cindex Installing an Info file
1560942660Smarkm@cindex Info file installation
1561042660Smarkm@cindex @file{dir} directory for Info installation
1561142660Smarkm
1561242660SmarkmInfo files are usually kept in the @file{info} directory.  You can read
1561342660SmarkmInfo files using the standalone Info program or the Info reader built
1561442660Smarkminto Emacs.  (@inforef{Top, info, info}, for an introduction to Info.)
1561542660Smarkm
1561642660Smarkm@menu
1561756160Sru* Directory File::              The top level menu for all Info files.
15618100513Sru* New Info File::               Listing a new Info file.
1561942660Smarkm* Other Info Directories::      How to specify Info files that are
15620114472Sru                                 located in other directories.
1562142660Smarkm* Installing Dir Entries::      How to specify what menu entry to add
15622114472Sru                                 to the Info directory.
1562342660Smarkm* Invoking install-info::       @code{install-info} options.
1562442660Smarkm@end menu
1562542660Smarkm
1562642660Smarkm
1562756160Sru@node Directory File
1562856160Sru@subsection The Directory File @file{dir}
1562956160Sru
1563042660SmarkmFor Info to work, the @file{info} directory must contain a file that
1563142660Smarkmserves as a top level directory for the Info system.  By convention,
1563242660Smarkmthis file is called @file{dir}.  (You can find the location of this file
1563342660Smarkmwithin Emacs by typing @kbd{C-h i} to enter Info and then typing
1563442660Smarkm@kbd{C-x C-f} to see the pathname to the @file{info} directory.)
1563542660Smarkm
1563642660SmarkmThe @file{dir} file is itself an Info file.  It contains the top level
1563742660Smarkmmenu for all the Info files in the system.  The menu looks like
1563842660Smarkmthis:@refill
1563942660Smarkm
1564042660Smarkm@example
1564142660Smarkm@group
1564242660Smarkm* Menu:
1564342660Smarkm* Info:    (info).     Documentation browsing system.
1564442660Smarkm* Emacs:   (emacs).    The extensible, self-documenting
15645114472Sru                      text editor.
1564642660Smarkm* Texinfo: (texinfo).  With one source file, make
15647114472Sru                      either a printed manual using
15648114472Sru                      @@TeX@{@} or an Info file.
1564942660Smarkm@dots{}
1565042660Smarkm@end group
1565142660Smarkm@end example
1565242660Smarkm
1565342660SmarkmEach of these menu entries points to the `Top' node of the Info file
1565442660Smarkmthat is named in parentheses.  (The menu entry does not need to
1565542660Smarkmspecify the `Top' node, since Info goes to the `Top' node if no node
1565642660Smarkmname is mentioned.  @xref{Other Info Files, , Nodes in Other Info
1565742660SmarkmFiles}.)@refill
1565842660Smarkm
1565942660SmarkmThus, the @samp{Info} entry points to the `Top' node of the
1566042660Smarkm@file{info} file and the @samp{Emacs} entry points to the `Top' node
1566142660Smarkmof the @file{emacs} file.@refill
1566242660Smarkm
1566342660SmarkmIn each of the Info files, the `Up' pointer of the `Top' node refers
1566442660Smarkmback to the @code{dir} file.  For example, the line for the `Top'
1566542660Smarkmnode of the Emacs manual looks like this in Info:@refill
1566642660Smarkm
1566742660Smarkm@example
1566842660SmarkmFile: emacs  Node: Top, Up: (DIR), Next: Distrib
1566942660Smarkm@end example
1567042660Smarkm
1567142660Smarkm@noindent
1567256160SruIn this case, the @file{dir} file name is written in upper case
1567356160Sruletters---it can be written in either upper or lower case.  This is not
1567456160Srutrue in general, it is a special case for @file{dir}.
1567542660Smarkm
1567642660Smarkm
1567756160Sru@node New Info File
1567856160Sru@subsection Listing a New Info File
1567993139Sru@cindex Adding a new Info file
1568093139Sru@cindex Listing a new Info file
1568193139Sru@cindex New Info file, listing it in @file{dir} file
1568256160Sru@cindex Info file, listing a new
1568342660Smarkm@cindex @file{dir} file listing
1568442660Smarkm
1568542660SmarkmTo add a new Info file to your system, you must write a menu entry to
1568642660Smarkmadd to the menu in the @file{dir} file in the @file{info} directory.
1568742660SmarkmFor example, if you were adding documentation for GDB, you would write
1568842660Smarkmthe following new entry:@refill
1568942660Smarkm
1569042660Smarkm@example
1569142660Smarkm* GDB: (gdb).           The source-level C debugger.
1569242660Smarkm@end example
1569342660Smarkm
1569442660Smarkm@noindent
1569542660SmarkmThe first part of the menu entry is the menu entry name, followed by a
1569642660Smarkmcolon.  The second part is the name of the Info file, in parentheses,
1569742660Smarkmfollowed by a period.  The third part is the description.
1569842660Smarkm
1569942660SmarkmThe name of an Info file often has a @file{.info} extension.  Thus, the
1570042660SmarkmInfo file for GDB might be called either @file{gdb} or @file{gdb.info}.
1570142660SmarkmThe Info reader programs automatically try the file name both with and
1570256160Sruwithout @file{.info}@footnote{On MS-DOS/MS-Windows systems, Info will
1570356160Srutry the @file{.inf} extension as well.}; so it is better to avoid
1570456160Sruclutter and not to write @samp{.info} explicitly in the menu entry.  For
1570556160Sruexample, the GDB menu entry should use just @samp{gdb} for the file
1570656160Sruname, not @samp{gdb.info}.
1570742660Smarkm
1570842660Smarkm
1570956160Sru@node Other Info Directories
1571056160Sru@subsection Info Files in Other Directories
1571142660Smarkm@cindex Installing Info in another directory
1571242660Smarkm@cindex Info installed in another directory
1571342660Smarkm@cindex Another Info directory
1571456160Sru@cindex @file{dir} files and Info directories
1571542660Smarkm
1571642660SmarkmIf an Info file is not in the @file{info} directory, there are three
1571742660Smarkmways to specify its location:@refill
1571842660Smarkm
1571956160Sru@enumerate
1572042660Smarkm@item
1572156160SruWrite the pathname in the @file{dir} file as the second part of the menu.
1572242660Smarkm
1572342660Smarkm@item
1572442660SmarkmIf you are using Emacs, list the name of the file in a second @file{dir}
1572542660Smarkmfile, in its directory; and then add the name of that directory to the
1572642660Smarkm@code{Info-directory-list} variable in your personal or site
1572742660Smarkminitialization file.
1572842660Smarkm
1572956160SruThis variable tells Emacs where to look for @file{dir} files (the files
1573056160Srumust be named @file{dir}).  Emacs merges the files named @file{dir} from
1573156160Srueach of the listed directories.  (In Emacs version 18, you can set the
1573256160Sru@code{Info-directory} variable to the name of only one
1573356160Srudirectory.)@refill
1573442660Smarkm
1573542660Smarkm@item
1573642660SmarkmSpecify the Info directory name in the @code{INFOPATH} environment
1573742660Smarkmvariable in your @file{.profile} or @file{.cshrc} initialization file.
1573842660Smarkm(Only you and others who set this environment variable will be able to
1573956160Srufind Info files whose location is specified this way.)
1574056160Sru@end enumerate
1574142660Smarkm
1574256160SruFor example, to reach a test file in the @file{/home/bob/info}
1574342660Smarkmdirectory, you could add an entry like this to the menu in the
1574456160Srustandard @file{dir} file:@refill
1574542660Smarkm
1574642660Smarkm@example
1574756160Sru* Test: (/home/bob/info/info-test).  Bob's own test file.
1574842660Smarkm@end example
1574942660Smarkm
1575042660Smarkm@noindent
1575142660SmarkmIn this case, the absolute file name of the @file{info-test} file is
1575242660Smarkmwritten as the second part of the menu entry.@refill
1575342660Smarkm
1575493139SruAlternatively, you could write the following in your @file{.emacs} file:
1575542660Smarkm
1575656160Sru@vindex Info-directory-list
1575742660Smarkm@example
1575842660Smarkm@group
1575956160Sru(require 'info)
1576042660Smarkm(setq Info-directory-list
15761114472Sru (cons (expand-file-name "/home/bob/info")
15762114472Sru       Info-directory-list))
1576342660Smarkm@end group
1576442660Smarkm@end example
1576542660Smarkm
1576693139SruThis tells Emacs to merge the system @file{dir} file with the @file{dir}
1576793139Srufile in @file{/home/bob/info}.  Thus, Info will list the
1576893139Sru@file{/home/bob/info/info-test} file as a menu entry in the
1576993139Sru@file{/home/bob/info/dir} file.  Emacs does the merging only when
1577093139Sru@kbd{M-x info} is first run, so if you want to set
1577156160Sru@code{Info-directory-list} in an Emacs session where you've already run
1577256160Sru@code{info}, you must @code{(setq Info-dir-contents nil)} to force Emacs
1577356160Sruto recompose the @file{dir} file.
1577442660Smarkm
1577542660Smarkm@vindex INFOPATH
15776146515Sru@cindex Environment variable @code{INFOPATH}
1577742660SmarkmFinally, you can tell Info where to look by setting the @code{INFOPATH}
1577856160Sruenvironment variable in your shell startup file, such as @file{.cshrc},
1577956160Sru@file{.profile} or @file{autoexec.bat}.  If you use a Bourne-compatible
1578056160Srushell such as @code{sh} or @code{bash} for your shell command
1578156160Sruinterpreter, you set the @code{INFOPATH} environment variable in the
1578256160Sru@file{.profile} initialization file; but if you use @code{csh} or
1578356160Sru@code{tcsh}, you set the variable in the @file{.cshrc} initialization
1578456160Srufile.  On MS-DOS/MS-Windows systems, you must set @code{INFOPATH} in
1578556160Sruyour @file{autoexec.bat} file or in the Registry.  Each type of shell
1578656160Sruuses a different syntax.
1578742660Smarkm
1578842660Smarkm@itemize @bullet
1578942660Smarkm@item
1579042660SmarkmIn a @file{.cshrc} file, you could set the @code{INFOPATH}
1579142660Smarkmvariable as follows:@refill
1579242660Smarkm
1579342660Smarkm@smallexample
1579456160Srusetenv INFOPATH .:~/info:/usr/local/emacs/info
1579542660Smarkm@end smallexample
1579642660Smarkm
1579742660Smarkm@item
1579842660SmarkmIn a @file{.profile} file, you would achieve the same effect by
1579942660Smarkmwriting:@refill
1580042660Smarkm
1580142660Smarkm@smallexample
1580256160SruINFOPATH=.:$HOME/info:/usr/local/emacs/info
1580342660Smarkmexport INFOPATH
1580442660Smarkm@end smallexample
1580556160Sru
1580656160Sru@item
1580756160Sru@pindex autoexec.bat
1580856160SruIn a @file{autoexec.bat} file, you write this command@footnote{Note the
1580956160Sruuse of @samp{;} as the directory separator, and a different syntax for
1581056160Sruusing values of other environment variables.}:
1581156160Sru
1581256160Sru@smallexample
1581356160Sruset INFOPATH=.;%HOME%/info;c:/usr/local/emacs/info
1581456160Sru@end smallexample
1581542660Smarkm@end itemize
1581642660Smarkm
1581742660Smarkm@noindent
1581842660SmarkmThe @samp{.} indicates the current directory as usual.  Emacs uses the
1581942660Smarkm@code{INFOPATH} environment variable to initialize the value of Emacs's
1582056160Sruown @code{Info-directory-list} variable.  The stand-alone Info reader
1582156160Srumerges any files named @file{dir} in any directory listed in the
1582256160Sru@env{INFOPATH} variable into a single menu presented to you in the node
1582356160Srucalled @samp{(dir)Top}.
1582442660Smarkm
15825146515Sru@cindex Colon, last in @env{INFOPATH}
1582656160SruHowever you set @env{INFOPATH}, if its last character is a
1582756160Srucolon@footnote{On MS-DOS/MS-Windows systems, use semi-colon instead.}, this
1582842660Smarkmis replaced by the default (compiled-in) path.  This gives you a way to
1582942660Smarkmaugment the default path with new directories without having to list all
1583056160Sruthe standard places.  For example (using @code{sh} syntax):
1583142660Smarkm
1583242660Smarkm@example
1583342660SmarkmINFOPATH=/local/info:
1583442660Smarkmexport INFOPATH
1583542660Smarkm@end example
1583642660Smarkm
1583742660Smarkm@noindent
1583842660Smarkmwill search @file{/local/info} first, then the standard directories.
1583942660SmarkmLeading or doubled colons are not treated specially.
1584042660Smarkm
1584156160Sru@cindex @file{dir} file, creating your own
1584256160SruWhen you create your own @file{dir} file for use with
1584356160Sru@code{Info-directory-list} or @env{INFOPATH}, it's easiest to start by
1584456160Srucopying an existing @file{dir} file and replace all the text after the
1584556160Sru@samp{* Menu:} with your desired entries.  That way, the punctuation and
1584656160Sruspecial CTRL-_ characters that Info needs will be present.
1584742660Smarkm
1584856160Sru
1584993139Sru@node Installing Dir Entries
1585056160Sru@subsection Installing Info Directory Files
1585142660Smarkm
1585242660SmarkmWhen you install an Info file onto your system, you can use the program
1585342660Smarkm@code{install-info} to update the Info directory file @file{dir}.
1585442660SmarkmNormally the makefile for the package runs @code{install-info}, just
1585542660Smarkmafter copying the Info file into its proper installed location.
1585642660Smarkm
1585742660Smarkm@findex dircategory
1585842660Smarkm@findex direntry
15859100513SruIn order for the Info file to work with @code{install-info}, you include
15860100513Sruthe commands @code{@@dircategory} and
1586156160Sru@code{@@direntry}@dots{}@code{@@end direntry} in the Texinfo source
1586256160Srufile.  Use @code{@@direntry} to specify the menu entries to add to the
1586356160SruInfo directory file, and use @code{@@dircategory} to specify which part
1586456160Sruof the Info directory to put it in.  Here is how these commands are used
1586556160Sruin this manual:
1586642660Smarkm
1586742660Smarkm@smallexample
1586842660Smarkm@@dircategory Texinfo documentation system
1586942660Smarkm@@direntry
1587042660Smarkm* Texinfo: (texinfo).           The GNU documentation format.
1587142660Smarkm* install-info: (texinfo)Invoking install-info. @dots{}
1587242660Smarkm@dots{}
1587342660Smarkm@@end direntry
1587442660Smarkm@end smallexample
1587542660Smarkm
1587642660SmarkmHere's what this produces in the Info file:
1587742660Smarkm
1587842660Smarkm@smallexample
1587942660SmarkmINFO-DIR-SECTION Texinfo documentation system
1588042660SmarkmSTART-INFO-DIR-ENTRY
1588142660Smarkm* Texinfo: (texinfo).           The GNU documentation format.
1588242660Smarkm* install-info: (texinfo)Invoking install-info. @dots{}
1588342660Smarkm@dots{}
1588442660SmarkmEND-INFO-DIR-ENTRY
1588542660Smarkm@end smallexample
1588642660Smarkm
1588742660Smarkm@noindent
1588842660SmarkmThe @code{install-info} program sees these lines in the Info file, and
1588942660Smarkmthat is how it knows what to do.
1589042660Smarkm
1589142660SmarkmAlways use the @code{@@direntry} and @code{@@dircategory} commands near
1589242660Smarkmthe beginning of the Texinfo input, before the first @code{@@node}
1589342660Smarkmcommand.  If you use them later on in the input, @code{install-info}
1589442660Smarkmwill not notice them.
1589542660Smarkm
1589642660SmarkmIf you use @code{@@dircategory} more than once in the Texinfo source,
1589756160Srueach usage specifies the `current' category; any subsequent
15898116525Sru@code{@@direntry} commands will add to that category.
1589942660Smarkm
15900114472Sru@cindex Free Software Directory
15901114472Sru@cindex Dir categories, choosing
15902114472Sru@cindex Categories, choosing
15903146515SruWhen choosing a category name for the @code{@@dircategory} command, we
15904146515Srurecommend consulting the @uref{http://www.gnu.org/directory,
15905146515SruFree Software Directory}.  If your program is not listed there,
15906146515Sruor listed incorrectly or incompletely, please report the situation to
15907146515Sruthe directory maintainers (@email{bug-directory@@gnu.org}) so that the
15908114472Srucategory names can be kept in sync.
1590942660Smarkm
15910116525SruHere are a few examples (see the @file{util/dir-example} file in the
15911116525SruTexinfo distribution for large sample @code{dir} file):
15912116525Sru
1591393139Sru@display
15914114472SruEmacs
15915114472SruLocalization
15916114472SruPrinting
15917116525SruSoftware development
15918116525SruSoftware libraries
15919116525SruText creation and manipulation
1592093139Sru@end display
1592142660Smarkm
15922114472Sru@cindex Invoking nodes, including in dir file
15923114472SruEach `Invoking' node for every program installed should have a
15924114472Srucorresponding @code{@@direntry}.  This lets users easily find the
15925114472Srudocumentation for the different programs they can run, as with the
15926114472Srutraditional @command{man} system.
1592793139Sru
1592893139Sru
1592956160Sru@node Invoking install-info
15930114472Sru@subsection Invoking @command{install-info}
1593142660Smarkm@pindex install-info
1593242660Smarkm
1593342660Smarkm@code{install-info} inserts menu entries from an Info file into the
1593442660Smarkmtop-level @file{dir} file in the Info system (see the previous sections
1593542660Smarkmfor an explanation of how the @file{dir} file works).  It's most often
1593656160Srurun as part of software installation, or when constructing a @file{dir} file
1593742660Smarkmfor all manuals on a system.  Synopsis:
1593842660Smarkm
1593942660Smarkm@example
1594042660Smarkminstall-info [@var{option}]@dots{} [@var{info-file} [@var{dir-file}]]
1594142660Smarkm@end example
1594242660Smarkm
1594356160SruIf @var{info-file} or @var{dir-file} are not specified, the options
1594456160Sru(described below) that define them must be.  There are no compile-time
1594556160Srudefaults, and standard input is never used.  @code{install-info} can
1594656160Sruread only one Info file and write only one @file{dir} file per invocation.
1594742660Smarkm
1594842660Smarkm@cindex @file{dir}, created by @code{install-info}
1594942660SmarkmIf @var{dir-file} (however specified) does not exist,
1595042660Smarkm@code{install-info} creates it if possible (with no entries).
1595142660Smarkm
1595256160Sru@cindex Compressed files, reading
1595356160Sru@cindex Dir files, compressed
1595456160SruIf any input file is compressed with @code{gzip} (@pxref{Invoking
1595556160Srugzip,,,gzip, Gzip}), @code{install-info} automatically uncompresses it
1595656160Srufor reading.  And if @var{dir-file} is compressed, @code{install-info}
1595756160Srualso automatically leaves it compressed after writing any changes.
1595856160SruIf @var{dir-file} itself does not exist, @code{install-info} tries to
1595956160Sruopen @file{@var{dir-file}.gz}.
1596056160Sru
1596142660SmarkmOptions:
1596242660Smarkm
1596342660Smarkm@table @code
1596442660Smarkm@item --delete
1596542660Smarkm@opindex --delete
1596642660SmarkmDelete the entries in @var{info-file} from @var{dir-file}.  The file
1596742660Smarkmname in the entry in @var{dir-file} must be @var{info-file} (except for
1596842660Smarkman optional @samp{.info} in either one).  Don't insert any new entries.
1596942660Smarkm
1597042660Smarkm@item --dir-file=@var{name}
1597156160Sru@itemx -d @var{name}
1597242660Smarkm@opindex --dir-file=@var{name}
1597356160Sru@opindex -d @var{name}
1597442660SmarkmSpecify file name of the Info directory file.  This is equivalent to
1597542660Smarkmusing the @var{dir-file} argument.
1597642660Smarkm
1597742660Smarkm@item --entry=@var{text}
1597856160Sru@itemx -e @var{text}
1597942660Smarkm@opindex --entry=@var{text}
1598056160Sru@opindex -e @var{text}
1598142660SmarkmInsert @var{text} as an Info directory entry; @var{text} should have the
1598242660Smarkmform of an Info menu item line plus zero or more extra lines starting
1598342660Smarkmwith whitespace.  If you specify more than one entry, they are all
1598442660Smarkmadded.  If you don't specify any entries, they are determined from
1598542660Smarkminformation in the Info file itself.
1598642660Smarkm
1598742660Smarkm@item --help
1598856160Sru@itemx -h
1598942660Smarkm@opindex --help
1599056160Sru@opindex -h
1599142660SmarkmDisplay a usage message listing basic usage and all available options,
1599242660Smarkmthen exit successfully.
1599342660Smarkm
1599442660Smarkm@item --info-file=@var{file}
1599556160Sru@itemx -i @var{file}
1599642660Smarkm@opindex --info-file=@var{file}
1599756160Sru@opindex -i @var{file}
1599842660SmarkmSpecify Info file to install in the directory.
1599956160SruEquivalent to using the @var{info-file} argument.
1600042660Smarkm
1600142660Smarkm@item --info-dir=@var{dir}
1600256160Sru@itemx -D @var{dir}
1600342660Smarkm@opindex --info-dir=@var{dir}
1600456160Sru@opindex -D @var{dir}
16005146515SruSpecify the directory where the directory file @file{dir} resides.
1600642660SmarkmEquivalent to @samp{--dir-file=@var{dir}/dir}.
1600742660Smarkm
1600842660Smarkm@item --item=@var{text}
1600942660Smarkm@opindex --item=@var{text}
1601042660SmarkmSame as @samp{--entry=@var{text}}.  An Info directory entry is actually
1601142660Smarkma menu item.
1601242660Smarkm
1601342660Smarkm@item --quiet
1601442660Smarkm@opindex --quiet
1601542660SmarkmSuppress warnings.
1601642660Smarkm
1601742660Smarkm@item --remove
1601856160Sru@itemx -r
1601942660Smarkm@opindex --remove
1602056160Sru@opindex -r
1602142660SmarkmSame as @samp{--delete}.
1602242660Smarkm
1602342660Smarkm@item --section=@var{sec}
1602456160Sru@itemx -s @var{sec}
1602542660Smarkm@opindex --section=@var{sec}
1602656160Sru@opindex -s @var{sec}
1602742660SmarkmPut this file's entries in section @var{sec} of the directory.  If you
1602842660Smarkmspecify more than one section, all the entries are added in each of the
1602942660Smarkmsections.  If you don't specify any sections, they are determined from
1603042660Smarkminformation in the Info file itself.
1603142660Smarkm
1603242660Smarkm@item --version
1603356160Sru@itemx -V
1603442660Smarkm@opindex --version
1603556160Sru@opindex -V
16036146515Sru@cindex Version number, for install-info
1603742660SmarkmDisplay version information and exit successfully.
1603842660Smarkm
1603942660Smarkm@end table
1604042660Smarkm
1604142660Smarkm
16042146515Sru@node Generating HTML
16043146515Sru@chapter Generating HTML
16044146515Sru@cindex HTML output
16045146515Sru
16046146515Sru@command{makeinfo} generates Info output by default, but given the
16047146515Sru@option{--html} option, it will generate HTML, for web browsers and
16048146515Sruother programs.  This chapter gives some details on such HTML output.
16049146515Sru
16050146515Sru
16051146515Sru@command{makeinfo} can also write in XML and Docbook format, but we do
16052146515Srunot as yet describe these further.  @xref{Output Formats}, for a brief
16053146515Sruoverview of all the output formats.
16054146515Sru
16055146515Sru@menu
16056146515Sru* HTML Translation::       Details of the HTML output.
16057146515Sru* HTML Splitting::         How HTML output is split.
16058146515Sru* HTML CSS::               Influencing HTML output with Cascading Style Sheets.
16059146515Sru* HTML Xref::              Cross-references in HTML output.
16060146515Sru@end menu
16061146515Sru
16062146515Sru
16063146515Sru@node HTML Translation
16064146515Sru@section HTML Translation
16065146515Sru
16066146515Sru@command{makeinfo} will include segments of Texinfo source between
16067146515Sru@code{@@ifhtml} and @code{@@end ifhtml} in the HTML output (but not
16068146515Sruany of the other conditionals, by default).  Source between
16069146515Sru@code{@@html} and @code{@@end html} is passed without change to the
16070146515Sruoutput (i.e., suppressing the normal escaping of input @samp{<},
16071146515Sru@samp{>} and @samp{&} characters which have special significance in
16072146515SruHTML).  @xref{Conditional Commands}.
16073146515Sru
16074146515Sru@opindex --footnote-style@r{, ignored in HTML output}
16075146515SruThe @option{--footnote-style} option is currently ignored for HTML output;
16076146515Srufootnotes are always linked to the end of the output file.
16077146515Sru
16078146515Sru@cindex Navigation bar, in HTML output
16079146515SruBy default, a navigation bar is inserted at the start of each node,
16080146515Sruanalogous to Info output.  The @samp{--no-headers} option suppresses
16081146515Sruthis if used with @samp{--no-split}.  Header @code{<link>} elements in
16082146515Srusplit output can support info-like navigation with browsers like Lynx
16083146515Sruand @w{Emacs W3} which implement this HTML@tie{}1.0 feature.
16084146515Sru
16085146515Sru@cindex HTML output, browser compatibility of
16086146515SruThe HTML generated is mostly standard (i.e., HTML@tie{}2.0, RFC-1866).
16087146515SruOne exception is that HTML@tie{}3.2 tables are generated from the
16088146515Sru@code{@@multitable} command, but tagged to degrade as well as possible
16089146515Sruin browsers without table support.  The HTML@tie{}4 @samp{lang}
16090146515Sruattribute on the @samp{<html>} attribute is also used.  (Please report
16091146515Sruoutput from an error-free run of @code{makeinfo} which has browser
16092146515Sruportability problems as a bug.)
16093146515Sru
16094146515Sru
16095146515Sru@node HTML Splitting
16096146515Sru@section HTML Splitting
16097146515Sru@cindex Split HTML output
16098146515Sru@cindex HTML output, split
16099146515Sru
16100146515SruWhen splitting output (which is the default), @command{makeinfo}
16101146515Sruwrites HTML output into (generally) one output file per Texinfo source
16102146515Sru@code{@@node}.
16103146515Sru
16104146515SruThe output file name is the node name with special characters replaced
16105146515Sruby @samp{-}'s, so it can work as a filename.  In the unusual case of
16106146515Srutwo different nodes having the same name after this treatment, they
16107146515Sruare written consecutively to the same file, with HTML anchors so each
16108146515Srucan be referred to separately.  If @command{makeinfo} is run on a
16109146515Srusystem which does not distinguish case in filenames, nodes which are
16110146515Sruthe same except for case will also be folded into the same output
16111146515Srufile.
16112146515Sru
16113146515SruWhen splitting, the HTML output files are written into a subdirectory,
16114146515Sruwith the name chosen as follows:
16115146515Sru@enumerate
16116146515Sru@item 
16117146515Sru@command{makeinfo} first tries the subdirectory with the base name
16118146515Srufrom @code{@@setfilename} (that is, any extension is removed).  For
16119146515Sruexample, HTML output for @code{@@setfilename gcc.info} would be
16120146515Sruwritten into a subdirectory named @samp{gcc}.
16121146515Sru
16122146515Sru@item
16123146515SruIf that directory cannot be created for any reason, then
16124146515Sru@command{makeinfo} tries appending @samp{.html} to the directory name.
16125146515SruFor example, output for @code{@@setfilename texinfo} would be written
16126146515Sruto @samp{texinfo.html}.
16127146515Sru
16128146515Sru@item
16129146515SruIf the @samp{@var{name}.html} directory can't be
16130146515Srucreated either, @code{makeinfo} gives up.
16131146515Sru
16132146515Sru@end enumerate
16133146515Sru
16134146515Sru@noindent In any case, the top-level output file within the directory
16135146515Sruis always named @samp{index.html}.
16136146515Sru
16137146515SruMonolithic output (@code{--no-split}) is named according to
16138146515Sru@code{@@setfilename} (with any @samp{.info} extension is replaced with
16139146515Sru@samp{.html}) or @code{--output} (the argument is used literally).
16140146515Sru
16141146515Sru
16142146515Sru@node HTML CSS
16143146515Sru@section HTML CSS
16144146515Sru@cindex HTML, and CSS
16145146515Sru@cindex CSS, and HTML output
16146146515Sru@cindex Cascading Style Sheets, and HTML output
16147146515Sru
16148146515SruCascading Style Sheets (CSS for short) is an Internet standard for
16149146515Sruinfluencing the display of HTML documents: see
16150146515Sru@uref{http://www.w3.org/Style/CSS/}.
16151146515Sru
16152146515SruBy default, @command{makeinfo} includes a few simple CSS commands to
16153146515Srubetter implement the appearance of some of the environments.  Here 
16154146515Sruare two of them, as an example:
16155146515Sru
16156146515Sru@example
16157146515Srupre.display @{ font-family:inherit @}
16158146515Srupre.smalldisplay @{ font-family:inherit; font-size:smaller @}
16159146515Sru@end example
16160146515Sru
16161146515SruA full explanation of CSS is (far) beyond this manual; please see the
16162146515Srureference above.  In brief, however, this specification tells the web
16163146515Srubrowser to use a `smaller' font size for @code{@@smalldisplay} text,
16164146515Sruand to use the `inherited' font (generally a regular roman typeface)
16165146515Srufor both @code{@@smalldisplay} and @code{@@display}.  By default, the
16166146515SruHTML @samp{<pre>} command uses a monospaced font.
16167146515Sru
16168146515SruYou can influence the CSS in the HTML output with the
16169146515Sru@option{--css-include=@var{file}} option to @command{makeinfo}.  This
16170146515Sruincludes the contents @var{file} in the HTML output, as you might
16171146515Sruexpect.  However, the details are somewhat tricky, as described in the
16172146515Srufollowing, to provide maximum flexibility.
16173146515Sru
16174146515Sru@cindex @@import specifications, in CSS files
16175146515SruThe CSS file may begin with so-called @samp{@@import} directives,
16176146515Sruwhich link to external CSS specifications for browsers to use when
16177146515Sruinterpreting the document.  Again, a full description is beyond our
16178146515Sruscope here, but we'll describe how they work syntactically, so we can
16179146515Sruexplain how @command{makeinfo} handles them.
16180146515Sru
16181146515Sru@cindex Comments, in CSS files
16182146515SruThere can be more than one @samp{@@import}, but they have to come
16183146515Srufirst in the file, with only whitespace and comments interspersed, no
16184146515Srunormal definitions.  (Technical exception: an @samp{@@charset}
16185146515Srudirective may precede the @samp{@@import}'s.  This does not alter
16186146515Sru@command{makeinfo}'s behavior, it just copies the @samp{@@charset} if
16187146515Srupresent.)  Comments in CSS files are delimited by @samp{/* ... */}, as
16188146515Sruin C.  An @samp{@@import} directive must be in one of these two forms:
16189146515Sru
16190146515Sru@example
16191146515Sru@@import url(http://example.org/foo.css);
16192146515Sru@@import "http://example.net/bar.css";
16193146515Sru@end example
16194146515Sru
16195146515SruAs far as @command{makeinfo} is concerned, the crucial characters are
16196146515Sruthe @samp{@@} at the beginning and the semicolon terminating the
16197146515Srudirective.  When reading the CSS file, it simply copies any such
16198146515Sru@samp{@@}-directive into the output, as follows:
16199146515Sru
16200146515Sru@itemize
16201146515Sru@item If @var{file} contains only normal CSS declarations, it is
16202146515Sruincluded after @command{makeinfo}'s default CSS, thus overriding it.
16203146515Sru
16204146515Sru@item If @var{file} begins with @samp{@@import} specifications (see
16205146515Srubelow), then the @samp{import}'s are included first (they have to come
16206146515Srufirst, according to the standard), and then @command{makeinfo}'s
16207146515Srudefault CSS is included.  If you need to override @command{makeinfo}'s
16208146515Srudefaults from an @samp{@@import}, you can do so with the @samp{!@:
16209146515Sruimportant} CSS construct, as in:
16210146515Sru@example
16211146515Srupre.smallexample @{ font-size: inherit ! important @}
16212146515Sru@end example
16213146515Sru
16214146515Sru@item If @var{file} contains both @samp{@@import} and inline CSS
16215146515Sruspecifications, the @samp{@@import}'s are included first, then
16216146515Sru@command{makeinfo}'s defaults, and lastly the inline CSS from
16217146515Sru@var{file}.
16218146515Sru
16219146515Sru@item Any @@-directive other than @samp{@@import} and @samp{@@charset}
16220146515Sruis treated as a CSS declaration, meaning @command{makeinfo} includes
16221146515Sruits default CSS and then the rest of the file.
16222146515Sru
16223146515Sru@end itemize
16224146515Sru
16225146515SruIf the CSS file is malformed or erroneous, @command{makeinfo}'s output
16226146515Sruis unspecified.  @command{makeinfo} does not try to interpret the
16227146515Srumeaning of the CSS file in any way; it just looks for the special
16228146515Sru@samp{@@} and @samp{;} characters and blindly copies the text into the
16229146515Sruoutput.  Comments in the CSS file may or may not be included in the
16230146515Sruoutput.
16231146515Sru
16232146515Sru
16233146515Sru@node HTML Xref
16234146515Sru@section HTML Cross-references
16235146515Sru@cindex HTML cross-references
16236146515Sru@cindex Cross-references, in HTML output
16237146515Sru
16238146515SruCross-references between Texinfo manuals in HTML format amount, in the
16239146515Sruend, to a standard HTML @code{<a>} link, but the details are
16240146515Sruunfortunately complex.  This section describes the algorithm used in
16241146515Srudetail, so that Texinfo can cooperate with other programs, such as
16242146515Sru@command{texi2html}, by writing mutually compatible HTML files.
16243146515Sru
16244146515SruThis algorithm may or may not be used for links @emph{within} HTML
16245146515Sruoutput for a Texinfo file.  Since no issues of compatibility arise in
16246146515Srusuch cases, we do not need to specify this.
16247146515Sru
16248146515SruWe try to support references to such ``external'' manuals in both
16249146515Srumonolithic and split forms.  A @dfn{monolithic} (mono) manual is
16250146515Sruentirely contained in one file, and a @dfn{split} manual has a file
16251146515Srufor each node.  (@xref{HTML Splitting}.)
16252146515Sru
16253146515Sru@cindex Dumas, Patrice
16254146515SruAcknowledgement: this algorithm was primarily devised by Patrice Dumas
16255146515Sruin 2003--04.
16256146515Sru
16257146515Sru@menu
16258146515Sru* Link Basics:       HTML Xref Link Basics.
16259146515Sru* Node Expansion:    HTML Xref Node Name Expansion.
16260146515Sru* Command Expansion: HTML Xref Command Expansion.
16261146515Sru* 8-bit Expansion:   HTML Xref 8-bit Character Expansion.
16262146515Sru* Mismatch:          HTML Xref Mismatch.
16263146515Sru@end menu
16264146515Sru
16265146515Sru
16266146515Sru@node HTML Xref Link Basics
16267146515Sru@subsection HTML Cross-reference Link Basics
16268146515Sru@cindex HTML cross-reference link basics
16269146515Sru
16270146515SruFor our purposes, an HTML link consists of four components: a host
16271146515Sruname, a directory part, a file part, and a target part.  We
16272146515Srualways assume the @code{http} protocol.  For example:
16273146515Sru
16274146515Sru@example
16275146515Sruhttp://@var{host}/@var{dir}/@var{file}.html#@var{target}
16276146515Sru@end example
16277146515Sru
16278146515SruThe information to construct a link comes from the node name and
16279146515Srumanual name in the cross-reference command in the Texinfo source
16280146515Sru(@pxref{Cross References}), and from @dfn{external information}, which
16281146515Sruis currently simply hardwired.  In the future, it may come from an
16282146515Sruexternal data file.
16283146515Sru
16284146515SruWe now consider each part in turn.
16285146515Sru
16286146515SruThe @var{host} is hardwired to be the local host.  This could either
16287146515Srube the literal string @samp{localhost}, or, according to the rules for
16288146515SruHTML links, the @samp{http://localhost/} could be omitted entirely.
16289146515Sru
16290146515SruThe @var{dir} and @var{file} parts are more complicated, and depend on
16291146515Sruthe relative split/mono nature of both the manual being processed and
16292146515Sruthe manual that the cross-reference refers to.  The underlying idea is
16293146515Sruthat there is one directory for Texinfo manuals in HTML, and each
16294146515Srumanual is either available as a monolithic file @file{manual.html}, or a
16295146515Srusplit subdirectory @file{manual/*.html}.  Here are the cases:
16296146515Sru
16297146515Sru@itemize @bullet
16298146515Sru@item
16299146515SruIf the present manual is split, and the referent manual is also split,
16300146515Sruthe directory is @samp{../@var{referent/}} and the file is the
16301146515Sruexpanded node name (described later).
16302146515Sru
16303146515Sru@item
16304146515SruIf the present manual is split, and the referent manual is mono, the
16305146515Srudirectory is @samp{../} and the file is @file{@var{referent}.html}.
16306146515Sru
16307146515Sru@item
16308146515SruIf the present manual is mono, and the referent manual is split, the
16309146515Srudirectory is @file{@var{referent}/} and the file is the expanded node
16310146515Sruname.
16311146515Sru
16312146515Sru@item
16313146515SruIf the present manual is mono, and the referent manual is also mono,
16314146515Sruthe directory is @file{./} (or just the empty string), and the file is
16315146515Sru@file{@var{referent}.html}.
16316146515Sru
16317146515Sru@end itemize
16318146515Sru
16319146515SruOne exception: the algorithm for node name expansion prefixes the
16320146515Srustring @samp{g_t} when the node name begins with a non-letter.  This
16321146515Srukludge (due to XHTML rules) is not necessary for filenames, and is
16322146515Srutherefore omitted.
16323146515Sru
16324146515SruAny directory part in the filename argument of the source
16325146515Srucross-reference command is ignored.  Thus, @code{@@xref@{,,,../foo@}}
16326146515Sruand @code{@@xref@{,,,foo@}} both use @samp{foo} as the manual name.
16327146515SruThis is because any such attempted hardwiring of the directory is very
16328146515Sruunlikely to be useful for both Info and HTML output.
16329146515Sru
16330146515SruFinally, the @var{target} part is always the expanded node name.
16331146515Sru
16332146515SruWhether the present manual is split or mono is determined by user
16333146515Sruoption; @command{makeinfo} defaults to split, with the
16334146515Sru@option{--no-split} option overriding this.
16335146515Sru
16336146515SruWhether the referent manual is split or mono is another bit of the
16337146515Sruexternal information.  For now, @command{makeinfo} simply assumes the
16338146515Srureferent manual is the same as the present manual.
16339146515Sru
16340146515SruThere can be a mismatch between the format of the referent manual that
16341146515Sruthe generating software assumes, and the format it's actually present
16342146515Sruin.  @xref{HTML Xref Mismatch}.
16343146515Sru
16344146515Sru
16345146515Sru@node HTML Xref Node Name Expansion
16346146515Sru@subsection HTML Cross-reference Node Name Expansion
16347146515Sru@cindex HTML cross-reference node name expansion
16348146515Sru@cindex node name expansion, in HTML cross-references
16349146515Sru@cindex expansion, of node names in HTML cross-references
16350146515Sru
16351146515SruAs mentioned in the previous section, the key part of the HTML
16352146515Srucross-reference algorithm is the conversion of node names in the
16353146515SruTexinfo source into strings suitable for XHTML identifiers and
16354146515Srufilenames.  The restrictions are similar for each: plain ASCII
16355146515Sruletters, numbers, and the @samp{-} and @samp{_} characters are all
16356146515Sruthat can be used.  (Although HTML anchors can contain most characters,
16357146515SruXHTML is more restrictive.)
16358146515Sru
16359146515SruCross-references in Texinfo can actually refer either to nodes or
16360146515Sruanchors (@pxref{anchor}), but anchors are treated identically to nodes
16361146515Sruin this context, so we'll continue to say ``node'' names for
16362146515Srusimplicity.
16363146515Sru
16364146515Sru(@@-commands and 8-bit characters are not presently handled by
16365146515Sru@command{makeinfo} for HTML cross-references.  See the next section.)
16366146515Sru
16367146515SruA special exception: the Top node (@pxref{The Top Node}) is always
16368146515Srumapped to the file @file{index.html}, to match web server software.
16369146515SruHowever, the HTML @emph{target} is @samp{Top}.  Thus (in the split case):
16370146515Sru
16371146515Sru@example
16372146515Sru@@xref@{Top, Introduction,, emacs, The GNU Emacs Manual@}.
16373146515Sru@result{} <a href="emacs/index.html#Top">
16374146515Sru@end example
16375146515Sru
16376146515Sru@enumerate
16377146515Sru@item
16378146515SruThe standard ASCII letters (a-z and A-Z) are not modified.  All other
16379146515Srucharacters are changed as specified below.
16380146515Sru
16381146515Sru@item
16382146515SruThe standard ASCII numbers (0-9) are not modified except when a number
16383146515Sruis the first character of the node name.  In that case, see below.
16384146515Sru
16385146515Sru@item
16386146515SruMultiple consecutive space, tab and newline characters are transformed
16387146515Sruinto just one space.  (It's not possible to have newlines in node
16388146515Srunames with the current implementation, but we specify it anyway, just
16389146515Sruin case.)
16390146515Sru
16391146515Sru@item
16392146515SruLeading and trailing spaces are removed.
16393146515Sru
16394146515Sru@item
16395146515SruAfter the above has been applied, each remaining space character is
16396146515Sruconverted into a @samp{-} character.
16397146515Sru
16398146515Sru@item
16399146515SruOther ASCII 7-bit characters are transformed into @samp{_00@var{xx}},
16400146515Sruwhere @var{xx} is the ASCII character code in (lowercase) hexadecimal.
16401146515SruThis includes @samp{_}, which is mapped to @samp{_005f}.
16402146515Sru
16403146515Sru@item
16404146515SruIf the node name does not begin with a letter, the literal string
16405146515Sru@samp{g_t} is prefixed to the result.  (Due to the rules above, that
16406146515Srustring can never occur otherwise; it is an arbitrary choice, standing
16407146515Srufor ``GNU Texinfo''.)  This is necessary because XHTML requires that
16408146515Sruidentifiers begin with a letter.
16409146515Sru
16410146515Sru@end enumerate
16411146515Sru
16412146515SruFor example:
16413146515Sru
16414146515Sru@example
16415146515Sru@@node A  node --- with _'%
16416146515Sru@result{} A-node-_002d_002d_002d-with-_005f_0027_0025
16417146515Sru@end example
16418146515Sru
16419146515SruNotice in particular:
16420146515Sru
16421146515Sru@itemize @bullet
16422146515Sru@item @samp{_} @result{} @samp{_005f}
16423146515Sru@item @samp{-} @result{} @samp{_002d}
16424146515Sru@item @samp{A  node} @result{} @samp{A-node}
16425146515Sru@end itemize
16426146515Sru
16427146515SruOn case-folding computer systems, nodes differing only by case will be
16428146515Srumapped to the same file.  
16429146515Sru
16430146515SruIn particular, as mentioned above, Top always maps to the file
16431146515Sru@file{index.html}.  Thus, on a case-folding system, Top and a node
16432146515Srunamed `Index' will both be written to @file{index.html}.
16433146515Sru
16434146515SruFortunately, the targets serve to distinguish these cases, since HTML
16435146515Srutarget names are always case-sensitive, independent of operating
16436146515Srusystem.
16437146515Sru
16438146515Sru
16439146515Sru@node HTML Xref Command Expansion
16440146515Sru@subsection HTML Cross-reference Command Expansion
16441146515Sru@cindex HTML cross-reference command expansion
16442146515Sru
16443146515SruIn standard Texinfo, node names may not contain @@-commands.
16444146515Sru@command{makeinfo} has an option @option{--commands-in-node-names}
16445146515Sruwhich partially supports it (@pxref{Invoking makeinfo}), but it is not
16446146515Srurobust and not recommended.
16447146515Sru
16448146515SruThus, @command{makeinfo} also does not fully implement this part of
16449146515Sruthe HTML cross-reference algorithm, but it is documented here for the
16450146515Srusake of completeness.
16451146515Sru
16452146515SruFirst, comments are removed.
16453146515Sru
16454146515SruNext, any @code{@@value} commands (@pxref{set value}) and macro invocations
16455146515Sru(@pxref{Invoking Macros}) are fully expanded.
16456146515Sru
16457146515SruThen, for the following commands, the command name and braces are removed,
16458146515Sruthe text of the argument is recursively transformed:
16459146515Sru@example
16460146515Sru@@asis @@b @@cite @@code @@command @@dfn @@dmn @@dotless
16461146515Sru@@emph @@env @@file @@indicateurl @@kbd @@key
16462146515Sru@@samp @@sc @@slanted @@strong @@t @@var @@w
16463146515Sru@end example
16464146515Sru
16465146515Sru@noindent For @code{@@sc}, any letters are capitalized.
16466146515Sru
16467146515SruThe following commands are replaced by constant text, as shown.  If
16468146515Sruany of these commands have non-empty arguments, as in
16469146515Sru@code{@@TeX@{bad@}}, it is an error, and the result is unspecified.
16470146515Sru`(space)' means a space character, `(nothing)' means the empty string,
16471146515Sruetc.  The notation `U+@var{xxxx}' means Unicode code point @var{xxxx}.
16472146515SruThere are further transformations of many of these expansions for the
16473146515Srufinal file or target name, such as space characters to @samp{-}, etc.,
16474146515Sruaccording to the other rules.
16475146515Sru
16476146515Sru@multitable @columnfractions .3 .5
16477146515Sru@item @code{@@(newline)}        @tab (space)
16478146515Sru@item @code{@@(space)}          @tab (space)
16479146515Sru@item @code{@@(tab)}            @tab (space)
16480146515Sru@item @code{@@!}                @tab @samp{!}
16481146515Sru@item @code{@@*}                @tab (space)
16482146515Sru@item @code{@@-}                @tab (nothing)
16483146515Sru@item @code{@@.}                @tab @samp{.}
16484146515Sru@item @code{@@:}                @tab (nothing)
16485146515Sru@item @code{@@?}                @tab @samp{?}
16486146515Sru@item @code{@@@@}               @tab @samp{@@}
16487146515Sru@item @code{@@@{}               @tab @samp{@{}
16488146515Sru@item @code{@@@}}               @tab @samp{@}}
16489146515Sru@item @code{@@LaTeX}            @tab @samp{LaTeX}
16490146515Sru@item @code{@@TeX}              @tab @samp{TeX}
16491146515Sru@item @code{@@bullet}           @tab U+2022
16492146515Sru@item @code{@@comma}            @tab @samp{,}
16493146515Sru@item @code{@@copyright}        @tab U+00A9
16494146515Sru@item @code{@@dots}             @tab U+2026
16495146515Sru@item @code{@@enddots}          @tab @samp{...}
16496146515Sru@item @code{@@equiv}            @tab U+2261
16497146515Sru@item @code{@@error}            @tab @samp{error-->}
16498146515Sru@item @code{@@euro}             @tab U+20AC
16499146515Sru@item @code{@@exclamdown}       @tab U+00A1
16500146515Sru@item @code{@@expansion}        @tab U+2192
16501146515Sru@item @code{@@minus}            @tab U+2212
16502146515Sru@item @code{@@ordf}             @tab U+00AA
16503146515Sru@item @code{@@ordm}             @tab U+00BA
16504146515Sru@item @code{@@point}            @tab U+2217
16505146515Sru@item @code{@@pounds}           @tab U+00A3
16506146515Sru@item @code{@@print}            @tab @samp{-|}
16507146515Sru@item @code{@@questiondown}     @tab U+00BF
16508146515Sru@item @code{@@registeredsymbol} @tab U+00AE
16509146515Sru@item @code{@@result}           @tab U+21D2
16510146515Sru@item @code{@@tie}              @tab (space)
16511146515Sru@end multitable
16512146515Sru
16513146515SruAn @code{@@acronym} or @code{@@abbr} command is replaced by the first
16514146515Sruargument, followed by the second argument in parentheses, if present.
16515146515Sru@xref{acronym}.
16516146515Sru
16517146515SruAn @code{@@email} command is replaced by the @var{text} argument if
16518146515Srupresent, else the address.  @xref{email}.
16519146515Sru
16520146515SruAn @code{@@image} command is replaced by the filename (first)
16521146515Sruargument.  @xref{Images}.
16522146515Sru
16523146515SruA @code{@@verb} command is replaced by its transformed argument.
16524146515Sru@xref{verb}.
16525146515Sru
16526146515SruAny other command is an error, and the result is unspecified.
16527146515Sru
16528146515Sru
16529146515Sru@node HTML Xref 8-bit Character Expansion
16530146515Sru@subsection HTML Cross-reference 8-bit Character Expansion
16531146515Sru@cindex HTML cross-reference 8-bit character expansion
16532146515Sru@cindex 8-bit characters, in HTML cross-references
16533146515Sru@cindex Expansion of 8-bit characters in HTML cross-references
16534146515Sru
16535146515SruUsually, characters other than plain 7-bit ASCII are transformed into
16536146515Sruthe corresponding Unicode code point(s) in Normalization Form C, which
16537146515Sruuses precomposed characters where available.  (This is the
16538146515Srunormalization form recommended by the W3C and other bodies.)  This
16539146515Sruholds when that code point is 0xffff or less, as it almost always is.
16540146515Sru
16541146515SruThese will then be further transformed by the rules above into the
16542146515Srustring @samp{_@var{xxxx}}, where @var{xxxx} is the code point in hex.
16543146515Sru
16544146515SruFor example, combining this rule and the previous section:
16545146515Sru
16546146515Sru@example
16547146515Sru@@node @@b@{A@} @@TeX@{@} @@u@{B@} @@point@{@}@@enddots@{@}
16548146515Sru@result{} A-TeX-B_0306-_2605_002e_002e_002e
16549146515Sru@end example
16550146515Sru
16551146515SruNotice: 1)@tie{}@code{@@enddots} expands to three periods which in
16552146515Sruturn expands to three @samp{_002e}'s; 2)@tie{}@code{@@u@{B@}} is a `B'
16553146515Sruwith a breve accent, which does not exist as a pre-accented Unicode
16554146515Srucharacter, therefore expands to @samp{B_0306} (B with combining
16555146515Srubreve).
16556146515Sru
16557146515SruWhen the Unicode code point is above 0xffff, the transformation is
16558146515Sru@samp{__@var{xxxxxx}}, that is, two leading underscores followed by
16559146515Srusix hex digits.  Since Unicode has declared that their highest code
16560146515Srupoint is 0x10ffff, this is sufficient.  (We felt it was better to
16561146515Srudefine this extra escape than to always use six hex digits, since the
16562146515Srufirst two would nearly always be zeros.)
16563146515Sru
16564146515SruFor the definition of Unicode Normalization Form C, see Unicode report
16565146515SruUAX#15, @uref{http://www.unicode.org/reports/tr15/}.  Many related
16566146515Srudocuments and implementations are available elsewhere on the web.
16567146515Sru
16568146515Sru
16569146515Sru@node HTML Xref Mismatch
16570146515Sru@subsection HTML Cross-reference Mismatch
16571146515Sru@cindex HTML cross-reference mismatch
16572146515Sru@cindex Mismatched HTML cross-reference source and target
16573146515Sru
16574146515SruAs mentioned earlier (@pxref{HTML Xref Link Basics}), the generating
16575146515Srusoftware has to guess whether a given manual being cross-referenced is
16576146515Sruavailable in split or monolithic form---and, inevitably, it might
16577146515Sruguess wrong.  However, it is possible when the referent manual itself
16578146515Sruis generated, it is possible to handle at least some mismatches.
16579146515Sru
16580146515SruIn the case where we assume the referent is split, but it is actually
16581146515Sruavailable in mono, the only recourse would be to generate a
16582146515Sru@file{manual/} subdirectory full of HTML files which redirect back to
16583146515Sruthe monolithic @file{manual.html}.  Since this is essentially the same
16584146515Sruas a split manual in the first place, it's not very appealing.
16585146515Sru
16586146515SruOn the other hand, in the case where we assume the referent is mono,
16587146515Srubut it is actually available in split, it is possible to use
16588146515SruJavaScript to redirect from the putatively monolithic
16589146515Sru@file{manual.html} to the different @file{manual/node.html} files.
16590146515SruHere's an example:
16591146515Sru
16592146515Sru@example
16593146515Srufunction redirect() @{
16594146515Sru  switch (location.hash) @{
16595146515Sru    case "#Node1":
16596146515Sru      location.replace("manual/Node1.html#Node1"); break;
16597146515Sru    case "#Node2" :
16598146515Sru      location.replace("manual/Node2.html#Node2"); break;
16599146515Sru    @dots{}
16600146515Sru    default:;
16601146515Sru  @}
16602146515Sru@}
16603146515Sru@end example
16604146515Sru
16605146515SruThen, in the @code{<body>} tag of @file{manual.html}:
16606146515Sru
16607146515Sru@example
16608146515Sru<body onLoad="redirect();">
16609146515Sru@end example
16610146515Sru
16611146515SruOnce again, this is something the software which generated the
16612146515Sru@emph{referent} manual has to do in advance, it's not something the
16613146515Srusoftware generating the actual cross-reference in the present manual
16614146515Srucan control.
16615146515Sru
16616146515SruUltimately, we hope to allow for an external configuration file to
16617146515Srucontrol which manuals are available from where, and how.
16618146515Sru
16619146515Sru
16620146515Sru@ignore
16621146515Sru-- not yet --
16622146515Sru
16623146515Sruexternal information
16624146515Sru--------------------
16625146515Sru
16626146515SruThe information for the reference is searched in the file
16627146515Sru`htmlxref.cnf' present in the following directories:
16628146515Sru<srcdir>/.texinfo/, ~/.texinfo/,  SYSCONFDIR/texinfo/,
16629146515SruDATADIR/texinfo/
16630146515SruThe first match should be used.
16631146515Sru
16632146515SruThe file is line-oriented, with the following format:
16633146515Sru  <manualname> <whitespace> <keyword> <whitespace> <urlprefix>
16634146515Sruwith <keyword> being "mono" or "split". Thus
16635146515Srutexinfo split http://www.gnu.org/software/texinfo/manual/texinfo/html_node/
16636146515Srutexinfo mono http://www.gnu.org/software/texinfo/manual/texinfo/texinfo.html
16637146515Sru
16638146515SruIf the keyword is 'split', that is the target is split, the urlprefix gives 
16639146515Sruthe directory and host name.
16640146515SruIf the keyword is 'mono', that is the target is mono, the urlprefix gives 
16641146515Srudirectory, host and file name.
16642146515Sru
16643146515Sru'#' followed by a space begins comments. '#' followed by another character
16644146515Srucannot begin comments as there are # in urls.
16645146515Sru
16646146515Sru@end ignore
16647146515Sru
16648146515Sru
1664956160Sru@node Command List
1665042660Smarkm@appendix @@-Command List
1665142660Smarkm@cindex Alphabetical @@-command list
1665242660Smarkm@cindex List of  @@-commands
1665342660Smarkm@cindex @@-command list
1665456160Sru@cindex Reference to @@-commands
1665542660Smarkm
1665642660SmarkmHere is an alphabetical list of the @@-commands in Texinfo.  Square
1665742660Smarkmbrackets, @t{[}@w{ }@t{]}, indicate optional arguments; an ellipsis,
1665856160Sru@samp{@dots{}}, indicates repeated text.
1665942660Smarkm
16660146515SruMore specifics on the general syntax of different @@-commands are
16661146515Srugiven in the section below.
16662146515Sru
16663146515Sru@menu
16664146515Sru* Command Syntax::    General syntax for varieties of @@-commands.
16665146515Sru@end menu
16666146515Sru
1666742660Smarkm@sp 1
1666842660Smarkm@table @code
1666942660Smarkm@item @@@var{whitespace}
1667042660SmarkmAn @code{@@} followed by a space, tab, or newline produces a normal,
1667142660Smarkmstretchable, interword space.  @xref{Multiple Spaces}.
1667242660Smarkm
1667342660Smarkm@item @@!
1667442660SmarkmGenerate an exclamation point that really does end a sentence (usually
1667542660Smarkmafter an end-of-sentence capital letter).  @xref{Ending a Sentence}.
1667642660Smarkm
1667742660Smarkm@item @@"
1667842660Smarkm@itemx @@'
1667942660SmarkmGenerate an umlaut or acute accent, respectively, over the next
1668042660Smarkmcharacter, as in @"o and @'o.  @xref{Inserting Accents}.
1668142660Smarkm
1668242660Smarkm@item @@*
16683146515SruForce a line break.  @xref{Line Breaks}.
1668442660Smarkm
1668542660Smarkm@item @@,@{@var{c}@}
1668642660SmarkmGenerate a cedilla accent under @var{c}, as in @,{c}.  @xref{Inserting
1668742660SmarkmAccents}.
1668842660Smarkm
1668942660Smarkm@item @@-
1669042660SmarkmInsert a discretionary hyphenation point.  @xref{- and hyphenation}.
1669142660Smarkm
1669242660Smarkm@item @@.
1669342660SmarkmProduce a period that really does end a sentence (usually after an
1669442660Smarkmend-of-sentence capital letter).  @xref{Ending a Sentence}.
1669542660Smarkm
16696146515Sru@item @@/
16697116525SruProduces no output, but allows a line break.  @xref{Line Breaks}.
16698116525Sru
1669942660Smarkm@item @@:
1670042660SmarkmIndicate to @TeX{} that an immediately preceding period, question
1670142660Smarkmmark, exclamation mark, or colon does not end a sentence.  Prevent
1670242660Smarkm@TeX{} from inserting extra whitespace as it does at the end of a
1670342660Smarkmsentence.  The command has no effect on the Info file output.
1670456160Sru@xref{Not Ending a Sentence}.
1670542660Smarkm
1670642660Smarkm@item @@=
1670756160SruGenerate a macron (bar) accent over the next character, as in @=o.
1670842660Smarkm@xref{Inserting Accents}.
1670942660Smarkm
1671042660Smarkm@item @@?
1671142660SmarkmGenerate a question mark that really does end a sentence (usually after
1671242660Smarkman end-of-sentence capital letter).  @xref{Ending a Sentence}.
1671342660Smarkm
1671442660Smarkm@item @@@@
1671542660SmarkmStands for an at sign, @samp{@@}.
16716146515Sru@xref{Atsign Braces Comma, , Inserting @@ and @{@} and @comma{}}.
1671742660Smarkm
16718100513Sru@item @@\
16719100513SruStands for a backslash (@samp{\}) inside @code{@@math}.
16720100513Sru@xref{math,,@code{math}}.
16721100513Sru
1672242660Smarkm@item @@^
1672342660Smarkm@itemx @@`
1672442660SmarkmGenerate a circumflex (hat) or grave accent, respectively, over the next
16725100513Srucharacter, as in @^o and @`e.
1672642660Smarkm@xref{Inserting Accents}.
1672742660Smarkm
1672842660Smarkm@item @@@{
1672942660SmarkmStands for a left brace, @samp{@{}.
16730146515Sru@xref{Atsign Braces Comma, , Inserting @@ and @{@} and @comma{}}.
1673142660Smarkm
1673242660Smarkm@item @@@}
1673342660SmarkmStands for a right-hand brace, @samp{@}}.@*
16734146515Sru@xref{Atsign Braces Comma, , Inserting @@ and @{@} and @comma{}}.
1673542660Smarkm
1673656160Sru@item @@~
1673742660SmarkmGenerate a tilde accent over the next character, as in @~N.
1673842660Smarkm@xref{Inserting Accents}.
1673942660Smarkm
1674042660Smarkm@item @@AA@{@}
1674142660Smarkm@itemx @@aa@{@}
1674242660SmarkmGenerate the uppercase and lowercase Scandinavian A-ring letters,
1674342660Smarkmrespectively: @AA{}, @aa{}.  @xref{Inserting Accents}.
1674442660Smarkm
16745146515Sru@item @@abbr@{@var{abbreviation}@}
16746146515SruTag @var{abbreviation} as an abbreviation, such as `Comput.'.
16747146515Sru@xref{abbr,, @code{abbr}}.
1674856160Sru
16749146515Sru@item @@acronym@{@var{acronym}@}
16750146515SruTag @var{acronym} as an acronym, such as `NASA'.
16751146515Sru@xref{acronym,, @code{acronym}}.
16752146515Sru
1675342660Smarkm@item @@AE@{@}
1675442660Smarkm@itemx @@ae@{@}
1675542660SmarkmGenerate the uppercase and lowercase AE ligatures, respectively:
1675642660Smarkm@AE{}, @ae{}.  @xref{Inserting Accents}.
1675742660Smarkm
1675893139Sru@itemx @@afivepaper
1675993139SruChange page dimensions for the A5 paper size.  @xref{A4 Paper}.
1676093139Sru
1676156160Sru@item @@afourlatex
1676256160Sru@itemx @@afourpaper
1676356160Sru@itemx @@afourwide
1676456160SruChange page dimensions for the A4 paper size.  @xref{A4 Paper}.
1676542660Smarkm
1676656160Sru@item @@alias @var{new}=@var{existing}
1676756160SruMake the command @samp{@@@var{new}} an alias for the existing command
1676856160Sru@samp{@@@var{existing}}.  @xref{alias}.
1676956160Sru
1677056160Sru@item @@anchor@{@var{name}@}
1677156160SruDefine @var{name} as the current location for use as a cross-reference
1677256160Srutarget.  @xref{anchor,, @code{@@anchor}}.
1677356160Sru
1677442660Smarkm@item @@appendix @var{title}
1677542660SmarkmBegin an appendix.  The title appears in the table
1677642660Smarkmof contents of a printed manual.  In Info, the title is
1677742660Smarkmunderlined with asterisks.  @xref{unnumbered & appendix, , The
1677842660Smarkm@code{@@unnumbered} and @code{@@appendix} Commands}.@refill
1677942660Smarkm
1678042660Smarkm@item @@appendixsec @var{title}
1678142660Smarkm@itemx @@appendixsection @var{title}
1678242660SmarkmBegin an appendix section within an appendix.  The section title appears
1678342660Smarkmin the table of contents of a printed manual.  In Info, the title is
1678442660Smarkmunderlined with equal signs.  @code{@@appendixsection} is a longer
1678542660Smarkmspelling of the @code{@@appendixsec} command.  @xref{unnumberedsec
1678642660Smarkmappendixsec heading, , Section Commands}.@refill
1678742660Smarkm
1678842660Smarkm@item @@appendixsubsec @var{title}
1678942660SmarkmBegin an appendix subsection within an appendix.  The title appears
1679042660Smarkmin the table of contents of a printed manual.  In Info, the title is
1679142660Smarkmunderlined with hyphens.  @xref{unnumberedsubsec appendixsubsec
1679242660Smarkmsubheading, , Subsection Commands}.@refill
1679342660Smarkm
1679442660Smarkm@item @@appendixsubsubsec @var{title}
1679542660SmarkmBegin an appendix subsubsection within an appendix subsection.  The
1679642660Smarkmtitle appears in the table of contents of a printed manual.  In Info,
1679742660Smarkmthe title is underlined with periods.  @xref{subsubsection,, The
1679842660Smarkm`subsub' Commands}.@refill
1679942660Smarkm
1680042660Smarkm@item @@asis
1680142660SmarkmUsed following @code{@@table}, @code{@@ftable}, and @code{@@vtable} to
1680242660Smarkmprint the table's first column without highlighting (``as is'').
1680342660Smarkm@xref{Two-column Tables, , Making a Two-column Table}.@refill
1680442660Smarkm
1680542660Smarkm@item @@author @var{author}
1680642660SmarkmTypeset @var{author} flushleft and underline it.  @xref{title
1680742660Smarkmsubtitle author, , The @code{@@title} and @code{@@author}
1680842660SmarkmCommands}.@refill
1680942660Smarkm
1681042660Smarkm@item @@b@{@var{text}@}
1681142660SmarkmPrint @var{text} in @b{bold} font.  No effect in Info.  @xref{Fonts}.@refill
1681242660Smarkm
1681342660Smarkm@ignore
1681442660Smarkm@item @@br
1681542660SmarkmForce a paragraph break.  If used within a line, follow @code{@@br}
1681642660Smarkmwith braces.  @xref{br, , @code{@@br}}.@refill
1681742660Smarkm@end ignore
1681842660Smarkm
1681942660Smarkm@item @@bullet@{@}
1682042660SmarkmGenerate a large round dot, or the closest possible
1682142660Smarkmthing to one.  @xref{bullet, , @code{@@bullet}}.@refill
1682242660Smarkm
1682342660Smarkm@item @@bye
1682442660SmarkmStop formatting a file.  The formatters do not see the contents of a
1682542660Smarkmfile following an @code{@@bye} command.  @xref{Ending a File}.@refill
1682642660Smarkm
1682742660Smarkm@item @@c @var{comment}
1682842660SmarkmBegin a comment in Texinfo.  The rest of the line does not appear in
1682942660Smarkmeither the Info file or the printed manual.  A synonym for
16830146515Sru@code{@@comment}.  @xref{Comments}.
1683142660Smarkm
16832146515Sru@item @@caption
16833146515SruDefine the full caption for a @code{@@float}.  @xref{caption shortcaption}.
16834146515Sru
1683542660Smarkm@item @@cartouche
1683642660SmarkmHighlight an example or quotation by drawing a box with rounded
1683742660Smarkmcorners around it.  Pair with @code{@@end cartouche}.  No effect in
1683842660SmarkmInfo.  @xref{cartouche, , Drawing Cartouches Around Examples}.)@refill
1683942660Smarkm
1684042660Smarkm@item @@center @var{line-of-text}
1684142660SmarkmCenter the line of text following the command.
1684242660Smarkm@xref{titlefont center sp, , @code{@@center}}.@refill
1684342660Smarkm
1684442660Smarkm@item @@centerchap @var{line-of-text}
1684542660SmarkmLike @code{@@chapter}, but centers the chapter title.  @xref{chapter,,
1684642660Smarkm@code{@@chapter}}.
1684742660Smarkm
1684842660Smarkm@item @@chapheading @var{title}
1684942660SmarkmPrint a chapter-like heading in the text, but not in the table of
1685042660Smarkmcontents of a printed manual.  In Info, the title is underlined with
1685142660Smarkmasterisks.  @xref{majorheading & chapheading, , @code{@@majorheading}
1685242660Smarkmand @code{@@chapheading}}.@refill
1685342660Smarkm
1685442660Smarkm@item @@chapter @var{title}
1685542660SmarkmBegin a chapter.  The chapter title appears in the table of
1685642660Smarkmcontents of a printed manual.  In Info, the title is underlined with
1685742660Smarkmasterisks.  @xref{chapter, , @code{@@chapter}}.@refill
1685842660Smarkm
1685942660Smarkm@item @@cindex @var{entry}
1686042660SmarkmAdd @var{entry} to the index of concepts.  @xref{Index Entries, ,
1686142660SmarkmDefining the Entries of an Index}.@refill
1686242660Smarkm
1686342660Smarkm@item @@cite@{@var{reference}@}
1686442660SmarkmHighlight the name of a book or other reference that lacks a
1686542660Smarkmcompanion Info file.  @xref{cite, , @code{@@cite}}.@refill
1686642660Smarkm
1686742660Smarkm@item @@clear @var{flag}
1686842660SmarkmUnset @var{flag}, preventing the Texinfo formatting commands from
1686942660Smarkmformatting text between subsequent pairs of @code{@@ifset @var{flag}}
1687042660Smarkmand @code{@@end ifset} commands, and preventing
1687142660Smarkm@code{@@value@{@var{flag}@}} from expanding to the value to which
1687242660Smarkm@var{flag} is set.
1687342660Smarkm@xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill
1687442660Smarkm
1687542660Smarkm@item @@code@{@var{sample-code}@}
1687642660SmarkmHighlight text that is an expression, a syntactically complete token
1687742660Smarkmof a program, or a program name.  @xref{code, , @code{@@code}}.@refill
1687842660Smarkm
16879146515Sru@item @@comma@{@}
16880146515SruInsert a comma `,' character; only needed when a literal comma would
16881146515Srube taken as an argument separator.  @xref{Inserting a Comma}.
16882146515Sru
1688356160Sru@item @@command@{@var{command-name}@}
1688456160SruIndicate a command name, such as @command{ls}.
1688556160Sru@xref{command,, @code{@@command}}.
1688656160Sru
1688742660Smarkm@item @@comment @var{comment}
1688842660SmarkmBegin a comment in Texinfo.  The rest of the line does not appear in
1688942660Smarkmeither the Info file or the printed manual.  A synonym for @code{@@c}.
1689056160Sru@xref{Comments}.
1689142660Smarkm
1689242660Smarkm@item @@contents
1689342660SmarkmPrint a complete table of contents.  Has no effect in Info, which uses
1689442660Smarkmmenus instead.  @xref{Contents, , Generating a Table of
1689542660SmarkmContents}.@refill
1689642660Smarkm
1689742660Smarkm@item @@copyright@{@}
16898146515SruGenerate the copyright symbol @copyright{}.  @xref{copyright symbol,,
16899146515Sru@code{@@copyright@{@}}}.
1690042660Smarkm
1690142660Smarkm@ignore
1690242660Smarkm@item @@ctrl@{@var{ctrl-char}@}
1690342660SmarkmDescribe an @sc{ascii} control character.  Insert actual control character
1690442660Smarkminto Info file.  @xref{ctrl, , @code{@@ctrl}}.@refill
1690542660Smarkm@end ignore
1690642660Smarkm
1690742660Smarkm@item @@defcodeindex @var{index-name}
1690842660SmarkmDefine a new index and its indexing command.  Print entries in an
1690942660Smarkm@code{@@code} font.  @xref{New Indices, , Defining New
1691042660SmarkmIndices}.@refill
1691142660Smarkm
1691242660Smarkm@item @@defcv @var{category} @var{class} @var{name}
1691342660Smarkm@itemx @@defcvx @var{category} @var{class} @var{name}
1691442660SmarkmFormat a description for a variable associated with a class in
1691542660Smarkmobject-oriented programming.  Takes three arguments: the category of
1691642660Smarkmthing being defined, the class to which it belongs, and its name.
1691742660Smarkm@xref{Definition Commands}, and @ref{deffnx,, Def Cmds in Detail}.
1691842660Smarkm
1691942660Smarkm@item @@deffn @var{category} @var{name} @var{arguments}@dots{}
1692042660Smarkm@itemx @@deffnx @var{category} @var{name} @var{arguments}@dots{}
1692142660SmarkmFormat a description for a function, interactive command, or similar
1692242660Smarkmentity that may take arguments.  @code{@@deffn} takes as arguments the
1692342660Smarkmcategory of entity being described, the name of this particular
1692442660Smarkmentity, and its arguments, if any.  @xref{Definition Commands}.@refill
1692542660Smarkm
1692642660Smarkm@item @@defindex @var{index-name}
1692742660SmarkmDefine a new index and its indexing command.  Print entries in a roman
1692842660Smarkmfont.  @xref{New Indices, , Defining New Indices}.@refill
1692942660Smarkm
1693056160Sru@item @@definfoenclose @var{newcmd}, @var{before}, @var{after},
1693156160SruCreate new @@-command @var{newcmd} for Info that marks text by enclosing
1693256160Sruit in strings that precede and follow the text.  @xref{definfoenclose}.
1693342660Smarkm
1693442660Smarkm@item @@defivar @var{class} @var{instance-variable-name}
1693542660Smarkm@itemx @@defivarx @var{class} @var{instance-variable-name}
1693642660SmarkmThis command formats a description for an instance variable in
1693742660Smarkmobject-oriented programming.  The command is equivalent to @samp{@@defcv
1693842660Smarkm@{Instance Variable@} @dots{}}.  @xref{Definition Commands}, and
1693942660Smarkm@ref{deffnx,, Def Cmds in Detail}.
1694042660Smarkm
1694156160Sru@item @@defmac @var{macroname} @var{arguments}@dots{}
1694256160Sru@itemx @@defmacx @var{macroname} @var{arguments}@dots{}
1694342660SmarkmFormat a description for a macro.  The command is equivalent to
1694442660Smarkm@samp{@@deffn Macro @dots{}}.  @xref{Definition Commands}, and
1694542660Smarkm@ref{deffnx,, Def Cmds in Detail}.
1694642660Smarkm
1694742660Smarkm@item @@defmethod @var{class} @var{method-name} @var{arguments}@dots{}
1694842660Smarkm@itemx @@defmethodx @var{class} @var{method-name} @var{arguments}@dots{}
1694942660SmarkmFormat a description for a method in object-oriented programming.  The
1695042660Smarkmcommand is equivalent to @samp{@@defop Method @dots{}}.  Takes as
1695142660Smarkmarguments the name of the class of the method, the name of the
1695242660Smarkmmethod, and its arguments, if any.  @xref{Definition Commands}, and
1695342660Smarkm@ref{deffnx,, Def Cmds in Detail}.
1695442660Smarkm
1695542660Smarkm@item @@defop @var{category} @var{class} @var{name} @var{arguments}@dots{}
1695642660Smarkm@itemx @@defopx @var{category} @var{class} @var{name} @var{arguments}@dots{}
1695742660SmarkmFormat a description for an operation in object-oriented programming.
1695842660Smarkm@code{@@defop} takes as arguments the overall name of the category of
1695942660Smarkmoperation, the name of the class of the operation, the name of the
1696042660Smarkmoperation, and its arguments, if any.  @xref{Definition
1696156160SruCommands}, and @ref{Abstract Objects}.
1696242660Smarkm
1696342660Smarkm@item @@defopt @var{option-name}
1696442660Smarkm@itemx @@defoptx @var{option-name}
1696542660SmarkmFormat a description for a user option.  The command is equivalent to
1696642660Smarkm@samp{@@defvr @{User Option@} @dots{}}.  @xref{Definition Commands}, and
1696742660Smarkm@ref{deffnx,, Def Cmds in Detail}.
1696842660Smarkm
1696942660Smarkm@item @@defspec @var{special-form-name} @var{arguments}@dots{}
1697042660Smarkm@itemx @@defspecx @var{special-form-name} @var{arguments}@dots{}
1697142660SmarkmFormat a description for a special form.  The command is equivalent to
1697242660Smarkm@samp{@@deffn @{Special Form@} @dots{}}.  @xref{Definition Commands},
1697342660Smarkmand @ref{deffnx,, Def Cmds in Detail}.
1697442660Smarkm
1697542660Smarkm@item @@deftp @var{category} @var{name-of-type} @var{attributes}@dots{}
1697642660Smarkm@itemx @@deftpx @var{category} @var{name-of-type} @var{attributes}@dots{}
1697742660SmarkmFormat a description for a data type.  @code{@@deftp} takes as arguments
1697842660Smarkmthe category, the name of the type (which is a word like @samp{int} or
1697942660Smarkm@samp{float}), and then the names of attributes of objects of that type.
1698056160Sru@xref{Definition Commands}, and @ref{Data Types}.
1698142660Smarkm
16982146515Sru@item @@deftypecv @var{category} @var{class} @var{data-type} @var{name}
16983146515Sru@itemx @@deftypecvx @var{category} @var{class} @var{data-type} @var{name}
16984146515SruFormat a description for a typed class variable in object-oriented programming.
16985146515Sru@xref{Definition Commands}, and @ref{Abstract Objects}.
16986146515Sru
1698742660Smarkm@item @@deftypefn @var{classification} @var{data-type} @var{name} @var{arguments}@dots{}
1698842660Smarkm@itemx @@deftypefnx @var{classification} @var{data-type} @var{name} @var{arguments}@dots{}
1698942660SmarkmFormat a description for a function or similar entity that may take
1699042660Smarkmarguments and that is typed.  @code{@@deftypefn} takes as arguments the
1699142660Smarkmclassification of entity being described, the type, the name of the
1699242660Smarkmentity, and its arguments, if any.  @xref{Definition Commands}, and
1699342660Smarkm@ref{deffnx,, Def Cmds in Detail}.
1699442660Smarkm
1699542660Smarkm@item @@deftypefun @var{data-type} @var{function-name} @var{arguments}@dots{}
1699642660Smarkm@itemx @@deftypefunx @var{data-type} @var{function-name} @var{arguments}@dots{}
1699742660SmarkmFormat a description for a function in a typed language.
1699842660SmarkmThe command is equivalent to @samp{@@deftypefn Function @dots{}}.
1699956160Sru@xref{Definition Commands}, and @ref{deffnx,, Def Cmds in Detail}.
1700042660Smarkm
1700156160Sru@item @@deftypeivar @var{class} @var{data-type} @var{variable-name}
1700256160Sru@itemx @@deftypeivarx @var{class} @var{data-type} @var{variable-name}
1700356160SruFormat a description for a typed instance variable in object-oriented
1700456160Sruprogramming. @xref{Definition Commands}, and @ref{Abstract Objects}.
1700556160Sru
1700642660Smarkm@item @@deftypemethod @var{class} @var{data-type} @var{method-name} @var{arguments}@dots{}
1700742660Smarkm@itemx @@deftypemethodx @var{class} @var{data-type} @var{method-name} @var{arguments}@dots{}
1700842660SmarkmFormat a description for a typed method in object-oriented programming.
1700942660Smarkm@xref{Definition Commands}, and @ref{deffnx,, Def Cmds in Detail}.
1701042660Smarkm
1701156160Sru@item @@deftypeop @var{category} @var{class} @var{data-type} @var{name} @var{arguments}@dots{}
1701256160Sru@itemx @@deftypeopx @var{category} @var{class} @var{data-type} @var{name} @var{arguments}@dots{}
1701356160SruFormat a description for a typed operation in object-oriented programming.
1701456160Sru@xref{Definition Commands}, and @ref{Abstract Objects}.
1701556160Sru
1701656160Sru@item @@deftypevar @var{data-type} @var{variable-name}
1701756160Sru@itemx @@deftypevarx @var{data-type} @var{variable-name}
1701856160SruFormat a description for a variable in a typed language.  The command is
1701956160Sruequivalent to @samp{@@deftypevr Variable @dots{}}.  @xref{Definition
1702056160SruCommands}, and @ref{deffnx,, Def Cmds in Detail}.
1702156160Sru
1702242660Smarkm@item @@deftypevr @var{classification} @var{data-type} @var{name}
1702342660Smarkm@itemx @@deftypevrx @var{classification} @var{data-type} @var{name}
1702442660SmarkmFormat a description for something like a variable in a typed
1702542660Smarkmlanguage---an entity that records a value.  Takes as arguments the
1702642660Smarkmclassification of entity being described, the type, and the name of the
1702742660Smarkmentity.  @xref{Definition Commands}, and @ref{deffnx,, Def Cmds in
1702842660SmarkmDetail}.
1702942660Smarkm
1703042660Smarkm@item @@defun @var{function-name} @var{arguments}@dots{}
1703142660Smarkm@itemx @@defunx @var{function-name} @var{arguments}@dots{}
1703242660SmarkmFormat a description for functions.  The command is equivalent to
1703342660Smarkm@samp{@@deffn Function @dots{}}.  @xref{Definition Commands}, and
1703442660Smarkm@ref{deffnx,, Def Cmds in Detail}.
1703542660Smarkm
1703642660Smarkm@item @@defvar @var{variable-name}
1703742660Smarkm@itemx @@defvarx @var{variable-name}
1703842660SmarkmFormat a description for variables.  The command is equivalent to
1703942660Smarkm@samp{@@defvr Variable @dots{}}.  @xref{Definition Commands}, and
1704042660Smarkm@ref{deffnx,, Def Cmds in Detail}.
1704142660Smarkm
1704242660Smarkm@item @@defvr @var{category} @var{name}
1704342660Smarkm@itemx @@defvrx @var{category} @var{name}
1704442660SmarkmFormat a description for any kind of variable.  @code{@@defvr} takes
1704542660Smarkmas arguments the category of the entity and the name of the entity.
1704642660Smarkm@xref{Definition Commands},
1704742660Smarkmand @ref{deffnx,, Def Cmds in Detail}.
1704842660Smarkm
1704956160Sru@item @@detailmenu
1705042660SmarkmAvoid @code{makeinfo} confusion stemming from the detailed node listing
1705142660Smarkmin a master menu.  @xref{Master Menu Parts}.
1705242660Smarkm
1705342660Smarkm@item @@dfn@{@var{term}@}
1705442660SmarkmHighlight the introductory or defining use of a term.
1705542660Smarkm@xref{dfn, , @code{@@dfn}}.@refill
1705642660Smarkm
1705742660Smarkm@item @@dircategory @var{dirpart}
1705842660SmarkmSpecify a part of the Info directory menu where this file's entry should
1705942660Smarkmgo.  @xref{Installing Dir Entries}.
1706042660Smarkm
1706142660Smarkm@item @@direntry
1706256160SruBegin the Info directory menu entry for this file.  Pair with
1706356160Sru@code{@@end direntry}.  @xref{Installing Dir Entries}.
1706442660Smarkm
1706542660Smarkm@item @@display
1706656160SruBegin a kind of example.  Like @code{@@example} (indent text, do not
1706756160Srufill), but do not select a new font.  Pair with @code{@@end display}.
1706856160Sru@xref{display, , @code{@@display}}.
1706942660Smarkm
1707042660Smarkm@item @@dmn@{@var{dimension}@}
1707142660SmarkmFormat a unit of measure, as in 12@dmn{pt}.  Causes @TeX{} to insert a
1707242660Smarkmthin space before @var{dimension}.  No effect in Info.
1707356160Sru@xref{dmn, , @code{@@dmn}}.
1707442660Smarkm
17075146515Sru@item @@docbook
17076146515SruEnter Docbook completely.  Pair with @code{@@end docbook}.  @xref{Raw
17077146515SruFormatter Commands}.
17078146515Sru
1707993139Sru@item @@documentdescription
1708093139SruSet the document description text, included in the HTML output.  Pair
1708193139Sruwith @code{@@end documentdescription}.  @xref{documentdescription,,
1708293139Sru@code{@@documentdescription}}.
1708393139Sru
1708456160Sru@item @@documentencoding @var{enc}
1708593139SruDeclare the input encoding to be @var{enc}.
1708656160Sru@xref{documentencoding,, @code{@@documentencoding}}.
1708756160Sru
1708856160Sru@item @@documentlanguage @var{CC}
1708956160SruDeclare the document language as the two-character ISO-639 abbreviation
1709056160Sru@var{CC}.  @xref{documentlanguage,, @code{@@documentlanguage}}.
1709156160Sru
1709242660Smarkm@item @@dotaccent@{@var{c}@}
1709356160SruGenerate a dot accent over the character @var{c}, as in @dotaccent{o}.
1709442660Smarkm@xref{Inserting Accents}.
1709542660Smarkm
1709642660Smarkm@item @@dots@{@}
1709742660SmarkmInsert an ellipsis: @samp{@dots{}}.
1709842660Smarkm@xref{dots, , @code{@@dots}}.@refill
1709942660Smarkm
1710042660Smarkm@item @@email@{@var{address}[, @var{displayed-text}]@}
1710142660SmarkmIndicate an electronic mail address.
1710256160Sru@xref{email, , @code{@@email}}.
1710342660Smarkm
1710442660Smarkm@item @@emph@{@var{text}@}
1710542660SmarkmHighlight @var{text}; text is displayed in @emph{italics} in printed
1710642660Smarkmoutput, and surrounded by asterisks in Info.  @xref{Emphasis, ,
1710742660SmarkmEmphasizing Text}.
1710842660Smarkm
1710942660Smarkm@item @@end @var{environment}
1711042660SmarkmEnds @var{environment}, as in @samp{@@end example}.  @xref{Formatting
1711142660SmarkmCommands,,@@-commands}.
1711242660Smarkm
1711356160Sru@item @@env@{@var{environment-variable}@}
1711456160SruIndicate an environment variable name, such as @env{PATH}.
1711556160Sru@xref{env,, @code{@@env}}.
1711656160Sru
1711742660Smarkm@item @@enddots@{@}
1711842660SmarkmGenerate an end-of-sentence of ellipsis, like this @enddots{}
1711942660Smarkm@xref{dots,,@code{@@dots@{@}}}.
1712042660Smarkm
1712142660Smarkm@item @@enumerate [@var{number-or-letter}]
1712242660SmarkmBegin a numbered list, using @code{@@item} for each entry.
1712342660SmarkmOptionally, start list with @var{number-or-letter}.  Pair with
1712442660Smarkm@code{@@end enumerate}.  @xref{enumerate, ,
1712542660Smarkm@code{@@enumerate}}.@refill
1712642660Smarkm
1712742660Smarkm@item @@equiv@{@}
1712842660SmarkmIndicate to the reader the exact equivalence of two forms with a
1712942660Smarkmglyph: @samp{@equiv{}}.  @xref{Equivalence}.@refill
1713042660Smarkm
17131146515Sru@item @@euro@{@}
17132146515SruGenerate the Euro currency sign.
17133146515Sru@xref{euro,,@code{@@euro@{@}}}.
17134146515Sru
1713542660Smarkm@item @@error@{@}
1713642660SmarkmIndicate to the reader with a glyph that the following text is
1713742660Smarkman error message: @samp{@error{}}.  @xref{Error Glyph}.@refill
1713842660Smarkm
1713942660Smarkm@item  @@evenfooting [@var{left}] @@| [@var{center}] @@| [@var{right}]
1714042660Smarkm@itemx @@evenheading [@var{left}] @@| [@var{center}] @@| [@var{right}]
1714142660SmarkmSpecify page footings resp.@: headings for even-numbered (left-hand)
17142100513Srupages.  @xref{Custom Headings, ,
1714342660SmarkmHow to Make Your Own Headings}.@refill
1714442660Smarkm
1714542660Smarkm@item @@everyfooting [@var{left}] @@| [@var{center}] @@| [@var{right}]
1714642660Smarkm@itemx @@everyheading [@var{left}] @@| [@var{center}] @@| [@var{right}]
1714742660SmarkmSpecify page footings resp.@: headings for every page.  Not relevant to
1714842660SmarkmInfo.  @xref{Custom Headings, , How to Make Your Own Headings}.@refill
1714942660Smarkm
1715042660Smarkm@item @@example
1715142660SmarkmBegin an example.  Indent text, do not fill, and select fixed-width font.
1715242660SmarkmPair with @code{@@end example}.  @xref{example, ,
1715342660Smarkm@code{@@example}}.@refill
1715442660Smarkm
1715556160Sru@item @@exampleindent @var{indent}
1715656160SruIndent example-like environments by @var{indent} number of spaces
1715756160Sru(perhaps 0).  @xref{exampleindent,, Paragraph Indenting}.
1715856160Sru
1715942660Smarkm@item @@exclamdown@{@}
1716042660SmarkmProduce an upside-down exclamation point.  @xref{Inserting Accents}.
1716142660Smarkm
1716242660Smarkm@item @@exdent @var{line-of-text}
1716342660SmarkmRemove any indentation a line might have.  @xref{exdent, ,
1716442660SmarkmUndoing the Indentation of a Line}.@refill
1716542660Smarkm
1716642660Smarkm@item @@expansion@{@}
1716742660SmarkmIndicate the result of a macro expansion to the reader with a special
1716842660Smarkmglyph: @samp{@expansion{}}.
1716942660Smarkm@xref{expansion, , @expansion{} Indicating an Expansion}.@refill
1717042660Smarkm
1717142660Smarkm@item @@file@{@var{filename}@}
1717242660SmarkmHighlight the name of a file, buffer, node, or directory.  @xref{file, ,
1717342660Smarkm@code{@@file}}.@refill
1717442660Smarkm
1717542660Smarkm@item @@finalout
1717642660SmarkmPrevent @TeX{} from printing large black warning rectangles beside
1717742660Smarkmover-wide lines.  @xref{Overfull hboxes}.@refill
1717842660Smarkm
1717942660Smarkm@item @@findex @var{entry}
1718042660SmarkmAdd @var{entry} to the index of functions.  @xref{Index Entries, ,
1718142660SmarkmDefining the Entries of an Index}.@refill
1718242660Smarkm
17183146515Sru@item @@float
17184146515SruEnvironment to define floating material.  Pair with @code{@@end float}.
17185146515Sru@xref{Floats}.
17186146515Sru
1718742660Smarkm@item @@flushleft
1718842660Smarkm@itemx @@flushright
1718942660SmarkmLeft justify every line but leave the right end ragged.
1719042660SmarkmLeave font as is.  Pair with @code{@@end flushleft}.
1719142660Smarkm@code{@@flushright} analogous.
1719242660Smarkm@xref{flushleft & flushright, , @code{@@flushleft} and
1719342660Smarkm@code{@@flushright}}.@refill
1719442660Smarkm
1719542660Smarkm@item @@footnote@{@var{text-of-footnote}@}
1719642660SmarkmEnter a footnote.  Footnote text is printed at the bottom of the page
1719742660Smarkmby @TeX{}; Info may format in either `End' node or `Separate' node style.
1719842660Smarkm@xref{Footnotes}.@refill
1719942660Smarkm
1720042660Smarkm@item @@footnotestyle @var{style}
1720142660SmarkmSpecify an Info file's footnote style, either @samp{end} for the end
1720242660Smarkmnode style or @samp{separate} for the separate node style.
1720342660Smarkm@xref{Footnotes}.@refill
1720442660Smarkm
1720542660Smarkm@item @@format
1720656160SruBegin a kind of example.  Like @code{@@display}, but do not narrow the
1720756160Srumargins.  Pair with @code{@@end format}.  @xref{example,,
1720856160Sru@code{@@example}}.
1720942660Smarkm
1721042660Smarkm@item @@ftable @var{formatting-command}
1721142660SmarkmBegin a two-column table, using @code{@@item} for each entry.
1721242660SmarkmAutomatically enter each of the items in the first column into the
1721342660Smarkmindex of functions.  Pair with @code{@@end ftable}.  The same as
1721442660Smarkm@code{@@table}, except for indexing.  @xref{ftable vtable, ,
1721542660Smarkm@code{@@ftable} and @code{@@vtable}}.@refill
1721642660Smarkm
1721742660Smarkm@item @@group
1721842660SmarkmHold text together that must appear on one printed page.  Pair with
1721942660Smarkm@code{@@end group}.  Not relevant to Info.  @xref{group, ,
1722042660Smarkm@code{@@group}}.@refill
1722142660Smarkm
1722242660Smarkm@item @@H@{@var{c}@}
1722342660SmarkmGenerate the long Hungarian umlaut accent over @var{c}, as in @H{o}.
1722442660Smarkm
1722542660Smarkm@item @@heading @var{title}
1722642660SmarkmPrint an unnumbered section-like heading in the text, but not in the
1722742660Smarkmtable of contents of a printed manual.  In Info, the title is
1722842660Smarkmunderlined with equal signs.  @xref{unnumberedsec appendixsec heading,
1722942660Smarkm, Section Commands}.@refill
1723042660Smarkm
1723142660Smarkm@item @@headings @var{on-off-single-double}
1723242660SmarkmTurn page headings on or off, and/or specify single-sided or double-sided
1723342660Smarkmpage headings for printing.  @xref{headings on off, , The
1723442660Smarkm@code{@@headings} Command}.
1723542660Smarkm
1723642660Smarkm@item @@html
1723742660SmarkmEnter HTML completely.  Pair with @code{@@end html}.  @xref{Raw
1723842660SmarkmFormatter Commands}.
1723942660Smarkm
1724042660Smarkm@item @@hyphenation@{@var{hy-phen-a-ted words}@}
1724142660SmarkmExplicitly define hyphenation points.  @xref{- and hyphenation,,
1724242660Smarkm@code{@@-} and @code{@@hyphenation}}.
1724342660Smarkm
1724442660Smarkm@item @@i@{@var{text}@}
17245100513SruPrint @var{text} in @i{italic} font.  No effect in Info.  @xref{Fonts}.
1724642660Smarkm
1724742660Smarkm@item @@ifclear @var{flag}
1724842660SmarkmIf @var{flag} is cleared, the Texinfo formatting commands format text
1724942660Smarkmbetween @code{@@ifclear @var{flag}} and the following @code{@@end
1725042660Smarkmifclear} command.
1725142660Smarkm@xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill
1725242660Smarkm
17253146515Sru@item @@ifdocbook
17254146515Sru@itemx @@ifhtml
1725542660Smarkm@itemx @@ifinfo
17256146515SruBegin text that will appear only in the given output format.
17257146515Sru@code{@@ifinfo} output appears in both Info and (for historical
17258146515Srucompatibility) plain text output.  Pair with @code{@@end ifdocbook}
17259146515Sruresp.@: @code{@@end ifhtml} resp.@: @code{@@end ifinfo}.
17260146515Sru@xref{Conditionals}.
1726142660Smarkm
17262146515Sru@item @@ifnotdocbook
17263146515Sru@itemx @@ifnothtml
1726442660Smarkm@itemx @@ifnotinfo
17265100513Sru@itemx @@ifnotplaintext
1726642660Smarkm@itemx @@ifnottex
17267114472Sru@itemx @@ifnotxml
1726842660SmarkmBegin a stretch of text that will be ignored in one output format but
17269100513Srunot the others.  The text appears in the formats not specified:
17270100513Sru@code{@@ifnothtml} text is omitted from html output, etc.  The exception
17271100513Sruis @code{@@ifnotinfo} text, which is omitted from plain text output as
17272114472Sruwell as Info output.  Pair with the corresponding @code{@@end
17273114472Sruifnot@var{format}}.  @xref{Conditionals}.
1727442660Smarkm
17275100513Sru@item @@ifplaintext
17276146515SruBegin text that will appear only in the plain text output.
17277100513SruPair with @code{@@end ifplaintext}.  @xref{Conditionals}.
17278100513Sru
1727942660Smarkm@item @@ifset @var{flag}
1728042660SmarkmIf @var{flag} is set, the Texinfo formatting commands format text
1728142660Smarkmbetween @code{@@ifset @var{flag}} and the following @code{@@end ifset}
1728242660Smarkmcommand.
1728342660Smarkm@xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill
1728442660Smarkm
1728542660Smarkm@item @@iftex
17286146515SruBegin text that will not appear in the Info file or other output, but
1728742660Smarkmwill be processed only by @TeX{}.  Pair with @code{@@end iftex}.
1728842660Smarkm@xref{Conditionals, , Conditionally Visible Text}.@refill
1728942660Smarkm
17290114472Sru@item @@ifxml
17291146515SruBegin text that will appear only in the XML output.  Pair with
17292146515Sru@code{@@end ifxml}.  @xref{Conditionals}.
17293114472Sru
1729442660Smarkm@item @@ignore
17295146515SruBegin text that will not appear in any output.  Pair with @code{@@end
17296146515Sruignore}.  @xref{Comments, , Comments and Ignored Text}.
1729742660Smarkm
1729893139Sru@item @@image@{@var{filename}, [@var{width}], [@var{height}], [@var{alt}], [@var{ext}]@}
1729942660SmarkmInclude graphics image in external @var{filename} scaled to the given
1730093139Sru@var{width} and/or @var{height}, using @var{alt} text and looking for
1730193139Sru@samp{@var{filename}.@var{ext}} in HTML.  @xref{Images}.
1730242660Smarkm
1730342660Smarkm@item @@include @var{filename}
1730442660SmarkmIncorporate the contents of the file @var{filename} into the Info file
1730542660Smarkmor printed document.  @xref{Include Files}.@refill
1730642660Smarkm
17307146515Sru@item @@indicateurl@{@var{indicateurl}@}
17308146515SruIndicate text that is a uniform resource locator for the World Wide
17309146515SruWeb.  @xref{indicateurl, , @code{@@indicateurl}}.
17310146515Sru
1731142660Smarkm@item @@inforef@{@var{node-name}, [@var{entry-name}], @var{info-file-name}@}
1731242660SmarkmMake a cross reference to an Info file for which there is no printed
1731342660Smarkmmanual.  @xref{inforef, , Cross references using
1731442660Smarkm@code{@@inforef}}.@refill
1731542660Smarkm
1731642660Smarkm@item \input @var{macro-definitions-file}
1731742660SmarkmUse the specified macro definitions file.  This command is used only
1731842660Smarkmin the first line of a Texinfo file to cause @TeX{} to make use of the
1731942660Smarkm@file{texinfo} macro definitions file.  The backslash in @code{\input}
1732042660Smarkmis used instead of an @code{@@} because @TeX{} does not
1732142660Smarkmrecognize @code{@@} until after it has read the definitions file.
17322100513Sru@xref{Texinfo File Header}.
1732342660Smarkm
1732442660Smarkm@item @@item
1732542660SmarkmIndicate the beginning of a marked paragraph for @code{@@itemize} and
1732642660Smarkm@code{@@enumerate}; indicate the beginning of the text of a first column
1732742660Smarkmentry for @code{@@table}, @code{@@ftable}, and @code{@@vtable}.
1732842660Smarkm@xref{Lists and Tables}.@refill
1732942660Smarkm
1733042660Smarkm@item @@itemize  @var{mark-generating-character-or-command}
1733142660SmarkmProduce a sequence of indented paragraphs, with a mark inside the left
1733242660Smarkmmargin at the beginning of each paragraph.  Pair with @code{@@end
1733342660Smarkmitemize}.  @xref{itemize, , @code{@@itemize}}.@refill
1733442660Smarkm
1733542660Smarkm@item @@itemx
1733642660SmarkmLike @code{@@item} but do not generate extra vertical space above the
1733742660Smarkmitem text.  @xref{itemx, , @code{@@itemx}}.@refill
1733842660Smarkm
1733942660Smarkm@item @@kbd@{@var{keyboard-characters}@}
1734042660SmarkmIndicate text that is characters of input to be typed by
1734142660Smarkmusers.  @xref{kbd, , @code{@@kbd}}.@refill
1734242660Smarkm
1734342660Smarkm@item @@kbdinputstyle @var{style}
1734442660SmarkmSpecify when @code{@@kbd} should use a font distinct from @code{@@code}.
1734542660Smarkm@xref{kbd, , @code{@@kbd}}.@refill
1734642660Smarkm
1734742660Smarkm@item @@key@{@var{key-name}@}
1734842660SmarkmIndicate a name for a key on a keyboard.
1734942660Smarkm@xref{key, , @code{@@key}}.@refill
1735042660Smarkm
1735142660Smarkm@item @@kindex @var{entry}
1735242660SmarkmAdd @var{entry} to the index of keys.
1735342660Smarkm@xref{Index Entries, , Defining the Entries of an Index}.@refill
1735442660Smarkm
1735542660Smarkm@item @@L@{@}
1735642660Smarkm@itemx @@l@{@}
1735742660SmarkmGenerate the uppercase and lowercase Polish suppressed-L letters,
1735842660Smarkmrespectively: @L{}, @l{}.
1735942660Smarkm
17360146515Sru@item @@LaTeX@{@}
17361146515SruInsert the logo @LaTeX{}.  @xref{tex, , @TeX{} and @LaTeX{}}.
1736242660Smarkm
1736342660Smarkm@item @@lisp
1736442660SmarkmBegin an example of Lisp code.  Indent text, do not fill, and select
1736556160Srufixed-width font.  Pair with @code{@@end lisp}.  @xref{lisp, , @code{@@lisp}}.
1736642660Smarkm
17367146515Sru@item @@listoffloats
17368146515SruProduce a table-of-contents-like listing of @code{@@float}s.
17369146515Sru@xref{listoffloats}.
17370146515Sru
1737142660Smarkm@item @@lowersections
1737242660SmarkmChange subsequent chapters to sections, sections to subsections, and so
1737342660Smarkmon. @xref{Raise/lower sections, , @code{@@raisesections} and
1737442660Smarkm@code{@@lowersections}}.@refill
1737542660Smarkm
1737656160Sru@item @@macro @var{macroname} @{@var{params}@}
1737756160SruDefine a new Texinfo command @code{@@@var{macroname}@{@var{params}@}}.
1737842660SmarkmOnly supported by @code{makeinfo} and @code{texi2dvi}.  @xref{Defining
1737942660SmarkmMacros}.
1738042660Smarkm
1738142660Smarkm@item @@majorheading @var{title}
1738242660SmarkmPrint a chapter-like heading in the text, but not in the table of
1738342660Smarkmcontents of a printed manual.  Generate more vertical whitespace before
17384146515Sruthe heading than the @code{@@chapheading} command.  @xref{majorheading &
1738542660Smarkmchapheading, , @code{@@majorheading} and @code{@@chapheading}}.@refill
1738642660Smarkm
1738742660Smarkm@item @@math@{@var{mathematical-expression}@}
1738842660SmarkmFormat a mathematical expression.
1738942660Smarkm@xref{math, , @code{@@math}: Inserting Mathematical Expressions}.
1739042660Smarkm
1739142660Smarkm@item @@menu
1739242660SmarkmMark the beginning of a menu of nodes in Info.  No effect in a printed
1739342660Smarkmmanual.  Pair with @code{@@end menu}.  @xref{Menus}.@refill
1739442660Smarkm
1739542660Smarkm@item @@minus@{@}
1739642660SmarkmGenerate a minus sign, `@minus{}'.  @xref{minus, , @code{@@minus}}.@refill
1739742660Smarkm
1739842660Smarkm@item @@multitable @var{column-width-spec}
1739942660SmarkmBegin a multi-column table.  Pair with @code{@@end multitable}.
1740042660Smarkm@xref{Multitable Column Widths}.
1740142660Smarkm
1740242660Smarkm@item @@need @var{n}
1740342660SmarkmStart a new page in a printed manual if fewer than @var{n} mils
1740442660Smarkm(thousandths of an inch) remain on the current page.  @xref{need, ,
1740542660Smarkm@code{@@need}}.@refill
1740642660Smarkm
1740756160Sru@item @@node @var{name}, @var{next}, @var{previous}, @var{up}
1740842660SmarkmDefine the beginning of a new node in Info, and serve as a locator for
1740942660Smarkmreferences for @TeX{}.  @xref{node, , @code{@@node}}.@refill
1741042660Smarkm
1741142660Smarkm@item @@noindent
1741242660SmarkmPrevent text from being indented as if it were a new paragraph.
1741342660Smarkm@xref{noindent, , @code{@@noindent}}.@refill
1741442660Smarkm
1741556160Sru@item @@novalidate
1741656160SruSuppress validation of node references, omit creation of auxiliary files
1741756160Sruwith @TeX{}.  Use before @code{@@setfilename}.  @xref{Pointer Validation}.
1741856160Sru
1741942660Smarkm@item @@O@{@}
1742042660Smarkm@itemx @@o@{@}
1742142660SmarkmGenerate the uppercase and lowercase O-with-slash letters, respectively:
1742242660Smarkm@O{}, @o{}.
1742342660Smarkm
1742442660Smarkm@item  @@oddfooting [@var{left}] @@| [@var{center}] @@| [@var{right}]
1742542660Smarkm@itemx @@oddheading [@var{left}] @@| [@var{center}] @@| [@var{right}]
1742642660SmarkmSpecify page footings resp.@: headings for odd-numbered (right-hand)
17427100513Srupages.  @xref{Custom Headings, ,
1742842660SmarkmHow to Make Your Own Headings}.@refill
1742942660Smarkm
1743042660Smarkm@item @@OE@{@}
1743142660Smarkm@itemx @@oe@{@}
1743242660SmarkmGenerate the uppercase and lowercase OE ligatures, respectively:
1743342660Smarkm@OE{}, @oe{}.  @xref{Inserting Accents}.
1743442660Smarkm
1743556160Sru@item @@option@{@var{option-name}@}
1743656160SruIndicate a command-line option, such as @option{-l} or @option{--help}.
1743756160Sru@xref{option,, @code{@@option}}.
1743856160Sru
1743942660Smarkm@item @@page
1744042660SmarkmStart a new page in a printed manual.  No effect in Info.
1744142660Smarkm@xref{page, , @code{@@page}}.@refill
1744242660Smarkm
1744356160Sru@item @@pagesizes [@var{width}][, @var{height}]
1744456160SruChange page dimensions.  @xref{pagesizes}.
1744556160Sru
1744642660Smarkm@item @@paragraphindent @var{indent}
1744756160SruIndent paragraphs by @var{indent} number of spaces (perhaps 0); preserve
1744856160Srusource file indentation if @var{indent} is @code{asis}.
1744956160Sru@xref{paragraphindent,, Paragraph Indenting}.
1745042660Smarkm
1745142660Smarkm@item @@pindex @var{entry}
1745242660SmarkmAdd @var{entry} to the index of programs.  @xref{Index Entries, , Defining
1745342660Smarkmthe Entries of an Index}.@refill
1745442660Smarkm
1745542660Smarkm@item @@point@{@}
1745642660SmarkmIndicate the position of point in a buffer to the reader with a
1745742660Smarkmglyph: @samp{@point{}}.  @xref{Point Glyph, , Indicating
1745842660SmarkmPoint in a Buffer}.@refill
1745942660Smarkm
1746042660Smarkm@item @@pounds@{@}
1746142660SmarkmGenerate the pounds sterling currency sign.
1746242660Smarkm@xref{pounds,,@code{@@pounds@{@}}}.
1746342660Smarkm
1746442660Smarkm@item @@print@{@}
1746542660SmarkmIndicate printed output to the reader with a glyph:
1746642660Smarkm@samp{@print{}}.  @xref{Print Glyph}.@refill
1746742660Smarkm
1746842660Smarkm@item @@printindex @var{index-name}
1746942660SmarkmPrint an alphabetized two-column index in a printed manual or generate
1747042660Smarkman alphabetized menu of index entries for Info.  @xref{Printing
1747142660SmarkmIndices & Menus}.@refill
1747242660Smarkm
1747342660Smarkm@item @@pxref@{@var{node-name}, [@var{entry}], [@var{topic-or-title}], [@var{info-file}], [@var{manual}]@}
1747442660SmarkmMake a reference that starts with a lower case `see' in a printed
1747542660Smarkmmanual.  Use within parentheses only.  Do not follow command with a
1747642660Smarkmpunctuation mark---the Info formatting commands automatically insert
1747742660Smarkmterminating punctuation as needed.  Only the first argument is mandatory.
1747842660Smarkm@xref{pxref, , @code{@@pxref}}.@refill
1747942660Smarkm
1748042660Smarkm@item @@questiondown@{@}
1748142660SmarkmGenerate an upside-down question mark.  @xref{Inserting Accents}.
1748242660Smarkm
1748342660Smarkm@item @@quotation
1748442660SmarkmNarrow the margins to indicate text that is quoted from another real
17485146515Sruor imaginary work.  Takes optional argument of prefix text.  Pair with
1748642660Smarkm@code{@@end quotation}.  @xref{quotation, ,
1748742660Smarkm@code{@@quotation}}.@refill
1748842660Smarkm
1748942660Smarkm@item @@r@{@var{text}@}
1749042660SmarkmPrint @var{text} in @r{roman} font.  No effect in Info.
1749142660Smarkm@xref{Fonts}.@refill
1749242660Smarkm
1749342660Smarkm@item @@raisesections
1749442660SmarkmChange subsequent sections to chapters, subsections to sections, and so
1749542660Smarkmon.  @xref{Raise/lower sections, , @code{@@raisesections} and
1749642660Smarkm@code{@@lowersections}}.@refill
1749742660Smarkm
1749842660Smarkm@item @@ref@{@var{node-name}, [@var{entry}], [@var{topic-or-title}], [@var{info-file}], [@var{manual}]@}
1749942660SmarkmMake a reference.  In a printed manual, the reference does not start
1750042660Smarkmwith a `See'.  Follow command with a punctuation mark.  Only the first
1750142660Smarkmargument is mandatory.  @xref{ref, , @code{@@ref}}.@refill
1750242660Smarkm
1750342660Smarkm@item @@refill
17504146515SruThis command used to refill and indent the paragraph after all the
17505146515Sruother processing has been done.  It is no longer needed, since all
17506146515Sruformatters now automatically refill as needed, but you may still see
17507146515Sruit in the source to some manuals, as it does no harm.
1750842660Smarkm
17509146515Sru@item @@registeredsymbol@{@}
17510146515SruGenerate the legal symbol @registeredsymbol{}.  @xref{registered
17511146515Srusymbol,, @code{@@registeredsymbol@{@}}}.
17512146515Sru
1751342660Smarkm@item @@result@{@}
1751442660SmarkmIndicate the result of an expression to the reader with a special
1751542660Smarkmglyph: @samp{@result{}}.  @xref{result, , @code{@@result}}.@refill
1751642660Smarkm
1751742660Smarkm@item @@ringaccent@{@var{c}@}
1751842660SmarkmGenerate a ring accent over the next character, as in @ringaccent{o}.
1751942660Smarkm@xref{Inserting Accents}.
1752042660Smarkm
1752142660Smarkm@item @@samp@{@var{text}@}
1752242660SmarkmHighlight @var{text} that is a literal example of a sequence of
1752342660Smarkmcharacters.  Used for single characters, for statements, and often for
1752442660Smarkmentire shell commands.  @xref{samp, , @code{@@samp}}.@refill
1752542660Smarkm
17526146515Sru@item @@sansserif@{@var{text}@}
17527146515SruPrint @var{text} in a @sansserif{sans serif} font if possible.  No
17528146515Srueffect in Info.  @xref{Fonts}.
17529146515Sru
1753042660Smarkm@item @@sc@{@var{text}@}
1753142660SmarkmSet @var{text} in a printed output in @sc{the small caps font} and
1753242660Smarkmset text in the Info file in uppercase letters.
1753342660Smarkm@xref{Smallcaps}.@refill
1753442660Smarkm
1753542660Smarkm@item @@section @var{title}
1753642660SmarkmBegin a section within a chapter.  In a printed manual, the section
1753742660Smarkmtitle is numbered and appears in the table of contents.  In Info, the
1753842660Smarkmtitle is underlined with equal signs.  @xref{section, ,
1753942660Smarkm@code{@@section}}.@refill
1754042660Smarkm
1754142660Smarkm@item @@set @var{flag} [@var{string}]
1754242660SmarkmMake @var{flag} active, causing the Texinfo formatting commands to
1754342660Smarkmformat text between subsequent pairs of @code{@@ifset @var{flag}} and
1754442660Smarkm@code{@@end ifset} commands.  Optionally, set value of @var{flag} to
1754542660Smarkm@var{string}.
1754656160Sru@xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.
1754742660Smarkm
1754842660Smarkm@item @@setchapternewpage @var{on-off-odd}
1754942660SmarkmSpecify whether chapters start on new pages, and if so, whether on
1755042660Smarkmodd-numbered (right-hand) new pages.  @xref{setchapternewpage, ,
1755156160Sru@code{@@setchapternewpage}}.
1755242660Smarkm
1755356160Sru@item @@setcontentsaftertitlepage
1755456160SruPut the table of contents after the @samp{@@end titlepage} even if the
1755556160Sru@code{@@contents} command is not there.  @xref{Contents}.
1755656160Sru
1755742660Smarkm@item @@setfilename @var{info-file-name}
1755842660SmarkmProvide a name to be used by the Info file.  This command is essential
1755942660Smarkmfor @TeX{} formatting as well, even though it produces no output.
1756056160Sru@xref{setfilename, , @code{@@setfilename}}.
1756142660Smarkm
1756256160Sru@item @@setshortcontentsaftertitlepage
1756356160SruPlace the short table of contents after the @samp{@@end titlepage}
1756456160Srucommand even if the @code{@@shortcontents} command is not there.
1756556160Sru@xref{Contents}.
1756656160Sru
1756742660Smarkm@item @@settitle @var{title}
1756893139SruProvide a title for page headers in a printed manual, and the default
1756993139Srudocument description for HTML @samp{<head>}.
1757042660Smarkm@xref{settitle, , @code{@@settitle}}.@refill
1757142660Smarkm
17572146515Sru@item @@shortcaption
17573146515SruDefine the short caption for a @code{@@float}.  @xref{caption shortcaption}.
17574146515Sru
1757542660Smarkm@item @@shortcontents
1757642660SmarkmPrint a short table of contents.  Not relevant to Info, which uses
1757742660Smarkmmenus rather than tables of contents.  A synonym for
1757842660Smarkm@code{@@summarycontents}.  @xref{Contents, , Generating a Table of
1757942660SmarkmContents}.@refill
1758042660Smarkm
1758156160Sru@item @@shorttitlepage @var{title}
1758242660SmarkmGenerate a minimal title page.  @xref{titlepage,,@code{@@titlepage}}.
1758342660Smarkm
17584146515Sru@item @@slanted@{@var{text}@}
17585146515SruPrint @var{text} in a @slanted{slanted} font if possible.  No effect
17586146515Sruin Info.  @xref{Fonts}.
17587146515Sru
1758842660Smarkm@item @@smallbook
1758942660SmarkmCause @TeX{} to produce a printed manual in a 7 by 9.25 inch format
1759042660Smarkmrather than the regular 8.5 by 11 inch format.  @xref{smallbook, ,
1759156160SruPrinting Small Books}.  Also, see @ref{small}.
1759242660Smarkm
1759356160Sru@item @@smalldisplay
1759493139SruBegin a kind of example.  Like @code{@@smallexample} (narrow margins, no
1759593139Srufilling), but do not select the fixed-width font.  Pair with @code{@@end
1759693139Srusmalldisplay}.  @xref{small}.
1759756160Sru
1759842660Smarkm@item @@smallexample
1759942660SmarkmIndent text to indicate an example.  Do not fill, select fixed-width
1760093139Srufont, narrow the margins.  In printed manuals, print text in a smaller
1760193139Srufont than with @code{@@example}.  Pair with @code{@@end smallexample}.
1760256160Sru@xref{small}.
1760342660Smarkm
1760456160Sru@item @@smallformat
1760556160SruBegin a kind of example.  Like @code{@@smalldisplay}, but do not narrow
1760693139Sruthe margins.  Pair with @code{@@end smallformat}.  @xref{small}.
1760756160Sru
1760842660Smarkm@item @@smalllisp
1760993139SruBegin an example of Lisp code.  Same as @code{@@smallexample}.  Pair
1761093139Sruwith @code{@@end smalllisp}.  @xref{small}.
1761142660Smarkm
1761242660Smarkm@item @@sp @var{n}
1761342660SmarkmSkip @var{n} blank lines.  @xref{sp, , @code{@@sp}}.@refill
1761442660Smarkm
1761542660Smarkm@item @@ss@{@}
1761642660SmarkmGenerate the German sharp-S es-zet letter, @ss{}.  @xref{Inserting Accents}.
1761742660Smarkm
1761856160Sru@item @@strong @{@var{text}@}
1761942660SmarkmEmphasize @var{text} by typesetting it in a @strong{bold} font for the
1762042660Smarkmprinted manual and by surrounding it with asterisks for Info.
1762142660Smarkm@xref{emph & strong, , Emphasizing Text}.@refill
1762242660Smarkm
1762342660Smarkm@item @@subheading @var{title}
1762442660SmarkmPrint an unnumbered subsection-like heading in the text, but not in
1762542660Smarkmthe table of contents of a printed manual.  In Info, the title is
1762642660Smarkmunderlined with hyphens.  @xref{unnumberedsubsec appendixsubsec
1762742660Smarkmsubheading, , @code{@@unnumberedsubsec} @code{@@appendixsubsec}
1762842660Smarkm@code{@@subheading}}.@refill
1762942660Smarkm
1763042660Smarkm@item @@subsection @var{title}
1763142660SmarkmBegin a subsection within a section.  In a printed manual, the
1763242660Smarkmsubsection title is numbered and appears in the table of contents.  In
1763342660SmarkmInfo, the title is underlined with hyphens.  @xref{subsection, ,
1763442660Smarkm@code{@@subsection}}.@refill
1763542660Smarkm
1763642660Smarkm@item @@subsubheading @var{title}
1763742660SmarkmPrint an unnumbered subsubsection-like heading in the text, but not in
1763842660Smarkmthe table of contents of a printed manual.  In Info, the title is
1763942660Smarkmunderlined with periods.  @xref{subsubsection, , The `subsub'
1764042660SmarkmCommands}.@refill
1764142660Smarkm
1764242660Smarkm@item @@subsubsection @var{title}
1764342660SmarkmBegin a subsubsection within a subsection.  In a printed manual,
1764442660Smarkmthe subsubsection title is numbered and appears in the table of
1764542660Smarkmcontents.  In Info, the title is underlined with periods.
1764642660Smarkm@xref{subsubsection, , The `subsub' Commands}.@refill
1764742660Smarkm
1764842660Smarkm@item @@subtitle @var{title}
1764942660SmarkmIn a printed manual, set a subtitle in a normal sized font flush to
1765042660Smarkmthe right-hand side of the page.  Not relevant to Info, which does not
1765142660Smarkmhave title pages.  @xref{title subtitle author, , @code{@@title}
1765242660Smarkm@code{@@subtitle} and @code{@@author} Commands}.@refill
1765342660Smarkm
1765442660Smarkm@item @@summarycontents
1765542660SmarkmPrint a short table of contents.  Not relevant to Info, which uses
1765642660Smarkmmenus rather than tables of contents.  A synonym for
1765742660Smarkm@code{@@shortcontents}.  @xref{Contents, , Generating a Table of
1765842660SmarkmContents}.@refill
1765942660Smarkm
1766042660Smarkm@item @@syncodeindex @var{from-index} @var{into-index}
1766142660SmarkmMerge the index named in the first argument into the index named in
1766242660Smarkmthe second argument, printing the entries from the first index in
1766342660Smarkm@code{@@code} font.  @xref{Combining Indices}.@refill
1766442660Smarkm
1766542660Smarkm@item @@synindex @var{from-index} @var{into-index}
1766642660SmarkmMerge the index named in the first argument into the index named in
1766742660Smarkmthe second argument.  Do not change the font of @var{from-index}
1766842660Smarkmentries.  @xref{Combining Indices}.@refill
1766942660Smarkm
1767042660Smarkm@item @@t@{@var{text}@}
1767142660SmarkmPrint @var{text} in a @t{fixed-width}, typewriter-like font.
1767242660SmarkmNo effect in Info.  @xref{Fonts}.@refill
1767342660Smarkm
1767442660Smarkm@item @@tab
1767542660SmarkmSeparate columns in a multitable.  @xref{Multitable Rows}.
1767642660Smarkm
1767742660Smarkm@item @@table @var{formatting-command}
1767842660SmarkmBegin a two-column table, using @code{@@item} for each entry.  Write
1767942660Smarkmeach first column entry on the same line as @code{@@item}.  First
1768042660Smarkmcolumn entries are printed in the font resulting from
1768142660Smarkm@var{formatting-command}.  Pair with @code{@@end table}.
1768242660Smarkm@xref{Two-column Tables, , Making a Two-column Table}.
1768342660SmarkmAlso see @ref{ftable vtable, , @code{@@ftable} and @code{@@vtable}},
1768442660Smarkmand @ref{itemx, , @code{@@itemx}}.@refill
1768542660Smarkm
1768642660Smarkm@item @@TeX@{@}
17687146515SruInsert the logo @TeX{}.  @xref{tex, , @TeX{} and @LaTeX{}}.
1768842660Smarkm
1768942660Smarkm@item @@tex
1769042660SmarkmEnter @TeX{} completely.  Pair with @code{@@end tex}.  @xref{Raw
1769142660SmarkmFormatter Commands}.
1769242660Smarkm
1769342660Smarkm@item @@thischapter
1769442660Smarkm@itemx @@thischaptername
1769542660Smarkm@itemx @@thisfile
1769642660Smarkm@itemx @@thispage
1769742660Smarkm@itemx @@thistitle
1769842660SmarkmOnly allowed in a heading or footing.  Stands for the number and name of
1769942660Smarkmthe current chapter (in the format `Chapter 1: Title'), the chapter name
1770042660Smarkmonly, the filename, the current page number, and the title of the
1770142660Smarkmdocument, respectively.  @xref{Custom Headings, , How to Make Your Own
1770242660SmarkmHeadings}.@refill
1770342660Smarkm
17704114472Sru@item @@tie@{@}
17705114472SruGenerate a normal interword space at which a line break is not allowed.
17706114472Sru@xref{tie,, @code{@@tie@{@}}}.
17707114472Sru
1770842660Smarkm@item @@tieaccent@{@var{cc}@}
1770942660SmarkmGenerate a tie-after accent over the next two characters @var{cc}, as in
1771042660Smarkm`@tieaccent{oo}'.  @xref{Inserting Accents}.
1771142660Smarkm
1771242660Smarkm@item @@tindex @var{entry}
1771342660SmarkmAdd @var{entry} to the index of data types.  @xref{Index Entries, ,
1771442660SmarkmDefining the Entries of an Index}.@refill
1771542660Smarkm
1771642660Smarkm@item @@title @var{title}
1771742660SmarkmIn a printed manual, set a title flush to the left-hand side of the
1771842660Smarkmpage in a larger than normal font and underline it with a black rule.
1771942660SmarkmNot relevant to Info, which does not have title pages.  @xref{title
1772042660Smarkmsubtitle author, , The @code{@@title} @code{@@subtitle} and
1772142660Smarkm@code{@@author} Commands}.@refill
1772242660Smarkm
1772342660Smarkm@item @@titlefont@{@var{text}@}
1772442660SmarkmIn a printed manual, print @var{text} in a larger than normal font.
1772542660SmarkmNot relevant to Info, which does not have title pages.
1772642660Smarkm@xref{titlefont center sp, , The @code{@@titlefont} @code{@@center}
1772742660Smarkmand @code{@@sp} Commands}.@refill
1772842660Smarkm
1772942660Smarkm@item @@titlepage
1773042660SmarkmIndicate to Texinfo the beginning of the title page.  Write command on
1773142660Smarkma line of its own.  Pair with @code{@@end titlepage}.  Nothing between
1773242660Smarkm@code{@@titlepage} and @code{@@end titlepage} appears in Info.
1773342660Smarkm@xref{titlepage, , @code{@@titlepage}}.@refill
1773442660Smarkm
1773542660Smarkm@item @@today@{@}
1773642660SmarkmInsert the current date, in `1 Jan 1900' style.  @xref{Custom
1773742660SmarkmHeadings, , How to Make Your Own Headings}.@refill
1773842660Smarkm
1773942660Smarkm@item @@top @var{title}
1774042660SmarkmIn a Texinfo file to be formatted with @code{makeinfo}, identify the
17741100513Srutopmost @code{@@node} in the file, which must be written on the line
1774242660Smarkmimmediately preceding the @code{@@top} command.  Used for
1774342660Smarkm@code{makeinfo}'s node pointer insertion feature.  The title is
1774442660Smarkmunderlined with asterisks.  Both the @code{@@node} line and the @code{@@top}
17745100513Sruline normally should be enclosed by @code{@@ifnottex} and @code{@@end
17746100513Sruifnottex}.  In @TeX{} and @code{texinfo-format-buffer}, the @code{@@top}
1774742660Smarkmcommand is merely a synonym for @code{@@unnumbered}.  @xref{makeinfo
1774842660SmarkmPointer Creation, , Creating Pointers with @code{makeinfo}}.
1774942660Smarkm
1775042660Smarkm@item @@u@{@var{c}@}
1775142660Smarkm@itemx @@ubaraccent@{@var{c}@}
1775242660Smarkm@itemx @@udotaccent@{@var{c}@}
1775342660SmarkmGenerate a breve, underbar, or underdot accent, respectively, over or
1775442660Smarkmunder the character @var{c}, as in @u{o}, @ubaraccent{o},
1775542660Smarkm@udotaccent{o}.  @xref{Inserting Accents}.
1775642660Smarkm
1775742660Smarkm@item @@unnumbered @var{title}
1775842660SmarkmIn a printed manual, begin a chapter that appears without chapter
1775942660Smarkmnumbers of any kind.  The title appears in the table of contents of a
1776042660Smarkmprinted manual.  In Info, the title is underlined with asterisks.
1776142660Smarkm@xref{unnumbered & appendix, , @code{@@unnumbered} and
1776242660Smarkm@code{@@appendix}}.@refill
1776342660Smarkm
1776442660Smarkm@item @@unnumberedsec @var{title}
1776542660SmarkmIn a printed manual, begin a section that appears without section
1776642660Smarkmnumbers of any kind.  The title appears in the table of contents of a
1776742660Smarkmprinted manual.  In Info, the title is underlined with equal signs.
1776842660Smarkm@xref{unnumberedsec appendixsec heading, , Section Commands}.@refill
1776942660Smarkm
1777042660Smarkm@item @@unnumberedsubsec @var{title}
1777142660SmarkmIn a printed manual, begin an unnumbered subsection within a
1777242660Smarkmchapter.  The title appears in the table of contents of a printed
1777342660Smarkmmanual.  In Info, the title is underlined with hyphens.
1777442660Smarkm@xref{unnumberedsubsec appendixsubsec subheading, ,
1777542660Smarkm@code{@@unnumberedsubsec} @code{@@appendixsubsec}
1777642660Smarkm@code{@@subheading}}.@refill
1777742660Smarkm
1777842660Smarkm@item @@unnumberedsubsubsec @var{title}
1777942660SmarkmIn a printed manual, begin an unnumbered subsubsection within a
1778042660Smarkmchapter.  The title appears in the table of contents of a printed
1778142660Smarkmmanual.  In Info, the title is underlined with periods.
1778242660Smarkm@xref{subsubsection, , The `subsub' Commands}.@refill
1778342660Smarkm
1778456160Sru@item @@uref@{@var{url}[, @var{displayed-text}][, @var{replacement}@}
17785146515Sru@itemx @@url@{@var{url}[, @var{displayed-text}][, @var{replacement}@}
1778642660SmarkmDefine a cross reference to an external uniform resource locator for the
17787146515SruWorld Wide Web.  @xref{uref, , @code{@@uref}}.
1778842660Smarkm
1778942660Smarkm@item @@v@{@var{c}@}
1779042660SmarkmGenerate check accent over the character @var{c}, as in @v{o}.
1779142660Smarkm@xref{Inserting Accents}.
1779242660Smarkm
1779342660Smarkm@item @@value@{@var{flag}@}
1779442660SmarkmReplace @var{flag} with the value to which it is set by @code{@@set
1779542660Smarkm@var{flag}}.
1779642660Smarkm@xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill
1779742660Smarkm
1779842660Smarkm@item @@var@{@var{metasyntactic-variable}@}
1779942660SmarkmHighlight a metasyntactic variable, which is something that stands for
1780042660Smarkmanother piece of text.  @xref{var, , Indicating Metasyntactic
1780142660SmarkmVariables}.@refill
1780242660Smarkm
1780393139Sru@item @@verb@{@var{delim} @var{literal} @var{delim}@}
1780493139SruOutput @var{literal}, delimited by the single character @var{delim},
1780593139Sruexactly as is (in the fixed-width font), including any whitespace or
1780693139SruTexinfo special characters.  @xref{verb,,@code{verb}}.
1780793139Sru
1780893139Sru@item @@verbatim
1780993139SruOutput the text of the environment exactly as is (in the fixed-width
1781093139Srufont).  Pair with @code{@@end verbatim}.  @xref{verbatim,,@code{verbatim}}.
1781193139Sru
1781293139Sru@item @@verbatiminclude @var{filename}
1781393139SruOutput the contents of @var{filename} exactly as is (in the fixed-width font).
1781493139Sru@xref{verbatiminclude,,@code{verbatiminclude}}.
1781593139Sru
1781642660Smarkm@item @@vindex @var{entry}
1781742660SmarkmAdd @var{entry} to the index of variables.  @xref{Index Entries, ,
1781842660SmarkmDefining the Entries of an Index}.@refill
1781942660Smarkm
1782042660Smarkm@item @@vskip @var{amount}
1782142660SmarkmIn a printed manual, insert whitespace so as to push text on the
1782242660Smarkmremainder of the page towards the bottom of the page.  Used in
1782342660Smarkmformatting the copyright page with the argument @samp{0pt plus
1782442660Smarkm1filll}.  (Note spelling of @samp{filll}.)  @code{@@vskip} may be used
17825100513Sruonly in contexts ignored for Info.  @xref{Copyright}.
1782642660Smarkm
1782742660Smarkm@item @@vtable @var{formatting-command}
1782842660SmarkmBegin a two-column table, using @code{@@item} for each entry.
1782942660SmarkmAutomatically enter each of the items in the first column into the
1783042660Smarkmindex of variables.  Pair with @code{@@end vtable}.  The same as
1783142660Smarkm@code{@@table}, except for indexing.  @xref{ftable vtable, ,
1783242660Smarkm@code{@@ftable} and @code{@@vtable}}.@refill
1783342660Smarkm
1783442660Smarkm@item @@w@{@var{text}@}
17835146515SruPrevent @var{text} from being split across two lines.
1783642660Smarkm@xref{w, , @code{@@w}}.@refill
1783742660Smarkm
17838146515Sru@item @@xml
17839146515SruEnter XML completely.  Pair with @code{@@end xml}.  @xref{Raw
17840146515SruFormatter Commands}.
17841146515Sru
1784242660Smarkm@item @@xref@{@var{node-name}, [@var{entry}], [@var{topic-or-title}], [@var{info-file}], [@var{manual}]@}
1784342660SmarkmMake a reference that starts with `See' in a printed manual.  Follow
1784442660Smarkmcommand with a punctuation mark.  Only the first argument is
1784542660Smarkmmandatory.  @xref{xref, , @code{@@xref}}.@refill
1784642660Smarkm@end table
1784742660Smarkm
1784842660Smarkm
17849146515Sru@node Command Syntax
17850146515Sru@section @@-Command Syntax
17851146515Sru@cindex @@-command syntax
17852146515Sru@cindex Syntax, of @@-commands
17853146515Sru@cindex Command syntax
17854146515Sru
17855146515SruThe character @samp{@@} is used to start special Texinfo commands.
17856146515Sru(It has the same meaning that @samp{\} has in plain @TeX{}.)  Texinfo
17857146515Sruhas four types of @@-command:@refill
17858146515Sru
17859146515Sru@table @asis
17860146515Sru@item 1. Non-alphabetic commands.
17861146515SruThese commands consist of an @@ followed by a punctuation mark or other
17862146515Srucharacter that is not part of the alphabet.  Non-alphabetic commands are
17863146515Srualmost always part of the text within a paragraph, and never take any
17864146515Sruargument.  The two characters (@@ and the other one) are complete in
17865146515Sruthemselves; none is followed by braces.  The non-alphabetic commands
17866146515Sruare: @code{@@.}, @code{@@:}, @code{@@*}, @code{@@@kbd{SPACE}},
17867146515Sru@code{@@@kbd{TAB}}, @code{@@@kbd{NL}}, @code{@@@@}, @code{@@@{}, and
17868146515Sru@code{@@@}}.@refill
17869146515Sru
17870146515Sru@item 2. Alphabetic commands that do not require arguments.
17871146515SruThese commands start with @@ followed by a word followed by left- and
17872146515Sruright-hand braces.  These commands insert special symbols in the
17873146515Srudocument; they do not require arguments.  For example,
17874146515Sru@code{@@dots@{@}} @result{} @samp{@dots{}}, @code{@@equiv@{@}}
17875146515Sru@result{} @samp{@equiv{}}, @code{@@TeX@{@}} @result{} `@TeX{}',
17876146515Sruand @code{@@bullet@{@}} @result{} @samp{@bullet{}}.@refill
17877146515Sru
17878146515Sru@item 3. Alphabetic commands that require arguments within braces.
17879146515SruThese commands start with @@ followed by a letter or a word, followed by an
17880146515Sruargument within braces.  For example, the command @code{@@dfn} indicates
17881146515Sruthe introductory or defining use of a term; it is used as follows: @samp{In
17882146515SruTexinfo, @@@@-commands are @@dfn@{mark-up@} commands.}@refill
17883146515Sru
17884146515Sru@item 4. Alphabetic commands that occupy an entire line.
17885146515SruThese commands occupy an entire line.  The line starts with @@,
17886146515Srufollowed by the name of the command (a word); for example, @code{@@center}
17887146515Sruor @code{@@cindex}.  If no argument is needed, the word is followed by
17888146515Sruthe end of the line.  If there is an argument, it is separated from
17889146515Sruthe command name by a space.  Braces are not used.@refill
17890146515Sru@end table
17891146515Sru
17892146515Sru@cindex Braces and argument syntax
17893146515SruThus, the alphabetic commands fall into classes that have
17894146515Srudifferent argument syntaxes.  You cannot tell to which class a command
17895146515Srubelongs by the appearance of its name, but you can tell by the
17896146515Srucommand's meaning: if the command stands for a glyph, it is in
17897146515Sruclass 2 and does not require an argument; if it makes sense to use the
17898146515Srucommand together with other text as part of a paragraph, the command
17899146515Sruis in class 3 and must be followed by an argument in braces;
17900146515Sruotherwise, it is in class 4 and uses the rest of the line as its
17901146515Sruargument.@refill
17902146515Sru
17903146515SruThe purpose of having a different syntax for commands of classes 3 and
17904146515Sru4 is to make Texinfo files easier to read, and also to help the GNU
17905146515SruEmacs paragraph and filling commands work properly.  There is only one
17906146515Sruexception to this rule: the command @code{@@refill}, which is always
17907146515Sruused at the end of a paragraph immediately following the final period
17908146515Sruor other punctuation character.  @code{@@refill} takes no argument and
17909146515Srudoes @emph{not} require braces.  @code{@@refill} never confuses the
17910146515SruEmacs paragraph commands because it cannot appear at the beginning of
17911146515Srua line.  It is also no longer needed, since all formatters now refill
17912146515Sruparagraphs automatically.
17913146515Sru
17914146515Sru
1791556160Sru@node Tips
1791642660Smarkm@appendix Tips and Hints
1791742660Smarkm
1791842660SmarkmHere are some tips for writing Texinfo documentation:@refill
1791942660Smarkm
1792042660Smarkm@cindex Tips
1792142660Smarkm@cindex Usage tips
1792242660Smarkm@cindex Hints
1792342660Smarkm@itemize @bullet
1792442660Smarkm@item
1792542660SmarkmWrite in the present tense, not in the past or the future.
1792642660Smarkm
1792742660Smarkm@item
1792842660SmarkmWrite actively!  For example, write ``We recommend that @dots{}'' rather
1792942660Smarkmthan ``It is recommended that @dots{}''.
1793042660Smarkm
1793142660Smarkm@item
1793242660SmarkmUse 70 or 72 as your fill column.  Longer lines are hard to read.
1793342660Smarkm
1793442660Smarkm@item
1793542660SmarkmInclude a copyright notice and copying permissions.
1793642660Smarkm@end itemize
1793742660Smarkm
1793842660Smarkm@subsubheading Index, Index, Index!
1793942660Smarkm
1794042660SmarkmWrite many index entries, in different ways.
1794142660SmarkmReaders like indices; they are helpful and convenient.
1794242660Smarkm
1794342660SmarkmAlthough it is easiest to write index entries as you write the body of
1794442660Smarkmthe text, some people prefer to write entries afterwards.  In either
1794542660Smarkmcase, write an entry before the paragraph to which it applies.  This
1794642660Smarkmway, an index entry points to the first page of a paragraph that is
1794742660Smarkmsplit across pages.
1794842660Smarkm
1794942660SmarkmHere are more hints we have found valuable:
1795042660Smarkm
1795142660Smarkm@itemize @bullet
1795242660Smarkm@item
1795342660SmarkmWrite each index entry differently, so each entry refers to a different
1795442660Smarkmplace in the document.
1795542660Smarkm
1795642660Smarkm@item
1795742660SmarkmWrite index entries only where a topic is discussed significantly.  For
1795842660Smarkmexample, it is not useful to index ``debugging information'' in a
1795942660Smarkmchapter on reporting bugs.  Someone who wants to know about debugging
1796042660Smarkminformation will certainly not find it in that chapter.
1796142660Smarkm
1796242660Smarkm@item
1796342660SmarkmConsistently capitalize the first word of every concept index entry,
1796442660Smarkmor else consistently use lower case.  Terse entries often call for
1796542660Smarkmlower case; longer entries for capitalization.  Whichever case
1796642660Smarkmconvention you use, please use one or the other consistently!  Mixing
1796742660Smarkmthe two styles looks bad.
1796842660Smarkm
1796942660Smarkm@item
1797042660SmarkmAlways capitalize or use upper case for those words in an index for
1797142660Smarkmwhich this is proper, such as names of countries or acronyms.  Always
1797242660Smarkmuse the appropriate case for case-sensitive names, such as those in C or
1797342660SmarkmLisp.
1797442660Smarkm
1797542660Smarkm@item
1797642660SmarkmWrite the indexing commands that refer to a whole section immediately
1797742660Smarkmafter the section command, and write the indexing commands that refer to
1797856160Srua paragraph before that paragraph.
1797942660Smarkm
1798042660SmarkmIn the example that follows, a blank line comes after the index
1798142660Smarkmentry for ``Leaping'':
1798242660Smarkm
1798342660Smarkm@example
1798442660Smarkm@group
1798542660Smarkm@@section The Dog and the Fox
1798642660Smarkm@@cindex Jumping, in general
1798742660Smarkm@@cindex Leaping
1798842660Smarkm
1798942660Smarkm@@cindex Dog, lazy, jumped over
1799042660Smarkm@@cindex Lazy dog jumped over
1799142660Smarkm@@cindex Fox, jumps over dog
1799242660Smarkm@@cindex Quick fox jumps over dog
1799342660SmarkmThe quick brown fox jumps over the lazy dog.
1799442660Smarkm@end group
1799542660Smarkm@end example
1799642660Smarkm
1799742660Smarkm@noindent
1799842660Smarkm(Note that the example shows entries for the same concept that are
1799942660Smarkmwritten in different ways---@samp{Lazy dog}, and @samp{Dog, lazy}---so
1800042660Smarkmreaders can look up the concept in different ways.)
1800142660Smarkm@end itemize
1800242660Smarkm
1800342660Smarkm@subsubheading Blank Lines
1800442660Smarkm
1800542660Smarkm@itemize @bullet
1800642660Smarkm@item
1800742660SmarkmInsert a blank line between a sectioning command and the first following
1800842660Smarkmsentence or paragraph, or between the indexing commands associated with
1800942660Smarkmthe sectioning command and the first following sentence or paragraph, as
1801042660Smarkmshown in the tip on indexing.  Otherwise, a formatter may fold title and
1801142660Smarkmparagraph together.
1801242660Smarkm
1801342660Smarkm@item
1801442660SmarkmAlways insert a blank line before an @code{@@table} command and after an
1801542660Smarkm@code{@@end table} command; but never insert a blank line after an
1801642660Smarkm@code{@@table} command or before an @code{@@end table} command.
1801742660Smarkm
1801842660Smarkm@need 1000
1801942660SmarkmFor example,
1802042660Smarkm
1802142660Smarkm@example
1802242660Smarkm@group
1802342660SmarkmTypes of fox:
1802442660Smarkm
1802542660Smarkm@@table @@samp
1802642660Smarkm@@item Quick
1802742660SmarkmJump over lazy dogs.
1802842660Smarkm@end group
1802942660Smarkm
1803042660Smarkm@group
1803142660Smarkm@@item Brown
1803242660SmarkmAlso jump over lazy dogs.
1803342660Smarkm@@end table
1803442660Smarkm
1803542660Smarkm@end group
1803642660Smarkm@group
1803742660Smarkm@@noindent
1803842660SmarkmOn the other hand, @dots{}
1803942660Smarkm@end group
1804042660Smarkm@end example
1804142660Smarkm
1804242660SmarkmInsert blank lines before and after @code{@@itemize} @dots{} @code{@@end
1804342660Smarkmitemize} and @code{@@enumerate} @dots{} @code{@@end enumerate} in the
1804442660Smarkmsame way.
1804542660Smarkm@end itemize
1804642660Smarkm
1804742660Smarkm@subsubheading Complete Phrases
1804842660Smarkm
1804942660SmarkmComplete phrases are easier to read than @dots{}
1805042660Smarkm
1805142660Smarkm@itemize @bullet
1805242660Smarkm@item
1805342660SmarkmWrite entries in an itemized list as complete sentences; or at least, as
1805442660Smarkmcomplete phrases.  Incomplete expressions @dots{} awkward @dots{} like
1805542660Smarkmthis.
1805642660Smarkm
1805742660Smarkm@item
1805842660SmarkmWrite the prefatory sentence or phrase for a multi-item list or table as
1805942660Smarkma complete expression.  Do not write ``You can set:''; instead, write
1806042660Smarkm``You can set these variables:''.  The former expression sounds cut off.
1806142660Smarkm@end itemize
1806242660Smarkm
1806342660Smarkm@subsubheading Editions, Dates and Versions
1806442660Smarkm
18065100513SruInclude edition numbers, version numbers, and dates in the
18066100513Sru@code{@@copying} text (for people reading the Texinfo file, and for the
18067100513Srulegal copyright in the output files).  Then use @code{@@insertcopying}
18068100513Sruin the @code{@@titlepage} section (for people reading the printed
18069100513Sruoutput) and the Top node (for people reading the online output).
1807042660Smarkm
18071100513SruIt is easiest to do this using @code{@@set} and @code{@@value}.
18072100513Sru@xref{value Example, , @code{@@value} Example}, and @ref{GNU Sample Texts}.
1807342660Smarkm
1807442660Smarkm
1807542660Smarkm@subsubheading Definition Commands
1807642660Smarkm
1807742660SmarkmDefinition commands are @code{@@deffn}, @code{@@defun},
1807842660Smarkm@code{@@defmac}, and the like, and enable you to write descriptions in
1807942660Smarkma uniform format.@refill
1808042660Smarkm
1808142660Smarkm@itemize @bullet
1808242660Smarkm@item
1808342660SmarkmWrite just one definition command for each entity you define with a
1808442660Smarkmdefinition command.  The automatic indexing feature creates an index
1808542660Smarkmentry that leads the reader to the definition.
1808642660Smarkm
1808742660Smarkm@item
1808842660SmarkmUse @code{@@table} @dots{} @code{@@end table} in an appendix that
1808942660Smarkmcontains a summary of functions, not @code{@@deffn} or other definition
1809042660Smarkmcommands.
1809142660Smarkm@end itemize
1809242660Smarkm
1809342660Smarkm@subsubheading Capitalization
1809442660Smarkm
1809542660Smarkm@itemize @bullet
1809642660Smarkm@item
1809742660SmarkmCapitalize ``Texinfo''; it is a name.  Do not write the @samp{x} or
1809842660Smarkm@samp{i} in upper case.
1809942660Smarkm
1810042660Smarkm@item
1810142660SmarkmCapitalize ``Info''; it is a name.
1810242660Smarkm
1810342660Smarkm@item
1810442660SmarkmWrite @TeX{} using the @code{@@TeX@{@}} command.  Note the uppercase
1810542660Smarkm@samp{T} and @samp{X}.  This command causes the formatters to
1810642660Smarkmtypeset the name according to the wishes of Donald Knuth, who wrote
1810742660Smarkm@TeX{}.
1810842660Smarkm@end itemize
1810942660Smarkm
1811042660Smarkm@subsubheading Spaces
1811142660Smarkm
1811242660SmarkmDo not use spaces to format a Texinfo file, except inside of
18113146515Sru@code{@@example} @dots{} @code{@@end example} and other literal
18114146515Sruenvironments and commands.
1811542660Smarkm
1811642660Smarkm@need 700
1811742660SmarkmFor example, @TeX{} fills the following:
1811842660Smarkm
1811942660Smarkm@example
1812042660Smarkm@group
18121114472Sru   @@kbd@{C-x v@}
18122114472Sru   @@kbd@{M-x vc-next-action@}
18123114472Sru      Perform the next logical operation
18124114472Sru      on the version-controlled file
18125114472Sru      corresponding to the current buffer.
1812642660Smarkm@end group
1812742660Smarkm@end example
1812842660Smarkm
1812942660Smarkm@need 950
1813042660Smarkm@noindent
1813142660Smarkmso it looks like this:
1813242660Smarkm
1813342660Smarkm@iftex
1813442660Smarkm@quotation
18135114472Sru   @kbd{C-x v}
18136114472Sru   @kbd{M-x vc-next-action}
18137114472Sru      Perform the next logical operation on the version-controlled file
18138114472Sru      corresponding to the current buffer.
1813942660Smarkm@end quotation
1814042660Smarkm@end iftex
18141146515Sru@ifnottex
1814242660Smarkm@quotation
1814342660Smarkm`C-x v' `M-x vc-next-action' Perform the next logical operation on the
1814442660Smarkmversion-controlled file corresponding to the current buffer.
1814542660Smarkm@end quotation
18146146515Sru@end ifnottex
1814742660Smarkm
1814842660Smarkm@noindent
1814942660SmarkmIn this case, the text should be formatted with
1815042660Smarkm@code{@@table}, @code{@@item}, and @code{@@itemx}, to create a table.
1815142660Smarkm
18152146515Sru
1815342660Smarkm@subsubheading @@code, @@samp, @@var, and @samp{---}
1815442660Smarkm
1815542660Smarkm@itemize @bullet
1815642660Smarkm@item
1815742660SmarkmUse @code{@@code} around Lisp symbols, including command names.
1815842660SmarkmFor example,
1815942660Smarkm
1816042660Smarkm@example
1816142660SmarkmThe main function is @@code@{vc-next-action@}, @dots{}
1816242660Smarkm@end example
1816342660Smarkm
1816442660Smarkm@item
1816542660SmarkmAvoid putting letters such as @samp{s} immediately after an
1816642660Smarkm@samp{@@code}.  Such letters look bad.
1816742660Smarkm
1816842660Smarkm@item
1816942660SmarkmUse @code{@@var} around meta-variables.  Do not write angle brackets
1817042660Smarkmaround them.
1817142660Smarkm
1817242660Smarkm@item
1817342660SmarkmUse three hyphens in a row, @samp{---}, to indicate a long dash.  @TeX{}
1817442660Smarkmtypesets these as a long dash and the Info formatters reduce three
1817542660Smarkmhyphens to two.
1817642660Smarkm@end itemize
1817742660Smarkm
1817842660Smarkm@subsubheading Periods Outside of Quotes
1817942660Smarkm
1818042660SmarkmPlace periods and other punctuation marks @emph{outside} of quotations,
1818142660Smarkmunless the punctuation is part of the quotation.  This practice goes
1818242660Smarkmagainst publishing conventions in the United States, but enables the
1818342660Smarkmreader to distinguish between the contents of the quotation and the
1818442660Smarkmwhole passage.
1818542660Smarkm
1818642660SmarkmFor example, you should write the following sentence with the period
1818742660Smarkmoutside the end quotation marks:
1818842660Smarkm
1818942660Smarkm@example
1819042660SmarkmEvidently, @samp{au} is an abbreviation for ``author''.
1819142660Smarkm@end example
1819242660Smarkm
1819342660Smarkm@noindent
1819442660Smarkmsince @samp{au} does @emph{not} serve as an  abbreviation for
1819542660Smarkm@samp{author.} (with a period following the word).
1819642660Smarkm
1819742660Smarkm@subsubheading Introducing New Terms
1819842660Smarkm
1819942660Smarkm@itemize @bullet
1820042660Smarkm@item
1820142660SmarkmIntroduce new terms so that a reader who does not know them can
1820242660Smarkmunderstand them from context; or write a definition for the term.
1820342660Smarkm
1820442660SmarkmFor example, in the following, the terms ``check in'', ``register'' and
1820542660Smarkm``delta'' are all appearing for the first time; the example sentence should be
1820642660Smarkmrewritten so they are understandable.
1820742660Smarkm
1820842660Smarkm@quotation
1820942660SmarkmThe major function assists you in checking in a file to your
1821042660Smarkmversion control system and registering successive sets of changes to
1821142660Smarkmit as deltas.
1821242660Smarkm@end quotation
1821342660Smarkm
1821442660Smarkm@item
1821542660SmarkmUse the @code{@@dfn} command around a word being introduced, to indicate
1821642660Smarkmthat the reader should not expect to know the meaning already, and
1821742660Smarkmshould expect to learn the meaning from this passage.
1821842660Smarkm@end itemize
1821942660Smarkm
1822042660Smarkm@subsubheading @@pxref
1822142660Smarkm
1822242660Smarkm@c !!! maybe include this in the tips on pxref
1822342660Smarkm@ignore
1822442660SmarkmBy the way, it is okay to use pxref with something else in front of
1822542660Smarkmit within the parens, as long as the pxref is followed by the close
1822642660Smarkmparen, and the material inside the parens is not part of a larger
1822742660Smarkmsentence.  Also, you can use xref inside parens as part of a complete
1822842660Smarkmsentence so long as you terminate the cross reference with punctuation.
1822942660Smarkm@end ignore
1823042660SmarkmAbsolutely never use @code{@@pxref} except in the special context for
1823142660Smarkmwhich it is designed: inside parentheses, with the closing parenthesis
1823242660Smarkmfollowing immediately after the closing brace.  One formatter
1823342660Smarkmautomatically inserts closing punctuation and the other does not.  This
1823442660Smarkmmeans that the output looks right both in printed output and in an Info
1823542660Smarkmfile, but only when the command is used inside parentheses.
1823642660Smarkm
1823742660Smarkm@subsubheading Invoking from a Shell
1823842660Smarkm
1823942660SmarkmYou can invoke programs such as Emacs, GCC, and @code{gawk} from a
1824042660Smarkmshell.  The documentation for each program should contain a section that
1824142660Smarkmdescribes this.  Unfortunately, if the node names and titles for these
1824293139Srusections are all different, they are difficult for users to find.
1824342660Smarkm
1824493139SruSo, there is a convention to name such sections with a phrase beginning
1824593139Sruwith the word `Invoking', as in `Invoking Emacs'; this way, users can
1824693139Srufind the section easily.
1824742660Smarkm
1824893139Sru
1824942660Smarkm@subsubheading ANSI C Syntax
1825042660Smarkm
1825142660SmarkmWhen you use @code{@@example} to describe a C function's calling
1825242660Smarkmconventions, use the ANSI C syntax, like this:@refill
1825342660Smarkm
1825442660Smarkm@example
1825542660Smarkmvoid dld_init (char *@@var@{path@});
1825642660Smarkm@end example
1825742660Smarkm
1825842660Smarkm@noindent
1825942660SmarkmAnd in the subsequent discussion, refer to the argument values by
1826042660Smarkmwriting the same argument names, again highlighted with
1826142660Smarkm@code{@@var}.@refill
1826242660Smarkm
1826342660Smarkm@need 800
1826442660SmarkmAvoid the obsolete style that looks like this:@refill
1826542660Smarkm
1826642660Smarkm@example
1826742660Smarkm#include <dld.h>
1826842660Smarkm
1826942660Smarkmdld_init (path)
1827042660Smarkmchar *path;
1827142660Smarkm@end example
1827242660Smarkm
1827342660SmarkmAlso, it is best to avoid writing @code{#include} above the
1827442660Smarkmdeclaration just to indicate that the function is declared in a
1827542660Smarkmheader file.  The practice may give the misimpression that the
1827642660Smarkm@code{#include} belongs near the declaration of the function.  Either
1827742660Smarkmstate explicitly which header file holds the declaration or, better
1827842660Smarkmyet, name the header file used for a group of functions at the
1827942660Smarkmbeginning of the section that describes the functions.@refill
1828042660Smarkm
1828142660Smarkm@subsubheading Bad Examples
1828242660Smarkm
1828342660SmarkmHere are several examples of bad writing to avoid:
1828442660Smarkm
1828542660SmarkmIn this example, say, `` @dots{} you must @code{@@dfn}@{check
1828642660Smarkmin@} the new version.''  That flows better.
1828742660Smarkm
1828842660Smarkm@quotation
1828942660SmarkmWhen you are done editing the file, you must perform a
1829042660Smarkm@code{@@dfn}@{check in@}.
1829142660Smarkm@end quotation
1829242660Smarkm
1829342660SmarkmIn the following example, say, ``@dots{} makes a unified interface such as VC
1829442660Smarkmmode possible.''
1829542660Smarkm
1829642660Smarkm@quotation
1829742660SmarkmSCCS, RCS and other version-control systems all perform similar
1829842660Smarkmfunctions in broadly similar ways (it is this resemblance which makes
1829942660Smarkma unified control mode like this possible).
1830042660Smarkm@end quotation
1830142660Smarkm
1830242660SmarkmAnd in this example, you should specify what `it' refers to:
1830342660Smarkm
1830442660Smarkm@quotation
1830542660SmarkmIf you are working with other people, it assists in coordinating
1830642660Smarkmeveryone's changes so they do not step on each other.
1830742660Smarkm@end quotation
1830842660Smarkm
1830942660Smarkm@subsubheading And Finally @dots{}
1831042660Smarkm
1831142660Smarkm@itemize @bullet
1831242660Smarkm@item
1831342660SmarkmPronounce @TeX{} as if the @samp{X} were a Greek `chi', as the last
1831442660Smarkmsound in the name `Bach'.  But pronounce Texinfo as in `speck':
1831542660Smarkm``teckinfo''.
1831642660Smarkm
1831742660Smarkm@item
1831842660SmarkmWrite notes for yourself at the very end of a Texinfo file after the
1831942660Smarkm@code{@@bye}.  None of the formatters process text after the
1832042660Smarkm@code{@@bye}; it is as if the text were within @code{@@ignore} @dots{}
1832142660Smarkm@code{@@end ignore}.
1832242660Smarkm@end itemize
1832342660Smarkm
1832442660Smarkm
18325100513Sru@node Sample Texinfo Files
18326100513Sru@appendix Sample Texinfo Files
18327100513Sru@cindex Sample Texinfo files
18328100513Sru
18329100513SruThe first example is from the first chapter (@pxref{Short Sample}),
18330114472Srugiven here in its entirety, without commentary.  The second
18331100513Sruincludes the full texts to be used in GNU manuals.
18332100513Sru
18333100513Sru@menu
18334116525Sru* Short Sample Texinfo File::
18335116525Sru* GNU Sample Texts::
18336116525Sru* Verbatim Copying License::
18337116525Sru* All-permissive Copying License::
18338100513Sru@end menu
18339100513Sru
18340100513Sru
18341100513Sru@node Short Sample Texinfo File
18342100513Sru@section Short Sample
1834342660Smarkm@cindex Sample Texinfo file, no comments
1834442660Smarkm
1834542660SmarkmHere is a complete, short sample Texinfo file, without any commentary.
18346100513SruYou can see this file, with comments, in the first chapter.  @xref{Short
18347100513SruSample}.
1834842660Smarkm
18349100513SruIn a nutshell: The @command{makeinfo} program transforms a Texinfo
18350100513Srusource file such as this into an Info file or HTML; and @TeX{} typesets
18351100513Sruit for a printed manual.
18352100513Sru
18353100513Sru
1835442660Smarkm@sp 1
1835542660Smarkm@example
1835642660Smarkm\input texinfo   @@c -*-texinfo-*-
1835742660Smarkm@@c %**start of header
1835842660Smarkm@@setfilename sample.info
18359100513Sru@@settitle Sample Manual 1.0
1836042660Smarkm@@c %**end of header
1836142660Smarkm
18362100513Sru@@copying
1836342660SmarkmThis is a short example of a complete Texinfo file.
1836442660Smarkm
18365146515SruCopyright (C) 2004 Free Software Foundation, Inc.
18366100513Sru@@end copying
1836742660Smarkm
1836842660Smarkm@@titlepage
1836993139Sru@@title Sample Title
1837042660Smarkm@@page
1837142660Smarkm@@vskip 0pt plus 1filll
18372100513Sru@@insertcopying
1837342660Smarkm@@end titlepage
1837442660Smarkm
1837593139Sru@@c Output the table of the contents at the beginning.
1837693139Sru@@contents
1837742660Smarkm
1837893139Sru@@ifnottex
1837993139Sru@@node Top
18380114472Sru@@top GNU Sample
1838193139Sru
18382100513Sru@@insertcopying
1838393139Sru@@end ifnottex
1838493139Sru
1838542660Smarkm@@menu
1838642660Smarkm* First Chapter::    The first chapter is the
18387114472Sru                      only chapter in this sample.
18388100513Sru* Index::            Complete index.
1838942660Smarkm@@end menu
1839042660Smarkm
1839193139Sru
18392100513Sru@@node First Chapter
1839342660Smarkm@@chapter First Chapter
1839442660Smarkm
18395100513Sru@@cindex chapter, first
1839642660Smarkm
18397100513SruThis is the first chapter.
18398100513Sru@@cindex index entry, another
18399100513Sru
1840042660SmarkmHere is a numbered list.
1840142660Smarkm
1840242660Smarkm@@enumerate
1840342660Smarkm@@item
1840442660SmarkmThis is the first item.
1840542660Smarkm
1840642660Smarkm@@item
1840742660SmarkmThis is the second item.
1840842660Smarkm@@end enumerate
1840942660Smarkm
1841042660Smarkm
18411100513Sru@@node Index
18412100513Sru@@unnumbered Index
1841393139Sru
18414100513Sru@@printindex cp
1841542660Smarkm
18416100513Sru@@bye
18417100513Sru@end example
18418100513Sru
18419100513Sru
18420100513Sru@node GNU Sample Texts
18421100513Sru@section GNU Sample Texts
18422100513Sru
18423100513Sru@cindex GNU sample texts
18424100513Sru@cindex Sample texts, GNU
18425100513Sru@cindex Full texts, GNU
18426100513Sru
18427114472SruFollowing is a sample Texinfo document with the full texts that should
18428114472Srube used in GNU manuals.
18429100513Sru
18430100513SruAs well as the legal texts, it also serves as a practical example of how
18431100513Srumany elements in a GNU system can affect the manual.  If you're not
18432100513Srufamiliar with all these different elements, don't worry.  They're not
18433100513Srurequired and a perfectly good manual can be written without them.
18434100513SruThey're included here nonetheless because many manuals do (or could)
18435100513Srubenefit from them.
18436100513Sru
18437100513Sru@xref{Short Sample}, for a minimal example of a Texinfo file.
18438100513Sru@xref{Beginning a File}, for a full explanation of that minimal
18439100513Sruexample.
18440100513Sru
18441100513SruHere are some notes on the example:
18442100513Sru
18443100513Sru@itemize @bullet
18444100513Sru@item
18445146515Sru@cindex $Id
18446146515Sru@cindex CVS $Id
18447146515Sru@cindex RCS $Id
18448114472Sru@cindex Documentation identification
18449114472Sru@cindex Identification of documentation
18450114472SruThe @samp{$Id:} comment is for the CVS (@pxref{Top,, Overview, cvs,
18451100513SruConcurrent Versions System}) or RCS (see rcsintro(1)) version control
18452100513Srusystems, which expand it into a string such as:
18453100513Sru@example
18454146515Sru$Id: texinfo.txi,v 1.128 2004/12/29 15:06:41 karl Exp $
18455100513Sru@end example
18456100513Sru(This is useful in all sources that use version control, not just manuals.)
18457114472SruYou may wish to include the @samp{$Id:} comment in the @code{@@copying}
18458114472Srutext, if you want a completely unambiguous reference to the
18459114472Srudocumentation version.
18460100513Sru
18461146515SruIf you want to literally write @t{@w{$}Id$}, use @code{@@w}:
18462146515Sru@code{@@w@{$@}Id$}.
18463146515Sru
18464100513Sru@item
18465100513Sru@pindex automake@r{, and version info}
18466114472Sru@vindex UPDATED @r{Automake variable}
18467114472Sru@vindex VERSION @r{Automake variable}
18468114472Sru@pindex time-stamp.el
18469100513SruThe @file{version.texi} in the @code{@@include} command is maintained
18470100513Sruautomatically by Automake (@pxref{Top,, Introduction, automake, GNU
18471100513SruAutomake}).  It sets the @samp{VERSION} and @samp{UPDATED} values used
18472114472Sruelsewhere.  If your distribution doesn't use Automake, but you do use
18473114472SruEmacs, you may find the time-stamp.el package helpful (@pxref{Time
18474114472SruStamps,,,emacs,The GNU Emacs Manual}).
18475100513Sru
18476100513Sru@item
18477114472SruThe @code{@@syncodeindex} command reflects the recommendation to use
18478114472Sruonly one index where possible, to make it easier for readers to look up
18479114472Sruindex entries.
18480100513Sru
18481100513Sru@item
18482100513SruThe @code{@@dircategory} is for constructing the Info directory.
18483100513Sru@xref{Installing Dir Entries}, which includes a variety of recommended
18484100513Srucategory names.
18485100513Sru
18486100513Sru@item
18487100513SruThe `Invoking' node is a GNU standard to help users find the basic
18488100513Sruinformation about command-line usage of a given program.  @xref{Manual
18489100513SruStructure Details,,,standards, GNU Coding Standards}.
18490100513Sru
18491100513Sru@item
18492114472Sru@cindex GNU Free Documentation License, including entire
18493114472Sru@cindex Free Documentation License, including entire
18494100513SruIt is best to include the entire GNU Free Documentation License in a GNU
18495100513Srumanual, unless the manual is only a few pages long.  Of course this
18496100513Srusample is even shorter than that, but it includes the FDL anyway in
18497114472Sruorder to show one conventional way to do so.  The @file{fdl.texi} file
18498114472Sruis available on the GNU machines and in the Texinfo and other GNU
18499114472Srusource distributions.
18500100513Sru
18501100513SruThe FDL provides for omitting itself under certain conditions, but in
18502100513Sruthat case the sample texts given here have to be modified.  @xref{GNU
18503100513SruFree Documentation License}.
18504100513Sru
18505100513Sru@item
18506100513SruIf your manual has invariant sections (again, see the license itself for
18507114472Srudetails), then don't forget to change the text here accordingly.
18508114472Sru
18509114472Sru@item
18510114472SruFor documents that express your personal views, feelings or experiences,
18511114472Sruit is more appropriate to use a license permitting only verbatim
18512114472Srucopying, rather than the FDL.  @xref{Verbatim Copying License}.
18513114472Sru
18514100513Sru@end itemize
18515100513Sru
18516100513SruHere is the sample document:
18517100513Sru
18518114472Sru@verbatim
18519114472Sru\input texinfo   @c -*-texinfo-*-
18520146515Sru@comment $Id: texinfo.txi,v 1.128 2004/12/29 15:06:41 karl Exp $
18521114472Sru@comment %**start of header
18522114472Sru@setfilename sample.info
18523114472Sru@include version.texi
18524114472Sru@settitle GNU Sample @value{VERSION}
18525114472Sru@syncodeindex pg cp
18526114472Sru@comment %**end of header
18527114472Sru@copying
18528100513SruThis manual is for GNU Sample
18529114472Sru(version @value{VERSION}, @value{UPDATED}),
18530100513Sruwhich is an example in the Texinfo documentation.
18531100513Sru
18532146515SruCopyright @copyright{} 2004 Free Software Foundation, Inc.
18533100513Sru
18534114472Sru@quotation
18535100513SruPermission is granted to copy, distribute and/or modify this document
18536100513Sruunder the terms of the GNU Free Documentation License, Version 1.1 or
18537100513Sruany later version published by the Free Software Foundation; with no
18538114472SruInvariant Sections, with the Front-Cover Texts being ``A GNU Manual,''
18539100513Sruand with the Back-Cover Texts as in (a) below.  A copy of the
18540100513Srulicense is included in the section entitled ``GNU Free Documentation
18541100513SruLicense.''
18542100513Sru
18543100513Sru(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
18544100513Sruthis GNU Manual, like GNU software.  Copies published by the Free
18545100513SruSoftware Foundation raise funds for GNU development.''
18546114472Sru@end quotation
18547114472Sru@end copying
18548100513Sru
18549114472Sru@dircategory Texinfo documentation system
18550114472Sru@direntry
18551116525Sru* sample: (sample)Invoking sample.
18552114472Sru@end direntry
18553100513Sru
18554114472Sru@titlepage
18555114472Sru@title GNU Sample
18556114472Sru@subtitle for version @value{VERSION}, @value{UPDATED}
18557114472Sru@author A.U. Thor (@email{bug-texinfo@@gnu.org})
18558114472Sru@page
18559114472Sru@vskip 0pt plus 1filll
18560114472Sru@insertcopying
18561114472Sru@end titlepage
18562100513Sru
18563114472Sru@contents
18564100513Sru
18565114472Sru@ifnottex
18566114472Sru@node Top
18567114472Sru@top GNU Sample
18568100513Sru
18569114472Sru@insertcopying
18570114472Sru@end ifnottex
18571100513Sru
18572114472Sru@menu
18573100513Sru* Invoking sample::
18574100513Sru* Copying This Manual::
18575100513Sru* Index::
18576114472Sru@end menu
18577100513Sru
18578100513Sru
18579114472Sru@node Invoking sample
18580114472Sru@chapter Invoking sample
18581100513Sru
18582114472Sru@pindex sample
18583114472Sru@cindex invoking @command{sample}
18584100513Sru
18585100513SruThis is a sample manual.  There is no sample program to
18586100513Sruinvoke, but if there was, you could see its basic usage
18587100513Sruand command line options here.
18588100513Sru
18589100513Sru
18590114472Sru@node Copying This Manual
18591114472Sru@appendix Copying This Manual
18592100513Sru
18593114472Sru@menu
18594100513Sru* GNU Free Documentation License::  License for copying this manual.
18595114472Sru@end menu
18596100513Sru
18597114472Sru@include fdl.texi
18598100513Sru
18599100513Sru
18600114472Sru@node Index
18601114472Sru@unnumbered Index
18602100513Sru
18603114472Sru@printindex cp
1860442660Smarkm
18605114472Sru@bye
18606114472Sru@end verbatim
18607114472Sru
18608114472Sru
18609114472Sru@node Verbatim Copying License
18610114472Sru@section Verbatim Copying License
18611114472Sru
18612114472Sru@cindex Verbatim copying license
18613114472Sru@cindex License for verbatim copying
18614114472Sru
18615114472SruFor software manuals and other documentation, it is important to use a
18616114472Srulicense permitting free redistribution and updating, so that when a free
18617114472Sruprogram is changed, the documentation can be updated as well.
18618114472Sru
18619114472SruOn the other hand, for documents that express your personal views,
18620114472Srufeelings or experiences, it is more appropriate to use a license
18621114472Srupermitting only verbatim copying.
18622114472Sru
18623114472SruHere is sample text for such a license permitting verbatim copying only.
18624114472SruThis is just the license text itself.  For a complete sample document,
18625114472Srusee the previous sections.
18626114472Sru
18627114472Sru@verbatim
18628114472Sru@copying
18629114472SruThis document is a sample for allowing verbatim copying only.
18630114472Sru
18631146515SruCopyright @copyright{} 2004 Free Software Foundation, Inc.
18632114472Sru
18633114472Sru@quotation
18634114472SruPermission is granted to make and distribute verbatim copies
18635114472Sruof this entire document without royalty provided the
18636114472Srucopyright notice and this permission notice are preserved.
18637114472Sru@end quotation
18638114472Sru@end copying
18639114472Sru@end verbatim
18640114472Sru
18641114472Sru
18642114472Sru@node All-permissive Copying License
18643114472Sru@section All-permissive Copying License
18644114472Sru
18645114472Sru@cindex All-permissive copying license
18646114472Sru@cindex License for all-permissive copying
18647114472Sru
18648114472SruFor software manuals and other documentation, it is important to use a
18649114472Srulicense permitting free redistribution and updating, so that when a free
18650114472Sruprogram is changed, the documentation can be updated as well.
18651114472Sru
18652114472SruOn the other hand, for small supporting files, short manuals (under 300
18653114472Srulines long) and rough documentation (README files, INSTALL files, etc.),
18654114472Sruthe full FDL would be overkill.  They can use a simple all-permissive
18655114472Srulicense.
18656114472Sru
18657114472SruHere is sample text for such an all-permissive license.  This is just
18658114472Sruthe license text itself.  For a complete sample document, see the
18659114472Sruprevious sections.
18660114472Sru
18661114472Sru@example
18662146515SruCopyright @copyright{} 2004 Free Software Foundation, Inc.
18663114472Sru
18664114472SruCopying and distribution of this file, with or without modification,
18665114472Sruare permitted in any medium without royalty provided the copyright
18666114472Srunotice and this notice are preserved.
1866742660Smarkm@end example
1866842660Smarkm
1866942660Smarkm
1867056160Sru@node Include Files
1867142660Smarkm@appendix Include Files
1867242660Smarkm@cindex Include files
1867342660Smarkm
1867442660SmarkmWhen @TeX{} or an Info formatting command sees an @code{@@include}
1867542660Smarkmcommand in a Texinfo file, it processes the contents of the file named
1867642660Smarkmby the command and incorporates them into the DVI or Info file being
1867742660Smarkmcreated.  Index entries from the included file are incorporated into
18678100513Sruthe indices of the output file.
1867942660Smarkm
1868042660SmarkmInclude files let you keep a single large document as a collection of
1868193139Sruconveniently small parts.
1868242660Smarkm
1868342660Smarkm@menu
1868442660Smarkm* Using Include Files::         How to use the @code{@@include} command.
1868542660Smarkm* texinfo-multiple-files-update::  How to create and update nodes and
18686146515Sru                                     menus when using included files.
18687146515Sru* Include Files Requirements::  @code{texinfo-multiple-files-update} needs.
1868842660Smarkm* Sample Include File::         A sample outer file with included files
18689146515Sru                                     within it; and a sample included file.
1869042660Smarkm* Include Files Evolution::     How use of the @code{@@include} command
18691146515Sru                                     has changed over time.
1869242660Smarkm@end menu
1869342660Smarkm
18694114472Sru@node Using Include Files
1869556160Sru@section How to Use Include Files
1869642660Smarkm@findex include
1869742660Smarkm
1869842660SmarkmTo include another file within a Texinfo file, write the
1869942660Smarkm@code{@@include} command at the beginning of a line and follow it on
18700114472Sruthe same line by the name of a file to be included.  For example:
1870142660Smarkm
1870242660Smarkm@example
1870342660Smarkm@@include buffers.texi
1870442660Smarkm@end example
1870542660Smarkm
18706114472SruThe name of the file is taken literally, with a single exception:
18707114472Sru@code{@@value@{@var{var}@}} references are expanded.  This makes it
18708114472Srupossible to reliably include files in other directories in a
18709114472Srudistribution.  @xref{verbatiminclude,,@code{@@verbatiminclude}}, for
18710114472Sruan example.
18711114472Sru
1871242660SmarkmAn included file should simply be a segment of text that you expect to
1871342660Smarkmbe included as is into the overall or @dfn{outer} Texinfo file; it
1871442660Smarkmshould not contain the standard beginning and end parts of a Texinfo
1871542660Smarkmfile.  In particular, you should not start an included file with a
1871642660Smarkmline saying @samp{\input texinfo}; if you do, that phrase is inserted
1871742660Smarkminto the output file as is.  Likewise, you should not end an included
1871842660Smarkmfile with an @code{@@bye} command; nothing after @code{@@bye} is
18719114472Sruformatted.
1872042660Smarkm
1872142660SmarkmIn the past, you were required to write an @code{@@setfilename} line at the
1872242660Smarkmbeginning of an included file, but no longer.  Now, it does not matter
1872342660Smarkmwhether you write such a line.  If an @code{@@setfilename} line exists
1872442660Smarkmin an included file, it is ignored.@refill
1872542660Smarkm
1872642660SmarkmConventionally, an included file begins with an @code{@@node} line that
1872742660Smarkmis followed by an @code{@@chapter} line.  Each included file is one
1872842660Smarkmchapter.  This makes it easy to use the regular node and menu creating
1872942660Smarkmand updating commands to create the node pointers and menus within the
1873042660Smarkmincluded file.  However, the simple Emacs node and menu creating and
1873142660Smarkmupdating commands do not work with multiple Texinfo files.  Thus you
1873242660Smarkmcannot use these commands to fill in the `Next', `Previous', and `Up'
1873342660Smarkmpointers of the @code{@@node} line that begins the included file.  Also,
1873442660Smarkmyou cannot use the regular commands to create a master menu for the
1873542660Smarkmwhole file.  Either you must insert the menus and the `Next',
1873642660Smarkm`Previous', and `Up' pointers by hand, or you must use the GNU Emacs
1873742660SmarkmTexinfo mode command, @code{texinfo-multiple-files-update}, that is
1873842660Smarkmdesigned for @code{@@include} files.@refill
1873942660Smarkm
18740146515SruWhen an included file does not have any node lines in it, the
18741146515Srumultiple files update command does not try to create a menu entry
18742146515Srufor it.  Consequently, you can include any file, such as a
18743146515Sruversion or an update file without node lines, not just files that
18744146515Sruare chapters.  Small includable files like this are created by
18745146515SruAutomake (@pxref{GNU Sample Texts}).
18746114472Sru
18747146515Sru
18748114472Sru@node texinfo-multiple-files-update
1874956160Sru@section @code{texinfo-multiple-files-update}
1875042660Smarkm@findex texinfo-multiple-files-update
1875142660Smarkm
1875242660SmarkmGNU Emacs Texinfo mode provides the @code{texinfo-multiple-files-update}
1875342660Smarkmcommand.  This command creates or updates `Next', `Previous', and `Up'
1875442660Smarkmpointers of included files as well as those in the outer or overall
1875542660SmarkmTexinfo file, and it creates or updates a main menu in the outer file.
1875642660SmarkmDepending whether you call it with optional arguments, the command
1875742660Smarkmupdates only the pointers in the first @code{@@node} line of the
1875842660Smarkmincluded files or all of them:@refill
1875942660Smarkm
1876042660Smarkm@table @kbd
1876142660Smarkm@item M-x texinfo-multiple-files-update
1876242660SmarkmCalled without any arguments:@refill
1876342660Smarkm
1876442660Smarkm@itemize @minus
1876542660Smarkm@item
1876642660SmarkmCreate or update the `Next', `Previous', and `Up' pointers of the
1876742660Smarkmfirst @code{@@node} line in each file included in an outer or overall
1876842660SmarkmTexinfo file.@refill
1876942660Smarkm
1877042660Smarkm@item
1877142660SmarkmCreate or update the `Top' level node pointers of the outer or
1877242660Smarkmoverall file.@refill
1877342660Smarkm
1877442660Smarkm@item
1877542660SmarkmCreate or update a main menu in the outer file.@refill
1877642660Smarkm@end itemize
1877742660Smarkm
1877842660Smarkm@item C-u M-x texinfo-multiple-files-update
1877942660SmarkmCalled with @kbd{C-u} as a prefix argument:
1878042660Smarkm
1878142660Smarkm@itemize @minus{}
1878242660Smarkm@item
1878342660SmarkmCreate or update pointers in the first @code{@@node} line in each
1878442660Smarkmincluded file.
1878542660Smarkm
1878642660Smarkm@item
1878742660SmarkmCreate or update the `Top' level node pointers of the outer file.
1878842660Smarkm
1878942660Smarkm@item
1879042660SmarkmCreate and insert a master menu in the outer file.  The master menu
1879142660Smarkmis made from all the menus in all the included files.@refill
1879242660Smarkm@end itemize
1879342660Smarkm
1879442660Smarkm@item C-u 8 M-x texinfo-multiple-files-update
1879542660SmarkmCalled with a numeric prefix argument, such as @kbd{C-u 8}:
1879642660Smarkm
1879742660Smarkm@itemize @minus
1879842660Smarkm@item
1879942660SmarkmCreate or update @strong{all} the `Next', `Previous', and `Up' pointers
1880042660Smarkmof all the included files.@refill
1880142660Smarkm
1880242660Smarkm@item
1880342660SmarkmCreate or update @strong{all} the menus of all the included
1880442660Smarkmfiles.@refill
1880542660Smarkm
1880642660Smarkm@item
1880742660SmarkmCreate or update the `Top' level node pointers of the outer or
1880842660Smarkmoverall file.@refill
1880942660Smarkm
1881042660Smarkm@item
1881142660SmarkmAnd then create a master menu in the outer file.  This is similar to
1881242660Smarkminvoking @code{texinfo-master-menu} with an argument when you are
1881342660Smarkmworking with just one file.@refill
1881442660Smarkm@end itemize
1881542660Smarkm@end table
1881642660Smarkm
1881742660SmarkmNote the use of the prefix argument in interactive use: with a regular
1881842660Smarkmprefix argument, just @w{@kbd{C-u}}, the
1881942660Smarkm@code{texinfo-multiple-files-update} command inserts a master menu;
1882042660Smarkmwith a numeric prefix argument, such as @kbd{C-u 8}, the command
1882142660Smarkmupdates @strong{every} pointer and menu in @strong{all} the files and then inserts a
1882242660Smarkmmaster menu.@refill
1882342660Smarkm
1882493139Sru
18825114472Sru@node Include Files Requirements
18826114472Sru@section Include Files Requirements
18827114472Sru@cindex Include files requirements
1882842660Smarkm@cindex Requirements for include files
1882942660Smarkm
1883042660SmarkmIf you plan to use the @code{texinfo-multiple-files-update} command,
1883142660Smarkmthe outer Texinfo file that lists included files within it should
1883242660Smarkmcontain nothing but the beginning and end parts of a Texinfo file, and
1883342660Smarkma number of @code{@@include} commands listing the included files.  It
1883442660Smarkmshould not even include indices, which should be listed in an included
1883542660Smarkmfile of their own.@refill
1883642660Smarkm
1883742660SmarkmMoreover, each of the included files must contain exactly one highest
1883842660Smarkmlevel node (conventionally, @code{@@chapter} or equivalent),
1883942660Smarkmand this node must be the first node in the included file.
1884042660SmarkmFurthermore, each of these highest level nodes in each included file
1884142660Smarkmmust be at the same hierarchical level in the file structure.
1884242660SmarkmUsually, each is an @code{@@chapter}, an @code{@@appendix}, or an
1884342660Smarkm@code{@@unnumbered} node.  Thus, normally, each included file contains
1884442660Smarkmone, and only one, chapter or equivalent-level node.@refill
1884542660Smarkm
1884642660SmarkmThe outer file should contain only @emph{one} node, the `Top' node.  It
1884742660Smarkmshould @emph{not} contain any nodes besides the single `Top' node.  The
1884842660Smarkm@code{texinfo-multiple-files-update} command will not process
1884942660Smarkmthem.@refill
1885042660Smarkm
18851114472Sru
18852114472Sru@node Sample Include File
1885356160Sru@section Sample File with @code{@@include}
1885442660Smarkm@cindex Sample @code{@@include} file
1885542660Smarkm@cindex Include file sample
1885642660Smarkm@cindex @code{@@include} file sample
1885742660Smarkm
18858114472SruHere is an example of an outer Texinfo file with @code{@@include} files
1885942660Smarkmwithin it before running @code{texinfo-multiple-files-update}, which
18860114472Sruwould insert a main or master menu:
1886142660Smarkm
1886242660Smarkm@example
1886342660Smarkm@group
1886442660Smarkm\input texinfo @@c -*-texinfo-*-
1886542660Smarkm@c %**start of header
18866114472Sru@@setfilename include-example.info
1886742660Smarkm@@settitle Include Example
1886842660Smarkm@c %**end of header
1886942660Smarkm@end group
1887042660Smarkm
18871114472Sru... @xref{Sample Texinfo Files}, for
18872114472Sruexamples of the rest of the frontmatter ...
1887342660Smarkm
1887442660Smarkm@group
18875114472Sru@@ifnottex
18876114472Sru@@node Top
18877116525Sru@@top Include Example
18878114472Sru@@end ifnottex
1887942660Smarkm@end group
1888042660Smarkm
1888142660Smarkm@group
1888242660Smarkm@@include foo.texinfo
1888342660Smarkm@@include bar.texinfo
1888442660Smarkm@@include concept-index.texinfo
1888542660Smarkm@@bye
1888642660Smarkm@end group
1888742660Smarkm@end example
1888842660Smarkm
18889100513SruAn included file, such as @file{foo.texinfo}, might look like this:
1889042660Smarkm
1889142660Smarkm@example
1889242660Smarkm@group
18893114472Sru@@node First
1889442660Smarkm@@chapter First Chapter
1889542660Smarkm
1889642660SmarkmContents of first chapter @dots{}
1889742660Smarkm@end group
1889842660Smarkm@end example
1889942660Smarkm
1890042660SmarkmThe full contents of @file{concept-index.texinfo} might be as simple as this:
1890142660Smarkm
1890242660Smarkm@example
1890342660Smarkm@group
1890456160Sru@@node Concept Index
1890542660Smarkm@@unnumbered Concept Index
1890642660Smarkm
1890742660Smarkm@@printindex cp
1890842660Smarkm@end group
1890942660Smarkm@end example
1891042660Smarkm
1891142660SmarkmThe outer Texinfo source file for @cite{The GNU Emacs Lisp Reference
1891242660SmarkmManual} is named @file{elisp.texi}.  This outer file contains a master
1891342660Smarkmmenu with 417 entries and a list of 41 @code{@@include}
18914114472Srufiles.
1891542660Smarkm
1891693139Sru
1891793139Sru@node Include Files Evolution
1891856160Sru@section Evolution of Include Files
1891942660Smarkm
1892042660SmarkmWhen Info was first created, it was customary to create many small
1892142660SmarkmInfo files on one subject.  Each Info file was formatted from its own
1892242660SmarkmTexinfo source file.  This custom meant that Emacs did not need to
1892342660Smarkmmake a large buffer to hold the whole of a large Info file when
1892442660Smarkmsomeone wanted information; instead, Emacs allocated just enough
1892542660Smarkmmemory for the small Info file that contained the particular
1892642660Smarkminformation sought.  This way, Emacs could avoid wasting memory.@refill
1892742660Smarkm
1892842660SmarkmReferences from one file to another were made by referring to the file
1892942660Smarkmname as well as the node name. (@xref{Other Info Files, , Referring to
1893042660SmarkmOther Info Files}.  Also, see @ref{Four and Five Arguments, ,
1893142660Smarkm@code{@@xref} with Four and Five Arguments}.)@refill
1893242660Smarkm
1893342660SmarkmInclude files were designed primarily as a way to create a single,
1893442660Smarkmlarge printed manual out of several smaller Info files.  In a printed
1893542660Smarkmmanual, all the references were within the same document, so @TeX{}
1893642660Smarkmcould automatically determine the references' page numbers.  The Info
1893742660Smarkmformatting commands used include files only for creating joint
1893842660Smarkmindices; each of the individual Texinfo files had to be formatted for
1893942660SmarkmInfo individually.  (Each, therefore, required its own
1894042660Smarkm@code{@@setfilename} line.)@refill
1894142660Smarkm
1894242660SmarkmHowever, because large Info files are now split automatically, it is
1894342660Smarkmno longer necessary to keep them small.@refill
1894442660Smarkm
1894542660SmarkmNowadays, multiple Texinfo files are used mostly for large documents,
1894642660Smarkmsuch as @cite{The GNU Emacs Lisp Reference Manual}, and for projects
1894742660Smarkmin which several different people write different sections of a
1894842660Smarkmdocument simultaneously.@refill
1894942660Smarkm
1895042660SmarkmIn addition, the Info formatting commands have been extended to work
1895142660Smarkmwith the @code{@@include} command so as to create a single large Info
1895242660Smarkmfile that is split into smaller files if necessary.  This means that
1895342660Smarkmyou can write menus and cross references without naming the different
1895442660SmarkmTexinfo files.@refill
1895542660Smarkm
1895642660Smarkm
1895756160Sru@node Headings
1895842660Smarkm@appendix Page Headings
1895942660Smarkm@cindex Headings
1896042660Smarkm@cindex Footings
1896142660Smarkm@cindex Page numbering
1896242660Smarkm@cindex Page headings
1896342660Smarkm@cindex Formatting headings and footings
1896442660Smarkm
1896542660SmarkmMost printed manuals contain headings along the top of every page
1896642660Smarkmexcept the title and copyright pages.  Some manuals also contain
1896742660Smarkmfootings.  (Headings and footings have no meaning to Info, which is
1896842660Smarkmnot paginated.)@refill
1896942660Smarkm
1897042660Smarkm@menu
1897142660Smarkm* Headings Introduced::         Conventions for using page headings.
1897242660Smarkm* Heading Format::              Standard page heading formats.
1897342660Smarkm* Heading Choice::              How to specify the type of page heading.
1897442660Smarkm* Custom Headings::             How to create your own headings and footings.
1897542660Smarkm@end menu
1897642660Smarkm
18977146515Sru@node Headings Introduced
18978146515Sru@section Headings Introduced
1897942660Smarkm
1898042660SmarkmTexinfo provides standard page heading formats for manuals that are
1898142660Smarkmprinted on one side of each sheet of paper and for manuals that are
1898242660Smarkmprinted on both sides of the paper.  Typically, you will use these
1898342660Smarkmformats, but you can specify your own format if you wish.@refill
1898442660Smarkm
1898542660SmarkmIn addition, you can specify whether chapters should begin on a new
1898642660Smarkmpage, or merely continue the same page as the previous chapter; and if
1898742660Smarkmchapters begin on new pages, you can specify whether they must be
1898842660Smarkmodd-numbered pages.@refill
1898942660Smarkm
1899042660SmarkmBy convention, a book is printed on both sides of each sheet of paper.
1899142660SmarkmWhen you open a book, the right-hand page is odd-numbered, and
1899242660Smarkmchapters begin on right-hand pages---a preceding left-hand page is
1899342660Smarkmleft blank if necessary.  Reports, however, are often printed on just
1899442660Smarkmone side of paper, and chapters begin on a fresh page immediately
1899542660Smarkmfollowing the end of the preceding chapter.  In short or informal
1899642660Smarkmreports, chapters often do not begin on a new page at all, but are
1899742660Smarkmseparated from the preceding text by a small amount of whitespace.@refill
1899842660Smarkm
1899942660SmarkmThe @code{@@setchapternewpage} command controls whether chapters begin
1900042660Smarkmon new pages, and whether one of the standard heading formats is used.
1900142660SmarkmIn addition, Texinfo has several heading and footing commands that you
1900242660Smarkmcan use to generate your own heading and footing formats.@refill
1900342660Smarkm
1900442660SmarkmIn Texinfo, headings and footings are single lines at the tops and
1900542660Smarkmbottoms of pages; you cannot create multiline headings or footings.
1900642660SmarkmEach header or footer line is divided into three parts: a left part, a
1900742660Smarkmmiddle part, and a right part.  Any part, or a whole line, may be left
1900842660Smarkmblank.  Text for the left part of a header or footer line is set
1900942660Smarkmflushleft; text for the middle part is centered; and, text for the
1901042660Smarkmright part is set flushright.@refill
1901142660Smarkm
19012146515Sru@node Heading Format
1901342660Smarkm@comment  node-name,  next,  previous,  up
1901456160Sru@section Standard Heading Formats
1901542660Smarkm
1901642660SmarkmTexinfo provides two standard heading formats, one for manuals printed
1901742660Smarkmon one side of each sheet of paper, and the other for manuals printed
1901842660Smarkmon both sides of the paper.
1901942660Smarkm
1902042660SmarkmBy default, nothing is specified for the footing of a Texinfo file,
1902142660Smarkmso the footing remains blank.@refill
1902242660Smarkm
1902342660SmarkmThe standard format for single-sided printing consists of a header
1902442660Smarkmline in which the left-hand part contains the name of the chapter, the
1902542660Smarkmcentral part is blank, and the right-hand part contains the page
1902642660Smarkmnumber.@refill
1902742660Smarkm
1902842660Smarkm@need 950
1902942660SmarkmA single-sided page looks like this:
1903042660Smarkm
1903142660Smarkm@example
1903242660Smarkm@group
19033114472Sru  _______________________
19034114472Sru |                       |
19035114472Sru | chapter   page number |
19036114472Sru |                       |
19037114472Sru | Start of text ...     |
19038114472Sru | ...                   |
19039114472Sru |                       |
1904042660Smarkm@end group
1904142660Smarkm@end example
1904242660Smarkm
1904342660SmarkmThe standard format for two-sided printing depends on whether the page
1904442660Smarkmnumber is even or odd.  By convention, even-numbered pages are on the
1904542660Smarkmleft- and odd-numbered pages are on the right.  (@TeX{} will adjust the
1904642660Smarkmwidths of the left- and right-hand margins.  Usually, widths are
1904742660Smarkmcorrect, but during double-sided printing, it is wise to check that
1904842660Smarkmpages will bind properly---sometimes a printer will produce output in
1904942660Smarkmwhich the even-numbered pages have a larger right-hand margin than the
1905042660Smarkmodd-numbered pages.)@refill
1905142660Smarkm
1905242660SmarkmIn the standard double-sided format, the left part of the left-hand
1905342660Smarkm(even-numbered) page contains the page number, the central part is
1905442660Smarkmblank, and the right part contains the title (specified by the
1905542660Smarkm@code{@@settitle} command).  The left part of the right-hand
1905642660Smarkm(odd-numbered) page contains the name of the chapter, the central part
1905742660Smarkmis blank, and the right part contains the page number.@refill
1905842660Smarkm
1905942660Smarkm@need 750
1906042660SmarkmTwo pages, side by side as in an open book, look like this:@refill
1906142660Smarkm
1906242660Smarkm@example
1906342660Smarkm@group
19064114472Sru  _______________________     _______________________
19065114472Sru |                       |   |                       |
19066114472Sru | page number     title |   | chapter   page number |
19067114472Sru |                       |   |                       |
19068114472Sru | Start of text ...     |   | More  text ...        |
19069114472Sru | ...                   |   | ...                   |
19070114472Sru |                       |   |                       |
1907142660Smarkm@end group
1907242660Smarkm@end example
1907342660Smarkm
1907442660Smarkm@noindent
1907542660SmarkmThe chapter name is preceded by the word ``Chapter'', the chapter number
1907642660Smarkmand a colon.  This makes it easier to keep track of where you are in the
1907742660Smarkmmanual.@refill
1907842660Smarkm
19079146515Sru@node Heading Choice
1908042660Smarkm@comment  node-name,  next,  previous,  up
1908156160Sru@section Specifying the Type of Heading
1908242660Smarkm
1908342660Smarkm@TeX{} does not begin to generate page headings for a standard Texinfo
1908442660Smarkmfile until it reaches the @code{@@end titlepage} command.  Thus, the
1908542660Smarkmtitle and copyright pages are not numbered.  The @code{@@end
1908642660Smarkmtitlepage} command causes @TeX{} to begin to generate page headings
1908742660Smarkmaccording to a standard format specified by the
1908842660Smarkm@code{@@setchapternewpage} command that precedes the
1908942660Smarkm@code{@@titlepage} section.@refill
1909042660Smarkm
1909142660Smarkm@need 1000
1909242660SmarkmThere are four possibilities:@refill
1909342660Smarkm
1909442660Smarkm@table @asis
1909542660Smarkm@item No @code{@@setchapternewpage} command
1909642660SmarkmCause @TeX{} to specify the single-sided heading format, with chapters
1909742660Smarkmon new pages. This is the same as @code{@@setchapternewpage on}.@refill
1909842660Smarkm
1909942660Smarkm@item @code{@@setchapternewpage on}
1910042660SmarkmSpecify the single-sided heading format, with chapters on new pages.@refill
1910142660Smarkm
1910242660Smarkm@item @code{@@setchapternewpage off}
1910342660SmarkmCause @TeX{} to start a new chapter on the same page as the last page of
1910442660Smarkmthe preceding chapter, after skipping some vertical whitespace.  Also
1910542660Smarkmcause @TeX{} to typeset for single-sided printing.  (You can override
1910642660Smarkmthe headers format with the @code{@@headings double} command; see
1910742660Smarkm@ref{headings on off, , The @code{@@headings} Command}.)@refill
1910842660Smarkm
1910942660Smarkm@item @code{@@setchapternewpage odd}
1911042660SmarkmSpecify the double-sided heading format, with chapters on new pages.@refill
1911142660Smarkm@end table
1911242660Smarkm
1911342660Smarkm@noindent
1911442660SmarkmTexinfo lacks an @code{@@setchapternewpage even} command.@refill
1911542660Smarkm
19116146515Sru@node Custom Headings
1911742660Smarkm@comment  node-name,  next,  previous,  up
1911856160Sru@section How to Make Your Own Headings
1911942660Smarkm
1912042660SmarkmYou can use the standard headings provided with Texinfo or specify
1912142660Smarkmyour own.  By default, Texinfo has no footers, so if you specify them,
1912242660Smarkmthe available page size for the main text will be slightly reduced.
1912342660Smarkm
1912442660SmarkmTexinfo provides six commands for specifying headings and
1912556160Srufootings:
1912656160Sru@itemize @bullet
1912756160Sru@item
1912856160Sru@code{@@everyheading} @code{@@everyfooting} generate page headers and
1912956160Srufooters that are the same for both even- and odd-numbered pages.
1913056160Sru@item
1913156160Sru@code{@@evenheading} and @code{@@evenfooting} command generate headers
1913256160Sruand footers for even-numbered (left-hand) pages.
1913356160Sru@item
1913456160Sru@code{@@oddheading} and @code{@@oddfooting} generate headers and footers
1913556160Srufor odd-numbered (right-hand) pages.
1913656160Sru@end itemize
1913742660Smarkm
1913842660SmarkmWrite custom heading specifications in the Texinfo file immediately
19139100513Sruafter the @code{@@end titlepage} command.
19140100513SruYou must cancel the predefined heading commands with the
1914142660Smarkm@code{@@headings off} command before defining your own
1914242660Smarkmspecifications.@refill
1914342660Smarkm
1914442660Smarkm@need 1000
1914542660SmarkmHere is how to tell @TeX{} to place the chapter name at the left, the
1914642660Smarkmpage number in the center, and the date at the right of every header
1914742660Smarkmfor both even- and odd-numbered pages:@refill
1914842660Smarkm
1914942660Smarkm@example
1915042660Smarkm@group
1915142660Smarkm@@headings off
1915242660Smarkm@@everyheading @@thischapter @@| @@thispage @@| @@today@{@}
1915342660Smarkm@end group
1915442660Smarkm@end example
1915542660Smarkm
1915642660Smarkm@noindent
1915742660SmarkmYou need to divide the left part from the central part and the central
1915842660Smarkmpart from the right part by inserting @samp{@@|} between parts.
1915942660SmarkmOtherwise, the specification command will not be able to tell where
1916042660Smarkmthe text for one part ends and the next part begins.@refill
1916142660Smarkm
1916242660SmarkmEach part can contain text or @@-commands.  The text
1916342660Smarkmis printed as if the part were within an ordinary paragraph in the
1916442660Smarkmbody of the page.  The @@-commands replace
1916542660Smarkmthemselves with the page number, date, chapter name, or
1916642660Smarkmwhatever.@refill
1916742660Smarkm
1916842660Smarkm@need 950
1916942660SmarkmHere are the six heading and footing commands:@refill
1917042660Smarkm
1917142660Smarkm@findex everyheading
1917242660Smarkm@findex everyfooting
1917342660Smarkm@table @code
1917442660Smarkm@item @@everyheading @var{left} @@| @var{center} @@| @var{right}
1917542660Smarkm@itemx @@everyfooting @var{left} @@| @var{center} @@| @var{right}
1917642660Smarkm
1917742660SmarkmThe `every' commands specify the format for both even- and odd-numbered
1917842660Smarkmpages.  These commands are for documents that are printed on one side
1917942660Smarkmof each sheet of paper, or for documents in which you want symmetrical
1918042660Smarkmheaders or footers.@refill
1918142660Smarkm
1918242660Smarkm@findex evenheading
1918342660Smarkm@findex evenfooting
1918442660Smarkm@findex oddheading
1918542660Smarkm@findex oddfooting
1918642660Smarkm@item @@evenheading @var{left} @@| @var{center} @@| @var{right}
1918742660Smarkm@itemx @@oddheading  @var{left} @@| @var{center} @@| @var{right}
1918842660Smarkm@itemx @@evenfooting @var{left} @@| @var{center} @@| @var{right}
1918942660Smarkm@itemx @@oddfooting  @var{left} @@| @var{center} @@| @var{right}
1919042660Smarkm
1919142660SmarkmThe `even' and `odd' commands specify the format for even-numbered
1919242660Smarkmpages and odd-numbered pages.  These commands are for books and
1919342660Smarkmmanuals that are printed on both sides of each sheet of paper.
1919442660Smarkm@end table
1919542660Smarkm
1919642660SmarkmUse the @samp{@@this@dots{}} series of @@-commands to
1919742660Smarkmprovide the names of chapters
1919842660Smarkmand sections and the page number.  You can use the
1919942660Smarkm@samp{@@this@dots{}} commands in the left, center, or right portions
1920042660Smarkmof headers and footers, or anywhere else in a Texinfo file so long as
1920142660Smarkmthey are between @code{@@iftex} and @code{@@end iftex} commands.@refill
1920242660Smarkm
1920342660Smarkm@need 1000
1920442660SmarkmHere are the @samp{@@this@dots{}} commands:@refill
1920542660Smarkm
1920642660Smarkm@table @code
1920742660Smarkm@findex thispage
1920842660Smarkm@item @@thispage
1920942660SmarkmExpands to the current page number.@refill
1921042660Smarkm@c !!! Karl Berry says that `thissection' can fail on page breaks.
1921142660Smarkm@ignore
1921242660Smarkm@item @@thissection
1921342660SmarkmExpands to the name of the current section.@refill
1921442660Smarkm@end ignore
1921542660Smarkm
1921642660Smarkm@findex thischaptername
1921742660Smarkm@item @@thischaptername
1921842660SmarkmExpands to the name of the current chapter.@refill
1921942660Smarkm
1922042660Smarkm@findex thischapter
1922142660Smarkm@item @@thischapter
1922242660SmarkmExpands to the number and name of the current
1922342660Smarkmchapter, in the format `Chapter 1: Title'.@refill
1922442660Smarkm
1922542660Smarkm@findex thistitle
1922642660Smarkm@item @@thistitle
1922742660SmarkmExpands to the name of the document, as specified by the
1922842660Smarkm@code{@@settitle} command.@refill
1922942660Smarkm
1923042660Smarkm@findex thisfile
1923142660Smarkm@item @@thisfile
1923242660SmarkmFor @code{@@include} files only: expands to the name of the current
1923342660Smarkm@code{@@include} file.  If the current Texinfo source file is not an
1923442660Smarkm@code{@@include} file, this command has no effect.  This command does
1923542660Smarkm@emph{not} provide the name of the current Texinfo source file unless
1923642660Smarkmit is an @code{@@include} file.  (@xref{Include Files}, for more
1923742660Smarkminformation about @code{@@include} files.)@refill
1923842660Smarkm@end table
1923942660Smarkm
1924042660Smarkm@noindent
1924142660SmarkmYou can also use the @code{@@today@{@}} command, which expands to the
1924242660Smarkmcurrent date, in `1 Jan 1900' format.@refill
1924342660Smarkm@findex today
1924442660Smarkm
1924542660SmarkmOther @@-commands and text are printed in a header or footer just as
1924642660Smarkmif they were in the body of a page.  It is useful to incorporate text,
1924742660Smarkmparticularly when you are writing drafts:@refill
1924842660Smarkm
1924942660Smarkm@example
1925042660Smarkm@group
1925142660Smarkm@@headings off
1925242660Smarkm@@everyheading @@emph@{Draft!@} @@| @@thispage @@| @@thischapter
1925342660Smarkm@@everyfooting @@| @@| Version: 0.27: @@today@{@}
1925442660Smarkm@end group
1925542660Smarkm@end example
1925642660Smarkm
1925742660SmarkmBeware of overlong titles: they may overlap another part of the
1925842660Smarkmheader or footer and blot it out.@refill
1925942660Smarkm
1926042660Smarkm
1926156160Sru@node Catching Mistakes
1926242660Smarkm@appendix Formatting Mistakes
1926342660Smarkm@cindex Structure, catching mistakes in
1926442660Smarkm@cindex Nodes, catching mistakes
1926542660Smarkm@cindex Catching mistakes
1926642660Smarkm@cindex Correcting mistakes
1926742660Smarkm@cindex Mistakes, catching
1926842660Smarkm@cindex Problems, catching
1926942660Smarkm@cindex Debugging the Texinfo structure
1927042660Smarkm
19271100513SruBesides mistakes in the content of your documentation, there are two
19272100513Srukinds of mistake you can make with Texinfo: you can make mistakes with
19273100513Sru@@-commands, and you can make mistakes with the structure of the nodes
19274100513Sruand chapters.
1927542660Smarkm
1927642660SmarkmEmacs has two tools for catching the @@-command mistakes and two for
1927742660Smarkmcatching structuring mistakes.@refill
1927842660Smarkm
1927942660SmarkmFor finding problems with @@-commands, you can run @TeX{} or a region
1928042660Smarkmformatting command on the region that has a problem; indeed, you can
1928142660Smarkmrun these commands on each region as you write it.@refill
1928242660Smarkm
1928342660SmarkmFor finding problems with the structure of nodes and chapters, you can use
1928442660Smarkm@kbd{C-c C-s} (@code{texinfo-show-structure}) and the related @code{occur}
1928542660Smarkmcommand and you can use the @kbd{M-x Info-validate} command.@refill
1928642660Smarkm
1928742660Smarkm@menu
1928842660Smarkm* makeinfo Preferred::          @code{makeinfo} finds errors.
1928942660Smarkm* Debugging with Info::         How to catch errors with Info formatting.
1929042660Smarkm* Debugging with TeX::          How to catch errors with @TeX{} formatting.
1929142660Smarkm* Using texinfo-show-structure::  How to use @code{texinfo-show-structure}.
1929242660Smarkm* Using occur::                 How to list all lines containing a pattern.
1929342660Smarkm* Running Info-Validate::       How to find badly referenced nodes.
1929442660Smarkm@end menu
1929542660Smarkm
1929642660Smarkm
19297146515Sru@node makeinfo Preferred
19298146515Sru@section @code{makeinfo} Find Errors
19299146515Sru
1930042660SmarkmThe @code{makeinfo} program does an excellent job of catching errors
1930142660Smarkmand reporting them---far better than @code{texinfo-format-region} or
1930242660Smarkm@code{texinfo-format-buffer}.  In addition, the various functions for
1930342660Smarkmautomatically creating and updating node pointers and menus remove
1930442660Smarkmmany opportunities for human error.@refill
1930542660Smarkm
1930642660SmarkmIf you can, use the updating commands to create and insert pointers
1930742660Smarkmand menus.  These prevent many errors.  Then use @code{makeinfo} (or
1930842660Smarkmits Texinfo mode manifestations, @code{makeinfo-region} and
1930942660Smarkm@code{makeinfo-buffer}) to format your file and check for other
1931042660Smarkmerrors.  This is the best way to work with Texinfo.  But if you
1931142660Smarkmcannot use @code{makeinfo}, or your problem is very puzzling, then you
1931242660Smarkmmay want to use the tools described in this appendix.@refill
1931342660Smarkm
19314146515Sru@node Debugging with Info
1931542660Smarkm@comment  node-name,  next,  previous,  up
1931656160Sru@section Catching Errors with Info Formatting
1931742660Smarkm@cindex Catching errors with Info formatting
1931842660Smarkm@cindex Debugging with Info formatting
1931942660Smarkm
1932042660SmarkmAfter you have written part of a Texinfo file, you can use the
1932142660Smarkm@code{texinfo-format-region} or the @code{makeinfo-region} command to
1932242660Smarkmsee whether the region formats properly.@refill
1932342660Smarkm
1932442660SmarkmMost likely, however, you are reading this section because for some
1932542660Smarkmreason you cannot use the @code{makeinfo-region} command; therefore, the
1932642660Smarkmrest of this section presumes that you are using
1932742660Smarkm@code{texinfo-format-region}.@refill
1932842660Smarkm
1932942660SmarkmIf you have made a mistake with an @@-command,
1933042660Smarkm@code{texinfo-format-region} will stop processing at or after the
1933142660Smarkmerror and display an error message.  To see where in the buffer the
1933242660Smarkmerror occurred, switch to the @samp{*Info Region*} buffer; the cursor
1933342660Smarkmwill be in a position that is after the location of the error.  Also,
1933442660Smarkmthe text will not be formatted after the place where the error
1933542660Smarkmoccurred (or more precisely, where it was detected).@refill
1933642660Smarkm
1933742660SmarkmFor example, if you accidentally end a menu with the command @code{@@end
1933842660Smarkmmenus} with an `s' on the end, instead of with @code{@@end menu}, you
1933942660Smarkmwill see an error message that says:@refill
1934042660Smarkm
1934142660Smarkm@example
1934242660Smarkm@@end menus is not handled by texinfo
1934342660Smarkm@end example
1934442660Smarkm
1934542660Smarkm@noindent
1934642660SmarkmThe cursor will stop at the point in the buffer where the error
1934742660Smarkmoccurs, or not long after it.  The buffer will look like this:@refill
1934842660Smarkm
1934942660Smarkm@example
1935042660Smarkm@group
1935142660Smarkm---------- Buffer: *Info Region* ----------
1935242660Smarkm* Menu:
1935342660Smarkm
1935442660Smarkm* Using texinfo-show-structure::  How to use
19355114472Sru                                 `texinfo-show-structure'
19356114472Sru                                 to catch mistakes.
1935742660Smarkm* Running Info-Validate::         How to check for
19358114472Sru                                 unreferenced nodes.
1935942660Smarkm@@end menus
1936042660Smarkm@point{}
1936142660Smarkm---------- Buffer: *Info Region* ----------
1936242660Smarkm@end group
1936342660Smarkm@end example
1936442660Smarkm
1936542660SmarkmThe @code{texinfo-format-region} command sometimes provides slightly
1936642660Smarkmodd error messages.  For example, the following cross reference fails to format:@refill
1936742660Smarkm
1936842660Smarkm@example
1936942660Smarkm(@@xref@{Catching Mistakes, for more info.)
1937042660Smarkm@end example
1937142660Smarkm
1937242660Smarkm@noindent
1937342660SmarkmIn this case, @code{texinfo-format-region} detects the missing closing
1937442660Smarkmbrace but displays a message that says @samp{Unbalanced parentheses}
1937542660Smarkmrather than @samp{Unbalanced braces}.  This is because the formatting
1937642660Smarkmcommand looks for mismatches between braces as if they were
1937742660Smarkmparentheses.@refill
1937842660Smarkm
1937942660SmarkmSometimes @code{texinfo-format-region} fails to detect mistakes.  For
1938042660Smarkmexample, in the following, the closing brace is swapped with the
1938142660Smarkmclosing parenthesis:@refill
1938242660Smarkm
1938342660Smarkm@example
1938442660Smarkm(@@xref@{Catching Mistakes), for more info.@}
1938542660Smarkm@end example
1938642660Smarkm
1938742660Smarkm@noindent
1938842660SmarkmFormatting produces:
1938942660Smarkm@example
1939042660Smarkm(*Note for more info.: Catching Mistakes)
1939142660Smarkm@end example
1939242660Smarkm
1939342660SmarkmThe only way for you to detect this error is to realize that the
1939442660Smarkmreference should have looked like this:@refill
1939542660Smarkm
1939642660Smarkm@example
1939742660Smarkm(*Note Catching Mistakes::, for more info.)
1939842660Smarkm@end example
1939942660Smarkm
1940042660SmarkmIncidentally, if you are reading this node in Info and type @kbd{f
1940142660Smarkm@key{RET}} (@code{Info-follow-reference}), you will generate an error
1940242660Smarkmmessage that says:
1940342660Smarkm
1940442660Smarkm@example
1940542660SmarkmNo such node: "Catching Mistakes) The only way @dots{}
1940642660Smarkm@end example
1940742660Smarkm
1940842660Smarkm@noindent
1940942660SmarkmThis is because Info perceives the example of the error as the first
1941042660Smarkmcross reference in this node and if you type a @key{RET} immediately
1941142660Smarkmafter typing the Info @kbd{f} command, Info will attempt to go to the
1941242660Smarkmreferenced node.  If you type @kbd{f catch @key{TAB} @key{RET}}, Info
1941342660Smarkmwill complete the node name of the correctly written example and take
1941442660Smarkmyou to the `Catching Mistakes' node.  (If you try this, you can return
1941542660Smarkmfrom the `Catching Mistakes' node by typing @kbd{l}
1941642660Smarkm(@code{Info-last}).)
1941742660Smarkm
1941842660Smarkm@c !!! section on using Elisp debugger ignored.
1941942660Smarkm@ignore
1942042660SmarkmSometimes @code{texinfo-format-region} will stop long after the
1942142660Smarkmoriginal error; this is because it does not discover the problem until
1942242660Smarkmthen.  In this case, you will need to backtrack.@refill
1942342660Smarkm
1942442660Smarkm@c menu
1942542660Smarkm@c * Using the Emacs Lisp Debugger::  How to use the Emacs Lisp debugger.
1942642660Smarkm@c end menu
1942742660Smarkm
1942842660Smarkm@c node Using the Emacs Lisp Debugger
1942942660Smarkm@c appendixsubsec Using the Emacs Lisp Debugger
1943042660Smarkm@c index Using the Emacs Lisp debugger
1943142660Smarkm@c index Emacs Lisp debugger
1943242660Smarkm@c index Debugger, using the Emacs Lisp
1943342660Smarkm
1943442660SmarkmIf an error is especially elusive, you can turn on the Emacs Lisp
1943542660Smarkmdebugger and look at the backtrace; this tells you where in the
1943642660Smarkm@code{texinfo-format-region} function the problem occurred.  You can
1943742660Smarkmturn on the debugger with the command:@refill
1943842660Smarkm
1943942660Smarkm@example
1944042660SmarkmM-x set-variable @key{RET} debug-on-error @key{RET} t @key{RET}
1944142660Smarkm@end example
1944242660Smarkm
1944342660Smarkm@noindent
1944442660Smarkmand turn it off with
1944542660Smarkm
1944642660Smarkm@example
1944742660SmarkmM-x set-variable @key{RET} debug-on-error @key{RET} nil @key{RET}
1944842660Smarkm@end example
1944942660Smarkm
1945042660SmarkmOften, when you are using the debugger, it is easier to follow what is
1945142660Smarkmgoing on if you use the Emacs Lisp files that are not byte-compiled.
1945242660SmarkmThe byte-compiled sources send octal numbers to the debugger that may
1945342660Smarkmlook mysterious.  To use the uncompiled source files, load
1945442660Smarkm@file{texinfmt.el} and @file{texinfo.el} with the @kbd{M-x load-file}
1945542660Smarkmcommand.@refill
1945642660Smarkm
1945742660SmarkmThe debugger will not catch an error if @code{texinfo-format-region}
1945842660Smarkmdoes not detect one.  In the example shown above,
1945942660Smarkm@code{texinfo-format-region} did not find the error when the whole
1946042660Smarkmlist was formatted, but only when part of the list was formatted.
1946142660SmarkmWhen @code{texinfo-format-region} did not find an error, the debugger
1946242660Smarkmdid not find one either. @refill
1946342660Smarkm
1946442660SmarkmHowever, when @code{texinfo-format-region} did report an error, it
1946542660Smarkminvoked the debugger.  This is the backtrace it produced:@refill
1946642660Smarkm
1946742660Smarkm@example
1946842660Smarkm---------- Buffer: *Backtrace* ----------
1946942660SmarkmSignalling: (search-failed "[@},]")
19470114472Sru re-search-forward("[@},]")
19471114472Sru (while ...)
19472114472Sru (let ...)
19473114472Sru texinfo-format-parse-args()
19474114472Sru (let ...)
19475114472Sru texinfo-format-xref()
19476114472Sru funcall(texinfo-format-xref)
19477114472Sru (if ...)
19478114472Sru (let ...)
19479114472Sru (if ...)
19480114472Sru (while ...)
19481114472Sru texinfo-format-scan()
19482114472Sru (save-excursion ...)
19483114472Sru (let ...)
19484114472Sru texinfo-format-region(103370 103631)
1948542660Smarkm* call-interactively(texinfo-format-region)
1948642660Smarkm---------- Buffer: *Backtrace* ----------
1948742660Smarkm@end example
1948842660Smarkm
1948942660SmarkmThe backtrace is read from the bottom up.
1949042660Smarkm@code{texinfo-format-region} was called interactively; and it, in
1949142660Smarkmturn, called various functions, including @code{texinfo-format-scan},
1949242660Smarkm@code{texinfo-format-xref} and @code{texinfo-format-parse-args}.
1949342660SmarkmInside the function @code{texinfo-format-parse-args}, the function
1949442660Smarkm@code{re-search-forward} was called; it was this function that could
1949542660Smarkmnot find the missing right-hand brace.@refill
1949642660Smarkm
1949742660Smarkm@xref{Lisp Debug, , Debugging Emacs Lisp, emacs, The GNU Emacs
1949842660SmarkmManual}, for more information.@refill
1949942660Smarkm@end ignore
1950042660Smarkm
19501146515Sru@node Debugging with TeX
1950242660Smarkm@comment  node-name,  next,  previous,  up
1950356160Sru@section Catching Errors with @TeX{} Formatting
1950442660Smarkm@cindex Catching errors with @TeX{} formatting
1950542660Smarkm@cindex Debugging with @TeX{} formatting
1950642660Smarkm
1950742660SmarkmYou can also catch mistakes when you format a file with @TeX{}.@refill
1950842660Smarkm
1950942660SmarkmUsually, you will want to do this after you have run
1951042660Smarkm@code{texinfo-format-buffer} (or, better, @code{makeinfo-buffer}) on
1951142660Smarkmthe same file, because @code{texinfo-format-buffer} sometimes displays
1951242660Smarkmerror messages that make more sense than @TeX{}.  (@xref{Debugging
1951342660Smarkmwith Info}, for more information.)@refill
1951442660Smarkm
1951542660SmarkmFor example, @TeX{} was run on a Texinfo file, part of which is shown
1951642660Smarkmhere:@refill
1951742660Smarkm
1951842660Smarkm@example
1951942660Smarkm---------- Buffer: texinfo.texi ----------
1952042660Smarkmname of the Texinfo file as an extension.  The
1952142660Smarkm@@samp@{??@} are `wildcards' that cause the shell to
1952242660Smarkmsubstitute all the raw index files.  (@@xref@{sorting
1952342660Smarkmindices, for more information about sorting
1952442660Smarkmindices.)@@refill
1952542660Smarkm---------- Buffer: texinfo.texi ----------
1952642660Smarkm@end example
1952742660Smarkm
1952842660Smarkm@noindent
1952942660Smarkm(The cross reference lacks a closing brace.)
1953042660Smarkm@TeX{} produced the following output, after which it stopped:@refill
1953142660Smarkm
1953242660Smarkm@example
1953342660Smarkm---------- Buffer: *tex-shell* ----------
1953442660SmarkmRunaway argument?
1953542660Smarkm@{sorting indices, for more information about sorting
1953642660Smarkmindices.) @@refill @@ETC.
1953742660Smarkm! Paragraph ended before @@xref was complete.
1953842660Smarkm<to be read again>
19539114472Sru                  @@par
1954042660Smarkml.27
1954142660Smarkm
1954242660Smarkm?
1954342660Smarkm---------- Buffer: *tex-shell* ----------
1954442660Smarkm@end example
1954542660Smarkm
1954642660SmarkmIn this case, @TeX{} produced an accurate and
1954742660Smarkmunderstandable error message:
1954842660Smarkm
1954942660Smarkm@example
1955042660SmarkmParagraph ended before @@xref was complete.
1955142660Smarkm@end example
1955242660Smarkm
1955342660Smarkm@noindent
1955442660Smarkm@samp{@@par} is an internal @TeX{} command of no relevance to Texinfo.
1955542660Smarkm@samp{l.27} means that @TeX{} detected the problem on line 27 of the
1955642660SmarkmTexinfo file.  The @samp{?} is the prompt @TeX{} uses in this
1955742660Smarkmcircumstance.@refill
1955842660Smarkm
1955942660SmarkmUnfortunately, @TeX{} is not always so helpful, and sometimes you must
1956042660Smarkmtruly be a Sherlock Holmes to discover what went wrong.@refill
1956142660Smarkm
1956242660SmarkmIn any case, if you run into a problem like this, you can do one of three
1956342660Smarkmthings.@refill
1956442660Smarkm
1956542660Smarkm@enumerate
1956642660Smarkm@item
1956742660SmarkmYou can tell @TeX{} to continue running and ignore just this error by
1956842660Smarkmtyping @key{RET} at the @samp{?} prompt.@refill
1956942660Smarkm
1957042660Smarkm@item
1957142660SmarkmYou can tell @TeX{} to continue running and to ignore all errors as best
1957242660Smarkmit can by typing @kbd{r @key{RET}} at the @samp{?} prompt.@refill
1957342660Smarkm
1957442660SmarkmThis is often the best thing to do.  However, beware: the one error
1957542660Smarkmmay produce a cascade of additional error messages as its consequences
1957642660Smarkmare felt through the rest of the file.  To stop @TeX{} when it is
1957742660Smarkmproducing such an avalanche of error messages, type @kbd{C-c} (or
1957842660Smarkm@kbd{C-c C-c}, if you are running a shell inside Emacs).
1957942660Smarkm
1958042660Smarkm@item
1958142660SmarkmYou can tell @TeX{} to stop this run by typing @kbd{x @key{RET}}
1958242660Smarkmat the @samp{?} prompt.@refill
1958342660Smarkm@end enumerate
1958442660Smarkm
1958556160SruIf you are running @TeX{} inside Emacs, you need to switch to the shell
1958656160Srubuffer and line at which @TeX{} offers the @samp{?} prompt.
1958742660Smarkm
1958842660SmarkmSometimes @TeX{} will format a file without producing error messages even
1958942660Smarkmthough there is a problem.  This usually occurs if a command is not ended
1959042660Smarkmbut @TeX{} is able to continue processing anyhow.  For example, if you fail
1959142660Smarkmto end an itemized list with the @code{@@end itemize} command, @TeX{} will
1959242660Smarkmwrite a DVI file that you can print out.  The only error message that
1959342660Smarkm@TeX{} will give you is the somewhat mysterious comment that@refill
1959442660Smarkm
1959542660Smarkm@example
1959642660Smarkm(@@end occurred inside a group at level 1)
1959742660Smarkm@end example
1959842660Smarkm
1959942660Smarkm@noindent
1960042660SmarkmHowever, if you print the DVI file, you will find that the text
1960142660Smarkmof the file that follows the itemized list is entirely indented as if
1960242660Smarkmit were part of the last item in the itemized list.  The error message
1960342660Smarkmis the way @TeX{} says that it expected to find an @code{@@end}
1960442660Smarkmcommand somewhere in the file; but that it could not determine where
1960542660Smarkmit was needed.@refill
1960642660Smarkm
1960742660SmarkmAnother source of notoriously hard-to-find errors is a missing
1960842660Smarkm@code{@@end group} command.  If you ever are stumped by
1960942660Smarkmincomprehensible errors, look for a missing @code{@@end group} command
1961042660Smarkmfirst.@refill
1961142660Smarkm
1961242660SmarkmIf the Texinfo file lacks header lines,
1961342660Smarkm@TeX{} may stop in the
1961442660Smarkmbeginning of its run and display output that looks like the following.
1961542660SmarkmThe @samp{*} indicates that @TeX{} is waiting for input.@refill
1961642660Smarkm
1961742660Smarkm@example
1961842660SmarkmThis is TeX, Version 3.14159 (Web2c 7.0)
1961942660Smarkm(test.texinfo [1])
1962042660Smarkm*
1962142660Smarkm@end example
1962242660Smarkm
1962342660Smarkm@noindent
1962442660SmarkmIn this case, simply type @kbd{\end @key{RET}} after the asterisk.  Then
1962542660Smarkmwrite the header lines in the Texinfo file and run the @TeX{} command
1962642660Smarkmagain. (Note the use of the backslash, @samp{\}.  @TeX{} uses @samp{\}
1962742660Smarkminstead of @samp{@@}; and in this circumstance, you are working
1962842660Smarkmdirectly with @TeX{}, not with Texinfo.)@refill
1962942660Smarkm
19630146515Sru@node Using texinfo-show-structure
1963142660Smarkm@comment  node-name,  next,  previous,  up
1963256160Sru@section Using @code{texinfo-show-structure}
1963342660Smarkm@cindex Showing the structure of a file
1963442660Smarkm@findex texinfo-show-structure
1963542660Smarkm
1963642660SmarkmIt is not always easy to keep track of the nodes, chapters, sections, and
1963742660Smarkmsubsections of a Texinfo file.  This is especially true if you are revising
1963842660Smarkmor adding to a Texinfo file that someone else has written.@refill
1963942660Smarkm
1964042660SmarkmIn GNU Emacs, in Texinfo mode, the @code{texinfo-show-structure}
1964142660Smarkmcommand lists all the lines that begin with the @@-commands that
1964242660Smarkmspecify the structure: @code{@@chapter}, @code{@@section},
1964342660Smarkm@code{@@appendix}, and so on.  With an argument (@w{@kbd{C-u}}
1964442660Smarkmas prefix argument, if interactive),
1964542660Smarkmthe command also shows the @code{@@node} lines.  The
1964642660Smarkm@code{texinfo-show-structure} command is bound to @kbd{C-c C-s} in
1964742660SmarkmTexinfo mode, by default.@refill
1964842660Smarkm
1964942660SmarkmThe lines are displayed in a buffer called the @samp{*Occur*} buffer,
1965042660Smarkmindented by hierarchical level.  For example, here is a part of what was
1965142660Smarkmproduced by running @code{texinfo-show-structure} on this manual:@refill
1965242660Smarkm
1965342660Smarkm@example
1965442660Smarkm@group
19655114472SruLines matching "^@@\\(chapter \\|sect\\|subs\\|subh\\|
19656114472Sruunnum\\|major\\|chapheading \\|heading \\|appendix\\)"
19657114472Sruin buffer texinfo.texi.
19658114472Sru@dots{}
19659114472Sru4177:@@chapter Nodes
19660114472Sru4198:    @@heading Two Paths
19661114472Sru4231:    @@section Node and Menu Illustration
19662114472Sru4337:    @@section The @@code@{@@@@node@} Command
19663114472Sru4393:        @@subheading Choosing Node and Pointer Names
19664114472Sru4417:        @@subsection How to Write an @@code@{@@@@node@} Line
19665114472Sru4469:        @@subsection @@code@{@@@@node@} Line Tips
19666114472Sru@dots{}
1966742660Smarkm@end group
1966842660Smarkm@end example
1966942660Smarkm
1967042660SmarkmThis says that lines 4337, 4393, and 4417 of @file{texinfo.texi} begin
1967142660Smarkmwith the @code{@@section}, @code{@@subheading}, and @code{@@subsection}
1967242660Smarkmcommands respectively.  If you move your cursor into the @samp{*Occur*}
1967342660Smarkmwindow, you can position the cursor over one of the lines and use the
1967442660Smarkm@kbd{C-c C-c} command (@code{occur-mode-goto-occurrence}), to jump to
1967542660Smarkmthe corresponding spot in the Texinfo file.  @xref{Other Repeating
1967642660SmarkmSearch, , Using Occur, emacs, The GNU Emacs Manual}, for more
1967742660Smarkminformation about @code{occur-mode-goto-occurrence}.@refill
1967842660Smarkm
1967942660SmarkmThe first line in the @samp{*Occur*} window describes the @dfn{regular
1968042660Smarkmexpression} specified by @var{texinfo-heading-pattern}.  This regular
1968142660Smarkmexpression is the pattern that @code{texinfo-show-structure} looks for.
1968242660Smarkm@xref{Regexps, , Using Regular Expressions, emacs, The GNU Emacs Manual},
1968342660Smarkmfor more information.@refill
1968442660Smarkm
1968542660SmarkmWhen you invoke the @code{texinfo-show-structure} command, Emacs will
1968642660Smarkmdisplay the structure of the whole buffer.  If you want to see the
1968742660Smarkmstructure of just a part of the buffer, of one chapter, for example,
1968842660Smarkmuse the @kbd{C-x n n} (@code{narrow-to-region}) command to mark the
1968942660Smarkmregion.  (@xref{Narrowing, , , emacs, The GNU Emacs Manual}.)  This is
1969042660Smarkmhow the example used above was generated.  (To see the whole buffer
1969142660Smarkmagain, use @kbd{C-x n w} (@code{widen}).)@refill
1969242660Smarkm
1969342660SmarkmIf you call @code{texinfo-show-structure} with a prefix argument by
1969442660Smarkmtyping @w{@kbd{C-u C-c C-s}}, it will list lines beginning with
1969542660Smarkm@code{@@node} as well as the lines beginning with the @@-sign commands
1969642660Smarkmfor @code{@@chapter}, @code{@@section}, and the like.@refill
1969742660Smarkm
1969842660SmarkmYou can remind yourself of the structure of a Texinfo file by looking at
1969942660Smarkmthe list in the @samp{*Occur*} window; and if you have mis-named a node
1970042660Smarkmor left out a section, you can correct the mistake.@refill
1970142660Smarkm
19702146515Sru@node Using occur
1970342660Smarkm@comment  node-name,  next,  previous,  up
1970456160Sru@section Using @code{occur}
1970542660Smarkm@cindex Occurrences, listing with @code{@@occur}
1970642660Smarkm@findex occur
1970742660Smarkm
1970842660SmarkmSometimes the @code{texinfo-show-structure} command produces too much
1970942660Smarkminformation.  Perhaps you want to remind yourself of the overall structure
1971042660Smarkmof a Texinfo file, and are overwhelmed by the detailed list produced by
1971142660Smarkm@code{texinfo-show-structure}.  In this case, you can use the @code{occur}
1971242660Smarkmcommand directly.  To do this, type@refill
1971342660Smarkm
1971442660Smarkm@example
1971542660Smarkm@kbd{M-x occur}
1971642660Smarkm@end example
1971742660Smarkm
1971842660Smarkm@noindent
1971942660Smarkmand then, when prompted, type a @dfn{regexp}, a regular expression for
1972042660Smarkmthe pattern you want to match.  (@xref{Regexps, , Regular Expressions,
1972142660Smarkmemacs, The GNU Emacs Manual}.)  The @code{occur} command works from
1972242660Smarkmthe current location of the cursor in the buffer to the end of the
1972342660Smarkmbuffer.  If you want to run @code{occur} on the whole buffer, place
1972442660Smarkmthe cursor at the beginning of the buffer.@refill
1972542660Smarkm
1972642660SmarkmFor example, to see all the lines that contain the word
1972742660Smarkm@samp{@@chapter} in them, just type @samp{@@chapter}.  This will
1972842660Smarkmproduce a list of the chapters.  It will also list all the sentences
1972942660Smarkmwith @samp{@@chapter} in the middle of the line.@refill
1973042660Smarkm
1973142660SmarkmIf you want to see only those lines that start with the word
1973242660Smarkm@samp{@@chapter}, type @samp{^@@chapter} when prompted by
1973342660Smarkm@code{occur}.  If you want to see all the lines that end with a word
1973442660Smarkmor phrase, end the last word with a @samp{$}; for example,
1973542660Smarkm@samp{catching mistakes$}.  This can be helpful when you want to see
1973642660Smarkmall the nodes that are part of the same chapter or section and
1973742660Smarkmtherefore have the same `Up' pointer.@refill
1973842660Smarkm
1973942660Smarkm@xref{Other Repeating Search, , Using Occur, emacs , The GNU Emacs Manual},
1974042660Smarkmfor more information.@refill
1974142660Smarkm
19742146515Sru@node Running Info-Validate
1974342660Smarkm@comment  node-name,  next,  previous,  up
1974456160Sru@section Finding Badly Referenced Nodes
1974542660Smarkm@findex Info-validate
1974642660Smarkm@cindex Nodes, checking for badly referenced
1974742660Smarkm@cindex Checking for badly referenced nodes
1974842660Smarkm@cindex Looking for badly referenced nodes
1974942660Smarkm@cindex Finding badly referenced nodes
1975042660Smarkm@cindex Badly referenced nodes
1975142660Smarkm
1975242660SmarkmYou can use the @code{Info-validate} command to check whether any of
1975342660Smarkmthe `Next', `Previous', `Up' or other node pointers fail to point to a
1975442660Smarkmnode.  This command checks that every node pointer points to an
1975542660Smarkmexisting node.  The @code{Info-validate} command works only on Info
1975642660Smarkmfiles, not on Texinfo files.@refill
1975742660Smarkm
1975842660SmarkmThe @code{makeinfo} program validates pointers automatically, so you
1975942660Smarkmdo not need to use the @code{Info-validate} command if you are using
1976042660Smarkm@code{makeinfo}.  You only may need to use @code{Info-validate} if you
1976142660Smarkmare unable to run @code{makeinfo} and instead must create an Info file
1976242660Smarkmusing @code{texinfo-format-region} or @code{texinfo-format-buffer}, or
1976342660Smarkmif you write an Info file from scratch.@refill
1976442660Smarkm
1976542660Smarkm@menu
1976642660Smarkm* Using Info-validate::         How to run @code{Info-validate}.
1976742660Smarkm* Unsplit::                     How to create an unsplit file.
1976842660Smarkm* Tagifying::                   How to tagify a file.
1976942660Smarkm* Splitting::                   How to split a file manually.
1977042660Smarkm@end menu
1977142660Smarkm
19772146515Sru@node Using Info-validate
1977356160Sru@subsection Running @code{Info-validate}
1977442660Smarkm@cindex Running @code{Info-validate}
1977542660Smarkm@cindex Info validating a large file
1977642660Smarkm@cindex Validating a large file
1977742660Smarkm
1977842660SmarkmTo use @code{Info-validate}, visit the Info file you wish to check and
1977942660Smarkmtype:@refill
1978042660Smarkm
1978142660Smarkm@example
1978242660SmarkmM-x Info-validate
1978342660Smarkm@end example
1978442660Smarkm
1978542660Smarkm@noindent
1978656160SruNote that the @code{Info-validate} command requires an upper case
1978742660Smarkm`I'.  You may also need to create a tag table before running
1978856160Sru@code{Info-validate}.  @xref{Tagifying}.
1978942660Smarkm
1979042660SmarkmIf your file is valid, you will receive a message that says ``File appears
1979142660Smarkmvalid''.  However, if you have a pointer that does not point to a node,
1979242660Smarkmerror messages will be displayed in a buffer called @samp{*problems in
1979342660Smarkminfo file*}.@refill
1979442660Smarkm
1979542660SmarkmFor example, @code{Info-validate} was run on a test file that contained
1979642660Smarkmonly the first node of this manual.  One of the messages said:@refill
1979742660Smarkm
1979842660Smarkm@example
1979942660SmarkmIn node "Overview", invalid Next: Texinfo Mode
1980042660Smarkm@end example
1980142660Smarkm
1980242660Smarkm@noindent
1980342660SmarkmThis meant that the node called @samp{Overview} had a `Next' pointer that
1980442660Smarkmdid not point to anything (which was true in this case, since the test file
1980542660Smarkmhad only one node in it).@refill
1980642660Smarkm
1980742660SmarkmNow suppose we add a node named @samp{Texinfo Mode} to our test case
1980842660Smarkmbut we do not specify a `Previous' for this node.  Then we will get
1980942660Smarkmthe following error message:@refill
1981042660Smarkm
1981142660Smarkm@example
1981242660SmarkmIn node "Texinfo Mode", should have Previous: Overview
1981342660Smarkm@end example
1981442660Smarkm
1981542660Smarkm@noindent
1981642660SmarkmThis is because every `Next' pointer should be matched by a
1981742660Smarkm`Previous' (in the node where the `Next' points) which points back.@refill
1981842660Smarkm
1981942660Smarkm@code{Info-validate} also checks that all menu entries and cross references
1982042660Smarkmpoint to actual nodes.@refill
1982142660Smarkm
1982256160Sru@code{Info-validate} requires a tag table and does not work with files
1982356160Sruthat have been split.  (The @code{texinfo-format-buffer} command
1982456160Sruautomatically splits large files.)  In order to use @code{Info-validate}
1982556160Sruon a large file, you must run @code{texinfo-format-buffer} with an
1982656160Sruargument so that it does not split the Info file; and you must create a
1982756160Srutag table for the unsplit file.
1982842660Smarkm
19829146515Sru@node Unsplit
1983042660Smarkm@comment  node-name,  next,  previous,  up
1983156160Sru@subsection Creating an Unsplit File
1983242660Smarkm@cindex Creating an unsplit file
1983342660Smarkm@cindex Unsplit file creation
1983442660Smarkm
1983542660SmarkmYou can run @code{Info-validate} only on a single Info file that has a
1983642660Smarkmtag table.  The command will not work on the indirect subfiles that
1983742660Smarkmare generated when a master file is split.  If you have a large file
19838116525Sru(longer than 300,000 bytes or so), you need to run the
1983942660Smarkm@code{texinfo-format-buffer} or @code{makeinfo-buffer} command in such
1984042660Smarkma way that it does not create indirect subfiles.  You will also need
1984142660Smarkmto create a tag table for the Info file.  After you have done this,
1984242660Smarkmyou can run @code{Info-validate} and look for badly referenced
1984342660Smarkmnodes.@refill
1984442660Smarkm
1984542660SmarkmThe first step is to create an unsplit Info file.  To prevent
1984642660Smarkm@code{texinfo-format-buffer} from splitting a Texinfo file into
1984742660Smarkmsmaller Info files, give a prefix to the @kbd{M-x
1984842660Smarkmtexinfo-format-buffer} command:@refill
1984942660Smarkm
1985042660Smarkm@example
1985142660SmarkmC-u M-x texinfo-format-buffer
1985242660Smarkm@end example
1985342660Smarkm
1985442660Smarkm@noindent
1985542660Smarkmor else
1985642660Smarkm
1985742660Smarkm@example
1985842660SmarkmC-u C-c C-e C-b
1985942660Smarkm@end example
1986042660Smarkm
1986142660Smarkm@noindent
1986242660SmarkmWhen you do this, Texinfo will not split the file and will not create
1986342660Smarkma tag table for it. @refill
1986442660Smarkm@cindex Making a tag table manually
1986542660Smarkm@cindex Tag table, making manually
1986642660Smarkm
19867146515Sru@node Tagifying
1986856160Sru@subsection Tagifying a File
1986942660Smarkm
1987042660SmarkmAfter creating an unsplit Info file, you must create a tag table for
1987142660Smarkmit.  Visit the Info file you wish to tagify and type:@refill
1987242660Smarkm
1987342660Smarkm@example
1987442660SmarkmM-x Info-tagify
1987542660Smarkm@end example
1987642660Smarkm
1987742660Smarkm@noindent
1987842660Smarkm(Note the upper case @samp{I} in @code{Info-tagify}.)  This creates an
1987942660SmarkmInfo file with a tag table that you can validate.@refill
1988042660Smarkm
1988142660SmarkmThe third step is to validate the Info file:@refill
1988242660Smarkm
1988342660Smarkm@example
1988442660SmarkmM-x Info-validate
1988542660Smarkm@end example
1988642660Smarkm
1988742660Smarkm@noindent
1988842660Smarkm(Note the upper case @samp{I} in @code{Info-validate}.)
1988942660SmarkmIn brief, the steps are:@refill
1989042660Smarkm
1989142660Smarkm@example
1989242660Smarkm@group
1989342660SmarkmC-u M-x texinfo-format-buffer
1989442660SmarkmM-x Info-tagify
1989542660SmarkmM-x Info-validate
1989642660Smarkm@end group
1989742660Smarkm@end example
1989842660Smarkm
1989942660SmarkmAfter you have validated the node structure, you can rerun
1990042660Smarkm@code{texinfo-format-buffer} in the normal way so it will construct a
1990142660Smarkmtag table and split the file automatically, or you can make the tag
1990242660Smarkmtable and split the file manually.@refill
1990342660Smarkm
19904146515Sru@node Splitting
1990542660Smarkm@comment  node-name,  next,  previous,  up
1990656160Sru@subsection Splitting a File Manually
1990742660Smarkm@cindex Splitting an Info file manually
1990842660Smarkm@cindex Info file, splitting manually
1990942660Smarkm
1991042660SmarkmYou should split a large file or else let the
1991142660Smarkm@code{texinfo-format-buffer} or @code{makeinfo-buffer} command do it
1991242660Smarkmfor you automatically.  (Generally you will let one of the formatting
1991356160Srucommands do this job for you.  @xref{Creating an Info File}.)@refill
1991442660Smarkm
1991542660SmarkmThe split-off files are called the indirect subfiles.@refill
1991642660Smarkm
1991742660SmarkmInfo files are split to save memory.  With smaller files, Emacs does not
1991842660Smarkmhave make such a large buffer to hold the information.@refill
1991942660Smarkm
1992042660SmarkmIf an Info file has more than 30 nodes, you should also make a tag
1992142660Smarkmtable for it. @xref{Using Info-validate}, for information
1992242660Smarkmabout creating a tag table.  (Again, tag tables are usually created
1992342660Smarkmautomatically by the formatting command; you only need to create a tag
1992442660Smarkmtable yourself if you are doing the job manually.  Most likely, you
1992542660Smarkmwill do this for a large, unsplit file on which you have run
1992642660Smarkm@code{Info-validate}.)@refill
1992742660Smarkm
1992842660Smarkm@c Info-split is autoloaded in `loaddefs.el' in Emacs 18.51
1992942660Smarkm@ignore
1993042660SmarkmBefore running @code{Info-split}, you need to load the @code{info} library
1993142660Smarkminto Emacs by giving the command @kbd{M-x load-library @key{RET} info
1993242660Smarkm@key{RET}}.
1993342660Smarkm@end ignore
1993442660Smarkm
1993542660SmarkmVisit the Info file you wish to tagify and split and type the two
1993642660Smarkmcommands:@refill
1993742660Smarkm
1993842660Smarkm@example
1993942660SmarkmM-x Info-tagify
1994042660SmarkmM-x Info-split
1994142660Smarkm@end example
1994242660Smarkm
1994342660Smarkm@noindent
1994442660Smarkm(Note that the @samp{I} in @samp{Info} is upper case.)@refill
1994542660Smarkm
1994642660SmarkmWhen you use the @code{Info-split} command, the buffer is modified into a
1994742660Smarkm(small) Info file which lists the indirect subfiles.  This file should be
1994842660Smarkmsaved in place of the original visited file.  The indirect subfiles are
1994942660Smarkmwritten in the same directory the original file is in, with names generated
1995042660Smarkmby appending @samp{-} and a number to the original file name.@refill
1995142660Smarkm
1995242660SmarkmThe primary file still functions as an Info file, but it contains just
1995342660Smarkmthe tag table and a directory of subfiles.@refill
1995442660Smarkm
1995542660Smarkm
19956146515Sru@ignore
19957146515SruThe simple description in the command summary seems sufficient to me
19958146515Sruthese days, so ignore this appendix.  --karl, 13mar04.
19959146515Sru
1996056160Sru@node Refilling Paragraphs
1996142660Smarkm@appendix Refilling Paragraphs
1996242660Smarkm@cindex Refilling paragraphs
1996342660Smarkm@cindex Filling paragraphs
1996456160Sru@cindex Paragraphs, filling
1996542660Smarkm@findex refill
1996642660Smarkm
1996742660SmarkmThe @code{@@refill} command refills and, optionally, indents the first
1996842660Smarkmline of a paragraph.@footnote{Perhaps the command should have been
1996942660Smarkmcalled the @code{@@refillandindent} command, but @code{@@refill} is
1997042660Smarkmshorter and the name was chosen before indenting was possible.} The
1997142660Smarkm@code{@@refill} command is no longer important, but we describe it here
1997242660Smarkmbecause you once needed it.  You will see it in many old Texinfo
1997342660Smarkmfiles.@refill
1997442660Smarkm
1997542660SmarkmWithout refilling, paragraphs containing long @@-constructs may look
1997642660Smarkmbad after formatting because the formatter removes @@-commands and
1997742660Smarkmshortens some lines more than others.  In the past, neither the
1997842660Smarkm@code{texinfo-format-region} command nor the
1997942660Smarkm@code{texinfo-format-buffer} command refilled paragraphs
1998042660Smarkmautomatically.  The @code{@@refill} command had to be written at the
1998142660Smarkmend of every paragraph to cause these formatters to fill them.  (Both
1998242660Smarkm@TeX{} and @code{makeinfo} have always refilled paragraphs
1998342660Smarkmautomatically.)  Now, all the Info formatters automatically fill and
1998442660Smarkmindent those paragraphs that need to be filled and indented.@refill
1998542660Smarkm
1998642660SmarkmThe @code{@@refill} command causes @code{texinfo-format-region} and
1998742660Smarkm@code{texinfo-format-buffer} to refill a paragraph in the Info file
1998842660Smarkm@emph{after} all the other processing has been done.  For this reason,
1998942660Smarkmyou can not use @code{@@refill} with a paragraph containing either
1999042660Smarkm@code{@@*} or @code{@@w@{ @dots{} @}} since the refilling action will
1999142660Smarkmoverride those two commands.@refill
1999242660Smarkm
1999342660SmarkmThe @code{texinfo-format-region} and @code{texinfo-format-buffer}
1999442660Smarkmcommands now automatically append @code{@@refill} to the end of each
1999542660Smarkmparagraph that should be filled.  They do not append @code{@@refill} to
1999642660Smarkmthe ends of paragraphs that contain @code{@@*} or @w{@code{@@w@{ @dots{}@}}}
1999742660Smarkmand therefore do not refill or indent them.@refill
1999842660Smarkm
19999146515Sru@end ignore
2000042660Smarkm
2000142660Smarkm
2000242660Smarkm@c These are no longer ``new'', and the explanations
2000342660Smarkm@c are all given elsewhere anyway, I think.  --karl, 25apr97.
2000456160Sru@c So ignore the entire appendix.
2000556160Sru@ignore
2000642660Smarkm@c node New Features, Command and Variable Index, Obtaining TeX, Top
2000742660Smarkm@c appendix Second Edition Features
2000842660Smarkm
2000942660Smarkm@tex
2001042660Smarkm% Widen the space for the first column so three control-character
2001142660Smarkm% strings fit in the first column.  Switched back to default .8in
2001242660Smarkm% value at end of chapter.
2001342660Smarkm\global\tableindent=1.0in
2001442660Smarkm@end tex
2001542660Smarkm
2001642660SmarkmThe second edition of the Texinfo manual describes more than 20 new
2001742660SmarkmTexinfo mode commands and more than 50 previously undocumented Texinfo
2001842660Smarkm@@-commands.  This edition is more than twice the length of the first
2001942660Smarkmedition.@refill
2002042660Smarkm
2002142660SmarkmHere is a brief description of the new commands.@refill
2002242660Smarkm
2002356160Sru@c menu
2002442660Smarkm* New Texinfo Mode Commands::   The updating commands are especially useful.
2002542660Smarkm* New Commands::                Many newly described @@-commands.
2002656160Sru@c end menu
2002742660Smarkm
2002842660Smarkm@c node New Texinfo Mode Commands, New Commands, Obtaining TeX, Obtaining TeX
2002942660Smarkm@c appendixsec New Texinfo Mode Commands
2003042660Smarkm
2003142660SmarkmTexinfo mode provides commands and features especially designed for
2003242660Smarkmworking with Texinfo files.  More than 20 new commands have been
2003342660Smarkmadded, including commands for automatically creating and updating
2003442660Smarkmboth nodes and menus.  This is a tedious task when done by hand.@refill
2003542660Smarkm
2003642660SmarkmThe keybindings are intended to be somewhat mnemonic.@refill
2003742660Smarkm
2003842660Smarkm@c subheading Update all nodes and menus
2003942660Smarkm
2004042660SmarkmThe @code{texinfo-master-menu} command is the primary command:
2004142660Smarkm
2004242660Smarkm@table @kbd
2004342660Smarkm@item C-c C-u m
2004442660Smarkm@itemx M-x texinfo-master-menu
2004542660SmarkmCreate or update a master menu.
2004642660SmarkmWith @kbd{C-u} as a prefix argument,
2004742660Smarkmfirst create or update all nodes
2004842660Smarkmand regular menus.
2004942660Smarkm@end table
2005042660Smarkm
2005142660Smarkm@c subheading Update Pointers
2005242660Smarkm
2005342660Smarkm@noindent
2005442660SmarkmCreate or update `Next', `Previous', and `Up' node pointers.@refill
2005542660Smarkm
2005642660Smarkm@noindent
2005742660Smarkm@xref{Updating Nodes and Menus}.
2005842660Smarkm
2005942660Smarkm@table @kbd
2006042660Smarkm@item C-c C-u C-n
2006142660Smarkm@itemx M-x texinfo-update-node
2006242660SmarkmUpdate a node.
2006342660Smarkm
2006442660Smarkm@item C-c C-u C-e
2006542660Smarkm@itemx M-x texinfo-every-node-update
2006642660SmarkmUpdate every node in the buffer.
2006742660Smarkm@end table
2006842660Smarkm
2006942660Smarkm@c subheading Update Menus
2007042660Smarkm
2007142660Smarkm@noindent
2007242660SmarkmCreate or update menus.@refill
2007342660Smarkm
2007442660Smarkm@noindent
2007542660Smarkm@xref{Updating Nodes and Menus}.
2007642660Smarkm
2007742660Smarkm@table @kbd
2007842660Smarkm@item C-c C-u C-m
2007942660Smarkm@itemx M-x texinfo-make-menu
2008042660SmarkmMake or update a menu.
2008142660Smarkm
2008242660Smarkm@item C-c C-u C-a
2008342660Smarkm@itemx M-x texinfo-all-menus-update
2008442660SmarkmMake or update all the menus in a buffer.
2008542660SmarkmWith @kbd{C-u} as a prefix argument,
2008642660Smarkmfirst update all the nodes.
2008742660Smarkm@end table
2008842660Smarkm
2008942660Smarkm@c subheading Insert Title as Description
2009042660Smarkm
2009142660Smarkm@noindent
2009242660SmarkmInsert a node's chapter or section title in the space for the
2009342660Smarkmdescription in a menu entry line; position point so you can edit the
2009442660Smarkminsert.  (This command works somewhat differently than the other
2009542660Smarkminsertion commands, which insert only a predefined string.)@refill
2009642660Smarkm
2009742660Smarkm@noindent
2009842660Smarkm@xref{Inserting, Inserting Frequently Used Commands}.
2009942660Smarkm
2010042660Smarkm@table @kbd
2010142660Smarkm@item C-c C-c C-d
2010242660SmarkmInsert title.
2010342660Smarkm@end table
2010442660Smarkm
2010542660Smarkm@c subheading Format for Info
2010642660Smarkm
2010742660Smarkm@noindent
2010842660SmarkmProvide keybindings both for the Info formatting commands that are
2010942660Smarkmwritten in Emacs Lisp and for @code{makeinfo} that is written in
2011042660SmarkmC.@refill
2011142660Smarkm
2011242660Smarkm@noindent
2011342660Smarkm@xref{Info Formatting}.
2011442660Smarkm
2011542660Smarkm@noindent
2011642660SmarkmUse the Emacs lisp @code{texinfo-format@dots{}} commands:
2011742660Smarkm
2011842660Smarkm@table @kbd
2011942660Smarkm@item C-c C-e C-r
2012042660SmarkmFormat the region.
2012142660Smarkm
2012242660Smarkm@item C-c C-e C-b
2012342660SmarkmFormat the buffer.
2012442660Smarkm@end table
2012542660Smarkm
2012642660Smarkm@noindent
2012742660SmarkmUse @code{makeinfo}:
2012842660Smarkm
2012942660Smarkm@table @kbd
2013042660Smarkm@item C-c C-m C-r
2013142660SmarkmFormat the region.
2013242660Smarkm
2013342660Smarkm@item C-c C-m C-b
2013442660SmarkmFormat the buffer.
2013542660Smarkm
2013642660Smarkm@item C-c C-m C-l
2013742660SmarkmRecenter the @code{makeinfo} output buffer.
2013842660Smarkm
2013942660Smarkm@item C-c C-m C-k
2014042660SmarkmKill the @code{makeinfo} formatting job.
2014142660Smarkm@end table
2014242660Smarkm
2014342660Smarkm@c subheading Typeset and Print
2014442660Smarkm
2014542660Smarkm@noindent
20146146515SruTypeset and print Texinfo documents from within Emacs.
2014742660Smarkm
2014842660Smarkm@noindent
2014942660Smarkm@xref{Printing}.
2015042660Smarkm
2015142660Smarkm@table @kbd
2015242660Smarkm@item C-c C-t C-b
2015342660SmarkmRun @code{texi2dvi} on the buffer.
2015442660Smarkm
2015542660Smarkm@item C-c C-t C-r
2015642660SmarkmRun @TeX{} on the region.
2015742660Smarkm
2015842660Smarkm@item C-c C-t C-i
2015942660SmarkmRun @code{texindex}.
2016042660Smarkm
2016142660Smarkm@item C-c C-t C-p
2016242660SmarkmPrint the DVI file.
2016342660Smarkm
2016442660Smarkm@item C-c C-t C-q
2016542660SmarkmShow the print queue.
2016642660Smarkm
2016742660Smarkm@item C-c C-t C-d
2016842660SmarkmDelete a job from the print queue.
2016942660Smarkm
2017042660Smarkm@item C-c C-t C-k
2017142660SmarkmKill the current @TeX{} formatting job.
2017242660Smarkm
2017342660Smarkm@item C-c C-t C-x
2017442660SmarkmQuit a currently stopped @TeX{} formatting job.
2017542660Smarkm
2017642660Smarkm@item C-c C-t C-l
2017742660SmarkmRecenter the output buffer.
2017842660Smarkm@end table
2017942660Smarkm
2018042660Smarkm@c subheading Other Updating Commands
2018142660Smarkm
2018242660Smarkm@noindent
2018342660SmarkmThe ``other updating commands'' do not have standard keybindings because
2018442660Smarkmthey are used less frequently.@refill
2018542660Smarkm
2018642660Smarkm@noindent
2018742660Smarkm@xref{Other Updating Commands}.
2018842660Smarkm
2018942660Smarkm@table @kbd
2019042660Smarkm@item M-x texinfo-insert-node-lines
2019142660SmarkmInsert missing @code{@@node} lines using
2019242660Smarkmsection titles as node names.
2019342660Smarkm
2019442660Smarkm@item M-x texinfo-multiple-files-update
2019542660SmarkmUpdate a multi-file document.
2019642660SmarkmWith a numeric prefix, such as @kbd{C-u 8},
2019742660Smarkmupdate  @strong{every} pointer and
2019842660Smarkmmenu in @strong{all} the files and
2019942660Smarkmthen insert a master menu.
2020042660Smarkm
2020142660Smarkm@item M-x texinfo-indent-menu-description
2020242660SmarkmIndent descriptions in menus.
2020342660Smarkm
2020442660Smarkm@item M-x texinfo-sequential-node-update
2020542660SmarkmInsert node pointers in strict sequence.
2020642660Smarkm@end table
2020742660Smarkm
2020856160Sru@c no.de New Commands,  , New Texinfo Mode Commands, Obtaining TeX
2020956160Sru@c appendix.sec New Texinfo @@-Commands
2021042660Smarkm
2021142660SmarkmThe second edition of the Texinfo manual describes more than 50
2021242660Smarkmcommands that were not described in the first edition.  A third or so
2021342660Smarkmof these commands existed in Texinfo but were not documented in the
2021442660Smarkmmanual; the others are new.  Here is a listing, with brief
2021542660Smarkmdescriptions of them:@refill
2021642660Smarkm
2021742660Smarkm@c subheading Indexing
2021842660Smarkm
2021942660Smarkm@noindent
2022042660SmarkmCreate your own index, and merge indices.@refill
2022142660Smarkm
2022242660Smarkm@noindent
2022342660Smarkm@xref{Indices}.
2022442660Smarkm
2022542660Smarkm@table @kbd
2022642660Smarkm@item @@defindex @var{index-name}
2022742660SmarkmDefine a new index and its indexing command.
2022842660SmarkmSee also the @code{@@defcodeindex} command.
2022942660Smarkm
2023042660Smarkm@c written verbosely to avoid overfull hbox
2023142660Smarkm@item @@synindex @var{from-index} @var{into-index}
2023242660SmarkmMerge the @var{from-index} index into the @var{into-index} index.
2023342660SmarkmSee also the @code{@@syncodeindex} command.
2023442660Smarkm@end table
2023542660Smarkm
2023642660Smarkm@c subheading Definitions
2023742660Smarkm
2023842660Smarkm@noindent
2023942660SmarkmDescribe functions, variables, macros,
2024042660Smarkmcommands, user options, special forms, and other such artifacts in a
2024142660Smarkmuniform format.@refill
2024242660Smarkm
2024342660Smarkm@noindent
2024442660Smarkm@xref{Definition Commands}.
2024542660Smarkm
2024642660Smarkm@table @kbd
2024742660Smarkm@item @@deffn @var{category} @var{name} @var{arguments}@dots{}
2024842660SmarkmFormat a description for functions, interactive
2024942660Smarkmcommands, and similar entities.
2025042660Smarkm
2025142660Smarkm@item @@defvr, @@defop, @dots{}
2025242660Smarkm15 other related commands.
2025342660Smarkm@end table
2025442660Smarkm
2025542660Smarkm@c subheading Glyphs
2025642660Smarkm
2025742660Smarkm@noindent
2025842660SmarkmIndicate the results of evaluation, expansion,
2025942660Smarkmprinted output, an error message, equivalence of expressions, and the
2026042660Smarkmlocation of point.@refill
2026142660Smarkm
2026242660Smarkm@noindent
2026342660Smarkm@xref{Glyphs}.
2026442660Smarkm
2026542660Smarkm@table @kbd
2026642660Smarkm@item @@equiv@{@}
2026742660Smarkm@itemx @equiv{}
2026842660SmarkmEquivalence:
2026942660Smarkm
2027042660Smarkm@item @@error@{@}
2027142660Smarkm@itemx @error{}
2027242660SmarkmError message
2027342660Smarkm
2027442660Smarkm@item @@expansion@{@}
2027542660Smarkm@itemx @expansion{}
2027642660SmarkmMacro expansion
2027742660Smarkm
2027842660Smarkm@item @@point@{@}
2027942660Smarkm@itemx @point{}
2028042660SmarkmPosition of point
2028142660Smarkm
2028242660Smarkm@item @@print@{@}
2028342660Smarkm@itemx @print{}
2028442660SmarkmPrinted output
2028542660Smarkm
2028642660Smarkm@item @@result@{@}
2028742660Smarkm@itemx @result{}
2028842660SmarkmResult of an expression
2028942660Smarkm@end table
2029042660Smarkm
2029142660Smarkm@c subheading Page Headings
2029242660Smarkm
2029342660Smarkm@noindent
2029442660SmarkmCustomize page headings.
2029542660Smarkm
2029642660Smarkm@noindent
2029742660Smarkm@xref{Headings}.
2029842660Smarkm
2029942660Smarkm@table @kbd
2030042660Smarkm@item @@headings @var{on-off-single-double}
2030142660SmarkmHeadings on or off, single, or double-sided.
2030242660Smarkm
2030342660Smarkm@item @@evenfooting [@var{left}] @@| [@var{center}] @@| [@var{right}]
2030442660SmarkmFootings for even-numbered (left-hand) pages.
2030542660Smarkm
2030642660Smarkm@item @@evenheading, @@everyheading, @@oddheading, @dots{}
2030742660SmarkmFive other related commands.
2030842660Smarkm
2030942660Smarkm@item @@thischapter
2031042660SmarkmInsert name of chapter and chapter number.
2031142660Smarkm
2031242660Smarkm@item @@thischaptername, @@thisfile, @@thistitle, @@thispage
2031342660SmarkmRelated commands.
2031442660Smarkm@end table
2031542660Smarkm
2031642660Smarkm@c subheading Formatting
2031742660Smarkm
2031842660Smarkm@noindent
2031942660SmarkmFormat blocks of text.
2032042660Smarkm
2032142660Smarkm@noindent
2032242660Smarkm@xref{Quotations and Examples}, and@*
2032342660Smarkm@ref{Lists and Tables, , Making Lists and Tables}.
2032442660Smarkm
2032542660Smarkm@table @kbd
2032642660Smarkm@item @@cartouche
20327146515SruDraw rounded box surrounding text (no effect in Info).
2032842660Smarkm
2032942660Smarkm@item @@enumerate @var{optional-arg}
2033042660SmarkmEnumerate a list with letters or numbers.
2033142660Smarkm
2033242660Smarkm@item @@exdent @var{line-of-text}
2033342660SmarkmRemove indentation.
2033442660Smarkm
2033542660Smarkm@item @@flushleft
2033642660SmarkmLeft justify.
2033742660Smarkm
2033842660Smarkm@item @@flushright
2033942660SmarkmRight justify.
2034042660Smarkm
2034142660Smarkm@item @@format
2034242660SmarkmDo not narrow nor change font.
2034342660Smarkm
2034442660Smarkm@item @@ftable @var{formatting-command}
2034542660Smarkm@itemx @@vtable @var{formatting-command}
2034642660SmarkmTwo-column table with indexing.
2034742660Smarkm
2034842660Smarkm@item @@lisp
2034942660SmarkmFor an example of Lisp code.
2035042660Smarkm
2035142660Smarkm@item @@smallexample
2035242660Smarkm@itemx @@smalllisp
20353114472SruLike @@table and @@lisp, but for (originally) @@smallbook.
2035442660Smarkm@end table
2035542660Smarkm
2035642660Smarkm@c subheading Conditionals
2035742660Smarkm
2035842660Smarkm@noindent
2035942660SmarkmConditionally format text.
2036042660Smarkm
2036142660Smarkm@noindent
2036242660Smarkm@xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill
2036342660Smarkm
2036442660Smarkm@table @kbd
2036542660Smarkm@item @@set @var{flag} [@var{string}]
2036642660SmarkmSet a flag.  Optionally, set value
2036742660Smarkmof @var{flag} to @var{string}.
2036842660Smarkm
2036942660Smarkm@item @@clear @var{flag}
2037042660SmarkmClear a flag.
2037142660Smarkm
2037242660Smarkm@item @@value@{@var{flag}@}
2037342660SmarkmReplace with value to which @var{flag} is set.
2037442660Smarkm
2037542660Smarkm@item @@ifset @var{flag}
2037642660SmarkmFormat, if @var{flag} is set.
2037742660Smarkm
2037842660Smarkm@item @@ifclear @var{flag}
2037942660SmarkmIgnore, if @var{flag} is set.
2038042660Smarkm@end table
2038142660Smarkm
2038242660Smarkm@c subheading @@heading series for Titles
2038342660Smarkm
2038442660Smarkm@noindent
2038542660SmarkmProduce unnumbered headings that do not appear in a table of contents.
2038642660Smarkm
2038742660Smarkm@noindent
2038842660Smarkm@xref{Structuring}.
2038942660Smarkm
2039042660Smarkm@table @kbd
2039142660Smarkm@item @@heading @var{title}
2039242660SmarkmUnnumbered section-like heading not listed
2039342660Smarkmin the table of contents of a printed manual.
2039442660Smarkm
2039542660Smarkm@item @@chapheading, @@majorheading, @@c subheading, @@subsubheading
2039642660SmarkmRelated commands.
2039742660Smarkm@end table
2039842660Smarkm
2039942660Smarkm@need 1000
2040042660Smarkm@c subheading Font commands
2040142660Smarkm
2040242660Smarkm@need 1000
2040342660Smarkm@noindent
2040442660Smarkm@xref{Smallcaps}, and @*
2040542660Smarkm@ref{Fonts}.
2040642660Smarkm
2040742660Smarkm@table @kbd
2040842660Smarkm@item @@r@{@var{text}@}
2040942660SmarkmPrint in roman font.
2041042660Smarkm
2041142660Smarkm@item @@sc@{@var{text}@}
2041242660SmarkmPrint in @sc{small caps} font.
2041342660Smarkm@end table
2041442660Smarkm
2041542660Smarkm@c subheading Miscellaneous
2041642660Smarkm
2041742660Smarkm@noindent
2041842660SmarkmSee @ref{title subtitle author, , @code{@@title} @code{@@subtitle} and @code{@@author} Commands},@*
2041942660Smarkmsee @ref{Customized Highlighting},@*
2042042660Smarkmsee @ref{Overfull hboxes},@*
2042142660Smarkmsee @ref{Footnotes},@*
2042242660Smarkmsee @ref{dmn, , Format a Dimension},@*
2042342660Smarkmsee @ref{Raise/lower sections, , @code{@@raisesections} and @code{@@lowersections}},@*
2042442660Smarkmsee @ref{math, , @code{@@math}: Inserting Mathematical Expressions}.@*
2042542660Smarkmsee @ref{minus, , Inserting a Minus Sign},@*
2042642660Smarkmsee @ref{paragraphindent, , Paragraph Indenting},@*
2042742660Smarkmsee @ref{Cross Reference Commands},@*
2042842660Smarkmsee @ref{title subtitle author, , @code{@@title} @code{@@subtitle} and @code{@@author}}, and@*
2042942660Smarkmsee @ref{Custom Headings, , How to Make Your Own Headings}.
2043042660Smarkm
2043142660Smarkm@table @kbd
2043242660Smarkm@item @@author @var{author}
2043342660SmarkmTypeset author's name.
2043442660Smarkm
2043542660Smarkm@c @item @@definfoenclose @var{new-command}, @var{before}, @var{after},
2043642660Smarkm@c Define a highlighting command for Info.  (Info only.)
2043742660Smarkm
2043842660Smarkm@item @@finalout
2043942660SmarkmProduce cleaner printed output.
2044042660Smarkm
2044142660Smarkm@item @@footnotestyle @var{end-or-separate}
2044242660SmarkmSpecify footnote style.
2044342660Smarkm
2044442660Smarkm@item @@dmn@{@var{dimension}@}
2044542660SmarkmFormat a dimension.
2044642660Smarkm
2044742660Smarkm@item @@global@@let@var{new-cmd}=@var{existing-cmd}
2044842660SmarkmDefine a highlighting command for @TeX{}. (@TeX{} only.)
2044942660Smarkm
2045042660Smarkm@item @@lowersections
2045142660SmarkmReduce hierarchical level of sectioning commands.
2045242660Smarkm
2045342660Smarkm@item @@math@{@var{mathematical-expression}@}
2045442660SmarkmFormat a mathematical expression.
2045542660Smarkm
2045642660Smarkm@item @@minus@{@}
2045742660SmarkmGenerate a minus sign.
2045842660Smarkm
2045942660Smarkm@item @@paragraphindent @var{asis-or-number}
2046042660SmarkmSpecify paragraph indentation.
2046142660Smarkm
2046242660Smarkm@item @@raisesections
2046342660SmarkmRaise hierarchical level of sectioning commands.
2046442660Smarkm
2046542660Smarkm@item @@ref@{@var{node-name}, @r{[}@var{entry}@r{]}, @r{[}@var{topic-or-title}@r{]}, @r{[}@var{info-file}@r{]}, @r{[}@var{manual}@r{]}@}
2046642660SmarkmMake a reference.  In the printed manual, the
2046742660Smarkmreference does not start with the word `see'.
2046842660Smarkm
2046942660Smarkm@item @@title @var{title}
2047042660SmarkmTypeset @var{title} in the alternative
2047142660Smarkmtitle page format.
2047242660Smarkm
2047342660Smarkm@item @@subtitle @var{subtitle}
2047442660SmarkmTypeset @var{subtitle} in the alternative
2047542660Smarkmtitle page format.
2047642660Smarkm
2047742660Smarkm@item @@today@{@}
2047842660SmarkmInsert the current date.
2047942660Smarkm@end table
2048042660Smarkm@tex
2048142660Smarkm% Switch width of first column of tables back to default value
2048242660Smarkm\global\tableindent=.8in
2048342660Smarkm@end tex
2048442660Smarkm@end ignore
2048542660Smarkm
2048656160Sru
20487100513Sru@node Copying This Manual
20488100513Sru@appendix Copying This Manual
2048993139Sru
20490100513Sru@menu
20491100513Sru* GNU Free Documentation License::  License for copying this manual.
20492100513Sru@end menu
2049393139Sru
20494100513Sru@include fdl.texi
2049593139Sru
2049693139Sru
2049756160Sru@node Command and Variable Index
2049842660Smarkm@unnumbered Command and Variable Index
2049942660Smarkm
2050042660SmarkmThis is an alphabetical list of all the @@-commands, assorted Emacs Lisp
2050142660Smarkmfunctions, and several variables.  To make the list easier to use, the
2050242660Smarkmcommands are listed without their preceding @samp{@@}.@refill
2050342660Smarkm
2050442660Smarkm@printindex fn
2050542660Smarkm
2050642660Smarkm
2050756160Sru@node Concept Index
2050842660Smarkm@unnumbered Concept Index
2050942660Smarkm
2051042660Smarkm@printindex cp
2051142660Smarkm
2051242660Smarkm
2051342660Smarkm@bye
20514