# Texinfo

## October 1996

Robert J. Chassell
Richard M. Stallman

index (arbitrarily chosen to be the concept index).

@dircategory Texinfo documentation system @direntry * Texinfo: (texinfo). The GNU documentation format. * install-info: (texinfo)Invoking install-info. Updating info/dir entries. * texi2dvi: (texinfo)Format with texi2dvi. Printing Texinfo documentation. * texindex: (texinfo)Format with tex/texindex. Sorting Texinfo index files.

@shorttitlepage Texinfo

Copyright (C) 1988, 1990, 1991, 1992, 1993, 1995, 1996 Free Software Foundation, Inc.

This is the second edition of the Texinfo documentation,
and is consistent with version 2 of texinfo.tex'.

59 Temple Place Suite 330,
Boston, MA 02111-1307 USA


produces

# Glyphs for Examples

In Texinfo, code is often illustrated in examples that are delimited by @example and @end example, or by @lisp and @end lisp. In such examples, you can indicate the results of evaluation or an expansion using =>' or ==>'. Likewise, there are commands to insert glyphs to indicate printed output, error messages, equivalence of expressions, and the location of point.

The glyph-insertion commands do not need to be used within an example, but most often they are. Every glyph-insertion command is followed by a pair of left- and right-hand braces.

=>
@result{} points to the result of an expression.
==>
@expansion{} shows the results of a macro expansion.
-|
@print{} indicates printed output.
error-->
@error{} indicates that the following text is an error message.
==
@equiv{} indicates the exact equivalence of two forms.
-!-
@point{} shows the location of point.

## =>: Indicating Evaluation

Use the @result{} command to indicate the result of evaluating an expression.

The @result{} command is displayed as =>' in Info and as =>' in the printed output.

Thus, the following,

