\documentstyle[11pt,latexinfo,elisp,format]{book} % -*-latexinfo-*- \pagestyle{empty} \setcounter{tocdepth}{1} % clisp.sty commands we'll need later. \def\empty{\t{()}} \def\false{\t{nil}} \def\true{\t{t}} \def\nil{\t{nil}} \def\FALSE{\t{nil}} \def\TRUE{\t{t}} \def\NIL{\t{nil}} \def\dlbrack{\lbrack\mskip-\thinmuskip\lbrack\mskip\thinmuskip} \def\drbrack{\mskip\thinmuskip\rbrack\mskip-\thinmuskip\rbrack} \def\mopt#1{{$\,\lbrack$}{\it #1\/}{$\rbrack\,$}}% \def\mchoice#1{{$\,\dlbrack$}{\it #1\/}{$\drbrack\,$}}% \def\mstar#1{{$\,\lbrace$}{\it #1\/}{$\rbrace^*\,$}}% \def\mplus#1{{$\,\lbrace$}{\it #1\/}{$\rbrace^+\,$}}% \def\mgroup#1{{$\,\lbrace$}{\it #1\/}{$\rbrace\,$}}% \def\mor{{$|$}}% \def\mind#1{$\downarrow${\it #1\/}}% %% FUNCTIONS {\catcode`&=11 \def\&optional{\t{\& optional}} \def\&rest{\t{\& rest}} \def\&key{\t{\& key}} } \begin{document} \bibliographystyle{alpha} \newindex{cp} \newindex{fn} \sloppy \finalout \setfilename{latexinfo2.info} \node Top, Copying, (dir), (dir) \title{The \LaTeX info Documentation Format\\ \n{Version \latexinfoversion}} \author{Richard M. Stallman and Robert J. Chassell\\ The Free Software Foundation,\\ 675 Massachusetts Ave., Cambridge MA,\\ \and Michael Clarkson\\ Centre for Earth and Space Science,\\ York University,\\ North York, Ontario, M3J 1P3} \date{\today} \maketitle \clearpage \vspace*{0pt plus 1filll} \noindent Copyright \copyright\ 1988, 1990, 1991 Free Software Foundation, Inc.\\ Copyleft \copyright{} 1988, 1989, 1990, 1991 Michael E. Clarkson. \sp{2} This is version \latexinfoversion\ of the \LaTeX info documentation, and is for Version 18 of GNU Emacs. This is the second edition of the \LaTeX info documentation, and is also consistent with version 2 of Texinfo documentation \file{texinfo.tex}. \sp{2} 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 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 Foundation. \clearpage \pagestyle{headings} \footnotestyle{separate} \pagenumbering{roman} \tableofcontents \clearpage \listoftables \clearpage \pagenumbering{arabic} \begin{menu} * Copying:: \LaTeX info Copying Conditions * Overview:: Overview of \LaTeX info * Beginning a File:: Beginning a \LaTeX info File * Structuring:: Chapter Structuring * Marking Text:: Marking Words and Phrases * Displaying Material:: * Lists and Tables:: Making Lists Tables and Descriptions * Formatting Paragraphs:: * Citations and Footnotes:: * Input and Include Files:: * Definition Commands:: Definition Commands: \code{\back deffn}, etc. * Nodes and Menus:: * Cross References:: Making Cross References * Creating Indices:: * Creating and Installing an Info File:: * LaTeXinfo Mode:: Using \LaTeX info Mode * Printing Hardcopy:: * Catching Formatting Mistakes:: * Extending LaTeXinfo:: * Installing LaTeXinfo:: * Converting Files to LaTeXinfo:: * Obtaining TeX:: Obtaining \LaTeX{} * Command List:: * Command Index:: * Concept Index:: Concept Index --- The Detailed Node Listing --- Overview of LaTeXinfo * Using Latexinfo:: Create an normal printed book or an Info file. * Advantages of LaTeXinfo over TeXinfo:: * Info Files:: What is an Info file? * Printed Manuals:: Characteristics of a printed manual * Formatting Commands:: \back -commands are used for formatting. * A Short Sample LaTeXinfo File:: Beginning a LaTeXinfo File * Conventions:: General Syntactic Conventions * Minimum:: What a LaTeXinfo File Must Have * Six Parts:: Six Parts of a LaTeXinfo File * The LaTeXinfo File Header:: * The Title and Copyright Pages:: * Generating a Table of Contents:: * The Top Node:: Creating the top node and master menu. * Software Copying Conditions:: * Ending a File:: Ending a LaTeXinfo File General Syntactic Conventions * Comments:: The LaTeXinfo File Header * The Documentstyle:: * setfilename:: \protect\code{\protect\back setfilename} * New Indexes:: * Custom Headings:: Customizing Your Layout Customizing Your Layout * paragraphindent:: Paragraph Indenting The Title and Copyright Pages * Titlepage:: * The Copyright Page and Printed Permissions:: The Top Node and Master Menu * Title of Top Node:: A Top node needs a title. * Master Menu Parts:: A master menu has three or more parts. Software Copying Conditions * Sample Permissions:: * Titlepage Permissions:: Titlepage Copying Permissions Sample Permissions * Inserting Permissions:: How to put permissions in your document. * ifinfo Permissions:: Sample \samp{ifinfo} copying permissions. * Titlepage Permissions:: Sample Titlepage copying permissions. Ending a LaTeXinfo File * Making a Bibliography:: * Printing an Index and Generating Menus:: Printing an index and generating index menus. * File End:: Ending a file with \code{\back end\{document\}}. Chapter Structuring * Tree Structuring:: A manual is like an upside down tree \dots{} * Structuring Command Types:: How to divide a manual into parts. * Chapter:: * Appendix:: * Section:: * Subsection:: * Subsubsection:: Commands for the lowest level sections. Types of Structuring Command * Chapter:: * Appendix:: * Section:: * Subsection:: * Subsubsection:: * Node:: * Menu Environment:: Marking Words and Phrases * Indicating:: Indicating Definitions, Commands, etc. * Emphasis:: Emphasizing Text * Insertions:: Special Insertions Indicating Definitions, Commands, etc. * code:: How to indicate code. * kbd:: How to show keyboard input. * key:: How to specify keys. * Ctrl:: * samp:: How to show a literal sequence of characters. * var:: How to indicate a metasyntactic variable. * file:: How to indicate the name of a file. * dfn:: How to specify a definition. Emphasizing Text * emph & strong:: How to emphasize text in LaTeXinfo. * Smallcaps:: How to use the small caps font. * Fonts:: Various font commands for printed output. Special Insertions * Braces Atsigns Periods:: How to insert braces, \samp{\back } and periods. * dmn:: How to format a dimension. * Dots Bullets:: How to insert dots and bullets. * LaTeX and copyright:: How to insert the \LaTeX{} logo and the copyright symbol. * minus:: How to insert a minus sign. * Inserting Characters Verbatim:: Inserting \protect\code{\protect\back }, Braces, and Periods * Inserting An Atsign:: * Inserting Braces:: Inserting \samp{\{} and \samp{\}}---\back \{ and \back \} * Controlling Spacing:: Inserting Ellipsis, Dots, and Bullets * dots:: Inserting dots \dots{} * bullet:: Inserting a bullet. Inserting \protect\LaTeX{} and the Copyright Symbol * LaTeX:: Insert the \LaTeX{} logo. * copyright symbol:: \code{\back copyright}\{\} Displaying Material * Quotations:: * Justifying Text:: * Display Environments:: * Examples and Verbatim:: * Controlling Indentation:: * cartouche:: Drawing Cartouches Around Examples * Special Glyphs:: Special Glyphs for Examples * Conditionals:: Conditionally Visible Text Quotations * quotation:: \protect\code{\protect\back begin\protect\{quote\protect\}} Justifying Text * flushleft & flushright:: Left Justification and Right Justification Left Justification and Right Justification * Center Environment:: Display Environments * display:: \protect\code{\protect\back begin\protect\{display\protect\}} * format:: \protect\code{\protect\back begin\protect\{format\protect\}} Examples and Verbatim * example:: \protect\code{\protect\back begin\protect\{example\protect\}} * noindent:: \protect\code{\protect\back noindent} * Lisp Example:: \protect\code{\protect\back begin\protect\{lisp\protect\}} * Verbatim Environment:: Controlling Indentation * exdent:: \protect\code{\protect\back exdent}: Undoing a Line's Indentation Special Glyphs for Examples * result:: How to show the result of expression. * expansion:: How to indicate an expansion. * Print Special Glyph:: How to indicate printed output. * Error Special Glyph:: How to indicate an error message. * Equivalence:: How to indicate equivalence. * Point Special Glyph:: How to indicate the location of point. Conditionally Visible Text * Conditional Commands:: Specifying text for Info or \LaTeX. * Using Ordinary LaTeX Commands:: Making Lists Tables and Descriptions * Introducing Lists:: Formatting is done for you. * Itemize Environment:: * enumerate:: How to construct a numbered list. * Description Environment:: * Tabular Environment:: * Figures and Tables:: Formatting Paragraphs * Breaks:: Making and Preventing Breaks * Break Commands:: The Line Breaking Commands * Page Breaking Commands:: The Page Breaking Commands * Refilling Paragraphs:: * Always Refilling Paragraphs:: Making and Preventing Breaks * Break Commands:: Introducing the break commands. * Line Breaks:: How to force lines breaks. * w:: How to prevent unwanted line breaks. * sp:: How to insert blank lines. * clearpage:: How to force the start of a new page. * same:: How to prevent unwanted page breaks. * need:: Another way to prevent unwanted page breaks. The Line Breaking Commands * Line Breaks:: \protect\code{\protect\back *}: Generate Line Breaks * w:: \protect\code{\protect\back w}\protect\{\protect\var{text}\protect\}: Prevent Line Breaks * sp:: \protect\code{\protect\back sp} \protect\var{n}: Insert Blank Lines The Page Breaking Commands * page:: Start a New Page * group:: Putting things on the Same Page * need:: Prevent Page Breaks Citations and Footnotes * Footnotes:: * Citations:: Input and Include Files * Input Files:: * Include Files:: Include Files * Using Include Files:: How to use the \code{\back include} command. * Sample Include File:: A sample outer file with included files within it; and a sample included file. Definition Commands * Untyped Languages Definition Commands:: * C Functions:: * Abstract Objects:: Object-Oriented Programming * Sample Function Definition:: A Sample Function Definition Untyped Languages Definition Commands * Def Cmd Template:: How to structure a description using a definition command. * Optional Parameters:: How to handle optional and repeated parameters. * Def Cmds in Detail:: All the definition commands. * Functions Commands:: Functions and Similar Entities * Variables Commands:: Variables and Similar Entities The Definition Commands * Functions Commands:: Commands for functions. * Variables Commands:: Commands for variables. * Typed Functions:: Commands for functions in typed languages. * Typed Variables:: Commands for variables in typed languages. * Abstract Objects:: Commands for object-oriented programming. * Data Types:: The definition command for data types. C Functions * Typed Functions:: Functions in Typed Languages * Typed Variables:: Variables in Typed Languages Object-Oriented Programming * Data Types:: Nodes and Menus * Node Menu Illustration:: A diagram and sample nodes and menus. * node:: The \code{\back node} command in detail. * Node Names:: Choosing Node and Pointer Names * Menu Environment:: * Other Info Files:: Referring to nodes in other Info files. \protect\code{\protect\back node} * Node Names:: Choosing node and pointer names. * Writing a Node:: How to write a node line. Choosing Node and Pointer Names * Writing a Node:: Writing a Node Line Menu Environment * Menu Location:: Put a menu in a short node. * Menu Item:: How to write a menu item. * Menu Example:: A menu example. Making Cross References * References:: What cross references are for. * Cross Reference Commands:: A summary of the different commands. * Cross Reference Parts:: A cross reference has several parts. * xref:: Begin a reference with `See' \dots{} * Top Node Naming:: Naming a `Top' Node * ref:: A reference for the last part of a sentence. * pxref:: How to write a parenthetical cross reference. * inforef:: How to refer to an Info-only file. \protect\code{\protect\back xref} * Reference Syntax:: What a reference looks like and requires. * One Argument:: \code{\back xref} with one argument. * Two Arguments:: \code{\back xref} with two arguments. * Three Arguments:: \code{\back xref} with three arguments. * Four and Five Arguments:: \code{\back xref} with Four and Five Arguments Creating Indices * Index Entries:: Choose different words for index entries. * Indexing Commands:: How to make an index entry. * Combining Indices:: How to combine indices. Defining the Entries of an Index * Declaring indices:: Declaring Indices * Special Index Entries:: Declaring Indices * Special Index Entries:: Creating and Installing an Info File * Creating an Info file:: * Installing an Info File:: Creating an Info file * latexinfo-format commands:: The \protect\code{latexinfo-format\protect\dots{}} Commands * Tag and Split Files:: Tag Files and Split Files Tag Files and Split Files * Installing an Info file:: * Extending LaTeXinfo:: Installing an Info File * Directory file:: The top level menu for all Info files. * New Info File:: Listing a new info file. * Other Info Directories:: How to specify Info files that are located in other directories. Using LaTeXinfo Mode * Emacs Editing:: \LaTeX info mode adds to the usual editing commands. * Inserting:: How to insert frequently used commands. * Showing the Structure:: How to show the structure of a file. * Updating Nodes and Menus:: How to update or create new nodes and menus. * Info Formatting:: Formatting for Info. * Printing:: How to format and print part or all of a file. * LaTeXinfo Mode Summary:: Summary of all the \LaTeX info mode commands. Updating Nodes and Menus * Updating Commands:: Five major updating commands. * Updating Requirements:: How to structure a \LaTeX info file for using the updating command. * Other Updating Commands:: Indenting descriptions, inserting missing nodes lines, and updating nodes in sequence. * latexinfo-multiple-files-update:: \protect\code{latexinfo-multiple-files-update} Printing Hardcopy * How to Print:: How to print a hardcopy manual with shell commands. * Printing from Emacs:: How to print from an Emacs shell. * LaTeXinfo Mode Printing:: How to format and print in \LaTeX info mode. * Compile-Command:: How to print using Emacs's compile command. * Preparing for LaTeX:: Preparing for Use of \LaTeX{} * Overfull Hboxes:: What are and what to do with overfull hboxes. Catching Formatting Mistakes * Debugging with Info:: How to catch errors with Info formatting. * Debugging with LaTeX:: How to catch errors with \LaTeX{} formatting. * Using latexinfo-show-structure:: How to use \code{latexinfo-show-structure}. * Using occur:: How to list all lines containing a pattern. * Running Info-Validate:: How to find badly referenced nodes. Finding Badly Referenced Nodes * Using Info-validate:: How to run \code{Info-validate}. * Unsplit:: How to create an unsplit file. * Tagifying:: How to tagify a file. * Splitting:: How to split a file manually. Extending LaTeXinfo * Optional Style Files:: * LaTeXinfo support for European languages:: * Writing Your Own Style Files:: Optional Style Files * The fvpindex Style:: * Clisp Style:: Commands to be used by the end users * Obsolete Commands:: * Lower Level Commands and Features:: Installing LaTeXinfo * Compiling LaTeXinfo:: * Installing the LaTeXinfo Distribution:: Installing the LaTeXinfo Distribution * Installing the Style Files:: Converting Files to LaTeXinfo * Converting LaTeX Files to LaTeXinfo:: * Converting TeXinfo Files into LaTeXinfo Files:: * Converting Scribe Files to LaTeXinfo:: Converting LaTeX Files to LaTeXinfo * l2latexinfo.el:: Converting TeXinfo Files into LaTeXinfo Files * Differences from TeXinfo:: \end{menu} \node Copying, Overview, , Top \chapter*{LaTeXinfo Copying Conditions} \markboth{LaTeXinfo Copying Conditions}{LaTeXinfo Copying Conditions} \cindex{Copying conditions} \cindex{Conditions for copying LaTeXinfo} The programs currently being distributed that relate to \LaTeX info include portions of GNU Emacs, plus other separate programs (including \code{latexinfo.sty}, \code{latexindex}, and \code{info}). These programs are \dfn{free}; this means that everyone is free to use them and free to redistribute them on a free basis. The Latexinfo-related programs are not in the public domain; they are copyrighted and there are restrictions on their distribution, but these restrictions are designed to permit everything that a good cooperating citizen would want to do. What is not allowed is to try to prevent others from further sharing any version of these programs that they might get from you.\refill Specifically, we want to make sure that you have the right to give away copies of the programs that relate to \LaTeX info, that you receive source code or else can get it if you want it, that you can change these programs or use pieces of them in new free programs, and that you know you can do these things.\refill To make sure that everyone has such rights, we have to forbid you to deprive anyone else of these rights. For example, if you distribute copies of the \LaTeX info related programs, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights.\refill Also, for our own protection, we must make certain that everyone finds out that there is no warranty for the programs that relate to LaTeXinfo. If these programs are modified by someone else and passed on, we want their recipients to know that what they have is not what we distributed, so that any problems introduced by others will not reflect on our reputation.\refill The precise conditions of the licenses for the programs currently being distributed that relate to \LaTeX info are found in the General Public Licenses that accompany them.\refill \node Overview, Using Latexinfo, Copying, Top \chapter{Overview of LaTeXinfo} \cindex{Overview of LaTeXinfo} \cindex{LaTeXinfo overview} \LaTeX info\footnote{Note that the first syllable of ``texinfo'' is pronounced like ``speck'', not ``hex''. This odd pronunciation is derived from \LaTeX, in which the \samp{X} is actually the Greek letter ``chi'' rather than the English letter ``ex'' (the \samp{T} and \samp{E} are Greek letters also, but they happen to be pronounced the same way in Greek as in English).} is a documentation system that uses a single source file to produce both on-line help (and other information) and a printed manual. This means that instead of writing two different documents, one providing on-line information and the other for a printed manual, you need write only one document. When the system is revised, you need revise only one document. You can print the manual with most laser printers, and you can read the on-line help, known as an \dfn{Info file}, with the Info documentation-reading programs. These documentation-reading programs are available for use under GNU Emacs, under X-windows, or for \code{termcap} based ordinary terminals.\refill \begin{menu} * Using Latexinfo:: Create an normal printed book or an Info file. * Advantages of LaTeXinfo over TeXinfo:: * Info Files:: What is an Info file? * Printed Manuals:: Characteristics of a printed manual * Formatting Commands:: \back -commands are used for formatting. * A Short Sample LaTeXinfo File:: \end{menu} \begin{ifinfo} \node Using Latexinfo, Advantages of LaTeXinfo over TeXinfo, Overview, Overview \section{Using Latexinfo} \end{ifinfo} Using \LaTeX info, you can create a printed document with the normal features of a book, including chapters, sections, cross references, and indices. From the same \LaTeX info source file, you can create a menu-driven, on-line Info file with nodes, menus, cross references, and indices. You can, if you wish, make the chapters and sections of the printed document correspond to the nodes of the on-line information, and use the same cross references and indices for both the Info file and the printed document.\refill To make a printed manual, process a \LaTeX info source file with the \LaTeX{} typesetting program. This creates a \scap{dvi} file that you can typeset and print as a book. To create an Info file, you process a \LaTeX info source file with Emacs's \code{latexinfo-format-buffer} command; this creates an Info file that you can install on-line.\refill Info works with almost every type of computer terminal; similarly, \LaTeX{} works with many types of printer. This power makes \LaTeX info a general purpose system, but brings with it a constraint, which is that a \LaTeX info file may contain only the customary ``typewriter'' characters (letters, numbers, spaces, and punctuation marks) but no special graphics.\refill A \LaTeX info file is a plain \scap{ascii} file containing text and \dfn{\back -commands} (words preceded by an \samp{\back }) that tell the typesetting and formatting programs what to do. You may edit a \LaTeX info file with any text editor; but it is especially convenient to use GNU Emacs since that editor has a special mode, called \LaTeX info mode, that provides various \LaTeX info-related features. (\xref{LaTeXinfo Mode}.)\refill Before writing a \LaTeX info source file, you should become familiar with the Info documentation reading program and learn about nodes, menus, cross references, and the rest. On Unix systems, these programs are called \code{info} for terminals, and \code{xinfo} for systems with X-Windows. (\inforef{Top, info, info}, for more information.)\refill \LaTeX info creates both on-line help and a printed manual; moreover, it is freely redistributable. \node Advantages of LaTeXinfo over TeXinfo, Info Files, Using Latexinfo, Overview \section{Advantages of LaTeXinfo over TeXinfo} \cindex{Advantages of LaTeXinfo over TeXinfo} Documentation for GNU utilities and libraries is usually written in a format called \dfn{\TeX info}. This document describes an enhancement of this format which can be used with \LaTeX\ instead of \TeX. \LaTeX info offers a number of advantages over \TeX info: \begin{enumerate} \item The point size or layout style of a document can be changed easily, using the \code{documentstyle} (\t{article, report, book, twoside, \dots}). \item \LaTeX\ has better error checking than \TeX\ files, especially in begin/end environments. In addition, the \LaTeX\ error messages are more informative. This makes it considerably easier to make extensions and enhancements (read \i{hacks}). \item \LaTeX\ delimits its arguments with braces, so it's easier to tell where a \LaTeX info command starts, and where it ends. TeXinfo has to stand on its head to avoid using TeX's braces. \item Any \LaTeX\ commands not understood by the on-line manual generator\\ (\file{latexinfo.el}) are simply ignored. This means that you are free to add a considerable number of \LaTeX\ commands to make you manual look pretty, as long as you don't care that there will be no action taken by the Info formatting program. \item It is easy to add your own extensions to the on-line manual generator by making GNU Emacs handlers for your \LaTeX\ extensions. This is the Emacs counterpart to the \code{documentstyle} options. \LaTeX info looks in a specified directory for GNU Elisp code that corresponds to each style file. This makes it easy to modularize your style files. \item \LaTeX\ has many advantages over \TeX, such as being able to easily incorporate the Bib\TeX\ bibliography formatting program. \end{enumerate} \clearpage \node Info Files, Printed Manuals, Advantages of LaTeXinfo over TeXinfo, Overview \section{Info files} \cindex{Info files} A \LaTeX info file can be transformed into a printed manual and an on-line Info file. An on-line Info file is a file formatted so that the Info documentation reading program can operate on it. Info files are divided into pieces called \dfn{nodes}, each of which contains the discussion of one topic. Each node has a name, and contains both text for the user to read and pointers to other nodes, which are identified by their names. The Info program displays one node at a time, and provides commands with which the user can move to the other related nodes. \inforef{Top, info, info}, for more information about using Info.\refill Each node of an Info file may have any number of child nodes that describe subtopics of the node's topic. The names of these child nodes, if any, are listed in a \dfn{menu} within the parent node; this allows you to use certain Info commands to move to one of the child nodes. Generally, a \LaTeX info file is organized like a book. If a node is at the logical level of a chapter, its child nodes are at the level of sections; likewise, the child nodes of sections are at the level of subsections.\refill All the children of any one parent are linked together in a bidirectional chain of `Next' and `Previous' pointers. This means that all the nodes that are at the level of sections within a chapter are linked together. Normally the order in this chain is the same as the order of the children in the parent's menu. Each child node records the parent node name, as its `Up' pointer. The last child has no `Next' pointer, and the first child has the parent both as its `Previous' and as its `Up' pointer.\footnote{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.}\refill The book-like structuring of an Info file into nodes that correspond to chapters, sections, and the like is a matter of convention, not a requirement. The `Up', `Previous', and `Next' pointers of a node can point to any other nodes, and a menu can contain any other nodes. Thus, the node structure can be any directed graph. But it is usually more comprehensible to follow a structure that corresponds to the structure of chapters and sections in a printed manual.\refill In addition to `Next', `Previous', and `Up' pointers and menus, Info provides cross--references, that can be sprinkled throughout the text. This is usually the best way to represent links that do not fit a hierarchical structure. Usually, you will design a document so that its nodes match the structure of chapters and sections in the printed manual. But there are times when this is not right for the material being discussed. Therefore, \LaTeX info uses separate commands to specify the node structure of the Info file and the section structure of the printed manual.\refill Generally, you enter an Info file through a node that by convention is called \samp{Top}. This node normally contains just a brief summary of the file's purpose, and a large menu through which the rest of the file is reached. From this node, you can either traverse the file systematically by going from node to node, or you can go to a specific node listed in the main menu, or you can search the index menus and then go directly to the node that has the information you want.\refill \clearpage \node Printed Manuals, Formatting Commands, Info Files, Overview \section{Printed Manuals} \cindex{Printed manual characteristics} \cindex{Manual characteristics, printed} \cindex{Characteristics of printed manual} A \LaTeX info file can be formatted and typeset as a printed manual. To do this, you need to use \LaTeX, a powerful, sophisticated typesetting program written by Leslie Lamport, based on the \TeX{} typesetting system written by by Donald Knuth. A \LaTeX info-based printed manual will be similar to any other book; it will have a title page, copyright page, table of contents, and preface, as well as chapters, numbered or unnumbered sections and subsections, page headers, cross references, footnotes, and indices.\refill You can use \LaTeX info to write a book without ever having the intention of converting it into on-line information. You can use \LaTeX info for writing a printed novel, and even to write a printed memo.\refill \LaTeX{} is a general purpose typesetting program. \LaTeX info provides a file called \file{latexinfo.sty} that contains information (definitions or \dfn{macros}) that \LaTeX{} uses when it typesets a \LaTeX info file. (The macros tell \LaTeX{} how to convert the \LaTeX info \back -commands to \LaTeX{} commands, which \LaTeX{} can then process to create the typeset document.) \LaTeX\ allows you to customize the design of your document by selecting different document styles and options. You can readily change the style in which the printed document is formatted; for example, you can change the sizes and fonts used, the amount of indentation for each paragraph, the degree to which words are hyphenated, and the like. By changing the specifications, you can make a book look dignified, old and serious, or light-hearted, young and cheery. See the \LaTeX\ Manual for more details \cite{Lamport1986}.\refill \LaTeX{} is freely distributable. It is written in a dialect of Pascal called WEB and can be compiled either in Pascal or (by using a conversion program that comes with the \LaTeX{} distribution) in C. (\inforef{TeX Mode, TeX Mode, emacs}, for information about \LaTeX.)\refill \LaTeX{} is very powerful and has a great many features. Because a \LaTeX info file must be able to present information both on a character-only terminal in Info form and in a typeset book, the formatting commands that \LaTeX info supports are necessarily limited. However, you are free to use any \LaTeX\ extensions as long as you don't mind them being ignored by the Info formatting program. Or you can write your own extensions to the Info formatting program. \xref{Extending LaTeXinfo}.\refill \node Formatting Commands, A Short Sample LaTeXinfo File, Printed Manuals, Overview \section{\protect\back -commands} \cindex{\back -commands} \cindex{Formatting commands} In a \LaTeX info file, the commands that tell \LaTeX{} how to typeset the printed manual and tell \code{latexinfo-format-buffer} how to create an Info file are preceded by \samp{\back }; they are called \dfn{\back -commands}. For example, \code{\back node} is the command to indicate a node and \code{\back chapter} is the command to indicate the start of a chapter.\refill \beforenoterule \begin{sideremark} Most of the \back -commands, with a few exceptions such as \code{\back LaTeX\{\}}, must be written entirely in lower case.\refill \end{sideremark} \afternoterule The \LaTeX info \back -commands are a limited subset of \LaTeX\ commands. The limits make it possible for \LaTeX info files to be understood both by \LaTeX{} and by the code that converts them into Info files. This is because you have to be able to display Info files on any terminal that displays alphabetic and numeric characters.\refill Because \LaTeX info is an extension of \LaTeX, it is assumed in this manual that you are familiar with \LaTeX. There is a good reference manual available by the author \cite{Lamport1986}, and there are several beginner's introduction manuals alos available. You should read these first before trying to use \LaTeX info. Unlike \LaTeX, all ASCII printing characters except \samp{\back }, \samp{\{} and \samp{\}} can appear in body text in a \LaTeX info file and stand for themselves. This means that the characters \code{# $ % ^ & _ |} all print as normal characters. This is for several reasons. Firstly, \LaTeX info is designed for documenting computer programs, where these characters are used quite often. Secondly, the special uses in \LaTeX\ of some of these characters, such as math mode, are not used in \LaTeX info, so there is little point in making then special. And finally, because there is only one character in \LaTeX info that starts a command (\code{\back }), it is easier to implement the Info formating program, without making a complete implementation of \LaTeX. \xref{Using Ordinary LaTeX Commands}, for how to make \LaTeX info treat these characters as \LaTeX\ does. \clearpage \node A Short Sample LaTeXinfo File, A Short Sample LaTeXinfo File, Formatting Commands, Overview \section{A Short Sample LaTeXinfo File} \cindex{A Short Sample LaTeXinfo File} \cindex{Sample LaTeXinfo file} A \LaTeX info file looks like the following, which is a complete but very short \LaTeX info file. The \code{\back comment} or \code{\back c} command introduces comments that will not appear in either the Info file or the printed manual; they are for the person who reads the \LaTeX info file. The first part of the file, from \samp{\back documentstyle} through to \samp{\back setfilename}, looks more intimidating than it is. Most of the material is standard boilerplate; when you write a manual, you just put in the name of your own manual in this section.\refill All the commands that tell \LaTeX\ how to typeset the printed manual and tell\\ \code{latexinfo-format-buffer} how to create an Info file are preceded by \samp{\back }; thus, \code{\back node} indicates a node and \code{\back chapter} indicates the start of a chapter.\refill \smallverbatimfile{lnfo-sample.tex} \end{smallverbatim} \clearpage Here is what the contents of the first chapter of the sample look like: \begin{quotation} This is the contents of the first chapter. Here is a numbered list. \begin{enumerate} \item This is the first item. \item This is the second item. \end{enumerate} The \kbd{M-x latexinfo-format-buffer} command in Emacs transforms a \LaTeX info file like this into an Info file; and \LaTeX\ typesets it for a printed manual. \end{quotation} \section{The Structure of this Manual} This manual is structured in four parts: \begin{description} \item[LaTeX] This introduces the \LaTeX\ commands that are supported by \LaTeX info. This includes topic such as chapter structuring, marking words and phrases, displayed material, making lists tables and descriptions, formatting paragraphs, citations and footnotes. \item[Info] This introduces the concept of the \code{\back node}, and the specific requirements of the Info formatting program. This includes nodes and menus, making cross references, creating indices, and creating and installing an info file. \item[Emacs] This part show how to run \LaTeX\ and Info to generate the printed and on--line versions of the manual. It also describes how Emacs can make your life easier when writing \LaTeX info programs. \item[Appendices] The appendices describe how to install \LaTeX info, how to convert files from other formats to \LaTeX info, and gives a summary of all of the commands. \end{description} \part{LaTeX} \node Beginning a File, Conventions, A Short Sample LaTeXinfo File, Top \chapter{Beginning a LaTeXinfo File} \cindex{Beginning a LaTeXinfo file} \cindex{LaTeXinfo file beginning} \cindex{File beginning} \begin{menu} * Conventions:: General Syntactic Conventions * Minimum:: What a LaTeXinfo File Must Have * Six Parts:: Six Parts of a LaTeXinfo File * The LaTeXinfo File Header:: * The Title and Copyright Pages:: * Generating a Table of Contents:: * The Top Node:: Creating the top node and master menu. * Software Copying Conditions:: * Ending a File:: Ending a LaTeXinfo File \end{menu} \node Conventions, Comments, Beginning a File, Beginning a File \comment node-name, next, previous, up \section{General Syntactic Conventions} \cindex{General syntactic conventions} \cindex{Syntactic conventions} \cindex{Conventions, syntactic} All \scap{ascii} printing characters except \samp{\back }, \samp{\{} and \samp{\}} can appear in a \LaTeX info file and stand for themselves. \samp{\back } is the escape character which introduces commands. \samp{\{} and \samp{\}} should be used only to surround arguments to certain commands. To put one of these special characters into the document, put an \samp{\back } character in front of it, like this: \samp{\back back}, \samp{\back \{}, and \samp{\back \}}.\refill It is customary in \LaTeX{} to use doubled single-quote characters to begin and end quotations: \verb+``+ and \verb+'+. This convention should be followed in \LaTeX info files. \LaTeX{} converts doubled single-quote characters to left- and right-hand doubled quotation marks, ``like this,'' and Info converts doubled single-quote characters to \scap{ascii} double-quotes: \verb+``+ and \verb+''+ to \samp{"}. \xref{Inserting Characters Verbatim} for how to protect sections of documentation from these global substitutions.\refill Use three hyphens in a row, \samp{---}, for a dash---like this. In \LaTeX, a single or even a double hyphen produces a printed dash that is shorter than you want. Info reduces three hyphens to two for display on the screen.\refill \LaTeX\ ignores the line-breaks in the input text, except for blank lines, which separate paragraphs. Info generally preserves the line breaks that are present in the input file. Therefore, break the lines in the \LaTeX info file the way you want them to appear in the output Info file, and let \LaTeX\ take care of itself. Since Info does not normally refill paragraphs when it processes them, a line with commands in it will sometimes look bad after Info has run on it. To cause Info to refill the paragraph after finishing with the other processing, you need to put the command \code{\back refill} at the end of the paragraph. (\xref{Refilling Paragraphs}.)\refill If you mark off a region of the \LaTeX info file with the \code{\back begin\{iftex\}} and \w{\code{\back end\{iftex\}}} commands, that region will appear only in the printed copy; in that region, you can use commands borrowed from \LaTeX{} that you cannot use in Info. Likewise, if you mark off a region with the \code{\back begin\{ifinfo\}} and \code{\back end\{ifinfo\}} commands, that region will appear only in the Info file; in that region, you can use Info commands that you cannot use in \LaTeX. (\xref{Conditionals}.) \cindex{Tabs; don't use!} \begin{quote} \strong{Caution:} Do not use tabs in examples in a \LaTeX info file! \LaTeX{} treats them like single spaces.\footnote{To avoid putting tabs into your file, you can set the \code{indent-tabs-mode} variable in Emacs to \code{nil} so that Emacs inserts multiple spaces when you press the \key{TAB} key. Also, you can run \code{untabify} to convert tabs in a region to multiple spaces.\refill} \end{quote} \begin{menu} * Comments:: \end{menu} \node Comments, Minimum, Conventions, Conventions \subsection{Comments} \findex{c} \findex{comment} You can write comments in a \LaTeX info file that will not appear in either the Info file or the printed manual by using the \code{\back comment} command (which may be abbreviated to \code{\back c}). Such comments are for the person who reads the \LaTeX info file. All the text on a line that follows either \code{\back comment} or \code{\back c} is a comment; the rest of the line does not appear in either the Info file or the printed manual. (The \code{\back comment} or \code{\back c} does not have to be at the beginning of the line; only the text on the line that follows after the \code{\back comment} or \code{\back c} command does not appear.)\refill \cindex{Comments} \findex{comment} \findex{c \r{(comment)}} You can write long stretches of text that will not appear in either the Info file or the printed manual by using the \code{\back begin\{ignore\}} and \code{\back end\{ignore\}} commands. Write each of these commands on a line of its own, starting each command at the beginning of the line. Text between these two commands does not appear in the processed output. You can use \code{\back begin\{ignore\}} and \code{\back end\{ignore\}} for writing comments or for holding text you may wish to use in another version of your document. Often, \code{\back begin\{ignore\}} and \code{\back end\{ignore\}} is used to enclose a part of the copying permissions that applies to the \LaTeX info source file of a document, but not to the Info or printed version of the document.\refill \cindex{Ignored text} \cindex{Unprocessed text} \findex{ignore} \node Minimum, Six Parts, Comments, Beginning a File \section{What a LaTeXinfo File Must Have} \cindex{Minimal LaTeXinfo file} \cindex{Must have in LaTeXinfo file} \cindex{LaTeXinfo file minimum} In order to be made into a printed manual, a \LaTeX info file \strong{must} begin with lines that looks like \begin{verbatim} \documentstyle[12pt,latexinfo]{book} \pagestyle{headings} \begin{document} \setfilename{latexinfo.info} \end{verbatim} \noindent The \samp{\back documentstyle[12pt,latexinfo]\{book\}} line tells \LaTeX\ to use the\\ \file{latexinfo.sty} style and \file{book.sty} documentstyle files. The \code{\back pagestyle\{headings\}} command is the \LaTeX\ command to put the chapter and section headings and page numbers at the top of each page. The \code{\back begin\{document\}} command starts the document, and makes the characters \code{# $ % ^ & _ |} all begin to print as normal characters. (These characters retain their normal \LaTeX\ meanings in the preamble between the \code{\back documentstyle} and \code{\back begin\{document\}} commands.) This line must be followed (sooner or later) by the \samp{\back setfilename\{\var{info-file-name}\}}. It is needed to provide a name for the Info file to output to. The \code{\back setfilename} command \emph{must} occur at the beginning of a line. The \begin{example} \code{\back end\{document\}} \end{example} line at the end of the file on a line of its own tells \LaTeX{} that the file is ended and to stop typesetting.\refill Usually, you won't use quite such a spare format, but will include mode setting and index declarations at the beginning of a \LaTeX info file, like this:\refill \begin{verbatim} \documentstyle[12pt,latexinfo]{book} \pagestyle{headings} \begin{document} \newindex{cp} \bibliographystyle{alpha} \finalout \alwaysrefill \setfilename{latexinfo.info} \end{verbatim} Furthermore, you will usually provide a \LaTeX info file with a title page, master menu, and the like. But the minimum, which can be useful for short documents, is just the three lines at the beginning and the one line at the end.\refill \node Six Parts, The LaTeXinfo File Header, Minimum, Beginning a File \section{Six Parts of a LaTeXinfo File} \cindex{LaTeXinfo file beginning} \cindex{File beginning} Various pieces of information have to be provided to \LaTeX info at the beginning of a \LaTeX info file, such as the name of the file, the title of the document and the like. If you want to get elaborate, the beginning of a \LaTeX info file has six parts: \begin{enumerate} \item The preamble, which includes the command to tell \LaTeX\ what style files to use when processing the file. This starts with the \code{\back documentstyle}, and is terminated by the \code{\back begin\{document\}} command. \item The header, which is terminated by the \code{\back setfilename} command that contains the \LaTeX info options needed to tailor your output to your needs. \item The title page and the copyright page, which usually are set without any page numbers (\code{\back pagestyle\{empty}). This is terminated by the \code{\back maketitle} command. \item Then the table of contents, list of figures and tables, and possibly a preface, which are usually set with roman page numbers (\code{\back pagestyle\{headings\}} and \code{\back pagenumbering\{roman}). \item The \samp{Top} node that contains an extensive menu for the whole Info file. This is written with the \code{\back node} command, with a nodename of \code{Top}. The contents of this node should only appear in the Info file. \item The beginning of the text, which is set with \code{\back pagenumbering\{arabic}), and a chapter or section command. \end{enumerate} \cindex{Sample LaTeXinfo file} For a a short sample latexinfo file, see the file \file{lnfo-sample.tex} which is supplied with the \LaTeX info distribution. \node The LaTeXinfo File Header, The Documentstyle, Six Parts, Beginning a File \section{The LaTeXinfo File Header} \cindex{File Header} \cindex{Header for LaTeXinfo files} \cindex{LaTeXinfo file header} \LaTeX info files start with at least three lines that provide Info and \LaTeX\ with necessary information. \begin{verbatim} \documentstyle[12pt,latexinfo]{book} \begin{document} \setfilename{foo.info} \end{verbatim} \begin{menu} * The Documentstyle:: * setfilename:: \protect\code{\protect\back setfilename} * New Indexes:: * Custom Headings:: Customizing Your Layout \end{menu} \node The Documentstyle, setfilename, The LaTeXinfo File Header, The LaTeXinfo File Header \subsection{The Documentstyle} \cindex{First line of a LaTeXinfo file} \cindex{Beginning line of a LaTeXinfo file} Every \LaTeX info file that is to be the top-level input to \LaTeX\ must begin with a line that looks like this: \begin{verbatim} \documentstyle[12pt,latexinfo]{book} \end{verbatim} When the file is processed by \LaTeX, it loads the macros listed as options to the \code{documentstyle} command. The option \code{latexinfo} is needed for processing a \LaTeX info file, and \LaTeX\ will then input the file \file{latexinfo.sty}; \pxref{Preparing for LaTeX}. Unlike \TeX info, you can also include other options that may also include style files. These \LaTeX info style files may have an Emacs counterpart, so that you can extend \LaTeX info by writing your own styles. \xref{Extending LaTeXinfo}, for more information on writing your own styles. Also look in the inputs directory of your \TeX\ distribution for other \LaTeX\ styles that are provided with \TeX. \beforenoterule \begin{sideremark} The region of the file between the \code{\back documentstyle} and the \code{\back begin\{document\}} commands is know in \LaTeX\ as the \dfn{preamble}. Only certain \LaTeX\ commands are allowed there, and you'll need to consult the \LaTeX\ manual for the list of allowed commands. It is best to put your commands that modify your \LaTeX\ commands in the region between the \code{\back begin\{document\}} and the \code{\back setfilename}; they will be ignored by Info, and \LaTeX\ will not object. \end{sideremark} \afternoterule \node setfilename, New Indexes, The Documentstyle, The LaTeXinfo File Header \subsection{\protect\code{\protect\back setfilename}} \cindex{Info file requires \code{\back setfilename}} \findex{setfilename} It is important to note that the \code{\back setfilename} command is required for Info. In order to be made into an Info file, a \LaTeX info file must contain a line that looks like this:\refill \begin{example} \back setfilename\{\var{info-file-name}\} \end{example} \noindent Write the \code{\back setfilename} command at the beginning of a line followed by the Info file name.\refill The \code{\back setfilename} line specifies the name of the Info file to be generated. Specify the name with an \samp{.info} extension, to produce an Info file name such as \file{latexinfo.info}.\refill Any text that appears before the \code{\back setfilename} command is not included in the Info file. So if you want to include the \code{title} and \code{author} material, place the \code{\back setfilename} command before them; if not, after them. This region, between the \code{\back begin\{document\}} command and the \code{\back setfilename} command is known as the header, and should contain any of the commands that alter the overall style of your document. \node New Indexes, Custom Headings, setfilename, The LaTeXinfo File Header \subsection{New Indexes} \findex{newindex} In order to generate any of the indices, you must declare them with the \code{\back newindex} command, before it is first used by one of the index commands. This is usually done after the \code{\back begin\{document\}} but before the \code{\back setfilename}. \code{newindex} takes one argument, which is the two letter index type. For example, to declare a concept and function index, you would use\refill \begin{verbatim} \documentstyle[12pt,latexinfo]{book} \begin{document} \newindex{cp} \newindex{fn} \setfilename{plisp.info} \end{verbatim} \xref{Declaring indices}, for the declaring indices and the definitions of the index types. \node Custom Headings, paragraphindent, New Indexes, The LaTeXinfo File Header \subsection{Customizing Your Layout} \findex{pagestyle} \findex{pagenumbering} \findex{footnotestyle} \findex{markboth} \findex{markright} \findex{oddfoot} \findex{evenfoot} You may, if you wish, create your own, customized headings and footings. The \code{\back markboth} and \code{\back markright} commands are both supported in \LaTeX info. These should occur on a line by themselves. See \cite[\S\tie 5.1]{Lamport1986}, for a detailed discussion of this process.\refill The \code{\back oddfoot} and \code{\back evenfoot} commands specifiy the odd and even page footings respectively. These should occur on a line by themselves. At the beginning of a manual or book, pages are not numbered---for example, the title and copyright pages of a book are not numbered. To accomplish this, use the command\refill \begin{verbatim} \pagestyle{empty} \end{verbatim} as shown in the sample file, \file{lnfo-sample.tex}. By convention, table of contents pages are numbered with roman numerals and not in sequence with the rest of the document. To accomplish this, use the commands\refill \begin{verbatim} \pagestyle{headings} \pagenumbering{roman} \end{verbatim} as shown in the sample file, \file{lnfo-sample.tex}. Since an Info file does not have pages, the \code{\back markboth}, \code{\back markright}, \code{pagestyle} and \code{pagenumbering} commands have no effect on it. The lines containing these commands will be deleted from the Info file.\refill The \code{\back footnotestyle} command to specify an Info file's footnote style. \xref{Footnotes} for how to use this command. \begin{menu} * paragraphindent:: Paragraph Indenting \end{menu} \node paragraphindent, The Title and Copyright Pages, Custom Headings, Custom Headings \subsubsection{Paragraph Indenting} \cindex{Indenting paragraphs} \cindex{Paragraph indentation} \findex{paragraphindent} The Info formatting commands may insert spaces at the beginning of the first line of each paragraph, thereby indenting that paragraph. The \code{\back paragraphindent} command specifies the indentation. Write \code{\back paragraphindent} at the beginning of a line followed by either \samp{asis} or a number in braces. The template is:\refill \begin{example} \back paragraphindent\{\var{indent}\} \end{example} The Info formatting commands indent according to the value of \var{indent}:\refill \begin{itemize} \item If the value of \var{indent} is \samp{asis}, the Info formatting commands do not change the existing indentation.\refill \item If the value of \var{indent} is 0, the Info formatting commands delete existing indentation.\refill \item If the value of \var{indent} is greater than 0, the Info formatting commands indent the paragraph by that number of spaces.\refill \end{itemize} The default value of \var{indent} is \samp{asis}.\refill Write the \code{\back paragraphindent} command before the \code{setfilename} command at the beginning of a \LaTeX info file.\refill The \code{latexinfo-format-buffer} and \code{latexinfo-format-region} commands do \emph{not} automatically indent paragraphs. These commands only indent paragraphs that are ended by an \code{\back refill} command. (\xref{Always Refilling Paragraphs}, for how to avoid this.) \xref{Refilling Paragraphs}, for more information about \code{\back refill}.\refill \node The Title and Copyright Pages, Titlepage, paragraphindent, Beginning a File \section{The Title and Copyright Pages} \cindex{Copyright page} \begin{menu} * Titlepage:: * The Copyright Page and Printed Permissions:: \end{menu} \node Titlepage, The Copyright Page and Printed Permissions, The Title and Copyright Pages, The Title and Copyright Pages \subsection{Titlepage} \cindex{Titlepage} \findex{author} \findex{title} \findex{date} \findex{maketitle} The first printed material after the \code{\back begin\{document\}} will make up the titlepage. The \LaTeX\ commands \code{\back title}, \code{\back author} and \code{\back date} are used the same way as in any \LaTeX\ report or book. The title page is terminated by \code{\back maketitle}. Following the material for the title page should be the copyright page.\refill \begin{verbatim} \title{The PLisp Manual} \author{Fred Foobar,\\ Clarke Institute} \date{\today} \maketitle \end{verbatim} The \code{\back title} command produces a line in which the title is set centered on the page in a larger than normal font. You can have many lines in the title by using \code{\back \back} to force a newline.\refill The \code{\back author} command sets the names of the author or authors in a middle-sized font, centered on the page.\refill The \code{\back date} command sets the date in a middle-sized font, centered on the page. You can put the date in yourself, or use the \code{\back today} command, which will put in the date that the document is processed on.\refill The \code{\back maketitle} command sets the author, title and date, and in the \code{book} documentstyle, emitts a new page. The should be no other printing text between the \code{documentstyle} command and the \code{maketitle} command. In a \code{book} style, text is printed on both sides of the paper, chapters start on right-hand pages, and right-hand pages have odd numbers. But in a \code{report} style, text is printed only on one side of the paper unless the \code{twoside} \LaTeX\ option is provided to the \code{documentstyle} command.\refill \node The Copyright Page and Printed Permissions, Generating a Table of Contents, Titlepage, The Title and Copyright Pages \subsection{The Copyright Page and Printed Permissions} \cindex{Copyright} \cindex{Printed permissions} \cindex{Permissions, printed} \findex{pagestyle} \findex{thispagestyle} This part of the beginning of a \LaTeX info file contains the text of the copying permissions that will appear in the manual. This is usually followed by the \code{\back tableofcontents} command. If you put title and copyright pages before the \code{\back setfilename} command, then this material will only appear only in the printed manual, not in the Info file. By international treaty, the copyright notice for a book should be either on the title page or on the back of the title page. The copyright notice should include the year followed by the name of the organization or person who owns the copyright.\refill The following commands start the copyright page for the printed manual. \begin{verbatim} \maketitle \clearpage \vspace*{0pt plus 1filll} Copyright \copyright{} year copyright-owner Permission is granted to copy and distribute modified versions of this document under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. \pagestyle{empty} \clearpage \end{verbatim} When the copyright notice is on the back of the title page, the page is not numbered. Therefore, this is usually done while a \code{\back pagestyle\{empty\}} is in effect. See the \LaTeX\ Manual for more details on the \code{pagestyle} command \cite{Lamport1986}.\refill \findex{filll} \findex{vspace} \findex{vspace*} \findex{clearpage} To cause a page break, the \code{\back clearpage} command is used. In the sample, the \code{\back clearpage} that ends the titlepage is followed by the somewhat mysterious line that reads: \samp{\back vspace*\{0pt plus 1filll\}}. This is a line that uses \LaTeX\ commands to push the copyright notice and the other text on the copyright page towards the bottom of the page. The \code{\back vspace*} command means to put in white space. The \samp{0pt plus 1filll} means to put in zero points of mandatory white space, and as much optional white space as needed. Note the use of three \samp{l}s in the word \samp{filll}; this is the correct use in \LaTeX.\refill \findex{copyright} The \code{\back copyright} command generates a \samp{c} inside a circle. The copyright notice itself has the following legally defined sequence: \begin{example} Copyright \copyright{} \var{year} \var{copyright-owner} \end{example} It is customary to put information on how to get a manual after the copyright notice (the address of the Free Software Foundation, for example) and the permissions. When you write a manual about a computer program, you should write the version of the program to which the manual applies on the title page. If the manual changes more frequently than the program or is independent of it, you should also include an edition number\footnote{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.} for the manual. This helps readers keep track of which manual is for which version of the program.\refill \xref{Sample Permissions}, for recommended permission text.\refill \node Generating a Table of Contents, The Top Node, The Copyright Page and Printed Permissions, Beginning a File \section{Generating a Table of Contents} \cindex{Generating a Table of Contents} \cindex{Table of contents} \cindex{Contents, Table of} The commands \code{\back chapter}, \code{\back section}, etc., supply the information to make up a table of contents, but they do not cause an actual table to be generated. To do this, you must use the \code{\back tableofcontents} command. The table of contents command outputs (into a printed manual) a complete table of contents, based on the \code{\back chapter}, \code{\back section} and other sectioning commands. This command should be used on a line by itself. This command automatically generates a Table of Contents heading at the top of the page. Tables of contents should be generated at the beginning of the manual, usually just after the \code{\back maketitle} command or copyright pages.\refill You can also use the \code{\back listoftables} command to make a listing of all of the tables in the document. \xref{Figures and Tables}, for how to define tables. \begin{verbatim} \pagestyle{empty} \clearpage \pagestyle{headings} \pagenumbering{roman} \tableofcontents \clearpage \c Make a list of tables if you have any \listoftables \clearpage \end{verbatim} Since an Info file uses menus instead of tables of contents, the Info formatting commands ignore the \code{\back tableofcontents} and \code{\back listoftables} commands.\refill \node The Top Node, Title of Top Node, Generating a Table of Contents, Beginning a File \section{The Top Node and Master Menu} \cindex{Top node} \cindex{Master menu} \cindex{Node, Top} The `Top' node is the node at which you enter the file when browing the Info file with one of the Info browsing programs. A `Top' node should contain a brief description of the file and an extensive, master menu for the whole Info file. The contents of anything other than the master menu should appear only in the Info file; none of it should appear in printed output, so enclose it between \code{\back begin\{ifinfo\}} and \code{\back end\{ifinfo\}} commands. \LaTeX{} does not print either an \code{\back node} line or a menu; they appear only in Info, so you do not have to enclose these parts between \code{\back begin\{ifinfo\}} and \code{\back end\{ifinfo\}}. \xref{Conditionals, , Conditionally Visible Text}.)\refill \begin{menu} * Title of Top Node:: A Top node needs a title. * Master Menu Parts:: A master menu has three or more parts. \end{menu} \node Title of Top Node, Master Menu Parts, The Top Node, The Top Node \begin{ifinfo} \subsection*{Top Node Title} \end{ifinfo} For example, the beginning of the Top node of a manual might like this:\refill \begin{example} \begin{same} \dots{} \back tableofcontents \back clearpage \back begin\{ifinfo\} \back node Top, Copying, (dir), (dir) \LaTeX info is a documentation system\dots{} This is edition\dots{} \back end\{ifinfo\} \back begin\{menu\} * Copying:: \LaTeX info is freely redistributable. * Overview:: What is LaTeXinfo?\dots{} \back end\{menu\} \end{same} \end{example} In a `Top' node, the `Previous', and `Up' nodes usually refer to the top level directory of the whole Info system, which is called \samp{(dir)}. \xref{Installing an Info File}, for more information about the \code{dir} Info file in the \file{info} directory.\refill \node Master Menu Parts, Software Copying Conditions, Title of Top Node, The Top Node \subsection{Parts of a Master Menu} \cindex{Master menu parts} \cindex{Parts of a master menu} A \dfn{master menu} is a detailed main menu listing all the nodes in a file. A master menu is enclosed in \code{\back begin\{menu\}} and \code{\back end\{menu\}} commands and does not appear in the printed document. Generally, a master menu is divided into parts.\refill \begin{itemize} \item The first part contains the major nodes in the \LaTeX info file: the nodes for the chapters, chapter-like sections, and the appendices.\refill \item The second part contains nodes for the indices.\refill \item The third and subsequent parts contain a listing of the other, lower level nodes, often ordered by chapter. This way, rather than go through an intermediary menu, an inquirer can go directly to a particular node when searching for specific information. These menu items are not required; add them if you think they are a convenience.\refill \end{itemize} Each section in the menu can be introduced by a descriptive line. So long as the line does not begin with an asterisk, it will not be treated as a menu item. (\xref{Menu Environment}, for more information.)\refill For example, the master menu for a manual might look like the following: \refill \begin{example} \begin{same} \back begin\{menu\} * Copying:: \LaTeX info is freely redistributable. * Overview:: What is LaTeXinfo? * LaTeXinfo Mode:: Special features in GNU Emacs. \dots{} \dots{} * Command and Variable Index:: An item for each \back -command. * Concept Index:: An item for each concept. --- The Detailed Node Listing --- Overview of LaTeXinfo * Info Files:: What is an Info file? * Printed Manuals:: Characteristics of a printed manual. \dots{} \dots{} Using \LaTeX info Mode * Info on a Region:: Formatting part of a file for Info. \dots{} \dots{} \back end\{menu\} \end{same} \end{example} \node Software Copying Conditions, Sample Permissions, Master Menu Parts, Beginning a File \section{Software Copying Conditions} \cindex{Software copying conditions} \cindex{Copying software} \cindex{Distribution} \cindex{License agreement} If the \LaTeX info file has a section containing the distribution information and a warranty disclaimer for the software that is being documented, this section usually follows the `Top' node. The General Public License is very important to Project GNU software. It ensures that you and others will continue to have a right to use and share the software.\refill The copying and distribution information and the disclaimer are usually followed by a preface, or else by the first chapter of the manual.\refill \cindex{Preface} Although a preface is not a required part of a \LaTeX info file, it is very helpful. Ideally, it should state clearly and concisely what the file is about and who would be interested in reading it. In general, the preface would follow the licensing and distribution information, although sometimes people put it earlier in the document. Usually, a preface is put in an \code{\back chapter*} type of section. (\xref{Chapter}.)\refill \begin{menu} * Sample Permissions:: * Titlepage Permissions:: Titlepage Copying Permissions \end{menu} \node Sample Permissions, Titlepage Permissions, Software Copying Conditions, Software Copying Conditions \subsection{Sample Permissions} \cindex{Permissions} \cindex{Copying permissions} \LaTeX info files should contain sections that tell the readers that they have the right to copy and distribute the Info file, the printed manual, and any accompanying software. Here are samples containing the standard text of the Free Software Foundation copying permission notice for an Info file and printed manual. \inforef{Distrib, Distribution, emacs}, for an example of the text that could be used in the software Distribution, General Public License, and NO WARRANTY sections of a document.\refill \begin{menu} * Inserting Permissions:: How to put permissions in your document. * ifinfo Permissions:: Sample \samp{ifinfo} copying permissions. * Titlepage Permissions:: Sample Titlepage copying permissions. \end{menu} \node Titlepage Permissions, Ending a File, Sample Permissions, Software Copying Conditions \subsection{Titlepage Copying Permissions} \cindex{Titlepage permissions} In the copyright section of the \LaTeX info file, the standard Free Software Foundation copying permission notice follows the copyright notice and publishing information. The standard phrasing is: \begin{smallexample} 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 ``Distribution'' and ``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 the sections entitled ``Distribution'' and ``General Public License'' may be included in a translation approved by the author instead of in the original English. \end{smallexample} \node Ending a File, Making a Bibliography, Titlepage Permissions, Beginning a File \section{Ending a LaTeXinfo File} \cindex{Ending a LaTeXinfo file} \cindex{LaTeXinfo file ending} \cindex{File ending} The end of a \LaTeX info file should include the commands that create the bibliography, and the indices. It must include the \code{\back end\{document\}} command that marks the last line that \LaTeX{} processes. For example, a \LaTeX info file might be ended as follows:\refill For example,\refill \begin{verbatim} \bibliography{latexinfo} \twocolumn \node Concept Index, , Previous Node, Top \unnumbered{Concept Index} \cindex{Concept Index} \printindex{cp} \end{document} \end{verbatim} The \code{\back end\{document\}} command should be on a line by itself and every \LaTeX info file must end with such a line. This command terminates \LaTeX\ processing and forces out unfinished pages.\refill \begin{menu} * Making a Bibliography:: * Printing an Index and Generating Menus:: Printing an index and generating index menus. * File End:: Ending a file with \code{\back end\{document\}}. \end{menu} \node Making a Bibliography, Printing an Index and Generating Menus, Ending a File, Ending a File \subsection{Making a Bibliography} \cindex{Making a Bibliography} \findex{bibliographystyle} You may also choose to include a bibliography of citations in the document, using the \code{\back cite} command . Citations are prepared using the program \BibTeX, which formats the citations for use with \LaTeX. See the \LaTeX\ Manual for more details in \BibTeX\ \cite[Appendix B]{Lamport1986}.\refill Before you use the \code{\back cite} command, you must declare the bibliography style that you are going to use. This is usually done at the beginning of the document, for example \begin{verbatim} \begin{document} \bibliographystyle{alpha} \end{verbatim} At the end of the document comes the bibliography itself. The \code{\back bibliography} takes as an argument a comma separated list of filenames that contain the bibliography entries. \begin{verbatim} \bibliography{latexinfo} \end{verbatim} With these two sections in your document, you can use the \code{\back cite} command to refer to the bibliography. For example \begin{verbatim} a citation of the GNU Emacs Manual \cite{GNUEmacsManual}\dots \end{verbatim} \noindent would produce \begin{example} a citation of the GNU Emacs Manual \cite{GNUEmacsManual}\dots \end{example} \noindent and would cause an entry to be put in the Bibliography section something like \begin{description} \item[Sta86] Richard Stallman. \i{The GNU Emacs Manual}, The Free Software Foundation, 675 Massachusetts Ave., Cambridge MA, 02139, 1986. \end{description} \xref{Citations}, for how to use citations in the document. \node Printing an Index and Generating Menus, File End, Making a Bibliography, Ending a File \subsection{Index Menus and Printing an Index} \findex{printindex} \cindex{Printing an index} \cindex{Indices, printing and menus} \cindex{Generating menus with indices} \cindex{Menus generated with indices} Using \LaTeX info, you can generate printed indices and Info file menus without having to sort and collate entries manually. \LaTeX info will do this for you automatically. Each index covers a certain kind of entry (functions, or variables, or concepts, etc.)\: and lists all of those entries in alphabetical order, together with information on how to find the discussion of each entry. In a printed manual, this information consists of page numbers. In an Info file, it consists of a menu item leading to the first node where the entry is defined. To print an index means to include it as part of a manual or Info file. This does not happen automatically just because you use \code{\back cindex} or other index-entry generating commands in the \LaTeX info file; those just cause the raw data for the index to be accumulated. To generate an index, you must include the \code{\back printindex} command at the place in the document where you want the index to appear, and declare the index at the beginning of the document with the \code{\back newindex} command. Also, as part of the process of creating a printed manual, you must run a program called \code{latexindex} (\pxref{Printing Hardcopy}) to sort the raw data to produce a sorted index file. The sorted index file is what will actually be used to print the index.\refill Like typesetting, the construction of an index is a highly skilled, professional art, the subtleties of which are not appreciated until you have to do it yourself. \LaTeX info offers six different types of predefined index: the concept index, the function index, etc. (\xref{Creating Indices}.) Each index type has a two-letter name. You may merge indices, or put them into separate sections (\xref{Combining Indices}.).\refill \findex{twocolumn} \findex{onecolumn} The \code{\back printindex} command does not generate a chapter heading for the index. Consequently, you should precede the \code{\back printindex} command with a suitable section or chapter command (usually \code{\back unnumbered}) to supply the chapter heading and put the index into the table of contents. Precede the \code{\back unnumbered} command with an \code{\back node} line. Also, if you want the index to be set in two-column mode, then you should precede the index with the \LaTeX\ \code{\back twocolumn} command. You can switch back to one-column mode with the \LaTeX\ \code{\back onecolumn} command. For example,\refill \begin{verbatim} \twocolumn \node Command Index, Concept Index, The Last Section, Top \unnumbederd{Command Index} \cindex{Command Index} \printindex{fn} \onecolumn \node Concept Index,Top, Command Index, Top \unnumbered{Concept Index} \cindex{Concept Index} \printindex{cp} \end{document} \end{verbatim} \noindent (Readers often prefer that the concept index come last in a book, since that makes it easiest to find.)\refill \begin{ignore} In \LaTeX, the \code{\back printindex} command needs a sorted index file to work from. \LaTeX{} does not know how to do sorting; this is a deficiency. \LaTeX{} writes output files of raw index data; use the \code{latexindex} program to convert these files to sorted index files. (\xref{Printing Hardcopy}, for more information.)\refill \end{ignore} \node File End, Structuring, Printing an Index and Generating Menus, Ending a File \subsection{\protect\code{\protect\back end\protect\{document\protect\}} File Ending} \findex{bye} An \code{\back end\{document\}} command terminates \LaTeX{} or Info formatting. None of the formatting commands see any of the file following \code{\back end\{document\}}. The \code{\back end\{document\}} command should be on a line by itself.\refill Optionally, you may follow an \code{\back end\{document\}} line with a local variables list. \xref{Compile-Command, , Using Local Variables and the Compile Command}, for more information.\refill \node Structuring, Tree Structuring, File End, Top \chapter{Chapter Structuring} \cindex{Chapter structuring} \cindex{Structuring of chapters} The chapter structuring commands divide a document into a hierarchy of chapters, sections, subsections, and subsubsections. These commands generate large headings; they also provide information for the table of contents of a printed manual.\refill The chapter structuring commands do not create an Info node structure, so normally you should put an \code{\back node} command immediately before each chapter structuring command (\pxref{Nodes and Menus, , Nodes and Menus}). The only time you are likely to use the chapter structuring commands without using the node structuring commands is if you are writing a document that contains no cross references and will never be transformed into Info format.\refill \begin{menu} * Tree Structuring:: A manual is like an upside down tree \dots{} * Structuring Command Types:: How to divide a manual into parts. * Chapter:: * Appendix:: * Section:: * Subsection:: * Subsubsection:: Commands for the lowest level sections. \end{menu} \node Tree Structuring, Structuring Command Types, Structuring, Structuring \section{Tree Structure of Sections} \cindex{Tree structuring} A \LaTeX info file is usually structured like a book with chapters, sections, subsections, and the like. This structure can be visualized as a tree (or rather as an upside-down tree) with the root at the top and the levels corresponding to chapters, sections, subsection, and subsubsections. In Info format, `Next' and `Previous' pointers of a node usually lead to other nodes at the same level; an `Up' pointer usually leads to a node at the level above; and a `Menu' leads to nodes at a level below. Cross references can point to nodes at any level. \xref{Cross References}.\refill Here is a diagram that shows a \LaTeX info file with three chapters, each of which has two sections.\refill \begin{example} \begin{same} top | ------------------------------------- | | | Chapter 1 Chapter 2 Chapter 3 | | | -------- -------- -------- | | | | | | Section Section Section Section Section Section 1.1 1.2 2.1 2.2 3.1 3.2 \end{same} \end{example} In a \LaTeX info file that has this structure, the beginning of Chapter 2 might look like this:\refill \begin{example} \begin{same} \back node Chapter 2, Chapter 3, Chapter 1, top \back chapter\{Chapter 2\} \end{same} \end{example} To get to Sections 2.1 and 2.2, you need a menu inside of Chapter 2 that says: \begin{verbatim} \begin{menu} * Sect. 2.1:: Description of this section. * Sect. 2.2:: \end{menu} \end{verbatim} \noindent This menu is located inside Chapter 2, after the beginning of the chapter, just before Section 2.1. Usually, a \code{\back node} command and a chapter structuring command are used in sequence, along with indexing commands. For example, the node for the chapter on Ending a LaTeXinfo File looks like this: \begin{verbatim} \node Ending a LaTeXinfo File, Structuring, Beginning a LaTeXinfo File, Top \chapter{Ending a LaTeXinfo File} \cindex{Ending a LaTeXinfo File} \cindex{LaTeXinfo file ending} \cindex{File ending} \end{verbatim} The \code{\back node} command is the only one in \LaTeX info where the arguments are not delineated by braces. The arguments are separated by commas, and are terminated at the end of the line. This is because the Info format itself requires the \code{node} arguments to be like this. Note that it also means that you cannot use a comma within any of the four arguments to the node command. The chapter structuring commands are described in the sections that follow; the \code{\back node} and \code{\back begin\{menu\}} commands are described in a following chapter (\pxref{Nodes and Menus}).\refill \node Structuring Command Types, Chapter, Tree Structuring, Structuring \section{Types of Structuring Command} There are four chapter-structuring commands for chapters, sections, subsections and subsubsections. The optional heading argument of \LaTeX\ to these commands is not supported. You should avoid the use of any \LaTeX\ commands in the headings: any such commands should be preceded by a \code{\back protect}. See the \LaTeX\ Manual for more details \cite{Lamport1986}.\refill \begin{menu} * Chapter:: * Appendix:: * Section:: * Subsection:: * Subsubsection:: * Node:: * Menu Environment:: \end{menu} \c !!! spaces after a title underlined by asterisk: bug to fix \node Chapter, Appendix, Structuring Command Types, Structuring \section{Chapter} \cindex{Chapter} \findex{chapter} \findex{unnumbered} \findex{chapter*} \code{\back chapter} identifies a chapter in the document. It is followed by a single argument: \begin{verbatim} \chapter{Node and Chapter Structuring} \end{verbatim} In \LaTeX, it creates a chapter in the document, specifying the chapter title. The chapter will be numbered automatically in the printed manual. In the Info file, \code{\back chapter} causes its argument to appear on a line by itself, with a line of asterisks inserted underneath. For example:\refill \begin{example} This is a Chapter ***************** \end{example} \c !!! spaces after a title underlined by asterisk: bug to fix \noindent To start a chapter without it being numbered, use the \code{\back unnumbered} command. To start a chapter without it being numbered or appearing in the table of contents, use the \code{\back chapter*} command. In the printed manual, the chapters will begin on a new page. If you want the chapters to appear on the odd--sided pages, use the \code{book} documentstyle. \node Appendix, Section, Chapter, Structuring \section{Appendix} \cindex{Appendix} \findex{appendix} \code{\back appendix} is the same as the \LaTeX\ command of the same name. In a printed manual, all chapters that follow this command are numbered differently in the table of contents: they are given a letter instead of a number, and the letters restart from \code{A}. \node Section, Subsection, Appendix, Structuring \section{Section} \cindex{Section} \findex{section} \findex{unnumberedsec} \findex{section*} \code{\back section} is like \code{\back chapter} except that in \LaTeX\ it makes a section rather than a chapter. (\xref{Chapter}.) Sections go within chapters. In the Info file, \code{\back chapter} and \code{\back section} differ only in that \code{\back section} underlines with \samp{=}. For example,\refill \begin{example} This is a section ================= \end{example} To start a section without it being numbered, use the \code{\back unnumberedsec} command. To start a section without it being numbered or appearing in the table of contents, use the \code{\back section*} command. \node Subsection, Subsubsection, Section, Structuring \section{Subsection} \cindex{Subsection} \findex{subsection} \findex{unnumberedsubsec} \findex{subsection*} Subsections are to sections as sections are to chapters. (\xref{Section}.) They are underlined with \samp{-}. For example,\refill \begin{example} This is a subsection -------------------- \end{example} To start a subsection without it being numbered, use the \code{\back unnumberedsubsec} command. To start a subsection without it being numbered or appearing in the table of contents, use the \code{\back subsection*} command.\refill \node Subsubsection, Marking Text, Subsection, Structuring \section{Subsubsection} \cindex{Subsubsection} \findex{subsubsection} \findex{unnumberedsubsubsec} \findex{subsubsection*} Subsubsections are to subsections as subsections are to sections. (\xref{Subsection}.) They are underlined with periods. For example,\refill \begin{example} This is a subsubsection ....................... \end{example} To start a subsubsection without it being numbered, use the \code{\back unnumberedsubsubsec} command. To start a subsubsection without it being numbered or appearing in the table of contents, use the \code{\back subsubsection*} command.\refill \node Marking Text, Indicating, Subsubsection, Top \chapter{Marking Words and Phrases} \cindex{Paragraph, marking text within} \cindex{Marking words and phrases} \cindex{Words and phrases, marking them} \cindex{Marking text within a paragraph} In \LaTeX info, you can mark words and phrases in a variety of ways. These ways specify, for example, whether a word or phrase is a defining occurrence, a metasyntactic variable, or a symbol used in a program. Also, you can use fonts to emphasize text.\refill In addition, there are special commands for inserting single characters that have special meaning in \LaTeX info, such as braces, and for inserting symbols with special handling, such as dots and bullets. Finally, there are ways to emphasize words. \begin{menu} * Indicating:: Indicating Definitions, Commands, etc. * Emphasis:: Emphasizing Text * Insertions:: Special Insertions \end{menu} \node Indicating, code, Marking Text, Marking Text \section{Indicating Definitions, Commands, etc.} \cindex{Highlighting} \cindex{Indicating commands, definitions, etc.} \LaTeX info has commands for indicating just what kind of object a piece of text refers to. Metasyntactic variables, for example, are marked by \code{\back var} and code by \code{\back code}. \LaTeX info uses this information to determine how to highlight the text. Since the pieces of text are labelled by commands that tell what kind of object they are, it is easy to change the way \LaTeX info formats such text.\refill For example, code is usually illustrated in a typewriter font, but it would be easy to change the way \LaTeX info highlights code to use another font. This change would not effect how keystroke examples are highlighted. If straight typesetting commands were used in the body of the file and you wanted to make a change, you would have to check every single occurrence to make sure that you were changing code and not something else that should not be changed.\refill \begin{menu} * code:: How to indicate code. * kbd:: How to show keyboard input. * key:: How to specify keys. * Ctrl:: * samp:: How to show a literal sequence of characters. * var:: How to indicate a metasyntactic variable. * file:: How to indicate the name of a file. * dfn:: How to specify a definition. \end{menu} The highlighting commands can be used to generate useful information from the file, such as lists of functions or file names. It is possible, for example, to write a \LaTeX info style to insert an index entry after every paragraph that contains words or phrases marked by a specified command. You could do this to construct an index of functions automatically; \pxref{The fvpindex Style} for an example.\refill \clearpage The font changing commands commands serve a variety of purposes:\refill \begin{description} \item[\back code\{\var{sample-code}\}] Indicate text that is a literal example of a piece of a program.\refill \item[\back kbd\{\var{keyboard-characters}\}] Indicate keyboard input.\refill \item[\back key\{\var{key-name}\}] Use for the conventional name for a key on a keyboard.\refill \item[\back samp\{\var{text}\}] Indicate text that is a literal example of a sequence of characters.\refill \item[\back var\{\var{metasyntactic-variable}\}] Indicate a metasyntactic variable.\refill \item[\back file\{\var{file-name}\}] Indicate the name of a file.\refill \item[\back dfn\{\var{term}\}] Use for the introductory or defining use of a term.\refill \item[\back ctrl\{\var{ctrl-char}\}] Use for an \scap{ascii} control character.\refill \end{description} \node code, kbd, Indicating, Indicating \subsection{\protect\code{\protect\back code}\protect\{\protect\var{sample-code}\protect\}} \findex{code} Use the \code{\back code} command to indicate text that is a piece of a program and which consists of entire syntactic tokens. Enclose the text in braces.\refill Thus, you should use \code{\back code} for an expression in a program, for the name of a variable or function used in a program, or for a keyword. Also, you should use \code{\back code} for the name of a program, such as \code{diff}, that is a name used in the machine. (You should write the name of a program in the ordinary text font if you regard it as a new English word, such as `Emacs' or `Bison'.)\refill Use \code{\back code} for the \code{TEXINPUTS} environment variable and other such variables. Do not use the \code{\back code} command for a string of characters shorter than a syntactic token. In particular, you should not use the \code{\back code} command when writing about the characters used in a token; do not, for example, use \code{\back code} when you are explaining what letters or printable symbols can be used in the names of functions. (Use \code{\back samp}.) Also, you should not use \code{\back code} to mark text that is considered input to programs unless the input is written in a language that is like a programming language. For example, you should not use \code{\back code} for the single character commands of GNU Emacs (use \code{\back kbd} instead) although you may use \code{\back code} for the names of the Emacs Lisp functions that the keyboard commands invoke.\refill In the printed manual, \code{\back code} causes \LaTeX{} to typeset the argument in a typewriter face. In the Info file, it causes the Info formatting commands to use `\dots{}' quotation. For example:\refill \begin{example} Use \back code\{diff\} to compare two files. \end{example} \noindent produces this in the printed manual:\refill \begin{quote} Use \code{diff} to compare two files. \end{quote} \begin{iftex} \noindent and this in Info file:\refill \begin{example} Use `diff' to compare two files. \end{example} \end{iftex} \node kbd, key, code, Indicating \subsection{\protect\code{\protect\back kbd}\protect\{\protect\var{keyboard-characters}\protect\}} \findex{kbd} Use the \code{\back kbd} command for characters of input to be typed by users. For example, to refer to the characters \kbd{M-a}, write\refill \begin{example} \back kbd\{M-a\} \end{example} \noindent and to refer to the characters \kbd{M-x shell}, write\refill \begin{example} \back kbd\{M-x shell\} \end{example} The \code{\back kbd} command has the same effect as \code{\back code} in Info, but may produce a different font in a printed manual.\refill You can embed another \back -command inside the braces of an \code{\back kbd} command. Here, for example, is the way to describe a command that would be described more verbosely as ``press an \samp{r} and then press the \key{RET} key'':\refill \begin{example} \back kbd\{r \back key\{RET\}\} \end{example} \noindent This produces: \kbd{r \key{RET}} You also use the \code{\back kbd} command if you are spelling out the letters you type; for example:\refill \begin{example} To give the \back code\{logout\} command, type the characters \back kbd\{l o g o u t \back key\{RET\}\}. \end{example} \noindent This produces \begin{quote} To give the \code{logout} command, type the characters \kbd{l o g o u t \key{RET}}. \end{quote} (Also, this example shows that you can add spaces for clarity. If you really want to mention a space character as one of the characters of input, write \kbd{\back key\{SPC\}} for it.)\refill \node key, Ctrl, kbd, Indicating \subsection{\protect\code{\protect\back key}\protect\{\protect\var{key-name}\protect\}} \findex{key} Use the \code{\back key} command for the conventional name for a key on a keyboard, as in\refill \begin{example} \back key\{RET\} \end{example} You can use the \code{\back key} command within the argument of an \code{\back kbd} command when the sequence of characters to be typed includes one or more keys that are described by name.\refill For example, to produce \kbd{C-x \key{ESC}} you would type:\refill \begin{example} \back kbd\{C-x \back key\{ESC\}\} \end{example} The recommended names to use for keys are in upper case and are\refill \cindex{Recommended names for keys} \cindex{Keys, recommended names} \cindex{Names recommended for keys} \cindex{Abbreviations for keys} \begin{description} \item[SPC] Space \item[RET] Return \item[LFD] Linefeed \item[TAB] Tab \item[BS] Backspace \item[ESC] Escape \item[DEL] Delete \item[SFT] Shift \item[CTL] Control \item[META] Meta \end{description} There are subtleties to handling words like `meta' or `ctl' that are names of shift keys. When mentioning a character in which the shift key is used, such as \kbd{Meta-a}, use the \code{\back kbd} command alone without the \code{\back key} command, but when you are referring to the shift key in isolation, use the \code{\back key} command. For example, write \samp{\back kbd\{Meta-a\}} to produce \kbd{Meta-a} and \samp{\back key\{META\}} to produce \key{META}. This is because \kbd{Meta-a} refers to keys that you press on a keyboard, but \key{META} refers to a key without implying that you press it.\refill \cindex{META key} \node Ctrl, samp, key, Indicating \subsection{Ctrl} \cindex{Ctrl} \findex{ctrl} \code{\back ctrl} is used to describe an ASCII control character. The pattern of usage is \code{\back ctrl\{\var{ch}\}}, where \var{ch} is an ASCII character whose control-equivalent is wanted. Thus you put in an \samp{f} when you want to indicate a \samp{control-f}. For example, to specify \samp{control-f}, you would enter \begin{example} \back ctrl\{f\} \end{example} \noindent which produces \begin{quotation} \ctrl{f} \end{quotation} \noindent In the Info file, this generates the specified control character, output literally into the file. This is done so a user can copy the specified control character (along with whatever else he or she wants) into another Emacs buffer and use it. Since the `control-h',`control-i', and `control-j' characters are formatting characters, they should not be indicated this way.\refill In a printed manual, this generates text to describe or identify that control character: an uparrow followed by the character \var{ch}. \node samp, var, Ctrl, Indicating \subsection{\protect\code{\protect\back samp}\protect\{\protect\var{text}\protect\}} \findex{samp} Use the \code{\back samp} command to indicate text that is a literal example of a sequence of characters in a file, string, pattern, etc. Enclose the text in braces. The argument appears within `\dots{}' quotation in both the Info file and the printed manual; in addition, it is printed in a fixed-width font.\refill \begin{example} To match \back samp\{foo\} at the end of the line, use the regexp \back samp\{foo$\}. \end{example} \noindent produces \begin{quote} To match \samp{foo} at the end of the line, use the regexp \samp{foo$}.\refill \end{quote} \code{\back samp} is used for entire statements in C, for entire shell commands, and for names of command-line options. Use it for buffer names in Emacs and for node names in Info or LaTeXinfo. Often \code{\back samp} is a catchall for whatever is not covered by \code{\back code}, \code{\back kbd}, or \code{\back key}.\refill Only include punctuation marks within braces if they are part of the string you are specifying. Write punctuation marks outside the braces if those punctuation marks are part of the English text that surrounds the string. In the following sentence, for example, the commas and period are outside of the braces:\refill \begin{example} \begin{same} In English, the vowels are \back samp\{a\}, \back samp\{e\}, \back samp\{i\}, \back samp\{o\}, \back samp\{u\}, and sometimes \back samp\{y\}. \end{same} \end{example} \noindent This produces: \begin{quote} In English, the vowels are \samp{a}, \samp{e}, \samp{i}, \samp{o}, \samp{u}, and sometimes \samp{y}. \end{quote} \node var, file, samp, Indicating \subsection{\protect\code{\protect\back var}\protect\{\protect\var{metasyntactic-variable}\protect\}} \findex{var} Use the \code{\back var} command to indicate metasyntactic variables. A metasyntactic variable is something that stands for another piece of text. For example, you should use a metasyntactic variable in the documentation of a function to describe the arguments that are passed to that function.\refill Do not use \code{\back var} for the names of particular variables in programming languages. These are specific names from a program, so \code{\back code} is correct for them. For example, the Lisp variable \code{latexinfo-latex-command} is not a metasyntactic variable; it is properly formatted using \code{\back code}.\refill The effect of \code{\back var} in the Info file is to upcase the argument; in the printed manual, to italicize it. For example:\refill \begin{example} To delete file \back var\{filename\}, type \back code\{rm \back var\{filename\}\}. \end{example} \noindent produces \begin{quote} To delete file \var{filename}, type \code{rm \var{filename}}. \end{quote} \noindent (Note that \code{\back var} may appear inside of \code{\back code}, \code{\back samp}, \code{\back file}, etc.)\refill Write a metasyntactic variable all in lower case without spaces, and use hyphens to make it more readable. In some documentation styles, metasyntactic variables are shown with angle brackets, for example:\refill \begin{example} \dots{}, type rm \end{example} \noindent Although this is not the style we use in \LaTeX info, you can, of course, write your own \LaTeX info formatting commands to output the \code{<\dots{}>} format if you wish. \xref{Extending LaTeXinfo}.\refill \node file, dfn, var, Indicating \subsection{\protect\code{\protect\back file}\protect\{\protect\var{file-name}\protect\}} \findex{file} Use the \code{\back file} command to indicate text that is the name of a file, buffer, or directory, or is the name of a node in Info. You can also use the command for filename suffixes. Don't use \code{\back file} for symbols in a programming language; thus, a node name is a name in an Info file but not an identifier in a programming language. Currently, \code{\back file} is equivalent to \code{\back samp} in its effects on the output. For example,\refill \begin{example} The \back file\{.el\} files are in the \back file\{/usr/local/emacs/lisp\} directory. \end{example} \noindent produces \begin{quote} The \file{.el} files are in the \file{/usr/local/emacs/lisp} directory. \end{quote} \node dfn, Emphasis, file, Indicating \subsection{\protect\code{\protect\back dfn}\protect\{\protect\var{term}\protect\}} \findex{dfn} Use the \code{\back dfn} command to identify the introductory or defining use of a technical term. Use the command only in passages whose purpose is to introduce a term which will be used again or which the reader ought to know. Mere passing mention of a term for the first time doesn't deserve \code{\back dfn}. The command generates italics in the printed manual, and double quotation marks in the Info file. For example:\refill \begin{example} Getting rid of a file is called \back dfn\{deleting\} it. \end{example} \noindent produces \begin{quote} Getting rid of a file is called \dfn{deleting} it. \end{quote} As a general rule, a sentence containing the defining occurrence of a term should be a definition of the term. The sentence does not have to say explicitly that it is a definition, but it should contain the information of a definition---it should make the meaning clear. \node Emphasis, emph & strong, dfn, Marking Text \section{Emphasizing Text} \cindex{Emphasizing text} Usually, \LaTeX info changes the font to mark words in the text according to what category the words belong to. The \code{\back code} command, for example, does this. Most often, this is the best way to mark words. However, sometimes you will want to emphasize text without indicating a category. \LaTeX info has two ways to do this: commands that tell \LaTeX info to emphasize the text but leave the method to the program, and commands that specify the method to use. The first way is generally the best because it makes it possible to change the style of a document without needing to re-edit it line by line.\refill \begin{menu} * emph & strong:: How to emphasize text in LaTeXinfo. * Smallcaps:: How to use the small caps font. * Fonts:: Various font commands for printed output. \end{menu} \node emph & strong, Smallcaps, Emphasis, Emphasis \subsection{\protect\code{\protect\back emph}\protect\{\protect\var{text}\protect\} and \protect\code{\protect\back strong}\protect\{\protect\var{text}\protect\}} \cindex{Emphasizing text, font for} \findex{emph} \findex{strong} The \code{\back emph} and \code{\back strong} commands are for emphasis; \code{\back strong} is stronger. In printed output, \code{\back emph} produces \emph{italics} and \code{\back strong} produces \strong{bold}.\refill For example, \begin{example} \back begin\{quote\} \back strong\{Caution:\} \back code\{rm * .[^.]*\} removes \back emph\{all\} files in the directory. \back end\{quote\} \end{example} \begin{iftex} \noindent produces the following in printed output: \begin{quote} \strong{Caution}: \code{rm * .[^.]*} removes \emph{all} files in the directory. \end{quote} \noindent and the following in Info: \end{iftex} \begin{ifinfo} \noindent produces: \end{ifinfo} \begin{example} *Caution*: `rm * .[^.]*' removes *all* files in the directory. \end{example} The \code{\back strong} command is seldom used except to mark what is, in effect, a typographical element, such as the word `Caution' in the preceding example.\footnote{Don't try to use \code{\back emph} or \code{\back strong} with the word \samp{Note}; Info will mistake the combination for a cross reference. Use a phrase such as \emph{Please note} or \emph{Caution} instead.}\refill In the Info file, both \code{\back emph} and \code{\back strong} put asterisks around the text.\refill \node Smallcaps, Fonts, emph & strong, Emphasis \subsection{The Small Caps Font} \cindex{Small caps font} \findex{scap \r{(small caps font)}} \begin{iftex} Use the \samp{\back scap} command to set text in the printed output in \scap{a small caps font} and set text in the Info file in upper case letters.\refill \end{iftex} \begin{ifinfo} Use the \samp{\back scap} command to set text in the printed output in a small caps font and set text in the Info file in upper case letters.\refill \end{ifinfo} Write the text between braces in lower case, like this:\refill \begin{example} The \back sc\{acm\} and \back sc\{ieee\} are technical societies. \end{example} \noindent This produces: \begin{display} The \scap{acm} and \scap{ieee} are technical societies. \end{display} \LaTeX{} typesets the small caps font in a manner that prevents the letters from `jumping out at you on the page'. This makes small caps text easier to read than text in all upper case.\refill \begin{ifinfo} \LaTeX{} typesets any upper case letters in the small caps fonts in full-size capitals. Use them sparingly.\refill \end{ifinfo} \begin{iftex} \LaTeX{} typesets any upper case letters in the small caps fonts in \scap{FULL-SIZE CAPITALS}. Use them sparingly.\refill \end{iftex} The Info formatting commands set all small caps text in upper case.\refill You may also use the small caps font for acronyms such as \scap{ato} (a \scap{nasa} word meaning `abort to orbit').\refill There are subtleties to using the small caps font with a jargon word such as \scap{cdr}, a word used in Lisp programming. In this case, you should use the small caps font when the word refers to the second and subsequent elements of a list (the \scap{cdr} of the list), but you should use \samp{\back code} when the word refers to the Lisp function of the same spelling.\refill \node Fonts, Insertions, Smallcaps, Emphasis \subsection{Fonts for Printing, Not Info} \cindex{Fonts for printing, not Info} \findex{i \r{(italic font)}} \findex{b \r{(bold font)}} \findex{t \r{(typewriter font)}} \findex{r \r{(Roman font)}} \findex{n (normalsize font)} \LaTeX info provides four font commands that specify font changes in the printed manual but have no effect in the Info file. \code{\back i} requests \i{italic} font (in some versions of \LaTeX, a slanted font is used), \code{\back b} requests \b{bold} face, \code{\back t} requests the \t{fixed-width} font used by \code{\back code}, and \code{\back r} requests a \r{roman} font, which is the usual font in which text is printed. In addition \code{\back n} requests the fontsize be set in the normal size of the typeface, All the commands apply to an argument that follows, surrounded by braces. All four commands apply to an argument that follows, surrounded by braces.\refill Only the \code{\back r} command has much use: in example programs, you can use the \code{\back r} command to convert code comments from the fixed-width font to a roman font. This looks better in printed output.\refill For example, \begin{example} \begin{same} \back begin\{lisp\} (+ 2 2) ; \back r\{Add two plus two.\} \back end\{lisp\} \end{same} \end{example} \noindent produces \begin{lisp} (+ 2 2) ; \r{Add two plus two.} \end{lisp} If possible, you should avoid using the other three font commands. If you need to use one, it probably indicates a gap in the \LaTeX info language.\refill \node Insertions, Braces Atsigns Periods, Fonts, Marking Text \section{Special Insertions} \cindex{Inserting special characters and symbols} \cindex{Special insertions} \LaTeX info provides several commands for formatting dimensions, for inserting single characters that have special meaning in \LaTeX info, such as braces, and for inserting special graphic symbols that do not correspond to characters, such as dots and bullets.\refill \begin{iftex} These are: \begin{itemize} \item Braces, \samp{\back } and periods. \item Format a dimension, such as \samp{12\dmn{pt}}. \item Dots and bullets. \item The \LaTeX{} logo and the copyright symbol. \item A minus sign. \item The \code{\back verb} command, for inserting characters verbatim. \end{itemize} \end{iftex} \begin{menu} * Braces Atsigns Periods:: How to insert braces, \samp{\back } and periods. * dmn:: How to format a dimension. * Dots Bullets:: How to insert dots and bullets. * LaTeX and copyright:: How to insert the \LaTeX{} logo and the copyright symbol. * minus:: How to insert a minus sign. * Inserting Characters Verbatim:: \end{menu} \node Braces Atsigns Periods, Inserting An Atsign, Insertions, Insertions \subsection{Inserting \protect\code{\protect\back }, Braces, and Periods} \cindex{Inserting \back , braces, and periods} \cindex{Braces, inserting} \cindex{Periods, inserting} \cindex{Single characters, commands to insert} \cindex{Commands to insert single characters} \samp{\back } and curly braces are special characters in LaTeXinfo. Periods are also special. Depending on whether the period is inside of or at the end of a sentence, less or more space is inserted after a period in a typeset manual. Since it is not always possible for \LaTeX info to determine when a period ends a sentence and when it is used in an abbreviation, special commands are needed in some circumstances. (Usually, \LaTeX info can guess how to handle periods, so you don't have to use the special commands; you just enter a period as you would if you were using a typewriter, which means you put two spaces after the period, question mark, or exclamation mark that ends a sentence.) Do not put braces after any of these commands; they are not necessary.\refill \begin{menu} * Inserting An Atsign:: * Inserting Braces:: Inserting \samp{\{} and \samp{\}}---\back \{ and \back \} * Controlling Spacing:: \end{menu} \node Inserting An Atsign, Inserting Braces, Braces Atsigns Periods, Braces Atsigns Periods \subsubsection{Inserting \protect\code{\protect\back }---\protect\back back} \findex{\back \r{(single \samp{\back })}} \code{\back back} stands for a single \samp{\back } in either printed or Info output.\refill Do not put braces after an \code{\back back} command.\refill \node Inserting Braces, Controlling Spacing, Inserting An Atsign, Braces Atsigns Periods \subsubsection{Inserting \protect\samp{\protect\{} and \protect\samp{\protect\}}---\protect\back \protect\{ and \protect\back \protect\}} \findex{\{ \r{(single \samp{\{})}} \findex{\} \r{(single \samp{\}})}} \code{\back \{} stands for a single \samp{\{} in either printed or Info output.\refill \code{\back \}} stands for a single \samp{\}} in either printed or Info output.\refill Do not put braces after either an \code{\back \{} or an \code{\back \}} command.\refill \node Controlling Spacing, dmn, Inserting Braces, Braces Atsigns Periods \subsubsection{Spacing After Colons and Periods} \findex{: \r{(suppress widening)}} Use the \code{\back :}\: command after a period, question mark, exclamation mark, or colon that should not be followed by extra space. For example, use \code{\back :}\: after periods that end abbreviations which are not at the ends of sentences. \code{\back :}\: has no effect on the Info file output.\refill For example:\refill \begin{example} The U.S.A.\back : is a continental nation. \end{example} \noindent produces \begin{quote} The U.S.A.\: is a continental nation. \end{quote} \findex{. \r{(true end of sentence)}} Use \code{\back .}\: instead of a period at the end of a sentence that ends with a single capital letter. Otherwise, \LaTeX{} will think the letter is an abbreviation and will not insert the correct end-of-sentence spacing. Here is an example:\refill \begin{example} Give it to X. and to Y\back . Give it to Z\back . Give it to X. and to Y. Give it to Z. \end{example} \noindent \begin{ifinfo} produces \end{ifinfo} \begin{iftex} If you look carefully at this printed output, you will see a little more whitespace after the Y in the first line than the Y in the second line.\refill \end{iftex} \begin{quote} Give it to X. and to Y\. Give it to Z\.\* Give it to X. and to Y. Give it to Z. \end{quote} In the Info file output, \code{\back .}\: is equivalent to a simple \samp{.}. Do not put braces after either an \code{\back :} or an \code{\back .} command.\refill \node dmn, Dots Bullets, Controlling Spacing, Insertions \subsection{\protect\code{\protect\back dmn}\protect\{\protect\var{dimension}\protect\}: Format a Dimension} \cindex{Thin space between number and dimension} \cindex{Dimension formatting} \cindex{Format a dimension} \findex{dmn} At times, you may want to write \samp{12\dmn{pt}} or \samp{8.5\dmn{in}} with little or no space between the number and the abbreviation for the dimension. You can use the \code{\back dmn} command to do this. On seeing the command, \LaTeX{} inserts just enough space for proper typesetting; the Info formatting commands insert no space at all, since the Info file does not require it. To use the \code{\back dmn} command, write the number and then follow it immediately, with no intervening space, by \code{\back dmn}, and then by the dimension within braces.\refill For example,\refill \begin{example} A4 paper is 8.27\back dmn\{in\} wide. \end{example} \noindent produces \begin{example} A4 paper is 8.27\dmn{in} wide. \end{example} Not everyone uses this style. Instead of \samp{8.27\dmn{in}}, you may write \samp{8.27 in.} or \samp{8.27 inches}.\refill \node Dots Bullets, LaTeX and copyright, dmn, Insertions \subsection{Inserting Ellipsis, Dots, and Bullets} \cindex{Dots, inserting} \cindex{Bullets, inserting} \cindex{Ellipsis, inserting} \cindex{Inserting ellipsis} \cindex{Inserting dots} \cindex{Special typesetting commands} \cindex{Typesetting commands for dots, etc.} An \dfn{ellipsis} (a line of dots) is typeset unlike a string of periods, so a special command is used for ellipsis in LaTeXinfo. The \code{\back bullet} command is special, too. Each of these commands is followed by a pair of braces, \samp{\{\}}, without any whitespace between the name of the command and the braces.\refill \begin{menu} * dots:: Inserting dots \dots{} * bullet:: Inserting a bullet. \end{menu} \node dots, LaTeX and copyright, Dots Bullets, Insertions \paragraph*{\protect\code{\protect\back dots}\protect\{\protect\}} \findex{dots} \cindex{Inserting dots} \cindex{Dots, inserting} Use the \code{\back dots\{\}} command to generate an ellipsis, which is three dots in a row, appropriately spaced, like this: `\dots{}'. Do not simply write three periods in the input file; that would work for the Info file output, but would produce the wrong amount of space between the periods in the printed manual.\refill \begin{iftex} Here is an ellipsis: \dots{} Here are three periods in a row: ... In printed output, the three periods in a row are closer together than the dots in the ellipsis. \end{iftex} \node bullet, LaTeX and copyright, Dots Bullets, Insertions \paragraph*{\protect\code{\protect\back bullet}\protect\{\protect\}} \findex{bullet} Use the \code{\back bullet\{\}} command to generate a large round dot, or the closest possible thing to one. In Info, an asterisk is used.\refill Here is a bullet: \bullet{} \node LaTeX and copyright, minus, Dots Bullets, Insertions \subsection{Inserting \protect\LaTeX{} and the Copyright Symbol} The logo \LaTeX{} is typeset in a special fashion and it needs an \back -command, as does the command for inserting the copyright symbol. Each of these commands is followed by a pair of braces, \samp{\{\}}, without any whitespace between the name of the command and the braces.\refill \begin{menu} * LaTeX:: Insert the \LaTeX{} logo. * copyright symbol:: \code{\back copyright}\{\} \end{menu} \node LaTeX, minus, LaTeX and copyright, Insertions \paragraph*{\protect\code{\protect\back LaTeX}\protect\{\protect\}} \findex{LaTeX} Use the \code{\back LaTeX\{\}} command to generate `\LaTeX{}'. In a printed manual, this is a special logo that is different from three ordinary letters. In Info, it just looks like \samp{LaTeX}. The \code{\back LaTeX\{\}} command is amongst the few \LaTeX info commands in that the \key{L}, \key{T} and the \key{X} are in upper case.\refill \node copyright symbol, minus, LaTeX and copyright, Insertions \paragraph*{\protect\code{\protect\back copyright}\protect\{\protect\}} \findex{copyright} Use the \code{\back copyright\{\}} command to generate `\copyright\ '. In a printed manual, this is a \samp{c} inside a circle, and in Info, this is \samp{(C)}.\refill \node minus, Inserting Characters Verbatim, LaTeX and copyright, Insertions \subsection{Inserting a Minus Sign} \findex{minus} Use the \code{\back minus\{\}} command to generate a minus sign. In a fixed-width font, this is a single hyphen, but in a proportional font, the symbol is the customary length for a minus sign---a little longer than a hyphen.\refill You can compare the two forms: \begin{display} \samp{\minus{}} is a minus sign generated with \samp{\back minus\{\}}, \samp{-} is a hyphen generated with the character \samp{-}. \end{display} \noindent In the fixed-width font used by Info, \code{\back minus\{\}} is the same as a hyphen.\refill You should not use \code{\back minus\{\}} inside of \code{\back code} or \code{\back begin\{example\}} because the width distinction is not made in the fixed-width font they use.\refill \node Inserting Characters Verbatim, Displaying Material, minus, Insertions \subsection{Inserting Characters Verbatim} \findex{verb} You can use the \LaTeX\ \code{\back verb} command to inserting characters verbatim. The next character after the command must be a non-alphabetic or numeric character, such as \samp{+}. Any characters between this marker character, and the next occurence of this marker character, will be protected from any operations in \LaTeX\ or Info. The contents will be displayed in a fixed-width font. Unlike \LaTeX, \LaTeX info has a restriction on the use of the \code{\back verb} command: it must occur at the beginning of a line ( or preceded only by whitespace). Hence you will usually use it something like: \begin{verbatim} characters to \scap{ascii} double-quotes: \verb+``+ and \verb+''+ to \samp{"}.\refill \end{verbatim} \node Displaying Material, Quotations, Inserting Characters Verbatim, Top \chapter{Displaying Material} Displayed Material are blocks of text consisting of one or more whole paragraphs that are set off from the bulk of the text and treated differently. They are usually indented.\refill In \LaTeX info, you always begin a quotation or example by writing an \code{\back begin}-command at the beginning of a line by itself, and end it by writing an \code{\back end} command that is also at the beginning of a line by itself. For instance, you begin an example by writing \code{\back begin\{example\}} by itself at the beginning of a line and end the example by writing \code{\back end\{example\}} on a line by at itself, at the beginning of that line.\refill \findex{end} Since the lines containing \code{\back begin\{example\}} and \code{\back end\{example\}} will be turned into blank lines, you won't need to put a blank line before the \code{\back begin\{example\}}, and another blank line after the \code{\back end\{example\}}. (Remember that blank lines between the beginning \code{\back begin\{example\}} and the ending \code{\back end\{example\}} will also appear in the Info output.)\refill There are a variety of commands for Displaying Material:\refill \begin{description} \item[\back begin\{quote\}] Used to indicate text that is quoted. The text is filled, and printed in a roman font by default.\refill \item[\back begin\{quotation\}] Used to indicate text that is quoted. The text is filled, indented, and printed in a roman font by default.\refill \item[\back begin\{display\}] Used for illustrative text. The text is indented but not filled, and no font is specified (so, by default, the font is roman).\refill \item[\back begin\{format\}] Used for illustrative text. The text is not indented and not filled and no font is specified (so, by default, the font is roman).\refill \item[\back begin\{center\}] Used to center a body of text. \item[\back begin\{flushleft\}] Used to line up the left margin of unfilled text. \item[\code{\back begin\{flushright\}}] Used to line up the right margin of unfilled text. \item[\back begin\{lisp\}] Used to illustrate Lisp code. The text is printed in a fixed-width font without filling.\refill \item[\back begin\{smalllisp\}] Used to illustrate Lisp code. The text is printed in a smaller fixed-width font.\refill \item[\back begin\{example\}] Used to illustrate code, and commands. The text is printed in a fixed-width font without filling.\refill \item[\back begin\{smallexample\}] Used to illustrate code, commands, and the like, in a smaller font.\refill \item[\back begin\{verbatim\}] Used to illustrate code and commands, but the text is protected from processing by \LaTeX{} and Info, and is printed in a fixed-width font without filling.\refill \item[\back begin\{smallverbatim\}] Used to illustrate code, commands, and the like. The content is protected from processing by \LaTeX{} and Info, and is set in a smaller font.\refill \end{description} The \code{\back exdent} command is used within the above constructs (except of course for the \code{verbatim} ones) to undo the indentation of a line.\refill The \code{\back noindent} command may be used after one of the above constructs to prevent the following text from being indented as a new paragraph.\refill \begin{menu} * Quotations:: * Justifying Text:: * Display Environments:: * Examples and Verbatim:: * Controlling Indentation:: * cartouche:: Drawing Cartouches Around Examples * Special Glyphs:: Special Glyphs for Examples * Conditionals:: Conditionally Visible Text \end{menu} \node Quotations, quotation, Displaying Material, Displaying Material \section{Quotations} \begin{menu} * quotation:: \protect\code{\protect\back begin\protect\{quote\protect\}} \end{menu} \node quotation, Justifying Text, Quotations, Quotations \subsection{Quotations} \cindex{Quotations} \findex{quote} \findex{quotation} The text of a quote is processed normally except that\refill \begin{itemize} \item The margins are closer to the center of the page, so the whole of the quotation is offset.\refill \item The first lines of paragraphs are indented no more than the other lines.\refill \item In the printed output, interline spacing and interparagraph spacing are reduced.\refill \end{itemize} \begin{quote} This is an example of text written between an \code{\back begin\{quote\}} command and an \code{\back end\{quote\}} command. A \code{\back begin\{quote\}} command is most often used to indicate text that is excerpted from another (real or hypothetical) printed work. \end{quote} Write an \code{\back begin\{quote\}} command as text of a line by itself. This line will disappear from the output. Mark the end of the quotation with a line beginning with and containing only \code{\back end\{quote\}}. The \code{\back end\{quote\}} line will likewise disappear from the output. Thus, the input\refill \begin{example} \back begin\{quote\} This is a foo. \back end\{quote\} \end{example} \noindent produces \begin{quote} \begin{quote} This is a foo. \end{quote} \end{quote} \findex{quotation} The text of a \code{\back begin\{quotation\}} environment is processed the same way, except that the first line of the text is indented.\refill \node Justifying Text, flushleft & flushright, quotation, Displaying Material \section{Justifying Text} \begin{menu} * flushleft & flushright:: Left Justification and Right Justification \end{menu} \node flushleft & flushright, Center Environment, Justifying Text, Justifying Text \subsection{Left Justification and Right Justification} \findex{flushleft} \findex{flushright} The \code{\back begin\{flushleft\}} and \code{\back begin\{flushright\}} commands line up the left or right ends of lines on the left and right margins of a page, but do not fill the text. The commands are written on lines of their own, without braces. The \code{\back begin\{flushleft\}} and \code{\back begin\{flushright\}} commands are ended by \code{\back end\{flushleft\}} and \code{\back end flushright} commands on lines of their own.\refill For example, \begin{example} \begin{same} \back begin\{flushleft\} This text is written flushleft. \back end\{flushleft\} \end{same} \end{example} \noindent produces \begin{quote} \begin{flushleft} This text is written flushleft. The \back code\{\back begin\{flushleft\}\}\\ command left justifies every line but leaves the\\ right end ragged. \end{flushleft} \end{quote} \noindent Flushright produces the type of indentation often used in the return address of letters.\refill \begin{example} \begin{same} \back begin\{flushright\} Here is an example of text written flushright. The \back code\{\back begin\{flushright\}\} command right justifies every line but leaves the left end ragged. \back end\{flushright\} \end{same} \end{example} \noindent produces \begin{flushright} Here is an example of text written flushright. The \code{\back begin\{flushright\}} command right justifies every line but leaves the left end ragged. \end{flushright} \begin{menu} * Center Environment:: \end{menu} \node Center Environment, Display Environments, flushleft & flushright, flushleft & flushright \subsubsection{Center Environment} \cindex{Center Environment} \cindex{Centering a line} \findex{center} Text enclosed in a \code{center} environment produces lines of output containing text centered between the margins. This is the same as the \code{center} environment of \LaTeX, and different from the \TeX info command of the same name. \node Display Environments, display, Center Environment, Displaying Material \section{Display Environments} \begin{menu} * display:: \protect\code{\protect\back begin\protect\{display\protect\}} * format:: \protect\code{\protect\back begin\protect\{format\protect\}} \end{menu} \node display, format, Display Environments, Display Environments \subsection{\protect\code{\protect\back begin\protect\{display\protect\}}} \cindex{Display formatting} \findex{display} The \code{\back begin\{display\}} command begins a kind of example. It is like the \code{\back begin\{example\}} command except that, in a printed manual, \code{\back begin\{display\}} does not select the fixed-width font. In fact, it does not specify the font at all, so that the text appears in the same font it would have appeared in without the \code{\back begin\{display\}} command.\refill \begin{display} This is an example of text written between an \code{\back begin\{display\}} command and an \code{\back end\{display\}} command. The \code{\back begin\{display\}} command indents the text, but does not fill it. \end{display} \node format, Examples and Verbatim, display, Display Environments \subsection{\protect\code{\protect\back begin\protect\{format\protect\}}} \findex{format} The \code{\back begin\{format\}} command is similar to \code{\back begin\{example\}} except that, in the printed manual, \code{\back begin\{format\}} does not select the fixed-width font and does not narrow the margins.\refill \begin{format} This is an example of text written between an \code{\back begin\{format\}} command and an \code{\back end\{format\}} command. The \code{\back begin\{format\}} command does not fill the text. \end{format} \node Examples and Verbatim, example, format, Displaying Material \section{Examples and Verbatim} \begin{menu} * example:: \protect\code{\protect\back begin\protect\{example\protect\}} * noindent:: \protect\code{\protect\back noindent} * Lisp Example:: \protect\code{\protect\back begin\protect\{lisp\protect\}} * Verbatim Environment:: \end{menu} \node example, noindent, Examples and Verbatim, Examples and Verbatim \subsection{\protect\code{\protect\back begin\protect\{example\protect\}}} \cindex{Examples} \cindex{Formatting examples} \findex{example} The \code{\back begin\{example\}} command is used to indicate an example that is not part of the running text, such as computer input or output.\refill \begin{example} This is an example of text written between an \code{\back begin\{example\}} command and an \code{\back end\{example\}} command. The text is indented but not filled. In the printed manual, the text is typeset in a fixed-width font, and extra spaces and blank lines are significant. In the Info file, an analogous result is obtained by indenting each line with five extra spaces. \end{example} Write an \code{\back begin\{example\}} command at the beginning of a line (or possibly preceded by whitespace) as the only text on a line by itself. This line will turn into a blank line in the Info output. Mark the end of the example with a line beginning containing only \code{\back end\{example\}} (or possibly preceded by whitespace). The \code{\back end\{example\}} will likewise turn into a blank line in the Info output. For example:\refill \begin{example} \back begin\{example\} mv foo bar \back end\{example\} \end{example} \noindent produces \begin{example} mv foo bar \end{example} \begin{quote} \strong{Caution:} Do not use tabs in lines of an example (or anywhere else in \LaTeX info, for that matter)! \LaTeX{} treats tabs like single spaces, and that is not what they look like. This is a problem with \LaTeX. (If necessary, in Emacs, you can use \kbd{M-x untabify} to convert tabs in a region to multiple spaces.)\refill \end{quote} Examples are often, logically speaking, ``in the middle'' of a paragraph, and the text continues after an example should not be indented. The \code{\back noindent} command prevents a piece of text from being indented as if it were a new paragraph.\refill (The \code{\back code} command is used for examples of code that is embedded within sentences, not set off from preceding and following text. \xref{code, , \code{\back code}}.) \node noindent, Lisp Example, example, Examples and Verbatim \subsection{\protect\code{\protect\back noindent}} \findex{noindent} If you have text following an \code{\back begin\{example\}} or other similar inclusion that reads as a continuation of the text before the \code{\back begin\{example\}}, it is good to prevent this text from being indented as a new paragraph. To accomplish this, write \code{\back noindent} at the beginning of a line by itself preceding the continuation text. For example,\refill \begin{example} \back begin\{example\} This is an example \back end\{example\} \back noindent This line will not be indented. As you can see, the beginning of the line is fully flush left with the line that follows after it. (This whole example is between \code{\back begin\{display\}} and \code{\back end\{display\}}.) \end{example} \noindent produces \begin{display} \begin{example} This is an example \end{example} \noindent This line will not be indented. As you can see, the beginning of the line is fully flush left with the line that follows after it. (This whole example is between \code{\back begin\{display\}} and \code{\back end\{display\}}.) \end{display} To adjust the number of blank lines properly in the Info file output, remember that the line containing \code{\back noindent} does not generate a blank line, and neither does the \code{\back end\{example\}} line.\refill In the \LaTeX info source file for this documentation, each of the lines that says `produces' is preceded by a line containing \code{\back noindent}. Do not put braces after an \code{\back noindent} command.\refill The \code{smallexample} environment sets its contents in a smaller font. \node Lisp Example, Verbatim Environment, noindent, Examples and Verbatim \subsection{\protect\code{\protect\back begin\protect\{lisp\protect\}}} \cindex{Lisp example} \findex{lisp} The \code{\back begin\{lisp\}} command is used for Lisp code. It is synonymous with the \code{\back begin\{example\}} command. \begin{lisp} This is an example of text written between an \code{\back begin\{lisp\}} command and an \code{\back end\{lisp\}} command. \end{lisp} Use \code{\back begin\{lisp\}} instead of \code{\back begin\{example\}} so as to preserve information regarding the nature of the example. This is useful, for example, if you write a function that evaluates only and all the Lisp code in a \LaTeX info file. Then you can use the \LaTeX info file as a Lisp library.\footnote{It would be straightforward to extend \LaTeX info to work in a similar fashion for C, Fortran, or other languages.}\refill Mark the end of \code{\back begin\{lisp\}} with \code{\back end\{lisp\}} on a line by itself.\refill The \code{smalllisp} environment sets its contents in a smaller font. \node Verbatim Environment, Controlling Indentation, Lisp Example, Examples and Verbatim \subsection{Verbatim Environment} \cindex{Verbatim Environment} \cindex{Including text verbatim} \findex{verbatim} \findex{verbatimfile} \findex{smallverbatim} The \code{verbatim} environment is very similar to the \code{example} environment except that no parsing of the contents is carried out, and the text is not indented. In the Info file things will appear exactly as they have been typed in. In the printed manual, this is the same as the \LaTeX\ command of the same name. Verbatim environments cannot be nested, nor can they appear inside another environment such as \code{example}. The \code{\back begin\{verbatim\}} and \code{\back end\{verbatim\}} \emph{must} occur at the beginning of a line.\refill The \code{smallverbatim} environment sets its contents in a smaller font. The \code{verbatimfile} command includes the contents of a file with a \code{verbatim} environment. The command is followed by an \code{\back end\{verbatim\}} command, such as\refill \begin{smallverbatim} \verbatimfile{foo.bar} \end{verbatim} \end{smallverbatim} The \code{smallverbatimfile} command sets its argument in a smaller font, and is terminated by an \code{\back end\{smallverbatim\}} command. \node Controlling Indentation, exdent, Verbatim Environment, Displaying Material \section{Controlling Indentation} \begin{menu} * exdent:: \protect\code{\protect\back exdent}: Undoing a Line's Indentation \end{menu} \node exdent, cartouche, Controlling Indentation, Controlling Indentation \subsection{exdent: Undoing a Line's Indentation} \cindex{Indentation undoing} \findex{exdent} The \code{\back exdent} command removes any indentation a line might have. The command is written at the beginning of a line and applies only to the text that follows the command that is on the same line. Don't use braces around the text. In the printed manual, the text on the \code{\back exdent} line is printed in the roman font.\refill \code{\back exdent} is usually used within examples. Thus,\refill \begin{example} \begin{same} \back begin\{example\} This line follows an \back begin\{example\} command. \back exdent\{This line is exdented.\} This line follows the exdented line. The \back end\{example\} comes on the next line. \back end\{example\} \end{same} \end{example} \noindent produces \begin{example} \begin{same} This line follows an \back begin\{example\} command. \exdent{This line is exdented.} This line follows the exdented line. The \back end\{example\} comes on the next line. \end{same} \end{example} In practice, the \code{\back exdent} command is rarely used. Usually, you un-indent text by ending the example and returning the page to its normal width.\refill \node cartouche, Special Glyphs, exdent, Displaying Material \section{Drawing Cartouches Around Examples} \findex{cartouche} \cindex{Box with rounded corners} In a printed manual, the \code{cartouche} environment draws a box with rounded corners around its contents. Pair with \code{\back end\{cartouche\}}. You can use this command to further highlight an example or quotation. For instance, you could write a manual in which one type of example is surrounded in a cartouche to emphasize them.\refill The \code{\back cartouche} command affects only the printed manual; it has no effect in the Info file.\refill For example, \begin{example} \begin{same} \back begin\{example\} \back cartouche % pwd /usr/local/lib/emacs/info \back end\{cartouche\} \back end\{example\} \end{same} \end{example} \begin{iftex} \noindent produces \begin{example} \begin{cartouche} % pwd /usr/local/lib/emacs/info \end{cartouche} \end{example} \end{iftex} \noindent surrounds the two-line example with a box with rounded corners, in the printed manual. \node Special Glyphs, result, cartouche, Displaying Material \section{Special Glyphs for Examples} \cindex{Special glyphs} \cindex{Glyphs for examples } In \LaTeX info, code is often illustrated in examples that are delimited by \code{\back begin\{example\}} and \code{\back end\{example\}}, or by \code{\back begin\{lisp\}} and \code{\back end\{lisp\}}. In such examples, you can indicate the results of evaluation or an expansion using \samp{\result{}} or \samp{\expansion{}}. Likewise, there are special symbols to indicate printed output, an error message, equivalence of expressions, and the location of point. The special glyph commands do not have to be used within an example. Every special glyph command is followed by a pair of left- and right-hand braces.\refill \begin{menu} * result:: How to show the result of expression. * expansion:: How to indicate an expansion. * Print Special Glyph:: How to indicate printed output. * Error Special Glyph:: How to indicate an error message. * Equivalence:: How to indicate equivalence. * Point Special Glyph:: How to indicate the location of point. \end{menu} Here are the different special glyph commands:\refill \begin{description} \item[\result{}] \code{\back result\{\}} points to the result of an expression.\refill \item[\expansion{}] \code{\back expansion\{\}} shows the results of a macro expansion.\refill \item[\print{}] \code{\back print\{\}} indicates printed output.\refill \item[\error{}] \code{\back error\{\}} indicates that the following text is an error message.\refill \item[\equiv{}] \code{\back equiv\{\}} indicates the exact equivalence of two forms.\refill \item[\point{}] \code{\back point\{\}} shows the location of point.\refill \end{description} \node result, expansion, Special Glyphs, Special Glyphs \subsection{\protect\result{}: Indicating Evaluation} \cindex{Result of an expression} \cindex{Indicating evaluation} \cindex{Evaluation special glyph} \cindex{Value of an expression, indicating} Use the \code{\back result\{\}} command to indicate the result of evaluating an expression.\refill \begin{iftex} The \code{\back result\{\}} command is displayed as \samp{=>} in Info and as \samp{\result{}} in the printed output. \end{iftex} \begin{ifinfo} The \code{\back result\{\}} command is displayed as \samp{\result{}} in Info and as a double stemmed arrow in the printed output.\refill \end{ifinfo} Thus, the following, \begin{lisp} (cdr '(1 2 3)) \result{} (2 3) \end{lisp} \noindent may be read as ``\code{(cdr '(1 2 3))} evaluates to (2 3)''. \node expansion, Print Special Glyph, result, Special Glyphs \subsection{\protect\expansion{}: Indicating an Expansion} \cindex{Expansion, indicating it} When an expression is a macro call, it expands into a new expression. You can indicate the result of the expansion with the \code{\back expansion\{\}} command.\refill \begin{iftex} The \code{\back expansion\{\}} command is displayed as \samp{==>} in Info and as \samp{\expansion{}} in the printed output. \end{iftex} \begin{ifinfo} The \code{\back expansion\{\}} command is displayed as \samp{\expansion{}} in Info and as a long arrow with a flat base in the printed output.\refill \end{ifinfo} For example, the following \begin{example} \begin{same} \back begin\{lisp\} (third '(a b c)) \back expansion\{\} (car (cdr (cdr '(a b c)))) \back result\{\} c \back end\{lisp\} \end{same} \end{example} \noindent produces \begin{lisp} \begin{same} (third '(a b c)) \expansion{} (car (cdr (cdr '(a b c)))) \result{} c \end{same} \end{lisp} \noindent which may be read as: \begin{quote} \code{(third '(a b c))} expands to \code{(car (cdr (cdr '(a b c))))}; the result of evaluating the expression is \code{c}. \end{quote} (Often, as in this case, an example looks better if the \code{\back expansion\{\}} and \code{\back result\{\}} commands are indented five spaces.)\refill \node Print Special Glyph, Error Special Glyph, expansion, Special Glyphs \subsection{\protect\print{}: Indicating Printed Output} \cindex{Printed output, indicating it} Sometimes an expression will print output during its execution. You can indicate the printed output with the \code{\back print\{\}} command.\refill \begin{iftex} The \code{\back print\{\}} command is displayed as \samp{-|} in Info and as \samp{\print{}} in the printed output. \end{iftex} \begin{ifinfo} The \code{\back print\{\}} command is displayed as \samp{\print{}} in Info and similarly, as a horizontal dash butting against a vertical bar, in the printed output.\refill \end{ifinfo} In the following example, the printed text is indicated with \samp{\print{}}, and the value of the expression follows on the last line.\refill \begin{lisp} \begin{same} (progn (print 'foo) (print 'bar)) \print{} foo \print{} bar \result{} bar \end{same} \end{lisp} \noindent In a \LaTeX info source file, this example is written as follows: \begin{lisp} \begin{same} \back begin\{lisp\} (progn (print 'foo) (print 'bar)) \back print\{\} foo \back print\{\} bar \back result\{\} bar \back end\{lisp\} \end{same} \end{lisp} \node Error Special Glyph, Equivalence, Print Special Glyph, Special Glyphs \subsection{\protect\error{}: Indicating an Error Message} \cindex{Error message, indicating it} A section of code may cause an error when you evaluate it. You can designate the error message with the \code{\back error\{\}} command.\refill \begin{iftex} The \code{\back error\{\}} command is displayed as \samp{error-->} in Info and as \samp{\error{}} in the printed output. \end{iftex} \begin{ifinfo} The \code{\back error\{\}} command is displayed as \samp{\error{}} in Info and as the word `error' in a box in the printed output.\refill \end{ifinfo} Thus, \begin{example} \back begin\{lisp\} (+ 23 'x) \back error\{\} Wrong type argument: integer-or-marker-p, x \back end\{lisp\} \end{example} \noindent produces \begin{lisp} (+ 23 'x) \error{} Wrong type argument: integer-or-marker-p, x \end{lisp} \noindent This indicates that the following error message is printed when you evaluate the expression: \begin{lisp} Wrong type argument: integer-or-marker-p, x \end{lisp} Note that \samp{\error{}} itself is not part of the error message. \node Equivalence, Point Special Glyph, Error Special Glyph, Special Glyphs \subsection{\protect\equiv{}: Indicating Equivalence} \cindex{Equivalence, indicating it} Sometimes two expressions produce identical results. You can indicate the exact equivalence of two forms with the \code{\back equiv\{\}} command.\refill \begin{iftex} The \code{\back equiv\{\}} command is displayed as \samp{==} in Info and as \samp{\equiv{}} in the printed output. \end{iftex} \begin{ifinfo} The \code{\back equiv\{\}} command is displayed as \samp{\equiv{}} in Info and as a three parallel horizontal lines in the printed output.\refill \end{ifinfo} Thus, \begin{example} \back begin\{lisp\} (make-sparse-keymap) \back equiv\{\} (list 'keymap) \back end\{lisp\} \end{example} \noindent produces \begin{lisp} (make-sparse-keymap) \equiv{} (list 'keymap) \end{lisp} \noindent This indicates that evaluating \code{(make-sparse-keymap)} produces identical results to evaluating \code{(list 'keymap)}. \node Point Special Glyph, Conditionals, Equivalence, Special Glyphs \subsection{Indicating Point in a Buffer} \cindex{Point, indicating it 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.\refill You can use the \samp{\back 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 \emph{between} two characters where point is located.)\refill \begin{iftex} The \code{\back point\{\}} command is displayed as \samp{-!-} in Info and as \samp{\point{}} in the printed output. \end{iftex} \begin{ifinfo} The \code{\back point\{\}} command is displayed as \samp{\point{}} in Info and as a small five pointed star in the printed output.\refill \end{ifinfo} The following example shows the contents of buffer \file{foo} before and after evaluating a Lisp command to insert the word \code{changed}.\refill \begin{example} \begin{same} ---------- Buffer: foo ---------- This is the \point{}contents of foo. ---------- Buffer: foo ---------- \end{same} \end{example} \begin{example} \begin{same} (insert "changed ") \result{} nil ---------- Buffer: foo ---------- This is the changed \point{}contents of foo. ---------- Buffer: foo ---------- \end{same} \end{example} In a \LaTeX info source file, the example is written like this: \begin{example} \back begin\{example\} ---------- Buffer: foo ---------- This is the \back point\{\}contents of foo. ---------- Buffer: foo ---------- (insert "changed ") \back result\{\} nil ---------- Buffer: foo ---------- This is the changed \back point\{\}contents of foo. ---------- Buffer: foo ---------- \back end\{example\} \end{example} \node Conditionals, Conditional Commands, Point Special Glyph, Displaying Material \section{Conditionally Visible Text} \cindex{Conditionally visible text} \cindex{Text conditionally visible} \cindex{Visibility of conditional text} \cindex{If text conditionally visible} \findex{ifinfo} \findex{iftex} 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.\refill \begin{menu} * Conditional Commands:: Specifying text for Info or \LaTeX. * Using Ordinary LaTeX Commands:: \end{menu} \node Conditional Commands, Using Ordinary LaTeX Commands, Conditionals, Conditionals \begin{ifinfo} \subsection*{Using \protect\code{\protect\back begin\protect\{ifinfo\protect\}} and \protect\code{\protect\back begin\protect\{iftex\protect\}}} \end{ifinfo} \code{\back begin\{ifinfo\}} begins text that should be ignored by \LaTeX{} when it typesets the printed manual. The text appears only in the Info file. The \code{\back begin\{ifinfo\}} command should appear on a line by itself. End the Info-only text with a line containing \code{\back end\{ifinfo\}} by itself. The \code{\back begin\{iftex\}} and \code{\back end\{iftex\}} commands are used similarly but to delimit text that will appear in the printed manual but not in the Info file.\refill For example, \begin{example} \back begin\{iftex\} This text will appear only in the printed manual. \back end\{iftex\} \back begin\{ifinfo\} However, this text will appear only in Info. \back end\{ifinfo\} \end{example} \noindent The preceding example produces the following. 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.\refill \begin{iftex} This text will appear only in the printed manual. \end{iftex} \begin{ifinfo} However, this text will appear only in Info. \end{ifinfo} \node Using Ordinary LaTeX Commands, Lists and Tables, Conditional Commands, Conditionals \subsection{Using Ordinary \LaTeX{} Commands} \cindex{TeX commands, using ordinary} \cindex{Ordinary \LaTeX{} commands, using} \cindex{Commands using ordinary \LaTeX{}} \findex{tex} \findex{iftex} Inside a region delineated by \code{\back begin\{iftex\}} and \code{\back end\{iftex\}}, you can embed some \LaTeX{} commands. Info will ignore these commands since they are only in that part of the file that is seen by \LaTeX. You can enter \LaTeX{} completely by delineating a region with the \code{\back begin\{tex\}} and \code{\back end\{tex\}} commands. The characters \code{# $ % ^ & _ |} all revert to their normal \LaTeX\ meanings. The \code{\back begin\{tex\}} command also causes Info to ignore the region, like the \code{\back begin\{iftex\}} command.\refill For example, here is some mathematics:\refill \begin{example} \back begin\{tex\} $\back bigl(x\back in A(n)\back bigm|x\back in B(n)\back bigr)$ \back end\{tex\} \end{example} \begin{ifinfo} The output of this example will appear only in the printed manual. If you are reading this in Info, you will not see anything after this paragraph.\refill \end{ifinfo} \begin{iftex} The output of this example will appear only in the printed manual. If you are reading this in Info, you will not see anything after this paragraph. In the printed manual, the above mathematics looks like this:\refill \begin{tex} $\bigl(x\in A(n)\bigm|x\in B(n)\bigr)$ \end{tex} \end{iftex} \node Lists and Tables, Introducing Lists, Using Ordinary LaTeX Commands, Top \chapter{Making Lists Tables and Descriptions} \cindex{Making Lists Tables and Descriptions} \cindex{Lists and tables, making them} \cindex{Tables and lists, making them} \LaTeX info has several ways of making lists and tables. Lists can be bulleted or numbered, while descriptions can highlight the items in the first column.\refill \begin{menu} * Introducing Lists:: Formatting is done for you. * Itemize Environment:: * enumerate:: How to construct a numbered list. * Description Environment:: * Tabular Environment:: * Figures and Tables:: \end{menu} \begin{ifinfo} \node Introducing Lists, Itemize Environment, Lists and Tables, Lists and Tables \section*{Introducing Lists} \end{ifinfo} \LaTeX info automatically indents the text in lists or descriptions, and numbers an enumerated list. This last feature is useful if you modify the list, since you do not have to renumber it yourself.\refill \findex{end} Numbered lists and tables begin with the appropriate \code{\back begin} command at the beginning of a line, and end with the corresponding \code{\back end} command on a line by itself. Begin an enumerated list, for example, with an \code{\back begin\{enumerate\}} command and end the list with an \code{\back end\{enumerate\}} command. Begin an itemized list with an \code{\back begin\{itemize\}} command, and end the list with an \code{\back end\{itemize\}} command. You precede each element of a list with an \code{\back item} command.\refill Here is an itemized list of the different kinds of table and lists:\refill \begin{itemize} \item Itemized lists with and without bullets. \item Numbered lists. \item Descriptions with highlighting. \end{itemize} Here is an enumerated list with the same items:\refill \begin{enumerate} \item Itemized lists with and without bullets. \item Numbered lists. \item Descriptions with highlighting. \end{enumerate} And here is a description with the same items and their \back -commands:\refill \begin{description} \item[\back begin\{itemize\}] Itemized lists with and without bullets. \item[\back begin\{enumerate\}] Numbered lists. \item[\back begin\{description\}] two-column descriptions with highlighting. \item[\back begin\{tabular\}] Multio--column tables. \end{description} \node Itemize Environment, enumerate, Introducing Lists, Lists and Tables \section{Itemize Environment} \cindex{Itemization} \findex{itemize} The \code{\back begin\{itemize\}} is used to produce sequences of indented paragraphs, with a mark inside the left margin at the beginning of each paragraph. The text of the indented paragraphs themselves come after the \code{\back begin\{itemize\}}, up to another line that says \code{\back end\{itemize\}}. Before each paragraph for which a mark in the margin is desired, place a line that says just \code{\back item}. It's best not to put any other text on this line. Before each paragraph for which a mark in the margin is desired, place a line that says just \code{\back item}. Don't put any other text on this line.\refill \findex{item} Usually, you should put a blank line before an \code{\back item}. This puts a blank line in the Info file. (\LaTeX{} inserts the proper interline whitespace in either case.) Except when the entries are very brief, these blank lines make the list look better.\refill Here is an example of the use of \code{\back begin\{itemize\}}, followed by the output it produces.\refill \begin{example} \begin{same} \back begin\{itemize\} \back item Some text for foo. \back item Some text for bar. \back end\{itemize\} \end{same} \end{example} \noindent produces \begin{quote} \begin{itemize} \item Some text for foo. \item Some text for bar. \end{itemize} \end{quote} \noindent Itemized lists may be embedded within other itemized lists. \node enumerate, Description Environment, Itemize Environment, Lists and Tables \section{Enumerate Environment} \cindex{Enumeration} \findex{enumerate} \code{\back begin\{enumerate\}} is like \code{\back begin\{itemize\}} except that the marks in the left margin contain successive integers starting with 1. (See the preceeding section.) Do not put any argument on the same line as \code{\back begin\{enumerate\}}.\refill Normally, you should put a blank line between the entries in the list. This generally makes it easier to read the Info file.\refill \begin{example} \begin{same} \back begin\{enumerate\} \back item Some text for foo. \back item Some text for bar. \back end\{enumerate\} \end{same} \end{example} \noindent produces \begin{quote} \begin{enumerate} \item Some text for foo. \item Some text for bar. \end{enumerate} \end{quote} \node Description Environment, Tabular Environment, enumerate, Lists and Tables \section{Description Environment} \cindex{Descriptions, making two-column} \findex{description} \findex{item} The \code{description} environment is similar to \code{\back begin\{itemize\}}, but allows you to specify a name or heading line for each item. (\xref{Itemize Environment}.) The command is used to produce two-column descriptions, and is especially useful for glossaries and explanatory exhibits. You must follow each use of \code{\back item} inside of the description environment with text to serve as the heading line for that item. This text is put inside square brackets on the same line as the \code{\back item} command. Each heading line is put into the first column of the table and the supporting text, which you put on the line following the line beginning with \code{\back item}, goes into the second column.\refill Usually, you should put a blank line before a \code{\back item}. This puts a blank like in the Info file. Except when the entries are very brief, a blank line looks better. The following description highlights the text in the first column: \begin{verbatim} \begin{description} \item[foo] This is the text for \samp{foo}. \item[bar] This is the text for \samp{bar}. \end{description} \end{verbatim} \noindent produces \begin{quotation} \noindent \begin{description} \item[foo] This is the text for \samp{foo}. \item[bar] This is the text for \samp{bar}. \end{description} \end{quotation} Info indents the lines of text in the second column, but does not automatically fill them. As a result, the lines in the Info file may be too wide. To prevent this, cause Info to refill the paragraphs after processing by adding the command \code{\back refill} to the end of the paragraph. (\xref{Refilling Paragraphs}, for more information about the use of the \code{\back refill} command.) \node Tabular Environment, Figures and Tables, Description Environment, Lists and Tables \section{Tabular Environment} \findex{tabular} \cindex{Tabular environment} \findex{tabular} \findex{hline} The \LaTeX\ \code{tabular} environment is weakly supported by \LaTeX info. This environment makes it easy to set small multi--column tables. The ampersand character has its special \LaTeX\ meaning of a separator in tables. To insert a \code{&}, type \code{\back \&}. In the \code{tabular} environment, you must line the columns up the way you want them to appear in the Info file, and you must use \key{\&} as a separator. In the Info file, the separator will become a \key{SPC} character thus preserving the alignment. The trailing \code{\back \back } will be stripped; these \emph{must} occur at the end of the line. \findex{hline} The \code{hline} command is supported by the Info program. It will insert a line of hyphens all the way to the current \code{fill-column}. Neither the \code{cline} or \code{multicolumn} commands are supported. For example: \begin{smallverbatim} \begin{table}[hbtp] \caption{The First Table's Caption} \begin{tabular}{||l|l|l|l||} \hline Column A & Column B & Column C & Column D \\ \hline A 1 & B 1 & C 1 & D 1 \\ A 2 & B 2 & C 2 & D 2 \\ A 3 & B 3 & C 3 & D 3 \\ \hline \end{tabular} \end{table} \end{smallverbatim} \begin{same} \noindent produces in the Info file \begin{smallverbatim} Table 1 : The First Table's Caption ------------------------------------------------------------------------ Column A Column B Column C Column D ------------------------------------------------------------------------ A 1 B 1 C 1 D 1 A 2 B 2 C 2 D 2 A 3 B 3 C 3 D 3 ------------------------------------------------------------------------ \end{smallverbatim} \end{same} \begin{iftex} \clearpage \noindent and in the \LaTeX\ file this produces: \begin{table}[hbtp] \caption{The First Table's Caption} \begin{tabular}{||l|l|l|l||} \hline Column A & Column B & Column C & Column D \\ \hline A 1 & B 1 & C 1 & D 1 \\ A 2 & B 2 & C 2 & D 2 \\ A 3 & B 3 & C 3 & D 3 \\ \hline \end{tabular} \end{table} \end{iftex} The \LaTeX\ math environments \code{displaymath}, \code{equation}, \code{eqnarray} and \code{array} are completely ignored in the Info file, but will have their \LaTeX\ definitions in the printed manual. \node Figures and Tables, Formatting Paragraphs, Tabular Environment, Lists and Tables \section{Figures and Tables} \findex{table} \findex{caption} \findex{figure} Tables and Figures are only weakly supported by \LaTeX info. Anything within a \code{figure} environment is completely ignored in the Info file: \code{\back begin\{figure\}} is equivalent to \code{\back begin\{tex\}} \code{\back begin\{table\}} is supported by \LaTeX info, as is the \code{caption} command. The lines containing the \code{\back begin\{table\}} and \code{\back end\{table\}} are deleted from the Info file. The \code{caption} command causes its argument to be centered on a line, preceded by the word Table and the table number. \code{caption}s are assumed to be within tables because figures are not supported. \node Formatting Paragraphs, Breaks, Figures and Tables, Top \chapter{Formatting Paragraphs} \begin{menu} * Breaks:: Making and Preventing Breaks * Break Commands:: The Line Breaking Commands * Page Breaking Commands:: The Page Breaking Commands * Refilling Paragraphs:: * Always Refilling Paragraphs:: \end{menu} \node Breaks, Break Commands, Formatting Paragraphs, Formatting Paragraphs \section{Making and Preventing Breaks} \cindex{Making breaks} \cindex{Preventing breaks} Usually, a \LaTeX info file is processed both by \LaTeX{} and by one of the Info formatting commands. Sometimes line, paragraph, or page breaks 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.\refill 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 following commands.\refill \begin{menu} * Break Commands:: Introducing the break commands. * Line Breaks:: How to force lines breaks. * w:: How to prevent unwanted line breaks. * sp:: How to insert blank lines. * clearpage:: How to force the start of a new page. * same:: How to prevent unwanted page breaks. * need:: Another way to prevent unwanted page breaks. \end{menu} \node Break Commands, Line Breaks, Breaks, Formatting Paragraphs \section{The Line Breaking Commands} The line break commands create line breaks:\refill \begin{description} \item[\back *] Force a line break in the printed manual and in the Info file. \item[\back \back] Force a line break in the Info file. \item[\back sp\{\var{n}\}] Skip \var{n} blank lines.\refill \end{description} The line-break-prevention command holds text together all on one line.\refill \begin{description} \item[\back w\{\var{text}\}] Prevent \var{text} from being split across two lines.\refill \end{description} \begin{menu} * Line Breaks:: \protect\code{\protect\back *}: Generate Line Breaks * w:: \protect\code{\protect\back w}\protect\{\protect\var{text}\protect\}: Prevent Line Breaks * sp:: \protect\code{\protect\back sp} \protect\var{n}: Insert Blank Lines \end{menu} \node Line Breaks, w, Break Commands, Break Commands \subsection{\protect\code{\protect\back *}: Generate Line Breaks} \findex{* \r{(force line break)}} \cindex{Line breaks} \cindex{Breaks in a line} The \code{\back *} command forces a line break in both the printed manual and in Info. The \code{\back \back} command forces a line break in the printed manual. The optional argument to the \LaTeX\ \code{\back \back} command is not supported in \LaTeX info.\refill For example, \begin{example} This line \back * is broken \back *in two places. \end{example} \noindent produces \begin{example} \begin{same} This line \* is broken \* in two places. \end{same} \end{example} \noindent (Note that the space after the first \code{\back *} command is faithfully carried down to the next line.)\refill \begin{example} \begin{same} This is version 2.0 of the \LaTeX info documentation,\back * and is for \dots{} \end{same} \end{example} \noindent In this case, the \code{\back *} command keeps \LaTeX{} from stretching the line across the whole page in an ugly manner.\refill Do not write braces after an \code{\back *} command; they are not needed. Do not write an \code{\back refill} command at the end of a paragraph containing an \code{\back *} command; it will cause the paragraph to be refilled after the line break occurs, negating the effect of the line break.\refill \node w, sp, Line Breaks, Break Commands \subsection{Preventing Line Breaks} \findex{w \r{(prevent line break)}} \cindex{Line breaks, preventing} \code{\back w\{\var{text}\}} outputs \var{text} and prohibits line breaks within \var{text}.\refill You can use the \code{\back w} command to prevent \LaTeX{} from automatically hyphenating a long name or phrase that accidentally falls near the end of a line.\refill \begin{example} You can copy GNU software from \back w\{\back file\{prep.ai.mit.edu\}\}. \end{example} \noindent produces \begin{quote} You can copy GNU software from \w{\file{prep.ai.mit.edu}}. \end{quote} In the \LaTeX info file, you must write the \code{\back w} command and its argument (all the affected text) all on one line.\refill Do not write an \code{\back refill} command at the end of a paragraph containing an \code{\back w} command; it will cause the paragraph to be refilled and may thereby negate the effect of the \code{\back w} command.\refill \node sp, Page Breaking Commands, w, Break Commands \subsection{Inserting Blank Lines} \findex{sp \r{(line spacing)}} \cindex{Spaces from line to line} \cindex{Line spacing} A line beginning with and containing only \code{\back sp \var{n}} generates \var{n} blank lines of space in both the printed manual and the Info file. \code{\back sp} also forces a paragraph break. For example,\refill \begin{example} \back sp\{2\} \end{example} \noindent generates two blank lines. \begin{ignore} \c node br, page, sp, Breaks \c section \code{\back br}: Generate Paragraph Breaks \findex{br \r{(paragraph breaks)}} \cindex{Paragraph breaks} \cindex{Breaks in a paragraph} The \code{\back br} command forces a paragraph break. It inserts a blank line. You can use the command within or at the end of a line. If used within a line, the \code{\back br\{\}} command must be followed by left and right braces (as shown here) to mark the end of the command.\refill For example, \c !!! if line overfull try `A line containing... and ended by..' \begin{example} \begin{same} This line \back br\{\}contains and is ended by paragraph breaks\back br and is followed by another line. \end{same} \end{example} \noindent produces \begin{example} \begin{same} This line contains and is ended by paragraph breaks and is followed by another line. \end{same} \end{example} The \code{\back br} command is seldom used. \end{ignore} \node Page Breaking Commands, page, sp, Formatting Paragraphs \section{The Page Breaking Commands} The pagination commands apply only to printed output, since Info files do not have pages.\refill \begin{description} \item[\back clearpage] Start a new page in the printed manual.\refill \item[\back begin\{same\}] Hold text together that must appear on one printed page.\refill End the text to be held together with \code{\back begin\{same\}} \item[\back need\{\var{mils}\}] Start a new printed page if not enough space on this one.\refill \end{description} \begin{menu} * page:: Start a New Page * group:: Putting things on the Same Page * need:: Prevent Page Breaks \end{menu} \node page, group, Page Breaking Commands, Page Breaking Commands \subsection{Start a New Page} \cindex{Page breaks} \findex{page} A line containing only \code{\back clearpage} starts a new page in a printed manual. The command has no effect on Info files since they are not paginated. An \code{\back clearpage} command is often used in the title section of a \LaTeX info file to start the copyright page.\refill \node group, need, page, Page Breaking Commands \subsection{Putting things on the Same Page} \cindex{Same} \cindex{Holding text together vertically} \cindex{Vertically holding text together} \findex{same} The \code{\back begin\{same\}} command (on a line by itself) is used inside of an \code{\back begin\{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 \code{\back end\{same\}}. These two lines produce no output of their own, and in the Info file output they have no effect at all.\refill Although \code{\back begin\{same\}} would make sense conceptually in a wide variety of contexts, its current implementation works reliably only within \code{\back begin\{example\}} and variants, and within \code{\back begin\{quote\}}, \code{\back begin\{display\}}, \code{\back begin\{format\}}, \code{\back begin\{flushleft\}} and \code{\back begin\{flushright\}}. (What all these commands have in common is that they turn off vertical spacing between ``paragraphs''.) In other contexts, \code{\back begin\{same\}} can cause anomalous vertical spacing. \xref{Displaying Material}.\refill \begin{ignore} This formatting requirement means that you should write: \begin{example} \begin{same} \back begin\{example\} \back begin\{same\} \dots{} \back end\{same\} \back end\{example\} \end{same} \end{example} \end{ignore} \noindent with the \code{\back begin\{same\}} and \code{\back end\{same\}} command insides of the \code{\back begin\{example\}} and \code{\back end\{example\}} commands. The \code{\back begin\{same\}} command is most often used to hold an example together on one page. In this \LaTeX info manual, about 100 examples contain text that is enclosed between \code{\back begin\{same\}} and \code{\back end group}. \node need, Refilling Paragraphs, group, Page Breaking Commands \subsection{Prevent Page Breaks} \cindex{Need space at page bottom} \findex{need} A line containing only \code{\back need \var{n}} starts a new page in a printed manual if fewer than \var{n} mils (thousandths of an inch) remain on the current page. The \code{\back need} command has no effect on Info files since they are not paginated.\refill \need{300} This paragraph is preceded by an \code{\back need} command that tells \LaTeX{} to start a new page if fewer than 300 mils (nearly one-third inch) remain on the page. It looks like this:\refill \begin{example} \begin{same} \back need\{300\} This paragraph is preceded by \dots{} \end{same} \end{example} The \code{\back need} command is useful for preventing orphans (single lines at the bottoms of printed pages).\refill \node Refilling Paragraphs, Always Refilling Paragraphs, need, Formatting Paragraphs \section{Refilling Paragraphs} \cindex{Refilling paragraphs} \cindex{Filling paragraphs} \findex{refill} The \code{\back refill} command refills and, optionally, indents the first line of a paragraph.\footnote{Perhaps the command should have been called the \code{\back refillandindent} command, but \code{\back refill} is shorter and the name was chosen before indenting was available.}\refill If a paragraph contains long \back -constructs, the paragraph may look badly filled after being formatted by \code{latexinfo-format-region} or \code{latexinfo-format-buffer}. This is because both of thes commands remove \back -commands from formatted text but do not refill paragraphs automatically although \LaTeX{} does. Consequently, some lines become shorter than they were. To cause these commands to refill a paragraph, write \code{\back refill} at the end of the paragraph. This command refills a paragraph in the Info file after all the other processing has been done. \code{\back refill} has no effect on \LaTeX, which always fills every paragraph that ought to be filled.\refill For example, without any indenting, the following\refill \begin{example} To use \back code\{foo\}, pass \back samp\{xx%$\} and \back var\{flag\} and type \back kbd\{x\} after running \back code\{make-foo\}.\back refill \end{example} \noindent produces (in the Info file) \begin{example} To use `foo', pass `xx%$' and FLAG and type `x' after running `make-foo'. \end{example} \noindent whereas without the \code{\back refill} it would produce \begin{example} To use `foo', pass `xx%$' and FLAG and type `x' after running `make-foo'. \end{example} \noindent with the line broken at the same place as in the \LaTeX info input file.\refill Write the \code{\back refill} command at the end of the paragraph. Do not put a space before \code{\back refill}; otherwise the command might be put at the beginning of the line when you refill the paragraph in the \LaTeX info file with Emacs command \kbd{M-q} (\code{fill-paragraph}). If this were to happen, the \code{\back refill} command might fail to work. Do not put braces after \code{\back refill}. Because an \code{\back refill} command is placed at the end of a paragraph and never at the beginning of a line, the braces are not necessary.\refill You can write an \code{\back refill} command at the end of a footnote before the footnote's closing brace, even if the footnote text is embedded in a the middle of a paragraph in the \LaTeX info file. This is because the footnote text is extracted from the surrounding text and formatted on its own.\refill Also, do not end a paragraph that uses either \code{\back *} or \code{\back w} with an \code{\back refill} command; otherwise, \code{latexinfo-format-buffer} or \code{latexinfo-format-buffer} will refill the paragraph in spite of those commands.\refill In addition to refilling, the \code{\back refill} command may insert spaces at the beginning of the first line of the paragraph, thereby indenting that line. The argument to the \code{\back paragraphindent} command specifies the amount of indentation: if the value of the argument is 0, an \code{\back refill} command deletes existing indentation. If the value of the argument is greater than 0, an \code{\back refill} command indents the paragraph by that number of spaces. And if the value of the argument is \samp{asis}, an \code{\back refill} command does not change existing indentation. For more information about the \code{\back paragraphindent} command, \nxref{paragraphindent, , Paragraph Indenting}.\refill The \code{\back refill} command does not indent entries in a list, table, or definition, nor does \code{\back refill} indent paragraphs preceded by \code{\back noindent}.\refill \node Always Refilling Paragraphs, Citations and Footnotes, Refilling Paragraphs, Formatting Paragraphs \section{Always Refilling Paragraphs} \cindex{Always Refilling Paragraphs} \cindex{Filling paragraphs} \findex{alwaysrefill} In practice, one finds that many paragraphs in a \LaTeX info document need refilling, and one's document is littered with \code{\back refill} commands. One solution is to write a 6000 line \samp{C} program to do the refilling automatically. This would have the advantage of great speed, but would mean maintaining a two versions of the Info formating program, one in \samp{C} and one in Emacs lisp.\refill Another solution is to implement a heuristic\footnote{The \samp{H} in Heuristic is pronounced, as in Hack.} that searches for likely candidates for refilling, and inserts a \code{\back refill} command there. At the moment, the replacement takes place at any period followed by two newlines, or a period followed by a newline, followed by \code{\back end\{}. Of course, no replacements are made within \code{verbatim} or \code{smallverbatim} environments. \begin{implementation} This is implemented as a search and replace of all occurences matching the string \code{".\back n\back n"} or \code{".\back n\back end\{"}. This feature is likely to slow things down on a large document. This matching string should probably be changed to the regular expression \verb+\\s.\n\n+ or \verb+\\s.\n\end{+ \end{implementation} \node Citations and Footnotes, Footnotes, Always Refilling Paragraphs, Top \chapter{Citations and Footnotes} \begin{menu} * Footnotes:: * Citations:: \end{menu} \node Footnotes, Citations, Citations and Footnotes, Citations and Footnotes \section{Footnotes} \cindex{Footnotes} \findex{footnote} A \dfn{footnote} is for a reference that documents or elucidates the primary text.\footnote{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 \i{The Chicago Manual of Style}, which is published by the University of Chicago Press.} In \LaTeX info, footnotes are created with the \code{\back 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: \code{\back footnote}\{\var{text}\}.\refill For example, this clause is followed by a sample footnote;\footnote{Here is the sample footnote.} in the \LaTeX info source, it looks like this:\refill \begin{example} \dots{}a sample footnote \back footnote;\{Here is the sample footnote.\} in the \LaTeX info source\dots{} \end{example} In a printed manual or book, the reference mark for a footnote is a small, superscripted number; the text of the footnote is written at the bottom of the page, below a horizontal line.\refill In Info, the reference mark for a footnote is a pair of parentheses with the footnote number between them, like this: \samp{(1)}. Info has two footnote styles, which determine where the text of the footnote is located:\refill \begin{itemize} \cindex{End of node footnote style} \item In the \dfn{end} of 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 \samp{Footnotes} within it. Each footnote begins with an \samp{(\var{n})} reference mark.\refill \noindent Here is an example of a single footnote in the end of node style:\refill \begin{example} \begin{same} --------- Footnotes --------- (1) Here is a sample footnote. \end{same} \end{example} \cindex{Separate footnote style} \item In the \dfn{separate} 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 \samp{(\var{n})} reference mark in the body of the node. The footnote reference is actually a cross reference and you use it to reach the footnote node.\refill The name of the footnotes' node is constructed by appending \w{\samp{-Footnotes}} to the name of the node that contains the footnotes. (Consequently, the footnotes' node for the \file{Footnotes} node is \w{\file{Footnotes-Footnotes}}!) The footnotes' node has an `Up' node pointer that leads back to its parent node.\refill \end{itemize} \noindent Here is how the first footnote in this manual looks after being formatted for Info in the separate node style:\refill \begin{example} File: latexinfo.info Node: Overview-Footnotes, Up: Overview (1) Note that the first syllable of "texinfo" is pronounced like "speck", not "hex". \dots{} \end{example} A \LaTeX info file may be formatted into an Info file with either footnote style.\refill \findex{footnotestyle} Use the \code{\back footnotestyle} command to specify an Info file's footnote style. Write this command at the beginning of a line followed by an argument, either \samp{end} for the end node style or \samp{separate} for the separate node style. For example:\refill \begin{example} \back footnotestyle\{end\} \end{example} \noindent or \begin{example} \back footnotestyle\{separate\} \end{example} The \code{\back footnotestyle} command should be written in the header, before the \code{\back setfilename} and shortly after the \code{\back begin\{document\}} at the beginning of a \LaTeX info file. \xref{Custom Headings}. (If you include the \code{\back 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 will chose a default style.\refill \node Citations, Input and Include Files, Footnotes, Citations and Footnotes \section{Citations} \cindex{Citations} \cindex{Cite} \findex{cite} \code{\back cite} is the \LaTeX\ command for a bibliographic citations. Citations are usually prepared using the program \BibTeX, which formats the citations for use with \LaTeX. The argument to the \code{\back cite} command is the citation key, which appears in the printed manual as the citation key surrounded by square brackets. How it appears in the printed manual is dependent on the bibliographic style chosen. See the \LaTeX\ Manual for more details \cite{Lamport1986}.\refill Before you use the \code{\back cite} command, you must declare the bibliography style that you are going to use. \xref{Making a Bibliography}. \node Input and Include Files, Input Files, Citations, Top \chapter{Input and Include Files} \cindex{Input and Include Files} \LaTeX\ has two ways of including files: with the \code{\back input} command, and with the \code{\back include} command. \LaTeX\ makes some important distinctions between the two. See \cite[\S\tie 4.4]{Lamport1986} for the exact nature of the differences. In \LaTeX. Input files are simply inserted at the place where the \code{input} command occurs, both in the Info file and the \LaTeX\ file. \code{include} files have seperate auxilliarly files (\file{.aux}), and you can control which files are processed with the \code{includeonly} command. In \LaTeX info, the Info program ignores the \code{includeonly} command. Both \code{include} and \code{input} files are always processed. \code{input} files are always ignored by the \code{latexinfo-multiple-files-update} command, which creates or updates or updates the \code{\back node} entries in a file, whereas, under certain conditions, this command will recognize the structure of \code{include} files. \xref{latexinfo-multiple-files-update} for details \begin{menu} * Input Files:: * Include Files:: \end{menu} \node Input Files, Include Files, Input and Include Files, Input and Include Files \section{Input Files} \cindex{Input Files} \findex{input} A line of the form \code{\back input\{\var{filename}\}} will include the contents of the file \var{filename} at that point. A standard technique is to have a top--level file, used only for making a comprehensive manual, containing nothing but the beginning, the end, and a series of \code{\back input} commands. The \code{\back input} \emph{must} occur at the beginning of a line.\refill A file that is intended to be processed with \code{\back input} should not end with \code{\back end\{document\}}, since that would terminate \LaTeX\ processing immediately. \node Include Files, Using Include Files, Input Files, Input and Include Files \section{Include Files} \cindex{Include files} When \LaTeX{} or an Info formatting command sees an \code{\back include} command in a \LaTeX info file, it processes the contents of the file named by the command and incorporates them into the \scap{dvi} or Info file being created. Index entries from the included file are incorporated into the indices of the output file.\refill An included file should simply be a segment of text that you expect to be included as-is into the overall or \dfn{outer} \LaTeX info file; it should not contain the standard beginning and end parts of a \LaTeX info file. In particular, you should not start an included file with a \samp{\back documentstyle} command. Likewise, you should not end an included file with an \code{\back end\{document\}} command; that command will stop \LaTeX{} processing immediately.\refill \begin{menu} * Using Include Files:: How to use the \code{\back include} command. * Sample Include File:: A sample outer file with included files within it; and a sample included file. \end{menu} \node Using Include Files, Sample Include File, Include Files, Include Files \subsection{How to Use Include Files } \findex{include} To include another file within a \LaTeX info file, write the \code{\back 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:\refill \begin{example} \back include\{chap47.tex\} \end{example} Conventionally, an included file begins with an \code{\back node} line that is followed by an \code{\back 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 \LaTeX info files. Thus you cannot use these commands to fill in the `Next', `Previous', and `Up' pointers of the \code{\back 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 first and last `Next', `Previous', and `Up' pointers by hand, or you must use the \code{latexinfo-multiple-files-update} command that is designed for \code{\back include} files. \xref{latexinfo-multiple-files-update}\refill \node Sample Include File, Definition Commands, Using Include Files, Include Files \subsection{Sample File with \protect\code{\protect\back include}} If you plan to use the \code{latexinfo-multiple-files-update} command, the outer \LaTeX info file that lists included files within it should contain nothing but the beginning and end parts of a \LaTeX info file, and a number of \code{\back include} commands listing the included files. It should not even include indices, which should be listed in an included file of their own.\refill Moreover, each of the included files must contain exactly one highest level node (conventionally, an \code{\back chapter} node 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 \code{\back chapter}, an \code{\back chapter}, or an \code{\back unnumbered} node. Thus, normally, each included file contains one, and only one, chapter or equivalent-level node.\refill The outer file should \emph{not} contain any nodes besides the single `Top' node. The \code{latexinfo-multiple-files-update} command will not process them.\refill Here is an example of an outer \LaTeX info file with \code{\back include} files within it before running \code{latexinfo-multiple-files-update}, which would insert a main or master menu:\refill \clearpage \begin{smallverbatim} \documentstyle[12pt,latexinfo]{book} \pagestyle{headings} \begin{document} \bibliographystyle{alpha} \newindex{fn} \title{The Manual} \author{Fred Foobar,\\ Clarke Institute,\\ 999 Queen Street,\\ Toronto, Ontario} \date{\today} \maketitle \tableofcontents \clearpage \setfilename{themanual.info} \include{foo.tex} \include{bar.tex} \bibliography{references} \twocolumn \unnumbered{Function Index} \printindex{fn} \end{document} \end{smallverbatim} An included file, such as \file{foo.tex}, might look like this:\refill \begin{example} \begin{same} \back node First, Second, , Top \back chapter\{First Chapter\} Contents of first chapter \dots{} \end{same} \end{example} The full contents of \file{index.tex} might be as simple as this: \begin{example} \begin{same} \back unnumbered\{Concept Index, , Second, Top\} \back printindex\{cp\} \end{same} \end{example} \node Definition Commands, Untyped Languages Definition Commands, Sample Include File, Top \chapter{Definition Commands} \cindex{Definition commands} \cindex{Elisp Style} \cpsubindex{styles}{elisp} The \code{\back deffn} command and the other \dfn{definition commands} enable you to describe functions, variables, macros, commands, user options, special forms and other such constructs in a uniform format.\refill These constructs are most often used for documenting Lisp and C programs, and the table below summarizes the different constucts, their language on usual usage, and their class. We will order these functions by their usage: untyped languages such as Lisp, typed languages such as C, or object--oriented langauges such as CLOS. \begin{table}[hbtp] \begin{tabular}{||l|l|l||} \hline Command Name & Language & Class \\ \hline deffn & Lisp & general functions \\ deffun & Lisp & functions \\ defspec & Lisp & special forms \\ defmac & Lisp & macros \\ defvr & Lisp & general variables \\ defvar & Lisp & variables \\ \hline deftypefn & C & general typed functions \\ deftypefun & C & typed functions \\ deftypevr & C & general typed variables \\ deftypevar & C & typed variables \\ \hline defcv & CLOS & general classes \\ defvar & CLOS & classes \\ defivar & CLOS & instances \\ defop & CLOS & generic functions \\ defmethod & CLOS & methods \\ \hline deftp & All & data types \\ defopt & All & User Options \\ \hline \end{tabular} \caption{The Definition Commands} \end{table} In the Info file, a definition causes the category entity---`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 \LaTeX{} 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. The name of the entity is entered into the appropriate index: \code{\back deffn} enters the name into the index of functions, \code{\back defvr} enters it into the index of variables, and so on.\refill As these functions are not always wanted, their definitions are contained in the \LaTeX info style \code{elisp}. To make these commands available to \LaTeX info, include the \code{elisp} option in the list of \code{documentstyle} options, such as \begin{verbatim} \documentstyle[latexinfo,elisp]{book} \end{verbatim} \begin{note} The Lisp documentation functions in the \code{elisp} style are compatible with the Emacs \TeX info fuunctions, and are intended to document the GNU Emacs \code{elisp}. As such, they are oriented to the older \t{Maclisp} style of programming. \xref{Clisp Style}, for a more modern approach to a Lisp documentation style, as would be used for Common Lisp. \end{note} \begin{menu} * Untyped Languages Definition Commands:: * C Functions:: * Abstract Objects:: Object-Oriented Programming * Sample Function Definition:: A Sample Function Definition \end{menu} \node Untyped Languages Definition Commands, Def Cmd Template, Definition Commands, Definition Commands \section{Untyped Languages Definition Commands} \begin{menu} * Def Cmd Template:: How to structure a description using a definition command. * Optional Parameters:: How to handle optional and repeated parameters. * Def Cmds in Detail:: All the definition commands. * Functions Commands:: Functions and Similar Entities * Variables Commands:: Variables and Similar Entities \end{menu} \node Def Cmd Template, Optional Parameters, Untyped Languages Definition Commands, Untyped Languages Definition Commands \subsection{The Template for a Definition} \cindex{Definition template} \cindex{Template for a definition} The \code{\back deffn} command is used for definitions of entities that resemble functions. To write a definition using the \code{\back deffn} command, write the \code{\back deffn} command at the beginning of a line and follow it by the category of the entity, the name of the entity itself, and its arguments in braces. Then write the body of the definition on succeeding lines. (You may embed examples in the body.) Finally, end the definition with an \code{\back enddeffn} command written on a line of its own. The other definition commands follow the same format. The template for a definition looks like this:\refill \begin{example} \back deffn\{\var{category}\}\{\var{name}\}\{\var{arguments}\dots{}\} \var{body-of-definition} \back enddeffn \end{example} \noindent For example, \begin{example} \back deffn\{Command\}\{forward-word\}\{count\} This command moves point forward \back var\{count\} words (or backward if \back var\{count\} is negative). \dots{} \back enddeffn \end{example} \noindent produces \begin{quote} \deffn{Command}{forward-word}{count} This function moves point forward \var{count} words (or backward if \var{count} is negative). \dots{} \enddeffn \end{quote} Some of the definition commands are more general than others. The \code{\back 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 \code{\back deffn} command possesses three predefined, specialized variations, \code{\back defun}, \code{\back defmac}, and \code{\back defspec}, that specify the category for you: ``Function'', ``Macro'', and ``Special Form'' respectively. The \code{\back defvr} command also is accompanied by several predefined, specialized variations for describing particular kinds of variables.\refill The template for a specialized definition, such as \code{\back defun}, is similar to the template for a generalized definition, except that you don't have to specify the category:\refill \begin{example} \back defun\{\var{name}\}\{\var{arguments}\dots{}\} \var{body-of-definition} \back enddefun \end{example} \noindent Thus, \begin{example} \back defun\{buffer-end\}\{flag\} This function returns \back code\{(point-min)\} if \back var\{flag\} is less than 1, \back code\{(point-max)\} otherwise. \dots{} \back enddefun \end{example} \noindent produces \defun{buffer-end}{flag} This function returns \code{(point-min)} if \var{flag} is less than 1, \code{(point-max)} otherwise. \dots{} \enddefun \noindent \xref{Sample Function Definition, Sample Function Definition, A Sample Function Definition}, for a more detailed example of a function definition, including the use of \code{\back begin\{example\}} inside of the definition.\refill The other specialized commands work like \code{\back defun}.\refill \node Optional Parameters, Def Cmds in Detail, Def Cmd Template, Untyped Languages Definition Commands \subsection{Optional and Repeated Parameters} \cindex{Optional and repeated parameters} \cindex{Repeated and optional parameters} \cindex{Parameters, optional and repeated} \cindex{Syntax of optional and repeated parameters} \cindex{Meta-syntactic chars for optional parameters} Some entities take optional or repeated parameters, which may be specified by a distinctive special 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.\refill \begin{iftex} An argument enclosed within square brackets is optional. Thus, the phrase \samp{\code{\r{[}\var{optional-arg}\r{]}}} means that \var{optional-arg} is optional. An argument followed by an ellipsis is optional and may be repeated more than once. Thus, \samp{\var{repeated-args}\dots{}} stands for zero or more arguments. Parentheses are used when several arguments are grouped into additional levels of list structure in Lisp. \end{iftex} \c The following looks better in Info (no `r', `samp' and `code'): \begin{ifinfo} An argument enclosed within square brackets is optional. Thus, [\var{optional-arg}] means that \var{optional-arg} is optional. An argument followed by an ellipsis is optional and may be repeated more than once. Thus, \var{repeated-args}\dots{} stands for zero or more arguments. Parentheses are used when several arguments are grouped into additional levels of list structure in Lisp.\refill \end{ifinfo} Here is the \code{\back defspec} line of an example of an imaginary special form:\refill \begin{quote} \defspec{foobar}{\var{var} [\var{from} \var{to} [\var{inc}]]} \var{body}\dots{} \enddefspec \end{quote} \noindent In this example, the arguments \var{from} and \var{to} are optional, but must both be present or both absent. If they are present, \var{inc} may optionally be specified as well. In a \LaTeX info source file, this \code{\back defspec} line is written like this:\refill \begin{example} \back defspec\{foobar\}\{\back var\{var\} [\back var\{from\} \back var\{to\} [\back var\{inc\}]]\} \back var\{body\}\back dots\{\} \back enddefspec \end{example} \noindent The function is listed in the Command and Variable Index under \samp{foobar}.\refill \node Def Cmds in Detail, Functions Commands, Optional Parameters, Untyped Languages Definition Commands \subsection{The Definition Commands} The definition commands automatically enter the name of the entity in the appropriate index: for example, \code{\back deffn}, \code{\back defun}, and \code{\back defmac} enter function names in the index of functions; \code{\back defvr} and \code{\back defvar} enter variable names in the index of variables. Remember to declare the necessary indices with the \code{\back newindex} commands (\pxref{New Indexes}).\refill Although the examples that follow mostly illustrate Lisp, the commands can be used for other programming languages.\refill \begin{menu} * Functions Commands:: Commands for functions. * Variables Commands:: Commands for variables. * Typed Functions:: Commands for functions in typed languages. * Typed Variables:: Commands for variables in typed languages. * Abstract Objects:: Commands for object-oriented programming. * Data Types:: The definition command for data types. \end{menu} \node Functions Commands, Variables Commands, Def Cmds in Detail, Untyped Languages Definition Commands \subsection{Functions} This section describes the commands for describing functions and similar entities. \findex{deffn} \paragraph*{\back deffn\{\var{category}\}\{\var{name}\}\{\var{arguments}\dots{}\}} The \code{\back deffn} command is the general definition command for functions, interactive commands, 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 \code{\back deffn} command is written at the beginning of a line and is followed by the category of entity being described, the name of this particular entity, and its arguments, if any. Terminate the definition with \code{\back enddeffn} on a line of its own.\refill For example, \begin{example} \back deffn\{Command\}\{forward-char\}\{nchars\} Move point forward \back var\{nchars\} characters. \back enddeffn \end{example} \noindent shows a rather terse definition for a ``command'' named \code{forward-char} with one argument, \var{nchars}. \code{\back deffn} prints argument names such as \var{nchars} in italics or upper case, as if \code{\back 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 \code{\back var} to refer to the value of the argument. In the example above, we used \samp{\back var\{nchars\}} in this way. The template for \code{\back deffn} is:\refill \begin{example} \back deffn\{\var{category}\}\{\var{name}\}\{\var{arguments}\dots{}\} \var{body-of-definition} \back enddeffn \end{example} \findex{defun} \paragraph*{\back defun\{\var{name}\}\{\var{arguments}\dots{}\}} The \code{\back defun} command is the definition command for functions. \code{\back defun} is equivalent to \samp{\back deffn\{Function\} \dots{}}.\refill For example, \begin{example} \back defun\{set\}\{symbol new-value\} Change the value of the symbol \var{symbol} to \var{new-value}. \back enddefun \end{example} \noindent shows a rather terse definition for a function \code{set} whose arguments are \var{symbol} and \var{new-value}. The argument names on the \code{\back defun} line automatically appear in italics or upper case as if they were enclosed in \code{\back var}. Terminate the definition with \code{\back enddefun} on a line of its own. The template is:\refill \begin{example} \back defun\{\var{function-name}\}\{\var{arguments}\dots{}\} \var{body-of-definition} \back enddefun \end{example} \code{\back defun} creates an entry in the index of functions. \findex{defmac} \paragraph*{\back defmac\{\var{name}\}\{\var{arguments}\dots{}\}} The \code{\back defmac} command is the definition command for macros. \code{\back defmac} is equivalent to \samp{\back deffn\{Macro\}\dots{}} and works like \code{\back defun}.\refill \findex{defspec} \paragraph*{\back defspec\{\var{name}\}\{\var{arguments}\dots{}\}} The \code{\back defspec} command is the definition command for special forms. \code{\back defspec} is equivalent to \samp{\back deffn\{Special Form\} \dots{}} and works like \code{\back defun}.\refill \node Variables Commands, C Functions, Functions Commands, Untyped Languages Definition Commands \subsection{Variables} Here are the commands for defining variables and similar entities:\refill \findex{defvr} \paragraph*{\back defvr\{\var{category}\}\{\var{name}\}} The \code{\back 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 \code{\back defvr} command at the beginning of a line and follow it by the category of the entity and the name of the entity. Terminate the definition with \code{\back enddefvr} on a line of its own. For example:\refill \begin{example} \back defvr\{User Option\}\{fill-column\} This buffer-local variable specifies the maximum width of filled lines. \dots{} \back enddefvr \end{example} The template is: \begin{example} \back defvr\{\var{category}\}\{\var{name}\} \var{body-of-definition} \back enddefvr \end{example} \code{\back defvr} creates an entry in the index of variables for \var{name}. \findex{defvar} \paragraph*{\back defvar\{\var{name}\}} The \code{\back defvar} command is the definition command for variables. \code{\back defvar} is equivalent to \samp{\back defvr\{Variable\}\dots{}}. For example, \begin{example} \back defvar\{kill-ring\} \dots{} \back enddefvar \end{example} The template is: \begin{example} \back defvar\{\var{name}\} \var{body-of-definition} \back enddefvar \end{example} \code{\back defvar} creates an entry in the index of variables for \var{name}.\refill \node C Functions, Typed Functions, Variables Commands, Definition Commands \section{C Functions} \begin{menu} * Typed Functions:: Functions in Typed Languages * Typed Variables:: Variables in Typed Languages \end{menu} \node Typed Functions, Typed Variables, C Functions, C Functions \subsection{Functions in Typed Languages} The \code{\back 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.\refill \findex{deftypefn} \paragraph*{\back deftypefn\{\var{category}\}\{\var{data-type}\}\{\var{name}\}\{\var{arguments}\dots{}\}} The \code{\back deftypefn} command is the general definition command for functions that may take arguments and that are typed. The \code{\back deftypefn} command is written at the beginning of a line and is followed the category of entity being described, the type of the returned value, the name of this particular entity, and its arguments, if any.\refill For example, \begin{example} \back deftypefn\{Library Function\}\{int\}\{foobar\}\{(int \back var\{foo\}, float \back var\{bar\})\} \dots{} \back enddeftypefn \end{example} \noindent produces the following in Info: \begin{smallexample} -- Library Function: int foobar (int FOO, float BAR) \dots{} \end{smallexample} In a printed manual, it produces: \begin{quote} \deftypefn{Library Function}{int}{foobar}{(int \var{foo}, float \var{bar})} a ``library function'' that returns an \code{int} \enddeftypefn \end{quote} This means that \code{foobar} is a ``library function'' that returns an \code{int}, and its arguments are \var{foo} (an \code{int}) and \var{bar} (a \code{float}).\refill The argument names that you write in \code{\back deftypefn} are not subject to an implicit \code{\back var}---since the actual names of the arguments in \code{\back deftypefn} are typically scattered among data type names and keywords, \LaTeX info can't find them without help. Instead, you must write \code{\back var} explicitly around the argument names. In the example above, the argument names are \samp{foo} and \samp{bar}.\refill The template for \code{\back deftypefn} is:\refill \begin{smallexample} \back deftypefn\{\var{category}\}\{\var{data-type}\}\{\var{name}\}\{\var{arguments}\} \dots{} \var{body-of-description} \back enddeftypefn \end{smallexample} \noindent Note that if the \var{category} or \var{data type} is more than one word then it must be enclosed in braces to make it a single argument.\refill If you are describing a procedure in a language that has packages, such as Ada, you might consider using \code{\back deftypefn} in a manner somewhat contrary to the convention described in the preceding paragraphs. For example:\refill \begin{example} \back deftypefn\{stacks\}\{private\}\{push\} \{(\back var\{s\}:in out stack; \back var\{n\}:in integer)\} \dots{} \back enddeftypefn \end{example} \noindent In this instance, the procedure is classified as belonging to the package \code{stacks} rather than classified as a `procedure' and its data type is described as \code{private}. (The name of the procedure is \code{push}, and its arguments are \var{s} and \var{n}.)\refill \code{\back deftypefn} creates an entry in the index of functions for \var{name}.\refill \findex{deftypefun} \paragraph*{\back deftypefun\{\var{data-type}\}\{\var{name}\}\{\var{arguments}\dots{}\}} The \code{\back deftypefun} command is the specialized definition command for functions in typed languages. The command is equivalent to \samp{\back deftypefn\{Function\}\dots{}}.\refill \begin{example} \back deftypefun\{int\}\{foobar\} \{(int \back var\{foo\}, float \back var\{bar\})\} \dots{} \back enddeftypefun \end{example} \noindent produces the following in Info: \begin{example} -- Function: int foobar (int FOO, float BAR) \dots{} \end{example} \begin{iftex} \noindent and the following in a printed manual: \begin{quote} \deftypefun{int}{foobar}{(int \var{foo}, float \var{bar})} \dots{} \enddeftypefun \end{quote} \end{iftex} The template is: \begin{example} \back deftypefun\{\var{type}\}\{\var{name}\}\{\var{arguments}\dots{}\} \var{body-of-description} \back enddeftypefun \end{example} \code{\back deftypefun} creates an entry in the index of functions for \var{name}.\refill \node Typed Variables, Abstract Objects, Typed Functions, C Functions \subsection{Variables in Typed Languages} Variables in typed languages are handled in a manner similar to functions in typed languages. (\xref{Typed Functions}.) The general definition command \code{\back deftypevr} corresponds to \code{\back deftypefn} and the specialized definition command \code{\back deftypevar} corresponds to \code{\back deftypefun}.\refill \findex{deftypevr} \paragraph*{\back deftypevr\{\var{category}\}\{\var{data-type}\}\{\var{name}\}} The \code{\back 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.\refill The \code{\back deftypevr} command is written at the beginning of a line and is followed by the category of the entity being described, the data type, and the name of this particular entity. For example:\refill \begin{example} \back deftypevr\{Global Flag\}\{int\}\{enable\} \dots{} \back enddeftypevr \end{example} \noindent produces the following in Info: \begin{example} -- Global Flag: int enable \dots{} \end{example} \begin{iftex} \noindent and the following in a printed manual: \begin{quote} \deftypevr{Global Flag}{int}{enable} \dots{} \enddeftypevr \end{quote} \end{iftex} \noindent The template is: \begin{example} \back deftypevr\{\var{category}\}\{\var{data-type}\}\{\var{name}\} \var{body-of-description} \back enddeftypevr \end{example} \code{\back deftypevr} creates an entry in the index of variables for \var{name}.\refill \findex{deftypevar} \paragraph*{\back deftypevar\{\var{data-type}\}\{\var{name}\}} The \code{\back deftypevar} command is the specialized definition command for variables in typed languages. \code{\back deftypevar} is equivalent to \samp{\back deftypevr\{Variable\}\dots{}}.\refill For example, \begin{example} \back deftypevar\{int\}\{foobar\} \dots{} \back enddeftypevar \end{example} \noindent produces the following in Info: \begin{example} -- Variable: int foobar \dots{} \end{example} \begin{iftex} \noindent and the following in a printed manual: \begin{quote} \deftypevar{int}{foobar} \dots{} \enddeftypevar \end{quote} \end{iftex} \noindent The template is: \begin{example} \back deftypevar\{\var{data-type}\}\{\var{name}\} \var{body-of-description} \back enddeftypevar \end{example} \code{\back deftypevar} creates an entry in the index of variables for \var{name}.\refill \node Abstract Objects, Data Types, Typed Variables, Definition Commands \section{Object-Oriented Programming} \LaTeX info has commands for formatting descriptions about abstract objects, such as are used in object-oriented programming. A class is a defined type of abstact 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.\refill 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{\back code} around it. Otherwise, it is printed in the usual text font.\refill \findex{defcv} \paragraph*{\back defcv\{\var{category}\}\{\var{class}\}\{\var{name}\}} The \code{\back defcv} command is the general definition command for variables associated with classes in object-oriented programming. The \code{\back defcv} command is followed by three arguments: the category of thing being defined, the class to which it belongs, and its name. Thus,\refill \begin{example} \back defcv\{Class Option\}\{Window\}\{border-pattern\} \dots{} \back enddefcv \end{example} \noindent illustrates how you would write the first line of a definition of the \code{border-pattern} class option of the class \code{Window}. The template is:\refill \begin{example} \back defcv\{\var{category}\}\{\var{class}\}\{\var{name}\} \dots{} \back enddefcv \end{example} \code{\back defcv} creates an entry in the index of variables. \findex{defivar} \paragraph*{\back defivar\{\var{class}\}\{\var{name}\}} The \code{\back defivar} command is the definition command for instance variables in object-oriented programming. \code{\back defivar} is equivalent to \samp{\back defcv\{Instance Variable\} \dots{}}\refill The template is: \begin{example} \back defivar\{\var{class}\}\{\var{instance-variable-name}\} \var{body-of-definition} \back enddefivar \end{example} \noindent \code{\back defivar} creates an entry in the index of variables. \findex{defop} \paragraph*{\back defop\{\var{category}\}\{\var{class}\}\{\var{name}\}\{\var{arguments}\dots{}\}} The \code{\back 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 \dfn{wrappers} that are associated with classes as methods are, but that act more like macros than like functions. You could use \code{\back defop\{Wrapper\}} to describe one of these.\refill Sometimes it is useful to distinguish methods and \dfn{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 \code{expose}; we would say that this window system defines an \code{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.\refill Often it makes more sense to document operations than methods. For example, window application developers need to know about the \code{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:\refill \begin{example} \back defop\{Operation\}\{windows\}\{expose\}\{\} \end{example} The \code{\back defop} command is written at the beginning of a line and is followed 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.\refill The template is: \begin{example} \back defop\{\var{category}\}\{\var{class}\}\{\var{name}\}\{\var{arguments}\dots{}\} \var{body-of-definition} \back enddefop \end{example} \code{\back defop} creates an entry, such as `\code{expose} on \code{windows}', in the index of functions.\refill \findex{defmethod} \paragraph*{\back defmethod\{\var{class}\}\{\var{name}\}\{\var{arguments}\dots{}\}} The \code{\back 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.\refill \code{\back defmethod} is equivalent to \samp{\back defop\{Method \dots{}}\}. 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,\refill \begin{example} \back defmethod\{\code{bar-class}\}\{bar-method\}\{argument\} \dots{} \back enddefmethod \end{example} \noindent illustrates the definition for a method called \code{bar-method} of the class \code{bar-class}. The method takes an argument.\refill The template is: \begin{example} \back defmethod\{\var{class}\}\{\var{method-name}\}\{\var{arguments}\dots{}\} \var{body-of-definition} \back enddefmethod \end{example} \code{\back defmethod} creates an entry, such as `\code{bar-method} on \code{bar-class}', in the index of functions.\refill \begin{menu} * Data Types:: \end{menu} \node Data Types, Sample Function Definition, Abstract Objects, Abstract Objects \subsection{Data Types} Here is the command for data types:\refill \findex{deftp} \paragraph*{\back deftp\{\var{category}\}\{\var{name}\}\{\var{attributes}\dots{}\}} The \code{\back deftp} command is the generic definition command for data types. The command is written at the beginning of a line and is followed by the category, by the name of the type (which is a word like \code{int} or \code{float}, and then by names of attributes of objects of that type. Thus, you could use this command for describing \code{int} or \code{float}, in which case you could use \code{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.)\refill In Lisp, for example, \dfn{pair} names a particular data type, and an object of that type has two slots called the \scap{car} and the \scap{cdr}. Here is how you would write the first line of a definition of \code{pair}.\refill \begin{example} \back deftp\{Data type\}\{pair\}\{car cdr\} \dots{} \back enddeftp \end{example} The template is: \begin{example} \back deftp\{\var{category}\}\{\var{name-of-type}\}\{\var{attributes}\dots{}\} \var{body-of-definition} \back enddeftp \end{example} \code{\back deftp} creates an entry in the index of data types. \findex{defopt} \paragraph*{\back defopt\{\var{name}\}} The \code{\back defopt} command is the definition command for user options. \code{\back defopt} is equivalent to \samp{\back defvr \{User Option\} \dots{}} and works like \code{\back defvar}.\refill \node Sample Function Definition, Nodes and Menus, Data Types, Definition Commands \section{A Sample Function Definition} \cindex{Function definitions} \cindex{Command definitions} \cindex{Macro definitions} \cindex{Sample function definition} A function definition uses the \code{\back defun} and \code{\back enddefun} commands. The name of the function follows immediately after the \code{\back defun} command and it is followed by the parameter list.\refill \begin{quote} \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}. \begin{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 \enddefun \end{quote} In the \LaTeX info source file, this example looks like this: \begin{smallverbatim} \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}. \begin{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{smallverbatim} \noindent In this manual, this function is listed in the Command and Variable Index under \code{apply}.\refill Ordinary variables and user options are described using a format like that for functions except that variables do not take arguments. \c \section{Common Lisp Definitions} \part{Info} \node Nodes and Menus, Node Menu Illustration, Sample Function Definition, Top \chapter{Nodes and Menus} Most \LaTeX info files are organized hierarchically like books, with chapters, sections, subsections, and subsubsections. Such a hierarchy is tree-like; the chapters are the major limbs from which the sections branch out. In a conventional diagram, however, such a hierarchy is drawn with the ``root'' at the top and the ``leaves'' at the bottom---as an upside-down tree. The root node is called the `Top' node, and `Up' pointers carry you closer to the root.\refill \begin{menu} * Node Menu Illustration:: A diagram and sample nodes and menus. * node:: The \code{\back node} command in detail. * Node Names:: Choosing Node and Pointer Names * Menu Environment:: * Other Info Files:: Referring to nodes in other Info files. \end{menu} \node Node Menu Illustration, node, Nodes and Menus, Nodes and Menus \section{Node and Menu Illustration} Here is a copy of the diagram shown earlier that illustrates a \LaTeX info file with three chapters, each of which contains two sections.\refill \begin{example} \begin{same} top | ------------------------------------- | | | Chapter 1 Chapter 2 Chapter 3 | | | -------- -------- -------- | | | | | | Section Section Section Section Section Section 1.1 1.2 2.1 2.2 3.1 3.2 \end{same} \end{example} In a \LaTeX info file that has this organization, you would write the beginning of the node for Chapter 2 like this:\refill \begin{example} \back node Chapter 2, Chapter 3, Chapter 1, top \back comment node-name, next, previous, up \end{example} \clearpage To go to Sections 2.1 and 2.2 using Info, you need a menu inside of Chapter 2 that says:\refill \begin{example} \back begin\{menu\} * Sect. 2.1:: Description of this section. * Sect. 2.2:: \back end\{menu\} \end{example} \noindent You would locate this menu inside Chapter 2, after the beginning of the chapter and before Section 2.1.\refill The node for Sect. 2.1 will look like this:\refill \begin{example} \back node Sect. 2.1, Sect. 2.2, Chapter 2, Chapter 2 \back comment node-name, next, previous, up \end{example} Usually, an \code{\back node} command and a chapter structuring command are used in sequence, along with indexing commands. (The updating commands require this sequence. \xref{Updating Requirements}.) Also, you may want to follow the \code{\back node} line with a comment line that reminds you which pointer is which. For example, the beginning of the node for the chapter on ending a file looks like this:\refill \begin{smallexample} \begin{same} \back node Ending a File, Structuring, Beginning a File, Top \back comment node-name, next, previous, up \back chapter\{Ending a LaTeXinfo File\} \back cindex\{Ending a LaTeXinfo file\} \back cindex\{LaTeXinfo file ending\} \back cindex\{File ending\} \end{same} \end{smallexample} The following two sections describe the \code{\back node} and \code{\back begin\{menu\}} commands in detail.\refill \node node, Node Names, Node Menu Illustration, Nodes and Menus \section{\protect\code{\protect\back node}} \code{\back node} defines the beginning of a new node in the Info output file. (\inforef{Top, info, info}.) Write the command at the beginning of a line, followed by four arguments, separated by commas, that make up the rest of the line. These arguments are the name of the node, and the names of the `Next', `Previous', and `Up' pointers, in that order. You may insert spaces before each pointer if you wish. The spaces are ignored.\refill In \LaTeX, \code{\back node} is nearly ignored. It generates nothing visible. Its only function is to identify the name to use for cross references to the chapter or section which follows the \code{\back node} command and which makes up the body of the node. (Cross references, such as the one following this sentence, are made with \code{\back xref} and its related commands. \xref{Cross References}.)\refill In general, an \code{\back node} line is followed immediately by a chapter-structuring command such as \code{\back chapter}, \code{\back section}, \code{\back subsection}, or \code{\back subsubsection}. (\xref{Structuring Command Types, , Types of Structuring Command}.)\refill \begin{menu} * Node Names:: Choosing node and pointer names. * Writing a Node:: How to write a node line. \end{menu} \node Node Names, Writing a Node, node, Nodes and Menus \begin{ifinfo} \section*{Choosing Node and Pointer Names} \end{ifinfo} The name of the node identifies the node. The pointers, which enable you to reach other nodes, consist of the names of those nodes.\refill All the node names for a single Info file must be unique. Duplications confuse the Info movement commands. This means, for example, that if you end each chapter with a summary, you must name every summary node differently. You may, however, duplicate section titles (although this practice may confuse a reader).\refill Try to pick node names that are informative but short. In the Info file, the file name, node name, and pointer names are all inserted on one line, which may run into the right edge of the window. (This does not cause a problem with Info, but is ugly.)\refill By convention, node names are capitalized just as they would be for section or chapter titles.\refill \begin{quote} \strong{Caution:} Do not use any of the \LaTeX info \back -commands in a node name; these commands confuse Info.\refill Do not use commas within a node name; a comma terminates the node name.\refill \end{quote} Pointer names must be the names of nodes defined elsewhere. It does not matter whether pointers are before or after the node that refers to them.\refill Normally, a node's `Up' pointer should contain the name of the node whose menu mentions that node. The node's `Next' pointer should contain the name of the node that follows that node and its `Previous' pointer should contain the name of the node that precedes it in that menu. When a node's `Up' node is the same as its `Previous' node, both node pointers should name the same node. \begin{menu} * Writing a Node:: Writing a Node Line \end{menu} \node Writing a Node, Menu Environment, Node Names, Node Names \subsection{Writing a Node Line} \cindex{Writing a node Line} \cindex{Node line writing} The easiest way to write a node line is to write \code{\back node} at the beginning of a line and then the name of the node. You can use update node commands provided by \LaTeX info mode to insert the names of the pointers; \pxref{LaTeXinfo Mode}.\refill Alternatively, you may insert the `Next', `Previous', and `Up' pointers yourself. If you do this, you may find it helpful to use the \LaTeX info mode keyboard command \kbd{C-c C-c n}. This command inserts \samp{\back node} and a comment line listing the names of the pointers in their proper order. The comment line helps you keep track of which arguments are for which pointers. This template is especially useful if you are not familiar with \LaTeX info.\refill If you wish, you can ignore node lines altogether in your first draft and then use the \code{latexinfo-insert-node-lines} command to create node lines for you. However, this practice is not recommended. It is better to name the node itself at the same time you write a section so you can easily make cross references. A large number of cross references are an especially important feature of a good Info file.\refill After you have inserted a node line, you should immediately write an \back -command for the chapter or section and insert its name. Next (and this is important!), put in several index entries. Usually, you will find at least two and often as many as four or five ways of referring to the node in the index. Use them all. This will make it much easier for people to find the node.\refill The top node of the file (which must be named \samp{top} or \samp{Top}) should have as its `Up' and `Previous' nodes the name of a node in another file, where there is a menu that leads to this file. Specify the file name in parentheses. If the file is to be installed directly in the Info directory file, use \samp{(dir)} as the parent of the `Top' node; this is short for \samp{(dir)top}, and specifies the `Top' node in the \file{dir} file, which contains the main menu for Info. For example, the `Top' node line of this manual looks like this:\refill \begin{example} \back node Top, Overview, (dir), (dir) \end{example} \noindent (You may use the \LaTeX info updating commands to insert these `Next' and \samp{(dir)} pointers automatically.)\refill \xref{Installing an Info File}, for more information about installing an Info file in the \file{info} directory.\refill \node Menu Environment, Menu Location, Writing a Node, Nodes and Menus \section{Menu Environment} \cindex{Menus} \findex{menu} The \code{\back begin\{menu\}} command is used to create \dfn{menus}, which contain pointers to subordinate nodes. In Info, you use menus to go to such nodes. Menus have no effect in printed manuals and do not appear in them.\refill By convention, a menu is put at the end of a node. This way, it is easy for someone using Info to find the menu, using the \kbd{M->} (\code{end-of-buffer}) command.\refill \begin{ifinfo} \emph{A node that has a menu should not contain much text.} If you have a lot of text and a menu, move most of the text into a new subnode---all but a few lines.\refill \end{ifinfo} \begin{iftex} \emph{A node that has a menu should not contain much text.} If you have a lot of text and a menu, move most of the text into a new subnode---all but a few lines. Otherwise, a reader with a terminal that displays only a few lines may miss the menu and its associated text. As a practical matter, you should locate a menu within 20 lines of the beginning of the node.\refill \end{iftex} \begin{menu} * Menu Location:: Put a menu in a short node. * Menu Item:: How to write a menu item. * Menu Example:: A menu example. \end{menu} \node Menu Location, Menu Item, Menu Environment, Menu Environment \begin{ifinfo} \subsection*{Menus Need Short Nodes} \end{ifinfo} \cindex{Menu location} \cindex{Location of menus} \cindex{Nodes for menus are short} \cindex{Short nodes for menus} \begin{ifinfo} A reader can easily see a menu that is close to the beginning of the node. The node should be short. As a practical matter, you should locate a menu within 20 lines of the beginning of the node. Otherwise, a reader with a terminal that displays only a few lines may miss the menu and its associated text.\refill \end{ifinfo} The short text before a menu may look awkward in a printed manual. To avoid this, you can write a menu near the beginning of its node and follow the menu by an \code{\back node} line and an \code{\back section*} line within \code{\back begin\{ifinfo\}} and \code{\back end\{ifinfo\}}. This way, the menu, node line, and title appear only in the Info file, not the printed document.\refill The preceding two paragraphs follow an Info-only menu, node line, and heading, and look like this:\refill \begin{example} \begin{same} \back begin\{menu\} * Menu Location:: Put a menu in a short node. * Menu Item:: How to write a menu item. * Menu Example:: A menu example. \back end\{menu\} \back node Menu Location \back begin\{ifinfo\} \back subsection*\{Menus Need Short Nodes\} \back end\{ifinfo\} \end{same} \end{example} See the beginning of the ``Cross References'' chapter in the \LaTeX info source for this document for another example this procedure.\refill \node Menu Item, Menu Example, Menu Location, Menu Environment \subsection{Writing a Menu Item} \cindex{Writing a menu item} \cindex{Menu item writing} In a menu, every line that begins with a \samp{* } is a menu item. (Note the space after the asterisk.) A line that does not start with a \samp{* } can appear in the menu but is not a menu item, just a comment.\refill A menu item has three parts, only the second of which is required:\refill \begin{enumerate} \item The menu item name. \item The name of the node. \item A description of the item. \end{enumerate} A menu item looks like this: \begin{example} * Item name: Node name. Description. \end{example} Follow the menu item name with a single colon and follow the node name with tab, comma, period, or newline.\refill In Info, a user can select a node with the \kbd{m} (\code{Info-menu}) command. The menu item name is what the user types after the \kbd{m} command.\refill If the menu item name and the node name are the same, you can write the name immediately after the asterisk and space at the beginning of the line and follow the name with two colons.\refill For example, write \begin{example} * Name:: \end{example} \noindent instead of \begin{example} * Name: Name. \end{example} \noindent You should use the node name for the menu item name whenever possible, since it reduces visual clutter in the menu.\refill The third part of a menu entry is a short descriptive phrase or sentence. Menu item names and node names are often short; the description explains to the reader what the node is about. The description, which is optional, can spread over two or more lines. A useful description complements the node name rather than repeating it.\refill \node Menu Example, Other Info Files, Menu Item, Menu Environment \subsection{A Menu Example} \cindex{Menu example} \cindex{Example menu} A menu looks like this in \LaTeX info:\refill \begin{example} \begin{same} \back begin\{menu\} * Menu item name: Node name. A short description. * Node name:: This form is preferred. \back end\{menu\} \end{same} \end{example} \noindent This produces: \begin{example} \begin{same} * menu: * Menu item name: Node name. A short description. * Node name:: This form is preferred. \end{same} \end{example} Here is an example as you might see it in a \LaTeX info file:\refill \begin{example} \begin{same} \back begin\{menu\} Larger Units of Text * Files:: All about handling files. * Multiples: Buffers. Multiple buffers; editing several files at once. \back end\{menu\} \end{same} \end{example} \noindent This produces: \begin{example} \begin{same} * menu: Larger Units of Text * Files:: All about handling files. * Multiples: Buffers. Multiple buffers; editing several files at once. \end{same} \end{example} In this example, the menu has two entries. \samp{Files} is both a menu item name and the name of the node referred to by that item. In the other entry, \samp{Multiples} is the item name, and it refers to the node named \samp{Buffers}.\refill Since no file name is specified with either \samp{Files} or \samp{Buffers}, they must be the names of nodes in the same Info file. (\xref{Other Info Files, , Referring to Other Info Files}.)\refill The line \samp{Larger Units of Text} is a comment.\refill \node Other Info Files, Cross References, Menu Example, Nodes and Menus \section{Referring to Other Info Files} \cindex{Referring to other Info files} \cindex{Nodes in other Info files} \cindex{Other Info files' nodes} You can refer to nodes in other Info files by writing the file name in parentheses just before the node name. In this case, you should use the three-part menu item format, which saves the reader from having to type the file name.\refill If you do not list the node name, but only name the file, then Info presumes that you are referring to the \samp{Top} node.\refill The format looks like this:\refill \begin{example} \begin{same} \back begin\{menu\} * \var{first-item}:(\var{filename})\var{nodename}. \var{description} * \var{second-item}:(\var{filename})\var{second-node}. \var{description} \back end\{menu\} \end{same} \end{example} The \file{dir} top level directory for the Info system has menu entries that take you directly to the \samp{Top} nodes of each Info document. (\xref{Creating and Installing an Info File}.)\refill For example, \begin{example} \begin{same} \dots{} * Info: (info). Documentation browsing system. * Emacs: (emacs). The extensible, self-documenting text editor. \dots{} \end{same} \end{example} To refer directly to the \samp{Outlining} and \samp{Rebinding} nodes in the \i{Emacs Manual}, you would write a menu similar to the following:\refill \begin{example} \begin{same} \back begin\{menu\} * Outlining: (emacs)Outline Mode. The major mode for editing outlines. * Rebinding: (emacs)Rebinding. How to redefine the meaning of a key. \back end\{menu\} \end{same} \end{example} \node Invocation, References, Other Info Files, Top \node Cross References, References, Other Info Files, Top \chapter{Making Cross References} \cindex{Making cross references} \cindex{Cross references} \cindex{References} Cross references are used to refer the reader to other parts of the same or different \LaTeX info files. In \LaTeX info, nodes are the points to which cross references can refer.\refill \begin{menu} * References:: What cross references are for. * Cross Reference Commands:: A summary of the different commands. * Cross Reference Parts:: A cross reference has several parts. * xref:: Begin a reference with `See' \dots{} * Top Node Naming:: Naming a `Top' Node * ref:: A reference for the last part of a sentence. * pxref:: How to write a parenthetical cross reference. * inforef:: How to refer to an Info-only file. \end{menu} \node References, Cross Reference Commands, Cross References, Cross References \begin{ifinfo} \section*{What References Are For} \end{ifinfo} Often, but not always, a printed document should be designed so that it can be read sequentially. People tire of flipping back and forth to find information that should be presented to them as they need it.\refill However, in any document, some information will be too detailed for the current context, or incidental to it; use cross references to provide access to such information. Also, an on-line help system or a reference manual is not like a novel; few read such documents in sequence from beginning to end. Instead, people look up what they need. For this reason, such creations should contain many cross references to help readers find other information that they may not have read.\refill In a printed manual, a cross reference creates a page reference, unless it is to another manual altogether, in which case it names that manual.\refill In Info, a cross reference creates an entry that you can follow using the Info \samp{f} command. (\inforef{Help-Adv, Some advanced Info commands, info}.)\refill The various cross reference commands use nodes to define cross reference locations. This is evident in Info, in which a cross reference takes you to the specified node. \LaTeX{} also uses nodes to define cross reference locations, but the action is less obvious. When \LaTeX{} generates a \scap{dvi} file, it records nodes' page numbers and uses the page numbers in making references. Thus, if you are writing a manual that will only be printed, and will not be used on-line, you must nonetheless write \code{\back node} lines to name the places to which you make cross references.\refill \need{800} \node Cross Reference Commands, Cross Reference Parts, References, Cross References \section{Different Cross Reference Commands} \cindex{Different cross reference commands} There are several different cross reference commands:\refill \begin{description} \item[\back xref] Used to start a sentence in the printed manual saying \w{`See \dots{}'} or an entry in the Info file saying \samp{*Note \dots{}}. \item[\back nxref] Used within or, more often, at the end of a sentence; produces just the reference in the printed manual without a preceding `See'. (\samp{n} is for `node'.)\refill \item[\back pxref] Used within parentheses to make a reference that starts with a lower case `see' within the printed manual. (\samp{p} is for `parenthesis'.)\refill \item[\back inforef] Used to make a reference to an Info file. manual.\refill \end{description} \node Cross Reference Parts, xref, Cross Reference Commands, Cross References \section{Parts of a Cross Reference} \cindex{Cross reference parts} \cindex{Parts of a cross reference} A cross reference command requires only one argument, which is the name of the node to which it refers. But a cross reference command may contain up to four additional arguments. By using these arguments, you can provide a menu item name for Info, a descriptive phrase for the printed output, the name of a different Info file, and the name of a different printed manual.\refill Here is a simple cross reference example:\refill \begin{example} \back xref\{Node name\}. \end{example} \noindent which produces \begin{example} *Note Node name::. \end{example} \noindent and in \LaTeX, it turns into a sentence of the form \begin{quote} See section \var{nnn} [Node name], page \var{ppp}. \end{quote} Here, however, is an example of a full five-part cross reference:\refill \begin{example} \back xref\{Node name, Item name, Topic, info-file-name, A Printed Manual\}, for details. \end{example} \noindent which produces \begin{example} *Note Item name: (info-file-name)Node name, for details. \end{example} \noindent and \begin{quote} See section Topic of \i{A Printed Manual}, for details. \end{quote} The five arguments for a cross reference are:\refill \begin{enumerate} \item The node name (required). This is the node to which the cross reference takes you. In a printed document, the location of the node provides the page reference (for references within the same document).\refill \item The item name for the Info reference, if it is to be different from the node name. It is usually omitted.\refill \item A topic description or section name. Often, this is the title of the section. This is used as the name of the reference in the printed manual. If omitted, the node name is used.\refill \item The name of the Info file in which the reference is located, if it is different from the current file.\refill \item The name of another printed manual.\refill \end{enumerate} Cross references with one, two, three, four, and five arguments are described separately following the description of \code{\back xref}.\refill You can write cross reference commands within a paragraph, but note how Info and \LaTeX{} format the output of each of the various commands: write \code{\back xref} at the beginning of a sentence; write \code{\back pxref} only within parentheses, and so on.\refill \node xref, Reference Syntax, Cross Reference Parts, Cross References \section{\protect\code{\protect\back xref}} \findex{xref} \cindex{Cross references using \code{\back xref}} \cindex{References using \code{\back xref}} The \code{\back xref} command generates a cross reference for the beginning of a sentence. The Info formatting commands convert it into an Info cross reference, which the Info \samp{f} command can use to bring you directly to another node. The \LaTeX{} typesetting commands convert it into a page reference, or a reference to another book or manual.\refill \begin{menu} * Reference Syntax:: What a reference looks like and requires. * One Argument:: \code{\back xref} with one argument. * Two Arguments:: \code{\back xref} with two arguments. * Three Arguments:: \code{\back xref} with three arguments. * Four and Five Arguments:: \code{\back xref} with Four and Five Arguments \end{menu} \node Reference Syntax, One Argument, xref, xref \begin{ifinfo} \subsection*{What a Reference Looks Like and Requires} \end{ifinfo} Most often, an Info cross reference looks like this:\refill \begin{example} *Note \var{node-name}::. \end{example} \noindent or like this \begin{example} *Note \var{item-name}: \var{node-name}. \end{example} \noindent In \LaTeX, a cross reference looks like this: \begin{example} See section \var{section} [\var{node-name}], page \var{page} \end{example} \noindent or like this \begin{example} See section \var{section} [\var{topic}], page \var{page} \end{example} The \code{\back xref} command does not generate a period or comma to end the cross reference in either the Info file or the printed output. You must write that period or comma yourself; otherwise, Info will not recognize the end of the reference. (The \code{\back pxref} command works differently. \xref{pxref, , \code{\back pxref}}.)\refill \begin{quote} \emph{Please note:} A period or comma \strong{must} follow the closing brace of an \code{\back xref}. It is required to terminate the cross reference. This period or comma will appear in the output, both in the Info file and in the printed manual.\refill \end{quote} \code{\back xref} must refer to an Info node by name. Use \code{\back node} to define the node (\pxref{Writing a Node}).\refill \code{\back xref} is followed by several arguments inside braces, separated by commas. Whitespace before and after these commas is ignored.\refill A cross reference requires only the name of a node; but it may contain up to four additional arguments. Each of these variations produces a cross reference that looks somewhat different.\refill \node One Argument, Two Arguments, Reference Syntax, xref \subsection{\protect\code{\protect\back xref} with One Argument} The simplest form of \code{\back xref} takes one argument, the name of another node in the same Info file.\refill \noindent For example, \begin{example} \back xref\{Tropical Storms\}. \end{example} \noindent produces \begin{example} *Note Tropical Storms::. \end{example} \noindent and \begin{quote} See section \var{nnn} [Tropical Storms], page \var{ppp}. \end{quote} \noindent (Note that in the preceding example the closing brace is followed by a period.)\refill You can write a clause after the cross reference, like this:\refill \begin{example} \back xref\{Tropical Storms\}, for more info. \end{example} \noindent which produces: \begin{example} *Note Tropical Storms::, for more info. \end{example} \begin{quote} See section \var{nnn} [Tropical Storms], page \var{ppp}, for more info. \end{quote} \noindent (Note that in the preceding example the closing brace is followed by a comma, and then by the clause.)\refill \node Two Arguments, Three Arguments, One Argument, xref \subsection{\protect\code{\protect\back xref} with Two Arguments} With two arguments, the second one is used as the name of the Info cross reference, while the first argument is still the node that the cross reference points to:\refill \noindent The template is like this: \begin{example} \back xref \var{node-name}, \var{item-name}. \end{example} \noindent For example: \begin{example} \back xref\{Electrical Effects, Lightning\}. \end{example} \noindent which produces: \begin{example} *Note Lightning: Electrical Effects. \end{example} \noindent and \begin{quote} See section \var{nnn} [Electrical Effects], page \var{ppp}. \end{quote} \noindent (Note that in the preceding example the closing brace is followed by a period; and that the node name is printed, not the item name.)\refill You can write a clause after the cross reference, like this:\refill \begin{example} \back xref\{Electrical Effects, Lightning\}, for more info. \end{example} \noindent produces \begin{example} *Note Lightning: Electrical Effects, for more info. \end{example} \noindent and \begin{quote} See section \var{nnn} [Electrical Effects], page \var{ppp}, for more info. \end{quote} \noindent (Note that in the preceding example the closing brace is followed by a comma, and then by the clause.)\refill \node Three Arguments, Four and Five Arguments, Two Arguments, xref \subsection{\protect\code{\protect\back xref} with Three Arguments} A third argument replaces the node name in the \LaTeX{} output. The third argument should state the topic discussed by the section being referenced, or be the name of the section. Often, you will want to use initial upper case letters so it will be easier to read when the reference is printed. Use a third argument when the node name is unsuitable because of syntax or meaning.\refill Remember that a comma or period must follow the closing brace of an \code{\back xref} command to terminate the cross reference. In the following examples, a clause follows a terminating comma.\refill \noindent The template is like this: \begin{example} \back xref \var{node-name}, \var{item-name}, \var{topic}. \end{example} \noindent For example, \begin{example} \back xref\{Electrical Effects, Lightning, Thunder and Lightning\}, for details. \end{example} \noindent which produces \begin{example} *Note Lightning: Electrical Effects, for details. \end{example} \noindent and \begin{quote} See section \var{nnn} [Thunder and Lightning], page \var{ppp}, for details. \end{quote} If a third argument is given and the second one is empty, then the third argument serves both. (Note how two commas, side by side, mark the empty second argument.)\refill \begin{example} \back xref\{Electrical Effects, , Thunder and Lightning\}, for details. \end{example} \noindent produces \begin{example} *Note Thunder and Lightning: Electrical Effects, for details. \end{example} \noindent and \begin{quote} See section \var{nnn} [Thunder and Lightning], page \var{ppp}, for details. \end{quote} \node Four and Five Arguments, Top Node Naming, Three Arguments, xref \subsection{\protect\code{\protect\back xref} with Four and Five Arguments} In a cross reference, a fourth argument specifies the name of another Info file, different from the file in which the reference appears, and a fifth argument specifies its title as a printed manual.\refill Remember that a comma or period must follow the closing brace of an \code{\back xref} command to terminate the cross reference. In the following examples, a clause follows a terminating comma.\refill \noindent The template is: \begin{example} \back xref\{\var{node-name}, \var{item-name}, \var{topic}, \var{info-file-name}, \var{printed-title}\}. \end{example} \noindent For example, \begin{example} \back xref\{Electrical Effects, Lightning, Thunder and Lightning, weather, An Introduction to Meteorology\}, for details. \end{example} \noindent which produces \begin{example} *Note Lightning: (weather)Electrical Effects, for details. \end{example} \noindent The name of the Info file is enclosed in parentheses and precedes the name of the node. \noindent In a printed manual, the reference looks like this:\refill \begin{quote} See section Thunder and Lightning of \i{An Introduction to Meteorology}, for details. \end{quote} \noindent The name of the printed manual is typeset in italics; and the reference lacks a page number since \LaTeX{} cannot know to which page a refer refers when the reference is to another manual.\refill Often, you will leave out the second argument when you use the long version of \code{\back xref}. In this case, the third argument, the topic description, will be used as the item name in Info.\refill \noindent The template looks like this: \begin{example} \back xref\{\var{node-name}, , \var{topic}, \var{info-file-name}, \var{printed-title}\}, for details. \end{example} \noindent which produces \begin{example} *Note \var{topic}: (\var{info-file-name})\var{node-name}, for details. \end{example} \noindent and \begin{quote} See section \var{topic} of \var{printed-manual-title}, for details. \end{quote} \noindent For example: \begin{example} \back xref\{Electrical Effects, , Thunder and Lightning, weather, An Introduction to Meteorology\}, for details. \end{example} \noindent which produces \begin{example} *Note Thunder and Lightning: (weather)Electrical Effects, for details. \end{example} \noindent and \begin{quote} See section Thunder and Lightning of \i{An Introduction to Meteorology}, for details. \end{quote} On rare occasions, you may want to refer to another Info file that is is within a single printed manual---when multiple \LaTeX info files are incorporated into the same \LaTeX{} run but make separate Info files. In this case, you need to specify only the fourth argument, and not the fifth.\refill \node Top Node Naming, ref, Four and Five Arguments, Cross References \section{Naming a `Top' Node} \cindex{Naming a `Top' Node in references} \cindex{Top node naming for references} In a cross reference, you must always name a node. This means that in order to refer to a whole manual, you must identify the `Top' node by writing it as the first argument to the \code{\back xref} command. (This is different from the way you write a menu entry. \xref{Other Info Files, , Referring to Other Info Files}.) At the same time, to provide a meaningful section topic or title in the printed cross reference (instead of the word `Top'), you must write an appropriate entry for the third argument to the \code{\back xref} command. \refill Thus, to make a cross reference to \i{The GNU Make Manual}, write:\refill \begin{example} \back xref\{Top, , Overview, make, The GNU Make Manual\}. \end{example} \noindent which produces \begin{example} *Note Overview: (make)Top. \end{example} \noindent and \begin{quote} See section Overview of \i{The GNU Make Manual}. \end{quote} \noindent In this example, \samp{Top} is the name of the node, and \samp{Overview} is the name of the first section of the manual. \node ref, pxref, Top Node Naming, Cross References \section{\protect\code{\protect\back nxref}} \cindex{Cross references using \code{\back nxref}} \cindex{References using \code{\back nxref}} \findex{ref} \code{\back nxref} is nearly the same as \code{\back xref} except that it does not generate a `See' in the printed output, just the reference itself. This makes it useful as the last part of a sentence.\refill \noindent For example: \begin{example} \begin{same} For more information, see \back nxref\{Orogenesis, , Mountaing Building\}. \end{same} \end{example} \noindent produces \begin{example} \begin{same} For more information, see *Note Mountain Building: Orogenesis. \end{same} \end{example} \noindent and \begin{quote} For more information, see section \var{nnn} [Mountain Building]. page \var{ppp}. \end{quote} The \code{\back nxref} command sometimes leads writers to express themselves in a manner that is suitable for a printed manual but looks awkward in the Info format. Bear in mind that your audience will be using both the printed and the Info format.\refill \noindent For example, \begin{example} Sea surges are described in \back nxref\{Hurricanes\}. \end{example} \noindent produces \begin{quote} Sea surges are described in section \var{nnn} [Hurricanes]. \end{quote} \noindent in a printed document, but \begin{example} Sea surges are described in *Note Hurricanes::. \end{example} \noindent in Info. \begin{quote} \strong{Caution:} You \emph{must} write a period or comma immediately after an \code{\back nxref} command with two or more arguments. Otherwise, Info will not find the end of the cross reference entry and attempts to follow the cross reference will fail. As a general rule, you should write a period or comma after every \code{\back nxref} command. This looks best in both the printed and the Info output.\refill \end{quote} \node pxref, inforef, ref, Cross References \section{\protect\code{\protect\back pxref}} \cindex{Cross references using \code{\back pxref}} \cindex{References using \code{\back pxref}} \findex{pxref} The parenthetical reference command, \code{\back pxref}, is nearly the same as \code{\back xref}, but you use it \emph{only} inside parentheses and you do \emph{not} type a comma or period after the command's closing brace. The command differs from \code{\back xref} in two ways:\refill \begin{enumerate} \item \LaTeX{} typesets the reference for the printed manual with a lower case `see' rather than an upper case `See'.\refill \item The Info formatting commands automatically end the reference with a closing colon or period.\refill \end{enumerate} Because one type of formatting automatically inserts closing punctuation and the other does not, you should use \code{\back pxref} \emph{only} inside parentheses as part of another sentence. Also, you yourself should not insert punctuation after the reference, as you do with \code{\back xref}.\refill \code{\back pxref} is designed so that the output looks right and works right between parentheses both in printed output and in an Info file. In a printed manual, a closing comma or period should not follow a cross reference within parentheses; such punctuation is wrong. But in an Info file, suitable closing punctuation must follow the cross reference so Info can recognize its end. \code{\back pxref} spares you the need to use complicated methods to put a terminator into one form of the output and not the other.\refill Don't try to use \code{\back pxref} as a clause in a sentence. It will look bad in either the Info file, the printed output, or both. Use it only as a parenthetical reference.\refill With one argument, a parenthetical cross reference looks like this:\refill \begin{example} \dots{} large storms (\back pxref\{Hurricanes\}) may cause flooding \dots{} \end{example} \noindent which produces \begin{example} \dots{} large storms (*Note Hurricanes::) may cause flooding \dots{} \end{example} \noindent and \begin{quote} \dots{} large storms (see section \var{nnn} [Hurricanes], page \var{ppp}) may cause flooding \dots{} \end{quote} With two arguments, a parenthetical cross reference has this template:\refill \begin{example} \dots{} (\back pxref\{\var{node-name}, \var{item-name}\}) \dots{} \end{example} \noindent which produces \begin{example} \dots{} (*Note \var{item-name}: \var{node-name}.) \dots{} \end{example} \noindent and \begin{quote} \dots{} (see section \var{nnn} [\var{node-name}], page \var{ppp}) \dots{} \end{quote} \code{\back pxref} can be used with up to five arguments just like \code{\back xref} (\pxref{xref, , \code{\back xref}}).\refill \node inforef, Creating Indices, pxref, Cross References \section{\protect\code{\protect\back inforef}} \cindex{Cross references using \code{\back inforef}} \cindex{References using \code{\back inforef}} \findex{inforef} \code{\back inforef} is used for cross references to Info files for which there are no printed manuals. Even in a printed manual, \code{\back inforef} generates a reference directing the user to look in an Info file.\refill The command takes either two or three arguments, in the following order:\refill \begin{enumerate} \item The node name. \item The item name (optional). \item The Info file name. \end{enumerate} \noindent Separate the arguments with commas, as with \code{\back xref}. Also, you must terminate the reference with a comma or period after the \samp{\}}, as you do with \code{\back xref}.\refill \noindent The template is: \begin{example} \back inforef\{\var{node-name}, \var{item-name}, \var{info-file-name}\}, \end{example} Thus, \begin{example} \back inforef\{Expert, Advanced Info commands, info\}, for more information. \end{example} \noindent produces \begin{example} *Note Advanced Info commands: (info)Expert, for more information. \end{example} \noindent and \begin{quote} See Info file \file{info}, node \samp{Expert}, for more information. \end{quote} \noindent Similarly, \begin{example} \back inforef\{Expert, , info\}, for more information. \end{example} \noindent produces \begin{example} *Note (info)Expert::, for more information. \end{example} \noindent and \begin{quote} See Info file \file{info}, node \samp{Expert}, for more information. \end{quote} The converse of \code{\back inforef} is \code{\back cite}, which is used to refer to printed works for which no Info form exists. \xref{Citations}.\refill \node Creating Indices, Index Entries, inforef, Top \chapter{Creating Indices} \cindex{Indices} \cindex{Creating indices} Using \LaTeX info, you can generate indices without having to sort and collate entries manually. In an index, the entries are listed in alphabetical order, together with information on how to find the discussion of each entry. In a printed manual, this information consists of page numbers. In an Info file, this information is a menu item leading to the first node referenced.\refill \LaTeX info provides several predefined kinds of index: an index for functions, an index for variables, an index for concepts, and so on. You can combine indices or use them for other than their canonical purpose. If you wish, you can define your own indices.\refill \begin{menu} * Index Entries:: Choose different words for index entries. * Indexing Commands:: How to make an index entry. * Combining Indices:: How to combine indices. \end{menu} \node Index Entries, Indexing Commands, Creating Indices, Creating Indices \section{Making Index Entries} \cindex{Index entries, making} \cindex{Entries, making index} When you are making index entries, it is good practice to think of the different ways people may look for something. Different people \emph{do not} think of the same words when they look something up. A helpful index will have items indexed under all the different words that people may use. For example, someone might think it obvious that the two-letter names for indices should be listed under ``Indices, two-letter names'', since the word ``Index'' is the general concept. But another reader may remember the specific concept of two-letter names and search for the entry listed as ``Two letter names for indices''. A good index will have both entries and will help both kinds of user.\refill Like typesetting, the construction of an index is a highly skilled, professional art, the subtleties of which are not appreciated until you have to do it yourself.\refill \xref{Printing an Index and Generating Menus}, for information about the commands to put at the beginning and end of the file, for printing an index, or creating an index menu in an Info file.\refill \clearpage \LaTeX info provides six predefined indices:\refill \begin{itemize} \item A \dfn{concept index} listing concepts that are discussed.\refill \item A \dfn{function index} listing functions (such as, entry points of libraries).\refill \item A \dfn{variables index} listing variables (such as, global variables of libraries).\refill \item A \dfn{keystroke index} listing keyboard commands.\refill \item A \dfn{program index} listing names of programs.\refill \item A \dfn{data type index} listing data types (such as, structures defined in header files).\refill \end{itemize} \noindent Not every manual needs all of these. This manual has two indices: a concept index and an \back -command index (that is actually the function index but is called a command index in the chapter heading). Two or more indices can be combined into one using the \code{\back synindex} or \code{\back syncodeindex} commands. \xref{Combining Indices}.\refill \node Indexing Commands, Declaring indices, Index Entries, Creating Indices \section{Defining the Entries of an Index} \cindex{Defining indexing entries} \cindex{Index entries} \cindex{Entries for an index} \cindex{Specifying index entries} \cindex{Creating index entries} The data to make an index comes from many individual indexing commands scattered throughout the \LaTeX info source file. Each command says to add one entry to a particular index; after processing, it will give the current page number or node name as the reference.\refill An index entry consists of an indexing command at the beginning of a line followed by the entry in braces. For example, this section begins with the following five entries for the concept index:\refill \begin{example} \back cindex\{Defining indexing entries\} \back cindex\{Index entries\} \back cindex\{Entries for an index\} \back cindex\{Specifying index entries\} \back cindex\{Creating index entries\} \end{example} Each declared index has its own indexing command---\code{\back cindex} for the concept index, \code{\back findex} for the function index, and so on. An index must be declared at the beginning of the document with the \code{\back newindex} command, before the first use of the corresponding index command. \xref{Declaring indices} for how to use this command.\refill The usual convention is to capitalize the first word of each index entry, unless that word is the name of a function, variable, or other such entitity that should not be capitalized. Thus, if you are documenting Emacs Lisp, your concept index entries are usually capitalized, but not your function index entries. However, if your concept index entries are consistently short (one or two words each) it may look better for each regular entry to start with a lower case letter. Which ever convention you adapt, please be consistent! \cindex{Capitalizing index entries} \cindex{Index entry capitalization } By default, entries for a concept index are printed in a small roman font and entries for the other indices are printed in a small \code{\back code} font. You may change the way part of an entry is printed with the usual \LaTeX info commands, such as \code{\back file} for file names and \code{\back emph} for emphasis (\pxref{Marking Text}).\refill \cindex{Index font types} The six indexing commands for predefined indices are: \begin{description} \item[\back cindex\{\var{concept}] \findex{cindex} Make an entry in the concept index for \var{concept}.\refill \item[\back findex\{\var{function}] \findex{findex} Make an entry in the function index for \var{function}.\refill \item[\back vindex\{\var{variable}] \findex{vindex} Make an entry in the variable index for \var{variable}.\refill \item[\back kindex\{\var{key}] \findex{kindex} Make an entry in the key index for \var{key}.\refill \item[\back pindex\{\var{program}] \findex{pindex} Make an entry in the program index for \var{program}.\refill \item[\back tindex\{\var{data\} type}] \findex{tindex} Make an entry in the data type index for \var{data type}.\refill \end{description} \begin{quote} \strong{Caution:} Do not use a colon in an index entry. In Info, a colon separates the menu item name from the node name. An extra colon confuses Info. \xref{Menu Item, , Writing a Menu Item}, for more information about the structure of a menu entry.\refill \end{quote} If the same name is indexed on several pages, all the pages are listed in the printed manual's index. However, \strong{only} the \strong{first} node referenced will appear in the index of an Info file. This means that it is best to write indices in which each entry will refer to only one place in the \LaTeX info file.\refill \begin{menu} * Declaring indices:: Declaring Indices * Special Index Entries:: \end{menu} \node Declaring indices, Special Index Entries, Indexing Commands, Indexing Commands \subsection{Declaring Indices} \cindex{Indices, declaring} \cindex{Declaring indices} The \code{\back newindex} command takes a two-letter index name, and makes the index commands for that index available for use. The \code{\back printindex} command takes a two-letter index name, reads the corresponding sorted index file and formats it appropriately into an index. Normally, six indices are provided for, and are referred to by their two-letter abbreviations:\refill \begin{description} \item[cp] A \dfn{concept index} listing concepts that are discussed. \item[pg] A \dfn{program index} listing names of programs and leading to the places where those programs are documented. \item[fn] A \dfn{function index} listing functions (such as, entry points of libraries). \item[vr] A \dfn{variables index} listing variables (such as, external variables of libraries). \item[tp] A \dfn{data type index} listing data types (such as, structures defined in header files). \item[ky] A \dfn{keystroke index} listing keyboard commands. \end{description} \noindent Not every manual needs all of these. This manual has two indices: a concept index and a command index (that uses the function index but is called a command index in the chapter heading). Two or more indices can be combined into one using the \code{\back synindex} command. \xref{Combining Indices}. You are not actually required to use the predefined indices for their canonical purposes. For example, suppose you wish to index some C preprocessor macros. You could put them in the function index along with actual functions, just by writing \code{\back findex} commands for them; then, when you print the ``function index'' as an unnumbered chapter, you could give it the title `Function and Macro Index' and all will be consistent for the reader. Or you could put the macros in with the data types by writing \code{\back tindex} commands for them, and give that index a suitable title so the reader will understand. (\xref{Printing an Index and Generating Menus}.)\refill \begin{menu} * Special Index Entries:: \end{menu} \node Special Index Entries, Combining Indices, Declaring indices, Indexing Commands \subsection{Special Index Entries} \findex{cpsubindex} \findex{cpindexbold} The concept index has two special index entries to help you make more elaborate concept indices. \code{\back cpsubindex\{topic\}\{subtopic\}} defines an entry in the concept index, which has a subtopic. In the Info manual, this line and anything on it is deleted. \code{\back cpindexbold\{topic\}} defines an entry in the concept index, which is set in bold type. In the Info manual, this line and anything on it is deleted. \findex{pgindexbold} \findex{vrindexbold} \findex{tpindexbold} \findex{kyindexbold} \findex{fnindexbold} All other indices have just one special index, the \code{\back ??indexbold} command, which sets its entry in bold type. \node Combining Indices, Creating and Installing an Info File, Special Index Entries, Creating Indices \section{Combining Indices} \cindex{Combining indices} \cindex{Indices, combining them} Sometimes you will want to combine two disparate indices such as functions and variables, perhaps because you have few enough of one of them that a separate index for them would look silly.\refill You could put functions into the concept index by writing \code{\back cindex} commands for them instead of \code{\back findex} commands, and produce a consistent manual by printing the concept index with the title `Function and Concept Index' and not printing the `Function Index' at all; but this is not a robust procedure. It works only if your document is never included in part of or together with another document that is designed to have a separate function index; if your document were to be included with such a document, the functions from your document and those from the other would not end up together. Also, to make your function names appear in the right font in the concept index, you would have to enclose every one of them between \code{\back code} and \code{\back end\{code\}}.\refill What you should do instead when you want functions and concepts in one index is to index the functions with \code{\back findex} as they should be, but use the \code{\back syncodeindex} command to redirect these \code{\back findex} commands to the concept index.\refill \findex{syncodeindex} The \code{\back syncodeindex} command takes two arguments: the name of an index to redirect, and the name of an index to redirect it to:\refill \begin{example} \back syncodeindex\{\var{from}\}\{\var{to}\} \end{example} For this purpose, the indices are given two-letter names:\refill \cindex{Two letter names for indices} \cindex{Indices, two letter names} \cindex{Names for indices} \begin{description} \item[cp] the concept index \item[vr] the variable index \item[fn] the function index \item[ky] the key index \item[pg] the program index \item[tp] the data type index \end{description} Write an \code{\back syncodeindex} command before or shortly after the end of header line at the beginning of a \LaTeX info file. For example, to merge a function index with a concept index, write the following:\refill \begin{example} \back syncodeindex\{fn\}\{cp\} \end{example} \noindent This will cause all entries designated for the function index to go to the concept index instead.\refill The \code{\back syncodeindex} command puts all the entries from the redirected index into the \code{\back code} font, overriding whatever default font is used by the index to which the entries are redirected. This way, if you redirect function names from a function index into a concept index, all the function names are printed the \code{\back code} font as you would expect.\refill \cindex{Fonts for indices} The \code{\back synindex} command is nearly the same as the \code{\back syncodeindex} command, except that it does not put the redirected index into the \code{\back code} font, but puts it in the roman font.\refill \findex{synindex} \xref{Printing an Index and Generating Menus}, for information about printing an index at the end of a book or creating an index menu in an Info file.\refill \node Creating and Installing an Info File, Creating an Info file, Combining Indices, Top \chapter{Creating and Installing an Info File} \begin{menu} * Creating an Info file:: * Installing an Info File:: \end{menu} \node Creating an Info file, latexinfo-format commands, Creating and Installing an Info File, Creating and Installing an Info File \section{Creating an Info file} \cindex{Creating an Info file} \cindex{Info, creating an on-line file} \cindex{Formatting a file for Info} \cindex{Indirect subfiles} In GNU Emacs, the way to create an Info file is to visit the file and invoke \begin{example} \kbd{M-x latexinfo-format-buffer} \end{example} \noindent A new buffer is created and the Info file text is generated there. \ctrl{x} \ctrl{s} (\code{save-buffer}) will save it under the name specified in the \code{\back setfilename} command. \code{latexinfo-format-region} and \code{latexinfo-format-buffer} are the two Emacs commands that you can also use for formatting. A \LaTeX info file must possess an \code{\back setfilename} line near its beginning, otherwise the formatting commands will fail.\refill For information on installing the Info file in the Info system, see \nxref{Installing an Info File}.\refill \begin{menu} * latexinfo-format commands:: The \protect\code{latexinfo-format\protect\dots{}} Commands * Tag and Split Files:: Tag Files and Split Files \end{menu} \node latexinfo-format commands, Tag and Split Files, Creating an Info file, Creating an Info file \subsection{The latexinfo-format Commands} \findex{latexinfo-format-region} \findex{latexinfo-format-buffer} In GNU Emacs in \LaTeX info mode, you can format part or all of a \LaTeX info file with the \code{latexinfo-format-region} command. This formats the current region and displays the formatted text in a temporary buffer called \samp{*Info Region*}.\refill Similarly, you can format the whole file with the \code{latexinfo-format-buffer} command. This command creates a new buffer and generates the Info file in it. Typing \kbd{C-x C-s} will save the Info file under the name specified by the \code{\back setfilename} line which must be near the beginning of the \LaTeX info file. \xref{Info Formatting}, for how to use the commands:\refill \begin{description} \item[C-c C-e C-r (\code{latexinfo-format-region})] Format the current region for Info. \findex{latexinfo-format-region} \item[C-c C-e C-b (\code{latexinfo-format-buffer})] Format the current buffer for Info. \findex{latexinfo-format-buffer} \end{description} The \code{latexinfo-format-region} and \code{latexinfo-format-buffer} commands provide you with some error checking; and other functions provide you with further help in finding formatting errors. These procedures are described elsewhere, \pxref{Catching Formatting Mistakes}.\refill \node Tag and Split Files, Installing an Info File, latexinfo-format commands, Creating an Info file \subsection{Tag Files and Split Files} If a \LaTeX info file has more than 30,000 bytes, \code{latexinfo-format-buffer} automatically creates a \dfn{tag table} for its Info file. With a tag table, Info can jump to new nodes more quickly than it can otherwise.\refill In addition, if the \LaTeX info file contains more than about 70,000 bytes, \code{latexinfo-format-buffer} splits the large Info file into shorter \dfn{indirect} subfiles of about 50,000 bytes each. Big files are split into smaller files so that Emacs does not have 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 \dfn{include} files were designed as a way to create a single, large printed manual out of the smaller Info files. \xref{Include Files}, for more information. Include files are still used for very large documents, such as \i{The Emacs Lisp Reference Manual}, in which each chapter is a separate file.)\refill 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 \dfn{indirect} files.\refill The split off files have names that are created by appending \samp{-1}, \samp{-2}, \samp{-3} and so on to the file names specified by the \code{\back setfilename} command. The shortened version of the original file continues to have the name specified by \code{\back setfilename}.\refill At one stage in writing a document, for example, the Info file called \file{test-latexinfo} might have looked like this:\refill \begin{example} \begin{same} Info file: test-latexinfo, -*-Text-*- produced by latexinfo-format-buffer from file: new-manual.tex ^_ Indirect: test-latexinfo-1: 102 test-latexinfo-2: 50422 test-latexinfo-3: 101300 ^_^L Tag table: (Indirect) Node: overview^?104 Node: info file^?1271 Node: printed manual^?4853 Node: conventions^?6855 \dots{} \end{same} \end{example} \noindent Each of the split off, indirect files, \file{test-latexinfo-1}, \file{test-latexinfo-2}, and \file{test-latexinfo-3}, is listed in this file after the line that says \samp{Indirect:}. The tag table is listed after the line that says \samp{Tag table:}. \refill If you are using \code{latexinfo-format-buffer} to create Info files, you may want to run the \code{Info-validate} command. However, you cannot run the \kbd{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, \pxref{Using Info-validate}.\refill \begin{menu} * Installing an Info file:: * Extending LaTeXinfo:: \end{menu} \node Installing an Info File, Directory file, Tag and Split Files, Creating and Installing an Info File \section{Installing an Info File} \cindex{Installing an Info file} \cindex{Info file installation} \cindex{\file{dir} directory for Info installation} Info files are usually kept in the \file{\dots{}/emacs/info} directory. This directory is the values of the Emacs variable \code{Info-directory}. \begin{menu} * Directory file:: The top level menu for all Info files. * New Info File:: Listing a new info file. * Other Info Directories:: How to specify Info files that are located in other directories. \end{menu} \node Directory file, New Info File, Installing an Info File, Installing an Info File \subsection{The \protect\file{dir} File} For Info to work, the \file{info} directory must contain a file that serves as a top level directory for the Info system. By convention, this file is called \file{dir}. The \file{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:\refill \begin{example} * Menu: * Info: (info). Documentation browsing system. * Emacs: (emacs). The extensible, self-documenting text editor. * LaTeXinfo: (latexinfo). With one source file, make either a printed manual using LaTeX or an Info file. \dots{} \end{example} \noindent Each of these menu entries points to the `Top' node of the Info file that is named in parentheses. \footnote{The menu entry does not have to specify the `Top' node, since Info goes to the `Top' node if no node name is mentioned. \xref{Other Info Files, , Nodes in Other Info Files}.} Thus, the \samp{Info} entry points to the `Top' node of the \file{info} file and the \samp{Emacs} entry points to the `Top' node of the \file{emacs} file.\refill In each of the Info files, the `Up' pointer of the `Top' node refers back to the \code{dir} file. For example, the node line for the `Top' node of the Emacs manual looks like this:\refill \begin{example} File: emacs Node: Top, Up: (DIR), Next: Distrib \end{example} \noindent (Note that in this case, the 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.)\refill \c !!! Can any file name be written in upper or lower case, \c !!! or is dir a special case? \node New Info File, Other Info Directories, Directory file, Installing an Info File \subsection{Listing a New Info File} \cindex{Adding a new info file} \cindex{Listing a new info file} \cindex{New info file, listing it} \cindex{Info file, listing new one} \cindex{\file{dir} file listing} To add a new Info file to your system, add the name to the menu in the \file{dir} file by editing the \file{dir} file by hand. Also, put the new Info file in the \file{\dots{}/emacs/info} directory. For example, if you were adding documentation for GDB, you would make the following new entry:\refill \begin{example} * GDB: (gdb). The source-level C debugger. \end{example} \noindent The first item is the menu item name; it is followed by a colon. The second item is the name of the Info file, in parentheses; it is followed by a period. The third part of the entry is the description of the item.\refill Conventionally, the name of an Info file has a \file{.info} extension. Thus, you might list the name of the file like this: \begin{example} * GDB: (gdb.info). The source-level C debugger. \end{example} \noindent However, Info will look for a file with a \file{.info} extension if it does not find the file under the name given in the menu. This means that you can write to \file{gdb.info} in a menu as \file{gdb}, as shown in the first example. This looks better. \node Other Info Directories, LaTeXinfo Mode, New Info File, Installing an Info File \subsection{Info Files in Other Directories} \cindex{Installing Info in another directory} \cindex{Info installed in another directory} \cindex{Another Info directory} \cindex{\b{.login} initialization file} If an Info file is not in the \file{info} directory, there are two ways to specify its location:\refill \begin{itemize} \item Write the menu's second part as a pathname, or;\refill \item Specify an environment variable in your \file{.profile} or \file{.login} initialization file.\refill \end{itemize} For example, to reach a test file in the \file{~bob/manuals} directory, you could add an entry like this to the menu in the \file{dir} file:\refill \begin{example} * Test: (~bob/manuals/info-test). Bob's own test file. \end{example} \noindent In this case, the absolute file name of the \file{info-test} file is written as the second item of the menu entry.\refill \vindex{INFOPATH} Alternatively, you may set the \code{INFOPATH} environment variable in your \file{.login} or \file{.profile} file. The \code{INFOPATH} environment variable will tell Info where to look.\refill If you use \code{sh} or \code{bash} for your shell command interpreter, you must set the \code{INFOPATH} environment variable in the \file{.profile} initialization file; but if you use \code{csh} or \code{tcsh}, you must set the variable in the \file{.login} initialization file. The two files require slightly different command formats.\refill \begin{itemize} \item In a \file{.login} file, you could set the \code{INFOPATH} variable as follows:\refill \begin{smallexample} setenv INFOPATH .:~bob/manuals:/usr/local/emacs/info \end{smallexample} \item In a \file{.profile} file, you would achieve the same effect by writing:\refill \begin{smallexample} INFOPATH=.:~bob/manuals:/usr/local/emacs/info export INFOPATH \end{smallexample} \end{itemize} \noindent Either form would cause Info to look first in the current directory, indicated by the \samp{.}, then in the \file{~bob/manuals} directory, and finally in the \file{/usr/local/emacs/info} directory (which is the usual location for the standard Info directory).\refill \part{Emacs} \node LaTeXinfo Mode, Emacs Editing, Other Info Directories, Top \chapter{Using LaTeXinfo Mode} \cindex{LaTeXinfo mode} \cindex{Mode, using Latexinfo} \cindex{GNU Emacs} \cindex{Emacs} In GNU Emacs, \LaTeX info mode provides commands and features especially designed for working with \LaTeX info files. The special \LaTeX info commands are in addition to the usual editing commands, which are generally the same as the commands of Text mode. There are special commands to:\refill \begin{itemize} \item Insert commonly used strings of text.\refill \item Automatically create node lines. \item Show the structure of a \LaTeX info source file.\refill \item Automatically create or update the `Next',\* `Previous', and `Up' pointers of a node. \item Automatically create or update menus.\refill \item Automatically create a master menu.\refill \item Format a part or all of a file for Info.\refill \item Typeset and print part or all of a file.\refill \end{itemize} \begin{menu} * Emacs Editing:: \LaTeX info mode adds to the usual editing commands. * Inserting:: How to insert frequently used commands. * Showing the Structure:: How to show the structure of a file. * Updating Nodes and Menus:: How to update or create new nodes and menus. * Info Formatting:: Formatting for Info. * Printing:: How to format and print part or all of a file. * LaTeXinfo Mode Summary:: Summary of all the \LaTeX info mode commands. \end{menu} \node Emacs Editing, Inserting, LaTeXinfo Mode, LaTeXinfo Mode \begin{ifinfo} \section*{The Usual Editing Commands } \end{ifinfo} \beforenoterule \begin{implementation} In \LaTeX info mode the paragraph separation variable and syntax table are redefined so that \LaTeX info commands that should be on lines of their own are not inadvertently included in paragraphs. Thus, the \kbd{M-q} (\code{fill-paragraph}) command will refill a paragraph but not mix an indexing command on a line adjacent to it into the paragraph.\refill In addition, \LaTeX info mode sets the \code{page-delimiter} variable to the value of \code{latexinfo-chapter-level-regexp}; by default, this is a regular expression matching the commands for chapters and sections. With this value for the page delimiter, you can jump from chapter title to chapter title with the \kbd{C-x ]} (\code{forward-page}) and \kbd{C-x [} (\code{backward-page}) commands and narrow to a chapter with the \kbd{C-x p} (\code{narrow-to-page}) command. (\inforef{Pages, Pages, emacs}, for details about the page commands.)\refill \end{implementation} \afternoterule You may name a \LaTeX info file however you wish, but the convention is to end a \LaTeX info file name with \file{.tex}. Emacs switches to \LaTeX info mode for a file that has \samp{-*-latexinfo-*-} in its first line. If ever you are in another mode and wish to switch to \LaTeX info mode, type \code{M-x latexinfo-mode}.\refill Like all other Emacs features, you can customize or enhance \LaTeX info mode as you wish. In particular, the keybindings are very easy to change. The keybindings described here are the default or standard ones.\refill \node Inserting, Showing the Structure, Emacs Editing, LaTeXinfo Mode \section{Inserting Frequently Used Commands} \cindex{Inserting frequently used commands} \cindex{Frequently used commands, inserting} \cindex{Commands, inserting them} \LaTeX info mode provides commands to insert various frequently used \back -commands into the buffer. You can use these commands to save keystrokes.\refill The insert commands are invoked by typing \kbd{C-c} twice and then the first letter of the \back -command. In the following description, we will list the key sequence, and then the name of the \LaTeX info function that is invoked.\refill \begin{description} \item[C-c C-c c (latexinfo-insert-code)] \findex{latexinfo-insert-code} Insert \code{\back code\{\}} and put the cursor between the braces.\refill \item[C-c C-c d (latexinfo-insert-dfn)] \findex{latexinfo-insert-dfn} Insert \code{\back dfn\{\}} and put the cursor between the braces.\refill \item[C-c C-c e (latexinfo-insert-end)] \findex{latexinfo-insert-end} Insert \code{\back end}.\refill \item[C-c C-c i (latexinfo-insert-item)] \findex{latexinfo-insert-item} Insert \code{\back item} and put the cursor at the beginning of the next line.\refill \item[C-c C-c k (latexinfo-insert-kbd)] \findex{latexinfo-insert-kbd} Insert \code{\back kbd\{\}} and put the cursor between the braces.\refill \item[C-c C-c n (latexinfo-insert-node)] \findex{latexinfo-insert-node} Insert \code{\back node} and a comment line listing the sequence for the `Next', `Previous', and `Up' nodes. Leave cursor after the \code{\back node}.\refill \item[C-c C-c o (latexinfo-insert-noindent)] \findex{latexinfo-insert-noindent} Insert \code{\back noindent} and put the cursor in between.\refill \item[C-c C-c s (latexinfo-insert-samp)] \findex{latexinfo-insert-samp} Insert \code{\back samp\{\}} and put the cursor between the braces.\refill \item[C-c C-c v (latexinfo-insert-var)] \findex{latexinfo-insert-var} Insert \code{\back var\{\}} and put the cursor between the braces.\refill \item[C-c C-c x (latexinfo-insert-example)] \findex{latexinfo-insert-example} Insert \code{\back begin\{example\}} \code{\back end\{example\}} and put the cursor at the beginning of the next line.\refill \c M-\{ was the binding for latexinfo-insert-braces; \c in Emacs 19, backward-paragraph will take this binding. \item[C-c C-c \{ (latexinfo-insert-braces)] \findex{latexinfo-insert-braces} Insert \code{\{\}} and put the cursor between the braces.\refill \item[C-c C-c \} (up-list)] \findex{up-list} Move from between a set of braces forward past the closing brace.\refill \end{description} \beforenoterule \begin{sideremark} \c !!! Enhancement: use C-c C-c C-] for up-list (easier typing) \c !!! Perhaps mention use of C-f instead of up-list? This set of insert commands was created after analyzing the frequency with which different \back -commands are used in the \i{GNU Emacs Manual} and the \i{GDB Manual}. If you wish to add your own insert commands, you can bind a keyboard macro to a key, use abbreviations, or extend the code in \file{latexinfo-mde.el}.\refill \end{sideremark} \afternoterule \node Showing the Structure, Updating Nodes and Menus, Inserting, LaTeXinfo Mode \section{Showing the Section Structure of a File} \cindex{Showing the section structure of a file} \cindex{Section structure of a file, showing it} \cindex{Structure of a file, showing it} \cindex{Outline of file structure, showing it} \cindex{Contents-like outline of file structure} \cindex{File section structure, showing it} \cindex{LaTeXinfo file section structure, showing it} You can show the section structure of a \LaTeX info file by using the \kbd{C-c C-s} command (\code{latexinfo-show-structure}). This command shows the section structure of a \LaTeX info file by listing the lines that begin with the \back -commands for \code{\back chapter}, \code{\back section}, and the like. The command constructs what amounts to a table of contents. These lines are displayed in another buffer called the \samp{*Occur*} buffer. In that buffer, you can position the cursor over one of the lines and use the \kbd{C-c C-c} command (\code{occur-mode-goto-occurrence}), to jump to the corresponding spot in the \LaTeX info file.\refill \begin{description} \item[C-c C-s (latexinfo-show-structure)] \findex{latexinfo-show-structure} Show the \code{\back chapter}, \code{\back section}, and such lines of a \LaTeX info file.\refill \item[C-c C-c (occur-mode-goto-occurrence)] \findex{occur-mode-goto-occurrence} Go to the line in the \LaTeX info file corresponding to the line under the cursor in the \file{*Occur*} buffer.\refill \end{description} If you call \code{latexinfo-show-structure} with a prefix argument by typing \kbd{C-u C-c C-s}, it will list not only those lines with the \back -commands for \code{\back chapter}, \code{\back section}, and the like, but also the \code{\back node} lines. You can use \code{latexinfo-show-structure} with a prefix argument to inspect whether the `Next', `Previous', and `Up' pointers of a node line are correct.\refill Often, when you are working on a manual, you will be interested only in the structure of the current chapter. In this case, you can mark off the region of the buffer that you are interested in with the \kbd{C-x n} (\code{narrow-to-region}) command and \code{latexinfo-show-structure} will work on only that region. To see the whole buffer again, use \kbd{C-x w} (\code{widen}). (\inforef{Narrowing, Narrowing, emacs}, for more information about the narrowing commands.)\refill \vindex{page-delimiter} \cindex{Page delimiter in LaTeXinfo mode} In addition to providing the \code{latexinfo-show-structure} command, \LaTeX info mode sets the value of the page delimiter variable to match the chapter-level \back -commands. This enables you to use the \kbd{C-x ]} (\code{forward-page}) and \kbd{C-x [} (\code{backward-page}) commands to move forward and backward by chapter, and to use the \kbd{C-x p} (\code{narrow-to-page}) command to narrow to a chapter. \inforef{Pages, Pages, emacs}, for more information about the page commands.\refill \xref{Using latexinfo-show-structure}, for how to detect formatting errors using this command. \node Updating Nodes and Menus, Updating Commands, Showing the Structure, LaTeXinfo Mode \section{Updating Nodes and Menus} \cindex{Updating nodes and menus} \cindex{Create nodes, menus automatically} \cindex{Insert nodes, menus automatically} \cindex{Automatically insert nodes, menus } \LaTeX info mode provides commands for automatically creating or updating menus and node pointers. The commands are called ``update'' commands because their most frequent use is for updating a \LaTeX info file after you have worked on it.\refill \begin{menu} * Updating Commands:: Five major updating commands. * Updating Requirements:: How to structure a \LaTeX info file for using the updating command. * Other Updating Commands:: Indenting descriptions, inserting missing nodes lines, and updating nodes in sequence. * latexinfo-multiple-files-update:: \protect\code{latexinfo-multiple-files-update} \end{menu} \node Updating Commands, Updating Requirements, Updating Nodes and Menus, Updating Nodes and Menus \begin{ifinfo} \subsection*{The Updating Commands} \end{ifinfo} You can use the updating commands \begin{itemize} \item to insert or update the `Next', `Previous', and `Up' pointers of a node,\refill \item to insert or update the menu for a section, and\refill \item to create a master menu for a \LaTeX info source file.\refill \end{itemize} \noindent You can also use the commands to update all the nodes and menus in a region or in a whole \LaTeX info file.\refill \LaTeX info mode has five updating commands that are used most often: two are for updating the node pointers or menu of a single node (or a region), two are for updating every node pointer and menu in a file, and one, the \code{latexinfo-master-menu} command, is for creating a master menu for a complete file, and optionally, for updating every node and menu in the whole \LaTeX info file.\refill The \code{latexinfo-master-menu} command is the primary command:\refill \begin{description} \item[C-c C-u m (latexinfo-master-menu)] \findex{latexinfo-master-menu} Create or update a master menu that includes all the other menus (incorporating the descriptions from pre-existing menus, if any).\refill With an argument (prefix argument, if interactive), first create or update all the nodes and all the regular menus in the buffer before constructing the master menu. (\xref{The Top Node, , The Top Node and Master Menu}, for more about a master menu.) For \code{latexinfo-master-menu} to work, the \LaTeX info file must have a node called `Top'.\refill \end{description} \begin{quote} After extensively editing a \LaTeX info file, it is common to type \kbd{C-u C-c C-u m} or \kbd{C-u M-x latexinfo-master-menu} to update all the nodes and menus completely and all at once.\refill \end{quote} The other major updating commands do smaller jobs and are designed for the person who updates nodes and menus as he or she writes a \LaTeX info file. These commands are:\refill \begin{description} \item[C-c C-u C-n (latexinfo-update-node)] \findex{latexinfo-update-node} Insert the `Next', `Previous', and `Up' pointers for the node point is within (i.e., for the \code{\back node} line preceding point). If the \code{\back node} line has pre-existing `Next', `Previous', or `Up' pointers in it, the old pointers are removed and new ones inserted. With an argument (prefix argument, if interactive), this command updates all \code{\back node} lines in the region (which is the text between point and mark).\refill \item[C-c C-u C-m (latexinfo-make-menu)] \findex{latexinfo-make-menu} Create or update the menu in the node that point is within. With an argument (prefix argument, if interactive), the command makes or updates menus for the nodes within or part of the region.\refill Whenever \code{latexinfo-make-menu} updates an existing menu, the descriptions from that menu are incorporated into the new menu. This is done by copying descriptions from the existing menu to the entries in the new menu that have the same node names. If the node names are different, the descriptions are not copied to the new menu.\refill \c !!! latexinfo-make-menu should offer user a buffer with descriptions \c !!! in it so the user can edit them. Menu entries that refer to other Info files are removed since they do not refer to nodes within the current buffer. This is a deficiency.\refill \item[C-c C-u C-e (latexinfo-every-node-update)] \findex{latexinfo-every-node-update} Insert or update the `Next', `Previous', and `Up' pointers for every node in the buffer .\refill \item[C-c C-u C-a (latexinfo-all-menus-update)] \findex{latexinfo-all-menus-update} Create or update all the menus in the buffer. With an argument (prefix argument, if interactive), first insert or update all the node pointers before working on the menus.\refill If a master menu exists, the \code{latexinfo-all-menus-update} command updates it; but the command does not create a new master menu if none already exists. (Use the \code{latexinfo-master-menu} command for that.)\refill \end{description} \beforenoterule \begin{implementation} The \code{latexinfo-column-for-description} variable specifies the column to which menu descriptions are indented. By default, the value is 32 although it is often useful to reduce it to as low as 24. You can set the variable with the \kbd{M-x edit-options} command (\inforef{Edit Options, Editing Variable Values, emacs}), or with the \kbd{M-x set-variable} command (\inforef{Examining, Examining and Setting Variables, emacs}).\refill \end{implementation} \afternoterule Also, the \code{latexinfo-indent-menu-description} command may be used to indent existing menus to a specified column.Finally, if you wish, you can use the \code{latexinfo-insert-node-lines} command to insert missing \code{\back node} lines into a file. (\xref{Other Updating Commands}, for more information.)\refill \clearpage \node Updating Requirements, Other Updating Commands, Updating Commands, Updating Nodes and Menus \subsection{Updating Requirements} \cindex{Updating requirements} \cindex{Requirements for updating commands} To use the updating commands, you must organize the \LaTeX info file hierarchically with chapters, sections, subsections, and the like. Each \code{\back node} line, with the exception of the line for the `Top' node, must be followed by a line with a structuring command such as \code{\back chapter}, \code{\back section}, or \code{\back unnumberedsubsec}. Each \code{\back node} line/structuring-command line combination must look either like this:\refill \begin{example} \begin{same} \back node Comments, Minimum, Conventions, Overview \back comment node-name, next, previous, up \back section\{Comments\} \end{same} \end{example} or like this (without the \code{\back comment} line): \begin{example} \begin{same} \back node Comments, Minimum, Conventions, Overview \back section\{Comments\} \end{same} \end{example} \noindent (In this example, `Comments' is the name of both the node and the section. The next node is called `Minimum' and the previous node is called `Conventions'. The `Comments' section is within the `Overview' node, which is specified by the `Up' pointer.) If a file has a `Top' node, it must be called \samp{top} or \samp{Top} and be the first node in the file.\refill \node Other Updating Commands, latexinfo-multiple-files-update, Updating Requirements, Updating Nodes and Menus \subsection{Other Updating Commands} In addition to the five major updating commands, \LaTeX info mode possesses several less frequently used updating commands.\refill \begin{description} \item[C-c C-u C-i (latexinfo-insert-node-lines)] \findex{latexinfo-insert-node-lines} Insert \code{\back node} before the \code{\back chapter}, \code{\back section}, and other sectioning commands wherever it is missing throughout a region in a \LaTeX info file. With an argument (prefix argument, if interactive), the \code{latexinfo-insert-node-lines} command not only inserts \code{\back node} lines but also inserts the chapter or section titles as the names of the corresponding nodes; and it inserts their titles for node names in pre-existing \code{\back node} lines that lack names. Since node names should be more concise than section or chapter titles, node names so inserted should be edited manually. Also, section titles cannot contain commas if this command is used, or else only the title yp to the first comma will be used.\refill \item[C-c C-u C-f (latexinfo-multiple-files-update)] \findex{latexinfo-multiple-files-update} Update nodes and menus in a document built from several separate files. With a prefix argument if called interactively (a non-\code{nil} `make-master-menu' argument, if called non-interactively), create and insert a master menu in the outer file. With a numeric prefix argument if called interactively (a non-\code{nil} `update-everything' argument if called non-interactively), first update all the menus and all the `Next', `Previous', and `Up' pointers of all the included files before creating and inserting a master menu in the outer file. The \code{latexinfo-multiple-files-update} command is described in the section on \code{\back include} files. \xref{Include Files}.\refill \item[C-c C-u C-d (latexinfo-indent-menu-description)] \findex{latexinfo-indent-menu-description} Indent every description in the menu following point to the specified column. You can use this command to give yourself more space for descriptions. With an argument (prefix argument, if interactive), the \code{latexinfo-indent-menu-description} command indents every description in every menu in the region. However, this command does not indent the second and subsequent lines of a multi-line description.\refill \item[C-c C-u C-s (latexinfo-sequential-node-update)] \findex{latexinfo-sequential-node-update} Insert the names of the nodes immediately following and preceding the current node as the `Next' or `Previous' pointers regardless of those nodes' hierarchical level. This means that the `Next' node of a subsection may well be the next chapter. Sequentially ordered nodes are useful for documents that you read through sequentially. (However, in Info, the \code{g* \key{RET}} command lets you look through the file sequentially, so sequentially ordered nodes are not strictly necessary.) With an argument (prefix argument, if interactive), the \code{latexinfo-sequential-node-update} command sequentially updates all the nodes in the region.\refill \end{description} \node latexinfo-multiple-files-update, Info Formatting, Other Updating Commands, Updating Nodes and Menus \subsection{\protect\code{latexinfo-multiple-files-update}} \findex{latexinfo-multiple-files-update} The \code{latexinfo-multiple-files-update} command creates or updates `Next', `Previous', and `Up' pointers of included files as well as those in the outer or over all \LaTeX info file, and it creates or updates a main menu in the outer file. \xref{Include Files}. Depending whether you call it with optional arguments, it updates only the pointers in the first \code{\back node} line of the included files or all of them.\refill \begin{description} \item[C-u C-c C-u C-f (latexinfo-multiple-files-update)] Called without any arguments, will:\refill \begin{itemize} \item Create or update the `Next', `Previous', and `Up' pointers of the first \code{\back node} line in each file included in an outer or overall \LaTeX info file.\refill \item Create or update the `Top' level node pointers of the outer or overall file.\refill \item Create or update a main menu in the outer file.\refill \end{itemize} \item[C-u C-c C-u C-f (latexinfo-multiple-files-update)] Called with a prefix argument (a non-\code{nil} \var{make-master-menu} argument, if called from a program), create and insert a master menu in the outer file in addition to creating or updating pointers in the first \code{\back node} line in each included file and creating or updating the `Top' level node pointers of the outer file. The master menu is made from all the menus in all the included files.\refill \item[C-u 8 C-c C-u C-f (latexinfo-multiple-files-update)] Called with a numeric prefix argument (a non-\code{nil} \var{update-everything} argument, if called from a program):\refill \begin{itemize} \item Create or update the `Top' level node pointers of the outer or overall file.\refill \item Create or update \emph{all} the `Next', `Previous', and `Up' pointers of all the included files.\refill \item Create or update \emph{all} the menus of all the included files.\refill \item And then create a master menu in the outer file. This is similar to invoking \code{latexinfo-master-menu} with an argument when you are working with just one file.\refill \end{itemize} \end{description} \noindent Note the use of the prefix argument in interactive use: with a regular prefix argument, just \kbd{C-u}, the \code{latexinfo-multiple-files-update} command inserts a master menu; with a numeric prefix argument, such as \kbd{C-u 8}, the command updates every pointer and menu in all the files and then inserts a master menu.\refill \node Info Formatting, Printing, latexinfo-multiple-files-update, LaTeXinfo Mode \section{Formatting for Info} \cindex{Formatting for Info} \cindex{Running an Info formatter} \cindex{Info formatting} \LaTeX info mode provides several commands for formatting part or all of a \LaTeX info file for Info. Often, when you are writing a document, you want to format only part of a file---that is, a region. You can use the \code{latexinfo-format-region} command to format a region.\refill \begin{description} \findex{latexinfo-format-region} \item[C-c C-e C-r (latexinfo-format-region)] Format the current region for Info.\refill \end{description} You can use the \code{latexinfo-format-buffer} command to format a whole buffer:\refill \begin{description} \findex{latexinfo-format-buffer} \item[C-c C-e C-b (latexinfo-format-buffer)] Format the current buffer for Info.\refill \end{description} \begin{quote} After writing a \LaTeX info file, you can type \kbd{C-u C-c C-u m} or \kbd{C-u M-x latexinfo-master-menu} to update all the nodes and menus and then type \kbd{C-c C-u b} or \kbd{M-x latexinfo-format-buffer} to create an Info file. \end{quote} For the Info formatting commands to work, the file \emph{must} include a line that has \code{\back setfilename} in its header. \xref{Creating and Installing an Info File}, for details about Info formatting.\refill \clearpage \node Printing, LaTeXinfo Mode Summary, Info Formatting, LaTeXinfo Mode \section{Formatting and Printing} \cindex{Formatting for printing} \cindex{Printing a region or buffer} \cindex{Region formatting and printing} \cindex{Buffer formatting and printing} \cindex{Part of file formatting and printing} Typesetting and printing a \LaTeX info file is a multi-step process in which you first create a file for printing (called a \scap{dvi} file), and then you print the file. Optionally, also, you may create indices.\refill Often, when you are writing a document, you want to typeset and print only part of a file, to see what it will look like. You can use the \code{latexinfo-latex-region} and related commands for this purpose. Use the \code{latexinfo-latex-buffer} command to format all of a buffer.\refill \begin{description} \item[C-c C-t C-r (latexinfo-latex-region)] \findex{latexinfo-latex-region} Run \LaTeX{} on the region.\refill \item[C-c C-t C-b (latexinfo-latex-buffer)] \findex{latexinfo-latex-buffer} Run \LaTeX{} on the buffer.\refill \item[C-c C-t C-i (latexinfo-latexindex)] Sort the indices of a \LaTeX info file formatted with \code{latexinfo-latex-region} or \code{latexinfo-latex-buffer}. You must run the \code{latex} command a second time after sorting the raw index files.\refill \item[C-c C-t C-p (latexinfo-latex-print)] \findex{latexinfo-latex-print} Print the file (or the part of the file) previously formatted with \code{latexinfo-latex-buffer} or \code{latexinfo-latex-region}.\refill \end{description} \noindent For \code{latexinfo-latex-region} or \code{latexinfo-latex-buffer} to work, the file \emph{must} start with a \samp{\back documentstyle} line and must include an \code{\back setfilename} command as an end of header line. The file must end with \code{\back end\{document\}} on a line by itself.\refill \xref{Printing Hardcopy}, for a description of the other \LaTeX{} related commands, such as \code{latexinfo-latexindex} and \code{latex-show-print-queue}.\refill \clearpage \node LaTeXinfo Mode Summary, Printing Hardcopy, Printing, LaTeXinfo Mode \section{LaTeXinfo Mode Summary} \cpsubindex{LaTeXinfo Mode}{Summary} In \LaTeX info mode, each set of commands has default keybindings that begin with the same keys. All the commands that are custom-created for \LaTeX info mode begin with \kbd{C-c}. The keys that follow are arranged mnemonically.\refill \begin{description} \item[Insert Commands] The insert commands begin with \kbd{C-c} twice and then the first letter of the \back -command to be inserted.\refill \begin{example} C-c C-c c \r{Insert} \samp{\back code}. C-c C-c d \r{Insert} \samp{\back dfn}. C-c C-c e \r{Insert} \samp{\back end\{\}}. C-c C-c i \r{Insert} \samp{\back item}. C-c C-c n \r{Insert} \samp{\back node}. C-c C-c s \r{Insert} \samp{\back samp}. C-c C-c v \r{Insert} \samp{\back var}. C-c C-c \{ \r{Insert braces.} C-c C-c \} \r{Move out of enclosing braces.} \end{example} \item[Show Structure] \code{latexinfo-show-structure} is often used within a narrowed region. \begin{example} C-c C-s \r{List all the headings.} \end{example} \item[The Master Update Command] The \code{latexinfo-master-menu} command creates a master menu; and can be used to update every node and menu in a file as well.\refill \begin{example} C-c C-u m \r{Create or update a master menu.} C-u C-c C-u m \r{First create or update all nodes and regular menus.} \end{example} \item[Update Pointers] The update pointer commands begin with \kbd{C-c C-u}: \begin{example} C-c C-u C-n \r{Update a node.} C-c C-u C-e \r{Update every node in the buffer.} \end{example} \item[Update Menus] The update menu commands begin with \kbd{C-c C-u}. You may precede a \kbd{C-c C-u C-a} so as to update both nodes and menus.\refill \begin{example} C-c C-u C-m \r{Make or update a menu.} C-c C-u C-a \r{Make or update all the menus in a buffer;} C-u C-c C-u C-a \r{first update all the nodes.} \end{example} \item[Format for Info] The Info formatting commands begin with \kbd{C-c C-e}: \begin{example} C-c C-e C-r \r{Format the region.} C-c C-e C-b \r{Format the buffer.} \end{example} \item[Typeset and Print] The typesetting and printing commands begin with \kbd{C-c C-t}:\refill \begin{example} C-c C-t C-r \r{Run \LaTeX{} on the region.} C-c C-t C-b \r{Run \LaTeX{} on the buffer.} C-c C-t C-i \r{Run} \code{latexindex}. C-c C-t C-p \r{Print the \scap{dvi} file.} C-c C-t C-q \r{Show the print queue.} C-c C-t C-d \r{Delete a job from the print queue.} C-c C-t C-k \r{Kill the current \LaTeX{} formatting job.} C-c C-t C-x \r{Quit a currently stopped \LaTeX{} formatting job.} C-c C-t C-l \r{Recenter the output buffer.} \end{example} \item[Other Updating Commands] The `other updating commands' begin with \kbd{C-c C-u} \begin{example} C-c C-u C-i \r{Insert missing node lines using} \r{section titles as node names.} C-c C-u C-f \r{Update a multi-file document.} C-c C-u C-d \r{Indent descriptions.} C-c C-u C-s \r{Insert node pointers in strict sequence.} \end{example} \end{description} \node Printing Hardcopy, How to Print, LaTeXinfo Mode Summary, Top \chapter{Printing Hardcopy} \cindex{Printing hardcopy} \cindex{Hardcopy, printing it} \cindex{Making a printed manual} \cindex{Sorting indices} \cindex{Indices, sorting} \cindex{LaTeX index sorting} \findex{latexindex} The typesetting program \LaTeX{} is used for formatting a \LaTeX info file. \LaTeX{} is a very powerful typesetting program and, if used correctly, does an exceptionally good job.\refill There are three major stages for printing hardcopy of a \LaTeX info file. One is for formatting the file, the second is for sorting the index, and the third is 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 of GNU Emacs.\refill Instead of shell commands, you can use commands provided by \LaTeX info mode. In addition to three commands to format a file, sort the indices, and print the result, \LaTeX info mode offers key bindings for commands to recenter the output buffer, show the print queue, and delete a job from the print queue.\refill \begin{menu} * How to Print:: How to print a hardcopy manual with shell commands. * Printing from Emacs:: How to print from an Emacs shell. * LaTeXinfo Mode Printing:: How to format and print in \LaTeX info mode. * Compile-Command:: How to print using Emacs's compile command. * Preparing for LaTeX:: Preparing for Use of \LaTeX{} * Overfull Hboxes:: What are and what to do with overfull hboxes. \end{menu} \node How to Print, Printing from Emacs, Printing Hardcopy, Printing Hardcopy \section{How to Print Using Shell Commands} \cindex{\scap{dvi} file} Format the \LaTeX info file with the shell command \code{latex} followed by the name of the \LaTeX info file. This produces a formatted \scap{dvi} file as well as several auxiliary files containing indices, cross references, etc. The \scap{dvi} file (for \dfn{DeVice Independent} file) can be printed on a wide variety of printers.\refill The \code{latex} formatting command itself does not sort the indices; it writes an output file of unsorted index data. Hence, to generate a printed index, you first need a sorted index to work from. The \code{latexindex} command sorts indices.\footnote{The source file \file{latexindex.c} comes as part of the standard \LaTeX info distribution and is usually installed when \LaTeX info is installed.}\refill \findex{latexindex} \begin{ignore} Usage: latexindex [-k] [-T tempdir] infile [-o outfile] ... Each infile arg can optionally be followed by a `-o outfile' arg; for each infile that isn't followed by a -o arg, the infile name with `s' (for `sorted') appended is used for the outfile. -T dir is the directory to put temp files in, instead of /tmp. -k means `keep tempfiles', for debugging. \end{ignore} The \code{latex} 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 \code{latex} 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 \file{foo.tex} would be \file{foo.cp}, \file{foo.vr}, \file{foo.fn}, \file{foo.tp}, \file{foo.pg} and \file{foo.ky}. Those are exactly the arguments to give to \code{latexindex}. Or else, under Unix you can use \samp{??} as ``wild-cards'' and give the command in this form:\refill \begin{example} latexindex foo.?? \end{example} \noindent This command will run \code{latexindex} on all the unsorted index files. (You may execute \samp{latexindex foo.??} even if there are similarly named files with two letter extensions that are not index files, such as \samp{foo.el}. The \code{latexindex} command reports but otherwise ignores such files.) For each file specified, \code{latexindex} generates a sorted index file whose name is made by appending \samp{s} to the input file name. The \code{\back printindex} command knows to look for a file of that name. \code{latexindex} does not alter the raw index output file.\refill If you have a bibliography, you must also run the \BibTeX\ program on the \samp{aux} file generated by \LaTeX. For example, \begin{example} bibtex foo.aux \end{example} After you have sorted the indices or formatted the bibliography, you need to rerun the \code{latex} formatting command on the \LaTeX info file. This regenerates a formatted \scap{dvi} file with up-to-date index entries.\footnote{If you use more than one index and have cross references to an index other than the first, you must run \code{latex} \emph{three times} to get correct output: once to generate raw index data; again (after \code{latexindex}) 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. This may also be necessary to update the table of contents if the number of pages used by the indices or bibliography changed.}\refill To summarize, this is a three step process: \begin{enumerate} \item Run the \code{latex} formatting command on the \LaTeX info file. This generates the formatted \scap{dvi} file as well as the raw index files with two letter extensions.\refill \item Run the shell command \code{latexindex} on the raw index files to sort them. This creates the corresponding sorted index files.\refill \item Run the shell command \code{bibtex} on the raw index files to format the bibliography. This creates the corresponding \samp{.bbl} file.\refill \item Rerun the \code{latex} formatting command on the \LaTeX info file. This regenerates a formatted \scap{dvi} file with the index entries in the correct order. This second run also makes all the cross references correct as well.\refill \end{enumerate} You need not run \code{latexindex} each time after you run the \code{latex} formatting. If you don't, on the next run, the \code{latex} formatting command will use whatever sorted index files happen to exist from the previous use of \code{latexindex}. This is usually \scap{ok} while you are in the early stages of writing a document.\refill Rather than type the \code{latex, bibtex} and \code{latexindex} commands yourself, you can use the shell script \code{latex2dvi}. This shell script is designed to simplify the \code{latex}, \code{latexindex}, \code{bibtex}, \code{latex} sequence by figuring out whether index files and \scap{dvi} files are up-to-date. It runs \code{latexindex} and \code{latex} only when necessary. The syntax for \code{latex2dvi} is like this (where \samp{%} is the shell prompt):\refill \findex{latex2dvi \r{(shell script)}} \begin{example} % latex2dvi \var{filenames}\dots{} \end{example} \findex{lpr \r{(\scap{dvi} print command)}} Finally, you can print a \scap{dvi} file with the \scap{dvi} print command. The precise command to use depends on the system; \samp{lpr -d} is common. The \scap{dvi} print command may require a file name without any extension or with a \samp{.dvi} extension.\refill The following commands, for example, sort the indices, format, and print the \i{Foo Lisp Manual} (where \samp{%} is the shell prompt):\refill \begin{example} % latex foo.tex % latexindex foo.?? % bibtex foo.aux % latex foo.tex % lpr -d foo.dvi \end{example} \noindent (Remember that the shell commands may be different at your site; but these are commonly used versions.)\refill \node Printing from Emacs, LaTeXinfo Mode Printing, How to Print, Printing Hardcopy \section{Printing from an Emacs Shell} \cindex{Printing from an Emacs shell} \cindex{Shell, printing from} \cindex{Emacs shell, printing from} \cindex{GNU Emacs shell, printing from} You can give formatting and printing commands from a shell within GNU Emacs. To create a shell within Emacs, type \kbd{M-x shell}. In this shell, you can format and print the document. \xref{How to Print, , How to Print Using Shell Commands}, for details.\refill You can switch to and from the shell buffer while \code{latex} 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 \code{latex2dvi} from an Emacs shell. (\xref{How to Print, , How to Print Using Shell Commands}.) \begin{ifinfo} \xref{LaTeXinfo Mode Printing}, for more information about formatting and printing in \LaTeX info mode.\refill \end{ifinfo} \node LaTeXinfo Mode Printing, Compile-Command, Printing from Emacs, Printing Hardcopy \section{Formatting and Printing in LaTeXinfo Mode} \cindex{Region printing in LaTeXinfo mode} \cindex{Format and print in LaTeXinfo mode} \cindex{Print and format in LaTeXinfo mode} \LaTeX info mode provides several predefined key commands for \LaTeX{} formatting and printing. These include commands for sorting indices, looking at the printer queue, killing the formatting job, and recentering display of the buffer in which the operations occur.\refill \begin{description} \item[C-c C-t C-r (latexinfo-latex-region)] Run \LaTeX{} on the current region.\refill \item[C-c C-t C-b (latexinfo-latex-buffer)] Run \LaTeX{} on the current buffer.\refill \item[C-c C-t C-i (latexinfo-latexindex)] Sort the indices of a \LaTeX info file formatted with \code{latexinfo-latex-region} or \code{latexinfo-latex-buffer}.\refill \item[C-c C-t C-p (latexinfo-latex-print)] Print a \scap{dvi} file that was made with \code{latexinfo-latex-region} or \code{latexinfo-latex-buffer}.\refill \item[C-c C-t C-q (latexinfo-show-latex-print-queue)] Show the print queue.\refill \item[C-c C-t C-d (latexinfo-delete-from-latex-print-queue)] Delete a job from the print queue; you will be prompted for the job number shown by a preceding \kbd{C-c C-t C-q} command (\code{latexinfo-show-latex-print-queue}).\refill \item[C-c C-t C-k (latexinfo-kill-latex-job)] Kill the currently running \LaTeX{} job started by \code{latexinfo-latex-region} or \code{latexinfo-latex-buffer}, or any other process running in the \LaTeX info shell buffer.\refill \item[C-c C-t C-x (latexinfo-quit-latex-job)] Quit a \LaTeX{} formatting job that has stopped because of an error by sending an \key{x} to it. When you do this, \LaTeX{} preserves a record of what it did in a \file{.log} file.\refill \item[C-c C-t C-l (latexinfo-recenter-latex-output-buffer)] Redisplay the shell buffer in which the \LaTeX{} printing and formatting commands are run to show its most recent output.\refill \end{description} Thus, the usual sequence of commands for formatting a buffer is as follows (with comments to the right):\refill \begin{table} \begin{tabular}{||l|l||} \hline \kbd{C-c C-t C-b} & Run \LaTeX{} on the buffer. \\ \kbd{C-c C-t C-i} & Sort the indices. \\ \kbd{C-c C-t C-b} & Rerun \LaTeX{} to regenerate indices. \\ \kbd{C-c C-t C-p} & Print the \scap{dvi} file. \\ \kbd{C-c C-t C-q} & Display the printer queue. \\ \hline \end{tabular} \caption{Formatting a Buffer Commands} \end{table} The \LaTeX info mode \LaTeX{} formatting commands start a subshell in Emacs called the \file{*latexinfo-latex-shell*}. The \code{latexinfo-latex-command}, \code{latexinfo-latexindex-command}, and \code{latex-dvi-print-command} commands are all run in this shell. You can watch the commands operate in the \samp{*latexinfo-latex-shell*} buffer, and you can switch to and from and use the \samp{*latexinfo-latex-shell*} buffer as you would any other shell buffer.\refill The formatting and print commands depend on the values of several variables. The default values are:\refill \need{700} \begin{table} \begin{tabular}{||l|l||} \hline Variable & Default value \\ \hline latexinfo-latex-command & "latex" \\ latexinfo-latexindex-command & "latexindex" \\ latexinfo-latex-shell-cd-command & "cd" \\ latexinfo-latex-dvi-print-command & "lpr -d" \\ latexinfo-show-latex-queue-command & "lpq" \\ latexinfo-delete-from-print-queue-command & "lprm" \\ latexinfo-start-of-header & "\back begin\{document\}" \\ latexinfo-end-of-header & "\back setfilename" \\ latexinfo-latex-trailer & "\back end\{document\}" \\ \hline \end{tabular} \caption{Formatting a Document Commands} \end{table} The default values of \code{latexinfo-latex-command} and \code{latexinfo-latexindex-command} are set in the \file{latexnfo-tex.el} file.\refill You can change the values of these variables with the \kbd{M-x edit-options} command (\inforef{Edit Options, Editing Variable Values, emacs}), with the \kbd{M-x set-variable} command (\inforef{Examining, Examining and Setting Variables, emacs}), or with your \file{.emacs} initialization file (\inforef{Init File, Init File, emacs}).\refill \node Compile-Command, Preparing for LaTeX, LaTeXinfo Mode Printing, Printing Hardcopy \section{Using the Local Variables List} \cindex{Local variables} \cindex{Compile command for formatting} \cindex{Format with the compile command} Yet another way to apply the \LaTeX{} formatting command to a \LaTeX info file is to put that command in a \dfn{local variables list} at the end of the \LaTeX info file. You can then specify the \LaTeX{} formatting command as a \code{compile-command} and have Emacs run the \LaTeX{} formatting command by typing \kbd{M-x compile}. This creates a special shell called the \samp{*compilation buffer*} in which Emacs runs the compile command. For example, at the end of the \file{gdb.texinfo} file, after the \code{\back end\{document\}}, you would put the following:\refill \begin{example} \back c Local Variables: \back c compile-command: "latex2dvi foo.tex" \back c End: \end{example} \noindent This technique is most often used by programmers who also compile \samp{C} programs this way. (\inforef{Compilation, Compilation, emacs}.)\refill Usually, the file's first line contains an \samp{\back c -*-latexinfo-*-} comment that causes Emacs to switch to \LaTeX info mode when you edit the file. In addition, the beginning must include a \code{\back begin\{document\}}. After this follows the title page, a copyright page, and permissions, and a table of contents. Besides an \code{\back end\{document\}}, the end of a file usually includes indices and the bibliography.\refill \node Preparing for LaTeX, Overfull Hboxes, Compile-Command, Printing Hardcopy \section{Preparing for Use of \protect\LaTeX{}} \cindex{Preparing for use of \LaTeX{}} \cindex{LaTeX input initialization} \cindex{\code{TEXINPUTS} environment variable} \vindex{TEXINPUTS} \cindex{\b{.profile} initialization file} \cindex{\b{.login} initialization file} \cindex{Initialization file for \LaTeX{} input} You must put \code{latexinfo} as an option to the \code{documentstyle} of every \LaTeX info file to tell \LaTeX\ to use the \file{latexinfo.sty} file when it is processing the \LaTeX info source file. Otherwise \LaTeX\ will not know what to do with the commands. \xref{The Documentstyle}. If \LaTeX info has been installed properly, \LaTeX\ should find the file automatically. \xref{Installing LaTeXinfo}, if you have troubles. \node Overfull Hboxes, Catching Formatting Mistakes, Preparing for LaTeX, Printing Hardcopy \section{Overfull ``Hboxes''} \cindex{Overfull ``Hboxes''} \cindex{Hboxes, overfull} \cindex{Final output} \LaTeX{} is sometimes unable to typeset a line without extending it into the right margin. This can occur when \LaTeX{} 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, \LaTeX{} prints an error message like this:\refill \begin{example} Overfull \back hbox (20.76302pt too wide) \end{example} \noindent (In \LaTeX, lines are in ``horizontal boxes'', hence the term, ``hbox''.)\refill \LaTeX{} also provides the line number in the \LaTeX info source file and the text of the offending line, which is marked at all the places that \LaTeX{} knows how to hyphenate words.\refill If the \LaTeX info 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.\refill \cindex{Black rectangle in hardcopy} \cindex{Rectangle, ugly, black in hardcopy} \findex{finalout} However, if you do leave an overfull hbox, unless told otherwise, \LaTeX{} will print a large, ugly, black rectangle beside the line. This is so you will notice the location of the problem if you are correcting a draft. To prevent such a mark from marring your final printout, put the following in the beginning of the \LaTeX info file on a line of its own, before the \code{\back maketitle} command:\refill \begin{example} \back finalout \end{example} \node Catching Formatting Mistakes, Debugging with Info, Overfull Hboxes, Top \chapter{Catching Formatting Mistakes} \cindex{Structure, Catching Formatting Mistakes in} \cindex{Nodes, Catching Formatting Mistakes} \cindex{Catching Formatting Mistakes} \cindex{Correcting mistakes} \cindex{Mistakes, catching} \cindex{Problems, catching} \cindex{Debugging the LaTeXinfo structure} Besides mistakes with the content of what ever you are describing, there are two kinds of mistake you can make with \LaTeX info: you can make mistakes with commands, and you can make mistakes with the structure of the nodes and chapters. There are two tools for catching the first kind of mistake and two for catching the second.\refill For finding problems with commands, your best action is to run\\ \kbd{M-x latexinfo-format-region} on regions of your file as you write it. In \LaTeX info mode, the \code{latexinfo-format-region} command is bound to \ctrl{c} \ctrl{f}. In addition, you can run \LaTeX\ on the whole file.\refill For finding problems with the structure of nodes and chapters, you can use \ctrl{c} \ctrl{s} (\code{latexinfo-show-structure}) (\pxref{Using latexinfo-show-structure},) the related \code{occur} command (pxref{Using occur},) and you can use the \kbd{M-x Info-validate} command (\pxref{Running Info-Validate}.) \begin{menu} * Debugging with Info:: How to catch errors with Info formatting. * Debugging with LaTeX:: How to catch errors with \LaTeX{} formatting. * Using latexinfo-show-structure:: How to use \code{latexinfo-show-structure}. * Using occur:: How to list all lines containing a pattern. * Running Info-Validate:: How to find badly referenced nodes. \end{menu} \node Debugging with Info, Debugging with LaTeX, Catching Formatting Mistakes, Catching Formatting Mistakes \section{Catching Errors with Info Formatting} \cindex{Catching errors with Info formatting} \cindex{Debugging with Info formatting} After you have written part of a \LaTeX info file, you can use the\\ \kbd{M-x latexinfo-format-region} command to see whether the region formats properly. In LaTeXinfo Mode, this command is bound to the keyboard command \ctrl{c} \ctrl{f}. If you have made a mistake with a command, \kbd{M-x latexinfo-format-region} will stop processing at or after the error and give an error message. To see where in the file the error occurred, switch to the \samp{*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 the error occurred (or more precisely, where it was detected).\refill The \code{latexinfo-format-region} command sometimes provides slightly odd error messages. For example, if you forget a closing brace,\refill \begin{example} (\back xref\{Catching Formatting Mistakes, for more info.) \end{example} \noindent In this case, \code{latexinfo-format-region} detects the missing closing brace but displays a message that says \samp{Unbalanced parentheses} rather than \samp{Unbalanced braces}. This is because the formatting command looks for mismatches between braces as if they were parentheses.\refill Sometimes \code{latexinfo-format-region} fails to detect mistakes. For example, in the following, the closing brace is swapped with the closing parenthesis:\refill \begin{example} (\back xref\{Catching Formatting Mistakes), for more info.\} \end{example} \noindent Formatting produces: \begin{example} (*Note for more info.: Catching Formatting Mistakes) \end{example} The only way for you to detect this error is to realize that the reference should have looked like this:\refill \begin{example} (*Note Catching Formatting Mistakes::, for more info.) \end{example} \begin{ifinfo} \beforenoterule \begin{sideremark} Incidently, if you are reading this node in Info and type \kbd{f \key{RET}} (\code{Info-follow-reference}), you will generate an error message that says: \begin{example} No such node: "Catching Formatting Mistakes) The only way \dots{} \end{example} \noindent This is because Info perceives the example of the error as the first cross reference in this node and if you type a \key{RET} immediately after typing the Info \kbd{f} command, Info will attempt to go to the referenced node. If you type \kbd{f catch \key{TAB} \key{RET}}, Info will complete the node name of the correctly written example and take you to the `Catching Formatting Mistakes' node. (If you try this, you can return from the `Catching Formatting Mistakes' node by typing \kbd{l} (\code{Info-last}).) \end{sideremark} \afternoterule \end{ifinfo} \c !!! section on using Elisp debugger ignored. \begin{ignore} Sometimes \code{latexinfo-format-region} will stop long after the original error; this is because it does not discover the problem until then. In this case, you will have to backtrack.\refill \c menu \c * Using the Emacs Lisp Debugger:: How to use the Emacs Lisp debugger. \c end menu \c node Using the Emacs Lisp Debugger \c subsection\{Using the Emacs Lisp Debugger\} \c index\{Using the Emacs Lisp debugger\} \c index\{Emacs Lisp debugger\} \c index\{Debugger, using the Emacs Lisp\} If an error is especially elusive, you can turn on the Emacs Lisp debugger and look at the backtrace; this tells you where in the \code{latexinfo-format-region} function the problem occurred. You can turn on the debugger with the command:\refill \begin{example} M-x set-variable \key{RET} debug-on-error \key{RET} t \key{RET} \end{example} \noindent and turn it off with \begin{example} M-x set-variable \key{RET} debug-on-error \key{RET} nil \key{RET} \end{example} Often, when you are using the debugger, it is easier to follow what is going on if you use the Emacs Lisp files that are not byte-compiled. The byte-compiled sources send octal numbers to the debugger that may look mysterious. To use the uncompiled source files, load \file{latexinfo.el} and \file{latexinfo-mde.el} with the \kbd{M-x load-file} command.\refill The debugger will not catch an error if \code{latexinfo-format-region} does not detect one. In the example shown above, \code{latexinfo-format-region} did not find the error when the whole list was formatted, but only when part of the list was formatted. When \code{latexinfo-format-region} did not find an error, the debugger did not find one either. \refill However, when \code{latexinfo-format-region} did report an error, it invoked the debugger. This is the backtrace it produced:\refill \begin{example} ---------- Buffer: *Backtrace* ---------- Signalling: (search-failed "[\},]") re-search-forward("[\},]") (while ...) (let ...) latexinfo-format-parse-args() (let ...) latexinfo-format-xref() funcall(latexinfo-format-xref) (if ...) (let ...) (if ...) (while ...) latexinfo-format-scan() (save-excursion ...) (let ...) latexinfo-format-region(103370 103631) * call-interactively(latexinfo-format-region) ---------- Buffer: *Backtrace* ---------- \end{example} The backtrace is read from the bottom up. \code{latexinfo-format-region} was called interactively; and it, in turn, called various functions, including \code{latexinfo-format-scan}, \code{latexinfo-format-xref} and \code{latexinfo-format-parse-args}. Inside the function \code{latexinfo-format-parse-args}, the function \code{re-search-forward} was called; it was this function that could not find the missing right-hand brace.\refill \xref{Lisp Debug, , Debugging Emacs Lisp, emacs, The GNU Emacs Manual}, for more information.\refill \end{ignore} \node Debugging with LaTeX, Using latexinfo-show-structure, Debugging with Info, Catching Formatting Mistakes \section{Catching Errors with \protect\LaTeX{} Formatting} \cindex{Catching errors with \LaTeX{} formatting} \cindex{Debugging with \LaTeX{} formatting} You can also catch mistakes when you format a file with \LaTeX. Usually, you will want to do this after you have run \code{latexinfo-format-buffer} on the same file, because \code{latexinfo-format-buffer} sometimes displays error messages that make more sense than \LaTeX. (\xref{Debugging with Info}, for more information.)\refill For example, \LaTeX{} was run on a \LaTeX info file, part of which is shown here:\refill \begin{example} ---------- Buffer: latexinfo.tex ---------- name of the latexinfo file as an extension. The \back samp\{??\} are `wildcards' that cause the shell to substitute all the raw index files. (\back xref\{sorting indices, for more information about sorting indices.)\back refill ---------- Buffer: latexinfo.tex ---------- \end{example} \noindent (The cross reference lacks a closing brace.) \LaTeX{} produced the following output, after which it stopped:\refill \begin{example} ---------- Buffer: *latexinfo-latex-shell* ---------- Runaway argument? \{sorting indices, for more information about sorting indices.) \back refill \back ETC. ! Paragraph ended before \back xref was complete. \back par l.27 ? ---------- Buffer: *latexinfo-latex-shell* ---------- \end{example} In this case, \LaTeX{} produced an accurate and understandable error message: \begin{example} Paragraph ended before \back xref was complete. \end{example} \noindent (\samp{\back par} is an internal \LaTeX{} command, which is how it represents a new paragraph marker.) Because the \code{\}} was forgotten from the \code{\back xref} command, \LaTeX noticed that the paragraph ended before the command was complete.\refill Unfortunately, \LaTeX{} is not always so helpful, and sometimes you have to be truly a Sherlock Holmes to discover what went wrong. In any case, if you run into a problem like this, you can do one of two things.\refill \begin{enumerate} \item You can tell \LaTeX{} to continue running and to ignore errors as best it can by typing \kbd{r \key{RET}} at the \samp{?} prompt.\refill 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 \LaTeX{} when it is producing such an avalanche of error messages, type \kbd{C-c} (or \kbd{C-c C-c}, if you running a shell inside of Emacs.))\refill \item You can tell \LaTeX{} to stop this run by typing \kbd{x \key{RET}} at the \samp{?} prompt.\refill \end{enumerate} Sometimes \LaTeX{} will format a file without producing error messages even though there is a problem. This usually occurs if a command is not ended but \LaTeX{} is able to continue processing anyhow. For example, if you fail to end an itemized list with the \code{\back end\{itemize\}} command, \LaTeX{} will write a \scap{dvi} file that you can print out. The only error message that \LaTeX{} will give you is the somewhat mysterious comment that\refill \begin{example} (\back end occurred inside a group at level 1) \end{example} \noindent However, if you print the \scap{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 \LaTeX{} says that it expected to find an \code{\back end} command somewhere in the file; but that it could not determine where it was needed.\refill \node Using latexinfo-show-structure, Using occur, Debugging with LaTeX, Catching Formatting Mistakes \section{Using \protect\code{latexinfo-show-structure}} \cindex{Showing the structure of a file} \findex{latexinfo-show-structure} It is not always easy to keep track of the nodes, chapters, sections, and subsections of a \LaTeX info file. This is especially true if you are revising or adding to a \LaTeX info file that someone else has written.\refill In GNU Emacs, in \LaTeX info mode, the \code{latexinfo-show-structure} command lists all the lines that begin with the \back -commands that specify the structure: \code{\back chapter}, \code{\back section}, \code{\back chapter}, and so on. With an argument (prefix, if interactive), the command also shows the \code{\back node} lines. The \code{latexinfo-show-structure} command is bound to \kbd{C-c C-s} in \LaTeX info mode, by default.\refill The lines are displayed in a buffer called the \samp{*Occur*} buffer. For example, when \code{latexinfo-show-structure} was run on an earlier version of this appendix, it produced the following:\refill \begin{smallexample} Lines matching "^\back \back \back (chapter\back \back |sect\back \back |sub\back \back |unnum\back \back )" in buffer latexinfo.tex. 4:\back chapter\{Catching Formatting Mistakes\} 52:\back section\{Catching Errors with Info Formatting\} 222:\back section\{Catching Errors with \back LaTeX\{\} Formatting\} 338:\back section\{Using \back code\{latexinfo-show-structure\}\} 407:\back subsection\{Using \back code\{occur\}\} 444:\back section\{Finding Badly Referenced Nodes\} 513:\back subsection\{Running \back code\{Info-validate\}\} 573:\back subsection\{Splitting a File Manually\} \end{smallexample} This says that lines 4, 52, and 222 of \file{latexinfo.tex} begin with the \code{\back chapter}, \code{\back section}, and \code{\back section} commands respectively. If you move your cursor into the \samp{*Occur*} window, you can position the cursor over one of the lines and use the \kbd{C-c C-c} command (\code{occur-mode-goto-occurrence}), to jump to the corresponding spot in the \LaTeX info file. \inforef{Other Repeating Search, Using Occur, emacs}, for more information about \code{occur-mode-goto-occurrence}.\refill \beforenoterule \begin{sideremark} The first line in the \samp{*Occur*} window describes the \dfn{regular expression} specified by \var{latexinfo-heading-pattern}. This regular expression is the pattern that \code{latexinfo-show-structure} looks for. \inforef{Regexps, Using Regular Expressions, emacs}, for more information.\refill When you invoke the \code{latexinfo-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 \kbd{C-x n} (\code{narrow-to-region}) command to mark the region. (\inforef{Narrowing, Narrowing, emacs}.) This is how the example used above was generated. To see the whole buffer again, use the command \kbd{C-x w} (\code{widen}).\refill \end{sideremark} \afternoterule If you call \code{latexinfo-show-structure} with a prefix argument by typing \kbd{C-u C-c C-s}, it will list lines beginning with \code{\back node} as well as the lines beginning with the \back -commands for \code{\back chapter}, \code{\back section}, and the like.\refill You can remind yourself of the structure of a \LaTeX info file by looking at the list in the \samp{*Occur*} window; and if you have mis-named a node or left out a section, you can correct the mistake.\refill \node Using occur, Running Info-Validate, Using latexinfo-show-structure, Catching Formatting Mistakes \section{Using \protect\code{occur}} \cindex{Occurrences, listing with \code{\back occur} } \findex{occur} Sometimes the \code{latexinfo-show-structure} command produces too much information. Perhaps you want to remind yourself of the overall structure of a \LaTeX info file, and are overwhelmed by the detailed list produced by \code{latexinfo-show-structure}. In this case, you can use the \code{occur} command directly. To do this, type\refill \begin{example} \kbd{M-x occur} \end{example} \noindent and then, when prompted, type a \dfn{regexp}, a regular expression for the pattern you want to match. (\inforef{Regexps, Regular Expressions, emacs}.) The \code{occur} command works from the current location of the cursor in the buffer to the end of the buffer. If you want to run \code{occur} on the whole buffer, place the cursor at the beginning of the buffer.\refill For example, to see all the lines that contain the word \samp{\back chapter} in them, just type \samp{\back \back chapter}. This will produce a list of the chapters. It will also list all the sentences with \samp{\back chapter} in the middle of the line. If you want to see only those lines that start with the word \samp{\back chapter}, type \samp{^\back \back chapter} when prompted by \code{occur}. If you want to see all the lines that end with a word or phrase, end the last word with a \samp{$}; for example, \samp{Catching Formatting 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.\inforef{Other Repeating Search, Using Occur, emacs}, for more information.\refill \node Running Info-Validate, Using Info-validate, Using occur, Catching Formatting Mistakes \section{Finding Badly Referenced Nodes} \findex{Info-validate} \cindex{Nodes, checking for badly referenced} \cindex{Checking for badly referenced nodes} \cindex{Looking for badly referenced nodes} \cindex{Finding badly referenced nodes} \cindex{Badly referenced nodes } You can use the \code{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 \code{Info-validate} command works only on Info files, not on \LaTeX info files.\refill \begin{menu} * Using Info-validate:: How to run \code{Info-validate}. * Unsplit:: How to create an unsplit file. * Tagifying:: How to tagify a file. * Splitting:: How to split a file manually. \end{menu} \node Using Info-validate, Unsplit, Running Info-Validate, Running Info-Validate \subsection{Running \protect\code{Info-validate}} \cindex{Running \code{Info-validate}} \cindex{Info validating a large file} \cindex{Validating a large file} To use \code{Info-validate}, visit the Info file you wish to check and type:\refill \begin{example} M-x Info-validate \end{example} \noindent (Note that the \code{Info-validate} command requires an upper case `I'. You may also need to create a tag table before running \code{Info-validate}. \xref{Tagifying}.)\refill 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 \samp{*problems in info file*}.\refill For example, \code{Info-validate} was run on a test file that contained only the first node of this manual. One of the messages said:\refill \begin{example} In node "Overview", invalid Next: LaTeXinfo Mode \end{example} \noindent This meant that the node called \samp{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).\refill Now suppose we add a node named \samp{LaTeXinfo Mode} to our test case but we don't specify a `Previous' for this node. Then we will get the following error message:\refill \begin{example} In node "LaTexinfo Mode", should have Previous: Overview \end{example} \noindent This is because every `Next' pointer should be matched by a `Previous' (in the node where the `Next' points) which points back. \code{Info-validate} also checks that all menu items and cross references point to actual nodes.\refill Note that \code{Info-validate} requires a tag table and does not work with files that have been split. (The \code{latexinfo-format-buffer} command automatically splits files larger than 100,000 bytes.) In order to use \code{Info-validate} on a large file, you must run \code{latexinfo-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.\refill \node Unsplit, Tagifying, Using Info-validate, Running Info-Validate \subsection{Creating an Unsplit File} \cindex{Creating an unsplit file} \cindex{Unsplit file creation} You can run \code{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 \code{latexinfo-format-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 \code{Info-validate} and look for badly referenced nodes.\refill The first step is to create an unsplit Info file. To prevent \code{latexinfo-format-buffer} from splitting a \LaTeX info file into smaller Info files, give a prefix to the \kbd{M-x latexinfo-format-buffer} command:\refill \begin{example} C-u M-x latexinfo-format-buffer \end{example} \noindent When you do this, \LaTeX info will not split the file and will not create a tag table for it. \refill \cindex{Making a tag table manually} \cindex{Tag table, making manually} \node Tagifying, Splitting, Unsplit, Running Info-Validate \subsection{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:\refill \begin{example} M-x Info-tagify \end{example} \noindent (Note the upper case \key{I} in \code{Info-tagify}.) This creates an Info file with a tag table that you can validate.\refill The third step is to validate the Info file:\refill \begin{example} M-x Info-validate \end{example} \noindent (Note the upper case \key{I} in \code{Info-validate}.) In brief, the steps are:\refill \begin{example} \begin{same} C-u M-x latexinfo-format-buffer M-x Info-tagify M-x Info-validate \end{same} \end{example} After you have validated the node structure, you can rerun \code{latexinfo-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.\refill \node Splitting, Extending LaTeXinfo, Tagifying, Running Info-Validate \subsection{Splitting a File Manually} \cindex{Splitting an Info file manually} \cindex{Info file, splitting manually} You should split a large file or else let the \code{latexinfo-format-buffer} command do it for you automatically. (Generally you will let one of the formatting commands do this job for you. \xref{Creating and Installing an Info File}.)\refill 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. \xref{Using 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 \code{Info-validate}.)\refill \c Info-split is autoloaded in `loaddefs.el' in Emacs 18.51 \begin{ignore} Before running \code{Info-split}, you need to load the \code{info} library into Emacs by giving the command \kbd{M-x load-library \key{RET} info \key{RET}}. \end{ignore} Visit the file you wish to tagify and split and type the two commands:\refill \begin{example} M-x Info-tagify M-x Info-split \end{example} \noindent (Note that the \samp{I} in \samp{Info} is upper case.)\refill When you use the \code{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 \samp{-} and a number to the original file name.\refill The primary file still functions as an Info file, but it contains just the tag table and a directory of subfiles.\refill \node Extending LaTeXinfo, Optional Style Files, Splitting, Top \chapter{Extending LaTeXinfo} \cindex{Extending LaTeXinfo} One of the advantages of \LaTeX info is that it is easy to add your own extensions. Adding new styles in a standard feature of \LaTeX, and this makes it easy to modularize your additions by plcing them in style files. There are a large number of publically available style files that can be found on the \t{Internet} by \t{anonymous ftp}, for example on \code{soe.clarkson.edu}. In \LaTeX info, you can similarly make additions to the on-line manual generator by making GNU Emacs handlers for your \LaTeX\ extensions. This is the Emacs counterpart to the \code{documentstyle} options. \LaTeX info looks in a specified directory for GNU Elisp code that corresponds to each style file, by looking for the file named \code{\var{style}-fmt.el}. If this file is found, then it is loaded into the Emacs session when \code{latexinfo-format-buffer} is called (\pxref{Creating an Info file}). Look in the \code{styles} and \code{elisp} directories of the \LaTeX info distribution for examples of this, and in the next section we will show a simple example of how this works. \begin{menu} * Optional Style Files:: * LaTeXinfo support for European languages:: * Writing Your Own Style Files:: \end{menu} \node Optional Style Files, The fvpindex Style, Extending LaTeXinfo, Extending LaTeXinfo \section{Optional Style Files} \LaTeX\ provides a number of optional style files by default. These include \code{latexinfo, 11pt, 12pt, twoside} and \code{titlepage}. If any of the optional styles is a member of the Emacs variable \code{latexinfo-known-document-styles}, then \LaTeX info does not bother to look for the associated \code{-fmt} file. By default this list is: \begin{example} '(latexinfo 11pt 12pt twoside titlepage A4 a4 dina4 psfonts format)) \end{example} \begin{menu} * The fvpindex Style:: * Clisp Style:: \end{menu} \node The fvpindex Style, Clisp Style, Optional Style Files, Optional Style Files \subsection{The fvpindex Style} \subsection{fvpindex Style} \cpsubindex{styles}{fvpindex} Let's say that you wanted to develop a special style for a program, which defined the command \code{\back f} to be used for specifying functions. This command would put its argument in the function index, and set the function in the printed manual in a special font. The \LaTeX\ commands to do this are quite simple. Firstly, define the \code{\back f} command, to put its argument in the \code{fn} index, and set its argument in \code{sf} font. \begin{verbatim} \def\f#1{\findex{#1}{\sf #1}} \end{verbatim} \noindent But what about the Info file? As it stands, the command \code{\back f} is not defined in \LaTeX info, so when you formatted the buffer it would ignore all the \code{\back f} commands, and their arguments. You need to introduce the appropriate Emacs lisp code to provide the definition of the command that you have added. For each option in the \code{documentstyle} command, \LaTeX info looks to see if the file name \var{option}\code{-fmt.el} exists in the directory defined by the Emacs variable \code{latexinfo-formats-directory}. (This variable defaults to the value of the environment variable \code{LATEXINFO}, or if that has not been defined, then the current directory). If it does exist, then it loads this file. So continuing with our example, if the file \file{fvpindex-fmt.el} contained the code \begin{example} (put 'f 'latexinfo-format 'latexinfo-format-code) \end{example} \noindent then it would define the \code{\back f} command to treat its argument the same way that the \code{\back code} command does. After the \var{option}\code{-fmt.el} has been loaded, \LaTeX info checks to see if a function (of no arguments) called \var{option}\code{-fmt-hook} has been defined. If so, this function is called. This allows you to define functions in the \var{option}\code{-fmt.el} file that operate on the whole \LaTeX info file. You can use the \code{\back documentstyle} optional called \code{fvpindex} that loaded the style \file{fvpindex.sty}, which contains these definitions, and similar definitions for \code{\back v} and \code{\back p}. Include \code{fvpindex} in the list of options to the \code{documentstyle} command, \emph{after} the \code{latexinfo} option. Your \LaTeX info file would begin with something like: \begin{verbatim} \documentstyle[12pt,latexinfo,fvpindex]{book} \end{verbatim} This provides a convenient way of documenting all functions, variables ans packages of a program, and having their names automatically entered in the appropriate index, and set in the font of your choice. Additionally, if you are using \code{fvpindex} in conjunction with the \code{elisp} or \code{clisp} styles, you will find that the \code{\back defun} commands put their index entries in in index in bold type, whereas the definitions for \code{\back f}, \code{\back v} and \code{\back p} set their entries in normal type. This allows you to distinguish where the function was defined, and where it was simply referenced. \node Clisp Style, LaTeXinfo support for European languages, The fvpindex Style, Optional Style Files \subsection{Clisp Style} \cindex{Clisp Style} \cpsubindex{styles}{clisp} \findex{clisp} A more modern approach to the Lisp \code{back defun} commands can be found in the style \code{clisp}. The format of the commands is similar to that found in the earlier chapter on Definition Commands (\pxref{Definition Commands}). This style is still evolving, and may have new features of changes in the next release of \LaTeX info. The commands of this style are summarized below. \begin{table}[hbtp] \begin{tabular}{||l|l|l||} \hline Command Name & Language & Class \\ \hline deffn & Lisp & general functions \\ deffun & Lisp & functions \\ defspec & Lisp & special forms \\ defmac & Lisp & macros \\ defvr & Lisp & general variables \\ defvar & Lisp & variables \\ defconst & Lisp & constants \\ \hline \end{tabular} \caption{The Clisp Definition Commands} \end{table} The principal differences between this style and the \code{elisp} style are the following: \begin{itemize} \item An optional parameter can be defined after the name of the command, that is used to indicate the package to which the entity belongs. Insert this optional argument in the traditional \LaTeX\ style of using square brackets. \item The function arguments can contain the keywords \code{\back &optional}, \code{\back &rest}, and \code{\back &key}. \item The function arguments can contain the functions \code{\back keys\{\dots\}} and \code{\back morekeys\{\dots\}} to properly align the keyword arguments of a function. \item The variable and function index entries are coerced to lower case. \item The commands \code{\back true}, \code{\back false}, \code{\back empty} and \code{\back nil} are defined to print as \true, \false, \empty and \nil\ respectively. \end{itemize} \paragraph*{\back defun\{\var{name}\}[\var{package}]\{\var{arguments}\dots{}\}} The \code{\back defun} command is the definition command for functions. \code{\back defun} is equivalent to \samp{\back deffn\{Function\} \dots{}}. The package argument is optional, and the square brackets are omitted if no package is provided. Within the argument list, the following keywords are recognized: \code{\back &optional}, \code{\back &rest}, and \code{\back &key}. They print as themselves in the \code{\back code} font. The argument names on the \code{\back defun} line do not automatically appear in italics in the printed manual; they should be enclosed in \code{\back var}. Terminate the definition with \code{\back enddefun} on a line of its own. Within the argument list, the following commands are recognized: \begin{description} \item[\code{\back args\{\}}] which does nothing. \item[\code{\back keys\{\dots{}\}}] prints the word \code{\& key}, and sets the tab stop to be align subsequent keys. \item[\code{\back morekeys\{\dots\}}] starts a new line and moves to the tab stop set by \code{\back keys}. \item[\code{\back yetmorekeys\{\dots\}}] the same as \code{\back morekeys}. \end{description} \begin{implementation} The arguments to these functions are set with a \LaTeX\ minpage environment. This means that new lines within the argument list will start new lines in the region between the function name and the function type. Furthermore, the arguments are contained within a \code{tabbing} environment, that allows the use of the \code{\back =} and \code{\back >} tab--set and tab commands. This allows one to line up parts of the argument list, such as keys, and the \code{\back *keys} commands are implemented in terms of these. \end{implementation} \paragraph*{\back defmac\{\var{name}\}[\var{package}]\{\var{arguments}\dots{}\}} The \code{\back defmac} command is the definition command for macros. \code{\back defmac} is equivalent to \samp{\back deffn\{Macro\} \dots{}}. The package argument is optional, and the square brackets are omitted if no package is provided. Within the argument list, the following commands are recognized: \code{\back &optional}, \code{\back &rest}, and \code{\back &key}. They print as themselves in the \code{\back code} font. \code{\back defspec} is similarly defined for special forms. Within the \code{\back defun} and \code{\back defmac} argument lists, the following special functions are recognized: \begin{description} \item[mopt] To indicate \mopt{optional forms}. \item[mchoice] To indicate \mchoice{a choice of forms}. \item[mstar] To indicate 0 or more \mstar{optional forms}. \item[mplus] To indicate 1 or more \mplus{forms}. \item[mgroup] To indicate a group of \mplus{forms}. \item[mor] To indicate an or between \mor\ forms. \item[mind] To indicate an \mind{form}. \end{description} \noindent For more information on this syntax, see \cite{Steele1990}. \paragraph*{\back defvar\{\var{name}\}[\var{package}]} The \code{\back defvar} command is the definition command for variables. \code{\back defvar} is equivalent to \samp{\back deffn\{Variable\}}. \code{\back defconst} is similarly defined for constants. \findex{deffnx} \findex{deffunx} \findex{defspecx} \findex{defmacx} \findex{defvrx} \findex{defvarx} \findex{defconstx} In addition to these commands, there are the corresponding ``head-less'' commands: \code{\back deffnx}, \code{\back deffunx}, \code{\back defspecx}, \code{\back defmacx}, \code{\back defvrx}, \code{\back defvarx}, \code{\back defconstx}, which are defined identically to the corresponding commands expect that no extra space is put before the command heading. You can use these on the second or more of a section that describes a number of definitions. \clearpage \node LaTeXinfo support for European languages, LaTeXinfo support for European languages, Clisp Style, Extending LaTeXinfo \section{LaTeXinfo support for European languages} \cindex{diacritical marks} \findex{c} \LaTeX info tries to support European languages, but it is an area that is in great flux right now. \file{german.sty} is supported as an optional file, and this will also provide some support for French. The following diacrtical marks are supported by default in \LaTeX info, either in the form \code{\back \var{letter}} or \code{\back \{\var{letter}\}} \findex{c} \findex{^} \findex{`} \findex{'} \begin{description} \item[\code{\back ^}] Circumflex accent: \^c. \item[\code{\back `}] Accute accent: \`e. \item[\code{\back '}] Grave accent: \'e. \item[\code{\back "}] Tr\'emat: \"o. \end{description} \noindent In the Info file, these marks are removed. \findex{i} \findex{b} \findex{c} But note that by default, the commands \code{\back c}, \code{\back b} \code{\back i} are used for other purposes than their \LaTeX\ usage as diacritical marks. The hyphenation character \code{\back -} is also supported. To support Multi-lingual \TeX, \code{latexinfo.sty} looks for the presence of the \LaTeX\ number \code{\back language}, which are assumed to be defined as follows: \begin{verbatim} \newcount\USenglish \global\USenglish=0 \newcount\german \global\german=1 \newcount\austrian \global\austrian=2 \newcount\french \global\french=3 \newcount\english \global\english=4 \end{verbatim} The presence of \code{\back language} set to any of \code{\back english} \code{\back english}, \code{\back french} or \code{\back german} changes the way the cross-references are printed in \LaTeX. The default is \code{\back english}. \subsection{german.sty} \LaTeX info has support for the file \file{german.sty}, as of Vers. 2.3, 7 Aug 1990, collected by H. Partl (TU Wien), using ideas by W. Appelt, F. Hommes et al. (GMD St.Augustin), T. Hofmann (CIBA-GEIGY Basel), N. Schwarz (Uni Bochum), J. Schrod (TH Darmstadt), D. Armbruster (Uni Stuttgart), R. Schoepf (Uni Mainz), and others. It is a document style option for writing german texts with \TeX\ or \LaTeX. It can be called via adding the \code{german} option to the \code{\back documentstyle} command. \begin{note} User's should resort to their already-installed version of \file{german.sty} (if any) before using the one from \LaTeX info, so the existing \LaTeX\ site documentation won't break. Various copies of this file exist from different eras; you may wish to inquire if one is already installed at your site, and look to see if it is more or less recent than the one distributed with \LaTeX info. \end{note} To support Multi-lingual \TeX, \code{latexinfo.sty} looks for the presence of the \LaTeX\ number \code{\back language}, and if it is set to \code{\back german}, it sets the cross-references in German, and looks to see if \code{\back mdqon} is defined. If so, it lets double quotes have their special meaning, and otherwise sets them as double quotes in typewriter font. \begin{implementation} This file conforms to the standard for \i{Einheitliche deutsche TeX-Befehle} as proposed at the 6th Meeting of German TeX Users in Muenster, October 1987. \end{implementation} \subsubsection{Commands to be used by the end users} \begin{description} \item["a] for Umlaut-a (like \"a), also for all other vowels. \item["s] for sharp s (like \code{\back ss}{}). \item["ck] for ck to be hyphenated as k-k. \item["ff] for ff to be hyphenated as ff-f, also for certain other consonants. \item["|] to separate ligatures. \item["-] like \-, but allowing hyphenation in the rest of the word. \item[""] like "-, but producing no hyphen sign. \item["` or \code{\back glqq}] for german left double quotes (similar to ,,) \item["' or \code{\back grqq}] for german right double quotes (similar to ``) \item[\code{\back glq}] for german left single quotes (similar to , ) \item[\code{\back grq}] for german right single quotes (similar to ` ) \item["< or \code{\back flqq}] for french left double quotes (similar to <<) \item["> or \code{\back frqq}] for french right double quotes (similar to >>) \item[\code{\back flq}] for french left single quotes (similar to < ) \item[\code{\back frq}] for french right single quotes (similar to > ) \item[\code{\back dq}] for the original quotes character (") \item[\code{\back setlanguage}{n}] to switch to the language specified by n, which should be one of the following command names: \item[\code{\back austrian} \code{\back french} \code{\back english} \code{\back german} \code{\back USenglish}] this changes the date format, captions and (if ``multilingual TeX''is installed) hyphenation. \item[\code{\back originalTeX}] to restore everything to the original settings of \TeX{} and \LaTeX{} (well, almost everything). \item[\code{\back germanTeX}] to re-activate the german settings. \end{description} \begin{menu} * Obsolete Commands:: * Lower Level Commands and Features:: \end{menu} \node Obsolete Commands, Lower Level Commands and Features, LaTeXinfo support for European languages, LaTeXinfo support for European languages \subsubsection{Obsolete Commands} Obsolete commands, provided for compatibility with existing applications: \begin{description} \item[\back 3] for sharp s (like "s). \item[\code{\back ck}] for ck to be hyphenated as k-k (like "ck). \end{description} \node Lower Level Commands and Features, Writing Your Own Style Files, Obsolete Commands, LaTeXinfo support for European languages \subsubsection{Lower Level Commands and Features} \begin{description} \item[\code{\back umlautlow}] redefines the Umlaut accent such that the dots come nearer to the letter and that hyphenation is enabled in the rest of the word. \item[\code{\back umlauthigh}] restores \" to its original meaning. \item[\code{\back ss}] is \code{\back lccode}'d to enable hyphenation. \item[\code{\back mdqon}] makes " an active (meta-) character that does the pretty things described above. \item[\code{\back mdqoff}] restores " to its original meaning. \item[\code{\back dospecials}, \@sanitize] are redefined to include ". \item[\code{\back dateaustrian}, \code{\back dategerman}, \code{\back dateenglish}, \code{\back dateUSenglish}, \code{\back datefrench}] redefine \code{\back today} to use the respective date format. \item[\code{\back captionsgerman}, \code{\back captionsenglish}, \code{\back captionsfrench}] switch to german, english or french chapter captions and the like, resp. This will have an effect only if the document style files use the symbolic names \code{\back chaptername} etc. instead of the original english words. \item[\code{\back language}] a count that is set by \code{\back setlanguage} and can be used by document style declarations like \begin{verbatim} \ifnum\language=\english .textengl.\else \ifnum\language=\german .textgerm.\fi\fi \end{verbatim} and/or by M.Ferguson's ``Multilingual T\^eX''. \end{description} Finally, \code{\back germanTeX} is switched on. This file can be used both with Plain \TeX{} and with \LaTeX{} and other macro packages, and with the original \TeX{} and \LaTeX{} fonts. Usage of german hyphenation patterns is recommended to accompany this style file when writing german texts. The file should be read in vertical mode only (usually at the beginning of the document) to avoid spurious spaces. \code{\back undefined} must be an undefined control sequence. Multiple calls of this file (e.g. at the beginning of each subfile) will do no harm. Only the first call (i.e., if \code{\back mdqon} is undefined) performs all the definitions and settings. The catcode of \key{@} remains unchanged after processing of this file. All definitions are global, the switching on of the german options is local. The commands \code{\back mdqon}, \code{\back mdqoff}, \code{\back originalTeX}, \code{\back germanTeX}, and \code{\back setlanguage} are ``fragile'' with \LaTeX{} and should not be used within arguments of macro calls. In Plain TeX, `\code{\back protect}' should be \code{\back let} to `\code{\back relax}' normally and to something like `\code{\back string}' inside the arguments of `\code{\back write}' or `\code{\back message}' (see LaTeX.TEX for all the details). The command \code{\back umlautlow} may need adaption to font parameters (see comments there for details). The commands \code{\back flqq}, \code{\back frqq}, \code{\back flq}, \code{\back frq}, and \code{\back datefrench} in their present forms do not work properly with all font sizes and styles, they still require a better solution. \node Writing Your Own Style Files, Installing LaTeXinfo, Lower Level Commands and Features, Extending LaTeXinfo \section{Writing Your Own Style Files} \cindex{LATEXINFO environment variable} \cindex{environment variable, LATEXINFO} \part{Appendices} \appendix \node Installing LaTeXinfo, Compiling LaTeXinfo, Writing Your Own Style Files, Top \chapter{Installing LaTeXinfo} \begin{menu} * Compiling LaTeXinfo:: * Installing the LaTeXinfo Distribution:: \end{menu} \node Compiling LaTeXinfo, Installing the LaTeXinfo Distribution, Installing LaTeXinfo, Installing LaTeXinfo \section{Compiling LaTeXinfo} To compile \LaTeX info: \begin{enumerate} \item Run the shell script \file{configure}. You will be asked to provide the following: \begin{description} \item[BINDIR] Where to install the executables. \item[INFODIR] Where to install the info files. \item[EMACS] the name of your GNU Emacs. \end{description} \noindent These must exists, and you must be able to write to these directories. For example, \begin{example} Where would you like to install the binaries? Please type the full path to your binaries directory: >/usr5/gnu/bin-sparc The binaries path was verfied to be [/usr5/gnu/bin-sparc] Where are the Gnu Info files located? Please type the full path to your info directory: >/usr5/gnu/info The Info directory was verfied to be [/usr5/gnu/info] Where is your GNU Emacs command: Please type the name of your GNU Emacs command: >xemacs \end{example} \item Then you will be asked: \begin{example} Would you like to install the elisp and LaTeX files elsewhere, or leave them here, and set an environment variable to point to here? Set an environment variable to point to here [y/n]? \end{example} If you choose \begin{description} \item[y] \file{configure} will set the environment variable \code{LATEXINFO} in the \file{.login} to point to this directory, and you won't need to \code{make install}. \item[n] You will be asked about: \begin{description} \item[ELISPDIR] Where to install the compiled Elisp code. \item[TEXDIR] Where to install the style files. \end{description} For example, \begin{example} Set an environment variable to point to here [y/n]? n Where would you like to install GNU Emacs code (elisp)? Please type the full path to your elisp directory: >/usr5/gnu/lib/emacs/latexinfo The elisp path was verfied to be [/usr5/gnu/lib/emacs/latexinfo] Where would you like to install the LaTeX style files? Please type the full path to your LaTeX style directory: >/usr5/gnu/lib/tex The LaTeX style path was verfied to be [/usr5/gnu/lib/tex] \end{example} \end{description} \item Type \code{make}. This will make the executables \code{latexindex}, \code{info}, make the manual, and compile the \file{.el} files. It will also make the files \code{.emacs} and \code{.login}. \end{enumerate} You may also have to change the definitions of your LaTeX commands in the shell script \file{manual/latex2dvi} is you are unusual. \clearpage \node Installing the LaTeXinfo Distribution, Installing the Style Files, Compiling LaTeXinfo, Installing LaTeXinfo \section{Installing the LaTeXinfo Distribution} \begin{enumerate} \item If you chose to install the elisp and LaTeX files elsewhere, type \code{make install} to make the executables, the manual and compile the \file{.el} files. This will \begin{description} \item[\code{make install.C}] which will move the executables to \code{BINDIR}. \item[\code{make install.manual}] which will move a copy of the files \file{manual/latexinfo.info*} to the info directory of the GNU Emacs distribution specified by \code{INFODIR}, and a copy of the sample file to the \LaTeX\ styles directory specified by \code{TEXDIR}. \item[\code{make install.elisp}] which will move a copy of the files \file{styles/*.elc} to the the GNU Emacs lisp directory specified by \code{ELISPDIR}. \item[\code{make install.styles}] which will move a copy of the files \file{styles/*.sty} to the the \LaTeX\ styles directory specified by \code{TEXDIR}. \end{description} \item Edit the \file{dir} file in \code{INFO} directory to include lines like \begin{verbatim} * LaTeXinfo: (latexinfo2.info). With one source file, make either a manual using LaTeX or an Info file. \end{verbatim} \item Include a copy of the \file{.emacs} file in your \code{~/.emacs}. \item Include a copy of the \file{.login} file in your \code{~/.login}. \item Print a copy of the \file{manual/latexinfo.dvi} file and enjoy. \end{enumerate} \xref{Installing an Info File}, for more information on installing an info file. \xref{Installing the Style Files}, for more information on installing style files.\refill \begin{menu} * Installing the Style Files:: \end{menu} \node Installing the Style Files, Converting Files to LaTeXinfo, Installing the LaTeXinfo Distribution, Installing the LaTeXinfo Distribution \subsection{Installing the Style Files} \cindex{\code{TEXINPUTS} environment variable} \cindex{\b{.login} initialization file} Usually, the \file{latexinfo.sty} file is put in the default directory that contains \LaTeX{} macros, something like the directory \file{/usr/local/lib/tex/inputs}, which is created when \LaTeX\ is installed. In this case, \LaTeX{} will find the file and you don't have to do anything special. Alternatively, you can put \file{latexinfo.sty} in the directory in which each \LaTeX info source file is located, and \LaTeX{} will find it there.\refill However, you may want to specify the location of the \code{\back input} file yourself. One way is to set the \code{TEXINPUTS} environment variable in your \file{.login} or \file{.profile} file. The \code{TEXINPUTS} environment variable will tell \LaTeX{} where to find the \file{latexinfo.sty} file and any other file that you might want \LaTeX{} to use. This is done by the \code{.login} file supplied with the \LaTeX info distribution.\refill Whether you use a \file{.login} or \file{.profile} file depends on whether you use \code{csh}, \code{sh}, or \code{bash} for your shell command interpreter. When you use \code{csh}, it looks to the \file{.login} file for initialization information, and when you use \code{sh} or \code{bash}, it looks to the \file{.profile} file.\refill In a \file{.login} file, you could use the following \code{csh} command sequence:\refill \begin{verbatim} setenv LATEXINFO /usr/me/mylib # Add the format files to the list of directories that LaTeX searches. if ( $?TEXINPUTS ) then setenv TEXINPUTS "$TEXINPUTS"':'"$LATEXINFO" else setenv TEXINPUTS "$LATEXINFO" endif \end{verbatim} In a \file{.profile} file, you could use the following \code{sh} command sequence: \begin{example} TEXINPUTS=.:/usr/me/mylib:/usr/lib/tex/macros export TEXINPUTS \end{example} \noindent This would cause \LaTeX{} to look for the style file first in the current directory, indicated by the \samp{.}, then in a hypothetical user's \file{me/mylib} directory, and finally in the system library.\refill \node Converting Files to LaTeXinfo, Converting LaTeX Files to LaTeXinfo, Installing the Style Files, Top \chapter{Converting Files to LaTeXinfo} \begin{menu} * Converting LaTeX Files to LaTeXinfo:: * Converting TeXinfo Files into LaTeXinfo Files:: * Converting Scribe Files to LaTeXinfo:: \end{menu} \node Converting LaTeX Files to LaTeXinfo, l2latexinfo.el, Converting Files to LaTeXinfo, Converting Files to LaTeXinfo \section{Converting LaTeX Files to LaTeXinfo} \LaTeX info files are essentially a special style of standard \LaTeX\ files. To make a standard \LaTeX\ file into a \LaTeX info file, you must begin it with the lines \begin{verbatim} \documentstyle[12pt,latexinfo]{book} \pagestyle{headings} \begin{document} \setfilename{latexinfo.info} \end{verbatim} \noindent \xref{A Short Sample LaTeXinfo File}, for details of how a \LaTeX info file begins. Once you have added these lines, you will have a document that will pass both \LaTeX, and Info formating program, but it will be a document with any node structure, so it will be in essence one large node. (\xref{Nodes and Menus} for more information on nodes.)\refill This is not very useful for the people who read the document under the info program. To add nodes and menus to the document, you can do it by hand, or you can use the function \code{latexinfo-insert-node-lines} (\pxref{Other Updating Commands}.) Alternatively, use the \code{l2latexinfo.el} file provided with \LaTeX info, which does this, and makes a number of other conversions as well. \xref{l2latexinfo.el}.\refill If you want to use \LaTeX\ commands for which there is no \LaTeX info support of any kind, you can always wrap them in a \code{tex} environment:\refill \begin{verbatim} \begin{tex} ... \end{tex} \end{verbatim} \noindent This ensures that this part will be ignored by the Info processor, and that all special characters will be processed according to the normal \LaTeX\ definitions. The following \LaTeX\ commands are also supported by the Info formatter, although they might not do everything in Info that they do in \LaTeX. \begin{verbatim} \LaTeX \S \arrow \geq \hfill \label \leq \newblock \newpage \onecolumn \pi \pm \protect \qquad \quad \ss \thebibliography \thispagestyle \tie \twocolumn \vspace \vspace* \end{verbatim} \begin{menu} * l2latexinfo.el:: \end{menu} \node l2latexinfo.el, Converting TeXinfo Files into LaTeXinfo Files, Converting LaTeX Files to LaTeXinfo, Converting LaTeX Files to LaTeXinfo \subsection{l2latexinfo.el} With the \LaTeX info distribution is a file called \file{l2latexinfo.el}, which helps convert a \LaTeX\ file to a \LaTeX info file. Although it is not a perfectly automatic conversion, it will convert most of a file to \LaTeX info. To convert a \LaTeX\ File into an \LaTeX Info file, just visit a \LaTeX file in GNU Emacs and invoke \begin{example} \kbd{Meta-x latex-to-latexinfo} \end{example} \noindent to convert it to a \LaTeX Info file. Then search through the buffer to see if there are any command that were not converted. When you run \code{latex-to-latexinfo}, you will be asked \begin{example} Would you like to do the \back input files now, to do it all at once? \end{example} If you say \code{yes}, all the \code{\back input} files will be included, so you can do all of the subfiles at the same time. Remember that the characters \code{& ^ % $ #} are not special in \LaTeX info. There is no support for any of the mathematics commands. Braces that are not required for \LaTeX info commands will appear in the Info file. \node Converting TeXinfo Files into LaTeXinfo Files, Differences from TeXinfo, l2latexinfo.el, Converting Files to LaTeXinfo \section{Converting TeXinfo Files into LaTeXinfo Files} \cindex{Converting TeXinfo Files into LaTeXinfo Files} Documentation for GNU utilities and libraries is usually written in a format called \dfn{\TeX info}. Perhaps the most significant difference of \LaTeX info from \TeX info is that if a \LaTeX\ command is found that the Info formatter does not know about, an error is not signalled, and processing simply continues. This means that as long as you don't mind having the commands ignored in the Info file, you can use any \LaTeX\ command. \begin{menu} * Differences from TeXinfo:: \end{menu} \node Differences from TeXinfo, Differences from TeXinfo, Converting TeXinfo Files into LaTeXinfo Files, Converting TeXinfo Files into LaTeXinfo Files \subsection{Differences from TeXinfo} \cindex{Differences from TeXinfo} The following \TeX info commands have been deleted: \begin{verbatim} @asis Not needed. @defindex Not needed (how many more indexes do you want??) @dmn Not needed. @ftable Not needed. @itemx Not needed. @setchapternewpage Use documentstyle type and options instead. @subtitle You are free to use fonts in \title command. @summarycontents Controlled by LaTeX parameter \setcounter{tocdepth} @titlefont Not needed. \end{verbatim} The following commands have been replaced by their \LaTeX\ equivalents: \begin{verbatim} \appendixsec replaced by \section \appendixsubsec replaced by \subsection \appendixsubsubsec replaced by \subsubsection \bye replaced by \end{document} \center replaced by \begin{center} .. \end{center} \chapheading replaced by \chapter* \contents replaced by \tableofcontents \group replaced by \begin{same} \heading replaced by \section* \headings replaced by \pagestyle \majorheading replaced by \chapter* \page replaced by \clearpage \sc replaced by \scap \settitle replaced by \title \heading replaced by \section* \subheading replaced by \subsection* \subsubheading replaced by \subsubsection* \table replaced by \begin{description} \titlepage replaced by \maketitle \vskip replaced by \vspace \end{verbatim} The following commands have been changed to their \LaTeX\ definitions: \begin{verbatim} \appendix \author \center \chapter \date \section \subsection \subsubsection \begin{enumerate} \begin{flushleft} \begin{flushright} \title \today \end{verbatim} The \TeX info custom headings are supplanted by the \LaTeX\ commands. \subsection{t2latexinfo.el} With the \LaTeX info distribution is a file called \file{t2latexinfo.el}, which helps convert a \TeX info file to a \LaTeX info file. Although it is not a perfectly automatic conversion, it will convert most of a file to \LaTeX info. To convert a \TeX info File into an \LaTeX Info file, just visit a \TeX info file in GNU Emacs and invoke \begin{example} \kbd{Meta-x tex-to-latexinfo} \end{example} \noindent to convert it to a \LaTeX Info file. Then search through the buffer to see if there are any command that were not converted. These start with the symbol \samp{@}. You may have to fix up the titlepage to use \code{\back author} and \code{\back title} etc, and may choose to move the \code{setfilename} command down to somewhere after the title and copyright pages. You will also have to fix up any places where you have embedded \TeX\ code such as \begin{verbatim} @tex \overfullrule=0pt @end tex \end{verbatim} \noindent which will be converted into \begin{verbatim} \begin{tex} \back overfullrule=0pt \end{tex} \end{verbatim} \noindent When you run \code{tex-to-latexinfo}, you will be asked \begin{example} Would you like to do the @input files now, to do it all at once? \end{example} If you say \code{yes}, all the \code{@input} files will be included, so you can do all of the subfiles at the same time. You will also be asked: \begin{example} Would you like all occurences of `@@' replaced by `@'? \end{example} This is normally the case, but if you say no, you will be asked \begin{example} Would you like all occurences of `@@' replaced by `\back \back '? \end{example} \noindent You must choose one of these two options. The first option is normal for most \TeX info files; the second option is only normally used for converting the \TeX info manual itself. \node Converting Scribe Files to LaTeXinfo, Obtaining TeX, Differences from TeXinfo, Converting Files to LaTeXinfo \section{Converting Scribe Files to LaTeXinfo} With the \LaTeX info distribution is a file called \file{s2latexinfo.el}, which helps convert a Scribe file to a \LaTeX info file. Although it is not a perfectly automatic conversion, it will convert most of a file to \LaTeX info. To convert a Scribe file into a \LaTeX Info file, just visit the Scribe file in GNU Emacs and invoke \begin{example} \kbd{Meta-x scribe-to-latexinfo} \end{example} \noindent to convert it to a \LaTeX Info file. Then search through the buffer to see if there are any commands that were not converted. These start with the symbol \samp{@}. When you run \code{scribe-to-latexinfo}, you will be asked: \begin{example} Would you like to do the @include files now, to do it all at once? \end{example} If you say \code{yes}, all the \code{@include} files will be included, so you can do all of the subfiles at the same time. You will also be asked: \begin{implementation} This program was written to convert the CMU Lisp manuals. It is very heavily tailored to CMU and Common Lisp. Expect to have to alter this file to tailor it to your needs. \end{implementation} \node Obtaining TeX, Command List, Converting Scribe Files to LaTeXinfo, Top \chapter{Obtaining \protect\LaTeX{}} \c !!! Suggest moving info on getting TeX to appendix. \c !!! Here is information about obtaining TeX. Update it whenever. \c Last updated by RJC on 12 Feb 1991, \c based on message from elisabet@max.u.washington.edu \TeX{} is freely redistributable. You can obtain \TeX{} for Unix systems from the University of Washington for a distribution fee. \LaTeX{} is included with \TeX{}\refill To order a full distribution, send $140.00 for a 1/2-inch 9-track 1600 bpi (tar or cpio) tape reel, or $165.00 for a 1/4-inch 4-track QIC-24 (tar or cpio) cartridge, to:\refill \begin{display} Northwest Computing Support Center DR-10, Thomson Hall 35 University of Washington Seattle, Washington 98195 \end{display} \noindent Please make checks payable to the University of Washington.\refill Prepaid orders are preferred but purchase orders are acceptable; however, purchase orders carry an extra charge of $10.00, to pay for processing.\refill Overseas sites: please add to the base cost $20.00 for shipment via air parcel post, or $30.00 for shipment via courier.\refill Please check with the Northwest Computing Support Center at the University of Washington for current prices and formats:\refill \begin{display} telephone: (206) 543-6259 email: elisabet@max.u.washington.edu \end{display} \node Command List, Command Index, Obtaining TeX, Top \chapter{Command List} \cindex{Alphabetical \back -command list} \cindex{List of \back -Commands} \cindex{Command list} Here is an alphabetical list of the \back -commands in \LaTeX info. The alphabetical order ignores the \verb+\begin{}+ and \verb+\end{}+ of environment commands. \begin{description} \item[\back *] Force a line break. Do not end a paragraph that uses \code{\back *} with an \code{\back refill} command. \xref{Line Breaks}.\refill \item[\back \back] Force a line break in the \LaTeX\ file. \xref{Line Breaks}.\refill \item[\back .] Stands for a period that really does end a sentence. \xref{Controlling Spacing}.\refill \item[\back :] Indicate to \LaTeX{} that an immediately preceding period, question mark, exclamation mark, or colon does not end a sentence. Prevent \LaTeX{} from inserting extra whitespace as it does at the end of a sentence. The command has no effect on the Info file output. \xref{Controlling Spacing}.\refill \item[\back \{] Stands for a left-hand brace, \samp{\{}. \xref{Braces Atsigns Periods, , Inserting \back braces and periods}.\refill \item[\back \}] Stands for a right-hand brace, \samp{\}}. \xref{Braces Atsigns Periods, , Inserting \back braces and periods}.\refill \item[\back appendix] Begin the appendices. All chapters and sections after this command will be treated as appendices, and marked with alphabetical chapter numbers.\refill \item[\back author\{\var{author}\}] Typeset \var{author} according to the current \code{documentstyles}. \xref{Titlepage}.\refill \item[\back b\{\var{text}\}] Print \var{text} in \b{bold} font. No effect in Info. \xref{Fonts}.\refill \item[\back back] Stands for \samp{\back }. \xref{Braces Atsigns Periods, , Inserting \samp{\back }}.\refill \item[\back BibTeX\{\}] Insert the logo \BibTeX. \begin{ignore} \item[\back br] Force a paragraph break. If used within a line, follow \code{\back br} with braces. \xref{br, , \code{\back br}}.\refill \end{ignore} \item[\back bullet\{\}] Generate a large round dot, or the closest possible thing to one. \xref{Dots Bullets}.\refill \item[\back c \var{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 \code{\back comment}. \xref{Conventions, , General Syntactic Conventions}.\refill \item[\back cartouche] Highlight an example or quotation by drawing a box with rounded corners around it. Pair with \code{\back end\{cartouche\}}. No effect in Info. \xref{cartouche, , Drawing Cartouches Around Examples}.)\refill \item[\back begin\{center\}] Center the text following. \xref{Center Environment}.\refill \item[\back chapter\{\var{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. \xref{Chapter}.\refill \item[\back cindex\{\var{entry}\}] Add \var{entry} to the index of concepts. \xref{Index Entries, , Defining the Entries of an Index}.\refill \item[\back cite\{\var{reference}\}] Refer to a \BibTeX\ bibliography item. \xref{Citations}.\refill \item[\back clearpage] Start a new page in a printed manual. No effect in Info. \xref{page, , Start a New Page}.\refill \item[\back code\{\var{sample-code}\}] Highlight text that is an expression, a syntactically complete token of a program, or a program name. \xref{code, , \code{\back code}}.\refill \item[\back comment \var{comment}] Begin a comment in \LaTeX info. The rest of the line does not appear in either the Info file or the printed manual, nor does following whitespace. \xref{Conventions, , General Syntactic Conventions}.\refill \item[\back copyright\{\}] Generate a copyright symbol. \xref{LaTeX and copyright}.\refill \begin{ignore} \item[\back ctrl\{\var{ctrl-char}\}] Describe an \scap{ascii} control character. Insert actual control character into Info file. \xref{ctrl, , \code{\back ctrl}}.\refill \end{ignore} \item[\back defcv\{\var{category}\}\{\var{class}\}\{\var{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. \xref{Definition Commands}.\refill \item[\back deffn\{\var{category}\}\{\var{name}\}\{\var{arguments}\dots{}\}] Format a description for a function, interactive command, or similar entity that may take arguments. \code{\back deffn} takes as arguments the category of entity being described, the name of this particular entity, and its arguments, if any. \xref{Definition Commands}.\refill \item[\back defivar\{\var{class}\}\{\var{instance-variable-name}\}] Format a description for an instance variable in object-oriented programming. The command is equivalent to \samp{\back defcv\{Instance Variable\} \dots{}}. \xref{Definition Commands}.\refill \item[\back defmac\{\var{macro-name}\}\{\var{arguments}\dots{}\}] Format a description for a macro. The command is equivalent to \samp{\back deffn\{Macro\}\dots{}}. \xref{Definition Commands}.\refill \item[\back defmethod\{\var{class}\}\{\var{method-name}\}\{\var{arguments}\dots{}\}] Format a description for a method in object-oriented programming. The command is equivalent to \samp{\back defop\{Method\} \dots{}}. Takes as arguments the name of the class of the method, the name of the method, and its arguments, if any. \xref{Definition Commands}.\refill \item[\back defop\{\var{category}\}\{\var{class}\}\{\var{name}\}\{\var{arguments}\dots{}\}] Format a description for an operation in object-oriented programming. \code{\back 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. \xref{Definition Commands}.\refill \need{100} \item[\back defopt\{\var{option-name}\}] Format a description for a user option. The command is equivalent to \samp{\back defvr\{User Option\} \dots{}}. \xref{Definition Commands}.\refill \need{100} \item[\back defspec\{\var{special-form-name}\}\{\var{arguments}\}\dots{}] Format a description for a special form. The command is equivalent to \samp{\back deffn\{Special Form\}\dots{}}. \xref{Definition Commands}.\refill \need{200} \item[\back deftp\{\var{category}\}\{\var{name-of-type}\}\{\var{attributes}\dots{}\}] Format a description for a data type. \code{\back 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. \xref{Definition Commands}.\refill \item[\back deftypefn\{\var{classification}\}\{\var{data-type}\}\{\var{name}\}\{\var{arguments}\dots{}\}] Format a description for a function or similar entity that may take arguments and that is typed. \code{\back deftypefn} takes as arguments the classification of entity being described, the type, the name of the entity, and its arguments \xref{Definition Commands}.\refill \item[\back deftypefun\{\var{data-type}\}\{\var{function-name}\}\{\var{arguments}\dots{}\}] Format a description for a function in a typed language. The command is equivalent to \samp{\back deftypefn\{Function\}\dots{}}. \xref{Definition Commands}.\refill \item[\back deftypevr\{\var{classification}\}\{\var{data-type}\}\{\var{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. \xref{Definition Commands}.\refill \item[\back deftypevar\{\var{data-type}\}\{\var{variable-name}\}] Format a description for a variable in a typed language. The command is equivalent to \samp{\back deftypevr\{Variable\}\dots{}}. \xref{Definition Commands}.\refill \item[\back defun\{\var{function-name}\}\{\var{arguments}\dots{}\}] Format a description for functions. The command is equivalent to \samp{\back deffn\{Function\}\dots{}}. \xref{Definition Commands}.\refill \item[\back defvar\{\var{variable-name}\}] Format a description for variables. The command is equivalent to \samp{\back defvr\{Variable\}\dots{}}. \xref{Definition Commands}.\refill \item[\back defvr\{\var{category}\}\{\var{name}\}] Format a description for any kind of variable.\\ \code{\back defvr} takes as arguments the category of the entity and the name of the entity. \xref{Definition Commands}. \need{400} \item[\back begin\{description\}] Begin a description, using \code{\back item} for each entry. Write each first column entry as \code{\back item[\var{entry}]}. \xref{Description Environment}.\refill \item[\back dfn\{\var{term}\}] Highlight the introductory or defining use of a term. \xref{dfn, , \code{\back dfn}}.\refill \need{100} \item[\back begin\{display\}] Begin a kind of example. Indent text, do not fill, do not select a new font. Pair with \code{\back end\{display\}}. \xref{display, , \code{\back begin\{display\}}}.\refill \need{100} \item[\back dmn\{\var{dimension}\}] Format a dimension. Causes \LaTeX{} to insert a narrow space before \var{dimension}. Has no effect in Info. Used for writing a number followed by an abbreviation of a dimension name, such as \samp{12\dmn{pt}}, written as \samp{12\back dmn\{pt\}}, with no space between the number and the \code{\back dmn} command. \xref{dmn, , \code{\back dmn}}.\refill \item[\back end\{document\}] Terminate \LaTeX{} processing on the file. \LaTeX{} does not see any of the contents of the file following the \code{\back end\{document\}} command. \xref{Ending a File}.\refill \need{100} \item[\back dots\{\}] Insert an ellipsis: \samp{\dots{}}. \xref{Dots Bullets}.\refill \need{100} \item[\back emph\{\var{text}\}] Highlight \var{text}. \xref{Emphasis, , Emphasizing Text}.\refill \need{100} \item[\back begin\{enumerate\}] Begin a numbered list, using \code{\back item} for each entry. Pair with \code{\back end\{enumerate\}}. \xref{enumerate, , \code{\back begin\{enumerate\}}}.\refill \need{100} \item[\back equiv\{\}] Indicate the exact equivalence of two forms to the reader with a special glyph: \samp{\equiv{}}. \xref{Equivalence}.\refill \item[\back error\{\}] Indicate to the reader with a special glyph that the following text is an error message: \samp{\error{}}. \xref{Error Special Glyph}.\refill \item[\back begin\{example\}] Begin an example. Indent text, do not fill, select fixed-width font. Pair with \code{\back end\{example\}}. \xref{example, , \code{\back begin\{example\}}}.\refill \item[\back exdent \var{line-of-text}] Remove any indentation a line might have. \xref{exdent, , Undoing the Indentation of a Line}.\refill \item[\back expansion\{\}] Indicate the result of a macro expansion to the reader with a special glyph: \samp{\expansion{}}. \xref{expansion}.\refill \item[\back file\{\var{filename}\}] Highlight the name of a file or directory. \xref{file, , \code{\back file}}.\refill \item[\back finalout] Prevent \LaTeX{} from printing large black warning rectangles beside over-wide lines. \xref{Overfull Hboxes}.\refill \need{100} \item[\back findex\{\var{entry}\}] Add \var{entry} to the index of functions. \xref{Index Entries, , Defining the Entries of an Index}.\refill \need{200} \item[\back begin\{flushleft\}] Left justify every line but leave the right end ragged. Leave font as is. Pair with \code{\back end\{flushleft\}}. \xref{flushleft & flushright, , \code{\back begin\{flushleft\}} and \code{\back begin\{flushright\}}}.\refill \need{200} \item[\back begin\{flushright\}] Right justify every line but leave the left end ragged. Leave font as is. Pair with \code{\back end\{flushright\}}. \xref{flushleft & flushright, , \code{\back begin\{flushleft\}} and \code{\back begin\{flushright\}}}.\refill \need{200} \item[\back footnote\{\var{text-of-footnote}\}] Enter a footnote. Footnote text is printed at the bottom of the page by \LaTeX{}; Info may format in either `End Node' or `Make Node' style. \xref{Footnotes}.\refill \item[\back footnotestyle\{\var{style}\}] Specify an Info file's footnote style, either \samp{end} for the end node style or \samp{separate} for the separate node style. \xref{Footnotes}.\refill \item[\back begin\{format\}] Begin a kind of example. Like \code{\back begin\{example\}} or \code{\back begin\{display\}}, but do not narrow the margins and do not select the fixed-width font. Pair with \code{\back end\{format\}}. \xref{example, , \code{\back begin\{example\}}}.\refill \item[\back i\{\var{text}\}] Print \var{text} in \i{italic} font. No effect in Info. \xref{Fonts}.\refill \item[\back begin\{ifinfo\}] Begin a stretch of text that will be ignored by \LaTeX{} when it typesets the printed manual. The text appears only in the Info file. Pair with \code{\back end\{ifinfo\}}. \xref{Conditionals, , Conditionally Visible Text}.\refill \item[\back begin\{iftex\}] Begin a stretch of text that will not appear in the Info file, but will be processed only by \LaTeX. Pair with \code{\back end\{iftex\}}. \xref{Conditionals, , Conditionally Visible Text}.\refill \item[\back begin\{ignore\}] Begin a stretch of text that will not appear in either the Info file or the printed output. Pair with \code{\back end\{ignore\}}. \xref{Comments, , Comments and Ignored Text}.\refill \item[\back include\{\var{filename}\}] Incorporate the contents of the file \var{filename} into the Info file or printed document. \xref{Include Files}.\refill \item[\back inforef\{\var{node-name}, [\var{entry-name}], \var{info-file-name}\}] Make a cross reference to an Info file for which there is no printed manual. \xref{inforef, , Cross references using \code{\back inforef}}.\refill \item[\back input\{\var{filename}\}] Input the contents of the file \var{filename} into the Info file or printed document. \xref{Input Files}.\refill \item[\back item] Indicate the beginning of a marked paragraph for \code{\back begin\{itemize\}} and \code{\back begin\{enumerate\}} and \code{\back begin\{description\}} environments.\refill \item[\back begin\{itemize\}] Produce a sequence of indented paragraphs, with a mark inside the left margin at the beginning of each paragraph. Pair with \code{\back end\{itemize\}}. \xref{Itemize Environment}.\refill \item[\back kbd\{\var{keyboard-characters}\}] Indicate text that consists of characters of input to be typed by users. \xref{kbd, , \code{\back kbd}}.\refill \item[\back key\{\var{key-name}\}] Highlight \var{key-name}, a conventional name for a key on a keyboard. \xref{key, , \code{\back key}}.\refill \item[\back kindex\{\var{entry}\}] Add \var{entry} to the index of keys. \xref{Index Entries, , Defining the Entries of an Index}.\refill \item[\back LaTeX\{\}] Insert the logo \LaTeX. \item[\back begin\{lisp\}] Begin an example of Lisp code. Indent text, do not fill, select fixed-width font. Pair with \code{\back end\{lisp\}}. \xref{Lisp Example, , \code{\back begin\{lisp\}}}.\refill \item[\back begin\{menu\}] Mark the beginning of a menu of nodes in Info. No effect in a printed manual. Pair with \code{\back end\{menu\}}. \xref{Menu Environment}.\refill \item[\back minus\{\}] Generate a minus sign. \xref{minus, , \code{\back minus}}.\refill \item[\back need\{\var{n}\}] Start a new page in a printed manual if fewer than \var{n} mils (thousandths of an inch) remain on the current page. \xref{need, , \code{\back need}}.\refill \item[\back node \var{name, next, previous, up}] Define the beginning of a new node in Info, and serve as a locator for references for \LaTeX. \xref{node, , \code{\back node}}.\refill \need{200} \item[\back noindent] Prevent text from being indented as if it were a new paragraph. \xref{noindent, , \code{\back noindent}}.\refill \need{300} \item[\back nxref\{\var{node-name}, \r{[}\var{entry}\r{]}, \r{[}\var{topic}\r{]}, \r{[}\var{info-file}\r{]}, \r{[}\var{manual}\r{]}\}] 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. \xref{ref, , \code{\back nxref}}.\refill \item[\back paragraphindent\{\var{indent}\}] Indent paragraphs by \var{indent} number of spaces; delete indentation if the value of \var{indent} is 0; and do not change indentation if \var{indent} is \code{asis}. \xref{paragraphindent, , Paragraph Indenting}.\refill \item[\back pindex\{\var{entry}\}] Add \var{entry} to the index of programs. \xref{Index Entries, , Defining the Entries of an Index}.\refill \item[\back point\{\}] Indicate the position of point in a buffer to the reader with a special glyph: \samp{\point{}}. \xref{Point Special Glyph, , Indicating Point in a Buffer}.\refill \item[\back print\{\}] Indicate printed output to the reader with a special glyph: \samp{\print{}}. \xref{Print Special Glyph}.\refill \item[\back printindex\{\var{index-name}\}] Print an alphabetized two-column index in a printed manual or generate an alphabetized menu of index entries for Info. \xref{Printing an Index and Generating Menus}.\refill \item[\back pxref\{\var{node-name}, \r{[}\var{entry}\r{]}, \r{[}\var{topic}\r{]}, \r{[}\var{info-file}\r{]}, \r{[}\var{manual}\r{]}\}] 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, which is why you do not need to insert punctuation. Only the first argument is mandatory. \xref{pxref, , \code{\back pxref}}.\refill \item[\back begin\{quotation\}] Narrow the margins to indicate text that is quoted from another real or imaginary work, and indent following text. Write command on a line of its own. Pair with \code{\back end\{quotation\}}. \xref{Quotations}.\refill \item[\back begin\{quote\}] 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 \code{\back end\{quote\}}. \xref{Quotations}.\refill \need{100} \item[\back r\{\var{text}\}] Print \var{text} in \r{roman} font. No effect in Info. \xref{Fonts}.\refill \need{300} \item[\back refill] In Info, refill and indent the paragraph after all the other processing has been done. No effect on \LaTeX, which always refills. \xref{Refilling Paragraphs}.\refill \need{300} \item[\back result\{\}] Indicate the result of an expression to the reader with a special glyph: \samp{\result{}}. \xref{result, , \code{\back result}}.\refill \item[\back samp\{\var{text}\}] Highlight \var{text} that is a literal example of a sequence of characters. Used for single characters, for statements and often for entire shell commands. \xref{samp, , \code{\back code}}.\refill \item[\back scap\{\var{text}\}] Set \var{text} in a printed output in \scap{the small caps font} and set text in the Info file in uppercase letters. \xref{Smallcaps}.\refill \item[\back setfilename\{\var{info-file-name}\}] Provide a name for the Info file. \xref{Conventions, , General Syntactic Conventions}.\refill \item[\back begin\{smalllisp\}] Begin an example of Lisp code. Indent text, do not fill, select a small fixed-width font. Pair with \code{\back end\{lisp\}}. \xref{Lisp Example, , \code{\back begin\{lisp\}}}.\refill \item[\back title\{\var{title}\}] Provide a title for page headers in a printed manual, and for the titlepage. \xref{Conventions, , General Syntactic Conventions}.\refill \item[\back begin\{same\}] Hold text together that must appear on one printed page. Pair with \code{\back end\{same\}}. Not relevant to Info. \xref{group, , \code{\back begin\{same\}}}.\refill \need{400} \item[\back begin\{smallexample\}] Indent text to indicate an example. Do not fill, select fixed-width font. In \code{\back smallbook} format, print text in a smaller font than with \code{\back begin\{example\}}. Pair with \code{\back end\{smallexample\}}. \xref{Examples and Verbatim}.\refill \need{400} \item[\back smalllisp] Begin an example of Lisp code. Indent text, do not fill, select fixed-width font. In \code{\back smallbook} format, print text in a smaller font. Pair with \code{\back end\{smalllisp\}}. \xref{Examples and Verbatim}.\refill \need{500} \item[\back sp\{\var{n}\}] Skip \var{n} blank lines. \xref{sp, , \code{\back sp}}.\refill \need{500} \item[\back strong\{\var{text}\}] Emphasize \var{text} by typesetting it in a \strong{bold} font for the printed manual and by surrounding it with asterisks for Info. \xref{emph & strong, , Emphasizing Text}.\refill \item[\back subsection\{\var{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. \xref{Subsection}.\refill \item[\back subsubsection\{\var{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. \xref{Subsubsection}.\refill \need{300} \item[\back syncodeindex\{\var{from-index}\}\{\var{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{\back code} font. \xref{Combining Indices}.\refill \need{300} \item[\back synindex\{\var{from-index}\}\{\var{into-index}\}] Merge the index named in the first argument into the index named in the second argument. Do not change the font of \var{from-index} entries. \xref{Combining Indices}.\refill \need{100} \item[\back t\{\var{text}\}] Print \var{text} in a \t{fixed-width} font. No effect in Info. \xref{Fonts}.\refill \item[\back tableofcontents] Print a complete table of contents. Has no effect in Info, which uses menus instead. \xref{Generating a Table of Contents}.\refill \item[\back TeX\{\}] Insert the logo \TeX{}. \item[\back begin\{tex\}] Enter \LaTeX{} completely. Pair with \code{\back end\{tex\}}. \xref{Using Ordinary LaTeX Commands}.\refill \item[\back tindex\{\var{entry}\}] Add \var{entry} to the index of data types. \xref{Index Entries, , Defining the Entries of an Index}.\refill \item[\back title\{\var{title}\}] In a printed manual, set a title in a larger than normal font and underline it with a black rule. \xref{Titlepage}.\refill \need{150} \item[\back today\{\}] Insert the current date. \xref{Custom Headings}.\refill \item[\back unnumbered\{\var{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. \xref{Chapter}.\refill \item[\back unnumberedsec\{\var{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. \xref{Section}.\refill \item[\back unnumberedsubsec\{\var{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. \xref{Subsection}.\refill \item[\back unnumberedsubsubsec\{\var{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. \xref{Subsubsection}.\refill \item[\back var\{\var{metasyntactic-variable}\}] Highlight a metasyntactic variable, which is something that stands for another piece of text. Thus, in this entry, the word \var{metasyntactic-variable} is highlighted with \code{\back var}. \xref{var, , Indicating Metasyntactic Variables}.\refill \need{400} \item[\back vindex\{\var{entry}\}] Add \var{entry} to the index of variables. \xref{Index Entries, , Defining the Entries of an Index}.\refill \need{400} \item[\back vspace\{\var{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 \samp{0pt plus 1filll}. (Note spelling of \samp{filll}.) \code{\back vspace} is ignored for Info. \xref{The Copyright Page and Printed Permissions}.\refill \need{400} \item[\back w\{\var{text}\}] Prevent \var{text} from being split across two lines. Do not end a paragraph that uses \code{\back w} with an \code{\back refill} command. In the \LaTeX info file, keep \var{text} on one line. \xref{w, , \code{\back w}}.\refill \need{400} \item[\back xref\{\var{node-name}, \r{[}\var{entry}\r{]}, \r{[}\var{topic}\r{]}, \r{[}\var{info-file}\r{]}, \r{[}\var{manual}\r{]}\}] Make a reference that starts with `See' in a printed manual. Follow command with a punctuation mark. Only the first argument is mandatory. \xref{xref, , \code{\back xref}}.\refill \end{description} \bibliography{latexinfo2} \twocolumn \node Command Index, Concept Index, Command List, Top \unnumbered{Command Index} \cindex{Command Index} This is an alphabetical list of all the \back -commands and several variables. To make the list easier to use, the commands are listed without their preceding \samp{\back }.\refill \printindex{fn} \onecolumn \node Concept Index, , Command Index, Top \unnumbered{Concept Index} \cindex{Concept Index} \printindex{cp} \end{document}