(cdr '(1 2 3))
=> (2 3)


may be read as "(cdr '(1 2 3)) evaluates to (2 3)".

## ==>: Indicating an Expansion

When an expression is a macro call, it expands into a new expression. You can indicate the result of the expansion with the @expansion{} command.

The @expansion{} command is displayed as ==>' in Info and as ==>' in the printed output.

For example, the following

@lisp
(third '(a b c))
@expansion{} (car (cdr (cdr '(a b c))))
@result{} c
@end lisp


produces

(third '(a b c))
==> (car (cdr (cdr '(a b c))))
=> c


(third '(a b c)) expands to (car (cdr (cdr '(a b c)))); the result of evaluating the expression is c.

Often, as in this case, an example looks better if the @expansion{} and @result{} commands are indented five spaces.

## -|: Indicating Printed Output

Sometimes an expression will print output during its execution. You can indicate the printed output with the @print{} command.

The @print{} command is displayed as -|' in Info and as -|' in the printed output.

In the following example, the printed text is indicated with -|', and the value of the expression follows on the last line.

(progn (print 'foo) (print 'bar))
-| foo
-| bar
=> bar


In a Texinfo source file, this example is written as follows:

@lisp
(progn (print 'foo) (print 'bar))
@print{} foo
@print{} bar
@result{} bar
@end lisp


## error-->: Indicating an Error Message

A piece of code may cause an error when you evaluate it. You can designate the error message with the @error{} command.

The @error{} command is displayed as error-->' in Info and as error-->' in the printed output.

Thus,

@lisp
(+ 23 'x)
@error{} Wrong type argument: integer-or-marker-p, x
@end lisp


produces

(+ 23 'x)
error--> Wrong type argument: integer-or-marker-p, x


This indicates that the following error message is printed when you evaluate the expression:

Wrong type argument: integer-or-marker-p, x


Note that error-->' itself is not part of the error message.

## ==: Indicating Equivalence

Sometimes two expressions produce identical results. You can indicate the exact equivalence of two forms with the @equiv{} command.

The @equiv{} command is displayed as ==' in Info and as ==' in the printed output.

Thus,

@lisp
(make-sparse-keymap) @equiv{} (list 'keymap)
@end lisp


produces

(make-sparse-keymap) == (list 'keymap)


This indicates that evaluating (make-sparse-keymap) produces identical results to evaluating (list 'keymap).

## Indicating Point in a Buffer

Sometimes you need to show an example of text in an Emacs buffer. In such examples, the convention is to include the entire contents of the buffer in question between two lines of dashes containing the buffer name.

You can use the @point{}' command to show the location of point in the text in the buffer. (The symbol for point, of course, is not part of the text in the buffer; it indicates the place between two characters where point is located.)

The @point{} command is displayed as -!-' in Info and as -!-' in the printed output.

The following example shows the contents of buffer foo' before and after evaluating a Lisp command to insert the word changed.

---------- Buffer: foo ----------
This is the -!-contents of foo.
---------- Buffer: foo ----------


(insert "changed ")
=> nil
---------- Buffer: foo ----------
This is the changed -!-contents of foo.
---------- Buffer: foo ----------



In a Texinfo source file, the example is written like this:

@example
---------- Buffer: foo ----------
This is the @point{}contents of foo.
---------- Buffer: foo ----------

(insert "changed ")
@result{} nil
---------- Buffer: foo ----------
This is the changed @point{}contents of foo.
---------- Buffer: foo ----------
@end example


# Making and Preventing Breaks

Usually, a Texinfo file is processed both by TeX and by one of the Info formatting commands. Line, paragraph, or page breaks sometimes occur in the wrong' place in one or other form of output. You must ensure that text looks right both in the printed manual and in the Info file.

For example, in a printed manual, page breaks may occur awkwardly in the middle of an example; to prevent this, you can hold text together using a grouping command that keeps the text from being split across two pages. Conversely, you may want to force a page break where none would occur normally. Fortunately, problems like these do not often arise. When they do, use the break, break prevention, or pagination commands.

The break commands create or allow line and paragraph breaks:

@*
Force a line break.
@sp n
Skip n blank lines.
@-
Insert a discretionary hyphen.
@hyphenation{hy-phen-a-ted words}
Define hyphen points in hy-phen-a-ted words.

The line-break-prevention command holds text together all on one line:

@w{text}
Prevent text from being split and hyphenated across two lines.

The pagination commands apply only to printed output, since Info files do not have pages.

@page
Start a new page in the printed manual.
@group
Hold text together that must appear on one printed page.
@need mils
Start a new printed page if not enough space on this one.

## @*: Generate Line Breaks

The @* command forces a line break in both the printed manual and in Info.

For example,

This line @* is broken @*in two places.


produces

This line
is broken
in two places.


(Note that the space after the first @* command is faithfully carried down to the next line.)

The @* command is often used in a file's copyright page:

This is edition 2.0 of the Texinfo documentation,@*
and is for ...


In this case, the @* command keeps TeX from stretching the line across the whole page in an ugly manner.

Please note: Do not write braces after an @* command; they are not needed.

Do not write an @refill command at the end of a paragraph containing an @* command; it will cause the paragraph to be refilled after the line break occurs, negating the effect of the line break.

## @- and @hyphenation: Helping TeX hyphenate

Although TeX's hyphenation algorithm is generally pretty good, it does miss useful hyphenation points from time to time. (Or, far more rarely, insert an incorrect hyphenation.) So, for documents with an unusual vocabulary or when fine-tuning for a printed edition, you may wish to help TeX out. Texinfo supports two commands for this:

@-
Insert a discretionary hyphen, i.e., a place where TeX can (but does not have to) hyphenate. This is especially useful when you notice an overfull hbox is due to TeX missing a hyphenation (see section Overfull "hboxes"). TeX will not insert any hyphenation points in a word containing @-.
@hyphenation{hy-phen-a-ted words}
Tell TeX how to hyphenate hy-phen-a-ted words. As shown, you put a -' at each hyphenation point. For example:
@hyphenation{man-u-script man-u-scripts}

TeX only uses the specified hyphenation points when the words match exactly, so give all necessary variants.

Info output is not hyphenated, so these commands have no effect there.

## @w{text}: Prevent Line Breaks

@w{text} outputs text and prohibits line breaks within text.

You can use the @w command to prevent TeX from automatically hyphenating a long name or phrase that accidentally falls near the end of a line.

You can copy GNU software from @w{@file{prep.ai.mit.edu}}.


produces

You can copy GNU software from prep.ai.mit.edu'.

Caution: Do not write an @refill command at the end of a paragraph containing an @w command; it will cause the paragraph to be refilled and may thereby negate the effect of the @w command.

## @sp n: Insert Blank Lines

A line beginning with and containing only @sp n generates n blank lines of space in both the printed manual and the Info file. @sp also forces a paragraph break. For example,

@sp 2


generates two blank lines.

The @sp command is most often used in the title page.

## @page: Start a New Page

A line containing only @page starts a new page in a printed manual. The command has no effect on Info files since they are not paginated. An @page command is often used in the @titlepage section of a Texinfo file to start the copyright page.

## @group: Prevent Page Breaks

The @group command (on a line by itself) is used inside an @example or similar construct to begin an unsplittable vertical group, which will appear entirely on one page in the printed output. The group is terminated by a line containing only @end group. These two lines produce no output of their own, and in the Info file output they have no effect at all.

Although @group would make sense conceptually in a wide variety of contexts, its current implementation works reliably only within @example and variants, and within @display, @format, @flushleft and @flushright. See section Quotations and Examples. (What all these commands have in common is that each line of input produces a line of output.) In other contexts, @group can cause anomalous vertical spacing.

This formatting requirement means that you should write:

@example
@group
...
@end group
@end example


with the @group and @end group commands inside the @example and @end example commands.

The @group command is most often used to hold an example together on one page. In this Texinfo manual, more than 100 examples contain text that is enclosed between @group and @end group.

If you forget to end a group, you may get strange and unfathomable error messages when you run TeX. This is because TeX keeps trying to put the rest of the Texinfo file onto the one page and does not start to generate error messages until it has processed considerable text. It is a good rule of thumb to look for a missing @end group if you get incomprehensible error messages in TeX.

## @need mils: Prevent Page Breaks

A line containing only @need n starts a new page in a printed manual if fewer than n mils (thousandths of an inch) remain on the current page. Do not use braces around the argument n. The @need command has no effect on Info files since they are not paginated.

This paragraph is preceded by an @need command that tells TeX to start a new page if fewer than 800 mils (eight-tenths inch) remain on the page. It looks like this:

@need 800
This paragraph is preceded by ...


The @need command is useful for preventing orphans (single lines at the bottoms of printed pages).

# Definition Commands

The @deffn command and the other definition commands enable you to describe functions, variables, macros, commands, user options, special forms and other such artifacts in a uniform format.

In the Info file, a definition causes the entity category---Function', Variable', or whatever--to appear at the beginning of the first line of the definition, followed by the entity's name and arguments. In the printed manual, the command causes TeX to print the entity's name and its arguments on the left margin and print the category next to the right margin. In both output formats, the body of the definition is indented. Also, the name of the entity is entered into the appropriate index: @deffn enters the name into the index of functions, @defvr enters it into the index of variables, and so on.

A manual need not and should not contain more than one definition for a given name. An appendix containing a summary should use @table rather than the definition commands.

## The Template for a Definition

The @deffn command is used for definitions of entities that resemble functions. To write a definition using the @deffn command, write the @deffn command at the beginning of a line and follow it on the same line by the category of the entity, the name of the entity itself, and its arguments (if any). Then write the body of the definition on succeeding lines. (You may embed examples in the body.) Finally, end the definition with an @end deffn command written on a line of its own. (The other definition commands follow the same format.)

The template for a definition looks like this:

@deffn category name arguments...
body-of-definition
@end deffn


For example,

@deffn Command forward-word count
This command moves point forward @var{count} words
(or backward if @var{count} is negative). ...
@end deffn


produces

Command: forward-word count
This function moves point forward count words (or backward if count is negative). ...

Capitalize the category name like a title. If the name of the category contains spaces, as in the phrase Interactive Command', write braces around it. For example:

@deffn {Interactive Command} isearch-forward
...
@end deffn


Otherwise, the second word will be mistaken for the name of the entity.

Some of the definition commands are more general than others. The @deffn command, for example, is the general definition command for functions and the like--for entities that may take arguments. When you use this command, you specify the category to which the entity belongs. The @deffn command possesses three predefined, specialized variations, @defun, @defmac, and @defspec, that specify the category for you: "Function", "Macro", and "Special Form" respectively. The @defvr command also is accompanied by several predefined, specialized variations for describing particular kinds of variables.

The template for a specialized definition, such as @defun, is similar to the template for a generalized definition, except that you do not need to specify the category:

@defun name arguments...
body-of-definition
@end defun


Thus,

@defun buffer-end flag
This function returns @code{(point-min)} if @var{flag}
is less than 1, @code{(point-max)} otherwise.
...
@end defun


produces

Function: buffer-end flag
This function returns (point-min) if flag is less than 1, (point-max) otherwise. ...

See section A Sample Function Definition, for a more detailed example of a function definition, including the use of @example inside the definition.

The other specialized commands work like @defun.

## Optional and Repeated Arguments

Some entities take optional or repeated arguments, which may be specified by a distinctive glyph that uses square brackets and ellipses. For example, a special form often breaks its argument list into separate arguments in more complicated ways than a straightforward function.

An argument enclosed within square brackets is optional. Thus, the phrase [optional-arg]' means that optional-arg is optional. An argument followed by an ellipsis is optional and may be repeated more than once. Thus, repeated-args...' stands for zero or more arguments. Parentheses are used when several arguments are grouped into additional levels of list structure in Lisp.

Here is the @defspec line of an example of an imaginary special form:

Special Form: foobar (var [from to [inc]]) body...

In this example, the arguments from and to are optional, but must both be present or both absent. If they are present, inc may optionally be specified as well. These arguments are grouped with the argument var into a list, to distinguish them from body, which includes all remaining elements of the form.

In a Texinfo source file, this @defspec line is written like this (except it would not be split over two lines, as it is in this example).

@defspec foobar (@var{var} [@var{from} @var{to}
[@var{inc}]]) @var{body}@dots{}


The function is listed in the Command and Variable Index under foobar'.

## Two or More First' Lines

To create two or more first' or header lines for a definition, follow the first @deffn line by a line beginning with @deffnx. The @deffnx command works exactly like @deffn except that it does not generate extra vertical white space between it and the preceding line.

For example,

@deffn {Interactive Command} isearch-forward
@deffnx {Interactive Command} isearch-backward
These two search commands are similar except ...
@end deffn


produces

Interactive Command: isearch-forward
Interactive Command: isearch-backward
These two search commands are similar except ...

Each of the other definition commands has an x' form: @defunx, @defvrx, @deftypefunx, etc.

The x' forms work just like @itemx; see section @itemx.

## The Definition Commands

Texinfo provides more than a dozen definition commands, all of which are described in this section.

The definition commands automatically enter the name of the entity in the appropriate index: for example, @deffn, @defun, and @defmac enter function names in the index of functions; @defvr and @defvar enter variable names in the index of variables.

Although the examples that follow mostly illustrate Lisp, the commands can be used for other programming languages.

### Functions and Similar Entities

This section describes the commands for describing functions and similar entities:

@deffn category name arguments...
The @deffn command is the general definition command for functions, interactive commands, and similar entities that may take arguments. You must choose a term to describe the category of entity being defined; for example, "Function" could be used if the entity is a function. The @deffn command is written at the beginning of a line and is followed on the same line by the category of entity being described, the name of this particular entity, and its arguments, if any. Terminate the definition with @end deffn on a line of its own. For example, here is a definition:
@deffn Command forward-char nchars
Move point forward @var{nchars} characters.
@end deffn

This shows a rather terse definition for a "command" named forward-char with one argument, nchars. @deffn prints argument names such as nchars in italics or upper case, as if @var had been used, because we think of these names as metasyntactic variables--they stand for the actual argument values. Within the text of the description, write an argument name explicitly with @var to refer to the value of the argument. In the example above, we used @var{nchars}' in this way. The template for @deffn is:
@deffn category name arguments...
body-of-definition
@end deffn

@defun name arguments...
The @defun command is the definition command for functions. @defun is equivalent to @deffn Function ...'. For example,
@defun set symbol new-value
Change the value of the symbol @var{symbol}
to @var{new-value}.
@end defun

shows a rather terse definition for a function set whose arguments are symbol and new-value. The argument names on the @defun line automatically appear in italics or upper case as if they were enclosed in @var. Terminate the definition with @end defun on a line of its own. The template is:
@defun function-name arguments...
body-of-definition
@end defun

@defun creates an entry in the index of functions.
@defmac name arguments...
The @defmac command is the definition command for macros. @defmac is equivalent to @deffn Macro ...' and works like @defun.
@defspec name arguments...
The @defspec command is the definition command for special forms. (In Lisp, a special form is an entity much like a function.) @defspec is equivalent to @deffn {Special Form} ...' and works like @defun.

### Variables and Similar Entities

Here are the commands for defining variables and similar entities:

@defvr category name
The @defvr command is a general definition command for something like a variable--an entity that records a value. You must choose a term to describe the category of entity being defined; for example, "Variable" could be used if the entity is a variable. Write the @defvr command at the beginning of a line and followed it on the same line by the category of the entity and the name of the entity. Capitalize the category name like a title. If the name of the category contains spaces, as in the name User Option', write braces around it. Otherwise, the second word will be mistaken for the name of the entity, for example:
@defvr {User Option} fill-column
This buffer-local variable specifies
the maximum width of filled lines.
...
@end defvr

Terminate the definition with @end defvr on a line of its own. The template is:
@defvr category name
body-of-definition
@end defvr

@defvr creates an entry in the index of variables for name.
@defvar name
The @defvar command is the definition command for variables. @defvar is equivalent to @defvr Variable ...'. For example:
@defvar kill-ring
...
@end defvar

The template is:
@defvar name
body-of-definition
@end defvar

@defvar creates an entry in the index of variables for name.
@defopt name
The @defopt command is the definition command for user options. @defopt is equivalent to @defvr {User Option} ...' and works like @defvar.

### Functions in Typed Languages

The @deftypefn command and its variations are for describing functions in C or any other language in which you must declare types of variables and functions.

@deftypefn category data-type name arguments...
The @deftypefn command is the general definition command for functions and similar entities that may take arguments and that are typed. The @deftypefn command is written at the beginning of a line and is followed on the same line by the category of entity being described, the type of the returned value, the name of this particular entity, and its arguments, if any. For example,
@deftypefn {Library Function} int foobar
(int @var{foo}, float @var{bar})
...
@end deftypefn

(where the text before the "...", shown above as two lines, would actually be a single line in a real Texinfo file) produces the following in Info:
-- Library Function: int foobar (int FOO, float BAR)
...

In a printed manual, it produces:

Library Function: int foobar (int foo, float bar)
...
This means that foobar is a "library function" that returns an int, and its arguments are foo (an int) and bar (a float). The argument names that you write in @deftypefn are not subject to an implicit @var---since the actual names of the arguments in @deftypefn are typically scattered among data type names and keywords, Texinfo cannot find them without help. Instead, you must write @var explicitly around the argument names. In the example above, the argument names are foo' and bar'. The template for @deftypefn is:
@deftypefn category data-type name arguments ...
body-of-description
@end deftypefn

Note that if the category or data type is more than one word then it must be enclosed in braces to make it a single argument. If you are describing a procedure in a language that has packages, such as Ada, you might consider using @deftypefn in a manner somewhat contrary to the convention described in the preceding paragraphs. For example:
@deftypefn stacks private push
(@var{s}:in out stack;
@var{n}:in integer)
...
@end deftypefn

(The @deftypefn arguments are shown split into three lines, but would be a single line in a real Texinfo file.) In this instance, the procedure is classified as belonging to the package stacks rather than classified as a procedure' and its data type is described as private. (The name of the procedure is push, and its arguments are s and n.) @deftypefn creates an entry in the index of functions for name.
@deftypefun data-type name arguments...
The @deftypefun command is the specialized definition command for functions in typed languages. The command is equivalent to @deftypefn Function ...'. Thus,
@deftypefun int foobar (int @var{foo}, float @var{bar})
...
@end deftypefun

produces the following in Info:
-- Function: int foobar (int FOO, float BAR)
...

and the following in a printed manual:

Function: int foobar (int foo, float bar)
...
The template is:
@deftypefun type name arguments...
body-of-description
@end deftypefun

@deftypefun creates an entry in the index of functions for name.

### Variables in Typed Languages

Variables in typed languages are handled in a manner similar to functions in typed languages. See section Functions in Typed Languages. The general definition command @deftypevr corresponds to @deftypefn and the specialized definition command @deftypevar corresponds to @deftypefun.

@deftypevr category data-type name
The @deftypevr command is the general definition command for something like a variable in a typed language--an entity that records a value. You must choose a term to describe the category of the entity being defined; for example, "Variable" could be used if the entity is a variable. The @deftypevr command is written at the beginning of a line and is followed on the same line by the category of the entity being described, the data type, and the name of this particular entity. For example:
@deftypevr {Global Flag} int enable
...
@end deftypevr

produces the following in Info:
-- Global Flag: int enable
...

and the following in a printed manual:

Global Flag: int enable
...
The template is:
@deftypevr category data-type name
body-of-description
@end deftypevr

@deftypevr creates an entry in the index of variables for name.
@deftypevar data-type name
The @deftypevar command is the specialized definition command for variables in typed languages. @deftypevar is equivalent to @deftypevr Variable ...'. For example:
@deftypevar int fubar
...
@end deftypevar

produces the following in Info:
-- Variable: int fubar
...

and the following in a printed manual:

Variable: int fubar
...
The template is:
@deftypevar data-type name
body-of-description
@end deftypevar

@deftypevar creates an entry in the index of variables for name.

### Object-Oriented Programming

Here are the commands for formatting descriptions about abstract objects, such as are used in object-oriented programming. A class is a defined type of abstract object. An instance of a class is a particular object that has the type of the class. An instance variable is a variable that belongs to the class but for which each instance has its own value.

In a definition, if the name of a class is truly a name defined in the programming system for a class, then you should write an @code around it. Otherwise, it is printed in the usual text font.

@defcv category class name
The @defcv command is the general definition command for variables associated with classes in object-oriented programming. The @defcv command is followed by three arguments: the category of thing being defined, the class to which it belongs, and its name. Thus,
@defcv {Class Option} Window border-pattern
...
@end defcv

illustrates how you would write the first line of a definition of the border-pattern class option of the class Window. The template is
@defcv category class name
...
@end defcv

@defcv creates an entry in the index of variables.
@defivar class name
The @defivar command is the definition command for instance variables in object-oriented programming. @defivar is equivalent to @defcv {Instance Variable} ...' The template is:
@defivar class instance-variable-name
body-of-definition
@end defivar

@defivar creates an entry in the index of variables.
@defop category class name arguments...
The @defop command is the general definition command for entities that may resemble methods in object-oriented programming. These entities take arguments, as functions do, but are associated with particular classes of objects. For example, some systems have constructs called wrappers that are associated with classes as methods are, but that act more like macros than like functions. You could use @defop Wrapper to describe one of these. Sometimes it is useful to distinguish methods and operations. You can think of an operation as the specification for a method. Thus, a window system might specify that all window classes have a method named expose; we would say that this window system defines an expose operation on windows in general. Typically, the operation has a name and also specifies the pattern of arguments; all methods that implement the operation must accept the same arguments, since applications that use the operation do so without knowing which method will implement it. Often it makes more sense to document operations than methods. For example, window application developers need to know about the expose operation, but need not be concerned with whether a given class of windows has its own method to implement this operation. To describe this operation, you would write:
@defop Operation windows expose

The @defop command is written at the beginning of a line and is followed on the same line by the overall name of the category of operation, the name of the class of the operation, the name of the operation, and its arguments, if any. The template is:
@defop category class name arguments...
body-of-definition
@end defop

@defop creates an entry, such as expose on windows', in the index of functions.
@defmethod class name arguments...
The @defmethod command is the definition command for methods in object-oriented programming. A method is a kind of function that implements an operation for a particular class of objects and its subclasses. In the Lisp Machine, methods actually were functions, but they were usually defined with defmethod. @defmethod is equivalent to @defop Method ...'. The command is written at the beginning of a line and is followed by the name of the class of the method, the name of the method, and its arguments, if any. For example,
@defmethod bar-class bar-method argument
...
@end defmethod

illustrates the definition for a method called bar-method of the class bar-class. The method takes an argument. The template is:
@defmethod class method-name arguments...
body-of-definition
@end defmethod

@defmethod creates an entry, such as bar-method on bar-class', in the index of functions.

### Data Types

Here is the command for data types:

@deftp category name attributes...
The @deftp command is the generic definition command for data types. The command is written at the beginning of a line and is followed on the same line by the category, by the name of the type (which is a word like int or float), and then by names of attributes of objects of that type. Thus, you could use this command for describing int or float, in which case you could use data type as the category. (A data type is a category of certain objects for purposes of deciding which operations can be performed on them.) In Lisp, for example, pair names a particular data type, and an object of that type has two slots called the CAR and the CDR. Here is how you would write the first line of a definition of pair.
@deftp {Data type} pair car cdr
...
@end deftp

The template is:
@deftp category name-of-type attributes...
body-of-definition
@end deftp

@deftp creates an entry in the index of data types.

## Conventions for Writing Definitions

When you write a definition using @deffn, @defun, or one of the other definition commands, please take care to use arguments that indicate the meaning, as with the count argument to the forward-word function. Also, if the name of an argument contains the name of a type, such as integer, take care that the argument actually is of that type.

## A Sample Function Definition

A function definition uses the @defun and @end defun commands. The name of the function follows immediately after the @defun command and it is followed, on the same line, by the parameter list.

Here is a definition from The GNU Emacs Lisp Reference Manual. (See section Calling Functions' in The GNU Emacs Lisp Reference Manual.)

Function: apply function &rest arguments
apply calls function with arguments, just like funcall but with one difference: the last of arguments is a list of arguments to give to function, rather than a single argument. We also say that this list is appended to the other arguments.

apply returns the result of calling function. As with funcall, function must either be a Lisp function or a primitive function; special forms and macros do not make sense in apply.

(setq f 'list)
=> list
(apply f 'x 'y 'z)
error--> Wrong type argument: listp, z
(apply '+ 1 2 '(3 4))
=> 10
(apply '+ '(1 2 3 4))
=> 10

(apply 'append '((a b c) nil (x y z) nil))
=> (a b c x y z)


An interesting example of using apply is found in the description of mapcar.

In the Texinfo source file, this example looks like this:

@defun apply function &rest arguments

@code{apply} calls @var{function} with
@var{arguments}, just like @code{funcall} but with one
difference: the last of @var{arguments} is a list of
arguments to give to @var{function}, rather than a single
argument.  We also say that this list is @dfn{appended}
to the other arguments.

@code{apply} returns the result of calling
@var{function}.  As with @code{funcall},
@var{function} must either be a Lisp function or a
primitive function; special forms and macros do not make
sense in @code{apply}.

@example
(setq f 'list)
@result{} list
(apply f 'x 'y 'z)
@error{} Wrong type argument: listp, z
(apply '+ 1 2 '(3 4))
@result{} 10
(apply '+ '(1 2 3 4))
@result{} 10

(apply 'append '((a b c) nil (x y z) nil))
@result{} (a b c x y z)
@end example

An interesting example of using @code{apply} is found
in the description of @code{mapcar}.@refill
@end defun


In this manual, this function is listed in the Command and Variable Index under apply.

Ordinary variables and user options are described using a format like that for functions except that variables do not take arguments.

# Footnotes

A footnote is for a reference that documents or elucidates the primary text.(9)

## Footnote Commands

In Texinfo, footnotes are created with the @footnote command. This command is followed immediately by a left brace, then by the text of the footnote, and then by a terminating right brace. The template is:

@footnote{text}


Footnotes may be of any length, but are usually short.

For example, this clause is followed by a sample footnote(10); in the Texinfo source, it looks like this:

...a sample footnote @footnote{Here is the sample
footnote.}; in the Texinfo source...


Warning: Don't use footnotes in the argument of the @item command for a @table table. This doesn't work; because of limitations of TeX, there is no way to fix it. To avoid the problem, move the footnote into the body text of the table.

In a printed manual or book, the reference mark for a footnote is a small, superscripted number; the text of the footnote appears at the bottom of the page, below a horizontal line.

In Info, the reference mark for a footnote is a pair of parentheses with the footnote number between them, like this: (1)'.

## Footnote Styles

Info has two footnote styles, which determine where the text of the footnote is located:

• In the End' node style, all the footnotes for a single node are placed at the end of that node. The footnotes are separated from the rest of the node by a line of dashes with the word Footnotes' within it. Each footnote begins with an (n)' reference mark. Here is an example of a single footnote in the end of node style:
 --------- Footnotes ---------

(1)  Here is a sample footnote.

• In the Separate' node style, all the footnotes for a single node are placed in an automatically constructed node of their own. In this style, a "footnote reference" follows each (n)' reference mark in the body of the node. The footnote reference is actually a cross reference which you use to reach the footnote node. The name of the node containing the footnotes is constructed by appending -Footnotes' to the name of the node that contains the footnotes. (Consequently, the footnotes' node for the Footnotes' node is Footnotes-Footnotes'!) The footnotes' node has an Up' node pointer that leads back to its parent node. Here is how the first footnote in this manual looks after being formatted for Info in the separate node style:
File: texinfo.info  Node: Overview-Footnotes, Up: Overview

(1) Note that the first syllable of "Texinfo" is
pronounced like "speck", not "hex". ...


A Texinfo file may be formatted into an Info file with either footnote style.

Use the @footnotestyle command to specify an Info file's footnote style. Write this command at the beginning of a line followed by an argument, either end' for the end node style or separate' for the separate node style.

For example,

@footnotestyle end


or

@footnotestyle separate


Write an @footnotestyle command before or shortly after the end-of-header line at the beginning of a Texinfo file. (If you include the @footnotestyle command between the start-of-header and end-of-header lines, the region formatting commands will format footnotes as specified.)

If you do not specify a footnote style, the formatting commands use their default style. Currently, texinfo-format-buffer and texinfo-format-region use the separate' style and makeinfo uses the end' style.

This chapter contains two footnotes.

# Conditionally Visible Text

Sometimes it is good to use different text for a printed manual and its corresponding Info file. In this case, you can use the conditional commands to specify which text is for the printed manual and which is for the Info file.

@ifinfo begins segments of text that should be ignored by TeX when it typesets the printed manual. The segment of text appears only in the Info file. The @ifinfo command should appear on a line by itself; end the Info-only text with a line containing @end ifinfo by itself. At the beginning of a Texinfo file, the Info permissions are contained within a region marked by @ifinfo and @end ifinfo. (See section Summary and Copying Permissions for Info.)

The @iftex and @end iftex commands are similar to the @ifinfo and @end ifinfo commands, except that they specify text that will appear in the printed manual but not in the Info file. Likewise for @ifhtml and @end ifhtml, which specify text to appear only in HTML output.

For example,

@iftex
This text will appear only in the printed manual.
@end iftex

@ifinfo
However, this text will appear only in Info.
@end ifinfo


The preceding example produces the following line:

This text will appear only in the printed manual.

Note how you only see one of the two lines, depending on whether you are reading the Info version or the printed version of this manual.

The @titlepage command is a special variant of @iftex that is used for making the title and copyright pages of the printed manual. (See section @titlepage.)

## Using Ordinary TeX Commands

Inside a region delineated by @iftex and @end iftex, you can embed some plain TeX commands. Info will ignore these commands since they are only in that part of the file which is seen by TeX. You can write the TeX commands as you would write them in a normal TeX file, except that you must replace the \' used by TeX with an @'. For example, in the @titlepage section of a Texinfo file, you can use the TeX command @vskip to format the copyright page. (The @titlepage command causes Info to ignore the region automatically, as it does with the @iftex command.)

However, many features of plain TeX will not work, as they are overridden by features of Texinfo.

You can enter plain TeX completely, and use \' in the TeX commands, by delineating a region with the @tex and @end tex commands. (The @tex command also causes Info to ignore the region, like the @iftex command.)

For example, here is a mathematical expression written in plain TeX:

@tex
$$\chi^2 = \sum_{i=1}^N \left (y_i - (a + b x_i) \over \sigma_i\right)^2$$
@end tex


The output of this example will appear only in a printed manual. If you are reading this in Info, you will not see anything after this paragraph. In a printed manual, the above expression looks like this:

## @set, @clear, and @value

You can direct the Texinfo formatting commands to format or ignore parts of a Texinfo file with the @set, @clear, @ifset, and @ifclear commands.

In addition, you can use the @set flag command to set the value of flag to a string of characters; and use @value{flag} to insert that string. You can use @set, for example, to set a date and use @value to insert the date in several places in the Texinfo file.

### @ifset and @ifclear

When a flag is set, the Texinfo formatting commands format text between subsequent pairs of @ifset flag and @end ifset commands. When the flag is cleared, the Texinfo formatting commands do not format the text.

Use the @set flag command to turn on, or set, a flag; a flag can be any single word. The format for the command looks like this:

@set flag


Write the conditionally formatted text between @ifset flag and @end ifset commands, like this:

@ifset flag
conditional-text
@end ifset


For example, you can create one document that has two variants, such as a manual for a large' and small' model:

You can use this machine to dig up shrubs
without hurting them.

@set large

@ifset large
It can also dig up fully grown trees.
@end ifset

Remember to replant promptly ...


In the example, the formatting commands will format the text between @ifset large and @end ifset because the large flag is set.

Use the @clear flag command to turn off, or clear, a flag. Clearing a flag is the opposite of setting a flag. The command looks like this:

@clear flag


Write the command on a line of its own.

When flag is cleared, the Texinfo formatting commands do not format the text between @ifset flag and @end ifset; that text is ignored and does not appear in either printed or Info output.

For example, if you clear the flag of the preceding example by writing an @clear large command after the @set large command (but before the conditional text), then the Texinfo formatting commands ignore the text between the @ifset large and @end ifset commands. In the formatted output, that text does not appear; in both printed and Info output, you see only the lines that say, "You can use this machine to dig up shrubs without hurting them. Remember to replant promptly ...".

If a flag is cleared with an @clear flag command, then the formatting commands format text between subsequent pairs of @ifclear and @end ifclear commands. But if the flag is set with @set flag, then the formatting commands do not format text between an @ifclear and an @end ifclear command; rather, they ignore that text. An @ifclear command looks like this:

@ifclear flag


In brief, the commands are:

@set flag
Tell the Texinfo formatting commands that flag is set.
@clear flag
Tell the Texinfo formatting commands that flag is cleared.
@ifset flag
If flag is set, tell the Texinfo formatting commands to format the text up to the following @end ifset command. If flag is cleared, tell the Texinfo formatting commands to ignore text up to the following @end ifset command.
@ifclear flag
If flag is set, tell the Texinfo formatting commands to ignore the text up to the following @end ifclear command. If flag is cleared, tell the Texinfo formatting commands to format the text up to the following @end ifclear command.

### @value

You can use the @set command to specify a value for a flag, which is expanded by the @value command. The value is a string a characters.

Write the @set command like this:

@set foo This is a string.


This sets the value of foo to "This is a string."

The Texinfo formatters replace an @value{flag} command with the string to which flag is set.

Thus, when foo is set as shown above, the Texinfo formatters convert

@value{foo}
to
This is a string.


You can write an @value command within a paragraph; but you must write an @set command on a line of its own.

If you write the @set command like this:

@set foo


without specifying a string, the value of foo is an empty string.

If you clear a previously set flag with an @clear flag command, a subsequent @value{flag} command is invalid and the string is replaced with an error message that says {No value for "flag"}'.

For example, if you set foo as follows:

@set how-much very, very, very


then the formatters transform

It is a @value{how-much} wet day.
into
It is a very, very, very wet day.


If you write

@clear how-much


then the formatters transform

It is a @value{how-much} wet day.
into
It is a {No value for "how-much"} wet day.


### @value Example

You can use the @value command to limit the number of places you need to change when you record an update to a manual. Here is how it is done in The GNU Make Manual:

Set the flags:

@set EDITION 0.35 Beta
@set VERSION 3.63 Beta
@set UPDATED 14 August 1992
@set UPDATE-MONTH August 1992


Write text for the first @ifinfo section, for people reading the Texinfo file:

This is Edition @value{EDITION},
last updated @value{UPDATED},
of @cite{The GNU Make Manual},
for @code{make}, Version @value{VERSION}.


Write text for the title page, for people reading the printed manual:

@title GNU Make
@subtitle A Program for Directing Recompilation
@subtitle Edition @value{EDITION}, ...
@subtitle @value{UPDATE-MONTH}


(On a printed cover, a date listing the month and the year looks less fussy than a date listing the day as well as the month and year.)

Write text for the Top node, for people reading the Info file:

This is Edition @value{EDITION}
of the @cite{GNU Make Manual},
last updated @value{UPDATED}
for @code{make} Version @value{VERSION}.


After you format the manual, the text in the first @ifinfo section looks like this:

This is Edition 0.35 Beta, last updated 14 August 1992,
of The GNU Make Manual', for make', Version 3.63 Beta.


When you update the manual, change only the values of the flags; you do not need to rewrite the three sections.

# Macros: Defining New Texinfo Commands

A Texinfo macro allows you to define a new Texinfo command as any sequence of text and/or existing commands (including other macros). The macro can have any number of parameters---text you supply each time you use the macro. (This has nothing to do with the @defmac command, which is for documenting macros in the subject of the manual; see section The Template for a Definition.)

## Defining Macros

You use the Texinfo @macro command to define a macro. For example:

@macro macro-name{param1, param2, ...}
text ... \param1\ ...
@end macro


The parameters param1, param2, ... correspond to arguments supplied when the macro is subsequently used in the document (see the next section).

If a macro needs no parameters, you can define it either with an empty list (@macro foo {}') or with no braces at all (@macro foo').

The definition or body of the macro can contain any Texinfo commands, including previously-defined macros. (It is not possible to have mutually recursive Texinfo macros.) In the body, instances of a parameter name surrounded by backslashes, as in \param1\' in the example above, are replaced by the corresponding argument from the macro invocation.

You can undefine a macro foo with @unmacro foo. It is not an error to undefine a macro that is already undefined. For example:

@unmacro foo


## Invoking Macros

After a macro is defined (see the previous section), you can use (invoke) it in your document like this:

@macro-name {arg1, arg2, ...}


and the result will be just as if you typed the body of macro-name at that spot. For example:

@macro foo {p, q}
Together: \p\ & \q\.
@end macro
@foo{a, b}


produces:

Together: a & b.


Thus, the arguments and parameters are separated by commas and delimited by braces; any whitespace after (but not before) a comma is ignored. To insert a comma, brace, or backslash in an argument, prepend a backslash, as in

@macro-name {\\\{\}\,}


which will pass the (almost certainly error-producing) argument \{},' to macro-name.

If the macro is defined to take a single argument, and is invoked without any braces, the entire rest of the line after the macro name is supplied as the argument. For example:

@macro bar {p}
Twice: \p\, \p\.
@end macro
@bar aah


produces:

Twice: aah, aah.


# Format and Print Hardcopy

There are three major shell commands for making a printed manual from a Texinfo file: one for converting the Texinfo file into a file that will be printed, a second for sorting indices, and a third for printing the formatted document. When you use the shell commands, you can either work directly in the operating system shell or work within a shell inside GNU Emacs.

If you are using GNU Emacs, you can use commands provided by Texinfo mode instead of shell commands. In addition to the three commands to format a file, sort the indices, and print the result, Texinfo mode offers key bindings for commands to recenter the output buffer, show the print queue, and delete a job from the print queue.

The typesetting program called TeX is used for formatting a Texinfo file. TeX is a very powerful typesetting program and, if used right, does an exceptionally good job. See section How to Obtain TeX, for information on how to obtain TeX.

The makeinfo, texinfo-format-region, and texinfo-format-buffer commands read the very same @-commands in the Texinfo file as does TeX, but process them differently to make an Info file; see section Creating an Info File.

## Format using tex and texindex

Format the Texinfo file with the shell command tex followed by the name of the Texinfo file. This command produces a formatted DVI file as well as several auxiliary files containing indices, cross references, etc. The DVI file (for DeVice Independent file) can be printed on a wide variety of printers.

The tex formatting command itself does not sort the indices; it writes an output file of unsorted index data. This is a misfeature of TeX. (The texi2dvi command automatically generates indices; see section Format using texi2dvi.) To generate a printed index after running the tex command, you first need a sorted index to work from. The texindex command sorts indices. (The source file texindex.c' comes as part of the standard GNU distribution and is usually installed when Emacs is installed.)

The tex formatting command outputs unsorted index files under names that obey a standard convention. These names are the name of your main input file to the tex formatting command, with everything after the first period thrown away, and the two letter names of indices added at the end. For example, the raw index output files for the input file foo.texinfo' would be foo.cp', foo.vr', foo.fn', foo.tp', foo.pg' and foo.ky'. Those are exactly the arguments to give to texindex.

Or else, you can use ??' as "wild-cards" and give the command in this form:

texindex foo.??


This command will run texindex on all the unsorted index files, including any that you have defined yourself using @defindex or @defcodeindex. (You may execute texindex foo.??' even if there are similarly named files with two letter extensions that are not index files, such as foo.el'. The texindex command reports but otherwise ignores such files.)

For each file specified, texindex generates a sorted index file whose name is made by appending s' to the input file name. The @printindex command knows to look for a file of that name. texindex does not alter the raw index output file.

After you have sorted the indices, you need to rerun the tex formatting command on the Texinfo file. This regenerates a formatted DVI file with up-to-date index entries.(11)

To summarize, this is a three step process:

1. Run the tex formatting command on the Texinfo file. This generates the formatted DVI file as well as the raw index files with two letter extensions.
2. Run the shell command texindex on the raw index files to sort them. This creates the corresponding sorted index files.
3. Rerun the tex formatting command on the Texinfo file. This regenerates a formatted DVI file with the index entries in the correct order. This second run also corrects the page numbers for the cross references. (The tables of contents are always correct.)

You need not run texindex each time after you run the tex formatting. If you do not, on the next run, the tex formatting command will use whatever sorted index files happen to exist from the previous use of texindex. This is usually OK while you are debugging.

## Format using texi2dvi

The texi2dvi command is a shell script that automatically runs both tex and texindex as many times as necessary to produce a DVI file with up-to-date, sorted indices. It simplifies the tex---texindex---tex sequence described in the previous section.

The syntax for texi2dvi is like this (where prompt$' is the shell prompt): prompt$ texi2dvi filename...


## Shell Print Using lpr -d

You can print a DVI file with the DVI print command. The precise printing command to use depends on your system; lpr -d' is common. The DVI print command may require a file name without any extension or with a .dvi' extension.

The following commands, for example, sort the indices, format, and print the Bison Manual (where %' is the shell prompt):

% tex bison.texinfo
% texindex bison.??
% tex bison.texinfo
% lpr -d bison.dvi


(Remember that the shell commands may be different at your site; but these are commonly used versions.)

Using the texi2dvi shell script, you simply need type:

% texi2dvi bison.texinfo
% lpr -d bison.dvi


## From an Emacs Shell ...

You can give formatting and printing commands from a shell within GNU Emacs. To create a shell within Emacs, type M-x shell. In this shell, you can format and print the document. See section Format and Print Hardcopy, for details.

You can switch to and from the shell buffer while tex is running and do other editing. If you are formatting a long document on a slow machine, this can be very convenient.

You can also use texi2dvi from an Emacs shell. For example, here is how to use texi2dvi to format and print Using and Porting GNU CC from a shell within Emacs (where %' is the shell prompt):

% texi2dvi gcc.texinfo
% lpr -d gcc.dvi


## Formatting and Printing in Texinfo Mode

Texinfo mode provides several predefined key commands for TeX formatting and printing. These include commands for sorting indices, looking at the printer queue, killing the formatting job, and recentering the display of the buffer in which the operations occur.

C-c C-t C-b
M-x texinfo-tex-buffer
Run texi2dvi on the current buffer.
C-c C-t C-r
M-x texinfo-tex-region
Run TeX on the current region.
C-c C-t C-i
M-x texinfo-texindex
Sort the indices of a Texinfo file formatted with texinfo-tex-region.
C-c C-t C-p
M-x texinfo-tex-print
Print a DVI file that was made with texinfo-tex-region or texinfo-tex-buffer.
C-c C-t C-q
M-x tex-show-print-queue
Show the print queue.
C-c C-t C-d
M-x texinfo-delete-from-print-queue
Delete a job from the print queue; you will be prompted for the job number shown by a preceding C-c C-t C-q command (texinfo-show-tex-print-queue).
C-c C-t C-k
M-x tex-kill-job
Kill the currently running TeX job started by texinfo-tex-region or texinfo-tex-buffer, or any other process running in the Texinfo shell buffer.
C-c C-t C-x
M-x texinfo-quit-job
Quit a TeX formatting job that has stopped because of an error by sending an x to it. When you do this, TeX preserves a record of what it did in a .log' file.
C-c C-t C-l
M-x tex-recenter-output-buffer
Redisplay the shell buffer in which the TeX printing and formatting commands are run to show its most recent output.

Thus, the usual sequence of commands for formatting a buffer is as follows (with comments to the right):

C-c C-t C-b             Run texi2dvi on the buffer.
C-c C-t C-p             Print the DVI file.
C-c C-t C-q             Display the printer queue.


The Texinfo mode TeX formatting commands start a subshell in Emacs called the *tex-shell*'. The texinfo-tex-command, texinfo-texindex-command, and tex-dvi-print-command commands are all run in this shell.

You can watch the commands operate in the *tex-shell*' buffer, and you can switch to and from and use the *tex-shell*' buffer as you would any other shell buffer.

The formatting and print commands depend on the values of several variables. The default values are:

     Variable                              Default value

texinfo-texi2dvi-command                  "texi2dvi"
texinfo-tex-command                       "tex"
texinfo-texindex-command                  "texindex"
texinfo-delete-from-print-queue-command   "lprm"
texinfo-tex-trailer                       "@bye"
tex-dvi-print-command                     "lpr -d"
tex-show-queue-command                    "lpq"


You can change the values of these variables with the M-x edit-options command (see section Editing Variable Values' in The GNU Emacs Manual), with the M-x set-variable command (see section Examining and Setting Variables' in The GNU Emacs Manual), or with your .emacs' initialization file (see section Init File' in The GNU Emacs Manual).

## Using the Local Variables List

Yet another way to apply the TeX formatting command to a Texinfo file is to put that command in a local variables list at the end of the Texinfo file. You can then specify the tex or texi2dvi commands as a compile-command and have Emacs run it by typing M-x compile. This creates a special shell called the *compilation*' buffer in which Emacs runs the compile command. For example, at the end of the gdb.texinfo' file, after the @bye, you could put the following:

@c Local Variables:
@c compile-command: "texi2dvi gdb.texinfo"
@c End:


This technique is most often used by programmers who also compile programs this way; see section Compilation' in The GNU Emacs Manual.

## TeX Formatting Requirements Summary

Every Texinfo file that is to be input to TeX must begin with a \input command and must contain an @setfilename command and an @settitle command:

\input texinfo
@setfilename arg-not-used-by-TeX
@settitle name-of-manual


The first command instructs TeX to load the macros it needs to process a Texinfo file, the second command opens auxiliary files, and the third specifies the title of printed manual.

Every Texinfo file must end with a line that terminates TeX processing and forces out unfinished pages:

@bye


Strictly speaking, these four lines are all a Texinfo file needs for TeX, besides the body. (The @setfilename line is the only line that a Texinfo file needs for Info formatting.)

Usually, the file's first line contains an @c -*-texinfo-*-' comment that causes Emacs to switch to Texinfo mode when you edit the file. In addition, the beginning usually includes an @setchapternewpage command, a title page, a copyright page, and permissions. Besides an @bye, the end of a file usually includes indices and a table of contents.

For more information, see section @setchapternewpage, section Page Headings, section The Title and Copyright Pages, section Index Menus and Printing an Index, and section Generating a Table of Contents.

## Preparing to Use TeX

TeX needs to know where to find the texinfo.tex' file that you have told it to input with the \input texinfo' command at the beginning of the first line. The texinfo.tex' file tells TeX how to handle @-commands. (texinfo.tex' is included in the standard GNU distributions.)

Usually, the texinfo.tex' file is put in the default directory that contains TeX macros (the /usr/lib/tex/macros' directory) when GNU Emacs or other GNU software is installed. In this case, TeX will find the file and you do not need to do anything special. Alternatively, you can put texinfo.tex' in the directory in which the Texinfo source file is located, and TeX will find it there.

However, you may want to specify the location of the \input file yourself. One way to do this is to write the complete path for the file after the \input command. Another way is to set the TEXINPUTS environment variable in your .cshrc' or .profile' file. The TEXINPUTS environment variable will tell TeX where to find the texinfo.tex' file and any other file that you might want TeX to use.

Whether you use a .cshrc' or .profile' file depends on whether you use csh, sh, or bash for your shell command interpreter. When you use csh, it looks to the .cshrc' file for initialization information, and when you use sh or bash, it looks to the .profile' file.

In a .cshrc' file, you could use the following csh command sequence:

setenv TEXINPUTS .:/usr/me/mylib:/usr/lib/tex/macros


In a .profile' file, you could use the following sh command sequence:

TEXINPUTS=.:/usr/me/mylib:/usr/lib/tex/macros
export TEXINPUTS


This would cause TeX to look for \input' file first in the current directory, indicated by the .', then in a hypothetical user's me/mylib' directory, and finally in the system library.

## Overfull "hboxes"

TeX is sometimes unable to typeset a line without extending it into the right margin. This can occur when TeX comes upon what it interprets as a long word that it cannot hyphenate, such as an electronic mail network address or a very long title. When this happens, TeX prints an error message like this:

Overfull \hbox (20.76302pt too wide)


(In TeX, lines are in "horizontal boxes", hence the term, "hbox". The backslash, \', is the TeX equivalent of @'.)

TeX also provides the line number in the Texinfo source file and the text of the offending line, which is marked at all the places that TeX knows how to hyphenate words. See section Catching Errors with TeX Formatting, for more information about typesetting errors.

If the Texinfo file has an overfull hbox, you can rewrite the sentence so the overfull hbox does not occur, or you can decide to leave it. A small excursion into the right margin often does not matter and may not even be noticeable.

However, unless told otherwise, TeX will print a large, ugly, black rectangle beside the line that contains the overfull hbox. This is so you will notice the location of the problem if you are correcting a draft.

To prevent such a monstrosity from marring your final printout, write the following in the beginning of the Texinfo file on a line of its own, before the @titlepage command:

@finalout


## Printing "Small" Books

By default, TeX typesets pages for printing in an 8.5 by 11 inch format. However, you can direct TeX to typeset a document in a 7 by 9.25 inch format that is suitable for bound books by inserting the following command on a line by itself at the beginning of the Texinfo file, before the title page:

@smallbook


(Since regular sized books are often about 7 by 9.25 inches, this command might better have been called the @regularbooksize command, but it came to be called the @smallbook command by comparison to the 8.5 by 11 inch format.)

If you write the @smallbook command between the start-of-header and end-of-header lines, the Texinfo mode TeX region formatting command, texinfo-tex-region, will format the region in "small" book size (see section Start of Header).

The Free Software Foundation distributes printed copies of The GNU Emacs Manual and other manuals in the "small" book size. See section @smallexample and @smalllisp, for information about commands that make it easier to produce examples for a smaller manual.

## Printing on A4 Paper

You can tell TeX to typeset a document for printing on European size A4 paper with the @afourpaper command. Write the command on a line by itself between @iftex and @end iftex lines near the beginning of the Texinfo file, before the title page:

For example, this is how you would write the header for this manual:

\input texinfo    @c -*-texinfo-*-
@setfilename texinfo
@settitle Texinfo
@syncodeindex vr fn
@iftex
@afourpaper
@end iftex


## Cropmarks and Magnification

You can attempt to direct TeX to print cropmarks at the corners of pages with the @cropmarks command. Write the @cropmarks command on a line by itself between @iftex and @end iftex lines near the beginning of the Texinfo file, before the title page, like this:

@iftex
@cropmarks
@end iftex


This command is mainly for printers that typeset several pages on one sheet of film; but you can attempt to use it to mark the corners of a book set to 7 by 9.25 inches with the @smallbook command. (Printers will not produce cropmarks for regular sized output that is printed on regular sized paper.) Since different printing machines work in different ways, you should explore the use of this command with a spirit of adventure. You may have to redefine the command in the texinfo.tex' definitions file.

You can attempt to direct TeX to typeset pages larger or smaller than usual with the \mag TeX command. Everything that is typeset is scaled proportionally larger or smaller. (\mag stands for "magnification".) This is not a Texinfo @-command, but is a plain TeX command that is prefixed with a backslash. You have to write this command between @tex and @end tex (see section Using Ordinary TeX Commands).

Follow the \mag command with an =' and then a number that is 1000 times the magnification you desire. For example, to print pages at 1.2 normal size, write the following near the beginning of the Texinfo file, before the title page:

@tex
\mag=1200
@end tex


With some printing technologies, you can print normal-sized copies that look better than usual by using a larger-than-normal master.

Depending on your system, \mag may not work or may work only at certain magnifications. Be prepared to experiment.

# Creating an Info File

makeinfo is a utility that converts a Texinfo file into an Info file; texinfo-format-region and texinfo-format-buffer are GNU Emacs functions that do the same.

A Texinfo file must possess an @setfilename line near its beginning, otherwise the Info formatting commands will fail.

For information on installing the Info file in the Info system, see section Installing an Info File.

The makeinfo utility creates an Info file from a Texinfo source file more quickly than either of the Emacs formatting commands and provides better error messages. We recommend it. makeinfo is a C program that is independent of Emacs. You do not need to run Emacs to use makeinfo, which means you can use makeinfo on machines that are too small to run Emacs. You can run makeinfo in any one of three ways: from an operating system shell, from a shell inside Emacs, or by typing a key command in Texinfo mode in Emacs.

The texinfo-format-region and the texinfo-format-buffer commands are useful if you cannot run makeinfo. Also, in some circumstances, they format short regions or buffers more quickly than makeinfo.

## Running makeinfo from a Shell

To create an Info file from a Texinfo file, type makeinfo followed by the name of the Texinfo file. Thus, to create the Info file for Bison, type the following at the shell prompt (where %' is the prompt):

% makeinfo bison.texinfo


(You can run a shell inside Emacs by typing M-x shell.)

## Options for makeinfo

The makeinfo command takes a number of options. Most often, options are used to set the value of the fill column and specify the footnote style. Each command line option is a word preceded by --'(12) or a letter preceded by -'. You can use abbreviations for the option names as long as they are unique.

For example, you could use the following command to create an Info file for bison.texinfo' in which each line is filled to only 68 columns (where %' is the prompt):

% makeinfo --fill-column=68 bison.texinfo


You can write two or more options in sequence, like this:

% makeinfo --no-split --fill-column=70 ...


This would keep the Info file together as one possibly very long file and would also set the fill column to 70.

If you wish to discover which version of makeinfo you are using, type:

% makeinfo --version


The options are:

-D var
Cause var to be defined. This is equivalent to @set var in the Texinfo file.
--error-limit limit
Set the maximum number of errors that makeinfo will report before exiting (on the assumption that continuing would be useless). The default number of errors that can be reported before makeinfo gives up is 100.
--fill-column width
Specify the maximum number of columns in a line; this is the right-hand edge of a line. Paragraphs that are filled will be filled to this width. (Filling is the process of breaking up and connecting lines so that lines are the same length as or shorter than the number specified as the fill column. Lines are broken between words.) The default value for fill-column is 72.
--footnote-style style
Set the footnote style to style, either end' for the end node style or separate' for the separate node style. The value set by this option overrides the value set in a Texinfo file by an @footnotestyle command. When the footnote style is separate', makeinfo makes a new node containing the footnotes found in the current node. When the footnote style is end', makeinfo places the footnote references at the end of the current node.
-I dir
Add dir to the directory search list for finding files that are included using the @include command. By default, makeinfo searches only the current directory.
--no-headers
Do not include menus or node lines in the output. This results in an ASCII file that you cannot read in Info since it does not contain the requisite nodes or menus; but you can print such a file in a single, typewriter-like font and produce acceptable output.
--no-split
Suppress the splitting stage of makeinfo. Normally, large output files (where the size is greater than 70k bytes) are split into smaller subfiles, each one approximately 50k bytes. If you specify --no-split', makeinfo will not split up the output file.
--no-pointer-validate
--no-validate
Suppress the pointer-validation phase of makeinfo. Normally, after a Texinfo file is processed, some consistency checks are made to ensure that cross references can be resolved, etc. See section Pointer Validation.
--no-warn
Suppress the output of warning messages. This does not suppress the output of error messages, only warnings. You might want this if the file you are creating has examples of Texinfo cross references within it, and the nodes that are referenced do not actually exist.
--no-number-footnotes
Suppress automatic footnote numbering. By default, makeinfo numbers each footnote sequentially in a single node, resetting the current footnote number to 1 at the start of each node.
--output file
-o file
Specify that the output should be directed to file and not to the file name specified in the @setfilename command found in the Texinfo source. file can be the special token -', which specifies standard output.
--paragraph-indent indent
Set the paragraph indentation style to indent. The value set by this option overrides the value set in a Texinfo file by an @paragraphindent command. The value of indent is interpreted as follows:
• If the value of indent is asis', do not change the existing indentation at the starts of paragraphs.
• If the value of indent is zero, delete any existing indentation.
• If the value of indent is greater than zero, indent each paragraph by that number of spaces.
--reference-limit limit
Set the value of the number of references to a node that makeinfo will make without reporting a warning. If a node has more than this number of references in it, makeinfo will make the references but also report a warning.
-U var
Cause var to be undefined. This is equivalent to @clear var in the Texinfo file.
--verbose
Cause makeinfo to display messages saying what it is doing. Normally, makeinfo only outputs messages if there are errors or warnings.
--version
Report the version number of this copy of makeinfo.

## Pointer Validation

If you do not suppress pointer-validation, makeinfo will check the validity of the final Info file. Mostly, this means ensuring that nodes you have referenced really exist. Here is a complete list of what is checked:

1. If a Next', Previous', or Up' node reference is a reference to a node in the current file and is not an external reference such as to (dir)', then the referenced node must exist.
2. In every node, if the Previous' node is different from the Up' node, then the Previous' node must also be pointed to by a Next' node.
3. Every node except the Top' node must have an Up' pointer.
4. The node referenced by an Up' pointer must contain a reference to the current node in some manner other than through a Next' reference. This includes menu entries and cross references.
5. If the Next' reference of a node is not the same as the Next' reference of the Up' reference, then the node referenced by the Next' pointer must have a Previous' pointer that points back to the current node. This rule allows the last node in a section to point to the first node of the next chapter.

## Running makeinfo inside Emacs

You can run makeinfo in GNU Emacs Texinfo mode by using either the makeinfo-region or the makeinfo-buffer commands. In Texinfo mode, the commands are bound to C-c C-m C-r and C-c C-m C-b by default.

C-c C-m C-r
M-x makeinfo-region
Format the current region for Info.
C-c C-m C-b
M-x makeinfo-buffer
Format the current buffer for Info.

When you invoke either makeinfo-region or makeinfo-buffer, Emacs prompts for a file name, offering the name of the visited file as the default. You can edit the default file name in the minibuffer if you wish, before typing RET to start the makeinfo process.

The Emacs makeinfo-region and makeinfo-buffer commands run the makeinfo program in a temporary shell buffer. If makeinfo finds any errors, Emacs displays the error messages in the temporary buffer.

You can parse the error messages by typing C-x  (next-error). This causes Emacs to go to and position the cursor on the line in the Texinfo source that makeinfo thinks caused the error. See section Running make or Compilers Generally' in The GNU Emacs Manual, for more information about using the next-error command.

In addition, you can kill the shell in which the makeinfo command is running or make the shell buffer display its most recent output.

C-c C-m C-k
M-x makeinfo-kill-job
Kill the current running makeinfo job created by makeinfo-region or makeinfo-buffer.
C-c C-m C-l
M-x makeinfo-recenter-output-buffer
Redisplay the makeinfo shell buffer to display its most recent output.

(Note that the parallel commands for killing and recentering a TeX job are C-c C-t C-k and C-c C-t C-l. See section Formatting and Printing in Texinfo Mode.)

You can specify options for makeinfo by setting the makeinfo-options variable with either the M-x edit-options or the M-x set-variable command, or by setting the variable in your .emacs' initialization file.

For example, you could write the following in your .emacs' file:

(setq makeinfo-options
"--paragraph-indent=0 --no-split
--fill-column=70 --verbose")


For more information, see section Options for makeinfo, as well as "Editing Variable Values,""Examining and Setting Variables," and "Init File" in the The GNU Emacs Manual.

## The texinfo-format... Commands

In GNU Emacs in Texinfo mode, you can format part or all of a Texinfo file with the texinfo-format-region command. This formats the current region and displays the formatted text in a temporary buffer called *Info Region*'.

Similarly, you can format a buffer with the texinfo-format-buffer command. This command creates a new buffer and generates the Info file in it. Typing C-x C-s will save the Info file under the name specified by the @setfilename line which must be near the beginning of the Texinfo file.

C-c C-e C-r
texinfo-format-region
Format the current region for Info.
C-c C-e C-b
texinfo-format-buffer
Format the current buffer for Info.

The texinfo-format-region and texinfo-format-buffer commands provide you with some error checking, and other functions can provide you with further help in finding formatting errors. These procedures are described in an appendix; see section Formatting Mistakes. However, the makeinfo program is often faster and provides better error checking (see section Running makeinfo inside Emacs).

## Batch Formatting

You can format Texinfo files for Info using batch-texinfo-format and Emacs Batch mode. You can run Emacs in Batch mode from any shell, including a shell inside of Emacs. (See section Command Line Switches and Arguments' in The GNU Emacs Manual.)

Here is the command to format all the files that end in .texinfo' in the current directory (where %' is the shell prompt):

% emacs -batch -funcall batch-texinfo-format *.texinfo


Emacs processes all the files listed on the command line, even if an error occurs while attempting to format some of them.

Run batch-texinfo-format only with Emacs in Batch mode as shown; it is not interactive. It kills the Batch mode Emacs on completion.

batch-texinfo-format is convenient if you lack makeinfo and want to format several Texinfo files at once. When you use Batch mode, you create a new Emacs process. This frees your current Emacs, so you can continue working in it. (When you run texinfo-format-region or texinfo-format-buffer, you cannot use that Emacs for anything else until the command finishes.)

## Tag Files and Split Files

If a Texinfo file has more than 30,000 bytes, texinfo-format-buffer automatically creates a tag table for its Info file; makeinfo always creates a tag table. With a tag table, Info can jump to new nodes more quickly than it can otherwise.

In addition, if the Texinfo file contains more than about 70,000 bytes, texinfo-format-buffer and makeinfo split the large Info file into shorter indirect subfiles of about 50,000 bytes each. Big files are split into smaller files so that Emacs does not need to make a large buffer to hold the whole of a large Info file; instead, Emacs allocates just enough memory for the small, split off file that is needed at the time. This way, Emacs avoids wasting memory when you run Info. (Before splitting was implemented, Info files were always kept short and include files were designed as a way to create a single, large printed manual out of the smaller Info files. See section Include Files, for more information. Include files are still used for very large documents, such as The Emacs Lisp Reference Manual, in which each chapter is a separate file.)

When a file is split, Info itself makes use of a shortened version of the original file that contains just the tag table and references to the files that were split off. The split off files are called indirect files.

The split off files have names that are created by appending -1', -2', -3' and so on to the file name specified by the @setfilename command. The shortened version of the original file continues to have the name specified by @setfilename.

At one stage in writing this document, for example, the Info file was saved as test-texinfo' and that file looked like this:

Info file: test-texinfo,    -*-Text-*-
produced by texinfo-format-buffer
from file: new-texinfo-manual.texinfo

^_
Indirect:
test-texinfo-1: 102
test-texinfo-2: 50422
test-texinfo-3: 101300
^_^L
Tag table:
(Indirect)
Node: overview^?104
Node: info file^?1271
Node: printed manual^?4853
Node: conventions^?6855
...


(But test-texinfo' had far more nodes than are shown here.) Each of the split off, indirect files, test-texinfo-1', test-texinfo-2', and test-texinfo-3', is listed in this file after the line that says Indirect:'. The tag table is listed after the line that says Tag table:'.

In the list of indirect files, the number following the file name records the cumulative number of bytes in the preceding indirect files, not counting the file list itself, the tag table, or the permissions text in each file. In the tag table, the number following the node name records the location of the beginning of the node, in bytes from the beginning.

If you are using texinfo-format-buffer to create Info files, you may want to run the Info-validate command. (The makeinfo command does such a good job on its own, you do not need Info-validate.) However, you cannot run the M-x Info-validate node-checking command on indirect files. For information on how to prevent files from being split and how to validate the structure of the nodes, see section Running Info-validate.

# Installing an Info File

Info files are usually kept in the info' directory. You can read Info files using the standalone Info program or the Info reader built into Emacs. (See Info file info', node Top', for an introduction to Info.)

For Info to work, the info' directory must contain a file that serves as a top level directory for the Info system. By convention, this file is called dir'. (You can find the location of this file within Emacs by typing C-h i to enter Info and then typing C-x C-f to see the pathname to the info' directory.)

The dir' file is itself an Info file. It contains the top level menu for all the Info files in the system. The menu looks like this:

* Menu:

* Info:    (info).     Documentation browsing system.
* Emacs:   (emacs).    The extensible, self-documenting
text editor.
* Texinfo: (texinfo).  With one source file, make
either a printed manual using
TeX or an Info file.
...


Each of these menu entries points to the Top' node of the Info file that is named in parentheses. (The menu entry does not need to specify the Top' node, since Info goes to the Top' node if no node name is mentioned. See section Referring to Other Info Files.)

Thus, the Info' entry points to the Top' node of the info' file and the Emacs' entry points to the Top' node of the emacs' file.

In each of the Info files, the Up' pointer of the Top' node refers back to the dir file. For example, the line for the Top' node of the Emacs manual looks like this in Info:

File: emacs  Node: Top, Up: (DIR), Next: Distrib


(Note that in this case, the dir' file name is written in upper case letters--it can be written in either upper or lower case. Info has a feature that it will change the case of the file name to lower case if it cannot find the name as written.)

## Listing a New Info File

To add a new Info file to your system, you must write a menu entry to add to the menu in the dir' file in the info' directory. For example, if you were adding documentation for GDB, you would write the following new entry:

* GDB: (gdb).           The source-level C debugger.


The first part of the menu entry is the menu entry name, followed by a colon. The second part is the name of the Info file, in parentheses, followed by a period. The third part is the description.

The name of an Info file often has a .info' extension. Thus, the Info file for GDB might be called either gdb' or gdb.info'. The Info reader programs automatically try the file name both with and without .info'; so it is better to avoid clutter and not to write .info' explicitly in the menu entry. For example, the GDB menu entry should use just gdb' for the file name, not gdb.info'.

## Info Files in Other Directories

If an Info file is not in the info' directory, there are three ways to specify its location:

• Write the pathname in the dir' file as the second part of the menu.
• If you are using Emacs, list the name of the file in a second dir' file, in its directory; and then add the name of that directory to the Info-directory-list variable in your personal or site initialization file. This tells Emacs's Info reader where to look for dir' files. Emacs merges the files named dir' from each of the listed directories. (In Emacs Version 18, you can set the Info-directory variable to the name of only one directory.)
• Specify the info' directory name in the INFOPATH environment variable in your .profile' or .cshrc' initialization file. (Only you and others who set this environment variable will be able to find Info files whose location is specified this way.)

For example, to reach a test file in the ~bob/manuals' directory, you could add an entry like this to the menu in the dir' file:

* Test: (/home/bob/manuals/info-test).  Bob's own test file.


In this case, the absolute file name of the info-test' file is written as the second part of the menu entry.

Alternatively, you could write the following in your .emacs' file:

(setq Info-directory-list
'("/home/bob/manuals"
"/usr/local/emacs/info"))


This tells Emacs to merge the dir' file from the /home/bob/manuals' directory with the dir' file from the "/usr/local/emacs/info'" directory. Info will list the /home/bob/manuals/info-test' file as a menu entry in the /home/bob/manuals/dir' file.

Finally, you can tell Info where to look by setting the INFOPATH environment variable in your .cshrc' or .profile' file.

If you use sh or bash for your shell command interpreter, you must set the INFOPATH environment variable in the .profile' initialization file; but if you use csh, you must set the variable in the .cshrc' initialization file. The two files use slightly different command formats.

• In a .cshrc' file, you could set the INFOPATH variable as follows:
setenv INFOPATH .:~bob/manuals:/usr/local/emacs/info

• In a .profile' file, you would achieve the same effect by writing:
INFOPATH=.:~bob/manuals:/usr/local/emacs/info
export INFOPATH


The .' indicates the current directory. Emacs uses the INFOPATH environment variable to initialize the value of Emacs's own Info-directory-list variable.

## Installing Info Directory Files

When you install an Info file onto your system, you can use the program install-info to update the Info directory file dir'. Normally the makefile for the package runs install-info, just after copying the Info file into its proper installed location.

In order for the Info file to work with install-info, you should use the commands @dircategory and @direntry in the Texinfo source file. Use @direntry to specify the menu entry to add to the Info directory file, and use @dircategory to specify which part of the Info directory to put it in. Here is how these commands are used in this manual:

@dircategory Texinfo documentation system
@direntry
* Texinfo: (texinfo).           The GNU documentation format.
* install-info: (texinfo)Invoking install-info. ...
...
@end direntry


Here's what this produces in the Info file:

INFO-DIR-SECTION Texinfo documentation system
START-INFO-DIR-ENTRY
* Texinfo: (texinfo).           The GNU documentation format.
* install-info: (texinfo)Invoking install-info. ...
...
END-INFO-DIR-ENTRY


The install-info program sees these lines in the Info file, and that is how it knows what to do.

Always use the @direntry and @dircategory commands near the beginning of the Texinfo input, before the first @node command. If you use them later on in the input, install-info will not notice them.

If you use @dircategory more than once in the Texinfo source, each usage specifies one category; the new menu entry is added to the Info directory file in each of the categories you specify. If you use @direntry more than once, each usage specifies one menu entry; each of these menu entries is added to the directory in each of the specified categories.

## Invoking install-info

install-info inserts menu entries from an Info file into the top-level dir' file in the Info system (see the previous sections for an explanation of how the dir' file works). It's most often run as part of software installation, or when constructing a dir file for all manuals on a system. Synopsis:

install-info [option]... [info-file [dir-file]]


If info-file or dir-file are not specified, the various options (described below) that define them must be. There are no compile-time defaults, and standard input is never used. install-info can read only one info file and write only one dir file per invocation.

Options:

--delete'
Only delete existing entries in info-file; don't insert any new entries.
--dir-file=name'
Specify file name of the Info directory file. This is equivalent to using the dir-file argument.
--entry=text'
Insert text as an Info directory entry; text should have the form of an Info menu item line plus zero or more extra lines starting with whitespace. If you specify more than one entry, they are all added. If you don't specify any entries, they are determined from information in the Info file itself.
--help'
Display a usage message listing basic usage and all available options, then exit successfully.
--info-file=file'
Specify Info file to install in the directory. This is equivalent to using the info-file argument.
--info-dir=dir'
Equivalent to --dir-file=dir/dir'.
--item=text'
Same as --entry=text. An Info directory entry is actually a menu item.
--quiet'
Suppress warnings.
--remove'
Same as --delete.
--section=sec'
Put this file's entries in section sec of the directory. If you specify more than one section, all the entries are added in each of the sections. If you don't specify any sections, they are determined from information in the Info file itself.
--version'
Display version information and exit successfully.

# @-Command List

Here is an alphabetical list of the @-commands in Texinfo. Square brackets, [ ], indicate optional arguments; an ellipsis, ...', indicates repeated text.

@whitespace
An @ followed by a space, tab, or newline produces a normal, stretchable, interword space. See section Multiple Spaces.
@!
Generate an exclamation point that really does end a sentence (usually after an end-of-sentence capital letter). See section Ending a Sentence.
@"
@'
Generate an umlaut or acute accent, respectively, over the next character, as in @"o and 'o. See section Inserting Accents.
@*
Force a line break. Do not end a paragraph that uses @* with an @refill command. See section @*: Generate Line Breaks.
@,{c}
Generate a cedilla accent under c, as in @,{c}. See section Inserting Accents.
@-
Insert a discretionary hyphenation point. See section @- and @hyphenation: Helping TeX hyphenate.
@.
Produce a period that really does end a sentence (usually after an end-of-sentence capital letter). See section Ending a Sentence.
@:
Indicate to TeX that an immediately preceding period, question mark, exclamation mark, or colon does not end a sentence. Prevent TeX from inserting extra whitespace as it does at the end of a sentence. The command has no effect on the Info file output. See section Not Ending a Sentence.
@=
Generate a macro (bar) accent over the next character, as in @=o. See section Inserting Accents.
@?
Generate a question mark that really does end a sentence (usually after an end-of-sentence capital letter). See section Ending a Sentence.
@@
Stands for an at sign, @'.
See section Inserting @ and Braces.
@^
@
Generate a circumflex (hat) or grave accent, respectively, over the next character, as in @^o. See section Inserting Accents.
@{
Stands for a left brace, {'.
See section Inserting @ and Braces.
@}
Stands for a right-hand brace, }'.
See section Inserting @ and Braces.
@=
Generate a tilde accent over the next character, as in @~N. See section Inserting Accents.
@AA{}
@aa{}
Generate the uppercase and lowercase Scandinavian A-ring letters, respectively: @AA{}, @aa{}. See section Inserting Accents.
@AE{}
@ae{}
Generate the uppercase and lowercase AE ligatures, respectively: @AE{}, @ae{}. See section Inserting Accents.
@appendix title
Begin an appendix. The title appears in the table of contents of a printed manual. In Info, the title is underlined with asterisks. See section @unnumbered, @appendix.
@appendixsec title
@appendixsection title
Begin an appendix section within an appendix. The section title appears in the table of contents of a printed manual. In Info, the title is underlined with equal signs. @appendixsection is a longer spelling of the @appendixsec command. See section @unnumberedsec, @appendixsec, @heading.
@appendixsubsec title
Begin an appendix subsection within an appendix. The title appears in the table of contents of a printed manual. In Info, the title is underlined with hyphens. See section The @subsection-like Commands.
@appendixsubsubsec title
Begin an appendix subsubsection within a subappendix. The title appears in the table of contents of a printed manual. In Info, the title is underlined with periods. See section The subsub' Commands.
@asis
Used following @table, @ftable, and @vtable to print the table's first column without highlighting ("as is"). See section Making a Two-column Table.
@author author
Typeset author flushleft and underline it. See section @title, @subtitle, and @author.
@b{text}
Print text in bold font. No effect in Info. See section Fonts for Printing, Not Info.
@bullet{}
Generate a large round dot, or the closest possible thing to one. See section @bullet{}.
@bye
Stop formatting a file. The formatters do not see the contents of a file following an @bye command. See section Ending a Texinfo File.
@c comment
Begin a comment in Texinfo. The rest of the line does not appear in either the Info file or the printed manual. A synonym for @comment. See section Comments.
@cartouche
Highlight an example or quotation by drawing a box with rounded corners around it. Pair with @end cartouche. No effect in Info. See section Drawing Cartouches Around Examples.)
@center line-of-text
Center the line of text following the command. See section @titlefont, @center, and @sp.
@centerchap line-of-text
Like @chapter, but centers the chapter title. See section @chapter.
@chapheading title
Print a chapter-like heading in the text, but not in the table of contents of a printed manual. In Info, the title is underlined with asterisks. See section @majorheading, @chapheading.
@chapter title
Begin a chapter. The chapter title appears in the table of contents of a printed manual. In Info, the title is underlined with asterisks. See section @chapter.
@cindex entry
Add entry to the index of concepts. See section Making Index Entries.
@cite{reference}
Highlight the name of a book or other reference that lacks a companion Info file. See section @cite{reference}.
@clear flag
Unset flag, preventing the Texinfo formatting commands from formatting text between subsequent pairs of @ifset flag and @end ifset commands, and preventing @value{flag} from expanding to the value to which flag is set. See section @set, @clear, and @value.
@code{sample-code}
Highlight text that is an expression, a syntactically complete token of a program, or a program name. See section @code{sample-code}.
@comment comment
Begin a comment in Texinfo. The rest of the line does not appear in either the Info file or the printed manual. A synonym for @c. See section Comments.
@contents
@copyright{}
Generate a copyright symbol. See section @copyright{}.
@defcodeindex index-name
Define a new index and its indexing command. Print entries in an @code font. See section Defining New Indices.
@defcv category class name
@defcvx category class name
Format a description for a variable associated with a class in object-oriented programming. Takes three arguments: the category of thing being defined, the class to which it belongs, and its name. See section Definition Commands, and section Two or More First' Lines.
@deffn category name arguments...
@deffnx category name arguments...
Format a description for a function, interactive command, or similar entity that may take arguments. @deffn takes as arguments the category of entity being described, the name of this particular entity, and its arguments, if any. See section Definition Commands.
@defindex index-name
Define a new index and its indexing command. Print entries in a roman font. See section Defining New Indices.
@definfoenclose new-command, before, after,
Create new @-command for Info that marks text by enclosing it in strings that precede and follow the text. Write definition inside of @ifinfo ... @end ifinfo. See section Customized Highlighting.
@defivar class instance-variable-name
@defivarx class instance-variable-name
This command formats a description for an instance variable in object-oriented programming. The command is equivalent to @defcv {Instance Variable} ...'. See section Definition Commands, and section Two or More First' Lines.
@defmac macro-name arguments...
@defmacx macro-name arguments...
Format a description for a macro. The command is equivalent to @deffn Macro ...'. See section Definition Commands, and section Two or More First' Lines.
@defmethod class method-name arguments...
@defmethodx class method-name arguments...
Format a description for a method in object-oriented programming. The command is equivalent to @defop Method ...'. Takes as arguments the name of the class of the method, the name of the method, and its arguments, if any. See section Definition Commands, and section Two or More First' Lines.
@defop category class name arguments...
@defopx category class name arguments...
Format a description for an operation in object-oriented programming. @defop takes as arguments the overall name of the category of operation, the name of the class of the operation, the name of the operation, and its arguments, if any. See section Definition Commands, and section Two or More First' Lines.
@defopt option-name
@defoptx option-name
Format a description for a user option. The command is equivalent to @defvr {User Option} ...'. See section Definition Commands, and section Two or More First' Lines.
@defspec special-form-name arguments...
@defspecx special-form-name arguments...
Format a description for a special form. The command is equivalent to @deffn {Special Form} ...'. See section Definition Commands, and section Two or More First' Lines.
@deftp category name-of-type attributes...
@deftpx category name-of-type attributes...
Format a description for a data type. @deftp takes as arguments the category, the name of the type (which is a word like int' or float'), and then the names of attributes of objects of that type. See section Definition Commands, and section Two or More First' Lines.
@deftypefn classification data-type name arguments...
@deftypefnx classification data-type name arguments...
Format a description for a function or similar entity that may take arguments and that is typed. @deftypefn takes as arguments the classification of entity being described, the type, the name of the entity, and its arguments, if any. See section Definition Commands, and section Two or More First' Lines.
@deftypefun data-type function-name arguments...
@deftypefunx data-type function-name arguments...
Format a description for a function in a typed language. The command is equivalent to @deftypefn Function ...'. See section Definition Commands, and section Two or More First' Lines.
@deftypevr classification data-type name
@deftypevrx classification data-type name
Format a description for something like a variable in a typed language--an entity that records a value. Takes as arguments the classification of entity being described, the type, and the name of the entity. See section Definition Commands, and section Two or More First' Lines.
@deftypevar data-type variable-name
@deftypevarx data-type variable-name
Format a description for a variable in a typed language. The command is equivalent to @deftypevr Variable ...'. See section Definition Commands, and section Two or More First' Lines.
@defun function-name arguments...
@defunx function-name arguments...
Format a description for functions. The command is equivalent to @deffn Function ...'. See section Definition Commands, and section Two or More First' Lines.
@defvar variable-name
@defvarx variable-name
Format a description for variables. The command is equivalent to @defvr Variable ...'. See section Definition Commands, and section Two or More First' Lines.
@defvr category name
@defvrx category name
Format a description for any kind of variable. @defvr takes as arguments the category of the entity and the name of the entity. See section Definition Commands, and section Two or More First' Lines.
@detailmenu{}
Use to avoid Makeinfo confusion stemming from the detailed node listing in a master menu. See section Parts of a Master Menu.
@dfn{term}
Highlight the introductory or defining use of a term. See section @dfn{term}.
@dircategory dirpart
Specify a part of the Info directory menu where this file's entry should go. See section Installing Info Directory Files.
@direntry
Begin the Info directory menu entry for this file. See section Installing Info Directory Files.
@display
Begin a kind of example. Indent text, do not fill, do not select a new font. Pair with @end display. See section @display.
@dmn{dimension}
Format a unit of measure, as in 12pt. Causes TeX to insert a thin space before dimension. No effect in Info. See section @dmn{dimension}: Format a Dimension.
@dots{}
Insert an ellipsis: ...'. See section @dots{}.
@email{address}
Indicate an electronic mail address. See section @email{email-address}.
@emph{text}
Highlight text; text is displayed in italics in printed output, and surrounded by asterisks in Info. See section Emphasizing Text.
@end environment
Ends environment, as in @end example'. See section @-commands.
@enddots{}
Generate an end-of-sentence of ellipsis, like this @enddots{} See section @dots{}.
@enumerate [number-or-letter]
Begin a numbered list, using @item for each entry. Optionally, start list with number-or-letter. Pair with @end enumerate. See section Making a Numbered or Lettered List.
@equiv{}
Indicate to the reader the exact equivalence of two forms with a glyph: =='. See section ==: Indicating Equivalence.
@error{}
Indicate to the reader with a glyph that the following text is an error message: error-->'. See section error-->: Indicating an Error Message.
@evenfooting [left] @| [center] @| [right]
Specify page footings for even-numbered (left-hand) pages. Not relevant to Info. See section How to Make Your Own Headings.
@evenheading [left] @| [center] @| [right]
Specify page headings for even-numbered (left-hand) pages. Only supported within @iftex. See section How to Make Your Own Headings.
@everyfooting [left] @| [center] @| [right]
@everyheading [left] @| [center] @| [right]
Specify page footings resp. headings for every page. Not relevant to Info. See section How to Make Your Own Headings.
@example
Begin an example. Indent text, do not fill, and select fixed-width font. Pair with @end example. See section @example.
@exclamdown{}
Generate an upside-down exclamation point. See section Inserting Accents.
@exdent line-of-text
Remove any indentation a line might have. See section @exdent: Undoing a Line's Indentation.
@expansion{}
Indicate the result of a macro expansion to the reader with a special glyph: ==>'. See section ==>: Indicating an Expansion.
@file{filename}
Highlight the name of a file, buffer, node, or directory. See section @file{file-name}.
@finalout
Prevent TeX from printing large black warning rectangles beside over-wide lines. See section Overfull "hboxes".
@findex entry
Add entry to the index of functions. See section Making Index Entries.
@flushleft
@flushright
Left justify every line but leave the right end ragged. Leave font as is. Pair with @end flushleft. @flushright analogous. See section @flushleft and @flushright.
@footnote{text-of-footnote}
Enter a footnote. Footnote text is printed at the bottom of the page by TeX; Info may format in either End' node or Separate' node style. See section Footnotes.
@footnotestyle style
Specify an Info file's footnote style, either end' for the end node style or separate' for the separate node style. See section Footnotes.
@format
Begin a kind of example. Like @example or @display, but do not narrow the margins and do not select the fixed-width font. Pair with @end format. See section @example.
@ftable formatting-command
Begin a two-column table, using @item for each entry. Automatically enter each of the items in the first column into the index of functions. Pair with @end ftable. The same as @table, except for indexing. See section @ftable and @vtable.
@group
Hold text together that must appear on one printed page. Pair with @end group. Not relevant to Info. See section @group: Prevent Page Breaks.
@H{c}
Generate the long Hungarian umlaut accent over c, as in @H{o}.
@heading title
Print an unnumbered section-like heading in the text, but not in the table of contents of a printed manual. In Info, the title is underlined with equal signs. See section @unnumberedsec, @appendixsec, @heading.
@headings on-off-single-double
Turn page headings on or off, and/or specify single-sided or double-sided page headings for printing. See section The @headings Command.
@i{text}
Print text in italic font. No effect in Info. See section Fonts for Printing, Not Info.
@ifclear flag
If flag is cleared, the Texinfo formatting commands format text between @ifclear flag and the following @end ifclear command. See section @set, @clear, and @value.
@ifhtml
@ifinfo
Begin a stretch of text that will be ignored by TeX when it typesets the printed manual. The text appears only in the HTML resp. Info file. Pair with @end ifhtml resp. @end ifinfo. See section Conditionally Visible Text.
@ifset flag
If flag is set, the Texinfo formatting commands format text between @ifset flag and the following @end ifset command. See section @set, @clear, and @value.
@iftex
Begin a stretch of text that will not appear in the Info file, but will be processed only by TeX. Pair with @end iftex. See section Conditionally Visible Text.
@ignore
Begin a stretch of text that will not appear in either the Info file or the printed output. Pair with @end ignore. See section Comments.
@include filename
Incorporate the contents of the file filename into the Info file or printed document. See section Include Files.
@inforef{node-name, [entry-name], info-file-name}
Make a cross reference to an Info file for which there is no printed manual. See section @inforef.
\input macro-definitions-file
Use the specified macro definitions file. This command is used only in the first line of a Texinfo file to cause TeX to make use of the texinfo' macro definitions file. The backslash in \input is used instead of an @ because TeX does not recognize @ until after it has read the definitions file. See section The Texinfo File Header.
@item
Indicate the beginning of a marked paragraph for @itemize and @enumerate; indicate the beginning of the text of a first column entry for @table, @ftable, and @vtable. See section Making Lists and Tables.
@itemize mark-generating-character-or-command
Produce a sequence of indented paragraphs, with a mark inside the left margin at the beginning of each paragraph. Pair with @end itemize. See section Making an Itemized List.
@itemx
Like @item but do not generate extra vertical space above the item text. See section @itemx.
@kbd{keyboard-characters}
Indicate text that is characters of input to be typed by users. See section @kbd{keyboard-characters}.
@key{key-name}
Highlight key-name, a name for a key on a keyboard. See section @key{key-name}.
@kindex entry
Add entry to the index of keys. See section Making Index Entries.
@L{}
@l{}
Generate the uppercase and lowercase Polish suppressed-L letters, respectively: @L{}, @l{}.
@global@letnew-command=existing-command
Equate a new highlighting command with an existing one. Only for TeX. Write definition inside of @iftex ... @end iftex. See section Customized Highlighting.
@lisp
Begin an example of Lisp code. Indent text, do not fill, and select fixed-width font. Pair with @end lisp. See section @lisp.
@lowersections
Change subsequent chapters to sections, sections to subsections, and so on. See section @raisesections and @lowersections.
@macro macro-name {params}
Define a new Texinfo command @macro-name{params}. Only supported by Makeinfo and Texi2dvi. See section Defining Macros.
@majorheading title
Print a chapter-like heading in the text, but not in the table of contents of a printed manual. Generate more vertical whitespace before the heading than the @chapheading command. In Info, the chapter heading line is underlined with asterisks. See section @majorheading, @chapheading.
@math{mathematical-expression}
Format a mathematical expression. See section @math: Inserting Mathematical Expressions.
@menu
Mark the beginning of a menu of nodes in Info. No effect in a printed manual. Pair with @end menu. See section Menus.
@minus{}
Generate a minus sign, -'. See section @minus{}: Inserting a Minus Sign.
@multitable column-width-spec
Begin a multi-column table. Pair with @end multitable. See section Multitable Column Widths.
@need n
Start a new page in a printed manual if fewer than n mils (thousandths of an inch) remain on the current page. See section @need mils: Prevent Page Breaks.
@node name, next, previous, up
Define the beginning of a new node in Info, and serve as a locator for references for TeX. See section The @node Command.
@noindent
Prevent text from being indented as if it were a new paragraph. See section @noindent.
@O{}
@o{}
Generate the uppercase and lowercase Owith-slash letters, respectively: @O{}, @o{}.
@oddfooting [left] @| [center] @| [right]
@oddheading [left] @| [center] @| [right]
Specify page footings resp. headings for odd-numbered (right-hand) pages. Only allowed inside @iftex. See section How to Make Your Own Headings.
@OE{}
@oe{}
Generate the uppercase and lowercase OE ligatures, respectively: @OE{}, @oe{}. See section Inserting Accents.
@page
Start a new page in a printed manual. No effect in Info. See section @page: Start a New Page.
@paragraphindent indent
Indent paragraphs by indent number of spaces; delete indentation if the value of indent is 0; and do not change indentation if indent is asis. See section Paragraph Indenting.
@pindex entry
Add entry to the index of programs. See section Making Index Entries.
@point{}
Indicate the position of point in a buffer to the reader with a glyph: -!-'. See section Indicating Point in a Buffer.
@pounds{}
Generate the pounds sterling currency sign. See section @pounds{}.
@print{}
Indicate printed output to the reader with a glyph: -|'. See section -|: Indicating Printed Output.
@printindex index-name
Print an alphabetized two-column index in a printed manual or generate an alphabetized menu of index entries for Info. See section Index Menus and Printing an Index.
@pxref{node-name, [entry], [topic-or-title], [info-file], [manual]}
Make a reference that starts with a lower case see' in a printed manual. Use within parentheses only. Do not follow command with a punctuation mark--the Info formatting commands automatically insert terminating punctuation as needed. Only the first argument is mandatory. See section @pxref.
@questiondown{}
Generate an upside-down question mark. See section Inserting Accents.
@quotation
Narrow the margins to indicate text that is quoted from another real or imaginary work. Write command on a line of its own. Pair with @end quotation. See section @quotation.
@r{text}
Print text in roman font. No effect in Info. See section Fonts for Printing, Not Info.
@raisesections
Change subsequent sections to chapters, subsections to sections, and so on. See section @raisesections and @lowersections.
@ref{node-name, [entry], [topic-or-title], [info-file], [manual]}
Make a reference. In a printed manual, the reference does not start with a See'. Follow command with a punctuation mark. Only the first argument is mandatory. See section @ref.
@refill
In Info, refill and indent the paragraph after all the other processing has been done. No effect on TeX, which always refills. This command is no longer needed, since all formatters now automatically refill. See section Refilling Paragraphs.
@result{}
Indicate the result of an expression to the reader with a special glyph: =>'. See section =>: Indicating Evaluation.
@ringaccent{c}
Generate a ring accent over the next character, as in @ringaccent{o}. See section Inserting Accents.
@samp{text}
Highlight text that is a literal example of a sequence of characters. Used for single characters, for statements, and often for entire shell commands. See section @samp{text}.
@sc{text}
Set text in a printed output in THE SMALL CAPS FONT and set text in the Info file in uppercase letters. See section @sc{text}: The Small Caps Font.
@section title
Begin a section within a chapter. In a printed manual, the section title is numbered and appears in the table of contents. In Info, the title is underlined with equal signs. See section @section.
@set flag [string]
Make flag active, causing the Texinfo formatting commands to format text between subsequent pairs of @ifset flag and @end ifset commands. Optionally, set value of flag to string. See section @set, @clear, and @value.
@setchapternewpage on-off-odd
Specify whether chapters start on new pages, and if so, whether on odd-numbered (right-hand) new pages. See section @setchapternewpage.
@setfilename info-file-name
Provide a name to be used by the Info file. This command is essential for TeX formatting as well, even though it produces no output. See section @setfilename.
@settitle title
Provide a title for page headers in a printed manual. See section @settitle.
@shortcontents
Print a short table of contents. Not relevant to Info, which uses menus rather than tables of contents. A synonym for @summarycontents. See section Generating a Table of Contents.
@shorttitlepage{title}
Generate a minimal title page. See section @titlepage.
@smallbook
Cause TeX to produce a printed manual in a 7 by 9.25 inch format rather than the regular 8.5 by 11 inch format. See section Printing "Small" Books. Also, see section @smallexample and @smalllisp.
@smallexample
Indent text to indicate an example. Do not fill, select fixed-width font. In @smallbook format, print text in a smaller font than with @example. Pair with @end smallexample. See section @smallexample and @smalllisp.
@smalllisp
Begin an example of Lisp code. Indent text, do not fill, select fixed-width font. In @smallbook format, print text in a smaller font. Pair with @end smalllisp. See section @smallexample and @smalllisp.
@sp n
Skip n blank lines. See section @sp n: Insert Blank Lines.
@ss{}
Generate the German sharp-S es-zet letter, @ss{}. See section Inserting Accents.
@strong text
Emphasize text by typesetting it in a bold font for the printed manual and by surrounding it with asterisks for Info. See section @emph{text} and @strong{text}.
@subheading title
Print an unnumbered subsection-like heading in the text, but not in the table of contents of a printed manual. In Info, the title is underlined with hyphens. See section The @subsection-like Commands.
@subsection title
Begin a subsection within a section. In a printed manual, the subsection title is numbered and appears in the table of contents. In Info, the title is underlined with hyphens. See section The @subsection Command.
@subsubheading title
Print an unnumbered subsubsection-like heading in the text, but not in the table of contents of a printed manual. In Info, the title is underlined with periods. See section The subsub' Commands.
@subsubsection title
Begin a subsubsection within a subsection. In a printed manual, the subsubsection title is numbered and appears in the table of contents. In Info, the title is underlined with periods. See section The subsub' Commands.
@subtitle title
In a printed manual, set a subtitle in a normal sized font flush to the right-hand side of the page. Not relevant to Info, which does not have title pages. See section @title, @subtitle, and @author.
@summarycontents
Print a short table of contents. Not relevant to Info, which uses menus rather than tables of contents. A synonym for @shortcontents. See section Generating a Table of Contents.
@syncodeindex from-index into-index
Merge the index named in the first argument into the index named in the second argument, printing the entries from the first index in @code font. See section Combining Indices.
@synindex from-index into-index
Merge the index named in the first argument into the index named in the second argument. Do not change the font of from-index entries. See section Combining Indices.
@t{text}
Print text in a fixed-width, typewriter-like font. No effect in Info. See section Fonts for Printing, Not Info.
@tab
Separate columns in a multitable. See section Multitable Rows.
@table formatting-command
Begin a two-column table, using @item for each entry. Write each first column entry on the same line as @item. First column entries are printed in the font resulting from formatting-command. Pair with @end table. See section Making a Two-column Table. Also see section @ftable and @vtable, and section @itemx.
@TeX{}
Insert the logo TeX. See section Inserting TeX and the Copyright Symbol.
@tex
Enter TeX completely. Pair with @end tex. See section Using Ordinary TeX Commands.
@thischapter
@thischaptername
@thisfile
@thispage
@thistitle
Only allowed in a heading or footing. Stands for the number and name of the current chapter (in the format Chapter 1: Title'), the chapter name only, the filename, the current page number, and the title of the document, respectively. See section How to Make Your Own Headings.
@tindex entry
Add entry to the index of data types. See section Making Index Entries.
@title title
In a printed manual, set a title flush to the left-hand side of the page in a larger than normal font and underline it with a black rule. Not relevant to Info, which does not have title pages. See section @title, @subtitle, and @author.
@titlefont{text}
In a printed manual, print text in a larger than normal font. Not relevant to Info, which does not have title pages. See section @titlefont, @center, and @sp.
@titlepage
Indicate to Texinfo the beginning of the title page. Write command on a line of its own. Pair with @end titlepage. Nothing between @titlepage and @end titlepage appears in Info. See section @titlepage.
@today{}
Insert the current date, in 1 Jan 1900' style. See section How to Make Your Own Headings.
@top title
In a Texinfo file to be formatted with makeinfo, identify the topmost @node line in the file, which must be written on the line immediately preceding the @top command. Used for makeinfo's node pointer insertion feature. The title is underlined with asterisks. Both the @node line and the @top line normally should be enclosed by @ifinfo and @end ifinfo. In TeX and texinfo-format-buffer, the @top command is merely a synonym for @unnumbered. See section Creating Pointers with makeinfo.
@uc
@ubaraccentc
@udotaccentc
Generate a breve, underbar, or underdot accent, respectively, over or under the character c, as in @u{o}, @ubaraccent{o}, @udotaccent{o}. See section Inserting Accents.
@unnumbered title
In a printed manual, begin a chapter that appears without chapter numbers of any kind. The title appears in the table of contents of a printed manual. In Info, the title is underlined with asterisks. See section @unnumbered, @appendix.
@unnumberedsec title
In a printed manual, begin a section that appears without section numbers of any kind. The title appears in the table of contents of a printed manual. In Info, the title is underlined with equal signs. See section @unnumberedsec, @appendixsec, @heading.
@unnumberedsubsec title
In a printed manual, begin an unnumbered subsection within a chapter. The title appears in the table of contents of a printed manual. In Info, the title is underlined with hyphens. See section The @subsection-like Commands.
@unnumberedsubsubsec title
In a printed manual, begin an unnumbered subsubsection within a chapter. The title appears in the table of contents of a printed manual. In Info, the title is underlined with periods. See section The subsub' Commands.
@url{url}
Highlight text that is a uniform resource locator for the World Wide Web. See section @url{uniform-resource-locator}.
@vc
Generate check accent over the character c, as in @v{o}. See section Inserting Accents.
@value{flag}
Replace flag with the value to which it is set by @set flag. See section @set, @clear, and @value.
@var{metasyntactic-variable}
Highlight a metasyntactic variable, which is something that stands for another piece of text. See section @var{metasyntactic-variable}.
@vindex entry
Add entry to the index of variables. See section Making Index Entries.
@vskip amount
In a printed manual, insert whitespace so as to push text on the remainder of the page towards the bottom of the page. Used in formatting the copyright page with the argument 0pt plus 1filll'. (Note spelling of filll'.) @vskip may be used only in contexts ignored for Info. See section Copyright Page and Permissions.
@vtable formatting-command
Begin a two-column table, using @item for each entry. Automatically enter each of the items in the first column into the index of variables. Pair with @end vtable. The same as @table, except for indexing. See section @ftable and @vtable.
@w{text}
Prevent text from being split across two lines. Do not end a paragraph that uses @w with an @refill command. See section @w{text}: Prevent Line Breaks.
@xref{node-name, [entry], [topic-or-title], [info-file], [manual]}
Make a reference that starts with See' in a printed manual. Follow command with a punctuation mark. Only the first argument is mandatory. See section @xref.

# Tips and Hints

Here are some tips for writing Texinfo documentation:

• Write in the present tense, not in the past or the future.
• Write actively! For example, write "We recommend that ..." rather than "It is recommended that ...".
• Use 70 or 72 as your fill column. Longer lines are hard to read.
• Include a copyright notice and copying permissions.

#### Index, index, index!

Write many index entries, in different ways. Readers like indices; they are helpful and convenient.

Although it is easiest to write index entries as you write the body of the text, some people prefer to write entries afterwards. In either case, write an entry before the paragraph to which it applies. This way, an index entry points to the first page of a paragraph that is split across pages.

Here are more hints we have found valuable:

• Write each index entry differently, so each entry refers to a different place in the document.
• Write index entries only where a topic is discussed significantly. For example, it is not useful to index "debugging information" in a chapter on reporting bugs. Someone who wants to know about debugging information will certainly not find it in that chapter.
• Consistently capitalize the first word of every concept index entry, or else consistently use lower case. Terse entries often call for lower case; longer entries for capitalization. Whichever case convention you use, please use one or the other consistently! Mixing the two styles looks bad.
• Always capitalize or use upper case for those words in an index for which this is proper, such as names of countries or acronyms. Always use the appropriate case for case-sensitive names, such as those in C or Lisp.
• Write the indexing commands that refer to a whole section immediately after the section command, and write the indexing commands that refer to the paragraph before the paragraph. In the example that follows, a blank line comes after the index entry for "Leaping":
@section The Dog and the Fox
@cindex Jumping, in general
@cindex Leaping

@cindex Dog, lazy, jumped over
@cindex Lazy dog jumped over
@cindex Fox, jumps over dog
@cindex Quick fox jumps over dog
The quick brown fox jumps over the lazy dog.

(Note that the example shows entries for the same concept that are written in different ways---Lazy dog', and Dog, lazy'---so readers can look up the concept in different ways.)

#### Blank lines

• Insert a blank line between a sectioning command and the first following sentence or paragraph, or between the indexing commands associated with the sectioning command and the first following sentence or paragraph, as shown in the tip on indexing. Otherwise, a formatter may fold title and paragraph together.
• Always insert a blank line before an @table command and after an @end table command; but never insert a blank line after an @table command or before an @end table command. For example,
Types of fox:

@table @samp
@item Quick
Jump over lazy dogs.

@item Brown
Also jump over lazy dogs.
@end table

@noindent
On the other hand, ...

Insert blank lines before and after @itemize ... @end itemize and @enumerate ... @end enumerate in the same way.

#### Complete phrases

Complete phrases are easier to read than ...

• Write entries in an itemized list as complete sentences; or at least, as complete phrases. Incomplete expressions ... awkward ... like this.
• Write the prefatory sentence or phrase for a multi-item list or table as a complete expression. Do not write "You can set:"; instead, write "You can set these variables:". The former expression sounds cut off.

#### Editions, dates and versions

Write the edition and version numbers and date in three places in every manual:

1. In the first @ifinfo section, for people reading the Texinfo file.
2. In the @titlepage section, for people reading the printed manual.
3. In the Top' node, for people reading the Info file.

Also, it helps to write a note before the first @ifinfo section to explain what you are doing.

For example:

@c ===> NOTE! <==
@c Specify the edition and version numbers and date
@c in *three* places:
@c   1. First ifinfo section  2. title page  3. top node
@c To find the locations, search for !!set

@ifinfo
@c !!set edition, date, version
This is Edition 4.03, January 1992,
of the @cite{GDB Manual} for GDB Version 4.3.
...


---or use @set and @value (see section @value Example).

#### Definition Commands

Definition commands are @deffn, @defun, @defmac, and the like, and enable you to write descriptions in a uniform format.

• Write just one definition command for each entity you define with a definition command. The automatic indexing feature creates an index entry that leads the reader to the definition.
• Use @table ... @end table in an appendix that contains a summary of functions, not @deffn or other definition commands.

#### Capitalization

• Capitalize Texinfo'; it is a name. Do not write the x' or i' in upper case.
• Capitalize Info'; it is a name.
• Write TeX using the @TeX{} command. Note the uppercase T' and X'. This command causes the formatters to typeset the name according to the wishes of Donald Knuth, who wrote TeX.

#### Spaces

Do not use spaces to format a Texinfo file, except inside of @example ... @end example and similar commands.

For example, TeX fills the following:

    @kbd{C-x v}
@kbd{M-x vc-next-action}
Perform the next logical operation
on the version-controlled file
corresponding to the current buffer.


so it looks like this:

C-x v M-x vc-next-action Perform the next logical operation on the version-controlled file corresponding to the current buffer.

In this case, the text should be formatted with @table, @item, and @itemx, to create a table.

#### @code, @samp, @var, and ---'

• Use @code around Lisp symbols, including command names. For example,
The main function is @code{vc-next-action}, ...

• Avoid putting letters such as s' immediately after an @code'. Such letters look bad.
• Use @var around meta-variables. Do not write angle brackets around them.
• Use three hyphens in a row, ---', to indicate a long dash. TeX typesets these as a long dash and the Info formatters reduce three hyphens to two.

#### Periods Outside of Quotes

Place periods and other punctuation marks outside of quotations, unless the punctuation is part of the quotation. This practice goes against publishing conventions in the United States, but enables the reader to distinguish between the contents of the quotation and the whole passage.

For example, you should write the following sentence with the period outside the end quotation marks:

Evidently, au' is an abbreviation for author''.


since au' does not serve as an abbreviation for author.' (with a period following the word).

#### Introducing New Terms

• Introduce new terms so that a reader who does not know them can understand them from context; or write a definition for the term. For example, in the following, the terms "check in", "register" and "delta" are all appearing for the first time; the example sentence should be rewritten so they are understandable.

The major function assists you in checking in a file to your version control system and registering successive sets of changes to it as deltas.

• Use the @dfn command around a word being introduced, to indicate that the reader should not expect to know the meaning already, and should expect to learn the meaning from this passage.

#### @pxref

Absolutely never use @pxref except in the special context for which it is designed: inside parentheses, with the closing parenthesis following immediately after the closing brace. One formatter automatically inserts closing punctuation and the other does not. This means that the output looks right both in printed output and in an Info file, but only when the command is used inside parentheses.

#### Invoking from a Shell

You can invoke programs such as Emacs, GCC, and GAWK from a shell. The documentation for each program should contain a section that describes this. Unfortunately, if the node names and titles for these sections are all different, readers find it hard to search for the section.

Name such sections with a phrase beginning with the word Invoking ...', as in Invoking Emacs'; this way users can find the section easily.

#### ANSI C Syntax

When you use @example to describe a C function's calling conventions, use the ANSI C syntax, like this:

void dld_init (char *@var{path});


And in the subsequent discussion, refer to the argument values by writing the same argument names, again highlighted with @var.

Avoid the obsolete style that looks like this:

#include <dld.h>

dld_init (path)
char *path;


Also, it is best to avoid writing #include above the declaration just to indicate that the function is declared in a header file. The practice may give the misimpression that the #include belongs near the declaration of the function. Either state explicitly which header file holds the declaration or, better yet, name the header file used for a group of functions at the beginning of the section that describes the functions.

Here are several examples of bad writing to avoid:

In this example, say, " ... you must @dfn{check in} the new version." That flows better.

When you are done editing the file, you must perform a @dfn{check in}.

In the following example, say, "... makes a unified interface such as VC mode possible."

SCCS, RCS and other version-control systems all perform similar functions in broadly similar ways (it is this resemblance which makes a unified control mode like this possible).

And in this example, you should specify what it' refers to:

If you are working with other people, it assists in coordinating everyone's changes so they do not step on each other.

#### And Finally ...

• Pronounce TeX as if the X' were a Greek chi', as the last sound in the name Bach'. But pronounce Texinfo as in speck': teckinfo'.
• Write notes for yourself at the very end of a Texinfo file after the @bye. None of the formatters process text after the @bye; it is as if the text were within @ignore ... @end ignore.

# A Sample Texinfo File

Here is a complete, short sample Texinfo file, without any commentary. You can see this file, with comments, in the first chapter. See section A Short Sample Texinfo File.

\input texinfo   @c -*-texinfo-*-
@setfilename sample.info
@settitle Sample Document

@setchapternewpage odd

@ifinfo
This is a short example of a complete Texinfo file.

Copyright 1990 Free Software Foundation, Inc.
@end ifinfo

@titlepage
@sp 10
@comment The title is printed in a large font.
@center @titlefont{Sample Title}

@c The following two commands start the copyright page.
@page
@vskip 0pt plus 1filll
@end titlepage

@node    Top,       First Chapter, (dir),    (dir)
@comment node-name, next,          previous, up

* First Chapter::    The first chapter is the
only chapter in this sample.
* Concept Index::    This index has two entries.

@node    First Chapter, Concept Index, Top,      Top
@comment node-name,     next,          previous, up
@chapter First Chapter
@cindex Sample index entry

This is the contents of the first chapter.
@cindex Another sample index entry

Here is a numbered list.

@enumerate
@item
This is the first item.

@item
This is the second item.
@end enumerate

The @code{makeinfo} and @code{texinfo-format-buffer}
commands transform a Texinfo file such as this into
an Info file; and @TeX{} typesets it for a printed
manual.

@node    Concept Index,    ,  First Chapter, Top
@comment node-name,    next,  previous,      up
@unnumbered Concept Index

@printindex cp

@contents
@bye


# Sample Permissions

Texinfo files should contain sections that tell the readers that they have the right to copy and distribute the Texinfo file, the Info file, and the printed manual.

Also, if you are writing a manual about software, you should explain that the software is free and either include the GNU General Public License (GPL) or provide a reference to it. See section Distribution' in The GNU Emacs Manual, for an example of the text that could be used in the software "Distribution", "General Public License", and "NO WARRANTY" sections of a document. See section Texinfo Copying Conditions, for an example of a brief explanation of how the copying conditions provide you with rights.

In a Texinfo file, the first @ifinfo section usually begins with a line that says what the file documents. This is what a person reading the unprocessed Texinfo file or using the advanced Info command g * sees first. See Info file info', node Expert', for more information. (A reader using the regular Info commands usually starts reading at the first node and skips this first section, which is not in a node.)

In the @ifinfo section, the summary sentence is followed by a copyright notice and then by the copying permission notice. One of the copying permission paragraphs is enclosed in @ignore and @end ignore commands. This paragraph states that the Texinfo file can be processed through TeX and printed, provided the printed manual carries the proper copying permission notice. This paragraph is not made part of the Info file since it is not relevant to the Info file; but it is a mandatory part of the Texinfo file since it permits people to process the Texinfo file in TeX and print the results.

In the printed manual, the Free Software Foundation copying permission notice follows the copyright notice and publishing information and is located within the region delineated by the @titlepage and @end titlepage commands. The copying permission notice is exactly the same as the notice in the @ifinfo section except that the paragraph enclosed in @ignore and @end ignore commands is not part of the notice.

To make it simple to insert a permission notice into each section of the Texinfo file, sample permission notices for each section are reproduced in full below.

Note that you may need to specify the correct name of a section mentioned in the permission notice. For example, in The GDB Manual, the name of the section referring to the General Public License is called the "GDB General Public License", but in the sample shown below, that section is referred to generically as the "GNU General Public License". If the Texinfo file does not carry a copy of the General Public License, leave out the reference to it, but be sure to include the rest of the sentence.

## ifinfo' Copying Permissions

In the @ifinfo section of a Texinfo file, the standard Free Software Foundation permission notice reads as follows:

This file documents ...

Copyright 1992 Free Software Foundation, Inc.

Permission is granted to make and distribute verbatim
copies of this manual provided the copyright notice and
this permission notice are preserved on all copies.

@ignore
Permission is granted to process this file through TeX
and print the results, provided the printed document
carries a copying permission notice identical to this
one except for the removal of this paragraph (this
paragraph not being relevant to the printed manual).

@end ignore
Permission is granted to copy and distribute modified
versions of this manual under the conditions for
verbatim copying, provided also that the sections
entitled Copying'' and GNU General Public License''
are included exactly as in the original, and provided
that the entire resulting derived work is distributed
under the terms of a permission notice identical to this
one.

Permission is granted to copy and distribute
translations of this manual into another language,
under the above conditions for modified versions,
except that this permission notice may be stated in a
translation approved by the Free Software Foundation.


## Titlepage Copying Permissions

In the @titlepage section of a Texinfo file, the standard Free Software Foundation copying permission notice follows the copyright notice and publishing information. The standard phrasing is as follows:

Permission is granted to make and distribute verbatim
copies of this manual provided the copyright notice and
this permission notice are preserved on all copies.

Permission is granted to copy and distribute modified
versions of this manual under the conditions for
verbatim copying, provided also that the sections
entitled Copying'' and GNU General Public License''
are included exactly as in the original, and provided
that the entire resulting derived work is distributed
under the terms of a permission notice identical to this
one.

Permission is granted to copy and distribute
translations of this manual into another language,
under the above conditions for modified versions,
except that this permission notice may be stated in a
translation approved by the Free Software Foundation.


# Include Files

When TeX or an Info formatting command sees an @include command in a Texinfo file, it processes the contents of the file named by the command and incorporates them into the DVI or Info file being created. Index entries from the included file are incorporated into the indices of the output file.

Include files let you keep a single large document as a collection of conveniently small parts.

## How to Use Include Files

To include another file within a Texinfo file, write the @include command at the beginning of a line and follow it on the same line by the name of a file to be included. For example:

@include buffers.texi


An included file should simply be a segment of text that you expect to be included as is into the overall or outer Texinfo file; it should not contain the standard beginning and end parts of a Texinfo file. In particular, you should not start an included file with a line saying \input texinfo'; if you do, that phrase is inserted into the output file as is. Likewise, you should not end an included file with an @bye command; nothing after @bye is formatted.

In the past, you were required to write an @setfilename line at the beginning of an included file, but no longer. Now, it does not matter whether you write such a line. If an @setfilename line exists in an included file, it is ignored.

Conventionally, an included file begins with an @node line that is followed by an @chapter line. Each included file is one chapter. This makes it easy to use the regular node and menu creating and updating commands to create the node pointers and menus within the included file. However, the simple Emacs node and menu creating and updating commands do not work with multiple Texinfo files. Thus you cannot use these commands to fill in the Next', Previous', and Up' pointers of the @node line that begins the included file. Also, you cannot use the regular commands to create a master menu for the whole file. Either you must insert the menus and the Next', Previous', and Up' pointers by hand, or you must use the GNU Emacs Texinfo mode command, texinfo-multiple-files-update, that is designed for @include files.

## texinfo-multiple-files-update

GNU Emacs Texinfo mode provides the texinfo-multiple-files-update command. This command creates or updates Next', Previous', and Up' pointers of included files as well as those in the outer or overall Texinfo file, and it creates or updates a main menu in the outer file. Depending whether you call it with optional arguments, the command updates only the pointers in the first @node line of the included files or all of them:

M-x texinfo-multiple-files-update
Called without any arguments:
• Create or update the Next', Previous', and Up' pointers of the first @node line in each file included in an outer or overall Texinfo file.
• Create or update the Top' level node pointers of the outer or overall file.
• Create or update a main menu in the outer file.
C-u M-x texinfo-multiple-files-update
Called with C-u as a prefix argument:
• Create or update pointers in the first @node line in each included file.
• Create or update the Top' level node pointers of the outer file.
• Create and insert a master menu in the outer file. The master menu is made from all the menus in all the included files.
C-u 8 M-x texinfo-multiple-files-update
Called with a numeric prefix argument, such as C-u 8:
• Create or update all the Next', Previous', and Up' pointers of all the included files.
• Create or update all the menus of all the included files.
• Create or update the Top' level node pointers of the outer or overall file.
• And then create a master menu in the outer file. This is similar to invoking texinfo-master-menu with an argument when you are working with just one file.

Note the use of the prefix argument in interactive use: with a regular prefix argument, just C-u, the texinfo-multiple-files-update command inserts a master menu; with a numeric prefix argument, such as C-u 8, the command updates every pointer and menu in all the files and then inserts a master menu.

## Include File Requirements

If you plan to use the texinfo-multiple-files-update command, the outer Texinfo file that lists included files within it should contain nothing but the beginning and end parts of a Texinfo file, and a number of @include commands listing the included files. It should not even include indices, which should be listed in an included file of their own.

Moreover, each of the included files must contain exactly one highest level node (conventionally, @chapter or equivalent), and this node must be the first node in the included file. Furthermore, each of these highest level nodes in each included file must be at the same hierarchical level in the file structure. Usually, each is an @chapter, an @appendix, or an @unnumbered node. Thus, normally, each included file contains one, and only one, chapter or equivalent-level node.

The outer file should contain only one node, the Top' node. It should not contain any nodes besides the single Top' node. The texinfo-multiple-files-update command will not process them.

## Sample File with @include

Here is an example of a complete outer Texinfo file with @include files within it before running texinfo-multiple-files-update, which would insert a main or master menu:

\input texinfo @c -*-texinfo-*-
@setfilename  include-example.info
@settitle Include Example

@setchapternewpage odd
@titlepage
@sp 12
@center @titlefont{Include Example}
@sp 2
@center by Whom Ever

@page
@vskip 0pt plus 1filll
@end titlepage

@ifinfo
@node Top, First, (dir), (dir)
@end ifinfo

@include foo.texinfo
@include bar.texinfo
@include concept-index.texinfo

@summarycontents
@contents

@bye


An included file, such as foo.texinfo', might look like this:

@node First, Second, , Top
@chapter First Chapter

Contents of first chapter ...


The full contents of concept-index.texinfo' might be as simple as this:

@node Concept Index, , Second, Top
@unnumbered Concept Index

@printindex cp


The outer Texinfo source file for The GNU Emacs Lisp Reference Manual is named elisp.texi'. This outer file contains a master menu with 417 entries and a list of 41 @include files.

## Evolution of Include Files

When Info was first created, it was customary to create many small Info files on one subject. Each Info file was formatted from its own Texinfo source file. This custom meant that Emacs did not need to make a large buffer to hold the whole of a large Info file when someone wanted information; instead, Emacs allocated just enough memory for the small Info file that contained the particular information sought. This way, Emacs could avoid wasting memory.

References from one file to another were made by referring to the file name as well as the node name. (See section Referring to Other Info Files. Also, see section @xref with Four and Five Arguments.)

Include files were designed primarily as a way to create a single, large printed manual out of several smaller Info files. In a printed manual, all the references were within the same document, so TeX could automatically determine the references' page numbers. The Info formatting commands used include files only for creating joint indices; each of the individual Texinfo files had to be formatted for Info individually. (Each, therefore, required its own @setfilename line.)

However, because large Info files are now split automatically, it is no longer necessary to keep them small.

Nowadays, multiple Texinfo files are used mostly for large documents, such as The GNU Emacs Lisp Reference Manual, and for projects in which several different people write different sections of a document simultaneously.

In addition, the Info formatting commands have been extended to work with the @include command so as to create a single large Info file that is split into smaller files if necessary. This means that you can write menus and cross references without naming the different Texinfo files.

Most printed manuals contain headings along the top of every page except the title and copyright pages. Some manuals also contain footings. (Headings and footings have no meaning to Info, which is not paginated.)

Texinfo provides standard page heading formats for manuals that are printed on one side of each sheet of paper and for manuals that are printed on both sides of the paper. Usually, you will use one or other of these formats, but you can specify your own format, if you wish.

In addition, you can specify whether chapters should begin on a new page, or merely continue the same page as the previous chapter; and if chapters begin on new pages, you can specify whether they must be odd-numbered pages.

By convention, a book is printed on both sides of each sheet of paper. When you open a book, the right-hand page is odd-numbered, and chapters begin on right-hand pages--a preceding left-hand page is left blank if necessary. Reports, however, are often printed on just one side of paper, and chapters begin on a fresh page immediately following the end of the preceding chapter. In short or informal reports, chapters often do not begin on a new page at all, but are separated from the preceding text by a small amount of whitespace.

The @setchapternewpage command controls whether chapters begin on new pages, and whether one of the standard heading formats is used. In addition, Texinfo has several heading and footing commands that you can use to generate your own heading and footing formats.

In Texinfo, headings and footings are single lines at the tops and bottoms of pages; you cannot create multiline headings or footings. Each header or footer line is divided into three parts: a left part, a middle part, and a right part. Any part, or a whole line, may be left blank. Text for the left part of a header or footer line is set flushleft; text for the middle part is centered; and, text for the right part is set flushright.

Texinfo provides two standard heading formats, one for manuals printed on one side of each sheet of paper, and the other for manuals printed on both sides of the paper.

By default, nothing is specified for the footing of a Texinfo file, so the footing remains blank.

The standard format for single-sided printing consists of a header line in which the left-hand part contains the name of the chapter, the central part is blank, and the right-hand part contains the page number.

A single-sided page looks like this:

   _______________________
|                       |
| chapter   page number |
|                       |
| Start of text ...     |
| ...                   |
|                       |



The standard format for two-sided printing depends on whether the page number is even or odd. By convention, even-numbered pages are on the left- and odd-numbered pages are on the right. (TeX will adjust the widths of the left- and right-hand margins. Usually, widths are correct, but during double-sided printing, it is wise to check that pages will bind properly--sometimes a printer will produce output in which the even-numbered pages have a larger right-hand margin than the odd-numbered pages.)

In the standard double-sided format, the left part of the left-hand (even-numbered) page contains the page number, the central part is blank, and the right part contains the title (specified by the @settitle command). The left part of the right-hand (odd-numbered) page contains the name of the chapter, the central part is blank, and the right part contains the page number.

Two pages, side by side as in an open book, look like this:

   _______________________     _______________________
|                       |   |                       |
| page number     title |   | chapter   page number |
|                       |   |                       |
| Start of text ...     |   | More  text ...        |
| ...                   |   | ...                   |
|                       |   |                       |



The chapter name is preceded by the word Chapter', the chapter number and a colon. This makes it easier to keep track of where you are in the manual.

## Specifying the Type of Heading

TeX does not begin to generate page headings for a standard Texinfo file until it reaches the @end titlepage command. Thus, the title and copyright pages are not numbered. The @end titlepage command causes TeX to begin to generate page headings according to a standard format specified by the @setchapternewpage command that precedes the @titlepage section.

There are four possibilities:

No @setchapternewpage command
Cause TeX to specify the single-sided heading format, with chapters on new pages. This is the same as @setchapternewpage on.
@setchapternewpage on
Specify the single-sided heading format, with chapters on new pages.
@setchapternewpage off
Cause TeX to start a new chapter on the same page as the last page of the preceding chapter, after skipping some vertical whitespace. Also cause TeX to typeset for single-sided printing. (You can override the headers format with the @headings double command; see section The @headings Command.)
@setchapternewpage odd
Specify the double-sided heading format, with chapters on new pages.

Texinfo lacks an @setchapternewpage even command.

You can use the standard headings provided with Texinfo or specify your own.

Texinfo provides six commands for specifying headings and footings. The @everyheading command and @everyfooting command generate page headers and footers that are the same for both even- and odd-numbered pages. The @evenheading command and @evenfooting command generate headers and footers for even-numbered (left-hand) pages; and the @oddheading command and @oddfooting command generate headers and footers for odd-numbered (right-hand) pages.

Write custom heading specifications in the Texinfo file immediately after the @end titlepage command. Enclose your specifications between @iftex and @end iftex commands since the texinfo-format-buffer command may not recognize them. Also, you must cancel the predefined heading commands with the @headings off command before defining your own specifications.

Here is how to tell TeX to place the chapter name at the left, the page number in the center, and the date at the right of every header for both even- and odd-numbered pages:

@iftex
@everyheading @thischapter @| @thispage @| @today{}
@end iftex


You need to divide the left part from the central part and the central part from the right had part by inserting @|' between parts. Otherwise, the specification command will not be able to tell where the text for one part ends and the next part begins.

Each part can contain text or @-commands. The text is printed as if the part were within an ordinary paragraph in the body of the page. The @-commands replace themselves with the page number, date, chapter name, or whatever.

Here are the six heading and footing commands:

@everyheading left @| center @| right
@everyfooting left @| center @| right
The every' commands specify the format for both even- and odd-numbered pages. These commands are for documents that are printed on one side of each sheet of paper, or for documents in which you want symmetrical headers or footers.
@evenheading left @| center @| right
@oddheading left @| center @| right
@evenfooting left @| center @| right
@oddfooting left @| center @| right
The even' and odd' commands specify the format for even-numbered pages and odd-numbered pages. These commands are for books and manuals that are printed on both sides of each sheet of paper.

Use the @this...' series of @-commands to provide the names of chapters and sections and the page number. You can use the @this...' commands in the left, center, or right portions of headers and footers, or anywhere else in a Texinfo file so long as they are between @iftex and @end iftex commands.

Here are the @this...' commands:

@thispage
Expands to the current page number.
@thischaptername
Expands to the name of the current chapter.
@thischapter
Expands to the number and name of the current chapter, in the format Chapter 1: Title'.
@thistitle
Expands to the name of the document, as specified by the @settitle command.
@thisfile
For @include files only: expands to the name of the current @include file. If the current Texinfo source file is not an @include file, this command has no effect. This command does not provide the name of the current Texinfo source file unless it is an @include file. (See section Include Files, for more information about @include files.)

You can also use the @today{} command, which expands to the current date, in 1 Jan 1900' format.

Other @-commands and text are printed in a header or footer just as if they were in the body of a page. It is useful to incorporate text, particularly when you are writing drafts:

@iftex
@everyheading @emph{Draft!} @| @thispage @| @thischapter
@everyfooting @| @| Version: 0.27: @today{}
@end iftex


Beware of overlong titles: they may overlap another part of the header or footer and blot it out.

# Formatting Mistakes

Besides mistakes in the content of your documentation, there are two kinds of mistake you can make with Texinfo: you can make mistakes with @-commands, and you can make mistakes with the structure of the nodes and chapters.

Emacs has two tools for catching the @-command mistakes and two for catching structuring mistakes.

For finding problems with @-commands, you can run TeX or a region formatting command on the region that has a problem; indeed, you can run these commands on each region as you write it.

For finding problems with the structure of nodes and chapters, you can use C-c C-s (texinfo-show-structure) and the related occur command and you can use the M-x Info-validate command.

The makeinfo program does an excellent job of catching errors and reporting them--far better than texinfo-format-region or texinfo-format-buffer. In addition, the various functions for automatically creating and updating node pointers and menus remove many opportunities for human error.

If you can, use the updating commands to create and insert pointers and menus. These prevent many errors. Then use makeinfo (or its Texinfo mode manifestations, makeinfo-region and makeinfo-buffer) to format your file and check for other errors. This is the best way to work with Texinfo. But if you cannot use makeinfo, or your problem is very puzzling, then you may want to use the tools described in this appendix.

## Catching Errors with Info Formatting

After you have written part of a Texinfo file, you can use the texinfo-format-region or the makeinfo-region command to see whether the region formats properly.

Most likely, however, you are reading this section because for some reason you cannot use the makeinfo-region command; therefore, the rest of this section presumes that you are using texinfo-format-region.

If you have made a mistake with an @-command, texinfo-format-region will stop processing at or after the error and display an error message. To see where in the buffer the error occurred, switch to the *Info Region*' buffer; the cursor will be in a position that is after the location of the error. Also, the text will not be formatted after the place where the error occurred (or more precisely, where it was detected).

For example, if you accidentally end a menu with the command @end menus with an s' on the end, instead of with @end menu, you will see an error message that says:

@end menus is not handled by texinfo


The cursor will stop at the point in the buffer where the error occurs, or not long after it. The buffer will look like this:

---------- Buffer: *Info Region* ----------

* Using texinfo-show-structure::  How to use
texinfo-show-structure'
to catch mistakes.
* Running Info-Validate::         How to check for
unreferenced nodes.
-!-
---------- Buffer: *Info Region* ----------


The texinfo-format-region command sometimes provides slightly odd error messages. For example, the following cross reference fails to format:

(@xref{Catching Mistakes, for more info.)


In this case, texinfo-format-region detects the missing closing brace but displays a message that says Unbalanced parentheses' rather than Unbalanced braces'. This is because the formatting command looks for mismatches between braces as if they were parentheses.

Sometimes texinfo-format-region fails to detect mistakes. For example, in the following, the closing brace is swapped with the closing parenthesis:

(@xref{Catching Mistakes), for more info.}


Formatting produces:

(*Note for more info.: Catching Mistakes)


The only way for you to detect this error is to realize that the reference should have looked like this:

(*Note Catching Mistakes::, for more info.)


Incidentally, if you are reading this node in Info and type f RET (Info-follow-reference), you will generate an error message that says:

No such node: "Catching Mistakes) The only way ...


This is because Info perceives the example of the error as the first cross reference in this node and if you type a RET immediately after typing the Info f command, Info will attempt to go to the referenced node. If you type f catch TAB RET, Info will complete the node name of the correctly written example and take you to the Catching Mistakes' node. (If you try this, you can return from the Catching Mistakes' node by typing l (Info-last).)

## Catching Errors with TeX Formatting

You can also catch mistakes when you format a file with TeX.

Usually, you will want to do this after you have run texinfo-format-buffer (or, better, makeinfo-buffer) on the same file, because texinfo-format-buffer sometimes displays error messages that make more sense than TeX. (See section Catching Errors with Info Formatting, for more information.)

For example, TeX was run on a Texinfo file, part of which is shown here:

---------- Buffer: texinfo.texi ----------
name of the Texinfo file as an extension.  The
@samp{??} are wildcards' that cause the shell to
substitute all the raw index files.  (@xref{sorting
indices.)@refill
---------- Buffer: texinfo.texi ----------


(The cross reference lacks a closing brace.) TeX produced the following output, after which it stopped:

---------- Buffer: *tex-shell* ----------
Runaway argument?
indices.) @refill @ETC.
! Paragraph ended before @xref was complete.
@par
l.27

?
---------- Buffer: *tex-shell* ----------


In this case, TeX produced an accurate and understandable error message:

Paragraph ended before @xref was complete.


@par' is an internal TeX command of no relevance to Texinfo. l.27' means that TeX detected the problem on line 27 of the Texinfo file. The ?' is the prompt TeX uses in this circumstance.

Unfortunately, TeX is not always so helpful, and sometimes you must truly be a Sherlock Holmes to discover what went wrong.

In any case, if you run into a problem like this, you can do one of three things.

1. You can tell TeX to continue running and ignore just this error by typing RET at the ?' prompt.
2. You can tell TeX to continue running and to ignore all errors as best it can by typing r RET at the ?' prompt. This is often the best thing to do. However, beware: the one error may produce a cascade of additional error messages as its consequences are felt through the rest of the file. (To stop TeX when it is producing such an avalanche of error messages, type C-d (or C-c C-d, if you are running a shell inside Emacs.))
3. You can tell TeX to stop this run by typing x RET at the ?' prompt.

Please note that if you are running TeX inside Emacs, you need to switch to the shell buffer and line at which TeX offers the ?' prompt.

Sometimes TeX will format a file without producing error messages even though there is a problem. This usually occurs if a command is not ended but TeX is able to continue processing anyhow. For example, if you fail to end an itemized list with the @end itemize command, TeX will write a DVI file that you can print out. The only error message that TeX will give you is the somewhat mysterious comment that

(@end occurred inside a group at level 1)


However, if you print the DVI file, you will find that the text of the file that follows the itemized list is entirely indented as if it were part of the last item in the itemized list. The error message is the way TeX says that it expected to find an @end command somewhere in the file; but that it could not determine where it was needed.

Another source of notoriously hard-to-find errors is a missing @end group command. If you ever are stumped by incomprehensible errors, look for a missing @end group command first.

If the Texinfo file lacks header lines, TeX may stop in the beginning of its run and display output that looks like the following. The *' indicates that TeX is waiting for input.

This is TeX, Version 3.14159 (Web2c 7.0)
(test.texinfo [1])
*


In this case, simply type \end RET after the asterisk. Then write the header lines in the Texinfo file and run the TeX command again. (Note the use of the backslash, \'. TeX uses \' instead of @'; and in this circumstance, you are working directly with TeX, not with Texinfo.)

## Using texinfo-show-structure

It is not always easy to keep track of the nodes, chapters, sections, and subsections of a Texinfo file. This is especially true if you are revising or adding to a Texinfo file that someone else has written.

In GNU Emacs, in Texinfo mode, the texinfo-show-structure command lists all the lines that begin with the @-commands that specify the structure: @chapter, @section, @appendix, and so on. With an argument (C-u as prefix argument, if interactive), the command also shows the @node lines. The texinfo-show-structure command is bound to C-c C-s in Texinfo mode, by default.

The lines are displayed in a buffer called the *Occur*' buffer, indented by hierarchical level. For example, here is a part of what was produced by running texinfo-show-structure on this manual:

 Lines matching "^@\$$chapter \\|sect\\|subs\\|subh\\| unnum\\|major\\|chapheading \\|heading \\|appendix\$$"
in buffer texinfo.texi.
...
4177:@chapter Nodes
4231:    @section Node and Menu Illustration
4337:    @section The @code{@@node} Command
4393:        @subheading Choosing Node and Pointer Names
4417:        @subsection How to Write an @code{@@node} Line
4469:        @subsection @code{@@node} Line Tips
...


This says that lines 4337, 4393, and 4417 of texinfo.texi' begin with the @section, @subheading, and @subsection commands respectively. If you move your cursor into the *Occur*' window, you can position the cursor over one of the lines and use the C-c C-c command (occur-mode-goto-occurrence), to jump to the corresponding spot in the Texinfo file. See section Using Occur' in The GNU Emacs Manual, for more information about occur-mode-goto-occurrence.

The first line in the *Occur*' window describes the regular expression specified by texinfo-heading-pattern. This regular expression is the pattern that texinfo-show-structure looks for. See section Using Regular Expressions' in The GNU Emacs Manual, for more information.

When you invoke the texinfo-show-structure command, Emacs will display the structure of the whole buffer. If you want to see the structure of just a part of the buffer, of one chapter, for example, use the C-x n n (narrow-to-region) command to mark the region. (See section Narrowing' in The GNU Emacs Manual.) This is how the example used above was generated. (To see the whole buffer again, use C-x n w (widen).)

If you call texinfo-show-structure with a prefix argument by typing C-u C-c C-s, it will list lines beginning with @node as well as the lines beginning with the @-sign commands for @chapter, @section, and the like.

You can remind yourself of the structure of a Texinfo file by looking at the list in the *Occur*' window; and if you have mis-named a node or left out a section, you can correct the mistake.

## Using occur

Sometimes the texinfo-show-structure command produces too much information. Perhaps you want to remind yourself of the overall structure of a Texinfo file, and are overwhelmed by the detailed list produced by texinfo-show-structure. In this case, you can use the occur command directly. To do this, type

M-x occur


and then, when prompted, type a regexp, a regular expression for the pattern you want to match. (See section Regular Expressions' in The GNU Emacs Manual.) The occur command works from the current location of the cursor in the buffer to the end of the buffer. If you want to run occur on the whole buffer, place the cursor at the beginning of the buffer.

For example, to see all the lines that contain the word @chapter' in them, just type @chapter'. This will produce a list of the chapters. It will also list all the sentences with @chapter' in the middle of the line.

If you want to see only those lines that start with the word @chapter', type ^@chapter' when prompted by occur. If you want to see all the lines that end with a word or phrase, end the last word with a $'; for example, catching mistakes$'. This can be helpful when you want to see all the nodes that are part of the same chapter or section and therefore have the same Up' pointer.

See section Using Occur' in The GNU Emacs Manual, for more information.

You can use the Info-validate command to check whether any of the Next', Previous', Up' or other node pointers fail to point to a node. This command checks that every node pointer points to an existing node. The Info-validate command works only on Info files, not on Texinfo files.

The makeinfo program validates pointers automatically, so you do not need to use the Info-validate command if you are using makeinfo. You only may need to use Info-validate if you are unable to run makeinfo and instead must create an Info file using texinfo-format-region or texinfo-format-buffer, or if you write an Info file from scratch.

### Running Info-validate

To use Info-validate, visit the Info file you wish to check and type:

M-x Info-validate


(Note that the Info-validate command requires an upper case I'. You may also need to create a tag table before running Info-validate. See section Tagifying a File.)

If your file is valid, you will receive a message that says "File appears valid". However, if you have a pointer that does not point to a node, error messages will be displayed in a buffer called *problems in info file*'.

For example, Info-validate was run on a test file that contained only the first node of this manual. One of the messages said:

In node "Overview", invalid Next: Texinfo Mode


This meant that the node called Overview' had a Next' pointer that did not point to anything (which was true in this case, since the test file had only one node in it).

Now suppose we add a node named Texinfo Mode' to our test case but we do not specify a Previous' for this node. Then we will get the following error message:

In node "Texinfo Mode", should have Previous: Overview


This is because every Next' pointer should be matched by a Previous' (in the node where the Next' points) which points back.

Info-validate also checks that all menu entries and cross references point to actual nodes.

Note that Info-validate requires a tag table and does not work with files that have been split. (The texinfo-format-buffer command automatically splits large files.) In order to use Info-validate on a large file, you must run texinfo-format-buffer with an argument so that it does not split the Info file; and you must create a tag table for the unsplit file.

### Creating an Unsplit File

You can run Info-validate only on a single Info file that has a tag table. The command will not work on the indirect subfiles that are generated when a master file is split. If you have a large file (longer than 70,000 bytes or so), you need to run the texinfo-format-buffer or makeinfo-buffer command in such a way that it does not create indirect subfiles. You will also need to create a tag table for the Info file. After you have done this, you can run Info-validate and look for badly referenced nodes.

The first step is to create an unsplit Info file. To prevent texinfo-format-buffer from splitting a Texinfo file into smaller Info files, give a prefix to the M-x texinfo-format-buffer command:

C-u M-x texinfo-format-buffer


or else

C-u C-c C-e C-b


When you do this, Texinfo will not split the file and will not create a tag table for it.

### Tagifying a File

After creating an unsplit Info file, you must create a tag table for it. Visit the Info file you wish to tagify and type:

M-x Info-tagify


(Note the upper case I' in Info-tagify.) This creates an Info file with a tag table that you can validate.

The third step is to validate the Info file:

M-x Info-validate


(Note the upper case I' in Info-validate.) In brief, the steps are:

C-u M-x texinfo-format-buffer
M-x Info-tagify
M-x Info-validate


After you have validated the node structure, you can rerun texinfo-format-buffer in the normal way so it will construct a tag table and split the file automatically, or you can make the tag table and split the file manually.

### Splitting a File Manually

You should split a large file or else let the texinfo-format-buffer or makeinfo-buffer command do it for you automatically. (Generally you will let one of the formatting commands do this job for you. See section Creating an Info File.)

The split-off files are called the indirect subfiles.

Info files are split to save memory. With smaller files, Emacs does not have make such a large buffer to hold the information.

If an Info file has more than 30 nodes, you should also make a tag table for it. See section Running Info-validate, for information about creating a tag table. (Again, tag tables are usually created automatically by the formatting command; you only need to create a tag table yourself if you are doing the job manually. Most likely, you will do this for a large, unsplit file on which you have run Info-validate.)

Visit the Info file you wish to tagify and split and type the two commands:

M-x Info-tagify
M-x Info-split


(Note that the I' in Info' is upper case.)

When you use the Info-split command, the buffer is modified into a (small) Info file which lists the indirect subfiles. This file should be saved in place of the original visited file. The indirect subfiles are written in the same directory the original file is in, with names generated by appending -' and a number to the original file name.

The primary file still functions as an Info file, but it contains just the tag table and a directory of subfiles.

# Refilling Paragraphs

The @refill command refills and, optionally, indents the first line of a paragraph.(13) The @refill command is no longer important, but we describe it here because you once needed it. You will see it in many old Texinfo files.

Without refilling, paragraphs containing long @-constructs may look bad after formatting because the formatter removes @-commands and shortens some lines more than others. In the past, neither the texinfo-format-region command nor the texinfo-format-buffer command refilled paragraphs automatically. The @refill command had to be written at the end of every paragraph to cause these formatters to fill them. (Both TeX and makeinfo have always refilled paragraphs automatically.) Now, all the Info formatters automatically fill and indent those paragraphs that need to be filled and indented.

The @refill command causes texinfo-format-region and texinfo-format-buffer to refill a paragraph in the Info file after all the other processing has been done. For this reason, you can not use @refill with a paragraph containing either @* or @w{ ... } since the refilling action will override those two commands.

The texinfo-format-region and texinfo-format-buffer commands now automatically append @refill to the end of each paragraph that should be filled. They do not append @refill to the ends of paragraphs that contain @* or @w{ ...} and therefore do not refill or indent them.

# @-Command Syntax

The character @' is used to start special Texinfo commands. (It has the same meaning that \' has in plain TeX.) Texinfo has four types of @-command:

1. Non-alphabetic commands.
These commands consist of an @ followed by a punctuation mark or other character that is not part of the alphabet. Non-alphabetic commands are almost always part of the text within a paragraph, and never take any argument. The two characters (@ and the other one) are complete in themselves; none is followed by braces. The non-alphabetic commands are: @., @:, @*, @@, @{, and @}.
2. Alphabetic commands that do not require arguments.
These commands start with @ followed by a word followed by left- and right-hand braces. These commands insert special symbols in the document; they do not require arguments. For example, @dots{} => ...', @equiv{} => ==', @TeX{} => TeX', and @bullet{} => *'.
3. Alphabetic commands that require arguments within braces.
These commands start with @ followed by a letter or a word, followed by an argument within braces. For example, the command @dfn indicates the introductory or defining use of a term; it is used as follows: In Texinfo, @@-commands are @dfn{mark-up} commands.'
4. Alphabetic commands that occupy an entire line.
These commands occupy an entire line. The line starts with @, followed by the name of the command (a word); for example, @center or @cindex. If no argument is needed, the word is followed by the end of the line. If there is an argument, it is separated from the command name by a space. Braces are not used.

Thus, the alphabetic commands fall into classes that have different argument syntaxes. You cannot tell to which class a command belongs by the appearance of its name, but you can tell by the command's meaning: if the command stands for a glyph, it is in class 2 and does not require an argument; if it makes sense to use the command together with other text as part of a paragraph, the command is in class 3 and must be followed by an argument in braces; otherwise, it is in class 4 and uses the rest of the line as its argument.

The purpose of having a different syntax for commands of classes 3 and 4 is to make Texinfo files easier to read, and also to help the GNU Emacs paragraph and filling commands work properly. There is only one exception to this rule: the command @refill, which is always used at the end of a paragraph immediately following the final period or other punctuation character. @refill takes no argument and does not require braces. @refill never confuses the Emacs paragraph commands because it cannot appear at the beginning of a line.

# How to Obtain TeX

TeX is freely redistributable. You can obtain TeX for Unix systems via anonymous ftp or on tape or CD-ROM. The core material consists of Karl Berry's Web2c TeX distribution.

On-line retrieval instructions are available from either:

ftp://ftp.tug.org/tex/unixtex.ftp
http://www.tug.org/unixtex.ftp


The Free Software Foundation provides a core distribution on its Source Code CD-ROM suitable for printing Texinfo manuals; the University of Washington maintains and supports a tape distribution; the TeX Users Group co-sponsors a complete CD-ROM TeX distribution.

Free Software Foundation, Inc.
59 Temple Place Suite 330
Boston, MA w{ } 02111-1307
USA

Telephone: +1--617--542--5942
Fax: (including Japan) +1--617--542--2652
Free Dial Fax (in Japan):
0031--13--2473 (KDD)
0066--3382--0158 (IDC)
Electronic mail: gnu@prep.ai.mit.edu


To order a full distribution on CD-ROM, please see:

http://www.tug.org/tex-live.html


(The distribution is also available by FTP; see the URL's above.)

To order a full distribution from the University of Washington on either a 1/4in 4-track QIC-24 cartridge or a 4mm DAT cartridge, send $210 to: Pierre A. MacKay Denny Hall, Mail Stop DH-10 University of Washington Seattle, WA 98195 USA Telephone: +1--206--543--2268 Electronic mail: mackay@cs.washington.edu  Please make checks payable to the University of Washington. Checks must be in U.S. dollars, drawn on a U.S. bank. Prepaid orders are the only orders that can now be handled. Overseas sites: please add to the base cost, if desired,$20.00 for shipment via air parcel post, or \$30.00 for shipment via courier.

Please check with the above for current prices and formats.

# Second Edition Features

The second edition of the Texinfo manual describes more than 20 new Texinfo mode commands and more than 50 previously undocumented Texinfo @-commands. This edition is more than twice the length of the first edition.

Here is a brief description of the new commands.

## New Texinfo Mode Commands

Texinfo mode provides commands and features especially designed for working with Texinfo files. More than 20 new commands have been added, including commands for automatically creating and updating both nodes and menus. This is a tedious task when done by hand.

The keybindings are intended to be somewhat mnemonic.

### Update all nodes and menus

The texinfo-master-menu command is the primary command:

C-c C-u m
Create or update a master menu. With C-u as a prefix argument, first create or update all nodes and regular menus.

### Update Pointers

Create or update Next', Previous', and Up' node pointers.

See section Updating Nodes and Menus.

C-c C-u C-n
M-x texinfo-update-node
Update a node.
C-c C-u C-e
M-x texinfo-every-node-update
Update every node in the buffer.

See section Updating Nodes and Menus.

C-c C-u C-m
C-c C-u C-a
Make or update all the menus in a buffer. With C-u as a prefix argument, first update all the nodes.

### Insert Title as Description

Insert a node's chapter or section title in the space for the description in a menu entry line; position point so you can edit the insert. (This command works somewhat differently than the other insertion commands, which insert only a predefined string.)

See section Inserting Frequently Used Commands.

C-c C-c C-d
Insert title.

### Format for Info

Provide keybindings both for the Info formatting commands that are written in Emacs Lisp and for makeinfo that is written in C.

See section Formatting for Info.

Use the Emacs lisp texinfo-format... commands:

C-c C-e C-r
Format the region.
C-c C-e C-b
Format the buffer.

Use makeinfo:

C-c C-m C-r
Format the region.
C-c C-m C-b
Format the buffer.
C-c C-m C-l
Recenter the makeinfo output buffer.
C-c C-m C-k
Kill the makeinfo formatting job.

### Typeset and Print

Typeset and print Texinfo documents from within Emacs.

See section Formatting and Printing.

C-c C-t C-b
Run texi2dvi on the buffer.
C-c C-t C-r
Run TeX on the region.
C-c C-t C-i
Run texindex.
C-c C-t C-p
Print the DVI file.
C-c C-t C-q
Show the print queue.
C-c C-t C-d
Delete a job from the print queue.
C-c C-t C-k
Kill the current TeX formatting job.
C-c C-t C-x
Quit a currently stopped TeX formatting job.
C-c C-t C-l
Recenter the output buffer.

### Other Updating Commands

The "other updating commands" do not have standard keybindings because they are used less frequently.

See section Other Updating Commands.

M-x texinfo-insert-node-lines
Insert missing @node lines using section titles as node names.
M-x texinfo-multiple-files-update
Update a multi-file document. With a numeric prefix, such as C-u 8, update every pointer and menu in all the files and then insert a master menu.
M-x texinfo-sequential-node-update
Insert node pointers in strict sequence.

## New Texinfo @-Commands

The second edition of the Texinfo manual describes more than 50 commands that were not described in the first edition. A third or so of these commands existed in Texinfo but were not documented in the manual; the others are new. Here is a listing, with brief descriptions of them:

### Indexing

Create your own index, and merge indices.

See section Creating Indices.

@defindex index-name
Define a new index and its indexing command. See also the @defcodeindex command.
@synindex from-index into-index
Merge the from-index index into the into-index index. See also the @syncodeindex command.

### Definitions

Describe functions, variables, macros, commands, user options, special forms, and other such artifacts in a uniform format.

See section Definition Commands.

@deffn category name arguments...
Format a description for functions, interactive commands, and similar entities.
@defvr, @defop, ...
15 other related commands.

### Glyphs

Indicate the results of evaluation, expansion, printed output, an error message, equivalence of expressions, and the location of point.

See section Glyphs for Examples.

@equiv{}
==
Equivalence:
@error{}
error-->
Error message
@expansion{}
==>
Macro expansion
@point{}
-!-
Position of point
@print{}
-|
Printed output
@result{}
=>
Result of an expression

Headings on or off, single, or double-sided.
@evenfooting [left] @| [center] @| [right]
Footings for even-numbered (left-hand) pages.
Five other related commands.
@thischapter
Insert name of chapter and chapter number.
@thischaptername, @thisfile, @thistitle, @thispage
Related commands.

### Formatting

Format blocks of text.

See section Quotations and Examples, and
section Making Lists and Tables.

@cartouche
Draw rounded box surrounding text (not in Info).
@enumerate optional-arg
Enumerate a list with letters or numbers.
@exdent line-of-text
Remove indentation.
@flushleft
Left justify.
@flushright
Right justify.
@format
Do not narrow nor change font.
@ftable formatting-command
@vtable formatting-command
Two-column table with indexing.
@lisp
For an example of Lisp code.
@smallexample
@smalllisp
Like @table and @lisp but for @smallbook.

### Conditionals

Conditionally format text.

@set flag [string]
Set a flag. Optionally, set value of flag to string.
@clear flag
Clear a flag.
@value{flag}
Replace with value to which flag is set.
@ifset flag
Format, if flag is set.
@ifclear flag
Ignore, if flag is set.

See section Chapter Structuring.

Related commands.

### Font commands

See section @sc{text}: The Small Caps Font, and
section Fonts for Printing, Not Info.

@r{text}
Print in roman font.
@sc{text}
Print in SMALL CAPS font.

### Miscellaneous

See section @title, @subtitle, and @author,
see section Customized Highlighting,
see section Overfull "hboxes",
see section Footnotes,
see section @dmn{dimension}: Format a Dimension,
see section @raisesections and @lowersections,
see section @math: Inserting Mathematical Expressions.
see section @minus{}: Inserting a Minus Sign,
see section Paragraph Indenting,
see section Different Cross Reference Commands,
see section @title, @subtitle, and @author, and

@author author
Typeset author's name.
@finalout
Produce cleaner printed output.
@footnotestyle end-or-separate
Specify footnote style.
@dmn{dimension}
Format a dimension.
@global@letnew-cmd=existing-cmd
Define a highlighting command for TeX. (TeX only.)
@lowersections
Reduce hierarchical level of sectioning commands.
@math{mathematical-expression}
Format a mathematical expression.
@minus{}
Generate a minus sign.
@paragraphindent asis-or-number
Specify paragraph indentation.
@raisesections
Raise hierarchical level of sectioning commands.
@ref{node-name, [entry], [topic-or-title], [info-file], [manual]}
Make a reference. In the printed manual, the reference does not start with the word see'.
@title title
Typeset title in the alternative title page format.
@subtitle subtitle
Typeset subtitle in the alternative title page format.
@today{}
Insert the current date.

# Command and Variable Index

This is an alphabetical list of all the @-commands, assorted Emacs Lisp functions, and several variables. To make the list easier to use, the commands are listed without their preceding @'.

Jump to: ! - " - ' - ( - * - , - - - . - : - = - ? - @ - ^ -  - a - b - c - d - e - f - g - h - i - k - l - m - n - o - p - q - r - s - t - u - v - w - x - { - } - ~

## !

• ! (end of sentence)

• "

• '

• (newline)
• (space)
• (tab)
• ## *

• * (force line break)

• ,

• -
• ## .

• . (end of sentence)
• ## :

• : (suppress widening)

• =
• ## ?

• ? (end of sentence)
• ## @

• @ (single @')

• ^

• 
• ## a

• AA
• aa
• AE
• ae
• afourpaper
• appendix
• appendixsec
• appendixsection
• appendixsubsec
• appendixsubsubsec
• apply
• author
• ## b

• b (bold font)
• buffer-end
• bullet
• bye, bye
• ## c

• c (comment)
• cartouche
• center
• centerchap
• chapter
• cindex
• cite
• clear
• code
• columnfractions
• comment
• contents
• cropmarks
• ## d

• defcodeindex
• defcv
• deffn
• deffnx
• defindex
• definfoenclose
• defivar
• defmac
• defmethod
• defop
• defopt
• defspec
• deftp
• deftypefn
• deftypefun
• deftypevar
• deftypevr
• defun
• defvar
• defvr
• dfn
• dircategory
• direntry
• display
• dmn
• dotaccent
• dotless
• dots
• ## e

• email
• emph
• end, end
• end titlepage
• enumerate
• evenfooting
• everyfooting
• example
• exclamdown
• exdent
• ## f

• file
• filll
• finalout
• findex
• flushleft
• flushright
• foobar, foobar, foobar
• footnote
• footnotestyle
• format
• forward-word
• ftable

• group

• H
• hyphenation
• ## i

• i (italic font)
• ifclear
• ifhtml
• ifinfo
• ifset
• iftex
• ignore
• include
• Info-validate
• inforef
• input (TeX command)
• isearch-backward
• isearch-forward
• item, item, item
• itemize
• itemx

• kbd
• key
• kindex
• ## l

• L
• l
• lisp
• lowersections
• ## m

• macro
• mag (TeX command)
• makeinfo-buffer
• makeinfo-kill-job
• makeinfo-recenter-output-buffer
• makeinfo-region
• math
• minus
• multitable

• need
• next-error
• noindent
• ## o

• O
• o
• occur
• occur-mode-goto-occurrence
• oddfooting
• OE
• oe
• ## p

• page
• paragraphindent
• pindex
• pounds
• printindex
• pxref

• questiondown
• quotation
• ## r

• r (Roman font)
• raisesections
• ref
• refill
• ringaccent
• ## s

• samp
• sc (small caps font)
• section
• set
• setchapternewpage
• setfilename
• settitle
• shortcontents
• shorttitlepage
• smallbook
• smallexample
• smalllisp
• sp (line spacing)
• sp (titlepage line spacing)
• ss
• strong
• subsection
• subsubsection
• subtitle
• summarycontents
• syncodeindex, syncodeindex
• synindex
• ## t

• t (typewriter font)
• table
• tex
• tex (command)
• texinfo-every-node-update
• texinfo-format-buffer, texinfo-format-buffer, texinfo-format-buffer
• texinfo-format-region, texinfo-format-region, texinfo-format-region
• texinfo-insert-@code
• texinfo-insert-@dfn
• texinfo-insert-@end
• texinfo-insert-@example
• texinfo-insert-@item
• texinfo-insert-@kbd
• texinfo-insert-@node
• texinfo-insert-@noindent
• texinfo-insert-@samp
• texinfo-insert-@table
• texinfo-insert-@var
• texinfo-insert-braces
• texinfo-insert-node-lines
• texinfo-multiple-files-update
• texinfo-multiple-files-update (in brief)
• texinfo-sequential-node-update
• texinfo-show-structure, texinfo-show-structure
• texinfo-tex-buffer
• texinfo-tex-print
• texinfo-tex-region
• texinfo-update-node
• thischapter
• thischaptername
• thisfile
• thispage
• thistitle
• tieaccent
• tindex
• title
• titlefont
• titlepage
• today
• top (@-command)
• ## u

• u
• ubaraccent
• udotaccent
• unmacro
• unnumbered
• unnumberedsec
• unnumberedsubsec
• unnumberedsubsubsec
• up-list
• url

• v
• value
• var
• vindex
• vskip
• vtable
• ## w

• w (prevent line break)

• xref
• ## {

• { (single {')
• ## }

• } (single }')

• ~
• # Concept Index

Jump to: . - @ - a - b - c - d - e - f - g - h - i - k - l - m - n - o - p - q - r - s - t - u - v - w - z

## .

• .cshrc initialization file
• .profile initialization file
• ## @

• @-command in nodename
• @-command list
• @-command syntax
• @-commands
• @AA{}
• @aa{}
• @AE{}
• @ae{}
• @dotless{i}
• @dotless{j}
• @exclamdown{}
• @include file sample
• @l{}
• @L{}
• @menu parts
• @node line writing
• @OE{}
• @oe{}
• @O{}
• @o{}
• @questiondown{}
• @ss{}
• ## a

• A4 paper, printing on
• Abbreviations for keys
• Accents, inserting
• Acute accent
• Adding a new info file
• Alphabetical @-command list
• Another Info directory
• Apostrophe in nodename
• Arguments, repeated and optional
• Automatic pointer creation with makeinfo
• ## b

• Backslash, and macros
• Batch formatting for Info
• Beginning a Texinfo file
• Beginning line of a Texinfo file
• Berry, Karl
• Black rectangle in hardcopy
• Blank lines
• Body of a macro
• Book characteristics, printed
• Book, printing small
• Box with rounded corners
• Braces and argument syntax
• Braces, inserting
• Braces, when to use
• Breaks in a line
• Breve accent
• Buffer formatting and printing
• Bullets, inserting
• ## c

• Case in nodename
• Catching errors with Info formatting
• Catching errors with TeX formatting
• Catching mistakes
• Cedilla accent
• Chapter structuring
• Characteristics, printed books or manuals
• Chassell, Robert J.
• Check accent
• Checking for badly referenced nodes
• Circumflex accent
• Colon in nodename
• Column widths, defining for multitables
• Combining indices
• Comma in nodename
• Command definitions
• Commands to insert special characters
• Commands using ordinary TeX
• Commands, inserting them
• Compile command for formatting
• Conditionally visible text
• Conditions for copying Texinfo
• Contents, Table of
• Contents-like outline of file structure
• Conventions for writing definitions
• Conventions, syntactic
• Copying conditions
• Copying permissions
• Copying software
• Correcting mistakes
• Creating an Info file
• Creating an unsplit file
• Creating index entries
• Creating indices
• Creating pointers with makeinfo
• Cropmarks for printing
• Cross reference parts
• Cross references
• Cross references using @inforef
• Cross references using @pxref
• Cross references using @ref
• Cross references using @xref
• Customized highlighting
• ## d

• Debugging the Texinfo structure
• Debugging with Info formatting
• Debugging with TeX formatting
• Defining indexing entries
• Defining macros
• Defining new indices
• Defining new Texinfo commands
• Definition commands
• Definition conventions
• Definition template
• Definitions grouped together
• Different cross reference commands
• Dimension formatting
• dir' directory for Info installation
• dir' file listing
• Display formatting
• Distribution
• Dot accent
• Dotless i, j
• Dots, inserting, Dots, inserting
• DVI file
• ## e

• Ellipsis, inserting
• Emacs
• Emacs shell, format, print from
• Emphasizing text
• Emphasizing text, font for
• enable
• Enclosure command for Info
• End' node footnote style
• Ending a Sentence
• Ending a Texinfo file
• Entries for an index
• Entries, making index
• Enumeration
• Equivalence, indicating it
• Error message, indicating it
• Errors, parsing
• Es-zet
• European A4 paper
• Evaluation glyph
• Example for a small book
• Examples, formatting them
• Expansion, indicating it
• ## f

• File beginning
• File ending
• File section structure, showing it
• Filling paragraphs
• Final output
• Fine-tuning, and hyphenation
• First line of a Texinfo file
• First node
• Floating accents, inserting
• Fonts for indices
• Fonts for printing, not for Info
• Footings
• Footnotes
• Format a dimension
• Format and print hardcopy
• Format and print in Texinfo mode
• Format with the compile command
• Format, print from Emacs shell
• Formatting a file for Info
• Formatting commands
• Formatting examples
• Formatting for Info
• Formatting for printing
• Formatting requirements
• Formatting with tex and texindex
• Frequently used commands, inserting
• fubar
• Function definitions
• ## g

• General syntactic conventions
• German S
• Glyphs
• GNU Emacs
• GNU Emacs shell, format, print from
• Going to other Info files' nodes
• Grave accent
• Group (hold text together vertically)
• Grouping two definitions together
• ## h

• Hardcopy, printing it
• hboxes', overfull
• Header of a Texinfo file
• Headings, page, begin to appear
• Highlighting text
• Highlighting, customized
• Hints
• Holding text together vertically
• Hungariam umlaut accent
• Hyphenation, helping TeX do
• Hyphenation, preventing
• ## i

• If text conditionally visible
• ifinfo' permissions
• Ignored text
• Include file requirements
• Include file sample
• Include files
• Indentation undoing
• Indenting paragraphs
• Index entries
• Index entries, making
• Index entry writing
• Index font types
• Indexing commands, predefined
• Indexing table entries automatically
• Indicating commands, definitions, etc.
• Indicating evaluation
• Indices
• Indices, combining them
• Indices, defining new
• Indices, sorting
• Indices, two letter names
• Indirect subfiles
• Info batch formatting
• Info file installation
• Info file requires @setfilename
• Info file, listing new one
• Info file, splitting manually
• Info files
• Info formatting
• Info installed in another directory
• Info validating a large file
• Info, creating an on-line file
• Info-directory-list
• Info; other files' nodes
• INFOPATH
• Initialization file for TeX input
• Inserting @, braces
• Inserting accents
• Inserting dots, Inserting dots
• Inserting ellipsis
• Inserting frequently used commands
• Inserting space
• Inserting special characters and symbols
• install-info
• Installing an Info file
• Installing Info in another directory
• Introduction, as part of file
• Invoking macros
• Itemization
• ## k

• Keys, recommended names
• Knuth, Donald
• ## l

• Larger or smaller pages
• Line breaks
• Line breaks, preventing
• Line length, column widths as fraction of
• Line spacing
• Lisp example
• Lisp example for a small book
• List of @-commands
• Listing a new info file
• Lists and tables, making them
• Local variables
• Looking for badly referenced nodes
• lpr (DVI print command)
• ## m

• Macro definitions, Macro definitions
• Macro invocation
• Macron accent
• Macros
• Macros, undefining
• Magnified printing
• makeinfo inside Emacs
• makeinfo options
• Making a printed manual
• Making a tag table automatically
• Making a tag table manually
• Making cross references
• Making line and page breaks
• Making lists and tables
• Manual characteristics, printed
• Marking text within a paragraph
• Marking words and phrases
• Mathematical expressions, Mathematical expressions
• Menu entries with two colons
• META key
• Meta-syntactic chars for arguments
• Minimal Texinfo file (requirements)
• Mistakes, catching
• Mode, using Texinfo
• Multiple spaces
• Multitable column widths
• Multitable rows
• Must have in Texinfo file
• Mutually recursive macros
• ## n

• Names for indices
• Names recommended for keys
• Naming a Top' Node in references
• Need space at page bottom
• New index defining
• New info file, listing it in dir' file
• New Texinfo commands, defining
• Node line requirements
• Node line writing
• Node, Top'
• Node, defined
• Nodename must be unique
• Nodename, cannot contain
• Nodes for menus are short
• Nodes in other Info files
• Nodes, catching mistakes
• Nodes, checking for badly referenced
• Not ending a sentence
• ## o

• Obtaining TeX
• Occurrences, listing with @occur
• Optional and repeated arguments
• Options for makeinfo
• Ordinary TeX commands, using
• Other Info files' nodes
• Outline of file structure, showing it
• Overfull hboxes'
• Overview of Texinfo
• ## p

• Page breaks
• Page delimiter in Texinfo mode
• Page numbering
• Page sizes for books
• page-delimiter
• Pages, starting odd
• Paper size, European A4
• Paragraph indentation
• Paragraph, marking text within
• Parsing errors
• Part of file formatting and printing
• Parts of a cross reference
• Parts of a master menu
• Periods, inserting
• Permissions
• Permissions, printed
• Pinard, Fran@,{c}ois
• plain TeX
• Point, indicating it in a buffer
• Pointer creation with makeinfo
• Pointer validation with makeinfo
• Predefined indexing commands
• Predefined names for indices
• Preparing to use TeX
• Preventing line and page breaks
• Print and format in Texinfo mode
• Print, format from Emacs shell
• Printed book and manual characteristics
• Printed output, indicating it
• Printed permissions
• Printing a region or buffer
• Printing an index
• Printing cropmarks
• Problems, catching
• Prototype row, column widths defined by

• Quotations
• ## r

• Raising and lowering sections
• Recommended names for keys
• Rectangle, ugly, black in hardcopy
• Recursion, mutual
• References
• References using @inforef
• References using @pxref
• References using @ref
• References using @xref
• Referring to other Info files
• Refilling paragraphs
• Region formatting and printing
• Region printing in Texinfo mode
• Repeated and optional arguments
• Required in Texinfo file
• Requirements for formatting
• Requirements for include files
• Requirements for updating commands
• Result of an expression
• Ring accent
• Rows, of a multitable
• Running an Info formatter
• Running Info-validate
• Running makeinfo in Emacs
• ## s

• Sample @include file
• Sample function definition
• Sample Texinfo file
• Sample Texinfo file, no comments
• Section structure of a file, showing it
• Sections, raising and lowering
• Sentence ending punctuation
• Sentence non-ending punctuation
• Separate' footnote style
• Sharp S
• Shell formatting with tex and texindex
• Shell, format, print from
• Shell, running makeinfo in
• Showing the section structure of a file
• Showing the structure of a file
• Size of printed book
• Small book example
• Small book size
• Small caps font
• Software copying permissions
• Sorting indices
• Spaces (blank lines)
• Spacing, inserting
• Special characters, commands to insert
• Special insertions
• Special typesetting commands
• Specifying index entries
• Splitting an Info file manually
• Stallman, Richard M.
• Starting chapters
• Structure of a file, showing it
• Structure, catching mistakes in
• Structuring of chapters
• Subsection-like commands
• Subsub commands
• Syntactic conventions
• Syntax, optional & repeated arguments
• ## t

• tab
• Tables and lists, making them
• Tables with indexes
• Tables, making multi-column
• Tables, making two-column
• Tabs; don't use!
• Tag table, making automatically
• Tag table, making manually
• Template for a definition
• TeX commands, using ordinary
• TeX index sorting
• TeX input initialization
• TeX, how to obtain
• texi2dvi (shell script)
• texindex, texindex
• Texinfo commands, defining new
• Texinfo file beginning
• Texinfo file ending
• Texinfo file minimum
• Texinfo file section structure, showing it
• Texinfo mode
• Texinfo overview
• Texinfo printed book characteristics
• TEXINPUTS
• TEXINPUTS environment variable
• Text, conditionally visible
• Thin space between number, dimension
• Tie-after accent
• Tilde accent
• Tips
• Title page
• Titlepage permissions
• Top' node
• Top' node is first
• Top' node naming for references
• Top' node summary
• Tree structuring
• Two First' Lines for @deffn
• Two letter names for indices
• Two named items for @table
• Typesetting commands for dots, etc.
• ## u

• Umlaut accent
• Undefining macros
• Underbar accent
• Underdot accent
• Unique nodename requirement
• Unprocessed text
• Unsplit file creation
• Updating requirements
• Usage tips
• User-defined Texinfo commands
• ## v

• Validating a large file
• Validation of pointers
• Value of an expression, indicating
• version number, finding
• Vertical whitespace (vskip')
• Vertically holding text together
• Visibility of conditional text
• ## w

• Weisshaus, Melissa
• Whitespace, inserting, Whitespace, inserting
• Widths, defining multitable column
• Words and phrases, marking them
• Writing an @node line
• Writing index entries
• ## z

• Zuhn, David D.

• # Footnotes

### (1)

Note that the first syllable of "Texinfo" is pronounced like "speck", not "hex". This odd pronunciation is derived from, but is not the same as, the pronunciation of TeX. In the word TeX, the X' is actually the Greek letter "chi" rather than the English letter "ex". Pronounce TeX as if the X' were the last sound in the name Bach'; but pronounce Texinfo as if the x' were a k'. Spell "Texinfo" with a capital "T" and write the other letters in lower case.

### (2)

In some documents, the first child has no Previous' pointer. Occasionally, the last child has the node name of the next following higher level node as its Next' pointer.

### (3)

You can also use the texi2roff program if you do not have TeX; since Texinfo is designed for use with TeX, texi2roff is not described here. texi2roff is part of the standard GNU distribution.

### (4)

The word argument comes from the way it is used in mathematics and does not refer to a disputation between two people; it refers to the information presented to the command. According to the Oxford English Dictionary, the word derives from the Latin for to make clear, prove; thus it came to mean the evidence offered as proof', which is to say, the information offered', which led to its mathematical meaning. In its other thread of derivation, the word came to mean to assert in a manner against which others may make counter assertions', which led to the meaning of argument' as a disputation.

### (5)

We have found that it is helpful to refer to versions of manuals as editions' and versions of programs as versions'; otherwise, we find we are liable to confuse each other in conversation by referring to both the documentation and the software with the same words.

### (6)

Menus can carry you to any node, regardless of the hierarchical structure; even to nodes in a different Info file. However, the GNU Emacs Texinfo mode updating commands work only to create menus of subordinate nodes. Conventionally, cross references are used to refer to other nodes.

### (7)

Currently, @definfoenclose works only with texinfo-format-buffer and texinfo-format-region, not with makeinfo.

### (8)

It would be straightforward to extend Texinfo to work in a similar fashion for C, FORTRAN, or other languages.

### (9)

A footnote should complement or expand upon the primary text, but a reader should not need to read a footnote to understand the primary text. For a thorough discussion of footnotes, see The Chicago Manual of Style, which is published by the University of Chicago Press.

### (10)

Here is the sample footnote.

### (11)

If you use more than one index and have cross references to an index other than the first, you must run tex three times to get correct output: once to generate raw index data; again (after texindex) to output the text of the indices and determine their true page numbers; and a third time to output correct page numbers in cross references to them. However, cross references to indices are rare.

### (12)

--' has replaced +', the old introductory character, to maintain POSIX.2 compatibility without losing long-named options.

### (13)

Perhaps the command should have been called the @refillandindent command, but @refill is shorter and the name was chosen before indenting was possible.

This document was generated on 7 November 1998 using the texi2html translator version 1.52.