summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/latex2e-help-texinfo/latex2e.texi
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/latex2e-help-texinfo/latex2e.texi')
-rw-r--r--Master/texmf-dist/doc/latex/latex2e-help-texinfo/latex2e.texi11582
1 files changed, 8687 insertions, 2895 deletions
diff --git a/Master/texmf-dist/doc/latex/latex2e-help-texinfo/latex2e.texi b/Master/texmf-dist/doc/latex/latex2e-help-texinfo/latex2e.texi
index 7cba667c8ed..afd657383e5 100644
--- a/Master/texmf-dist/doc/latex/latex2e-help-texinfo/latex2e.texi
+++ b/Master/texmf-dist/doc/latex/latex2e-help-texinfo/latex2e.texi
@@ -1,8 +1,8 @@
\input texinfo
-@c $Id: latex2e.texi 613 2018-03-21 18:48:08Z jimhefferon $
+@c $Id: latex2e.texi 678 2018-07-02 20:51:26Z karl $
@comment %**start of header (This is for running Texinfo on a region.)
@setfilename latex2e.info
-@set UPDATED March 2018
+@set UPDATED July 2018
@include common.texi
@settitle @LaTeX{}2e unofficial reference manual (@value{UPDATED})
@comment %**end of header (This is for running Texinfo on a region.)
@@ -11,17 +11,24 @@
@c xx but latex2e stuff is missing.
@c xx random list of a few of the missing items is at the end of this file
@c
-@c xx ending a run with errors
@c xx ctan, distributions, components of TeX
@c xx classes and packages -- required, additional, useful; oberdiek; fonts
@c
-@c xx merge http://ctan.org/pkg/latex-info (CTAN package latex-info)
-@c xx merge http://ctan.org/pkg/latex2e-reference
@c xx merge permuted-index
@c xx merge latex-manual from savannah
@c xx merge display style math
-@c xx vertical mode, horizontal mode
-@c xx JH Discuss restricted execution
+@c xx JH explain nfss somewhere
+@c xx JH expand BiBTeX
+@c xx JH expand theorem, AMS math
+@c xx JH something on code listings
+@c xx JH ligatures
+@c xx JH \xspace
+@c xx JH \stretch
+@c xx JH \mathstrut
+@c xx JH \phantom https://tex.stackexchange.com/questions/4519/how-do-i-create-an-invisible-character
+@c xx JH \baselineskip https://texfaq.org/FAQ-baselinepar
+@c xx JH \contentsline, \@@dottedtocline?
+@c xx JH more on \write18, beyond what's mentioned in Command line.
@c
@c xx The typeset source2e has an index with all kernel
@c xx commands, though some are internal and shouldn't be included.
@@ -71,6 +78,9 @@ into another language, under the above conditions for modified versions.
@comment end of License
@end copying
+@c Merge into one index (arbitrarily chosen to be the concept index).
+@syncodeindex fn cp
+
@dircategory TeX
@direntry
* LaTeX2e: (latex2e). Unofficial LaTeX reference manual.
@@ -136,7 +146,7 @@ This document is an unofficial reference manual (version of
* Document classes:: Some of the various classes available.
* Fonts:: Italic, bold, typewriter, etc.
* Layout:: Controlling the page layout.
-* Sectioning:: How to section properly.
+* Sectioning:: Parts, Chapters, Sections, etc.
* Cross references:: Automatic referencing.
* Environments:: Such as enumerate & itemize.
* Line breaking:: Influencing line breaks.
@@ -160,15 +170,14 @@ This document is an unofficial reference manual (version of
* Terminal input/output:: User interaction.
* Command line:: System-independent command-line behavior.
* Document templates:: Starter templates for various document classes.
-* Concept Index:: General index.
-* Command Index:: Alphabetical list of @LaTeX{} commands.
+* Index:: General index.
@end menu
@node About this document
@chapter About this document
-@findex @url{@value{LTXREFMAN_HOME_PAGE}} @r{home page}
+@cindex home page for manual
This is an unofficial reference manual for the @LaTeX{}2e document
preparation system, which is a macro package for the @TeX{}
typesetting program (@pxref{Overview}). This document's home page is
@@ -259,10 +268,11 @@ produce the logo with @code{\LaTeX}. Where use of the logo is not
sensible, such as in plain text, write it as @samp{LaTeX}.
@menu
-* Starting and ending:: The standard beginning and end of a document.
-* Output files:: Files produced.
+* Starting and ending:: The standard beginning and end of a document.
+* Output files:: Files produced.
* @TeX{} engines:: Programs that can compile @TeX{} and @LaTeX{}.
* @LaTeX{} command syntax:: General syntax of @LaTeX{} commands.
+* CTAN:: Our repository.
@end menu
@@ -275,7 +285,7 @@ sensible, such as in plain text, write it as @samp{LaTeX}.
@cindex hello, world
@LaTeX{} files have a simple global structure, with a standard beginning
-and ending. Here is a ``hello, world'' example:
+and ending. This is a small example.
@example
\documentclass@{article@}
@@ -284,11 +294,15 @@ Hello, \LaTeX\ world.
\end@{document@}
@end example
+@noindent
+Every @LaTeX{} document has a @code{\begin@{document@}} line and an
+@code{\end@{document@}} line.
+
@cindex document class, defined
@noindent
-Here, the @samp{article} is the so-called @dfn{document class},
-implemented in a file @file{article.cls}. Any document class can be
-used. A few document classes are defined by @LaTeX{} itself, and vast
+Here, the @samp{article} is the @dfn{document class}. It is implemented
+in a file @file{article.cls}. You can use any document class on your
+system. A few document classes are defined by @LaTeX{} itself, and vast
array of others are widely available. @xref{Document classes}.
@cindex preamble, defined
@@ -296,12 +310,13 @@ You can include other @LaTeX{} commands between the
@code{\documentclass} and the @code{\begin@{document@}} commands.
This area is called the @dfn{preamble}.
-The @code{\begin@{document@} ... \end@{document@}} is a so-called
+The @code{\begin@{document@}}, @code{\end@{document@}} pair defines an
@cindex environment
@dfn{environment}; the @samp{document} environment (and no others) is
-required in all @LaTeX{} documents (@pxref{document}). @LaTeX{}
-provides many environments itself, and many more are defined separately.
-@xref{Environments}.
+required in all @LaTeX{} documents (@pxref{document}). @LaTeX{} make
+available to you many environments that are documented here
+(@pxref{Environments}). Many more are available to you from external
+packages, most importantly those available at CTAN (@pxref{CTAN}).
The following sections discuss how to produce PDF or other output from
a @LaTeX{} input file.
@@ -310,7 +325,7 @@ a @LaTeX{} input file.
@node Output files
@section Output files
-@LaTeX{} produces a main output file and at least two accessory files.
+@LaTeX{} produces a main output file and at least two auxiliary files.
The main output file's name ends in either @file{.dvi} or @file{.pdf}.
@table @code
@@ -321,6 +336,7 @@ The main output file's name ends in either @file{.dvi} or @file{.pdf}.
@findex dvips @r{command}
@findex dvipdfmx @r{command}
@findex dvitype @r{command}
+@anchor{output files dvi}
If @LaTeX{} is invoked with the system command @command{latex} then it
produces a DeVice Independent file, with extension @file{.dvi}. You
can view this file with a command such as @command{xdvi}, or convert
@@ -334,6 +350,7 @@ available (@url{http://mirror.ctan.org/dviware}).
@findex .pdf @r{file}
@cindex pdf@TeX{}
@findex pdflatex @r{command}
+@anchor{output files pdf}
If @LaTeX{} is invoked via the system command @command{pdflatex},
among other commands (@pxref{@TeX{} engines}), then the main output is
a Portable Document Format (PDF) file. Typically this is a
@@ -348,6 +365,7 @@ self-contained file, with all fonts and images included.
@cindex transcript file
@cindex log file
@findex .log @r{file}
+@anchor{output files log}
This transcript file contains summary information such as a list of
loaded packages. It also includes diagnostic messages and perhaps
additional information for any errors.
@@ -358,6 +376,7 @@ additional information for any errors.
@cindex cross references, resolving
@cindex forward references, resolving
@cindex references, resolving forward
+@anchor{output files aux}
Auxiliary information is used by @LaTeX{} for things such as
cross references. For example, the first time that @LaTeX{} finds a
forward reference---a cross reference to something that has not yet
@@ -379,10 +398,11 @@ location.
@cindex table of contents file
@cindex contents file
@LaTeX{} may produce yet more files, characterized by the filename
-ending. These include a @code{.lof} file that is used to make a list
-of figures, a @code{.lot} file used to make a list of tables, and a
-@code{.toc} file used to make a table of contents. A particular class
-may create others; the list is open-ended.
+ending. These include a @code{.lof} file that is used to make a list of
+figures, a @code{.lot} file used to make a list of tables, and a
+@code{.toc} file used to make a table of contents (@pxref{Table of
+contents etc.}). A particular class may create others; the list is
+open-ended.
@node @TeX{} engines
@@ -397,7 +417,7 @@ may create others; the list is open-ended.
@LaTeX{} is defined to be a set of commands that are run by a @TeX{}
implementation (@pxref{Overview}). This section gives a terse
-overview of the main programs.
+overview of the main programs (see also@tie{}@ref{Command line}).
@table @code
@item latex
@@ -405,6 +425,7 @@ overview of the main programs.
@cindex pdf@TeX{} engine
@findex etex @r{command}
@cindex e-@TeX{}
+@anchor{tex engines latex}
In @TeX{} Live (@url{http://tug.org/texlive}), if @LaTeX{} is invoked
via either the system command @command{latex} or @command{pdflatex},
then the pdf@TeX{} engine is run (@url{http://ctan.org/pkg/pdftex}).
@@ -425,6 +446,7 @@ assumed to be available in @LaTeX{}.
@item lualatex
@findex lualatex @r{command}
@cindex Lua@TeX{}
+@anchor{tex engines lualatex}
If @LaTeX{} is invoked via the system command @command{lualatex}, the
Lua@TeX{} engine is run (@url{http://ctan.org/pkg/luatex}). This
program allows code written in the scripting language Lua
@@ -439,6 +461,7 @@ but this is rarely used.
@cindex Xe@TeX{}
@findex .xdv @r{file}
@findex xdvipdfmx
+@anchor{tex engines xelatex}
If @LaTeX{} is invoked with the system command @command{xelatex}, the
Xe@TeX{} engine is run (@url{http://tug.org/xetex}). Like Lua@TeX{},
Xe@TeX{} natively supports UTF-8 Unicode and TrueType and OpenType
@@ -499,7 +522,7 @@ commands it covers (barring unintentional omissions, a.k.a.@: bugs).
@menu
* Environment:: Area of the source with distinct behavior.
* Declaration:: Change the value or meaning of a command.
-* \makeatletter and \makeatother:: Change the status of the at-sign character.
+* \makeatletter & \makeatother:: Change the status of the at-sign character.
@end menu
@@ -525,7 +548,7 @@ behavior. For instance, for poetry in @LaTeX{} put the lines between
\end@{verse@}
@end example
-See@tie{}@ref{Environments} for a list of environments.
+@xref{Environments} for a list of environments.
The @var{environment name} at the beginning must exactly match that at
the end. This includes the case where @var{environment name} ends in a
@@ -552,8 +575,8 @@ command or parameter. For instance, the @code{\mainmatter} command
changes the setting of page numbers from roman numerals to arabic.
-@node \makeatletter and \makeatother
-@subsection @code{\makeatletter} and @code{\makeatother}
+@node \makeatletter & \makeatother
+@subsection @code{\makeatletter} & @code{\makeatother}
Synopsis:
@@ -598,9 +621,9 @@ For a comprehensive list of macros with an at-sign
in their names see @url{http://ctan.org/pkg/macros2e}. These macros are
mainly intended to package or class authors.
-The example below is typical. In the user's class file is a command
-@code{\thesis@@universityname}. The user wants to change the
-definition. These three lines should go in the preamble, before the
+In this example the class file has a command
+@code{\thesis@@universityname} that the user wants to change. These
+three lines should go in the preamble, before the
@code{\begin@{document@}}.
@example
@@ -625,8 +648,8 @@ Synopsis:
@example
\newcommand@{\mycmd@}@{\@@ifstar@{\mycmd@@star@}@{\mycmd@@nostar@}@}
-\newcommand@{\mycmd@@nostar@}[@var{non-starred command number of args}]@{@var{body of non-starred command}@}
-\newcommand@{\mycmd@@star@}[@var{starred command number of args}]@{@var{body of starred command}@}
+\newcommand@{\mycmd@@nostar@}[@var{nostar-num-args}]@{@var{nostar-body}@}
+\newcommand@{\mycmd@@star@}[@var{star-num-args}]@{@var{star-body}@}
@end example
Many standard @LaTeX{} environments or commands have a variant with the
@@ -647,7 +670,7 @@ are @code{\mycmd@@nostar} and @code{\mycmd@@star}. They could take the
same number of arguments or a different number, or no arguments at all.
As always, in a @LaTeX{} document a command using at-sign@tie{}@code{@@}
must be enclosed inside a @code{\makeatletter ... \makeatother} block
-(@pxref{\makeatletter and \makeatother}).
+(@pxref{\makeatletter & \makeatother}).
This example of @code{\@@ifstar} defines the command @code{\ciel} and a
variant @code{\ciel*}. Both have one required argument. A call to
@@ -661,15 +684,16 @@ variant @code{\ciel*}. Both have one required argument. A call to
@end example
In the next example, the starred variant takes a different number of
-arguments than does the unstarred one. With this definition, Agent
-007's @code{``My name is \agentsecret*@{Bond@},
-\agentsecret@{James@}@{Bond@}.''} is equivalent to @code{``My name is
-\textsc@{Bond@}, \textit@{James@} textsc@{Bond@}.''}
+arguments than the unstarred one. With this definition, Agent 007's
+@code{``My name is \agentsecret*@{Bond@},
+\agentsecret@{James@}@{Bond@}.''} is equivalent to entering the commands
+@code{``My name is \textsc@{Bond@}, \textit@{James@} textsc@{Bond@}.''}
@example
\newcommand*@{\agentsecret@@unstarred@}[2]@{\textit@{#1@} \textsc@{#2@}@}
\newcommand*@{\agentsecret@@starred@}[1]@{\textsc@{#1@}@}
-\newcommand*@{\agentsecret@}@{\@@ifstar@{\agentsecret@@starred@}@{\agentsecret@@unstarred@}@}
+\newcommand*@{\agentsecret@}@{%
+ \@@ifstar@{\agentsecret@@starred@}@{\agentsecret@@unstarred@}@}
@end example
There are two sometimes more convenient ways to accomplish the work of
@@ -686,6 +710,38 @@ There are two sometimes more convenient ways to accomplish the work of
@end example
+@node CTAN
+@section CTAN: Comprehensive @TeX{} Archive Network
+
+@cindex CTAN
+
+The Comprehensive @TeX{} Archive Network, CTAN, is the @TeX{} and
+@LaTeX{} community's repository of free material. It is a set of
+Internet sites around the world that offer material related to @LaTeX{}
+for download. Visit CTAN on the web at @url{https://ctan.org}.
+
+This material is organized into packages, discrete bundles that
+typically offer some coherent functionality and are maintained by one
+person or a small number of people. For instance, many publishers have
+a package that allows authors to format papers to that publisher's
+specifications.
+
+In addition to the massive holdings, the web site offers features such
+as search by name or by functionality.
+
+@cindex DANTE e.V.
+@cindex mirrors of CTAN
+CTAN is not a single site, but instead is a set of sites. One of the
+sites is the core. This site actively manages the material, for
+instance, by accepting uploads of new or updated packages. It is
+hosted by the German @TeX{} group DANTE e.V. Other sites around the
+world help out by mirroring, that is, automatically syncing their
+collections with the core site and then in turn making their copies
+publicly available. This gives users close to their location better
+access and relieves the load on the core site. The list of mirrors is
+at @url{https://ctan.org/mirrors}.
+
+
@node Document classes
@chapter Document classes
@@ -711,22 +767,27 @@ The following document @var{class} names are built into @LaTeX{}.
@table @code
@item article
+@anchor{document classes article}
For a journal article, a presentation, and miscellaneous general use.
@item book
+@anchor{document classes book}
Full-length books, including chapters and possibly including front
matter, such as a preface, and back matter, such as an appendix
(@pxref{Front/back matter}).
@item letter
+@anchor{document classes letter}
Mail, optionally including mailing labels
(@pxref{Letters}).
@item report
+@anchor{document classes report}
For documents of length between an @code{article} and a @code{book},
such as technical reports or theses, which may contain several chapters.
@item slides
+@anchor{document classes slides}
For slide presentations---rarely used today. In its place the
@code{beamer} package is perhaps the most prevalent (@pxref{beamer
template}).
@@ -750,9 +811,9 @@ Standard @var{options} are described in the next section.
@cindex class options
@cindex global options
-You can specify so-called @dfn{global options} or @dfn{class options} to
-the @code{\documentclass} command by enclosing them in square brackets.
-To specify more than one @var{option}, separate them with a comma, as in:
+You can specify @dfn{global options} or @dfn{class options} to the
+@code{\documentclass} command by enclosing them in square brackets. To
+specify more than one @var{option}, separate them with a comma.
@example
\documentclass[@var{option1},@var{option2},...]@{@var{class}@}
@@ -945,7 +1006,7 @@ SMC Math Department} is for a class.
Inside of a class or package file you can use the at-sign @code{@@} as a
character in command names without having to surround the code
containing that command with @code{\makeatletter} and
-@code{\makeatother}. @xref{\makeatletter and \makeatother}. This allow
+@code{\makeatother}. @xref{\makeatletter & \makeatother}. This allow
you to create commands that users will not accidentally redefine.
Another technique is to preface class- or package-specific commands with
some string to prevent your class or package from interfering with
@@ -997,7 +1058,6 @@ most of its work: declaring new variables, commands and fonts, and
loading other files.
@end enumerate
-
Here is a starting class file, which should be saved as @file{stub.cls}
where @LaTeX{} can find it, for example in the same directory as the
@file{.tex} file.
@@ -1011,6 +1071,7 @@ where @LaTeX{} can find it, for example in the same directory as the
@end example
@cindex class file example
+@noindent
It identifies itself, handles the class options via the default of
passing them all to the @code{article} class, and then loads the
@code{article} class to provide the basis for this class's code.
@@ -1021,6 +1082,7 @@ Class Guide, at
of the descriptions here derive from this document), or the tutorial
@url{https://www.tug.org/TUGboat/tb26-3/tb84heff.pdf}.
+
@node Class and package commands
@subsection Class and package commands
@cindex class and package commands
@@ -1112,10 +1174,10 @@ or @code{\DeclareOption*}.
@cindex package options
@cindex options, class
@cindex options, package
-Make an option available to a user, for invoking in their
+Make an option available to a user to invoke in their
@code{\documentclass} command. For example, the @code{smcmemo} class
-could have an option allowing users to put the institutional logo on the
-first page with @code{\documentclass[logo]@{smcmemo@}}. The class file
+could have an option @code{\documentclass[logo]@{smcmemo@}} allowing
+users to put the institutional logo on the first page. The class file
must contain @code{\DeclareOption@{logo@}@{@var{code}@}} (and later,
@code{\ProcessOptions}).
@@ -1162,14 +1224,14 @@ Commands defined this way are a bit less efficient than those defined
using @code{\newcommand} so unless the command's data is fragile and the
command is used within a moving argument, use @code{\newcommand}.
-@PkgIndex{etoolbox}
-The @code{etoolbox} package offers commands @code{\newrobustcmd},
-@code{\newrobustcmd*}, @code{\renewrobustcmd}, @code{\renewrobustcmd*},
-@code{\providerobustcmd}, and @code{\providerobustcmd*} which are similar
-to @code{\newcommand}, @code{\newcommand*}, @code{\renewcommand},
-@code{\renewcommand*}, @code{\providecommand}, and
-@code{\providecommand*}, but define a robust @var{cmd} with two advantages
-as compared to @code{\DeclareRobustCommand}:
+@PkgIndex{etoolbox} The @file{etoolbox} package offers the commands
+@code{\newrobustcmd}, @code{\newrobustcmd*}, as well as the commands
+@code{\renewrobustcmd}, @code{\renewrobustcmd*}, and the commands
+@code{\providerobustcmd}, and @code{\providerobustcmd*}. These are
+similar to @code{\newcommand}, @code{\newcommand*},
+@code{\renewcommand}, @code{\renewcommand*}, @code{\providecommand}, and
+@code{\providecommand*}, but define a robust @var{cmd} with two
+advantages as compared to @code{\DeclareRobustCommand}:
@enumerate
@item
They use the low-level e-@TeX{} protection mechanism rather than the
@@ -1188,12 +1250,18 @@ commands, so they do not just make a log message when you redefine
@item \InputIfFileExists@{@var{file name}@}@{@var{true code}@}@{@var{false code}@}
@findex \IfFileExists
@findex \InputIfFileExists
-Execute @var{true code} if @LaTeX{} can find the file @file{@var{file
-name}} and @var{false code} otherwise. In the second case it inputs the
-file immediately after executing @var{true code}. Thus
-@code{\IfFileExists@{img.pdf@}@{\includegraphics@{img.pdf@}@}@{\typeout@{WARNING:
-img.pdf not found@}@}} will include the graphic @file{img.pdf} if it is
-found but otherwise just give a warning.
+Execute @var{true code} if @LaTeX{} finds the file @file{@var{file
+name}} or @var{false code} otherwise. In the first case it executing
+@var{true code} and then inputs the file. Thus the command
+
+@example
+\IfFileExists@{img.pdf@}@{%
+ \includegraphics@{img.pdf@}@}@{\typeout@{!! img.pdf not found@}
+@end example
+
+@noindent
+will include the graphic @file{img.pdf} if it is found and otherwise
+give a warning.
This command looks for the file in all search paths that @LaTeX{} uses,
not only in the current directory. To look only in the current
@@ -1218,11 +1286,15 @@ The @var{options list}, if present, is a comma-separated list. The
@c and do some actions conditionnally on version later or not to some
@c date.
-If you request a @var{release date} and the date of
-the package installed on your system is earlier, then you get a warning
-on the screen and in the log like @code{You have requested, on input
-line 4, version `2038/01/19' of document class article, but only version
-`2014/09/29 v1.4h Standard LaTeX document class' is available.}
+If you request a @var{release date} and the date of the package
+installed on your system is earlier, then you get a warning on the
+screen and in the log like this.
+
+@example
+You have requested, on input line 4, version `2038/01/19' of
+document class article, but only version `2014/09/29 v1.4h
+Standard LaTeX document class' is available.
+@end example
The command version @code{\LoadClassWithOptions} uses the list of
options for the current class. This means it ignores any options passed
@@ -1255,9 +1327,12 @@ To specify a version of the format that you know to have certain
features, include the optional @var{format date} on which those features
were implemented. If present it must be in the form @code{YYYY/MM/DD}.
If the format version installed on your system is earlier than
-@var{format date} then you get a warning like @samp{You have requested
-release `2038/01/20' of LaTeX, but only release `2016/02/01' is
-available.}
+@var{format date} then you get a warning like this.
+
+@example
+You have requested release `2038/01/20' of LaTeX, but only
+release `2016/02/01' is available.
+@end example
@item \OptionNotUsed
@findex \OptionNotUsed
@@ -1288,17 +1363,23 @@ options.)
If your own code is bringing in a package twice then you can collapse
that to once, for example replacing the two
-@code{\RequirePackage[landscape]@{geometry@}\RequirePackage[margins=1in]@{geometry@}}
-with the single
-@code{\RequirePackage[landscape,margins=1in]@{geometry@}}. But if you
-are loading a package that in turn loads another package then you need
-to queue up the options you desire for this other package. For
-instance, suppose the package @code{foo} loads the package
-@code{geometry}. Instead of
-@code{\RequirePackage@{foo@}\RequirePackage[draft]@{graphics@}} you must
-write @code{\PassOptionsToPackage@{draft@}@{graphics@}
-\RequirePackage@{foo@}}. (If @code{foo.sty} loads an option in conflict
-with what you want then you may have to look into altering its source.)
+@code{\RequirePackage[landscape]@{geometry@}} and
+@code{\RequirePackage[margins=1in]@{geometry@}} with the single command
+@code{\RequirePackage[landscape,margins=1in]@{geometry@}}.
+
+However, imagine that you are loading @file{firstpkg} and inside that
+package it loads @file{secondpkg}, and you need the second package to be
+loaded with option @code{draft}. Then before doing the first package
+you must queue up the options for the second package, like this.
+
+@example
+\PassOptionsToPackage@{draft@}@{secondpkg@}
+\RequirePackage@{firstpkg@}
+@end example
+
+@noindent
+(If @code{firstpkg.sty} loads an option in conflict with what you want
+then you may have to alter its source.)
These commands are useful for general users as well as class and package
writers. For instance, suppose a user wants to load the @code{graphicx}
@@ -1350,41 +1431,42 @@ options in the order specified in the calling commands, rather than in
the order of declaration in the class or package. For a package this
means that the global options are processed first.
-
@item \ProvidesClass@{@var{class name}@}[@var{release date} @var{brief additional information}]
@item \ProvidesClass@{@var{class name}@}[@var{release date}]
@item \ProvidesPackage@{@var{package name}@}[@var{release date} @var{brief additional information}]
@item \ProvidesPackage@{@var{package name}@}[@var{release date}]
@findex \ProvidesClass
@findex \ProvidesPackage
-Identifies the class or package, printing a message to the screen and the log file.
+Identifies the class or package, printing a message to the screen and
+the log file.
-When a user writes @code{\documentclass@{smcmemo@}} then @LaTeX{} loads
-the file @file{smcmemo.cls}. Similarly, a user writing
-@code{\usepackage@{test@}} prompts @LaTeX{} to load the file
-@code{test.sty}. If the name of the file does not match the declared
-class or package name then you get a warning. Thus, if you invoke
+When you load a class or package, for example with
+@code{\documentclass@{smcmemo@}} or @code{\usepackage@{test@}}, @LaTeX{}
+inputs a file. If the name of the file does not match the class or
+package name declared in it then you get a warning. Thus, if you invoke
@code{\documentclass@{smcmemo@}}, and the file @file{smcmemo.cls} has
the statement @code{\ProvidesClass@{xxx@}} then you get a warning like
@code{You have requested document class `smcmemo', but the document
class provides 'xxx'.} This warning does not prevent @LaTeX{} from
processing the rest of the class file normally.
-If you include the optional argument, then you must include the date, before
-the first space if any, and it must have the form @code{YYYY/MM/DD}. The rest
-of the optional argument is free-form, although it traditionally identifies
-the class, and is written to the screen during compilation and to the
-log file. Thus, if your file @file{smcmemo.cls} contains the line
-@code{\ProvidesClass@{smcmemo@}[2008/06/01 v1.0 SMC memo class]} and your
-document's first line is @code{\documentclass@{smcmemo@}} then you will
-see @code{Document Class: smcmemo 2008/06/01 v1.0 SMC memo class}.
+If you include the optional argument then you must include a date,
+before any spaces, of the form @code{YYYY/MM/DD}. The rest of the
+optional argument is free-form, although it traditionally identifies the
+class, and is written to the screen during compilation and to the log
+file. Thus, if your file @file{smcmemo.cls} contains the line
+@code{\ProvidesClass@{smcmemo@}[2008/06/01 v1.0 SMC memo class]} and
+your document's first line is @code{\documentclass@{smcmemo@}} then you
+will see @code{Document Class: smcmemo 2008/06/01 v1.0 SMC memo class}.
The date in the optional argument allows class and package users to ask
-to be warned if the version of the class or package installed on their
-system is earlier than @var{release date}, by using the optional arguments
-such as @code{\documentclass@{smcmemo@}[2018/10/12]} or
-@code{\usepackage@{foo@}[[2017/07/07]]}. (Note that package users only
-rarely include a date, and class users almost never do.)
+to be warned if the version of the class or package is earlier than
+@var{release date}. For instance, a user could enter
+@code{\documentclass@{smcmemo@}[2018/10/12]} or
+@code{\usepackage@{foo@}[[2017/07/07]]} to require a class or package
+with certain features by specifying that it must be released no earlier
+than the given date. (Although, in practice package users only rarely
+include a date, and class users almost never do.)
@item \ProvidesFile@{@var{file name}@}[@var{additional information}]
@findex \ProvidesFile
@@ -1399,11 +1481,11 @@ file and you get in the log a string like @code{File: test.config
@item \RequirePackageWithOptions@{@var{package name}@}[@var{release date}]
@findex \RequirePackage
@findex \RequirePackageWithOptions
-Load a package, like the document author command @code{\usepackage}.
-@xref{Additional packages}. An example is
-@code{\RequirePackage[landscape,margin=1in]@{geometry@}}. Note that the
-@LaTeX{} development team strongly recommends use of these commands over
-Plain@tie{}@TeX{}'s @code{\input}; see the Class Guide.
+Load a package, like the command @code{\usepackage} (@pxref{Additional
+packages}). The @LaTeX{} development team strongly recommends use of
+these commands over Plain@tie{}@TeX{}'s @code{\input}; see the Class
+Guide. An example is
+@code{\RequirePackage[landscape,margin=1in]@{geometry@}}.
The @var{option list}, if present, is a comma-separated list. The
@var{release date}, if present, must have the form @var{YYYY/MM/DD}. If
@@ -1453,30 +1535,28 @@ and a style. The @LaTeX{} commands for doing this are described here.
The following type style commands are supported by @LaTeX{}.
-This first group of commands is typically used with an argument, as in
-@code{\textit@{@var{text}@}}. In the table below, the corresponding
-command in parenthesis is the ``declaration form'', which takes no
-arguments, as in @code{@{\itshape @var{text}@}}. The scope of the
-declaration form lasts until the next type style command or the end of
-the current group.
-
-These commands, in both the argument form and the declaration form,
-are cumulative; e.g., you can say either @code{\sffamily\bfseries} or
-@code{\bfseries\sffamily} to get bold sans serif.
+In the table below the listed commands, the @code{\text...} commands,
+is used with an argument, as in @code{\textit@{@var{text}@}}. This is
+the preferred form. But shown after it, in parenthesis, is the
+corresponding declaration form, which is sometimes useful. This form
+takes no arguments, as in @code{@{\itshape @var{text}@}}. The scope of
+the declaration form lasts until the next type style command or the end
+of the current group. In addition, each has an environment form such as
+@code{\begin@{itshape@}...\end@{itshape@}}.
-You can alternatively use an environment form of the declarations; for
-instance, @code{\begin@{ttfamily@}...\end@{ttfamily@}}.
+These commands, in both the argument form and the declaration form, are
+cumulative; for instance you can get bold sans serif by saying either of
+@code{\sffamily\bfseries} or @code{\bfseries\sffamily}.
@findex \nocorrlist
@findex \nocorr
-These font-switching commands automatically insert italic corrections
-if needed. (@xref{\/}, for the details of italic corrections.)
-Specifically, they insert the italic correction unless the following
-character is in the list @code{\nocorrlist}, which by default consists
-of a period and a comma. To suppress the automatic insertion of
-italic correction, use @code{\nocorr} at the start or end of the
-command argument, such as @code{\textit@{\nocorr text@}} or
-@code{\textsc@{text \nocorr@}}.
+One advantage of these commands is that they automatically insert italic
+corrections if needed (@pxref{\/}). Specifically, they insert the
+italic correction unless the following character is in the list
+@code{\nocorrlist}, which by default consists of a period and a comma.
+To suppress the automatic insertion of italic correction, use
+@code{\nocorr} at the start or end of the command argument, such as
+@code{\textit@{\nocorr text@}} or @code{\textsc@{text \nocorr@}}.
@table @code
@item \textrm (\rmfamily)
@@ -1541,10 +1621,14 @@ text} \emph@{@var{middle text}@} @var{end text}@}} will result in the
will be in roman.
@LaTeX{} also provides the following commands, which unconditionally
-switch to the given style, that is, are @emph{not} cumulative. Also,
-they are used differently than the above commands:
-@code{@{\@var{cmd}...@}} instead of @code{\@var{cmd}@{...@}}. These
-are two unrelated constructs.
+switch to the given style, that is, are @emph{not} cumulative. They are
+used as declarations: @code{@{\@var{cmd}...@}} instead of
+@code{\@var{cmd}@{...@}}.
+
+(The unconditional commands below are an older version of font
+switching. The earlier commands are an improvement in most
+circumstances. But sometimes an unconditional font switch is precisely
+what you want.)
@ftable @code
@item \bf
@@ -1587,13 +1671,6 @@ Typewriter (monospace, fixed-width).
The @code{\em} command is the unconditional version of @code{\emph}.
-(Some people consider the unconditional font-switching commands, such
-as @code{\tt}, obsolete and that only the cumulative commands
-(@code{\texttt}) should be used. Others think that both sets of
-commands have their place and sometimes an unconditional font switch
-is precisely what you want; for one example,
-@pxref{description,,@code{description}}.)
-
The following commands are for use in math mode. They are not
cumulative, so @code{\mathbf@{\mathit@{@var{symbol}@}@}} does not
create a boldface and italic @var{symbol}; instead, it will just be in
@@ -1679,7 +1756,7 @@ options}).
@findex \huge
@findex \Huge
-@multitable {@code{\normalsize} (default)} {24.88} {24.88} {24.88}
+@multitable {@code{\normalsize} (default)@ @ } {24.88@ @ } {24.88@ @ } {24.88}
@headitem Command @tab @code{10pt} @tab @code{11pt} @tab @code{12pt}
@item @code{\tiny}
@tab 5 @tab 6 @tab 6
@@ -1703,10 +1780,22 @@ options}).
@tab 24.88 @tab 24.88 @tab 24.88
@end multitable
-The commands as listed here are ``declaration forms''. The scope of
-the declaration form lasts until the next type style command or the
-end of the current group. You can also use the environment form of
-these commands; for instance, @code{\begin@{tiny@}...\end@{tiny@}}.
+The commands are listed here in declaration forms. You use them by
+declaring them, as with this example.
+
+@example
+\begin@{quotation@} \small
+ The Tao that can be named is not the eternal Tao.
+\end@{quotation@}
+@end example
+
+@noindent
+The scope of the @code{\small} lasts until the end of the
+@code{quotation} environment. It would also end at the next type style
+command or the end of the current group, so you could enclose it in
+extra curly braces @code{@{\small We are here, we are here, we are
+here!@}}. You can instead use the environment form of these commands;
+for instance, @code{\begin@{tiny@}...\end@{tiny@}}.
@node Low-level font commands
@@ -1722,6 +1811,7 @@ ones.
@c xx something about ultimately reading ENCFAM.fd?
@table @code
+@anchor{low level font commands fontencoding}
@item \fontencoding@{@var{encoding}@}
@findex \fontencoding
Select the font encoding, the encoding of the output font. There are a
@@ -1733,6 +1823,7 @@ accented characters used by the most widespread European languages
hyphenate words containing accented letters. For more, see
@url{https://ctan.org/pkg/encguide}.
+@anchor{low level font commands fontfamily}
@item \fontfamily@{@var{family}@}
@findex \fontfamily
@cindex families, of fonts
@@ -1740,9 +1831,9 @@ hyphenate words containing accented letters. For more, see
Select the font family. The web page
@url{http://www.tug.dk/FontCatalogue/} provides one way to browse
through many of the fonts easily used with @LaTeX{}. Here are
-examples of some common families:
+examples of some common families.
-@multitable {font} {Computer Modern Typewriter XXXX}
+@multitable {font} {Computer Modern Typewriter more space}
@item @code{pag}
@tab Avant Garde
@item @code{fvs}
@@ -1786,6 +1877,7 @@ examples of some common families:
@end multitable
+@anchor{low level font commands fontseries}
@item \fontseries@{@var{series}@}
@findex \fontseries
@cindex series, of fonts
@@ -1834,7 +1926,6 @@ The possible values for weight, individually, are:
The possible values for width, individually, are (the meaning and
relationship of these terms varies with individual typefaces):
-
@multitable {xx} {Ultra condensed}
@item @code{uc}
@tab Ultra condensed
@@ -1856,7 +1947,6 @@ relationship of these terms varies with individual typefaces):
@tab Ultra expanded
@end multitable
-
When forming the @var{series} string from the weight and width, drop the
@code{m} that stands for medium weight or medium width, unless both
weight and width are @code{m}, in which case use just one
@@ -1865,6 +1955,7 @@ weight and width are @code{m}, in which case use just one
@item \fontshape@{@var{shape}@}
@findex \fontshape
@cindex shapes, of fonts
+@anchor{low level font commands fontshape}
Select font shape. Valid shapes are:
@multitable {xx} {Slanted (oblique)xx}
@@ -1882,10 +1973,10 @@ Select font shape. Valid shapes are:
@tab Outline
@end multitable
-
The two last shapes are not available for most font families, and
small caps are often missing as well.
+@anchor{low level font commands fontsize}
@item \fontsize@{@var{size}@}@{@var{skip}@}
@findex \fontsize
@cindex font size
@@ -1898,6 +1989,7 @@ the Computer Modern typeface is 1.2 times the @code{\fontsize}.
Changing @code{\baselineskip} directly is inadvisable since its value is
reset every time a size change happens; see @code{\baselinestretch}, next.
+@anchor{low level font commands baselinestretch}
@item \baselinestretch
@findex \baselinestretch
@LaTeX{} multiplies the line spacing by the value of the
@@ -1915,6 +2007,7 @@ options, this package keeps the line spacing single-spaced in places
where that is typically desirable, such as footnotes and figure
captions. See the package documentation.
+@anchor{low level font commands linespread}
@item \linespread@{@var{factor}@}
@findex \linespread
Equivalent to
@@ -1923,6 +2016,7 @@ therefore must be followed by @code{\selectfont} to have any effect.
Best specified in the preamble, or use the @code{setspace} package, as
just described.
+@anchor{low level font commands selectfont}
@item \selectfont
@findex \selectfont
The effects of the font commands described above do not happen until
@@ -1932,6 +2026,7 @@ to put this in a macro:@*
@code{\newcommand*@{\myfont@}@{\fontfamily@{@var{familyname}@}\selectfont@}}@*
(@pxref{\newcommand & \renewcommand}).
+@anchor{low level font commands usefont}
@item \usefont@{@var{enc}@}@{@var{family}@}@{@var{series}@}@{@var{shape}@}
@findex \usefont
The same as invoking @code{\fontencoding}, @code{\fontfamily},
@@ -1968,11 +2063,16 @@ Commands for controlling the general page layout.
@findex \onecolumn
@cindex one-column output
+Synopsis:
+
+@example
+\onecolumn
+@end example
+
Start a new page and produce single-column output. If the document is
given the class option @code{onecolumn} then this is the default
-behavior (@pxref{Document class options}).
-
-This command is fragile (@pxref{\protect}).
+behavior (@pxref{Document class options}). This command is fragile
+(@pxref{\protect}).
@node \twocolumn
@@ -1991,24 +2091,25 @@ Synopses:
Start a new page and produce two-column output. If the document is given
the class option @code{twocolumn} then this is the default
-(@pxref{Document class options}).
+(@pxref{Document class options}). This command is fragile
+(@pxref{\protect}).
If the optional @var{prelim one column text} argument
is present, it is typeset in one-column mode before the two-column
typesetting starts.
-This command is fragile (@pxref{\protect}).
-
These parameters control typesetting in two-column output:
@ftable @code
@item \columnsep
+@anchor{twocolumn columnsep}
The distance between columns. The default is 35pt. Change it with a
command such as @code{\setlength@{\columnsep@}@{40pt@}} You must change
it before the two column environment starts; in the preamble is a good
place.
@item \columnseprule
+@anchor{twocolumn columnseprule}
The width of the rule between columns. The rule appears halfway between
the two columns. The default is 0pt, meaning that there is no rule.
Change it with a command such as
@@ -2016,6 +2117,7 @@ Change it with a command such as
environment starts.
@item \columnwidth
+@anchor{twocolumn columnwidth}
The width of a single column. In one-column mode this is equal to
@code{\textwidth}. In two-column mode by default @LaTeX{} sets the
width of each of the two columns to be half of @code{\textwidth} minus
@@ -2030,6 +2132,7 @@ and @pxref{table}). @LaTeX{} places starred floats at the top of a page.
The following parameters control float behavior of two-column output.
@ftable @code
+@anchor{twocolumn dbltopfraction}
@item \dbltopfraction
The maximum fraction at the top of a two-column page that may be
occupied by two-column wide floats. The default is 0.7, meaning that
@@ -2052,14 +2155,16 @@ Increase the value of @code{\dbltopfraction} to a suitably large number,
to avoid going to float pages so soon.
@end itemize
-You can redefine it, for instance with
+You can redefine it, as with
@code{\renewcommand@{\dbltopfraction@}@{0.9@}}.
+@anchor{twocolumn dblfloatpagefraction}
@item \dblfloatpagefraction
For a float page of two-column wide floats, this is the minimum fraction
that must be occupied by floats, limiting the amount of blank space.
@LaTeX{}'s default is @code{0.5}. Change it with @code{\renewcommand}.
+@anchor{twocolumn dblfloatsep}
@item \dblfloatsep
On a float page of two-column wide floats, this length is the distance
between floats, at both the top and bottom of the page. The default is
@@ -2067,11 +2172,13 @@ between floats, at both the top and bottom of the page. The default is
@code{11pt}, and @code{14pt plus2pt minus4pt} for a document set at
@code{12pt}.
+@anchor{twocolumn dbltextfloatsep}
@item \dbltextfloatsep
This length is the distance between a multi-column float at the top or
bottom of a page and the main text. The default is @code{20pt plus2pt
minus4pt}.
+@anchor{twocolumn dbltopnumber}
@item \dbltopnumber
On a float page of two-column wide floats, this counter gives the
maximum number of floats allowed at the top of the page. The @LaTeX{}
@@ -2160,6 +2267,9 @@ option (@pxref{Document class options}).
@findex \columnsep
@findex \columnseprule
@findex \columnwidth
+@anchor{page layout parameters columnsep}
+@anchor{page layout parameters columnseprule}
+@anchor{page layout parameters columnwidth}
The distance between the two columns, the width of a rule between the
columns, and the width of the columns, when the document class option
@code{twocolumn} is in effect (@pxref{Document class options}).
@@ -2167,12 +2277,14 @@ columns, and the width of the columns, when the document class option
@item \headheight
@findex \headheight
+@anchor{page layout parameters headheight}
Height of the box that contains the running head. The default in the
@code{article}, @code{report}, and @code{book} classes is @samp{12pt},
at all type sizes.
@item \headsep
@findex \headsep
+@anchor{page layout parameters headsep}
Vertical distance between the bottom of the header line and the top of
the main text. The default in the @code{article} and @code{report}
classes is @samp{25pt}. In the @code{book} class the default is: if the
@@ -2181,6 +2293,7 @@ it is @samp{0.275in}.
@item \footskip
@findex \footskip
+@anchor{page layout parameters footskip}
Distance from the baseline of the last line of text to the baseline of
the page footer. The default in the @code{article} and @code{report}
classes is @samp{30pt}. In the @code{book} class the default is: when
@@ -2189,6 +2302,7 @@ the type size is 10pt the default is @samp{0.35in}, while at 11pt it is
@item \linewidth
@findex \linewidth
+@anchor{page layout parameters linewidth}
Width of the current line, decreased for each nested @code{list}
(@pxref{list}). That is, the nominal value for @code{\linewidth} is to
equal @code{\textwidth} but for each nested list the @code{\linewidth}
@@ -2204,6 +2318,9 @@ is decreased by the sum of that list's @code{\leftmargin} and
@findex \marginparpush
@findex \marginsep
@findex \marginparwidth
+@anchor{page layout parameters marginparpush}
+@anchor{page layout parameters marginsep}
+@anchor{page layout parameters marginparwidth}
The minimum vertical space between two marginal notes, the horizontal
space between the text body and the marginal notes, and the horizontal
width of the notes.
@@ -2232,6 +2349,8 @@ distance.
@itemx \evensidemargin
@findex \oddsidemargin
@findex \evensidemargin
+@anchor{page layout parameters oddsidemargin}
+@anchor{page layout parameters evensidemargin}
The @code{\oddsidemargin} is the extra distance between the left side of
the page and the text's left margin, on odd-numbered pages when the
document class option @code{twoside} is chosen and on all pages when
@@ -2245,20 +2364,23 @@ difference between @code{\paperwidth} and @code{\textwidth}, and
@item \paperheight
@findex \paperheight
+@anchor{page layout parameters paperheight}
The height of the paper, as distinct from the height of the print area.
-It is normally set with a document class option, as in
+Normally set with a document class option, as in
@code{\documentclass[a4paper]@{article@}} (@pxref{Document class
options}).
@item \paperwidth
@findex \paperwidth
+@anchor{page layout parameters paperwidth}
The width of the paper, as distinct from the width of the print area.
-It is normally set with a document class option, as in
+Normally set with a document class option, as in
@code{\documentclass[a4paper]@{article@}} (@pxref{Document class
options}).
@item \textheight
@findex \textheight
+@anchor{page layout parameters textheight}
The normal vertical height of the page body. If the document is set at
a nominal type size of 10pt then for an @code{article} or @code{report}
the default is @samp{43\baselineskip}, while for a @code{book} it is
@@ -2268,6 +2390,7 @@ the default is @samp{43\baselineskip}, while for a @code{book} it is
@item \textwidth
@findex \textwidth
+@anchor{page layout parameters textwidth}
The full horizontal width of the entire page body. For an
@code{article} or @code{report} document, the default is @samp{345pt}
when the chosen type size is 10pt, the default is @samp{360pt} at 11pt,
@@ -2288,13 +2411,15 @@ specified width, and revert to their normal values at the end of the
@code{minipage} or @code{\parbox}.
@findex \hsize
-@findex \hsize
+@anchor{page layout parameters hsize}
+@item \hsize
This entry is included for completeness: @code{\hsize} is the @TeX{}
primitive parameter used when text is broken into lines. It should not
be used in normal @LaTeX{} documents.
@item \topmargin
@findex topmargin
+@anchor{page layout parameters topmargin}
Space between the top of the @TeX{} page (one inch from the top of the
paper, by default) and the top of the header. The value is computed
based on many other parameters: @code{\paperheight @minus{} 2in @minus{}
@@ -2303,6 +2428,7 @@ and then divided by two.
@item \topskip
@findex \topskip
+@anchor{page layout parameters topskip}
Minimum distance between the top of the page body and the baseline of
the first line of text. For the standard classes, the default is the
same as the font size, e.g., @samp{10pt} at a type size of 10pt.
@@ -2416,68 +2542,81 @@ non-float text (change them with
@ftable @code
@item \bottomfraction
@findex \bottomfraction
+@anchor{floats bottomfraction}
The maximum fraction of the page allowed to be occupied by floats at
the bottom; default @samp{.3}.
@item \floatpagefraction
@findex \floatpagefraction
+@anchor{floats floatpagefraction}
The minimum fraction of a float page that must be occupied by floats;
default @samp{.5}.
@item \textfraction
@findex \textfraction
+@anchor{floats textfraction}
Minimum fraction of a page that must be text; if floats take up too
much space to preserve this much text, floats will be moved to a
different page. The default is @samp{.2}.
@item \topfraction
@findex \topfraction
+@anchor{floats topfraction}
Maximum fraction at the top of a page that may be occupied before
floats; default @samp{.7}.
@end ftable
-Parameters relating to vertical space around floats (change them with
-@code{\setlength@{@var{parameter}@}@{@var{length expression}@}}):
+Parameters relating to vertical space around floats (change them with a
+command of the form @code{\setlength@{@var{parameter}@}@{@var{length
+expression}@}}):
@ftable @code
@item \floatsep
@findex \floatsep
+@anchor{floats floatsep}
Space between floats at the top or bottom of a page; default
@samp{12pt plus2pt minus2pt}.
@item \intextsep
@findex \intextsep
+@anchor{floats intextsep}
Space above and below a float in the middle of the main text; default
@samp{12pt plus2pt minus2pt} for 10 point and 11 point documents,
and @samp{14pt plus4pt minus4pt} for 12 point documents.
@item \textfloatsep
@findex \textfloatsep
+@anchor{floats textfloatsep}
Space between the last (first) float at the top (bottom) of a page;
default @samp{20pt plus2pt minus4pt}.
@end ftable
-Counters relating to the number of floats on a page (change them with
-@code{\setcounter@{@var{ctrname}@}@{@var{natural number}@}}):
+Counters relating to the number of floats on a page (change them with a
+command of the form @code{\setcounter@{@var{ctrname}@}@{@var{natural
+number}@}}):
@ftable @code
@item bottomnumber
@findex bottomnumber
+@anchor{floats bottomnumber}
Maximum number of floats that can appear at the bottom of a text page;
default 1.
@item dbltopnumber
@findex dbltopnumber
+@anchor{floats dbltopnumber}
Maximum number of full-sized floats that can appear at the top of a
two-column page; default 2.
@item topnumber
@findex topnumber
+@anchor{floats topnumber}
Maximum number of floats that can appear at the top of a text page;
default 2.
@item totalnumber
@findex totalnumber
+@anchor{floats totalnumber}
Maximum number of floats that can appear on a text page; default 3.
@end ftable
@@ -2495,83 +2634,672 @@ influence the position of float environments like figure and table in
@chapter Sectioning
@cindex sectioning commands
+@cindex part
+@cindex chapter
+@cindex section
+@cindex subsection
+@cindex paragraph
+@cindex subparagraph
+@findex \part
+@findex \chapter
+@findex \section
+@findex \subsection
+@findex \paragraph
+@findex \subparagraph
+
+Structure your text into divisions: parts, chapters, sections, etc. All
+sectioning commands have the same form, one of:
+
+@example
+@var{sectioning-command}@{@var{title}@}
+@var{sectioning-command}*@{@var{title}@}
+@var{sectioning-command}[@var{toc-title}]@{@var{title}@}
+@end example
+
+@noindent
+For instance, declare the start of a subsection as with
+@code{\subsection@{Motivation@}}.
+
+The table has each @var{sectioning-command} in @LaTeX{}. All are
+available in all of @LaTeX{}'s standard document classes @code{book},
+@code{report}, and@tie{}@code{article}, except that @code{\chapter} is
+not available in @code{article}.
+
+@multitable @columnfractions .25 .25 .40
+@headitem Sectioning unit @tab Command @tab Level
+@item Part
+@tab @code{\part} @tab -1 (@code{book}, @code{report}), 0 (@code{article})
+@item Chapter
+@tab @code{\chapter} @tab 0
+@item Section
+@tab @code{\section} @tab 1
+@item Subsection
+@tab @code{\subsection} @tab 2
+@item Subsubsection
+@tab @code{\subsubsection} @tab 3
+@item Paragraph
+@tab @code{\paragraph} @tab 4
+@item Subparagraph
+@tab @code{\subparagraph} @tab 5
+@end multitable
-Sectioning commands provide the means to structure your text into units:
+@cindex @code{*}-form of sectioning commands
+All these commands have a @code{*}-form that prints @var{title} as usual
+but is not numbered and does not make an entry in the table of contents.
+An example of using this is for an appendix in an @code{article} . The
+input @code{\appendix\section@{Appendix@}} gives the output @samp{A
+Appendix} (@pxref{\appendix}). You can lose the numbering@tie{}@samp{A}
+by instead entering @code{\section*@{Appendix@}} (articles often omit a
+table of contents and have simple page headers so the other differences
+from the @code{\section} command may not matter).
+
+The section title @var{title} provides the heading in the main text, but
+it may also appear in the table of contents and in the running head or
+foot (@pxref{Page styles}). You may not want the same text in these
+places as in the main text. All of these commands have an optional
+argument @var{toc-title} for these other places.
+
+The level number in the table above determines which sectional units are
+numbered, and which appear in the table of contents. If the sectioning
+command's @var{level} is less than or equal to the value of the counter
+@code{secnumdepth} then the titles for this sectioning command will be
+numbered (@pxref{Sectioning/secnumdepth}). And, if @var{level} is less
+than or equal to the value of the counter @code{tocdepth} then the table
+of contents will have an entry for this sectioning unit
+(@pxref{Sectioning/tocdepth}).
+
+@LaTeX{} expects that before you have a @code{\subsection} you will have
+a @code{\section} and, in a book, that before a @code{\section} you will
+have a @code{\chapter}. Otherwise you can get a something like a
+subsection numbered @samp{3.0.1}.
+
+Two counters relate to the appearance of sectioning commands.
@ftable @code
-@item \part
-@item \chapter
-(@code{report} and @code{book} class only)
-@item \section
-@item \subsection
-@item \subsubsection
-@item \paragraph
-@item \subparagraph
+@item secnumdepth
+@findex secnumdepth @r{counter}
+@cindex section numbers, printing
+@anchor{sectioning secnumdepth}
+@anchor{Sectioning/secnumdepth}
+Controls which sectioning commands are
+numbered. Suppress numbering of sectioning at any depth greater than
+@var{level} @code{\setcounter@{secnumdepth@}@{@var{level}@}}
+(@pxref{\setcounter}). See the above table for the level numbers. For
+instance, if the @code{secnumdepth} is 1 in an @code{article} then a
+@code{\section@{Introduction@}} command will produce output like @samp{1
+Introduction} while @code{\subsection@{Discussion@}} will produce output
+like @samp{Discussion}, without the number. @LaTeX{}'s default
+@code{secnumdepth} is@tie{}3 in @file{article} class and @tie{}2 in the
+@file{book} and @file{report} classes.
+
+@item tocdepth
+@findex tocdepth @r{counter}
+@cindex table of contents, sectioning numbers printed
+@anchor{sectioning tocdepth}
+@anchor{Sectioning/tocdepth}
+Controls which sectioning units are listed in the table of contents.
+The setting @code{\setcounter@{tocdepth@}@{@var{level}@}} makes the
+sectioning units at @var{level} be the smallest ones listed
+(@pxref{\setcounter}). See the above table for the level numbers. For
+instance, if @code{tocdepth} is@tie{}1 then the table of contents will
+list sections but not subsections. @LaTeX{}'s default
+@code{secnumdepth} is@tie{}3 in @file{article} class and @tie{}2 in the
+@file{book} and @file{report} classes.
+
@end ftable
-All sectioning commands take the same general form, e.g.,
+@menu
+* \part:: Start a part.
+* \chapter:: Start a chapter.
+* \section:: Start a section.
+* \subsection:: Start a subsection.
+* \subsubsection & \paragraph & \subparagraph:: Lower divisions.
+* \appendix:: Start appendices.
+* \frontmatter & \mainmatter & \backmatter:: The three parts of a book.
+* \@@startsection:: Layout of sectional units.
+@end menu
+
+
+@node \part
+@section @code{\part}
+
+@findex \part
+@cindex part
+@cindex sectioning, part
+
+Synopsis, one of:
@example
-\chapter[@var{toctitle}]@{@var{title}@}
+\part@{@var{title}@}
+\part*@{@var{title}@}
+\part[@var{toc-title}]@{@var{title}@}
@end example
-In addition to providing the heading @var{title} in the main text, the
-section title can appear in two other places:
+Start a document part. The standard @LaTeX{} classes @code{book},
+@code{report}, and @code{article}, all have this command.
-@enumerate
-@item
-The table of contents.
-@item
-The running head at the top of the page.
-@end enumerate
+This produces a document part, in a book.
+
+@example
+\part@{VOLUME I \\
+ PERSONAL MEMOIRS OF U.\ S.\ GRANT@}
+\chapter@{ANCESTRY--BIRTH--BOYHOOD.@}
+My family is American, and has been for generations,
+in all its branches, direct and collateral.
+@end example
-You may not want the same text in these places as in the main text.
-To handle this, the sectioning commands have an optional argument
-@var{toctitle} that, when given, specifies the text for these other
-places.
+In each standard class the @code{\part} command outputs a part number
+such as @samp{Part I}, alone on its line, in boldface, and in large
+type. Then @LaTeX{} outputs @var{title}, also alone on its line, in
+bold and in even larger type. In class @code{book}, the @LaTeX{}
+default puts each part alone on its own page. If the book is two-sided
+then @LaTeX{} will skip a page if needed to have the new part on an
+odd-numbered page. In @code{report} it is again alone on a page, but
+@LaTeX{} won't force it onto an odd-numbered page. In an @code{article}
+@LaTeX{} does not put it on a fresh page, but instead outputs the part
+number and part title onto the main document page.
-@cindex @code{*}-form of sectioning commands
-Also, all sectioning commands have @code{*}-forms that print
-@var{title} as usual, but do not include a number and do not make an
-entry in the table of contents. For instance:
+The @code{*}@tie{}form shows @var{title}
+but it does not show the part number, does not increment the
+@code{part} counter, and produces no table of contents entry.
+
+The optional argument @var{toc-title} will appear as the part title in
+the table of contents (@pxref{Table of contents etc.}) and in running
+headers (@pxref{Page styles}). If it is not present then @var{title}
+will be there. This example puts a line break in @var{title} but leaves
+out the break in the table of contents.
+
+@example
+\part[Up from the bottom; my life]@{Up from the bottom\\ my life@}
+@end example
+
+For determining which sectional units are numbered and which appear in
+the table of contents, the level number of a part is@tie{}-1
+(@pxref{Sectioning/secnumdepth} and @pxref{Sectioning/tocdepth}).
+
+@PkgIndex{indentfirst}
+In the class @code{article}, if a paragraph immediately follows the part
+title then it is not indented. To get an indent you can use the package
+@file{indentfirst}.
+
+@PkgIndex{titlesec}
+One package to change the behavior of @code{\part} is @file{titlesec}.
+See its documentation on CTAN.
+
+
+@node \chapter
+@section @code{\chapter}
+
+@findex \chapter
+@cindex chapter
+
+Synopsis, one of:
+
+@example
+\chapter@{@var{title}@}
+\chapter*@{@var{title}@}
+\chapter[@var{toc-title}]@{@var{title}@}
+@end example
+
+Start a chapter. The standard @LaTeX{} classes @code{book} and
+@code{report} have this command but @code{article} does not.
+
+This produces a chapter.
+
+@example
+\chapter@{Loomings@}
+Call me Ishmael.
+Some years ago---never mind how long precisely---having little or no
+money in my purse, and nothing particular to interest me on shore, I
+thought I would sail about a little and see the watery part of
+the world.
+@end example
+
+The @LaTeX{} default starts each chapter on a fresh page, an
+odd-numbered page if the document is two-sided. It produces a chapter
+number such as @samp{Chapter 1} in large boldface type (the size is
+@code{\huge}). It then puts @var{title} on a fresh line, in boldface
+type that is still larger (size @code{\Huge}). It also increments the
+@code{chapter} counter, adds an entry to the table of contents
+(@pxref{Table of contents etc.}), and sets the running header
+information (@pxref{Page styles}).
+
+The @code{*}@tie{}form shows @var{title} on a fresh line, in boldface.
+But it does not show the chapter number, does not increment the
+@code{chapter} counter, produces no table of contents entry, and does
+not affect the running header. (If you use the page style
+@code{headings} in a two-sided document then the header will be from the
+prior chapter.) This example illustrates.
+
+@example
+\chapter*@{Preamble@}
+@end example
+
+The optional argument @var{toc-title} will appear as the chapter title
+in the table of contents (@pxref{Table of contents etc.}) and in
+running headers (@pxref{Page styles}). If it is not present then
+@var{title} will be there. This shows the full name in the chapter
+title,
+
+@example
+\chapter[Weyl]@{Hermann Klaus Hugo (Peter) Weyl (1885--1955)@}
+@end example
+
+@noindent
+but only @samp{Weyl} on the contents page. This puts a line break in
+the title but that doesn't work well with running headers so it omits
+the break in the contents
+
+@example
+\chapter[Given it all\\ my story]@{Given it all\\ my story@}
+@end example
+
+For determining which sectional units are numbered and which appear in
+the table of contents, the level number of a chapter is@tie{}0
+(@pxref{Sectioning/secnumdepth} and @pxref{Sectioning/tocdepth}).
+
+@PkgIndex{indentfirst}
+The paragraph that follows the chapter title is not indented, as is a
+standard typographical practice. To get an indent use the package
+@file{indentfirst}.
+
+You can change what is shown for the chapter number. To change it to
+something like @samp{Lecture 1}, put in the preamble either
+@code{\renewcommand@{\chaptername@}@{Lecture@}} or this
+(@pxref{\makeatletter & \makeatother}).
+
+@example
+\makeatletter
+\renewcommand@{\@@chapapp@}@{Lecture@}
+\makeatother
+@end example
+
+@PkgIndex{babel}
+@noindent To make this change because of the primary language for
+the document, see the package @file{babel}.
+
+In a two-sided document @LaTeX{} puts a chapter on odd-numbered page, if
+necessary leaving an even-numbered page that is blank except for any
+running headers. To make that page completely blank,
+see@tie{}@ref{\clearpage & \cleardoublepage}.
+
+@PkgIndex{titlesec}
+To change the behavior of the @code{\chapter} command, you can copy its
+definition from the @LaTeX{} format file and make adjustments. But
+there are also many packages on CTAN that address this. One is
+@file{titlesec}. See its documentation, but the example below gives a
+sense of what it can do.
+
+@example
+\usepackage@{titlesec@} % in preamble
+\titleformat@{\chapter@}
+ @{\Huge\bfseries@} % format of title
+ @{@} % label, such as 1.2 for a subsection
+ @{0pt@} % length of separation between label and title
+ @{@} % before-code hook
+@end example
+
+@noindent
+This omits the chapter number @samp{Chapter 1} from the page but unlike
+@code{\chapter*} it keeps the chapter in the table of contents and the
+running headers.
+
+
+@node \section
+@section @code{\section}
+
+@findex \section
+@cindex section
+
+Synopsis, one of:
+
+@example
+\section@{@var{title}@}
+\section*@{@var{title}@}
+\section[@var{toc-title}]@{@var{title}@}
+@end example
+
+Start a section. The standard @LaTeX{} classes @code{article},
+@code{book}, and @code{report} all have this command.
+
+This produces a section.
+
+@example
+In this Part we tend to be more interested in the function,
+in the input-output behavior,
+than in the details of implementing that behavior.
+
+\section@{Turing machines@}
+Despite this desire to downplay implementation,
+we follow the approach of A~Turing that the
+first step toward defining the set of computable functions
+is to reflect on the details of what mechanisms can do.
+@end example
+
+For the standard @LaTeX{} classes @code{book} and @code{report} the
+default output is like @samp{1.2 @var{title}} (for chapter@tie{}1,
+section@tie{}2), alone on its line and flush left, in boldface and a
+larger type (the type size is @code{\Large}). The same holds in
+@code{article} except that there are no chapters in that class so it
+looks like @samp{2 @var{title}}.
+
+The @code{*}@tie{}form shows @var{title}.
+But it does not show the section number, does not increment the
+@code{section} counter, produces no table of contents entry, and does
+not affect the running header. (If you use the page style
+@code{headings} in a two-sided document then the header will be from the
+prior section.)
+
+The optional argument @var{toc-title} will appear as the section title
+in the table of contents (@pxref{Table of contents etc.}) and in
+running headers (@pxref{Page styles}). If it is not present then
+@var{title} will be there. This shows the full name in the title of the
+section,
+
+@example
+\section[Elizabeth~II]@{Elizabeth the Second,
+ by the Grace of God of the United Kingdom,
+ Canada and Her other Realms and Territories Queen,
+ Head of the Commonwealth, Defender of the Faith.@}
+@end example
+
+@noindent
+but only @samp{Elizabeth II} on the contents page and in the headers.
+This has a line break in @var{title} but that does not work with headers
+so it is omitted from the contents and headers.
+
+@example
+\section[Truth is, I cheated; my life story]@{Truth is,
+ I cheated\\my life story@}
+@end example
+
+For determining which sectional units are numbered and which appear in
+the table of contents, the level number of a section is@tie{}1
+(@pxref{Sectioning/secnumdepth} and @pxref{Sectioning/tocdepth}).
+
+@PkgIndex{indentfirst}
+The paragraph that follows the section title is not indented, as is a
+standard typographical practice. One way to get an indent is to use the
+package @file{indentfirst}.
+
+@PkgIndex{titlesec}
+In general, to change the behavior of the @code{\section} command, there
+are a number of options. One is the @code{\@@startsection} command
+(@pxref{\@@startsection}). There are also many packages on CTAN that
+address this, including @file{titlesec}. See the documentation but the
+example below gives a sense of what they can do.
+
+@c credit: egreg https://groups.google.com/forum/#!topic/comp.text.tex/tvc8oM5P4y4
+@example
+\usepackage@{titlesec@} % in preamble
+\titleformat@{\section@}
+ @{\normalfont\Large\bfseries@} % format of title
+ @{\makebox[1pc][r]@{\thesection\hspace@{1pc@}@}@} % label
+ @{0pt@} % length of separation between label and title
+ @{@} % before-code hook
+\titlespacing*@{\section@}
+ @{-1pc@}@{18pt@}@{10pt@}[10pc]
+@end example
+
+@noindent
+That puts the section number in the margin.
+
+
+@node \subsection
+@section @code{\subsection}
+
+@findex \subsection
+@cindex subsection
+
+Synopsis, one of:
+
+@example
+\subsection@{@var{title}@}
+\subsection*@{@var{title}@}
+\subsection[@var{toc-title}]@{@var{title}@}
+@end example
+
+Start a subsection. The standard @LaTeX{} classes @code{article},
+@code{book}, and @code{report} all have this command.
+
+This produces a subsection.
+
+@example
+We will show that there are more functions than Turing machines and that
+therefore some functions have no associated machine.
+
+\subsection@{Cardinality@} We will begin with two paradoxes that
+dramatize the challenge to our intuition posed by comparing the sizes of
+infinite sets.
+@end example
+
+For the standard @LaTeX{} classes @code{book} and @code{report} the
+default output is like @samp{1.2.3 @var{title}} (for chapter@tie{}1,
+section@tie{}2, subsection@tie{}3), alone on its line and flush left, in
+boldface and a larger type (the type size is @code{\large}). The same
+holds in @code{article} except that there are no chapters in that class
+so it looks like @samp{2.3 @var{title}}.
+
+The @code{*}@tie{}form shows @var{title}.
+But it does not show the section number, does not increment the
+@code{section} counter, and produces no table of contents entry.
+
+The optional argument @var{toc-title} will appear as the section title
+in the table of contents (@pxref{Table of contents etc.}). If it is
+not present then @var{title} will be there. This shows the full name in
+the title of the section,
+
+@example
+\subsection[$\alpha,\beta,\gamma$ paper]@{\textit@{The Origin of
+ Chemical Elements@} by R.A.~Alpher, H.~Bethe, and G.~Gamow@}
+@end example
+
+@noindent
+but only @samp{@BES{03B1,\alpha},@BES{03B2,\beta},@BES{03B3,\gamma}
+paper} on the contents page.
+
+For determining which sectional units are numbered and which appear in
+the table of contents, the level number of a subsection is@tie{}2
+(@pxref{Sectioning/secnumdepth} and @pxref{Sectioning/tocdepth}).
+
+@PkgIndex{indentfirst}
+The paragraph that follows the subsection title is not indented, as is a
+standard typographical practice. One way to get an indent is to use the
+package @file{indentfirst}.
+
+@PkgIndex{titlesec}
+There are a number of ways to change the behavior of the
+@code{\subsection} command. One is the @code{\@@startsection} command
+(@pxref{\@@startsection}). There are also many packages on CTAN that
+address this, including @file{titlesec}. See the documentation but the
+example below gives a sense of what they can do.
+
+@example
+\usepackage@{titlesec@} % in preamble
+\titleformat@{\subsection@}[runin]
+ @{\normalfont\normalsize\bfseries@} % format of the title
+ @{\thesubsection@} % label
+ @{0.6em@} % space between label and title
+ @{@} % before-code hook
+@end example
+
+@noindent
+That puts the subsection number and @var{title} in the first line of
+text.
+
+
+@node \subsubsection & \paragraph & \subparagraph
+
+@section @code{\subsubsection}, @code{\paragraph}, @code{\subparagraph}
+
+@findex \subsubsection
+@cindex subsubsection
+@findex \paragraph
+@cindex paragraph
+@findex \subparagraph
+@cindex subparagraph
+
+Synopsis, one of:
@example
-\section*@{Preamble@}
+\subsubsection@{@var{title}@}
+\subsubsection*@{@var{title}@}
+\subsubsection[@var{toc-title}]@{@var{title}@}
@end example
+@noindent
+or one of:
+
+@example
+\paragraph@{@var{title}@}
+\paragraph*@{@var{title}@}
+\paragraph[@var{toc-title}]@{@var{title}@}
+@end example
+
+@noindent
+or one of:
+
+@example
+\subparagraph@{@var{title}@}
+\subparagraph*@{@var{title}@}
+\subparagraph[@var{toc-title}]@{@var{title}@}
+@end example
+
+Start a subsubsection, paragraph, or subparagraph. The standard
+@LaTeX{} classes @code{article}, @code{book}, and @code{report} all have
+these commands, although they are not commonly used.
+
+This produces a subsubsection.
+
+@example
+\subsubsection@{Piston ring compressors: structural performance@}
+Provide exterior/interior wall cladding assemblies
+capable of withstanding the effects of load and stresses from
+consumer-grade gasoline engine piston rings.
+@end example
+
+The default output of each of the three does not change over the
+standard @LaTeX{} classes @code{article}, @code{book}, and
+@code{report}. For @code{\subsubsection} the @var{title} is alone on
+its line, in boldface and normal size type. For @code{\paragraph} the
+@var{title} is inline with the text, not indented, in boldface and
+normal size type. For @code{\subparagraph} the @var{title} is inline
+with the text, with a paragraph indent, in boldface and normal size type
+(Because an @code{article} has no chapters its subsubsections are
+numbered and so it looks like @samp{1.2.3 @var{title}}, for
+section@tie{}1, subsection@tie{}2, and subsubsection@tie{}3. The other
+two divisions are not numbered.)
+
+The @code{*}@tie{}form shows @var{title}. But it does not increment the
+associated counter and produces no table of contents entry (and does not
+show the number for @code{\subsubsection}).
+
+The optional argument @var{toc-title} will appear as the division title
+in the table of contents (@pxref{Table of contents etc.}). If it is
+not present then @var{title} will be there.
+
+For determining which sectional units are numbered and which appear in
+the table of contents, the level number of a subsubsection is@tie{}3, of
+a paragraph is@tie{}4, and of a subparagraph is@tie{}5
+(@pxref{Sectioning/secnumdepth} and @pxref{Sectioning/tocdepth}).
+
+@PkgIndex{indentfirst}
+The paragraph that follows the subsubsection title is not indented, as is a
+standard typographical practice. One way to get an indent is to use the
+package @file{indentfirst}.
+
+@PkgIndex{titlesec}
+There are a number of ways to change the behavior of the these commands.
+One is the @code{\@@startsection} command (@pxref{\@@startsection}).
+There are also many packages on CTAN that address this, including
+@file{titlesec}. See the documentation on CTAN.
+
+
+@node \appendix
+
+@section @code{\appendix}
+
@findex \appendix
-@cindex appendix, creating
-The @code{\appendix} command changes the way following sectional units
-are numbered. The @code{\appendix} command itself generates no text
-and does not affect the numbering of parts. The normal use of this
-command is something like
+@cindex appendix
+@cindex appendices
+
+Synopsis:
@example
-\chapter@{A Chapter@}
-@dots{}
\appendix
-\chapter@{The First Appendix@}
@end example
-@findex secnumdepth @r{counter}
-@cindex section numbers, printing
-@anchor{Sectioning/secnumdepth}
-The @code{secnumdepth} counter controls printing of section numbers.
-The setting
+This does not directly produce any output. But in a book or report it
+declares that subsequent @code{\chapter} commands start an appendix. In
+an article it does the same, for @code{\section} commands. It also
+resets the @code{chapter} and @code{section} counters to@tie{}0 in a
+book or report, and in an article resets the @code{section} and
+@code{subsection} counters.
+
+In this book
@example
-\setcounter@{secnumdepth@}@{@var{level}@}
+\chapter@{One@} ...
+\chapter@{Two@} ...
+ ...
+\appendix
+\chapter@{Three@} ...
+\chapter@{Four@} ...
@end example
@noindent
-suppresses heading numbers at any depth @math{> @var{level}}, where
-@code{chapter} is level zero. The default @code{secnumdepth} is 3 in
-@LaTeX{}'s @file{article} class and 2 in the @file{book} and
-@file{report} classes. (@xref{\setcounter}.)
+the first two will generate output numbered @samp{Chapter 1} and
+@samp{Chapter 2}. After the @code{\appendix} the numbering will be
+@samp{Appendix A} and @samp{Appendix B}. @xref{Larger book template}
+for another example.
+
+@PkgIndex{appendix} The @file{appendix} package adds the command
+@code{\appendixpage} to put a separate @samp{Appendices} in the document
+body before the first appendix, and the command @code{\addappheadtotoc}
+to do the same in the table of contents. You can reset the name
+@samp{Appendix} with a command like
+@code{\renewcommand@{\appendixname@}@{Specification@}}, as well as a
+number of other features. See the documentation on CTAN.
-@menu
-* \@@startsection:: Redefine layout of start of sections, subsections, etc.
-@end menu
+
+@node \frontmatter & \mainmatter & \backmatter
+
+@section @code{\frontmatter}, @code{\mainmatter}, @code{\backmatter}
+
+@findex \frontmatter
+@cindex book, front matter
+@findex \mainmatter
+@cindex book, main matter
+@findex \backmatter
+@cindex book, back matter
+@cindex book, end matter
+
+Synopsis, one of:
+
+@example
+\frontmatter
+\mainmatter
+\backmatter
+@end example
+
+Format a @code{book} class document differently according to which part
+of the document is being produced. All three commands are optional.
+
+Traditionally, a book's front matter contains such things as the title
+page, an abstract, a table of contents, a preface, a list of notations,
+a list of figures, and a list of tables. (Some of these front matter
+pages, such as the title page, are traditionally not numbered.) The
+back matter may contain such things as a glossary, notes, a
+bibliography, and an index.
+
+The @code{\frontmatter} declaration makes the pages numbered in
+lowercase roman, and makes chapters not numbered, although each
+chapter's title appears in the table of contents; if you use other
+sectioning commands here, use the @code{*}-version (@pxref{Sectioning}).
+The @code{\mainmatter} changes the behavior back to the expected
+version, and resets the page number. The @code{\backmatter} leaves the
+page numbering alone but switches the chapters back to being not
+numbered. @xref{Larger book template} for an example using the three.
@node \@@startsection
@@ -2598,14 +3326,30 @@ make such a command you may want to use the @code{\secdef} command.
@c xx define, and make a cross reference to, secdef.
Technically, @code{\@@startsection} has the form
+
@example
-\@@startsection@{@var{name}@}@{@var{level}@}@{@var{indent}@}@{@var{beforeskip}@}@{@var{afterskip}@}@{@var{style}@}*[@var{toctitle}]@{@var{title}@}
+\@@startsection@{@var{name}@}
+ @{@var{level}@}
+ @{@var{indent}@}
+ @{@var{beforeskip}@}
+ @{@var{afterskip}@}
+ @{@var{style}@}*[@var{toctitle}]@{@var{title}@}
@end example
-@noindent (the star@tie{}@code{*} is optional), so that issuing
+
+@noindent
+so that issuing
+
@example
-\renewcommand@{\section@}@{\@@startsection@{@var{name}@}@{@var{level}@}@{@var{indent}@}@{@var{beforeskip}@}@{@var{afterskip}@}@{@var{style}@}@}
+\renewcommand@{\section@}@{\@@startsection@{@var{name}@}
+ @{@var{level}@}
+ @{@var{indent}@}
+ @{@var{beforeskip}@}
+ @{@var{afterskip}@}
+ @{@var{style}@}@}
@end example
-@noindent redefines @code{\section} to have the form
+
+@noindent
+redefines @code{\section} to have the form
@code{\section*[@var{toctitle}]@{@var{title}@}} (here too, the
star@tie{}@code{*} is optional). @xref{Sectioning}. This implies that
when you write a command like @code{\renewcommand@{section@}@{...@}},
@@ -2615,55 +3359,56 @@ the examples below.
@table @var
@item name
-@anchor{\@@startsection/name} Name of the counter used to number the
-sectioning header. This counter must be defined separately. Most
-commonly this is either @code{section}, @code{subsection}, or
-@code{paragraph}. Although in those three cases the counter name is the
-same as the sectioning command itself, using the same name is not
-required.
+@anchor{startsection name}
+@anchor{\@@startsection/name}
+Name of the counter used to number the sectioning header. This counter
+must be defined separately. Most commonly this is either
+@code{section}, @code{subsection}, or @code{paragraph}. Although in
+those cases the counter name is the same as the sectioning command
+itself, you don't have to use the same name.
Then @code{\the}@var{name} displays the title number and
@code{\}@var{name}@code{mark} is for the page headers. See the third
example below.
@item level
-@anchor{\@@startsection/level} An integer giving the depth of the
-sectioning command: 0 for @code{chapter} (only applies to the standard
-@code{book} and @code{report} classes), 1 for @code{section}, 2 for
-@code{subsection}, 3 for @code{subsubsection}, 4 for @code{paragraph},
-and 5 for @code{subparagraph}. In the @code{book} and @code{report}
-classes @code{part} has level -1, while in the @code{article} class
-@code{part} has level 0.
-
-If @var{level} is less than or equal to the value of @code{secnumdepth}
-then the titles for this sectioning command will be numbered. For
-instance, in an @code{article}, if @code{secnumdepth} is 1 then a
-@code{\section@{Introduction@}} command will produce output like ``1
+@anchor{startsection level}
+@anchor{\@@startsection/level}
+An integer giving the depth of the sectioning command.
+@xref{Sectioning} for the list of standard level numbers.
+
+If @var{level} is less than or equal to the value of the counter
+@code{secnumdepth} then titles for this sectioning command will be
+numbered (@pxref{Sectioning/secnumdepth}). For instance, if
+@code{secnumdepth} is 1 in an @code{article} then the command
+@code{\section@{Introduction@}} will produce output like ``1
Introduction'' while @code{\subsection@{Discussion@}} will produce
output like ``Discussion'', without the number prefix.
-@xref{Sectioning/secnumdepth}.
-If @var{level} is less than or equal to the value of @var{tocdepth} then
-the table of contents will have an entry for this sectioning unit.
-For instance, in an @code{article}, if @var{tocdepth} is 1 then the table of
-contents will list sections but not subsections.
-@c xx add, and cross reference to, tocdepth
+If @var{level} is less than or equal to the value of the counter
+@var{tocdepth} then the table of contents will have an entry for this
+sectioning unit (@pxref{Sectioning/tocdepth}). For instance, in an
+@code{article}, if @var{tocdepth} is 1 then the table of contents will
+list sections but not subsections.
@item indent
-@anchor{\@@startsection/indent} A length giving the indentation of all
-of the title lines with respect to the left margin. To have the title
-flush with the margin use @code{0pt}. A negative indentation such as
-@code{-\parindent} will move the title into the left margin.
+@anchor{startsection indent}
+@anchor{\@@startsection/indent}
+A length giving the indentation of all of the title lines with respect
+to the left margin. To have the title flush with the margin use
+@code{0pt}. A negative indentation such as @code{-\parindent} will move
+the title into the left margin.
@item beforeskip
-@anchor{\@@startsection/beforeskip} The absolute value of this length is
-the amount of vertical space that is inserted before this sectioning
-unit's title. This space will be discarded if the sectioning unit
-happens to start at the top of a fresh page. If this number is negative
-then the first paragraph following the header is not indented, if it is
-non-negative then the first paragraph is indented. (Note that the
-negative of @code{1pt plus 2pt minus 3pt} is @code{-1pt plus -2pt minus
--3pt}.)
+@anchor{startsection beforeskip}
+@anchor{\@@startsection/beforeskip}
+The absolute value of this length is the amount of vertical space that
+is inserted before this sectioning unit's title. This space will be
+discarded if the sectioning unit happens to start at the top of a fresh
+page. If this number is negative then the first paragraph following the
+header is not indented, if it is non-negative then the first paragraph
+is indented. (Note that the negative of @code{1pt plus 2pt minus 3pt}
+is @code{-1pt plus -2pt minus -3pt}.)
For example, if @var{beforeskip} is @code{-3.5ex plus -1ex minus -0.2ex}
then to start the new sectioning unit, @LaTeX{} will add about 3.5 times
@@ -2683,14 +3428,15 @@ where @LaTeX{} would put the baseline of the first text line on that
page.)
@item afterskip
-@anchor{\@@startsection/afterskip} This is a length. If @var{afterskip}
-is non-negative then this is the vertical space inserted after the
-sectioning unit's title header. If it is negative then the title header
-becomes a run-in header, so that it becomes part of the next paragraph.
-In this case the absolute value of the length gives the horizontal space
-between the end of the title and the beginning of the following
-paragraph. (Note that the negative of @code{1pt plus 2pt minus 3pt} is
-@code{-1pt plus -2pt minus -3pt}.)
+@anchor{startsection afterskip}
+@anchor{\@@startsection/afterskip}
+This is a length. If @var{afterskip} is non-negative then this is the
+vertical space inserted after the sectioning unit's title header. If it
+is negative then the title header becomes a run-in header, so that it
+becomes part of the next paragraph. In this case the absolute value of
+the length gives the horizontal space between the end of the title and
+the beginning of the following paragraph. (Note that the negative of
+@code{1pt plus 2pt minus 3pt} is @code{-1pt plus -2pt minus -3pt}.)
As with @var{beforeskip}, using a rubber length, with @code{plus} and
@code{minus} components, is good practice here since it gives @LaTeX{}
@@ -2707,48 +3453,39 @@ header's from standalone to run-in, you cannot use a negative
@code{afterskip} to cancel part of the @code{\parskip}.)
@item style
-@anchor{\@@startsection/style} Controls the styling of the title. See
-the examples below. Typical commands to use here are @code{\centering},
-@code{\raggedright}, @code{\normalfont}, @code{\hrule}, or
-@code{\newpage}. The last command in @var{style} may be one such as
-@code{\MakeUppercase} or @code{\fbox} that takes one argument. The
+@anchor{startsection style}
+@anchor{\@@startsection/style}
+Controls the styling of the title. See the examples below. Typical
+commands to use here are @code{\centering}, @code{\raggedright},
+@code{\normalfont}, @code{\hrule}, or @code{\newpage}. The last command
+in @var{style} may be one that takes one argument, such as
+@code{\MakeUppercase} or @code{\fbox} that takes one argument. The
section title will be supplied as the argument to this command. For
instance, setting @var{style} to @code{\bfseries\MakeUppercase} would
-produce titles that are bold and upper case.
+produce titles that are bold and uppercase.
@end table
These are @LaTeX{}'s defaults for the first three sectioning units that
are defined with @code{\@@startsection}, for the @file{article},
-@file{book}, and @file{report} classes.
-
-@multitable @columnfractions .10 .30 .30 .30
-@headitem @tab @code{section} @tab @code{subsection} @tab @code{subsubsection}
-@item @ref{\@@startsection/name,@var{name},@var{name}}
-@tab section @tab subsection @tab subsubsection
-@item @ref{\@@startsection/level,@var{level},@var{level}}
-@tab 1 @tab 2 @tab 3
-@item @ref{\@@startsection/indent,@var{indent},@var{indent}}
-@tab @code{0pt} @tab @code{0pt} @tab @code{0pt}
-@item @ref{\@@startsection/beforeskip,@var{beforeskip},@var{beforeskip}}
-@tab @code{-3.5ex plus -1ex minus -0.2ex}
-@tab @code{-3.25ex plus -1ex minus -0.2ex}
-@tab @code{-3.25ex plus -1ex minus -0.2ex}
-@item @ref{\@@startsection/afterskip,@var{afterskip},@var{afterskip}}
-@tab @code{2.3ex plus 0.2ex}
-@tab @code{1.5ex plus 0.2ex}
-@tab @code{1.5ex plus 0.2ex}
-@item @ref{\@@startsection/style,@var{style},@var{style}}
-@tab @code{\normalfont\Large\bfseries}
-@tab @code{\normalfont\large\bfseries}
-@tab @code{\normalfont\normalsize\bfseries}
-@end multitable
+@file{book}, and @file{report} classes. For section, the @var{level} is
+1, the @var{indent} is 0@dmn{pt}, the @var{beforeskip} is @code{-3.5ex
+plus -1ex minus -0.2ex}, the @var{afterskip} is @code{2.3ex plus 0.2ex},
+and the @var{style} is @code{\normalfont\Large\bfseries}. For
+subsection, the @var{level} is 2, the @var{indent} is 0@dmn{pt}, the
+@var{beforeskip} is @code{-3.25ex plus -1ex minus -0.2ex}, the
+@var{afterskip} is @code{1.5ex plus 0.2ex}, and the @var{style} is
+@code{\normalfont\large\bfseries}. For subsubsection, the @var{level}
+is 3, the @var{indent} is 0@dmn{pt}, the @var{beforeskip} is
+@code{-3.25ex plus -1ex minus -0.2ex}, the @var{afterskip} is
+@code{1.5ex plus 0.2ex}, and the @var{style} is
+@code{\normalfont\normalsize\bfseries}.
Here are examples. They go either in a package or class file or in the
preamble of a @LaTeX{} document. If you put them in the preamble they
must go between a @code{\makeatletter} command and a
@code{\makeatother}. (Probably the error message @code{You can't use
`\spacefactor' in vertical mode.} means that you forgot this.)
-@xref{\makeatletter and \makeatother}.
+@xref{\makeatletter & \makeatother}.
This will put section titles in large boldface type, centered. It says
@code{\renewcommand} because @LaTeX{}'s standard classes have already
@@ -2780,7 +3517,9 @@ This will put @code{subsection} titles in small caps type, inline with the parag
@}
@end example
-The prior examples redefined existing sectional unit title commands. This defines a new one, illustrating the needed counter and macros to display that counter.
+The prior examples redefined existing sectional unit title commands.
+This defines a new one, illustrating the needed counter and macros to
+display that counter.
@c From https://groups.google.com/forum/#!searchin/comp.text.tex/startsection%7Csort:relevance/comp.text.tex/sB-nTS-oL08/ZZeKYdG0llMJ
@example
@@ -2805,38 +3544,48 @@ The prior examples redefined existing sectional unit title commands. This defin
@cindex cross references
-One reason for numbering things such as figures and equations is to
-refer the reader to them, as in ``See Figure~3 for more details.''
-
@cindex label
-Including the figure number in the source is poor practice since if that
-number changes as the document evolves then you must remember to update
-this reference by hand. Instead, @LaTeX{} has you write a @dfn{label}
-like @code{\label@{eq:GreensThm@}} and refer to it with @code{See
-equation~\ref@{eq:GreensThm@}}.
-
-@LaTeX{} writes the information from the labels to a file with the same
-name as the file containing the @code{\label@{...@}} but with an
-@file{.aux} extension. (The information has the format
-@code{\newlabel@{@var{label}@}@{@{@var{currentlabel}@}@{@var{pagenumber}@}@}}
-where @var{currentlabel} is the current value of the macro
-@code{\@@currentlabel} that is usually updated whenever you call
-@code{\refstepcounter@{@var{counter}@}}.)
+We often want something like @samp{See Theorem~31}. But by-hand typing
+the 31 is poor practice. Instead you should write a @dfn{label} such as
+@code{\label@{eq:GreensThm@}} and then @dfn{reference} it, as with
+@code{See equation~\ref@{eq:GreensThm@}}. @LaTeX{} will automatically
+work out the number, put it into the output, and will change that number
+later if needed.
+
+@example
+We will see this with Theorem~\ref@{th:GreensThm@}. % forward reference
+...
+\begin@{theorem@} \label@{th:GreensThm@}
+ ...
+\end@{theorem@}
+...
+See Theorem~\ref@{th:GreensThm@} on page~\pageref@{th:GreensThm@}.
+@end example
+
+@LaTeX{} tracks cross reference information in a file having the
+extension @file{.aux} and with the same base name as the file containing
+the @code{\label}. So if @code{\label} is in @file{calculus.tex} then
+the information is in @file{calculus.aux}. @LaTeX{} puts the
+information in that file every time it runs across a @code{\label}.
@cindex forward reference
@cindex reference, forward
-The most common side effect of the prior paragraph happens when your
-document has a @dfn{forward reference}, a @code{\ref@{@var{key}@}} that
-appears earlier than the associated @code{\label@{@var{key}@}}; see the
-example in the @code{\pageref@{...@}} description. @LaTeX{} gets the
-information for references from the @file{.aux} file. If this is the
-first time you are compiling the document then you will get a message
-@code{LaTeX Warning: Label(s) may have changed. Rerun to get
-cross references right.} and in the output the reference will appear as
-two question marks@tie{}@samp{??}, in boldface. Or, if you change some
-things so the references change then you get the same warning and the
-output contains the old reference information. The solution in either
-case is just to compile the document a second time.
+The behavior described in the prior paragraph results in a quirk that
+happens when your document has a @dfn{forward reference}, a @code{\ref}
+that appears before the associated @code{\label}. If this is the first
+time that you are compiling the document then you will get @samp{LaTeX
+Warning: Label(s) may have changed. Rerun to get cross references right}
+and in the output the forward reference will appear as two question
+marks@tie{}@samp{??}, in boldface. A similar thing happens if you
+change some things so the references changes; you get the same warning
+and the output contains the old reference information. In both cases,
+resolve this by compiling the document a second time.
+
+@PkgIndex{cleveref} The @code{cleveref} package enhances @LaTeX{}'s
+cross referencing features. You can arrange that if you enter
+@code{\begin@{thm@}\label@{th:Nerode@}...\end@{thm@}} then
+@code{\cref@{th:Nerode@}} will output @samp{Theorem 3.21}, without you
+having to enter the ``Theorem.''
@menu
* \label:: Assign a symbolic name to a piece of text.
@@ -2869,30 +3618,39 @@ punctuation characters. Upper and lowercase letters are
distinguished, as usual.
A common convention is to use labels consisting of a prefix and a suffix
-separated by a colon or period. This helps to avoid accidentally
-creating two labels with the same name, and makes your source more
-readable. Some commonly-used prefixes:
+separated by a colon or period. Thus, @code{\label@{fig:Post@}} is a
+label for a figure with a portrait of Emil Post. This helps to avoid
+accidentally creating two labels with the same name, and makes your
+source more readable. Some commonly-used prefixes:
@table @code
@item ch
for chapters
+
@item sec
+@itemx subsec
for lower-level sectioning commands
+
@item fig
for figures
+
@item tab
for tables
+
@item eq
for equations
@end table
-Thus, @code{\label@{fig:Euler@}} is a label for a figure with a portrait
-of the great man.
+In the auxiliary file the reference information is kept as the text of
+a command of the form
+@code{\newlabel@{@var{label}@}@{@{@var{currentlabel}@}@{@var{pagenumber}@}@}}.
+Here @var{currentlabel} is the current value of the macro
+@code{\@@currentlabel} that is usually updated whenever you call
+@code{\refstepcounter@{@var{counter}@}}.
-In this example below the key @code{sec:test} will get the number of the
-current section and the key @code{fig:test} will get the number of the
-figure. (Incidentally, put labels after captions in figures and
-tables.)
+Below, the key @code{sec:test} will get the number of the current
+section and the key @code{fig:test} will get the number of the figure.
+(Incidentally, put labels after captions in figures and tables.)
@example
\section@{section name@}
@@ -2908,7 +3666,7 @@ See Figure~\ref@{fig:test@}.
@node \pageref
-@section @code{\pageref@{@var{key}@}}
+@section @code{\pageref}
@findex \pageref
@cindex cross referencing with page number
@@ -2923,10 +3681,14 @@ Synopsis:
Produce the page number of the place in the text where the corresponding
@code{\label}@{@var{key}@} command appears.
-In this example the @code{\label@{eq:main@}} is used both for the
-formula number and for the page number. (Note that the two references
-are forward references, so this document would need to be compiled twice
-to resolve those.)
+If there is no @code{\label@{@var{key}@}} then you get something like
+@samp{LaTeX Warning: Reference `th:GrensThm' on page 1 undefined on
+input line 11.}
+
+Below, the @code{\label@{eq:main@}} is used both for the formula number
+and for the page number. (Note that the two references are forward
+references so this document would need to be compiled twice to resolve
+those.)
@example
The main result is formula~\ref@{eq:main@} on page~\pageref@{eq:main@}.
@@ -2938,7 +3700,7 @@ The main result is formula~\ref@{eq:main@} on page~\pageref@{eq:main@}.
@node \ref
-@section @code{\ref@{@var{key}@}}
+@section @code{\ref}
@findex \ref
@cindex cross referencing, symbolic
@@ -2958,9 +3720,13 @@ equation, footnote, figure, @dots{}, of the corresponding
@code{\label} command (@pxref{\label}). It does not produce any text,
such as the word `Section' or `Figure', just the bare number itself.
-In this example, the @code{\ref@{popular@}} produces @samp{2}. Note
-that it is a forward reference since it comes before
-@code{\label@{popular@}}.
+If there is no @code{\label@{@var{key}@}} then you get something like
+@samp{LaTeX Warning: Reference `th:GrensThm' on page 1 undefined on
+input line 11.}
+
+In this example the @code{\ref@{popular@}} produces @samp{2}. Note that
+it is a forward reference since it comes before @code{\label@{popular@}}
+so this document would have to be compiled twice.
@example
The most widely-used format is item number~\ref@{popular@}.
@@ -2971,6 +3737,10 @@ The most widely-used format is item number~\ref@{popular@}.
\end@{enumerate@}
@end example
+@PkgIndex{cleveref}
+The @file{cleveref} package includes text such as @samp{Theorem} in the
+reference. See the documentation on CTAN.
+
@node Environments
@chapter Environments
@@ -3018,11 +3788,11 @@ Environments are executed within a group.
* math:: In-line math.
* minipage:: Miniature page.
* picture:: Picture with text, arrows, lines and circles.
-* quotation and quote:: Include a quotation.
+* quotation & quote:: Include a quotation.
* tabbing:: Align text arbitrarily.
* table:: Floating tables.
* tabular:: Align text in columns.
-* thebibliography:: Bibliography or reference list.
+* thebibliography:: Bibliography or reference list.
* theorem:: Theorems, lemmas, etc.
* titlepage:: For hand crafted title pages.
* verbatim:: Simulating typed input.
@@ -3102,7 +3872,8 @@ Synopsis:
\end@{array@}
@end example
-or
+@noindent
+or:
@example
\begin@{array@}[@var{pos}]@{@var{cols}@}
@@ -3113,26 +3884,44 @@ or
Produce a mathematical array. This environment can only be used in math
mode, and normally appears within a displayed mathematics environment
-such as @code{equation} (@pxref{equation}). Column entries are
-separated by an ampersand@tie{}(@code{&}). Rows are terminated with
-double-backslashes (@pxref{\\}).
+such as @code{equation} (@pxref{equation}). Inside of each row the
+column entries are separated by an ampersand, (@code{&}). Rows are
+terminated with double-backslashes (@pxref{\\}).
+
+This example shows a three by three array.
+
+@example
+\begin@{equation*@}
+ \chi(x) =
+ \left| % vertical bar fence
+ \begin@{array@}@{ccc@}
+ x-a &-b &-c \\
+ -d &x-e &-f \\
+ -g &-h &x-i
+ \end@{array@}
+ \right|
+\end@{equation*@}
+@end example
The required argument @var{cols} describes the number of columns, their
-alignment, and the formatting of the intercolumn regions. See
-@ref{tabular} for the complete description of @var{cols}, and of the
+alignment, and the formatting of the intercolumn regions. For instance,
+@code{\begin@{array@}@{rcl@}...\end@{array@}} gives three columns: the
+first flush right, the second centered, and the third flush left. See
+@ref{tabular} for the complete description of @var{cols} and of the
other common features of the two environments, including the optional
@var{pos} argument.
There are two ways that @code{array} diverges from @code{tabular}. The
first is that @code{array} entries are typeset in math mode, in
-textstyle (except if the @var{cols} definition specifies the column with
-@code{p@{...@}}, which causes the entry to be typeset in text mode).
-The second is that, instead of @code{tabular}'s parameter
-@code{\tabcolsep}, @LaTeX{}'s intercolumn space in an @code{array} is governed
-by
+textstyle (@pxref{Modes}) except if the @var{cols} definition specifies
+the column with @code{p@{...@}}, which causes the entry to be typeset in
+text mode. The second is that, instead of @code{tabular}'s parameter
+@code{\tabcolsep}, @LaTeX{}'s intercolumn space in an @code{array} is
+governed by
@findex \arraycolsep
@code{\arraycolsep}, which gives half the width between columns. The
-default for this is @samp{5pt}.
+default for this is @samp{5pt} so that between two columns comes
+10@dmn{pt} of space.
@PkgIndex{amsmath}
To obtain arrays with braces the standard is to use the @file{amsmath}
@@ -3144,29 +3933,27 @@ an array surrounded by vertical bars@tie{}@code{|...|}, and
@code{Vmatrix} for an array surrounded by double vertical
bars@tie{}@code{||...||}, along with a number of other array constructs.
-Here is an example of an array:
+@PkgIndex{amsmath}
+The next example uses the @file{amsmath} package.
@example
-\begin@{equation@}
- \begin@{array@}@{cr@}
- \sqrt@{y@} &12.3 \\
- x^2 &3.4
- \end@{array@}
-\end@{equation@}
-@end example
+\usepackage@{amsmath@} % in preamble
-The next example works if @code{\usepackage@{amsmath@}} is in the
-preamble:
-
-@example
-\begin@{equation@}
- \begin@{vmatrix@}@{cc@}
+\begin@{equation@}
+ \begin@{vmatrix@}@{cc@} % array with vert lines
a &b \\
c &d
\end@{vmatrix@}=ad-bc
\end@{equation@}
@end example
+@PkgIndex{array (package)}
+@PkgIndex{dcolumn}
+There are many packages concerning arrays. The @file{array} package has
+many useful extensions, including more column types. The @file{dcolumn}
+package adds a column type to center on a decimal point. For both see
+the documentation on CTAN.
+
@node center
@section @code{center}
@@ -3178,17 +3965,19 @@ Synopsis:
@example
\begin@{center@}
- ... text ...
+ @var{line1} \\
+ @var{line2} \\
+ ...
\end@{center@}
@end example
Create a new paragraph consisting of a sequence of lines that are
-centered within the left and right margins on the current page. Use
-double-backslash to get a line break at a particular spot (@pxref{\\}).
+centered within the left and right margins. Use
+double-backslash, @code{\\}, to get a line break (@pxref{\\}).
@findex \\ @r{(for @code{center})}
-If some text environment body is too long to fit on a line, @LaTeX{}
-will insert line breaks that avoid hyphenation and avoid stretching or
-shrinking any interword space.
+If some text is too long to fit on a line then @LaTeX{} will insert line
+breaks that avoid hyphenation and avoid stretching or shrinking any
+interword space.
This environment inserts space above and below the text body. See
@ref{\centering} to avoid such space, for example inside a @code{figure}
@@ -3219,7 +4008,11 @@ ending.
\end@{center@}
@end example
-A double backslash after the final line is optional.
+A double backslash after the final line is optional. If present it
+doesn't add any vertical space.
+
+In a two-column document the text is centered in a column, not in the
+entire page.
@menu
* \centering:: Declaration form of the @code{center} environment.
@@ -3232,12 +4025,42 @@ A double backslash after the final line is optional.
@findex \centering
@cindex centering text, declaration for
-A declaration that causes material in its scope to be centered. It is
-most often used inside an environment such as @code{figure}, or in a
-@code{parbox}.
+
+Synopsis:
+
+@example
+@{\centering ... @}
+@end example
+
+@noindent
+or
+
+@example
+\begin@{group@}
+ \centering ...
+\end@{group@}
+@end example
+
+Center the material in its scope. It is most often used inside an
+environment such as @code{figure}, or in a @code{parbox}.
+
+This example's @code{\centering} declaration causes the graphic to be
+horizontally centered.
+
+@example
+\begin@{figure@}
+ \centering
+ \includegraphics[width=0.6\textwidth]@{ctan_lion.png@}
+ \caption@{CTAN Lion@} \label@{fig:CTANLion@}
+\end@{figure@}
+@end example
+
+@noindent
+The scope of this @code{\centering} ends with the @code{\end@{figure@}}.
Unlike the @code{center} environment, the @code{\centering} command does
-not add vertical space above and below the text.
+not add vertical space above and below the text. That's its advantage
+in the above example; there is not an excess of space.
It also does not start a new paragraph; it simply changes how @LaTeX{}
formats paragraph units. If @code{ww @{\centering xx \\ yy@} zz} is
@@ -3249,20 +4072,7 @@ environment such as @code{figure} or @code{table} that ends the
paragraph unit. Thus, if @code{@{\centering xx \\ yy\par@} zz} is
surrounded by blank lines then it makes a new paragraph with two
centered lines @samp{xx} and @samp{yy}, followed by a new paragraph with
-@samp{zz} that is formatted as usual. See also the following example.
-
-This example's @code{\centering} causes the graphic to be horizontally
-centered.
-
-@example
-\begin@{figure@}
- \centering
- \includegraphics[width=0.6\textwidth]@{ctan_lion.png@}
- \caption@{CTAN Lion@} \label@{fig:CTANLion@}
-\end@{figure@}
-@end example
-
-The scope of the @code{\centering} ends with the @code{\end@{figure@}}.
+@samp{zz} that is formatted as usual.
@node description
@@ -3276,21 +4086,19 @@ Synopsis:
@example
\begin@{description@}
-\item[@var{label of first item}] text of first item
-\item[@var{label of second item}] text of second item
- ...
+ \item[@var{label of first item}] @var{text of first item}
+ \item[@var{label of second item}] @var{text of second item}
+ ...
\end@{description@}
@end example
-Environment to make a labeled list of items. Each item's @var{label} is
-typeset in bold, and is flush left so that long labels continue into the
+Environment to make a list of labeled items. Each item's @var{label} is
+typeset in bold and is flush left, so that long labels continue into the
first line of the item text. There must be at least one item; having
none causes the @LaTeX{} error @samp{Something's wrong--perhaps a
missing \item}.
This example shows the environment used for a sequence of definitions.
-The labels @samp{lama} and @samp{llama} come out in boldface with their
-left edges aligned on the left margin.
@example
\begin@{definition@}
@@ -3299,6 +4107,10 @@ left edges aligned on the left margin.
\end@{definition@}
@end example
+@noindent
+The labels @samp{lama} and @samp{llama} are output in boldface, with the
+left edge on the left margin.
+
@findex \item
Start list items with the @code{\item} command (@pxref{\item}). Use the
optional labels, as in @code{\item[Main point]}, because there is
@@ -3311,10 +4123,10 @@ Since the labels are in bold style, if the label text calls for a font
change given in argument style (see @ref{Font styles}) then it will come
out bold. For instance, if the label text calls for typewriter with
@code{\item[\texttt@{label text@}]} then it will appear in bold
-typewriter, if that is available. The simplest way to get non-bold
-typewriter is to use declarative style: @code{\item[@{\tt label
-text@}]}. Similarly, get the standard roman font with @code{\item[@{\rm
-label text@}]}.
+typewriter, if that is available. The simplest way around this, in this
+example to get non-bold typewriter, is to use declarative style:
+@code{\item[@{\tt label text@}]}. Similarly, get the standard roman
+font with @code{\item[@{\rm label text@}]}.
For other major @LaTeX{} labelled list environments, see @ref{itemize}
and @ref{enumerate}. Unlike those environments, nesting
@@ -3344,7 +4156,7 @@ Synopsis:
@example
\begin@{displaymath@}
-@var{math text}
+ @var{mathematical text}
\end@{displaymath@}
@end example
@@ -3377,11 +4189,14 @@ different vertical spacing, and because the @code{displaymath}
environment honors the @code{fleqn} option.)
The output from this example is centered and alone on its line.
+
@example
\begin@{displaymath@}
\int_1^2 x^2\,dx=7/3
\end@{displaymath@}
@end example
+
+@noindent
Also, the integral sign is larger than the inline version
@code{\( \int_1^2 x^2\,dx=7/3 \)} produces.
@@ -3455,9 +4270,9 @@ Synopsis:
@example
\begin@{enumerate@}
-\item[@var{optional label of first item}] text of first item
-\item[@var{optional label of second item}] text of second item
-...
+ \item[@var{optional label of first item}] @var{text of first item}
+ \item[@var{optional label of second item}] @var{text of second item}
+ ...
\end@{enumerate@}
@end example
@@ -3496,15 +4311,19 @@ the outermost level.
@enumerate
@item arabic number followed by a period: @samp{1.}, @samp{2.},@tie{}@dots{}
-@item lower case letter inside parentheses: @samp{(a)}, @samp{(b)}@tie{}@dots{}
-@item lower case roman numeral followed by a period: @samp{i.}, @samp{ii.},@tie{}@dots{}
-@item upper case letter followed by a period: @samp{A.}, @samp{B.},@tie{}@dots{}
+@item lowercase letter inside parentheses: @samp{(a)}, @samp{(b)}@tie{}@dots{}
+@item lowercase roman numeral followed by a period: @samp{i.}, @samp{ii.},@tie{}@dots{}
+@item uppercase letter followed by a period: @samp{A.}, @samp{B.},@tie{}@dots{}
@end enumerate
@findex \enumi
@findex \enumii
@findex \enumiii
@findex \enumiv
+@anchor{enumerate enumi}
+@anchor{enumerate enumii}
+@anchor{enumerate enumiii}
+@anchor{enumerate enumiv}
The @code{enumerate} environment uses the counters @code{\enumi} through
@code{\enumiv} (@pxref{Counters}).
@@ -3518,6 +4337,10 @@ useful for customizing lists.
@findex \labelenumii
@findex \labelenumiii
@findex \labelenumiv
+@anchor{enumerate labelenumi}
+@anchor{enumerate labelenumii}
+@anchor{enumerate labelenumiii}
+@anchor{enumerate labelenumiv}
To change the format of the label use @code{\renewcommand}
(@pxref{\newcommand & \renewcommand}) on the commands @code{\labelenumi}
through @code{\labelenumiv}. For instance, this first level list will be
@@ -3547,17 +4370,16 @@ For a list of counter-labeling commands see @ref{\alph \Alph \arabic
@cindex align @r{environment, from @code{amsmath}}
@cindex amsmath @r{package, replacing @code{eqnarray}}
@cindex Madsen, Lars
-First, a caveat: the @code{eqnarray} environment is depreciated. It has
-infelicities that cannot be overcome, including spacing that is
-inconsistent with other mathematics elements (see the article ``Avoid
-eqnarray!''@: by Lars Madsen
+The @code{eqnarray} environment is obsolete. It has infelicities,
+including spacing that is inconsistent with other mathematics elements.
+(See ``Avoid eqnarray!''@: by Lars Madsen
@url{http://tug.org/TUGboat/tb33-1/tb103madsen.pdf}). New documents
should include the @file{amsmath} package and use the displayed
mathematics environments provided there, such as the @code{align}
-environment.
+environment. We include a description only for completeness and for
+working with old documents.
-Nevertheless, for completeness and for a reference when working with old
-documents, a synopsis:
+Synopsis:
@example
\begin@{eqnarray@}
@@ -3566,6 +4388,7 @@ documents, a synopsis:
\end@{eqnarray@}
@end example
+@noindent
or
@example
@@ -3622,22 +4445,21 @@ Synopsis:
@example
\begin@{equation@}
- math text
+ @var{mathematical text}
\end@{equation@}
@end example
-Make a @code{displaymath} environment (@pxref{displaymath}) with an
-equation number in the right margin.
-
+The same as a @code{displaymath} environment (@pxref{displaymath})
+except that @LaTeX{} puts an equation number flush to the right margin.
The equation number is generated using the @code{equation} counter.
You should have no blank lines between @code{\begin@{equation@}} and
@code{\begin@{equation@}}, or @LaTeX{} will tell you that there is a
-missing dollar sign,@tie{}$@code{$}.
+missing dollar sign.
-Note that the @file{amsmath} package has extensive displayed equation
-facilities. Those facilities are the best approach for such output in
-new documents.
+@PkgIndex{amsmath}
+The package @file{amsmath} package has extensive displayed equation
+facilities. New documents should include this package.
@node figure
@@ -3651,29 +4473,37 @@ Synopsis:
@example
\begin@{figure@}[@var{placement}]
- figure body
-\caption[@var{loftitle}]@{@var{title}@}
-\label@{@var{label@}}
+ @var{figure body}
+ \caption[@var{loftitle}]@{@var{title}@} % optional
+ \label@{@var{label@}} % optional
\end@{figure@}
@end example
-or
+@noindent
+or:
@example
\begin@{figure*@}[@var{placement}]
- figure body
-\caption[@var{loftitle}]@{@var{title}@}
-\label@{@var{label@}}
+ @var{figure body}
+ \caption[@var{loftitle}]@{@var{title}@} % optional
+ \label@{@var{label@}} % optional
\end@{figure*@}
@end example
-A class of floats (@pxref{Floats}). Because they cannot be split across
-pages, they are not typeset in sequence with the normal text but instead
-are ``floated'' to a convenient place, such as the top of a following
-page.
+Figures are for material that is not part of the normal text. An
+example is material that you cannot have split between two pages, such
+as a graphic. Because of this, @LaTeX{} does not typeset figures in
+sequence with normal text but instead ``floats'' them to a convenient
+place, such as the top of a following page (@pxref{Floats}).
-For the possible values of @var{placement} and their effect on the
-float placement algorithm, see @ref{Floats}.
+The @var{figure body} can consist of imported graphics
+(@pxref{Graphics}), or text, @LaTeX{} commands, etc. It is typeset in a
+@code{parbox} of width @code{\textwidth}.
+
+The possible values of @var{placement} are @code{h} for @samp{here},
+@code{t} for @samp{top}, @code{b} for @samp{bottom}, and @code{p} for
+@samp{on a separate page of floats}. For the effect of these options on
+the float placement algorithm, see @ref{Floats}.
The starred form @code{figure*} is used when a document is in
double-column mode (@pxref{\twocolumn}). It produces a figure that
@@ -3681,23 +4511,21 @@ spans both columns, at the top of the page. To add the possibility of
placing at a page bottom see the discussion of @var{placement} @code{b}
in @ref{Floats}.
-The figure body is typeset in a @code{parbox} of width @code{\textwidth}
-and so it can contain text, commands, etc.
-
The label is optional; it is used for cross references (@pxref{Cross
references}).
@findex \caption
The optional @code{\caption} command specifies caption text for the
figure. By default it is numbered. If @var{loftitle} is present, it is
-used in the list of figures instead of @var{title} (@pxref{Tables of
-contents}).
+used in the list of figures instead of @var{title} (@pxref{Table of
+contents etc.}).
-This example makes a figure out of a graphic. It requires one of the
-packages @file{graphics} or @file{graphicx}. The graphic, with its
-caption, will be placed at the top of a page or, if it is pushed to the
+This example makes a figure out of a graphic. @LaTeX{} will place that
+graphic and its caption at the top of a page or, if it is pushed to the
end of the document, on a page of floats.
@example
+\usepackage@{graphicx@} % in preamble
+ ...
\begin@{figure@}[t]
\centering
\includegraphics[width=0.5\textwidth]@{CTANlion.png@}
@@ -3722,6 +4550,7 @@ Synopsis:
\end@{filecontents@}
@end example
+@noindent
or
@example
@@ -3760,6 +4589,7 @@ Article by \myname.
\end@{document@}
@end example
+@noindent
produces this file @file{JH.sty}.
@example
@@ -3778,18 +4608,37 @@ produces this file @file{JH.sty}.
@cindex left-justifying text, environment for
@cindex ragged right text, environment for
+Synopsis:
+
@example
\begin@{flushleft@}
-@var{line1} \\
-@var{line2} \\
-...
+ @var{line1} \\
+ @var{line2} \\
+ ...
\end@{flushleft@}
@end example
@findex \\ @r{for @code{flushleft}}
-The @code{flushleft} environment allows you to create a paragraph
-consisting of lines that are flush to the left-hand margin and ragged
-right. Each line must be terminated with the string @code{\\}.
+An environment that creates a paragraph whose lines are flush to the
+left-hand margin, and ragged right. If you have lines that are too long
+then @LaTeX{} will linebreak them in a way that avoids hyphenation and
+stretching or shrinking spaces. To force a new line use a double
+backslash, @code{\\}. For the declaration form
+see@tie{}@ref{\raggedright}.
+
+This creates a box of text that is at most 3 inches wide, with the text
+flush left and ragged right.
+
+@example
+\noindent\begin@{minipage@}@{3in@}
+\begin@{flushleft@}
+ A long sentence that will be broken by \LaTeX@{@}
+ at a convenient spot. \\
+ And, a fresh line forced by the double backslash.
+\end@{flushleft@}
+\end@{minipage@}
+@end example
+
@menu
* \raggedright:: Declaration form of the @code{flushleft} environment.
@@ -3804,9 +4653,25 @@ right. Each line must be terminated with the string @code{\\}.
@cindex left-justifying text
@cindex justification, ragged right
-The @code{\raggedright} declaration corresponds to the
-@code{flushleft} environment. This declaration can be used inside an
-environment such as @code{quote} or in a @code{parbox}.
+Synopses:
+
+@example
+@{\raggedright ... @}
+@end example
+
+@noindent
+or
+
+@example
+\begin@{@var{environment}@} \raggedright
+ ...
+\end@{@var{environment}@}
+@end example
+
+A declaration which causes lines to be flush to the left margin and
+ragged right. It can be used inside an environment such as @code{quote}
+or in a @code{parbox}. For the environment form
+see@tie{}@ref{flushleft}.
Unlike the @code{flushleft} environment, the @code{\raggedright}
command does not start a new paragraph; it only changes how @LaTeX{}
@@ -3814,6 +4679,19 @@ formats paragraph units. To affect a paragraph unit's format, the
scope of the declaration must contain the blank line or @code{\end}
command that ends the paragraph unit.
+Here @code{\raggedright} in each second column keeps @LaTeX{} from doing
+very awkward typesetting to fit the text into the narrow column. Note
+that @code{\raggedright} is inside the curly braces @code{@{...@}} to
+delimit its effect.
+
+@example
+\begin@{tabular@}@{rp@{2in@}@}
+ Team alpha &@{\raggedright This team does all the real work.@} \\
+ Team beta &@{\raggedright This team ensures that the water
+ cooler is never empty.@} \\
+\end@{tabular@}
+@end example
+
@node flushright
@section @code{flushright}
@@ -3824,16 +4702,21 @@ command that ends the paragraph unit.
@example
\begin@{flushright@}
-@var{line1} \\
-@var{line2} \\
-...
+ @var{line1} \\
+ @var{line2} \\
+ ...
\end@{flushright@}
@end example
@findex \\ (for @code{flushright})
-The @code{flushright} environment allows you to create a paragraph
-consisting of lines that are flush to the right-hand margin and ragged
-left. Each line must be terminated with the control sequence @code{\\}.
+An environment that creates a paragraph whose lines are flush to the
+right-hand margin and ragged left. If you have lines that are too long
+to fit the margins then @LaTeX{} will linebreak them in a way that
+avoids hyphenation and stretching or shrinking spaces. To force a new
+line use a double backslash, @code{\\}. For the declaration form
+see@tie{}@ref{\raggedleft}.
+
+For an example related to this environment, see@tie{}@ref{flushleft}.
@menu
* \raggedleft:: Declaration form of the @code{flushright} environment.
@@ -3848,9 +4731,25 @@ left. Each line must be terminated with the control sequence @code{\\}.
@cindex justification, ragged left
@cindex right-justifying text
-The @code{\raggedleft} declaration corresponds to the
-@code{flushright} environment. This declaration can be used inside an
-environment such as @code{quote} or in a @code{parbox}.
+Synopses:
+
+@example
+@{\raggedleft ... @}
+@end example
+
+@noindent
+or
+
+@example
+\begin@{@var{environment}@} \raggedleft
+ ...
+\end@{@var{environment}@}
+@end example
+
+A declaration which causes lines to be flush to the right margin and
+ragged left. It can be used inside an environment such as @code{quote}
+or in a @code{parbox}. For the environment form
+see@tie{}@ref{flushright}.
Unlike the @code{flushright} environment, the @code{\raggedleft}
command does not start a new paragraph; it only changes how @LaTeX{}
@@ -3858,6 +4757,8 @@ formats paragraph units. To affect a paragraph unit's format, the
scope of the declaration must contain the blank line or @code{\end}
command that ends the paragraph unit.
+For an example related to this environment, see@tie{}@ref{\raggedright}.
+
@node itemize
@section @code{itemize}
@@ -3867,25 +4768,23 @@ command that ends the paragraph unit.
@cindex lists of items
@cindex unordered lists
@cindex bulleted lists
+@cindex bullet lists
Synopsis:
@example
\begin@{itemize@}
-\item[@var{optional label of first item}] text of first item
-\item[@var{optional label of second item}] text of second item
-...
+ \item[@var{optional label of first item}] @var{text of first item}
+ \item[@var{optional label of second item}] @var{text of second item}
+ ...
\end@{itemize@}
@end example
-The @code{itemize} environment produces an ``unordered'', ``bulleted''
-list. The format of the label numbering depends on the nesting level of
-this environment; see below. Each @code{itemize} list environment must
-have at least one item; having none causes the @LaTeX{} error
-@samp{Something's wrong--perhaps a missing \item}.
+Produce a list that is unordered, sometimes called a bullet list. The
+environment must have at least one @code{\item}; having none causes the
+@LaTeX{} error @samp{Something's wrong--perhaps a missing \item}.
-This example gives a two-item list. As a top-level list each label
-would come out as a bullet, @bullet{}.
+This gives a two-item list.
@example
\begin@{itemize@}
@@ -3894,6 +4793,10 @@ would come out as a bullet, @bullet{}.
\end@{itemize@}
@end example
+@noindent
+As a top-level list each label would come out as a bullet, @bullet{}.
+The format of the labeling depends on the nesting level; see below.
+
@findex \item
Start list items with the @code{\item} command (@pxref{\item}). If you
give @code{\item} an optional argument by following it with square
@@ -3907,11 +4810,15 @@ contain multiple paragraphs.
@findex \labelitemii
@findex \labelitemiii
@findex \labelitemiv
+@anchor{itemize labelitemi}
+@anchor{itemize labelitemii}
+@anchor{itemize labelitemiii}
+@anchor{itemize labelitemiv}
Itemized lists can be nested within one another, up to four levels deep.
They can also be nested within other paragraph-making environments, such
as @code{enumerate} (@pxref{enumerate}). The @code{itemize} environment
uses the commands @code{\labelitemi} through @code{\labelitemiv} to
-produce the default label (this also uses the convention of lower case
+produce the default label (this also uses the convention of lowercase
roman numerals at the end of the command names that signify the nesting
level). These are the default marks at each level.
@@ -3941,10 +4848,17 @@ the first level use diamonds.
@findex \leftmarginiv
@findex \leftmarginv
@findex \leftmarginvi
+@anchor{itemize leftmargin}
+@anchor{itemize leftmargini}
+@anchor{itemize leftmarginii}
+@anchor{itemize leftmarginiii}
+@anchor{itemize leftmarginiv}
+@anchor{itemize leftmarginv}
+@anchor{itemize leftmarginvi}
The distance between the left margin of the enclosing environment and
the left margin of the @code{itemize} list is determined by the
parameters @code{\leftmargini} through @code{\leftmarginvi}. (Note the
-convention of using lower case roman numerals a the end of the command
+convention of using lowercase roman numerals a the end of the command
name to denote the nesting level.) The defaults are: @code{2.5em} in
level 1 (@code{2em} in two-column mode), @code{2.2em} in level 2,
@code{1.87em} in level 3, and @code{1.7em} in level 4, with smaller
@@ -3968,7 +4882,7 @@ Especially for lists with short items, it may be desirable to elide
space between items. Here is an example defining an @code{itemize*}
environment with no extra spacing between items, or between paragraphs
within a single item (@code{\parskip} is not list-specific,
-@pxref{\parskip}):
+@pxref{\parindent & \parskip}):
@example
\newenvironment@{itemize*@}%
@@ -3998,34 +4912,35 @@ Synopsis:
@example
\begin@{list@}@{@var{labeling}@}@{@var{spacing}@}
-\item[@var{optional label of first item}] text of first item
-\item[@var{optional label of second item}] text of second item
-...
+ \item[@var{optional label of first item}] @var{text of first item}
+ \item[@var{optional label of second item}] @var{text of second item}
+ ...
\end@{list@}
@end example
-The @code{list} environment is a generic environment for constructing
-more specialized lists. It is most often used to create lists via the
-@code{description}, @code{enumerate}, and @code{itemize} environments
-(@pxref{description}, @ref{enumerate}, and @ref{itemize}).
+An environment for constructing lists.
-Also, many standard @LaTeX{} environments that are not visually lists
-are constructed using @code{list}, including @code{quotation},
-@code{quote}, @code{center}, @code{verbatim}, and plenty more
-(@pxref{quotation and quote}, @pxref{center}, @pxref{flushright}).
+Note that this environment does not typically appear in the document
+body. Most lists created by @LaTeX{} authors are the ones that come
+standard: the @code{description}, @code{enumerate}, and @code{itemize}
+environments (@pxref{description}, @ref{enumerate}, and @ref{itemize}).
-@PkgIndex{enumitem}
-The third-party package @code{enumitem} is useful for customizing lists.
-Here, we describe the @code{list} environment by defining a new custom
+Instead, the @code{list} environment is most often used in macros. For
+example, many standard @LaTeX{} environments that do not immediately
+appear to be lists are in fact constructed using @code{list}, including
+@code{quotation}, @code{quote}, and @code{center} (@pxref{quotation &
+quote}, @pxref{center}).
+
+This uses the @code{list} environment to define a new custom
environment.
@example
\newcounter@{namedlistcounter@} % number the items
\newenvironment@{named@}
@{\begin@{list@}
- @{Item~\Roman@{namedlistcounter@}.@} % labeling argument
- @{\usecounter@{namedlistcounter@} % spacing argument
- \setlength@{\leftmargin@}@{3.5em@}@} % still spacing arg
+ @{Item~\Roman@{namedlistcounter@}.@} % labeling
+ @{\usecounter@{namedlistcounter@} % set counter
+ \setlength@{\leftmargin@}@{3.5em@}@} % set spacing
@}
@{\end@{list@}@}
@@ -4036,54 +4951,57 @@ environment.
\end@{named@}
@end example
-The @code{list} environment's mandatory first argument,
-@var{labeling}, specifies the default labeling of list items. It can
-contain text and @LaTeX{} commands, as above where it contains both
-@samp{Item} and @samp{\Roman@{...@}}. @LaTeX{} forms the label by
-putting the @var{labeling} argument in a box of width
-@code{\labelwidth}. If the label is wider than that, the additional
-material extends to the right. When making an instance of a list you
-can override the default labeling by giving @code{\item} an optional
-argument by including square braces and the text, as in the above
-@code{\item[Special label.]}; @pxref{\item}.
+The mandatory first argument @var{labeling} specifies the default
+labeling of list items. It can contain text and @LaTeX{} commands, as
+above where it contains both @samp{Item} and @samp{\Roman@{...@}}.
+@LaTeX{} forms the label by putting the @var{labeling} argument in a box
+of width @code{\labelwidth}. If the label is wider than that, the
+additional material extends to the right. When making an instance of a
+list you can override the default labeling by giving @code{\item} an
+optional argument by including square braces and the text, as in the
+above @code{\item[Special label.]}; @pxref{\item}.
+
+The mandatory second argument @var{spacing} has a list of commands.
+This list can be empty. A command that can go in here is
+@code{\usecounter@{@var{countername}@}} (@pxref{\usecounter}). Use this
+to tell @LaTeX{} to number the items using the given counter. The
+counter will be reset to zero each time @LaTeX{} enters the environment,
+and the counter is incremented by one each time @LaTeX{} encounters an
+@code{\item} that does not have an optional argument.
@findex \makelabel
-The label box is constructed by the command @code{\makelabel}. By
-default it positions the contents flush right. It takes one argument,
-the label. It typesets the contents in LR mode. An example of changing
-its definition is that to the above example before the definition of the
-@code{named} environment add
+@anchor{list makelabel} Another command that can go in @var{spacing} is
+@code{\makelabel}, which constructs the label box. By default it puts
+the contents flush right. Its only argument is the label, which it
+typesets in LR mode (@pxref{Modes}). One example of changing its
+definition is that to the above @code{named} example, before the
+definition of the environment add
@code{\newcommand@{\namedmakelabel@}[1]@{\textsc@{#1@}@}}, and between
the @code{\setlength} command and the parenthesis that closes the
@var{spacing} argument also add @code{\let\makelabel\namedmakelabel}.
Then the items will be typeset in small caps. Similarly, changing the
second code line to @code{\let\makelabel\fbox} puts the labels inside a
-framed box. Another example is at the bottom of this entry.
-
-The mandatory second argument @var{spacing} can have a list of
-commands to redefine the spacing parameters for the list, such as
-@code{\setlength@{\labelwidth@}@{2em@}}. If this argument is empty,
-i.e., @code{@{@}}, then the list will have the default spacing given
-below. To number the items using a counter, put
-@code{\usecounter@{@var{countername}@}} in this argument
-(@pxref{\usecounter}).
-
-Below are the spacing parameters for list formatting. See also the
-figure below. Each is a length (@pxref{Lengths}). The vertical
-spaces are normally rubber lengths, with @code{plus} and @code{minus}
-components, to give @TeX{} flexibility in setting the page. Change
-each with a command such as @code{\setlength@{itemsep@}@{2pt plus1pt
-minus1pt@}}. For some effects these lengths should be zero or
-negative. Default values for derived environments such as
-@code{itemize} can be changed from the values shown here for the basic
-@code{list}.
+framed box. Another example of the @code{\makelabel} command is below,
+in the definition of the @code{redlabel} environment.
+
+Also often in @var{spacing} are commands to redefine the spacing for the
+list. Below are the spacing parameters with their default values.
+(Default values for derived environments such as @code{itemize} can be
+different than the values shown here.) See also the figure that follows
+the list. Each is a length (@pxref{Lengths}). The vertical spaces are
+normally rubber lengths, with @code{plus} and @code{minus} components,
+to give @TeX{} flexibility in setting the page. Change each with a
+command such as @code{\setlength@{itemsep@}@{2pt plus1pt minus1pt@}}.
+For some effects these lengths should be zero or negative.
@ftable @code
@item \itemindent
+@anchor{list itemindent}
Extra horizontal space indentation, beyond @code{leftmargin}, of the
first line each item. Its default value is @code{0pt}.
@item \itemsep
+@anchor{list itemsep}
Vertical space between items, beyond the @code{\parsep}. The defaults
for the first three levels in @LaTeX{}'s @samp{article}, @samp{book},
and @samp{report} classes at 10 point size are: @code{4pt plus2pt
@@ -4096,11 +5014,13 @@ minus1pt}, @code{\parsep} (that is, @code{2.5pt plus1pt minus1pt}), and
@code{\topsep} (that is, @code{2.5pt plus1pt minus1pt}).
@item \labelsep
+@anchor{list labelsep}
Horizontal space between the label and text of an item.
The default for @LaTeX{}'s @samp{article}, @samp{book},
and @samp{report} classes is @code{0.5em}.
@item \labelwidth
+@anchor{list labelwidth}
Horizontal width. The box containing the label is nominally this wide.
If @code{\makelabel} returns text that is wider than this then the first
line of the item will be indented to make room for this extra material.
@@ -4122,6 +5042,7 @@ label's left edge coincide with the left margin of the enclosing
environment.
@item \leftmargin
+@anchor{list leftmargin}
Horizontal space between the left margin of the enclosing environment
(or the left margin of the page if this is a top-level list), and the
left margin of this list. It must be non-negative.
@@ -4139,12 +5060,14 @@ The defaults for the first three levels in @LaTeX{}'s @samp{article},
@code{2.2em}, and @code{\leftmarginiii} is @code{1.87em}.
@item \listparindent
+@anchor{list listparindent}
Horizontal space of additional line indentation, beyond
@code{\leftmargin}, for second and subsequent paragraphs within a list
item. A negative value makes this an ``outdent''. Its default value
is @code{0pt}.
@item \parsep
+@anchor{list parsep}
Vertical space between paragraphs within an item. In the @samp{book}
and @samp{article} classes The defaults for the first three levels in
@LaTeX{}'s @samp{article}, @samp{book}, and @samp{report} classes at 10
@@ -4155,6 +5078,7 @@ minus1pt}, and @code{0pt}. The defaults at 11 point size are:
minus1pt}, @code{2.5pt plus1pt minus1pt}, and @code{0pt}.
@item \partopsep
+@anchor{list partopsep}
Vertical space added, beyond @code{\topsep}+@code{\parskip}, to the top
and bottom of the entire environment if the list instance is preceded by
a blank line. (A blank line in the @LaTeX{} source before the list
@@ -4170,20 +5094,22 @@ defaults at 12 point are: @code{3pt plus2pt minus3pt}, @code{3pt plus2pt
minus2pt}, and @code{1pt plus0pt minus1pt}.
@item \rightmargin
+@anchor{list rightmargin}
Horizontal space between the right margin of the list and the right
margin of the enclosing environment. Its default value is @code{0pt}.
It must be non-negative.
@item \topsep
+@anchor{list topsep}
Vertical space added to both the top and bottom of the list, in addition
-to @code{\parskip} (@pxref{\parskip}). The defaults for the first three
-levels in @LaTeX{}'s @samp{article}, @samp{book}, and @samp{report}
-classes at 10 point size are: @code{8pt plus2pt minus4pt}, @code{4pt
-plus2pt minus1pt}, and @code{2pt plus1pt minus1pt}. The defaults at 11
-point are: @code{9pt plus3pt minus5pt}, @code{4.5pt plus2pt minus1pt},
-and @code{2pt plus1pt minus1pt}. The defaults at 12 point are:
-@code{10pt plus4pt minus6pt}, @code{5pt plus2.5pt minus1pt}, and
-@code{2.5pt plus1pt minus1pt}.
+to @code{\parskip} (@pxref{\parindent & \parskip}). The defaults for
+the first three levels in @LaTeX{}'s @samp{article}, @samp{book}, and
+@samp{report} classes at 10 point size are: @code{8pt plus2pt minus4pt},
+@code{4pt plus2pt minus1pt}, and @code{2pt plus1pt minus1pt}. The
+defaults at 11 point are: @code{9pt plus3pt minus5pt}, @code{4.5pt
+plus2pt minus1pt}, and @code{2pt plus1pt minus1pt}. The defaults at 12
+point are: @code{10pt plus4pt minus6pt}, @code{5pt plus2.5pt minus1pt},
+and @code{2.5pt plus1pt minus1pt}.
@end ftable
@@ -4215,6 +5141,9 @@ Same as @var{v0}. (This space is affected by whether a blank line
appears in the source above the environment; whether a blank line
appears in the source below the environment does not matter.)
+@item h0
+@code{\labelwidth}
+
@item h1
@code{\labelsep}
@@ -4250,18 +5179,25 @@ page break.
@ftable @code
@item \@@beginparpenalty
+@anchor{list beginparpenalty}
The page breaking penalty for breaking before the list (default @code{-51}).
@item \@@itempenalty
+@anchor{list itempenalty}
The page breaking penalty for breaking before a list item (default @code{-51}).
@item \@@endparpenalty
+@anchor{list endparpenalty}
The page breaking penalty for breaking after a list (default @code{-51}).
@end ftable
+@PkgIndex{enumitem}
+The package @code{enumitem} is useful for customizing lists.
+
This example has the labels in red. They are numbered, and the left
edge of the label lines up with the left edge of the item text.
+@xref{\usecounter}.
@example
\usepackage@{color@}
@@ -4296,7 +5232,9 @@ Synopsis:
\item text of item
@end example
+@noindent
or
+
@example
\item[@var{optional-label}] text of item
@end example
@@ -4404,26 +5342,131 @@ the running text. @code{\(...\)} and @code{$...$} are synonyms.
@EnvIndex{minipage}
@cindex minipage, creating a
+Synopses:
+
+@example
+\begin@{minipage@}@{@var{width}@}
+ @var{contents}
+\end@{minipage@}
+@end example
+
+@noindent
+or
+
@example
\begin@{minipage@}[@var{position}][@var{height}][@var{inner-pos}]@{@var{width}@}
-@var{text}
+ @var{contents}
+\end@{minipage@}
+@end example
+
+Put @var{contents} into a box that is @var{width} wide. This is like a
+small version of a page; it can contain its own footnotes, itemized
+lists, etc. (There are some restrictions, including that it cannot have
+floats.) This box will not be broken across pages. So @code{minipage}
+is similar to @code{\parbox} (@pxref{\parbox}) but here you can have
+paragraphs.
+
+This example will be 3@tie{}inches wide, and has two paragraphs.
+
+@example
+\begin@{minipage@}@{3in@}
+ Stephen Kleene was a founder of the Theory of Computation.
+
+ He was a student of Church, wrote three influential texts,
+ was President of the Association for Symbolic Logic,
+ and won the National Medal of Science.
+\end@{minipage@}
+@end example
+
+@noindent
+See below for a discussion of the paragraph indent inside a
+@code{minipage}.
+
+The required argument @var{width} is a rigid length (@pxref{Lengths}).
+It gives the width of the box into which @var{contents} are typeset.
+
+There are three optional arguments, @var{position}, @var{height}, and
+@var{inner-pos}. You need not include all three. For example, get the
+default @var{position} and set the @var{height} with
+@code{\begin@{minipage@}[c][2.54cm] @var{contents} \end@{minipage@}}.
+(Get the natural height with an empty argument, @code{[]}.)
+
+The optional argument @var{position} governs how the @code{minipage}
+vertically aligns with the surrounding material.
+
+@table @code
+@item c
+(synonym @code{m}) Default. Positions the @code{minipage} so its
+vertical center lines up with the center of the adjacent text line (what
+Plain @TeX{} calls @code{\vcenter}).
+
+@item t
+Match the top line in the @code{minipage} with the baseline of the
+surrounding text (Plain @TeX{}'s @code{\vtop}.
+
+@item b
+Match the bottom line in the @code{minipage} with the baseline of the
+surrounding text (Plain @TeX{}'s @code{\vbox}.
+@end table
+
+To see the effects of these, contrast running this
+
+@example
+---\begin@{minipage@}[c]@{0.25in@}
+ first\\ second\\ third
\end@{minipage@}
@end example
-The @code{minipage} environment typesets its body @var{text} in a
-block that will not be broken across pages. This is similar to the
-@code{\parbox} command (@pxref{\parbox}), but unlike @code{\parbox},
-other paragraph-making environments can be used inside a minipage.
+@noindent
+with the results of changing @code{c} to @code{b} or@tie{}@code{t}.
+
+The optional argument @var{height} is a rigid length (@pxref{Lengths}).
+It sets the height of the @code{minipage}. You can enter any value
+larger than, or equal to, or smaller than the @code{minipage}'s natural
+height and @LaTeX{} will not give an error or warning. You can also set
+it to a height of zero or a negative value.
+
+The final optional argument @var{inner-pos} controls the placement of
+@var{content} inside the box. These are the possible values are (the
+default is the value of @var{position}).
-@c (xxref positions)
-The arguments are the same as for @code{\parbox} (@pxref{\parbox}).
+@table @code
+@item t
+Place @var{content} at the top of the box.
+
+@item c
+Place it in the vertical center.
+
+@item b
+Place it at the box bottom.
+
+@item s
+Stretch @var{contents} out vertically; it must contain vertically
+stretchable space.
+
+@end table
+
+The @var{inner-pos} argument makes sense when the @var{height} options
+is set to a value larger than the @code{minipage}'s natural height. To
+see the effect of the options, run this example with the various choices
+in place of @code{b}.
+
+@example
+Text before
+\begin@{center@}
+ ---\begin@{minipage@}[c][3in][b]@{0.25\textwidth@}
+ first\\ second\\ third
+ \end@{minipage@}
+\end@{center@}
+Text after
+@end example
@cindex indentation of paragraphs, in minipage
@cindex paragraph indentation, in minipage
@findex \parindent
-By default, paragraphs are not indented in the @code{minipage}
-environment. You can restore indentation with a command such as
-@code{\setlength@{\parindent@}@{1pc@}} command.
+By default paragraphs are not indented in a @code{minipage}. Change
+that with a command such as @code{\setlength@{\parindent@}@{1pc@}} at
+the start of @var{contents}.
@cindex footnotes in figures
@cindex figures, footnotes in
@@ -4434,8 +5477,49 @@ the bottom of the minipage instead of at the bottom of the page, and it
uses the @code{\mpfootnote} counter instead of the ordinary
@code{footnote} counter (@pxref{Counters}).
-However, don't put one minipage inside another if you are using
-footnotes; they may wind up at the bottom of the wrong minipage.
+This puts the footnote at the bottom of the table, not the bottom of the
+page.
+
+@example
+\begin@{center@} % center the minipage on the line
+\begin@{minipage@}@{2.5in@}
+ \begin@{center@} % center the table inside the minipage
+ \begin@{tabular@}@{ll@}
+ \textsc@{Monarch@} &\textsc@{Reign@} \\ \hline
+ Elizabeth II &63 years\footnote@{to date@} \\
+ Victoria &63 years \\
+ George III &59 years
+ \end@{tabular@}
+ \end@{center@}
+\end@{minipage@}
+\end@{center@}
+@end example
+
+If you nest minipages then there is an oddness when using footnotes.
+Footnotes appear at the bottom of the text ended by the next
+@code{\end@{minipage@}} which may not be their logical place.
+
+This puts a table containing data side by side with a map graphic. They
+are vertically centered.
+
+@example
+\newcommand*@{\vcenteredhbox@}[1]@{\begin@{tabular@}@{@@@{@}c@@@{@}@}#1\end@{tabular@}@}
+ ...
+\begin@{center@}
+ \vcenteredhbox@{\includegraphics[width=0.3\textwidth]@{nyc.png@}@}
+ \hspace@{0.1\textwidth@}
+ \begin@{minipage@}@{0.5\textwidth@}
+ \begin@{tabular@}@{r|l@}
+ \multicolumn@{1@}@{r@}@{Borough@} &Pop (million) \\ \hline
+ The Bronx &$1.5$ \\
+ Brooklyn &$2.6$ \\
+ Manhattan &$1.6$ \\
+ Queens &$2.3$ \\
+ Staten Island &$0.5$
+ \end@{tabular@}
+ \end@{minipage@}
+\end@{center@}
+@end example
@node picture
@@ -4445,220 +5529,307 @@ footnotes; they may wind up at the bottom of the wrong minipage.
@cindex creating pictures
@cindex pictures, creating
+Synopses:
+@example
+\begin@{picture@}(@var{width},@var{height})
+ @var{picture commands}
+\end@{picture@}
+@end example
+
+@noindent
+or
+
@example
\begin@{picture@}(@var{width},@var{height})(@var{xoffset},@var{yoffset})
-@dots{} @var{picture commands} @dots{}
+ @var{picture commands}
\end@{picture@}
@end example
+An environment to create simple pictures containing lines, arrows,
+boxes, circles, and text. Note that while this environment is not
+obsolete, new documents typically use much more powerful graphics
+creation systems, such as @code{TikZ}, @code{PSTricks}, @code{MetaPost},
+or @code{Asymptote}. These are not covered in this document; see CTAN.
+
+This shows the parallelogram law for adding vectors.
+
@findex \unitlength
-The @code{picture} environment allows you to create just about any
-kind of picture you want containing text, lines, arrows and circles.
-You tell @LaTeX{} where to put things in the picture by specifying
-their coordinates. A coordinate is a number that may have a decimal
-point and a minus sign---a number like @code{5}, @code{0.3} or
-@code{-3.1416}. A coordinate specifies a length in multiples of the
-unit length @code{\unitlength}, so if @code{\unitlength} has been set
-to @code{1cm}, then the coordinate 2.54 specifies a length of 2.54
-centimeters.
-
-You should only change the value of @code{\unitlength}, using the
-@code{\setlength} command, outside of a @code{picture} environment.
-The default value is @code{1pt}.
-
-@PkgIndex{picture}
-The @code{picture} package redefine the @code{picture} environment so
-that everywhere a number is used in a @var{picture commands} to specify
-a coordinate, one can use alternatively a length. Be aware however that
-this will prevent scaling those lengths by changing @code{\unitlength}.
+@example
+\setlength@{\unitlength@}@{1cm@}
+\begin@{picture@}(6,6) % picture box will be 6cm wide by 6cm tall
+ \put(0,0)@{\vector(2,1)@{4@}@} % for every 2 over this vector goes 1 up
+ \put(2,1)@{\makebox(0,0)[l]@{\ first leg@}@}
+ \put(4,2)@{\vector(1,2)@{2@}@}
+ \put(5,4)@{\makebox(0,0)[l]@{\ second leg@}@}
+ \put(0,0)@{\line(1,1)@{6@}@}
+ \put(3,3)@{\makebox(0,0)[r]@{sum\ @}@}
+\end@{picture@}
+@end example
+You can also use this environment to place arbitrary material at an
+exact location.
-@cindex position, in picture
-A @dfn{position} is a pair of coordinates, such as @code{(2.4,-5)}, specifying
-the point with x-coordinate @code{2.4} and y-coordinate @code{-5}.
-Coordinates are specified in the usual way with respect to an origin,
-which is normally at the lower-left corner of the picture. Note that
-when a position appears as an argument, it is not enclosed in braces;
-the parentheses serve to delimit the argument.
-
-The @code{picture} environment has one mandatory argument which is a
-position (@var{width},@var{height}), which specifies the size of the
-picture. The environment produces a rectangular box with these
-@var{width} and @var{height}.
-
-The @code{picture} environment also has an optional position argument
-(@var{xoffset},@var{yoffset}), following the size argument, that can
-change the origin. (Unlike ordinary optional arguments, this argument
-is not contained in square brackets.) The optional argument gives the
-coordinates of the point at the lower-left corner of the picture
-(thereby determining the origin). For example, if @code{\unitlength}
-has been set to @code{1mm}, the command
+@example
+\usepackage@{color,graphicx@} % in preamble
+ ...
+\begin@{center@}
+\setlength@{\unitlength@}@{\textwidth@}
+\begin@{picture@}(1,1) % leave space, \textwidth wide and tall
+ \put(0,0)@{\includegraphics[width=\textwidth]@{desertedisland.jpg@}@}
+ \put(0.25,0.35)@{\textcolor@{red@}@{X Treasure here@}@}
+\end@{picture@}
+\end@{center@}
+@end example
+
+@noindent
+The red@tie{}X will be precisely a quarter of the @code{\linewidth} from
+the left margin, and @code{0.35\linewidth} up from the bottom. Another
+example of this usage is to put similar code in the page header to get
+repeat material on each of a document's pages.
+
+The @code{picture} environment has one required argument, a pair of
+numbers (@var{width},@var{height}). Multiply these by the value
+@code{\unitlength} to get the nominal size of the output, the space that
+@LaTeX{} reserves on the output page. This nominal size need not be how
+large the picture really is; @LaTeX{} will draw things from the picture
+outside the picture's box.
+
+This environment also has an optional argument
+(@var{xoffset},@var{yoffset}). It is used to shift the origin. Unlike
+most optional arguments, this one is not contained in square brackets.
+As with the required argument, it consists of two real numbers.
+Multiply these by @code{\unitlength} to get the point at the lower-left
+corner of the picture.
+
+For example, if @code{\unitlength} has been set to @code{1mm}, the
+command
@example
\begin@{picture@}(100,200)(10,20)
@end example
-@noindent produces a picture of width 100 millimeters and height 200
-millimeters, whose lower-left corner is the point (10,20) and whose
-upper-right corner is therefore the point (110,220). When you first
-draw a picture, you typically omit the optional argument, leaving the
-origin at the lower-left corner. If you then want to modify your
+@noindent
+produces a box of width 100 millimeters and height 200 millimeters. The
+picture's origin is the point (10mm,20mm) and so the lower-left corner
+is there, and the upper-right corner is at (110mm,220mm). When you
+first draw a picture you typically omit the optional argument, leaving
+the origin at the lower-left corner. If you then want to modify your
picture by shifting everything, you can just add the appropriate
optional argument.
-The environment's mandatory argument determines the nominal size of the
-picture. This need bear no relation to how large the picture really is;
-@LaTeX{} will happily allow you to put things outside the picture, or even
-off the page. The picture's nominal size is used by @LaTeX{} in determining
-how much room to leave for it.
+@cindex position, in picture
+Each @var{picture command} tells @LaTeX{} where to put something by
+naming its position. A @dfn{position} is a pair such as @code{(2.4,-5)}
+giving the x- and y-coordinates. A @dfn{coordinate} is a not a length,
+it is a real number (it may have a decimal point or a minus sign). It
+specifies a length in multiples of the unit length @code{\unitlength},
+so if @code{\unitlength} has been set to @code{1cm}, then the coordinate
+2.54 specifies a length of 2.54 centimeters.
+
+@LaTeX{}'s default for @code{\unitlength} is @code{1pt}. it is a rigid
+length (@pxref{Lengths}). Change it with the @code{\setlength} command
+(@pxref{\setlength}). Make this change only outside of a @code{picture}
+environment.
+
+Coordinates are given with respect to an origin, which is normally at
+the lower-left corner of the picture. Note that when a position appears
+as an argument, as with @code{\put(1,2)@{...@}}, it is not enclosed in
+braces since the parentheses serve to delimit the argument. Also,
+unlike in some computer graphics systems, larger y-coordinates are
+further up the page.
-Everything that appears in a picture is drawn by the @code{\put}
-command. The command
+There are four ways to put things in a picture: @code{\put},
+@code{\multiput}, @code{\qbezier}, and @code{\graphpaper}. The most
+often used is @code{\put}. This
@example
-\put (11.3,-.3)@{...@}
+\put(11.3,-0.3)@{...@}
@end example
-@noindent puts the object specified by @code{...} in the
-picture, with its reference point at coordinates @math{(11.3,-.3)}.
-The reference points for various objects will be described below.
-
-@findex lR box
-The @code{\put} command creates an @dfn{LR box}. You can put anything
-that can go in an @code{\mbox} (@pxref{\mbox}) in the text argument of
-the @code{\put} command. When you do this, the reference point will
-be the lower left corner of the box.
+@noindent
+places the object with its reference point at coordinates
+@math{(11.3,-0.3)}. The reference points for various objects will be
+described below.
+@findex LR box
+The @code{\put} command creates an @dfn{LR box} (@pxref{Modes}).
+Anything that can go in an @code{\mbox} (@pxref{\mbox & \makebox}) can
+go in the text argument of the @code{\put} command. The reference point
+will be the lower left corner of the box. In this picture
+
+@example
+\setlength@{\unitlength@}@{1cm@}
+...\begin@{picture@}(1,1)
+ \put(0,0)@{\line(1,0)@{1@}@}
+ \put(0,0)@{\line(1,1)@{1@}@}
+\end@{picture@}
+@end example
-The @code{picture} commands are described in the following sections.
+@noindent
+the three dots are just slightly left of the point of the angle formed
+by the two lines. (Also, @code{\line(1,1)@{1@}} does not call for a
+line of length one; rather the line has a change in the x coordinate of
+1.)
+
+The @code{\multiput}, @code{qbezier}, and @code{graphpaper} commands are
+described below.
+
+This draws a rectangle with a wavy top, using @code{\qbezier} for
+that curve.
+
+@example
+\begin@{picture@}(3,1.5)
+ \put(0,0)@{\vector(1,0)@{8@}@} % x axis
+ \put(0,0)@{\vector(0,1)@{4@}@} % y axis
+ \put(2,0)@{\line(0,1)@{3@}@} % left side rectangle
+ \put(4,0)@{\line(0,1)@{3.5@}@} % right side
+ \qbezier(2,3)(2.5,2.9)(3,3.25)
+ \qbezier(3,3.25)(3.5,3.6)(4,3.5)
+ \thicklines % below here, lines are twice as thick
+ \put(2,3)@{\line(4,1)@{2@}@}
+ \put(4.5,2.5)@{\framebox@{Trapezoidal Rule@}@}
+\end@{picture@}
+@end example
@menu
+* \put:: Place an object at a specified place.
+* \multiput:: Draw multiple instances of an object.
+* \qbezier:: Draw a quadratic Bezier curve.
+* \graphpaper:: Draw graph paper.
+* \line:: Draw a straight line.
+* \linethickness:: Set thickness of horizontal and vertical lines.
+* \thinlines:: The default line thickness.
+* \thicklines:: A heavier line thickness.
* \circle:: Draw a circle.
+* \oval:: Draw an oval.
+* \shortstack:: Make a stack of objects.
+* \vector:: Draw a line with an arrow.
* \makebox (picture):: Draw a box of the specified size.
* \framebox (picture):: Draw a box with a frame around it.
-* \dashbox:: Draw a dashed box.
* \frame:: Draw a frame around an object.
-* \line:: Draw a straight line.
-* \linethickness:: Set the line thickness.
-* \thicklines:: A heavier line thickness.
-* \thinlines:: The default line thickness.
-* \multiput:: Draw multiple instances of an object.
-* \oval:: Draw an ellipse.
-* \put:: Place an object at a specified place.
-* \shortstack:: Make a pile of objects.
-* \vector:: Draw a line with an arrow.
+* \dashbox:: Draw a dashed box.
@end menu
-@node \circle
-@subsection @code{\circle}
+@node \put
+@subsection @code{\put}
-@findex \circle
+@findex \put
Synopsis:
@example
-\circle[*]@{@var{diameter}@}
+\put(@var{xcoord},@var{ycoord})@{@var{content}@}
@end example
-The @code{\circle} command produces a circle with a diameter as close
-to the specified one as possible. The @code{*}-form of the command
-draws a solid circle.
+Place @var{content} at the coordinate (@var{xcoord},@var{ycoord}). See
+the discussion of coordinates and @code{\unitlength} in @ref{picture}.
+The @var{content} is processed in LR mode (@pxref{Modes}) so it cannot
+contain line breaks.
-Circles up to 40@dmn{pt} can be drawn.
+This includes the text into the @code{picture}.
+@example
+\put(4.5,2.5)@{Apply the \textit@{unpoke@} move@}
+@end example
-@node \makebox (picture)
-@subsection @code{\makebox}
+The reference point, the location (4.5,2.5), is the lower left of the
+text, at the bottom left of the @samp{A}.
-@findex \makebox @r{(for @code{picture})}
+
+@node \multiput
+@subsection @code{\multiput}
+
+@findex \multiput
Synopsis:
@example
-\makebox(@var{width},@var{height})[@var{position}]@{@var{text}@}
+\multiput(@var{x},@var{y})(@var{delta_x},@var{delta_y})@{@var{num-copies}@}@{@var{obj}@}
@end example
-The @code{\makebox} command for the picture environment is similar to
-the normal @code{\makebox} command except that you must specify a
-@var{width} and @var{height} in multiples of @code{\unitlength}.
+Copy @var{obj} a total of @var{num-copies} times, with an increment of
+@var{delta_x,delta_y}. The @var{obj} first appears at position
+@math{(x,y)}, then at @math{(x+\delta_x,y+\delta_y)}, and so on.
-The optional argument, @code{[@var{position}]}, specifies the quadrant that
-your @var{text} appears in. You may select up to two of the following:
+This draws a simple grid with every fifth line in bold (see also
+@ref{\graphpaper}).
-@table @code
-@item t
-Moves the item to the top of the rectangle.
-
-@item b
-Moves the item to the bottom.
-
-@item l
-Moves the item to the left.
+@example
+\begin@{picture@}(10,10)
+ \linethickness@{0.05mm@}
+ \multiput(0,0)(1,0)@{10@}@{\line(0,1)@{10@}@}
+ \multiput(0,0)(0,1)@{10@}@{\line(1,0)@{10@}@}
+ \linethickness@{0.5mm@}
+ \multiput(0,0)(5,0)@{3@}@{\line(0,1)@{10@}@}
+ \multiput(0,0)(0,5)@{3@}@{\line(1,0)@{10@}@}
+\end@{picture@}
+@end example
-@item r
-Moves the item to the right.
-@end table
+@node \qbezier
+@subsection @code{\qbezier}
-@xref{\makebox}.
+@findex \qbezier
+Synopsis:
-@node \framebox (picture)
-@subsection @code{\framebox}
+@example
+\qbezier(@var{x1},@var{y1})(@var{x2},@var{y2})(@var{x3},@var{y3})
+\qbezier[@var{num}](@var{x1},@var{y1})(@var{x2},@var{y2})(@var{x3},@var{y3})
+@end example
-@findex \framebox
+Draw a quadratic Bezier curve whose control points are given by the
+three required arguments @code{(@var{x1},@var{y1})},
+@code{(@var{x2},@var{y2})}, and @code{(@var{x3},@var{y3})}. That is,
+the curve runs from @var{(x1,y1)} to @var{(x3,y3)}, is quadratic, and is
+such that the tangent line at @var{(x1,y1)} passes through
+@var{(x2,y2)}, as does the tangent line at @var{(x3,y3)}.
-Synopsis:
+This draws a curve from the coordinate (1,1) to (1,0).
@example
-\framebox(@var{width},@var{height})[@var{pos}]@{...@}
+\qbezier(1,1)(1.25,0.75)(1,0)
@end example
-The @code{\framebox} command is like @code{\makebox} (see previous
-section), except that it puts a frame around the outside of the box
-that it creates.
-
-@findex \fboxrule
-@findex \fboxsep
-The @code{\framebox} command produces a rule of thickness
-@code{\fboxrule}, and leaves a space @code{\fboxsep} between the rule
-and the contents of the box.
+@noindent
+The curve's tangent line at (1,1) contains (1.25,0.75), as does the
+curve's tangent line at (1,0).
+The optional argument @var{num} gives the number of calculated
+intermediate points. The default is to draw a smooth curve whose
+maximum number of points is @code{\qbeziermax} (change this value with
+@code{\renewcommand}).
-@node \dashbox
-@subsection @code{\dashbox}
-@findex \dashbox
+@node \graphpaper
+@subsection @code{\graphpaper}
-Draws a box with a dashed line. Synopsis:
+@findex \graphpaper
+Synopsis:
@example
-\dashbox@{@var{dlen}@}(@var{rwidth},@var{rheight})[@var{pos}]@{@var{text}@}
+\graphpaper(@var{x_init},@var{y_init})(@var{x_dimen},@var{y_dimen})
+\graphpaper[@var{spacing}](@var{x_init},@var{y_init})(@var{x_dimen},@var{y_dimen})
@end example
-@code{\dashbox} creates a dashed rectangle around @var{text} in a
-@code{picture} environment. Dashes are @var{dlen} units long, and the
-rectangle has overall width @var{rwidth} and height @var{rheight}.
-The @var{text} is positioned at optional @var{pos}. @c xxref positions.
-
-A dashed box looks best when the @var{rwidth} and @var{rheight} are
-multiples of the @var{dlen}.
-
-
-@node \frame
-@subsection @code{\frame}
-
-@findex \frame
+Draw a coordinate grid. Requires the @code{graphpap} package.
+The grid's origin is @code{(@var{x_init},@var{y_init})}.
+Grid lines come every @var{spacing} units (the default is 10).
+The grid extends @var{x_dimen} units to the right and @var{y_dimen} units up.
+All arguments must be positive integers.
-Synopsis:
+This make a grid with seven vertical lines and eleven horizontal lines.
@example
-\frame@{@var{text}@}
+\usepackage@{graphpap@} % in preamble
+ ...
+\begin@{picture@}(6,20) % in document body
+ \graphpaper[2](0,0)(12,20)
+\end@{picture@}
@end example
-The @code{\frame} command puts a rectangular frame around @var{text}.
-The reference point is the bottom left corner of the frame. No extra
-space is put between the frame and the object.
+@noindent
+The lines are numbered every ten units.
@node \line
@@ -4669,18 +5840,59 @@ space is put between the frame and the object.
Synopsis:
@example
-\line(@var{xslope},@var{yslope})@{@var{length}@}
+\line(@var{x_run},@var{y_rise})@{@var{travel}@}
+@end example
+
+Draw a line. It slopes such that it vertically rises @var{y_rise} for
+every horizontal @var{x_run}. The @var{travel} is the total horizontal
+change@tie{}--- it is not the length of the vector, it is the change in
+@math{x}. In the special case of vertical lines, where
+(@var{x_run},@var{y_rise})=(0,1), the @var{travel} gives the change in
+@math{y}.
+
+This draws a line starting at coordinates (1,3).
+
+@example
+\put(1,3)@{\line(2,5)@{4@}@}
@end example
-The @code{\line} command draws a line with the given @var{length} and
-slope @var{xslope}/@var{yslope}.
+@noindent
+For every over 2, this line will go up 5. Because @var{travel}
+specifies that this goes over 4, it must go up@tie{}10. Thus its
+endpoint is @math{(1,3)+(4,10)=(5,13)}. In particular, note that
+@math{@var{travel}=4} is not the length of the line, it is the change in
+@math{x}.
+
+The arguments @var{x_run} and @var{y_rise} are integers that can be
+positive, negative, or zero. (If both are 0 then @LaTeX{} treats the
+second as 1.) With
+@code{\put(@var{x_init},@var{y_init})@{\line(@var{x_run},@var{y_rise})@{@var{travel}@}@}},
+if @var{x_run} is negative then the line's ending point has a first
+coordinate that is less than @var{x_init}. If @var{y_rise} is negative
+then the line's ending point has a second coordinate that is less than
+@var{y_init}.
+
+If @var{travel} is negative then you get @code{LaTeX Error: Bad \line or
+\vector argument.}
@cindex @code{pict2e} package
@cindex graphics packages
-Standard @LaTeX{} can only draw lines with @math{@var{slope} = x/y},
-where @math{x} and @math{y} have integer values from @minus{}6
-through@tie{}6. For lines of any slope, and plenty of other shapes,
-see @code{pict2e} and many other packages on CTAN.
+@PkgIndex{pict2e}
+@PkgIndex{TikZ}
+@PkgIndex{PSTricks}
+@PkgIndex{MetaPost}
+@PkgIndex{Asymptote}
+Standard @LaTeX{} can only draw lines with a limited range of slopes
+because these lines are made by putting together line segments from
+pre-made fonts. The two numbers @var{x_run} and @var{y_rise} must have
+integer values from @minus{}6 through@tie{}6. Also, they must be
+relatively prime, so that @var{(x_run,y_rise)} can be (2,1) but not
+(4,2) (if you choose the latter then instead of lines you get sequences
+of arrowheads; the solution is to switch to the former). To get lines
+of arbitrary slope and plenty of other shapes in a system like
+@code{picture}, see the package @file{pict2e} on CTAN. Another solution
+is to use a full-featured graphics system such as @file{TikZ}, or
+@file{PSTricks}, or @file{MetaPost}, or @file{Asymptote}
@node \linethickness
@@ -4688,12 +5900,28 @@ see @code{pict2e} and many other packages on CTAN.
@findex \linethickness
-The @code{\linethickness@{@var{dim}@}} command declares the thickness
-of horizontal and vertical lines in a picture environment to be
-@var{dim}, which must be a positive length.
+Synopsis:
+
+@example
+\linethickness@{@var{dim}@}
+@end example
+
+Declares the thickness of subsequent horizontal and vertical lines in a
+picture to be @var{dim}, which must be a positive length
+(@pxref{Lengths}). It differs from @code{\thinlines} and
+@code{\thicklines} in that it does not affect the thickness of slanted
+lines, circles, or ovals.
+
+
+@node \thinlines
+@subsection @code{\thinlines}
+
+@findex \thinlines
-@code{\linethickness} does not affect the thickness of slanted lines,
-circles, or the quarter circles drawn by @code{\oval}.
+Declaration to set the thickness of subsequent lines, circles, and ovals
+in a picture environment to be 0.4@dmn{pt}. This is the default
+thickness, so this command is unnecessary unless the thickness has been
+changed with either @ref{\linethickness} or @ref{\thicklines}.
@node \thicklines
@@ -4701,36 +5929,36 @@ circles, or the quarter circles drawn by @code{\oval}.
@findex \thicklines
-The @code{\thicklines} command is an alternate line thickness for
-horizontal and vertical lines in a picture environment;
-cf.@tie{}@ref{\linethickness} and @ref{\thinlines}.
+Declaration to set the thickness of subsequent lines, circles, and ovals
+in a picture environment to be 0.8@dmn{pt}. See also
+@ref{\linethickness} and @ref{\thinlines}. This command is illustrated
+in the Trapezoidal Rule example of @ref{picture}.
-@node \thinlines
-@subsection @code{\thinlines}
+@node \circle
+@subsection @code{\circle}
-@findex \thinlines
+@findex \circle
-The @code{\thinlines} command is the default line thickness for
-horizontal and vertical lines in a picture environment;
-cf.@tie{}@ref{\linethickness} and @ref{\thicklines}.
+Synopsis:
+@example
+\circle@{@var{diameter}@}
+\circle*@{@var{diameter}@}
+@end example
-@node \multiput
-@subsection @code{\multiput}
+Produces a circle with a diameter as close as possible to the specified
+one. The @code{*}@tie{}form produces a filled-in circle.
-@findex \multiput
-
-Synopsis:
+This draws a circle of radius 6, centered at @code{(5,7)}.
@example
-\multiput(@var{x},@var{y})(@var{delta_x},@var{delta_y})@{@var{n}@}@{@var{obj}@}
+\put(5,7)@{\circle@{6@}@}
@end example
-The @code{\multiput} command copies the object @var{obj} in a regular
-pattern across a picture. @var{obj} is first placed at position
-@math{(x,y)}, then at @math{(x+\delta x,y+\delta y)}, and so on,
-@var{n} times.
+The available radii for @code{circle} are, in points, the even
+numbers from 2 to 20, inclusive. For @code{circle*} they are all the
+integers from 1 to 15.
@node \oval
@@ -4741,46 +5969,42 @@ pattern across a picture. @var{obj} is first placed at position
Synopsis:
@example
+\oval(@var{width},@var{height})
\oval(@var{width},@var{height})[@var{portion}]
@end example
-The @code{\oval} command produces a rectangle with rounded corners. The
-optional argument @var{portion} allows you to produce only half of the
-oval via the following:
+Produce a rectangle with rounded corners. The optional argument
+@var{portion} allows you to produce only half or a quarter of the oval.
+For half an oval take @var{portion} to be one of these.
@table @code
@item t
-selects the top half;
+top half
@item b
-selects the bottom half;
+bottom half
@item r
-selects the right half;
+right half
@item l
-selects the left half.
+left half
@end table
-It is also possible to produce only one quarter of the oval by setting
-@var{portion} to @code{tr}, @code{br}, @code{bl}, or @code{tl}.
-
-The ``corners'' of the oval are made with quarter circles with a
-maximum radius of 20@dmn{pt}, so large ``ovals'' will look more like
-boxes with rounded corners.
+Produce only one quarter of the oval by setting @var{portion} to
+@code{tr}, @code{br}, @code{bl}, or @code{tl}.
-
-@node \put
-@subsection @code{\put}
-
-@findex \put
-
-Synopsis:
+This draws the top half of an oval that is 3 wide and 7 tall.
@example
-\put(@var{xcoord},@var{ycoord})@{ ... @}
+\put(5,7)@{\oval(3,7)[t]@}
@end example
-The @code{\put} command places the material specified by the
-(mandatory) argument in braces at the given coordinate,
-(@var{xcoord},@var{ycoord}).
+@noindent
+The (5,7) is the center of the entire oval, not just the center of the
+top half.
+
+These shapes are not ellipses. They are rectangles whose corners are
+made with quarter circles. These circles have a maximum radius of
+20@dmn{pt} (@pxref{\circle} for the sizes). Thus large ovals are just
+boxes with a small amount of corner rounding.
@node \shortstack
@@ -4791,23 +6015,49 @@ The @code{\put} command places the material specified by the
Synopsis:
@example
-\shortstack[@var{position}]@{...\\...\\...@}
+\shortstack[@var{position}]@{@var{line 1} \\ ... @}
+@end example
+
+Produce a vertical stack of objects.
+
+This labels the @math{y} axis.
+
+@example
+\put(0,0)@{\vector(1,0)@{4@}@} % x axis
+\put(0,0)@{\vector(0,1)@{2@}@} % y
+\put(-0.25,2)@{\makebox[0][r]@{\shortstack[r]@{$y$\\ axis@}@}@}
@end example
-The @code{\shortstack} command produces a stack of objects. The valid
-positions are:
+@noindent
+For a short stack, the reference point is the lower left of the stack.
+In the above example the @ref{\mbox & \makebox} puts the stack flush
+right in a zero width box so in total the short stack sits slightly to
+the left of the @math{y}@tie{}axis.
+
+The valid positions are:
@table @code
@item r
-Move the objects to the right of the stack.
+Make objects flush right
@item l
-Move the objects to the left of the stack
+Make objects flush left
@item c
-Move the objects to the centre of the stack (default)
+Center objects (default)
@end table
@findex \\ @r{(for @code{\shortstack} objects)}
-Objects are separated with @code{\\}.
+Separate objects into lines with @code{\\}. These stacks are short in
+that, unlike in a @code{tabular} or @code{array} environment, here the
+rows are not spaced out to be of even heights. Thus, in
+@code{\shortstack@{X\\o\\o\\X@}} the first and last rows are taller than
+the middle two. You can adjust row heights either by putting in the
+usual interline spacing with @code{\shortstack@{X\\ \strut o\\o\\X@}},
+or by hand, via an explicit zero-width box @code{\shortstack@{X \\
+\rule@{0pt@}@{12pt@} o\\o\\X@}} or by using @code{\\}'s optional
+argument @code{\shortstack@{X\\[2pt] o\\o\\X@}}.
+
+The @code{\shortstack} command is also available outside the
+@code{picture} environment.
@node \vector
@@ -4818,16 +6068,178 @@ Objects are separated with @code{\\}.
Synopsis:
@example
-\vector(@var{xslope},@var{yslope})@{@var{length}@}
+\vector(@var{x_run},@var{y_rise})@{@var{travel}@}
+@end example
+
+Draw a line ending in an arrow. The slope of that line is: it
+vertically rises @var{y_rise} for every horizontal @var{x_run}. The
+@var{travel} is the total horizontal change@tie{}--- it is not the
+length of the vector, it is the change in @math{x}. In the special case
+of vertical vectors, if (@var{x_run},@var{y_rise})=(0,1), then
+@var{travel} gives the change in @math{y}.
+
+For an example see @ref{picture}.
+
+For elaboration on @var{x_run} and @var{y_rise} see @ref{\line}. As
+there, the values of @var{x_run} and @var{y_rise} are limited. For
+@code{\vector} you must chooses integers between @minus{}4 and 4,
+inclusive. Also, the two you choose must be relatively prime. Thus,
+@code{\vector(2,1)@{4@}} is acceptable but @code{\vector(4,2)@{4@}} is
+not (if you use the latter then you get a sequence of arrowheads).
+
+
+@node \makebox (picture)
+@subsection @code{\makebox} (picture)
+
+@findex \makebox @r{(for @code{picture})}
+
+Synopsis:
+
+@example
+\makebox(@var{rec-width},@var{rec-height})@{@var{text}@}
+\makebox(@var{rec-width},@var{rec-height})[@var{position}]@{@var{text}@}
+@end example
+
+Make a box to hold @var{text}. This command fits with the
+@code{picture} environment, although you can use it outside of there,
+because @var{rec-width} and @var{rec-height} are numbers specifying
+distances in terms of the @code{\unitlength} (@pxref{picture}). This
+command is similar to the normal @code{\makebox} command (@pxref{\mbox &
+\makebox}) except here that you must specify the width and height. This
+command is fragile (@pxref{\protect}).
+
+This makes a box of length 3.5 times @code{\unitlength} and height 4
+times @code{\unitlength}.
+
+@example
+\put(1,2)@{\makebox(3.5,4)@{...@}@}
+@end example
+
+The optional argument @code{@var{position}} specifies where in the box
+the @var{text} appears. The default is to center it, both horizontally
+and vertically. To place it somewhere else, use a string with one or
+two of these letters.
+
+@table @code
+@item t
+Puts @var{text} the top of the box.
+
+@item b
+Put @var{text} at the bottom.
+
+@item l
+Put @var{text} on the left.
+
+@item r
+Put @var{text} on the right.
+
+@end table
+
+
+@node \framebox (picture)
+@subsection @code{\framebox} (picture)
+
+@findex \framebox
+
+Synopsis:
+
+@example
+\framebox(@var{rec-width},@var{rec-height})@{@var{text}@}
+\framebox(@var{rec-width},@var{rec-height})[@var{position}]@{@var{text}@}
+@end example
+
+This is the same as @ref{\makebox (picture)} except that it puts a frame
+around the outside of the box that it creates. The reference point is
+the bottom left corner of the frame. This command fits with the
+@code{picture} environment, although you can use it outside of there,
+because lengths are numbers specifying the distance in terms of the
+@code{\unitlength} (@pxref{picture}). This command is fragile
+(@pxref{\protect}).
+
+This example creates a frame 2.5@tie{}inches by 3@tie{}inches and puts
+the text in the center.
+
+@example
+\setlength@{\unitlength@}@{1in@}
+\framebox(2.5,3)@{test text@}
@end example
-The @code{\vector} command draws a line with an arrow of the specified
-length and slope. The @math{@var{xslope}} and @math{@var{yslope}}
-values must lie between @minus{}4 and +4, inclusive.
+The required arguments are that the rectangle has overall width
+@var{rect-width} units and height @var{rect-height} units.
+
+The optional argument @var{position} specifies the position of
+@var{text}; see @ref{\makebox (picture)} for the values that it can
+take.
+
+@findex \fboxrule
+@findex \fboxsep
+The rule has thickness @code{\fboxrule} and there is a blank space
+@code{\fboxsep} between the frame and the contents of the box.
+
+For this command, you must specify the @var{width} and @var{height}. If
+you want to just put a frame around some contents whose dimension is
+determined in some other way then either use @code{\fbox} (@pxref{\fbox
+& \framebox}) or @code{\frame} (@pxref{\frame}).
+
+
+@node \frame
+@subsection @code{\frame}
+
+@findex \frame
+
+Synopsis:
+
+@example
+\frame@{@var{contents}@}
+@end example
+Puts a rectangular frame around @var{contents}. The reference point is
+the bottom left corner of the frame. In contrast to @code{\framebox}
+(@pxref{\framebox (picture)}), this command puts no extra space is put
+between the frame and the object. It is fragile (@pxref{\protect}).
-@node quotation and quote
-@section @code{quotation} and @code{quote}
+
+@node \dashbox
+@subsection @code{\dashbox}
+
+@findex \dashbox
+
+Synopsis:
+
+@example
+\dashbox@{@var{dash-len}@}(@var{rect-width},@var{rect-height})@{@var{text}@}
+\dashbox@{@var{dash-len}@}(@var{rect-width},@var{rect-height})[@var{position}]@{@var{text}@}
+@end example
+
+Create a dashed rectangle around @var{text}. This command fits with the
+@code{picture} environment, although you can use it outside of there,
+because lengths are numbers specifying the distance in terms of the
+@code{\unitlength} (@pxref{picture}).
+
+The required arguments are: dashes are @var{dash-len} units long, with
+the same length gap, and the rectangle has overall width
+@var{rect-width} units and height @var{rect-height} units.
+
+The optional argument @var{position} specifies the position of
+@var{text}; see @ref{\makebox (picture)} for the values that it can
+take.
+
+This shows that you can use non-integer value for @var{dash-len}.
+
+@example
+\put(0,0)@{\dashbox@{0.1@}(5,0.5)@{My hovercraft is full of eels.@}@}
+@end example
+
+@noindent
+Each dash will be @code{0.1\unitlength} long, the box's width is
+@code{5\unitlength} and its height is @code{0.5\unitlength}.
+
+As in that example, a dashed box looks best when @var{rect-width} and
+@var{rect-height} are multiples of the @var{dash-len}.
+
+
+@node quotation & quote
+@section @code{quotation} & @code{quote}
@EnvIndex{quotation}
@cindex quoted text with paragraph indentation, displaying
@@ -4842,39 +6254,33 @@ Synopsis:
@example
\begin@{quotation@}
-@var{text}
+ @var{text}
\end@{quotation@}
@end example
+@noindent
or
@example
\begin@{quote@}
-@var{text}
+ @var{text}
\end@{quote@}
@end example
-Include a quotation.
-
-In both environments, margins are indented on both sides by
-@code{\leftmargin} and the text is justified at both. As with the main
-text, leaving a blank line produces a new paragraph.
+Include a quotation. Both environments indent margins on both sides by
+@code{\leftmargin} and the text is right-justified.
-To compare the two: in the @code{quotation} environment, paragraphs are
-indented by 1.5@dmn{em} and the space between paragraphs is small,
-@code{0pt plus 1pt}. In the @code{quote} environment, paragraphs are
-not indented and there is vertical space between paragraphs (it is the
-rubber length @code{\parsep}). Thus, the @code{quotation} environment
-may be more suitable for documents where new paragraphs are marked by an
-indent rather than by a vertical separation. In addition, @code{quote}
-may be more suitable for a short quotation or a sequence of short
-quotations.
+They differ in how they treat paragraphs. In the @code{quotation}
+environment, paragraphs are indented by 1.5@dmn{em} and the space
+between paragraphs is small, @code{0pt plus 1pt}. In the @code{quote}
+environment, paragraphs are not indented and there is vertical space
+between paragraphs (it is the rubber length @code{\parsep}).
@example
-\begin@{quotation@}
-\it Four score and seven years ago
+\begin@{quotation@} \small\it
+ Four score and seven years ago
... shall not perish from the earth.
-\hspace@{1em plus 1fill@}---Abraham Lincoln
+ \hspace@{1em plus 1fill@}---Abraham Lincoln
\end@{quotation@}
@end example
@@ -4897,10 +6303,11 @@ Synopsis:
\end@{tabbing@}
@end example
-The @code{tabbing} environment aligns text in columns. It works by
-setting tab stops and tabbing to them much as was done on a typewriter.
-It is best suited for cases where the width of each column is constant
-and known in advance.
+Align text in columns, by setting tab stops and tabbing to them much as
+was done on a typewriter. This is less often used than the environments
+@code{tabular} (@pxref{tabular}) or @code{array} (@pxref{array}) because
+in those the width of each column need not be constant and need not be
+known in advance.
This example has a first line where the tab stops are set to explicit
widths, ended by a @code{\kill} command (which is described below):
@@ -5037,7 +6444,9 @@ function \= fact(n : integer) : integer;\\
\end@{tabbing@}
@end example
-The output looks like this:
+@noindent
+The output looks like this.
+
@example
function fact(n : integer) : integer;
begin
@@ -5050,13 +6459,12 @@ function fact(n : integer) : integer;
@PkgIndex{algorithm2e} @PkgIndex{listings} @PkgIndex{minted}
@PkgIndex{fancyvrb}
-
-(The above example is just for illustration of the environment. To
-actually typeset computer code in typewriter like this, a verbatim
-environment (@pxref{verbatim}) would normally suffice. For
-pretty-printed code, there are quite a few packages, including
-@code{algorithm2e}, @code{fancyvrb}, @code{listings}, and
-@code{minted}.)
+@noindent
+This example is just for illustration of the environment. To actually
+typeset computer code in typewriter like this, a verbatim environment
+(@pxref{verbatim}) would normally be best. For pretty-printed code,
+there are quite a few packages, including @code{algorithm2e},
+@code{fancyvrb}, @code{listings}, and @code{minted}.
@node table
@@ -5070,30 +6478,50 @@ Synopsis:
@example
\begin@{table@}[@var{placement}]
- table body
-\caption[@var{loftitle}]@{@var{title}@}
-\label@{@var{label@}}
+ @var{table body}
+ \caption[@var{loftitle}]@{@var{title}@} % optional
+ \label@{@var{label@}} % also optional
\end@{table@}
@end example
-A class of floats (@pxref{Floats}). Because they cannot be split across
-pages, they are not typeset in sequence with the normal text but instead
-are ``floated'' to a convenient place, such as the top of a following
-page.
+A class of floats (@pxref{Floats}). They cannot be split across pages
+and so they are not typeset in sequence with the normal text but instead
+are floated to a convenient place, such as the top of a following page.
+
+This example @code{table} environment contains a @code{tabular}
+
+@example
+\begin@{table@}
+ \centering\small
+ \begin@{tabular@}@{ll@}
+ \multicolumn@{1@}@{c@}@{\textit@{Author@}@}
+ &\multicolumn@{1@}@{c@}@{\textit@{Piece@}@} \\ \hline
+ Bach &Cello Suite Number 1 \\
+ Beethoven &Cello Sonata Number 3 \\
+ Brahms &Cello Sonata Number 1
+ \end@{tabular@}
+ \caption@{Top cello pieces@}
+ \label@{tab:cello@}
+\end@{table@}
+@end example
+
+@noindent
+but you can put many different kinds of content in a @code{table},
+including text, @LaTeX{} commands, etc.
For the possible values of @var{placement} and their effect on the
float placement algorithm, see @ref{Floats}.
-The table body is typeset in a @code{parbox} of width @code{\textwidth}
-and so it can contain text, commands, etc.
+The table body is typeset in a @code{parbox} of width @code{\textwidth}.
+It can contain text, commands, graphics, etc.
The label is optional; it is used for cross references (@pxref{Cross
references}).
@findex \caption
-The optional @code{\caption} command specifies caption text for the
-table. By default it is numbered. If @var{lottitle} is present, it is
-used in the list of tables instead of @var{title} (@pxref{Tables of
-contents}).
+The @code{\caption} command is also optional. It specifies caption text
+for the table. By default it is numbered. If its optional
+@var{lottitle} is present then that text is used in the list of tables
+instead of @var{title} (@pxref{Table of contents etc.}).
In this example the table and caption will float to the bottom of a page,
unless it is pushed to a float page at the end.
@@ -5123,7 +6551,7 @@ Synopsis:
@example
\begin@{tabular@}[@var{pos}]@{@var{cols}@}
-column 1 entry &column 2 entry ... &column n entry \\
+ @var{column 1 entry} &@var{column 2 entry} ... &@var{column n entry} \\
...
\end@{tabular@}
@end example
@@ -5133,14 +6561,14 @@ or
@example
\begin@{tabular*@}@{@var{width}@}[@var{pos}]@{@var{cols}@}
-column 1 entry &column 2 entry ... &column n entry \\
+ @var{column 1 entry} &@var{column 2 entry} ... &@var{column n entry} \\
...
\end@{tabular*@}
@end example
-These environments produce a table, a box consisting of a sequence of
-horizontal rows. Each row consists of items that are aligned vertically
-in columns. This illustrates many of the features.
+Produce a table, a box consisting of a sequence of horizontal rows.
+Each row consists of items that are aligned vertically in columns. This
+illustrates many of the features.
@example
\begin@{tabular@}@{l|l@}
@@ -5151,27 +6579,22 @@ in columns. This illustrates many of the features.
\end@{tabular@}
@end example
-The vertical format of two left-aligned columns, with a vertical bar
-between them, is specified in @code{tabular}'s argument @code{@{l|l@}}.
+@noindent
+The output will have two left-aligned columns with a vertical bar
+between them. This is specified in @code{tabular}'s argument
+@code{@{l|l@}}.
@findex &
-Columns are separated with an ampersand @code{&}. A horizontal rule
-between two rows is created with @code{\hline}.
+Put the entries into different columns by separating them with an
+ampersand, @code{&}. The end of each row is marked with a double
+backslash, @code{\\}. Put a horizontal rule below a row, after a double
+backslash, with @code{\hline}.
@findex \\ @r{for @code{tabular}}
-The end of each row is marked with a double backslash@tie{}@code{\\}.
This @code{\\} is optional after the last row unless an @code{\hline}
command follows, to put a rule below the table.
The required and optional arguments to @code{tabular} consist of:
@table @var
-@item width
-Required for @code{tabular*}, not allowed for @code{tabular}. Specifies
-the width of the @code{tabular*} environment. The space between columns
-should be rubber, as with @code{@@@{\extracolsep@{\fill@}@}}, to allow
-the table to stretch or shrink to make the specified width, or else you
-are likely to get the @code{Underfull \hbox (badness 10000) in alignment
-...} warning.
-
@item pos
Optional. Specifies the table's vertical position. The default is to
align the table so its vertical center matches the baseline of the
@@ -5202,25 +6625,28 @@ A column of centered items.
A vertical line the full height and depth of the environment.
@item @@@{@var{text or space}@}
-This inserts @var{text or space} at this location in every row. The
-@var{text or space} material is typeset in LR mode. This text is
-fragile (@pxref{\protect}).
+Insert @var{text or space} at this location in every row. The @var{text
+or space} material is typeset in LR mode. This text is fragile
+(@pxref{\protect}).
-This specifier is optional: with no @@-expression, @LaTeX{}'s
+If between two columns there is no @@-expression then @LaTeX{}'s
@code{book}, @code{article}, and @code{report} classes will put on
-either side of each column a space of length @code{\tabcolsep}, which
-by default is @samp{6pt}. That is, by default adjacent columns are
-separated by 12pt (so @code{\tabcolsep} is misleadingly-named since it
-is not the separation between tabular columns). By implication, a
-space of 6pt also comes before the first column and after the final
-column, unless you put a @code{@@@{...@}} or @code{|} there.
+either side of each column a space of length @code{\tabcolsep}, which by
+default is 6@dmn{pt}. That is, by default adjacent columns are
+separated by 12@dmn{pt} (so @code{\tabcolsep} is misleadingly named
+since it is only half of the separation between tabular columns). In
+addition, a space of 6@dmn{pt} also comes before the first column and
+after the final column, unless you put a @code{@@@{...@}} or @code{|}
+there.
-If you override the default and use an @@-expression then you must
-insert any desired space yourself, as in @code{@@@{\hspace@{1em@}@}}.
+If you override the default and use an @@-expression then @LaTeX{} does
+not insert @code{\tabcolsep} so you must insert any desired space
+yourself, as in @code{@@@{\hspace@{1em@}@}}.
-An empty expression @code{@@@{@}} will eliminate the space, including
-the space at the start or end, as in the example below where the tabular
-lines need to lie on the left margin.
+An empty expression @code{@@@{@}} will eliminate the space. In
+particular, sometimes you want to eliminate the the space before the
+first column or after the last one, as in the example below where the
+tabular lines need to lie on the left margin.
@example
\begin@{flushleft@}
@@ -5230,8 +6656,8 @@ lines need to lie on the left margin.
\end@{flushleft@}
@end example
-This example shows text, a decimal point, between the columns, arranged
-so the numbers in the table are aligned on that decimal point.
+The next example shows text, a decimal point between the columns,
+arranged so the numbers in the table are aligned on it.
@example
\begin@{tabular@}@{r@@@{$.$@}l@}
@@ -5243,20 +6669,18 @@ so the numbers in the table are aligned on that decimal point.
@findex \extracolsep
An @code{\extracolsep@{@var{wd}@}} command in an @@-expression causes an
extra space of width @var{wd} to appear to the left of all subsequent
-columns, until countermanded by another @code{\extracolsep} command.
-Unlike ordinary intercolumn space, this extra space is not suppressed by
-an @@-expression. An @code{\extracolsep} command can be used only in an
+columns, until countermanded by another @code{\extracolsep}. Unlike
+ordinary intercolumn space, this extra space is not suppressed by an
+@@-expression. An @code{\extracolsep} command can be used only in an
@@-expression in the @code{cols} argument. Below, @LaTeX{} inserts the
right amount of intercolumn space to make the entire table 4 inches
wide.
@example
-\begin@{center@}
- \begin@{tabular*@}@{4in@}@{l@@@{\ \ldots\extracolsep@{\fill@}@}l@}
- Seven times down, eight times up
- &such is life!
- \end@{tabular*@}
-\end@{center@}
+\begin@{tabular*@}@{4in@}@{l@@@{\extracolsep@{\fill@}@}l@}
+ Seven times down, eight times up \ldots
+ &such is life!
+\end@{tabular*@}
@end example
To insert commands that are automatically executed before a given
@@ -5265,25 +6689,36 @@ specifier.
@c xx should fully explain array, tabularx, and all other base packages...
@item p@{@var{wd}@}
-Each item in the column is typeset in a parbox of width @var{wd}.
+Each item in the column is typeset in a parbox of width @var{wd}, as if
+it were the argument of a @code{\parbox[t]@{wd@}@{...@}} command.
-Note that a line break double backslash @code{\\} may not appear in the
-item, except inside an environment like @code{minipage}, @code{array},
-or @code{tabular}, or inside an explicit @code{\parbox}, or in the scope
-of a @code{\centering}, @code{\raggedright}, or @code{\raggedleft}
+A line break double backslash @code{\\} may not appear in the item,
+except inside an environment like @code{minipage}, @code{array}, or
+@code{tabular}, or inside an explicit @code{\parbox}, or in the scope of
+a @code{\centering}, @code{\raggedright}, or @code{\raggedleft}
declaration (when used in a @code{p}-column element these declarations
must appear inside braces, as with @code{@{\centering .. \\
..@}}). Otherwise @LaTeX{} will misinterpret the double backslash as
-ending the row.
+ending the row. Instead, to get a line break in there use
+@code{\newline} (@pxref{\newline}).
@item *@{@var{num}@}@{@var{cols}@}
Equivalent to @var{num} copies of @var{cols}, where @var{num} is a
-positive integer and @var{cols} is a list of specifiers. Thus
-@code{\begin@{tabular@}@{|*@{3@}@{l|r@}|@}} is equivalent to
-@code{\begin@{tabular@}@{|l|rl|rl|r|@}}. Note that @var{cols} may
-contain another @code{*}-expression.
+positive integer and @var{cols} is a list of specifiers. Thus the
+specifier @code{\begin@{tabular@}@{|*@{3@}@{l|r@}|@}} is equivalent to
+the specifier @code{\begin@{tabular@}@{|l|rl|rl|r|@}}. Note that
+@var{cols} may contain another @code{*}-expression.
@end table
+
+@item width
+Required for @code{tabular*}, not allowed for @code{tabular}. Specifies
+the width of the @code{tabular*} environment. The space between columns
+should be rubber, as with @code{@@@{\extracolsep@{\fill@}@}}, to allow
+the table to stretch or shrink to make the specified width, or else you
+are likely to get the @code{Underfull \hbox (badness 10000) in alignment
+...} warning.
+
@end table
Parameters that control formatting:
@@ -5291,21 +6726,25 @@ Parameters that control formatting:
@ftable @code
@item \arrayrulewidth
+@anchor{tabular arrayrulewidth}
A length that is the thickness of the rule created by @code{|},
@code{\hline}, and @code{\vline} in the @code{tabular} and @code{array}
environments. The default is @samp{.4pt}. Change it as in
@code{\setlength@{\arrayrulewidth@}@{0.8pt@}}.
@item \arraystretch
+@anchor{tabular arraystrech}
A factor by which the spacing between rows in the @code{tabular} and
@code{array} environments is multiplied. The default is @samp{1}, for
no scaling. Change it as @code{\renewcommand@{\arraystretch@}@{1.2@}}.
@item \doublerulesep
+@anchor{tabular doublerulesep}
A length that is the distance between the vertical rules produced by the
@code{||} specifier. The default is @samp{2pt}.
@item \tabcolsep
+@anchor{tabular tabcolsep}
A length that is half of the space between columns. The default is
@samp{6pt}. Change it with @code{\setlength}.
@@ -5346,8 +6785,9 @@ spanned by the single heading @samp{Name}.
@example
\begin@{tabular@}@{lccl@}
- \textit@{ID@} &\multicolumn@{2@}@{c@}@{\textit@{Name@}@} &\textit@{Age@} \\ \hline % row one
- 978-0-393-03701-2 &O'Brian &Patrick &55 \\ % row two
+ \textit@{ID@} &\multicolumn@{2@}@{c@}@{\textit@{Name@}@} &\textit@{Age@} \\
+ \hline
+ 978-0-393-03701-2 &O'Brian &Patrick &55 \\
...
\end@{tabular@}
@end example
@@ -5376,6 +6816,7 @@ area before it and after it. This table details the exact behavior.
\end@{tabular@}
@end example
+@noindent
Before the first entry the output will not have a vertical rule because
the @code{\multicolumn} has the @var{cols} specifier @samp{r} with no
initial vertical bar. Between entry one and entry two there will be a
@@ -5413,6 +6854,7 @@ range en-dash.
\end@{tabular@}
@end example
+@noindent
Note that although the @code{tabular} specification by default puts a
vertical rule between the first and second columns, because there is no
vertical bar in the @var{cols} of either of the first row's
@@ -5429,24 +6871,24 @@ used in an @@-expression, although its synonym vertical
bar@tie{}@code{|} is more common. This command is rarely used in the
body of a table; typically a table's vertical lines are specified in
@code{tabular}'s @var{cols} argument and overridden as needed with
-@code{\multicolumn}.
+@code{\multicolumn} (@pxref{tabular}).
-This example illustrates some pitfalls. In the first line's second
+The example below illustrates some pitfalls. In the first row's second
entry the @code{\hfill} moves the @code{\vline} to the left edge of the
cell. But that is different than putting it halfway between the two
-columns, so in that row between the first and second columns there are
-two vertical rules, with the one from the @code{@{c|cc@}} specifier
-coming before the one produced by the @code{\vline\hfill}. In contrast,
-the first line's third entry shows the usual way to put a vertical bar
-between two columns. In the second line, the @code{ghi} is the widest
-entry in its column so in the @code{\vline\hfill} the @code{\hfill} has
-no effect and the vertical line in that entry appears immediately next
-to the @code{g}, with no whitespace.
+columns, so between the first and second columns there are two vertical
+rules, with the one from the @code{@{c|cc@}} specifier coming before the
+one produced by the @code{\vline\hfill}. In contrast, the first row's
+third entry shows the usual way to put a vertical bar between two
+columns. In the second row, the @code{ghi} is the widest entry in its
+column so in the @code{\vline\hfill} the @code{\hfill} has no effect and
+the vertical line in that entry appears immediately next to the
+@code{g}, with no whitespace.
@example
\begin@{tabular@}@{c|cc@}
- x &\vline\hfill y &\multicolumn@{1@}@{|r@}@{z@} \\
- abc &def &\vline\hfill ghi
+ x &\vline\hfill y &\multicolumn@{1@}@{|r@}@{z@} \\ % row 1
+ abc &def &\vline\hfill ghi % row 2
\end@{tabular@}
@end example
@@ -5462,10 +6904,10 @@ Synopsis:
\cline@{@var{i}-@var{j}@}
@end example
-Draw a horizontal rule in an @code{array} or @code{tabular} environment
-beginning in column @var{i} and ending in column @var{j}. The
-dash@tie{}@code{-} must appear in the mandatory argument. To span a
-single column use the number twice.
+In an @code{array} or @code{tabular} environment, draw a horizontal rule
+beginning in column@tie{}@var{i} and ending in column@tie{}@var{j}. The
+dash, @code{-}, must appear in the mandatory argument. To span a single
+column use the number twice, as with @code{\cline@{2-2@}}.
This example puts two horizontal lines between the first and second
rows, one line in the first column only, and the other spanning the
@@ -5485,7 +6927,7 @@ height.
@findex \hline
-Draws a horizontal line the width of the enclosing @code{tabular} or
+Draw a horizontal line the width of the enclosing @code{tabular} or
@code{array} environment. It's most commonly used to draw a line at the
top, bottom, and between the rows of a table.
@@ -5513,44 +6955,59 @@ Synopsis:
@example
\begin@{thebibliography@}@{@var{widest-label}@}
-\bibitem[@var{label}]@{@var{cite_key@}}
-...
+ \bibitem[@var{label}]@{@var{cite_key@}}
+ ...
\end@{thebibliography@}
@end example
-The @code{thebibliography} environment produces a bibliography or
-reference list.
-
-In the @code{article} class, this reference list is labelled
-@samp{References} and the label is stored in macro @code{\refname}; in
-the @code{report} class, it is labelled @samp{Bibliography} and the
-label is stored in macro @code{\bibname}.
+Produce a bibliography or reference list. There are two ways to produce
+bibliographic lists. This environment is suitable when you have only a
+few references and can maintain the list by hand. @xref{Using BibTeX}
+for a more sophisticated approach.
-You can change the label by redefining the command @code{\refname} or
-@code{\bibname}, whichever is applicable depending on the class:
+This shows the environment with two entries.
-@itemize
-@item
-@findex \bibname
-For standard classes whose top level sectioning is @code{\chapter}
-(such as @file{book} and @file{report}), the label is in the macro
-@code{\bibname};
+@example
+This work is based on \cite@{latexdps@}.
+Together they are \cite@{latexdps, texbook@}.
+ ...
+\begin@{thebibliography@}@{9@}
+\bibitem@{latexdps@}
+ Leslie Lamport.
+ \textit@{\LaTeX@{@}: a document preparation system@}.
+ Addison-Wesley, Reading, Massachusetts, 1993.
+\bibitem@{texbook@}
+ Donald Ervin Knuth.
+ \textit@{The \TeX book@}.
+ Addison-Wesley, Reading, Massachusetts, 1983.
+\end@{thebibliography@}
+@end example
-@item
-@findex \refname
-For standard classes whose the top level sectioning is @code{\section}
-(such as @file{article}), the label is in macro @code{\refname}.
-@end itemize
+@noindent
+This styles the first reference as @samp{[1] Leslie ...}, and so that
+@code{\cite@{latexdps@}} produces the matching @samp{... based on [1]}.
+The second @code{\cite} produces @samp{[1, 2]}. You must compile the
+document twice to resolve these references.
+
+The mandatory argument @var{widest-label} is text that, when typeset, is
+as wide as the widest item label produced by the @code{\bibitem}
+commands. The tradition is to use @code{9} for bibliographies with less
+than 10 references, @code{99} for ones with less than 100, etc.
+
+The bibliographic list is headed by a title such as @samp{Bibliography}.
+To change it there are two cases. In the @file{book} and @file{report}
+classes, where the top level sectioning is @code{\chapter} and the
+default title is @samp{Bibliography}, that title is in the macro
+@code{\bibname}. For @file{article}, where the class's top level
+sectioning is @code{\section} and the default is @samp{References}, the
+title is in macro @code{\refname}. Change it by redefining the command,
+as with @code{\renewcommand@{\refname@}@{Cited references@}} after
+@code{\begin@{document@}}.
@PkgIndex{babel}
-Typically it is neither necessary nor desirable to directly redefine
-@code{\refname} or @code{\bibname}; language support packages like
-@file{babel} do this.
-
-The mandatory @var{widest-label} argument is text that, when typeset,
-is as wide as the widest item label produced by the @code{\bibitem}
-commands. It is typically given as @code{9} for bibliographies with
-less than 10 references, @code{99} for ones with less than 100, etc.
+Language support packages such as @file{babel} will automatically
+redefine @code{\refname} or @code{\bibname} to fit the selected
+language.
@menu
* \bibitem:: Specify a bibliography item.
@@ -5568,22 +7025,69 @@ less than 10 references, @code{99} for ones with less than 100, etc.
Synopsis:
@example
+\bibitem@{@var{cite_key}@}
+@end example
+
+@noindent
+or
+
+@example
\bibitem[@var{label}]@{@var{cite_key}@}
@end example
-The @code{\bibitem} command generates an entry labelled by @var{label}.
-If the @var{label} argument is missing, a number is automatically
-generated using the @code{enumi} counter. The @var{cite_key} is a
+Generate an entry labeled by @var{label}. The default is for @LaTeX{} to
+generates a number using the @code{enumi} counter. The @dfn{citation key}
@cindex citation key
-@dfn{citation key} consisting in any sequence of
-letters, numbers, and punctuation symbols not containing a comma.
+@var{cite_key} is a string of
+letters, numbers, and punctuation symbols (but not comma).
+
+@xref{thebibliography} for an example.
-This command writes an entry to the @file{.aux} file containing the
-item's @var{cite_key} and @var{label}. When the @file{.aux} file is
-read by the @code{\begin@{document@}} command, the item's @var{label} is
-associated with @code{cite_key}, causing references to @var{cite_key}
-with a @code{\cite} command (@pxref{\cite}) to produce the associated
-@var{label}.
+The optional @var{label} changes the default label from an integer to the
+given string. With this
+
+@example
+\begin@{thebibliography@}
+\bibitem[Lamport 1993]@{latexdps@}
+ Leslie Lamport.
+ \textit@{\LaTeX@{@}: a document preparation system@}.
+ Addison-Wesley, Reading, Massachusetts, 1993.
+\bibitem@{texbook@}
+ Donald Ervin Knuth.
+ \textit@{The \TeX book@}.
+ Addison-Wesley, Reading, Massachusetts, 1983.
+\end@{thebibliography@}
+@end example
+
+@noindent
+the first entry will be styled as @samp{[Lamport 1993] Leslie ...} (The
+amount of horizontal space that @LaTeX{} leaves for the label depends on
+the @var{widest-label} argument of the @code{thebibliography}
+environment; see @ref{thebibliography}.) Similarly, @code{... based on
+\cite@{latexdps@}} will produce @samp{... based on [Lamport 1994]}.
+
+If you mix @code{\bibitem} entries having a @var{label} with those that
+do not then @LaTeX{} will number the unlabelled ones sequentially. In
+the example above the @code{texbook} entry will appear as @samp{[1]
+Donald ...}, despite that it is the second entry.
+
+If you use the same @var{cite_key} twice then you get @samp{LaTeX
+Warning: There were multiply-defined labels}.
+
+Under the hood, @LaTeX{} remembers the @var{cite_key} and @var{label}
+information because @code{\bibitem} writes it to the auxiliary file
+@file{@var{filename}.aux}. For instance, the above example causes
+@code{\bibcite@{latexdps@}@{Lamport, 1993@}} and
+@code{\bibcite@{texbook@}@{1@}} to appear in that file. The @file{.aux}
+file is read by the @code{\begin@{document@}} command and then the
+information is available for @code{\cite} commands. This explains why
+you need to run @LaTeX{} twice to resolve references: once to write it
+out and once to read it in.
+
+Because of this two-pass algorithm, when you add a @code{\bibitem} or
+change its @var{cite_key} you may get @samp{LaTeX Warning: Label(s) may
+have changed. Rerun to get cross-references right}. Fix it by
+recompiling.
@node \cite
@@ -5594,17 +7098,55 @@ with a @code{\cite} command (@pxref{\cite}) to produce the associated
Synopsis:
@example
+\cite@{@var{keys}@}
+@end example
+
+@noindent
+or
+
+@example
\cite[@var{subcite}]@{@var{keys}@}
@end example
-The @var{keys} argument is a list of one or more citation keys
-(@pxref{\bibitem}), separated by commas. This command generates an
-in-text citation to the references associated with @var{keys} by entries
-in the @file{.aux} file.
+Generate as output a citation to the references associated with
+@var{keys}. The mandatory @var{keys} is a citation key, or a
+comma-separated list of citation keys (@pxref{\bibitem}).
-The text of the optional @var{subcite} argument appears after the
-citation. For example, @code{\cite[p.~314]@{knuth@}} might produce
-@samp{[Knuth, p.@tie{}314]}.
+This
+
+@example
+The ultimate source is \cite@{texbook@}.
+ ...
+\begin@{thebibliography@}
+\bibitem@{texbook@}
+ Donald Ervin Knuth.
+ \textit@{The \TeX book@}.
+ Addison-Wesley, Reading, Massachusetts, 1983.
+\end@{thebibliography@}
+@end example
+
+@noindent
+produces the output @samp{... source is [1]}.
+
+The optional argument @var{subcite} is appended to the citation. For
+example, @code{See 14.3 in \cite[p.~314]@{texbook@}} might produce
+@samp{See 14.3 in [1, p.@tie{}314]}.
+
+If @var{keys} is not in your bibliography information then you get
+@samp{LaTeX Warning: There were undefined references}, and in the output
+the citation shows as a boldface question mark between square brackets.
+There are two possible causes. If you have mistyped something, as in
+@code{\cite@{texbok@}} then you need to correct the spelling. On the
+other hand, if you have just added or modified the bibliographic
+information and so changed the @file{.aux} file (@pxref{\bibitem}) then
+the fix may be to just run @LaTeX{} again.
+
+In addition to what appears in the output, @code{\cite} writes
+information to the auxiliary file @file{@var{filename}.aux}. For
+instance, @code{\cite@{latexdps@}} writes @samp{\citation@{latexdps@}}
+to that file. This information is used by Bib@TeX{} to include in your
+reference list only those works that you have actually cited; see
+@ref{\nocite} also.
@node \nocite
@@ -5618,8 +7160,13 @@ Synopsis:
@code{\nocite@{@var{keys}@}}
@end example
-The @code{\nocite} command produces no text, but writes @var{keys},
-which is a list of one or more citation keys, to the @file{.aux} file.
+Produces no output but writes @var{keys} to the auxiliary file
+@file{@var{doc-filename}.aux}.
+
+The mandatory argument @var{keys} is a comma-separated list of one or
+more citation keys (@pxref{\bibitem}). This information is used by
+Bib@TeX{} to include these works in your reference list even though you
+have not cited them (@pxref{\cite}).
@node Using BibTeX
@@ -5631,45 +7178,69 @@ which is a list of one or more citation keys, to the @file{.aux} file.
@findex \bibliographystyle
@findex \bibliography
-If you use the Bib@TeX{} program by Oren Patashnik (highly
-recommended if you need a bibliography of more than a couple of
-titles) to maintain your bibliography, you don't use the
-@code{thebibliography} environment (@pxref{thebibliography}). Instead,
-you include the lines
+As described in @code{thebibliography} (@pxref{thebibliography}), a
+sophisticated approach to managing bibliographies is provided by the
+Bib@TeX{} program. This is only an introduction; see the full
+documentation on CTAN.
+
+With Bib@TeX{}, you don't use @code{thebibliography}
+(@pxref{thebibliography}). Instead, include these lines.
@example
\bibliographystyle@{@var{bibstyle}@}
-\bibliography@{@var{bibfile1},@var{bibfile2}@}
+\bibliography@{@var{bibfile1}, @var{bibfile2}, ...@}
@end example
-The @code{\bibliographystyle} command does not produce any output of
-its own. Rather, it defines the style in which the bibliography will
-be produced: @var{bibstyle} refers to a file
-@var{bibstyle}@file{.bst}, which defines how your citations will look.
-The standard @var{bibstyle} names distributed with Bib@TeX{} are:
+@noindent
+The @var{bibstyle} refers to a file @file{@var{bibstyle}.bst}, which
+defines how your citations will look. The standard @var{bibstyle}'s
+distributed with Bib@TeX{} are:
@table @code
@item alpha
-Sorted alphabetically. Labels are formed from name of author and year of
-publication.
+Labels are formed from name of author and year of publication.
+The bibliographic items are sorted alphabetically.
@item plain
-Sorted alphabetically. Labels are numeric.
+Labels are integers.
+Sort the bibliographic items alphabetically.
@item unsrt
Like @code{plain}, but entries are in order of citation.
@item abbrv
Like @code{plain}, but more compact labels.
@end table
-In addition, numerous other Bib@TeX{} style files exist tailored to
-the demands of various publications. See
+@noindent Many, many other Bib@TeX{} style files exist,
+tailored to the demands of various publications. See CTAN's listing
@url{http://mirror.ctan.org/biblio/bibtex/contrib}.
The @code{\bibliography} command is what actually produces the
-bibliography. The argument to @code{\bibliography} refers to files
-named @file{@var{bibfile1}.bib}, @file{@var{bibfile2}.bib}, @dots{},
-which should contain your database in
-Bib@TeX{} format. Only the entries referred to via @code{\cite} and
-@code{\nocite} will be listed in the bibliography.
+bibliography. Its argument is a comma-separated list, referring to
+files named @file{@var{bibfile1}.bib}, @file{@var{bibfile2}.bib},
+@dots{} These contain your database in Bib@TeX{} format. This shows a
+typical couple of entries in that format.
+
+@example
+@@book@{texbook,
+ title = @{The @{@{\TeX@}@}book@},
+ author = @{D.E. Knuth@},
+ isbn = @{0201134489@},
+ series = @{Computers \& typesetting@},
+ year = @{1983@},
+ publisher = @{Addison-Wesley@}
+@}
+@@book@{sexbook,
+ author = @{W.H. Masters and V.E. Johnson@},
+ title = @{Human Sexual Response@},
+ year = @{1966@},
+ publisher = @{Bantam Books@}
+@}
+@end example
+
+Only the bibliographic entries referred to via @code{\cite} and
+@code{\nocite} will be listed in the document's bibliography. Thus you
+can keep all your sources together in one file, or a small number of
+files, and rely on Bib@TeX{} to include in this document only those that
+you used.
@node theorem
@@ -5682,14 +7253,34 @@ Synopsis:
@example
\begin@{theorem@}
-@var{theorem-text}
+ @var{theorem body}
\end@{theorem@}
@end example
-The @code{theorem} environment produces ``Theorem @var{n}'' in
-boldface followed by @var{theorem-text}, where the numbering
-possibilities for @var{n} are described under @code{\newtheorem}
-(@pxref{\newtheorem}).
+Produces @samp{Theorem @var{n}} in boldface followed by @var{theorem
+body} in italics. The numbering possibilities for @var{n} are described under
+@code{\newtheorem} (@pxref{\newtheorem}).
+
+@example
+\newtheorem@{lem@}@{Lemma@} % in preamble
+\newtheorem@{thm@}@{Theorem@}
+ ...
+\begin@{lem@} % in document body
+ text of lemma
+\end@{lem@}
+
+The next result follows immediately.
+\begin@{thm@}[Gauss] % put `Gauss' in parens after theorem head
+ text of theorem
+\end@{thm@}
+@end example
+
+@PkgIndex{amsmath}
+@PkgIndex{amsthm}
+Most new documents use the packages @code{amsthm} and @code{amsmath}
+from the American Mathematical Society. Among other things these
+packages include a large number of options for theorem environments,
+such as styling options.
@node titlepage
@@ -5707,14 +7298,11 @@ Synopsis:
\end@{titlepage@}
@end example
-Create a title page, a page with no printed page number or heading. The
-following page will be numbered page one.
+Create a title page, a page with no printed page number or heading and
+with succeeding pages numbered starting with page one.
-To instead produce a standard title page without a @code{titlepage}
-environment you can use @code{\maketitle} (@pxref{\maketitle}).
-
-Notice in this example that all formatting, including vertical spacing,
-is left to the author.
+In this example all formatting, including vertical spacing, is left to
+the author.
@example
\begin@{titlepage@}
@@ -5739,6 +7327,9 @@ is left to the author.
\end@{titlepage@}
@end example
+To instead produce a standard title page without a @code{titlepage}
+environment, use @code{\maketitle} (@pxref{\maketitle}).
+
@node verbatim
@section @code{verbatim}
@@ -5758,19 +7349,48 @@ Synopsis:
\end@{verbatim@}
@end example
-The @code{verbatim} environment is a paragraph-making environment in
-which @LaTeX{} produces exactly what you type in; for instance the
-@code{\} character produces a printed @samp{\}. It turns @LaTeX{}
-into a typewriter with carriage returns and blanks having the same
-effect that they would on a typewriter.
-
-The @code{verbatim} environment uses a monospaced typewriter-like font
+A paragraph-making environment in which @LaTeX{} produces as output
+exactly what you type as input. For instance inside @var{literal-text}
+the backslash@tie{}@code{\} character does not start commands, it
+produces a printed @samp{\}, and carriage returns and blanks are taken
+literally. The output appears in a monospaced typewriter-like font
(@code{\tt}).
+@example
+\begin@{verbatim@}
+Symbol swearing: %&$#?@!.
+\end@{verbatim@}
+@end example
+
+The only restriction on @code{literal-text} is that it cannot include
+the string @code{\end@{verbatim@}}.
+
+@PkgIndex{cprotect}
+You cannot use the verbatim environment in the argument to macros, for
+instance in the argument to a @code{\section}. This is not the same as
+commands being fragile (@pxref{\protect}), instead it just cannot appear
+there. (But the @code{cprotect} package can help with this.)
+
+@PkgIndex{listings}
+@PkgIndex{minted}
+One common use of verbatim input is to typeset computer code. There are
+packages that are an improvement the @code{verbatim} environment. For
+instance, one improvement is to allow the verbatim inclusion of external
+files, or parts of those files. Such packages include @code{listings},
+and @code{minted}.
+
+@PkgIndex{fancyvrb}
+@PkgIndex{verbatimbox}
+A package that provides many more options for verbatim environments is
+@code{fancyvrb}. Another is @code{verbatimbox}.
+
+For a list of all the relevant packages, see CTAN.
+
@menu
* \verb:: The macro form of the @code{verbatim} environment.
@end menu
+
@node \verb
@subsection @code{\verb}
@@ -5780,23 +7400,63 @@ The @code{verbatim} environment uses a monospaced typewriter-like font
Synopsis:
@example
-\verb@var{char}@var{literal-text}@var{char}
-\verb*@var{char}@var{literal-text}@var{char}
+\verb @var{char} @var{literal-text} @var{char}
+\verb* @var{char} @var{literal-text} @var{char}
+@end example
+
+Typeset @var{literal-text} as it is input, including special characters
+and spaces, using the typewriter (@code{\tt}) font.
+
+This example shows two different invocations of @code{\verb}.
+
+@example
+This is \verb!literally! the biggest pumpkin ever.
+And this is the best squash, \verb+literally!+
@end example
-The @code{\verb} command typesets @var{literal-text} as it is input,
-including special characters and spaces, using the typewriter
-(@code{\tt}) font. No spaces are allowed between @code{\verb} or
-@code{\verb*} and the delimiter @var{char}, which begins and ends the
-verbatim text. The delimiter must not appear in @var{literal-text}.
+@noindent
+The first @code{\verb} has its @var{literal-text} surrounded with
+exclamation point, @code{!}. The second instead uses plus, @code{+},
+because the exclamation point is part of @code{literal-text}.
+
+The single-character delimiter @var{char} surrounds
+@var{literal-text}@tie{}--- it must be the same character before and
+after. No spaces come between @code{\verb} or @code{\verb*} and
+@var{char}, or between @var{char} and @var{literal-text}, or between
+@var{literal-text} and the second occurrence of @var{char} (the synopsis
+shows a space only to distinguish one component from the other). The
+delimiter must not appear in @var{literal-text}. The @var{literal-text}
+cannot include a line break.
@cindex visible space
-The @code{*}-form differs only in that spaces are printed with a
-``visible space'' character.
+The @code{*}-form differs only in that spaces are printed with a visible
+space character.
@tex
(Namely, {\tt\char`\ }.)
@end tex
+The output from this will include a character showing the spaces.
+
+@example
+The commands's first argument is \verb*!filename with extension! and ...
+@end example
+
+@PkgIndex{url}
+For typesetting Internet addresses, urls, the package @code{url}
+provides an option that is better than the @code{\verb} command, since
+it allows line breaks.
+
+@PkgIndex{listings}
+@PkgIndex{minted}
+For computer code there are many packages with advantages over
+@code{\verb}. One is @file{listings}, another is @file{minted}.
+
+@PkgIndex{cprotect}
+You cannot use @code{\verb} in the argument to a macro, for instance in
+the argument to a @code{\section}. It is not a question of @code{\verb}
+being fragile (@pxref{\protect}), instead it just cannot appear there.
+(But the @code{cprotect} package can help with this.)
+
@node verse
@section @code{verse}
@@ -5808,20 +7468,42 @@ Synopsis:
@example
\begin@{verse@}
-@var{line1} \\
-@var{line2} \\
-...
+ @var{line1} \\
+ @var{line2} \\
+ ...
\end@{verse@}
@end example
-The @code{verse} environment is designed for poetry, though you may find
-other uses for it.
+An environment for poetry.
+
+Here are two lines from Shakespeare's Romeo and Juliet.
+
+@example
+Then plainly know my heart's dear love is set \\
+On the fair daughter of rich Capulet.
+@end example
@findex \\ @r{for @code{verse}}
-The margins are indented on the left and the right, paragraphs are not
-indented, and the text is not justified. Separate the lines of each
-stanza with @code{\\}, and use one or more blank lines to separate the
-stanzas.
+Separate the lines of each stanza with @code{\\}, and use one or more
+blank lines to separate the stanzas.
+
+@example
+\begin@{verse@}
+\makebox[\linewidth][c]@{\textit@{Shut Not Your Doors@} ---Walt Whitman@}
+ \\[1\baselineskip]
+Shut not your doors to me proud libraries, \\
+For that which was lacking on all your well-fill'd shelves, \\
+\qquad yet needed most, I bring, \\
+Forth from the war emerging, a book I have made, \\
+The words of my book nothing, the drift of it every thing, \\
+A book separate, not link'd with the rest nor felt by the intellect, \\
+But you ye untold latencies will thrill to every page.
+\end@{verse@}
+@end example
+
+@noindent
+The output has margins indented on the left and the right, paragraphs
+are not indented, and the text is not right-justified.
@node Line breaking
@@ -5838,14 +7520,19 @@ produce a printed document, this sequence must be broken into lines
@LaTeX{} usually does the line (and page) breaking in the text body for
you but in some environments you manually force line breaks.
+A common workflow is to get a final version of the document content
+before taking a final pass through and considering line breaks (and page
+breaks). This differs from word processing, where you are formatting
+text as you input it. Putting these off until the end prevents a lot of
+fiddling with breaks that will change anyway.
+
@menu
* \\:: Start a new line.
* \obeycr & \restorecr:: Make each input line start a new output line.
* \newline:: Break the line
* \- (hyphenation):: Insert explicit hyphenation.
-* \discretionary:: Insert explicit hyphenation with control of hyphen character.
-* \fussy:: Be fussy about line breaking.
-* \sloppy:: Be sloppy about line breaking.
+* \discretionary:: Explicit control of the hyphen character.
+* \fussy & \sloppy:: Be more or less particular with line breaking.
* \hyphenation:: Tell @LaTeX{} how to hyphenate a word.
* \linebreak & \nolinebreak:: Forcing & avoiding line breaks.
@end menu
@@ -5858,41 +7545,81 @@ you but in some environments you manually force line breaks.
@cindex new line, starting
@cindex line break, forcing
-Synopsis:
+Synopsis, one of:
@example
+\\
\\[@var{morespace}]
@end example
-or
+@noindent
+or one of:
@example
+\\*
\\*[@var{morespace}]
@end example
-Start a new line. The optional argument @var{morespace} specifies extra
-vertical space to be insert before the next line. This can be a
-negative length. The text before the break is set at its normal length,
-that is, it is not stretched to fill out the line width.
-
-Explicit line breaks in the text body are unusual in @LaTeX{}. In
-particular, to start a new paragraph instead leave a blank line. This
-command is mostly used outside of the main flow of text such as in
-a @code{tabular} or @code{array} environment.
-
-Under ordinary circumstances (e.g., outside of a @code{p@{...@}} column
-in a @code{tabular} environment) the @code{\newline} command is a synonym for
-@code{\\} (@pxref{\newline}).
+End the current line. The optional argument @var{morespace} specifies
+extra vertical space to be inserted before the next line. This is a
+rubber length (@pxref{Lengths}) and can be negative. The text before
+the line break is set at its normal length, that is, it is not stretched
+to fill out the line width. This command is fragile (@pxref{\protect}).
-In addition to starting a new line, the starred form @code{\\*} tells
-@LaTeX{} not to start a new page between the two lines, by issuing a
-@code{\nobreak}.
+The starred form, @code{\\*}, tells @LaTeX{} not to start a new page
+between the two lines, by issuing a @code{\nobreak}.
@example
\title@{My story: \\[0.25in]
a tale of woe@}
@end example
+Explicit line breaks in the main text body are unusual in @LaTeX{}. In
+particular, don't start new paragraphs with @code{\\}. Instead leave a
+blank line between the two paragraphs. And don't put in a sequence of
+@code{\\}'s to make vertical space. Instead use
+@code{\vspace@{@var{length}@}}, or
+@code{\leavevmode\vspace@{@var{length}@}}, or
+@code{\vspace*@{@var{length}@}} if you want the space to not be thrown
+out at the top of a new page (@pxref{\vspace}).
+
+The @code{\\} command is mostly used outside of the main flow of text
+such as in a @code{tabular} or @code{array} environment or in an
+equation environment.
+
+The @code{\\} command is a synonym for @code{\newline}
+(@pxref{\newline}) under ordinary circumstances (an example of an
+exception is the @code{p@{...@}} column in a @code{tabular}
+environment; @pxref{tabular}).
+
+@c credit: David Carlisle https://tex.stackexchange.com/a/82666
+The @code{\\} command is a macro, and its definition changes by context
+so that its definition in normal text, a @code{center} environment, a
+@code{flushleft} environment, and a @code{tabular} are all different.
+In normal text when it forces a linebreak it is essentially a shorthand
+for @code{\newline}. It does not end horizontal mode or end the
+paragraph, it just inserts some glue and penalties so that when the
+paragraph does end a linebreak will occur at that point, with the short
+line padded with white space.
+
+You get @samp{LaTeX Error: There's no line here to end} if you use
+@code{\\} to ask for a new line, rather than to end the current line.
+An example is if you have @code{\begin@{document@}\\} or, more likely,
+something like this.
+
+@example
+\begin@{center@}
+ \begin@{minipage@}@{0.5\textwidth@}
+ \\
+ In that vertical space put your mark.
+ \end@{minipage@}
+\end@{center@}
+@end example
+
+@noindent
+Fix it by replacing the double backslash with something like
+@code{\vspace@{\baselineskip@}}.
+
@node \obeycr & \restorecr
@section @code{\obeycr} & @code{\restorecr}
@@ -5901,12 +7628,48 @@ In addition to starting a new line, the starred form @code{\\*} tells
@findex \restorecr
@cindex new line, output as input
-The @code{\obeycr} command makes a return in the input file
-(@samp{^^M}, internally) the same as @code{\\} (followed by
-@code{\relax}). So each new line in the input will also be a new line
-in the output.
+The @code{\obeycr} command makes a return in the input file (@samp{^^M},
+internally) the same as @code{\\}, followed by @code{\relax}. So each
+new line in the input will also be a new line in the output. The
+@code{\restorecr} command restores normal line-breaking behavior.
-@code{\restorecr} restores normal line-breaking behavior.
+This is not the way to show verbatim text or computer code.
+@xref{verbatim} instead.
+
+With @LaTeX{}'s usual defaults, this
+
+@example
+aaa
+bbb
+
+\obeycr
+ccc
+ddd
+ eee
+
+\restorecr
+fff
+ggg
+
+hhh
+iii
+@end example
+
+@noindent
+produces output like this.
+
+@example
+ aaa bbb
+ ccc
+ddd
+eee
+
+fff ggg
+ hhh iii
+@end example
+
+@noindent
+The indents are paragraph indents.
@node \newline
@@ -5915,14 +7678,18 @@ in the output.
@findex \newline
@cindex new line, starting (paragraph mode)
-In ordinary text this is equivalent to double-backslash (@pxref{\\}); it
-breaks a line, with no stretching of the text before it.
+In ordinary text, this ends a line in a way that does not right-justify
+the line, so the prior text is not stretched. That is, in paragraph mode
+(@pxref{Modes}), the @code{\newline} command is equivalent to
+double-backslash (@pxref{\\}). This command is fragile
+(@pxref{\protect}).
-Inside a @code{tabular} or @code{array} environment, in a column with a
-specifier producing a paragraph box, like typically @code{p@{...@}},
-@code{\newline} will insert a line break inside of the column, that is,
-it does not break the entire row. To break the entire row use @code{\\}
-or its equivalent @code{\tabularnewline}.
+However, the two commands are different inside a @code{tabular} or
+@code{array} environment. In a column with a specifier producing a
+paragraph box such as typically @code{p@{...@}}, @code{\newline} will
+insert a line end inside of the column; that is, it does not break the
+entire tabular row. To break the entire row use @code{\\} or its
+equivalent @code{\tabularnewline}.
This will print @samp{Name:} and @samp{Address:} as two lines in a
single cell of the table.
@@ -5933,6 +7700,7 @@ single cell of the table.
\end@{tabular@}
@end example
+@noindent
The @samp{Date:} will be baseline-aligned with @samp{Name:}.
@@ -5942,15 +7710,41 @@ The @samp{Date:} will be baseline-aligned with @samp{Name:}.
@findex \- @r{(hyphenation)}
@cindex hyphenation, forcing
-The @code{\-} command tells @LaTeX{} that it may hyphenate the word at
-that point. @LaTeX{} is pretty good at hyphenating, and usually finds
-most of the correct hyphenation points, while almost never using an
-incorrect one. The @code{\-} command is used for the exceptional
-cases.
+Tell @LaTeX{} that it may hyphenate the word at that point. When you
+insert @code{\-} commands in a word, the word will only be hyphenated at
+those points and not at any of the hyphenation points that @LaTeX{}
+might otherwise have chosen. This command is robust (@pxref{\protect}).
+
+@LaTeX{} is good at hyphenating and usually finds most of the correct
+hyphenation points, while almost never using an incorrect one. The
+@code{\-} command is for exceptional cases.
+
+For example, @LaTeX{} does not ordinarily hyphenate words containing a
+hyphen. Below, the long and hyphenated word means @LaTeX{} has to put
+in unacceptably large spaces to set the narrow column.
+
+@example
+\begin@{tabular@}@{rp@{1.75in@}@}
+ Isaac Asimov &The strain of
+ anti-intellectualism
+ % an\-ti-in\-tel\-lec\-tu\-al\-ism
+ has been a constant thread winding its way through our
+ political and cultural life, nurtured by
+ the false notion that democracy means that
+ `my ignorance is just as good as your knowledge'.
+\end@{tabular@}
+@end example
+
+@noindent
+Commenting out the third line and uncommenting the fourth makes a much
+better fit.
+
+The @code{\-} command only allows @LaTeX{} to break there, it does not
+require that it break there. You can insist on a split with something
+like @code{Hef-\linebreak feron}. Of course, if you later change the
+text then this forced break may look very odd, so this approach requires
+care.
-When you insert @code{\-} commands in a word, the word will only be
-hyphenated at those points and not at any of the hyphenation points
-that @LaTeX{} might otherwise have chosen.
@node \discretionary
@section @code{\discretionary} (generalized hyphenation point)
@@ -5960,34 +7754,86 @@ that @LaTeX{} might otherwise have chosen.
Synopsis:
@example
-\discretionary@{@var{pre-break-text}@}@{@var{post-break-text}@}@{@var{no-break-text}@}
+\discretionary@{@var{pre-break}@}@{@var{post-break}@}@{@var{no-break}@}
@end example
-@c xxx TODO, complete this node, see LaTeX-fr
+Handle word changes around hyphens. This command is not often used in
+@LaTeX{} documents.
-@node \fussy
-@section @code{\fussy}
+If a line break occurs at the point where @code{\discretionary} appears
+then @TeX{} puts @var{pre-break} at the end of the current line and puts
+@var{post-break} at the start of the next line. If there is no line
+break here then @TeX{} puts @var{no-break}
-@findex \fussy
+In @samp{difficult} the three letters @code{ffi} form a ligature. But
+@TeX{} can nonetheless break between the two f's with this.
-The declaration @code{\fussy} (which is the default) makes @TeX{}
-picky about line breaking. This usually avoids too much space between
-words, at the cost of an occasional overfull box.
+@example
+di\discretionary@{f-@}@{fi@}@{ffi@}cult
+@end example
-This command cancels the effect of a previous @code{\sloppy} command
-(@pxref{\sloppy}).
+Note that users do not have to do this. It is typically handled
+automatically by @TeX{}'s hyphenation algorithm.
-@node \sloppy
-@section @code{\sloppy}
+@node \fussy & \sloppy
+@section @code{\fussy} & @code{\sloppy}
+@findex \fussy
@findex \sloppy
+@cindex line breaks, changing
+
+Declarations to make @TeX{} more picky or less picky about line
+breaking. Declaring @code{\fussy} usually avoids too much space between
+words, at the cost of an occasional overfull box. Conversely,
+@code{\sloppy} avoids overfull boxes while suffering loose interword
+spacing.
+
+The default is @code{\fussy}. Line breaking in a paragraph is
+controlled by whichever declaration is current at the blank line, or
+@code{\par}, or displayed equation ending that paragraph. So to affect
+the line breaks, include that paragraph-ending material in the scope of
+the command.
+
+@menu
+* sloppypar:: Environment version of \sloppy command.
+@end menu
+
+
+@node sloppypar
+@subsection @code{sloppypar}
-The declaration @code{\sloppy} makes @TeX{} less fussy about line
-breaking. This will avoid overfull boxes, at the cost of loose
-interword spacing.
+@findex sloppypar
+@cindex sloppypar environment
-Lasts until a @code{\fussy} command is issued (@pxref{\fussy}).
+Synopsis:
+
+@example
+\begin@{sloppypar@}
+ ... paragraphs ...
+\end@{sloppypar@}
+@end example
+
+Typeset the paragraphs with @code{\sloppy} in effect (@pxref{\fussy &
+\sloppy}). Use this to locally adjust line breaking, to avoid
+@samp{Overfull box} or @samp{Underfull box} errors.
+
+The example is simple.
+
+@example
+\begin@{sloppypar@}
+ Her plan for the morning thus settled, she sat quietly down to her
+ book after breakfast, resolving to remain in the same place and the
+ same employment till the clock struck one; and from habitude very
+ little incommoded by the remarks and ejaculations of Mrs.\ Allen,
+ whose vacancy of mind and incapacity for thinking were such, that
+ as she never talked a great deal, so she could never be entirely
+ silent; and, therefore, while she sat at her work, if she lost her
+ needle or broke her thread, if she heard a carriage in the street,
+ or saw a speck upon her gown, she must observe it aloud, whether
+ there were anyone at leisure to answer her or not.
+\end@{sloppypar@}
+@end example
@node \hyphenation
@@ -5999,20 +7845,22 @@ Lasts until a @code{\fussy} command is issued (@pxref{\fussy}).
Synopsis:
@example
-\hyphenation@{@var{word-one} @var{word-two}@}
+\hyphenation@{@var{word1} ...@}
@end example
-The @code{\hyphenation} command declares allowed hyphenation points
-with a @code{-} character in the given words. The words are separated
-by spaces. @TeX{} will only hyphenate if the word matches exactly, no
-inflections are tried. Multiple @code{\hyphenation} commands
-accumulate. Some examples (the default @TeX{} hyphenation patterns
-misses the hyphenations in these words):
+Declares allowed hyphenation points within the words in the list. The
+words in that list are separated by spaces. Show permitted points for
+hyphenation with a dash character, @code{-}.
+
+Here is an example:
@example
-\hyphenation@{ap-pen-dix col-umns data-base data-bases@}
+\hyphenation@{hat-er il-lit-e-ra-ti tru-th-i-ness@}
@end example
+Use lowercase letters. @TeX{} will only hyphenate if the word matches
+exactly. Multiple @code{\hyphenation} commands accumulate.
+
@node \linebreak & \nolinebreak
@section @code{\linebreak} & @code{\nolinebreak}
@@ -6022,21 +7870,42 @@ misses the hyphenations in these words):
@cindex line breaks, forcing
@cindex line breaks, preventing
-Synopses:
+Synopses, one of:
@example
-\linebreak[@var{priority}]
-\nolinebreak[@var{priority}]
+\linebreak
+\linebreak[@var{zero-to-four}]
@end example
-By default, the @code{\linebreak} (@code{\nolinebreak}) command forces
-(prevents) a line break at the current position. For
-@code{\linebreak}, the spaces in the line are stretched out so that it
-extends to the right margin as usual.
+@noindent
+or one of these.
+
+@example
+\nolinebreak
+\nolinebreak[@var{zero-to-four}]
+@end example
+
+Encourage or discourage a line break. The optional @var{zero-to-four}
+is an integer that allows you to soften the instruction. The default is
+4, so that without the optional argument these commands entirely force
+or prevent the break. But for instance, @code{\nolinebreak[1]} is a
+suggestion that another place may be better. The higher the number, the
+more insistent the request. Both commands are fragile
+(@pxref{\protect}).
+
+Here we tell @LaTeX{} that a good place to put a linebreak is after the
+standard legal text.
+
+@example
+\boilerplatelegal@{@} \linebreak[2]
+We especially encourage applications from members of traditionally
+underrepresented groups.
+@end example
+
+When you issue @code{\linebreak}, the spaces in the line are stretched
+out so that it extends to the right margin. @xref{\\}
+and@tie{}@ref{\newline} to have the spaces not stretched out.
-With the optional argument @var{priority}, you can convert the command
-from a demand to a request. The @var{priority} must be a number from
-0 to@tie{}4. The higher the number, the more insistent the request.
@node Page breaking
@@ -6045,42 +7914,100 @@ from a demand to a request. The @var{priority} must be a number from
@cindex page breaking
@cindex breaking pages
-@LaTeX{} starts new pages asynchronously, when enough material has
-accumulated to fill up a page. Usually this happens automatically,
-but sometimes you may want to influence the breaks.
+Ordinarily @LaTeX{} automatically takes care of breaking output into
+pages with its usual aplomb. But if you are writing commands, or
+tweaking the final version of a document, then you may need to
+understand how to influence its actions.
+
+@c credit: H Vogt https://tex.stackexchange.com/a/115563
+@LaTeX{}'s algorithm for splitting a document into pages is more complex
+than just waiting until there is enough material to fill a page and
+outputting the result. Instead, @LaTeX{} typesets more material than
+would fit on the page and then chooses a break that is optimal in some
+way (it has the smallest badness). An example of the advantage of this
+approach is that if the page has some vertical space that can be
+stretched or shrunk, such as with rubber lengths between paragraphs,
+then @LaTeX{} can use that to avoid widow lines (where a new page starts
+with the last line of a paragraph; @LaTeX{} can squeeze the extra line
+onto the first page) and orphans (where the first line of paragraph is
+at the end of a page; @LaTeX{} can stretch the material of the first
+page so the extra line falls on the second page). Another example is
+where @LaTeX{} uses available vertical shrinkage to fit on a page not
+just the header for a new section but also the first two lines of that
+section.
+
+But @LaTeX{} does not optimize over the entire document's set of page
+breaks. So it can happen that the first page break is great but the
+second one is lousy; to break the current page @LaTeX{} doesn't look as
+far ahead as the next page break. So occasionally you may want to
+influence page breaks while preparing a final version of a document.
+
+@xref{Layout} for more material that is relevant to page breaking.
@menu
-* \cleardoublepage:: Start a new right-hand page.
-* \clearpage:: Start a new page.
-* \newpage:: Start a new page.
-* \enlargethispage:: Enlarge the current page a bit.
-* \pagebreak & \nopagebreak:: Forcing & avoiding page breaks.
+* \clearpage & \cleardoublepage:: Start a new page; eject floats.
+* \newpage:: Start a new page.
+* \enlargethispage:: Enlarge the current page a bit.
+* \pagebreak & \nopagebreak:: Forcing & avoiding page breaks.
@end menu
-@node \cleardoublepage
-@section @code{\cleardoublepage}
+@node \clearpage & \cleardoublepage
+@section @code{\clearpage} & @code{\cleardoublepage}
+@findex \clearpage
+@cindex flushing floats and starting a page
+@cindex starting a new page and clearing floats
@findex \cleardoublepage
@cindex starting on a right-hand page
-The @code{\cleardoublepage} command ends the current page and causes all
-the pending floating figures and tables that have so far appeared in the
-input to be printed. In a two-sided printing style, it also makes the
-next page a right-hand (odd-numbered) page, producing a blank page if
-necessary.
+Synopsis:
+@example
+\clearpage
+@end example
-@node \clearpage
-@section @code{\clearpage}
+@noindent
+or
-@findex \clearpage
-@cindex flushing floats and starting a page
-@cindex starting a new page and clearing floats
+@example
+\cleardoublepage
+@end example
+
+End the current page and output all of the pending floating figures and
+tables (@pxref{Floats}). If there are too many floats to fit on the
+page then @LaTeX{} will put in extra pages containing only floats. In
+two-sided printing, @code{\cleardoublepage} also makes the next page of
+content a right-hand page, an odd-numbered page, if necessary inserting
+a blank page. The @code{\clearpage} command is robust while
+@code{\cleardoublepage} is fragile (@pxref{\protect}).
+
+@LaTeX{}'s page breaks are optimized so ordinarily you only use this
+command in a document body to polish the final version, or inside
+commands.
+
+@c credit: https://www.tex.ac.uk/FAQ-reallyblank.html
+The @code{\cleardoublepage} command will put in a blank page, but it
+will have the running headers and footers. To get a really blank
+page, use this command.
+
+@example
+\let\origdoublepage\cleardoublepage
+\newcommand@{\clearemptydoublepage@}@{%
+ \clearpage
+ @{\pagestyle@{empty@}\origdoublepage@}%
+@}
+@end example
+
+@noindent
+If you want @LaTeX{}'s standard @code{\chapter} command to do this then
+add the line @code{\let\cleardoublepage\clearemptydoublepage}.
+
+The command @code{\newpage} (@pxref{\newpage}) also ends the current
+page, but without clearing pending floats. And, if @LaTeX{} is in
+two-column mode then @code{\newpage} ends the current column while
+@code{\clearpage} and @code{\cleardoublepage} end the current page.
-The @code{\clearpage} command ends the current page and causes all the
-pending floating figures and tables that have so far appeared in the
-input to be printed.
@node \newpage
@@ -6090,8 +8017,41 @@ input to be printed.
@cindex new page, starting
@cindex starting a new page
-The @code{\newpage} command ends the current page, but does not clear
-floats (@pxref{\clearpage}).
+Synopsis:
+
+@example
+\newpage
+@end example
+
+End the current page. This command is robust (@pxref{\protect}).
+
+@LaTeX{}'s page breaks are optimized so ordinarily you only use this
+command in a document body to polish the final version, or inside
+commands.
+
+While the commands @code{\clearpage} and @code{\cleardoublepage} also
+end the current page, in addition they clear pending floats
+(@pxref{\clearpage & \cleardoublepage}). And, if @LaTeX{} is in
+two-column mode then @code{\clearpage} and @code{\cleardoublepage} end
+the current page, possibly leaving an empty column, while
+@code{\newpage} only ends the current column.
+
+In contrast with @code{\pagebreak} (@pxref{\pagebreak & \nopagebreak}),
+the @code{\newpage} command will cause the new page to start right where
+requested. This
+
+@example
+Four score and seven years ago our fathers brought forth on this
+continent,
+\newpage
+\noindent a new nation, conceived in Liberty, and dedicated to the
+proposition that all men are created equal.
+@end example
+
+@noindent
+makes a new page start after @samp{continent,} and the cut-off line is
+not right justified. In addition, @code{\newpage} does not vertically
+stretch out the page, as @code{\pagebreak} does.
@node \enlargethispage
@@ -6100,17 +8060,31 @@ floats (@pxref{\clearpage}).
@findex \enlargethispage
@cindex enlarge current page
-@code{\enlargethispage@{size@}}
+Synopsis, one of:
+
+@example
+\enlargethispage@{size@}
+\enlargethispage*@{size@}
+@end example
+
+Enlarge the @code{\textheight} for the current page. The required
+argument @var{size} must be a rigid length (@pxref{Lengths}). It may be
+positive or negative. This command is fragile (@pxref{\protect}).
-@code{\enlargethispage*@{size@}}
+A common strategy is to wait until you have the final text of a
+document, and then pass through it tweaking line and page breaks. This
+command allows you some page size leeway.
-Enlarge the @code{\textheight} for the current page by the specified
-amount; e.g., @code{\enlargethispage@{\baselineskip@}} will allow one
-additional line.
+This will allow one extra line on the current page.
-The starred form tries to squeeze the material together on the page as
-much as possible. This is normally used together with an explicit
-@code{\pagebreak}.
+@example
+\enlargethispage@{\baselineskip@}
+@end example
+
+The starred form @code{\enlargesthispage*} tries to squeeze the material
+together on the page as much as possible, for the common use case of
+getting one more line on the page. This is often used together with an
+explicit @code{\pagebreak}.
@node \pagebreak & \nopagebreak
@@ -6124,19 +8098,50 @@ much as possible. This is normally used together with an explicit
Synopses:
@example
-\pagebreak[@var{priority}]
-\nopagebreak[@var{priority}]
+\pagebreak
+\pagebreak[@var{zero-to-four}]
@end example
-By default, the @code{\pagebreak} (@code{\nopagebreak}) command forces
-(prevents) a page break at the current position. With
-@code{\pagebreak}, the vertical space on the page is stretched out
-where possible so that it extends to the normal bottom margin.
+@noindent
+or
-With the optional argument @var{priority}, you can convert the
-@code{\pagebreak} command from a demand to a request. The number must
-be a number from 0 to@tie{}4. The higher the number, the more
-insistent the request is.
+@example
+\nopagebreak
+\nopagebreak[@var{zero-to-four}]
+@end example
+
+Encourage or discourage a page break. The optional @var{zero-to-four}
+is an integer that allows you to soften the request. The default is 4,
+so that without the optional argument these commands entirely force or
+prevent the break. But for instance @code{\nopagebreak[1]} suggests to
+@LaTeX{} that another spot might be preferable. The higher the number,
+the more insistent the request. Both commands are fragile
+(@pxref{\protect}).
+
+@LaTeX{}'s page endings are optimized so ordinarily you only use this
+command in a document body to polish the final version, or inside
+commands.
+
+If you use these inside a paragraph, they apply to the point following
+the line in which they appear. So this
+
+@example
+Four score and seven years ago our fathers brought forth on this
+continent,
+\pagebreak
+a new nation, conceived in Liberty, and dedicated to the proposition
+that all men are created equal.
+@end example
+
+@noindent
+does not give a page break at @samp{continent,} but instead at
+@samp{nation,} since that is where @LaTeX{} breaks that line. In
+addition, with @code{\pagebreak} the vertical space on the page is
+stretched out where possible so that it extends to the normal bottom
+margin. This can look strange, and if @code{\flushbottom} is in effect
+this can cause you to get @samp{Underfull \vbox (badness 10000) has
+occurred while \output is active}. @xref{\newpage} for a command that
+does not have these effects.
@node Footnotes
@@ -6144,33 +8149,32 @@ insistent the request is.
@cindex footnotes, creating
-Place a numbered footnote at the bottom of the current page, as here.
+Place a footnote at the bottom of the current page, as here.
@example
No@"{e}l Coward quipped that having to read a footnote is like having
to go downstairs to answer the door, while in the midst of making
-love.\footnote@{I wouldn't know, I don't read footnotes.@}
+love.\footnote@{%
+ I wouldn't know, I don't read footnotes.@}
@end example
-You can place multiple footnotes on a page. If the text becomes too long
-it will flow to the next page.
+You can put multiple footnotes on a page. If the footnote text becomes
+too long then it will flow to the next page.
You can also produce footnotes by combining the @code{\footnotemark} and
the @code{\footnotetext} commands, which is useful in special
circumstances.
To make bibliographic references come out as footnotes you need to
-include a bibliographic style with that behavior.
+include a bibliographic style with that behavior (@pxref{Using BibTeX}).
@menu
* \footnote:: Insert a footnote.
* \footnotemark:: Insert footnote mark only.
* \footnotetext:: Insert footnote text only.
-* Footnotes in a table:: Table footnotes.
* Footnotes in section headings:: Chapter or section titles.
+* Footnotes in a table:: Table footnotes.
* Footnotes of footnotes:: Multiple classes of footnotes.
-* Multiple reference to footnotes:: Referring to a footnote more than once.
-* Footnote parameters:: Parameters for footnote formatting.
@end menu
@@ -6179,51 +8183,87 @@ include a bibliographic style with that behavior.
@findex \footnote
-Synopsis:
+Synopsis, one of:
@example
+\footnote@{@var{text}@}
\footnote[@var{number}]@{@var{text}@}
@end example
-Place a numbered footnote @var{text} at the bottom of the current page.
+Place a footnote @var{text} at the bottom of the current page.
@example
There are over a thousand footnotes in Gibbon's
-\textit@{Decline and Fall of the Roman Empire@}.\footnote@{After
-reading an early version with endnotes David Hume complained,
-``One is also plagued with his Notes, according to the present Method
-of printing the Book'' and suggested that they ``only to be printed
-at the Margin or the Bottom of the Page.''@}
+\textit@{Decline and Fall of the Roman Empire@}.\footnote@{%
+ After reading an early version with endnotes David Hume complained,
+ ``One is also plagued with his Notes, according to the present Method
+ of printing the Book'' and suggested that they ``only to be printed
+ at the Margin or the Bottom of the Page.''@}
@end example
-The optional argument @var{number} allows you to specify the footnote
-number. If you use this option then the footnote number counter is not
-incremented, and if you do not use it then the counter is incremented.
+The optional argument @var{number} allows you to specify the number of
+the footnote. If you use this then @LaTeX{} does not increment the
+@code{footnote} counter.
@cindex footnotes, symbols instead of numbers
@findex \fnsymbol@r{, and footnotes}
@findex \@@fnsymbol
-Change how @LaTeX{} shows the footnote counter with something like
+By default, @LaTeX{} uses arabic numbers as footnote markers. Change
+this with something like
@code{\renewcommand@{\thefootnote@}@{\fnsymbol@{footnote@}@}}, which
uses a sequence of symbols (@pxref{\alph \Alph \arabic \roman \Roman
\fnsymbol}). To make this change global put that in the preamble. If
you make the change local then you may want to reset the counter with
-@code{\setcounter@{footnote@}@{0@}}. By default @LaTeX{} uses arabic
-numbers.
+@code{\setcounter@{footnote@}@{0@}}.
+
+@LaTeX{} determines the spacing of footnotes with two parameters.
+
+@cindex footnote parameters
+@cindex parameters, for footnotes
+
+@ftable @code
+@item \footnoterule
+@anchor{footnote footnoterule}
+Produces the rule separating the main text on a page from the page's
+footnotes. Default dimensions in the standard document classes (except
+@code{slides}, where it does not appear) is: vertical thickness of
+@code{0.4pt}, and horizontal size of @code{0.4\columnwidth} long.
+Change the rule with something like this.
+
+@c Credit egreg: https://tex.stackexchange.com/a/21917
+@example
+\renewcommand@{\footnoterule@}@{% Kerns avoid vertical space
+ \kern -3pt % This -3 is negative
+ \hrule width \textwidth height 1pt % of the sum of this 1
+ \kern 2pt@} % and this 2
+@end example
+
+@item \footnotesep
+@anchor{footnote footnotesep}
+The height of the strut placed at the beginning of the footnote
+(@pxref{\strut}). By default, this is set to the normal strut for
+@code{\footnotesize} fonts (@pxref{Font sizes}), therefore there is no
+extra space between footnotes. This is @samp{6.65pt} for @samp{10pt},
+@samp{7.7pt} for @samp{11pt}, and @samp{8.4pt} for @samp{12pt}. Change
+it as with @code{\setlength@{\footnotesep@}@{11pt@}}.
+
+@end ftable
+
+The @code{\footnote} command is fragile (@pxref{\protect}).
@LaTeX{}'s default puts many restrictions on where you can use a
@code{\footnote}; for instance, you cannot use it in an argument to a
sectioning command such as @code{\chapter} (it can only be used in outer
-paragraph mode). There are some workarounds; see following sections.
-@c xx mention packages that fix this
+paragraph mode; @pxref{Modes}). There are some workarounds; see
+following sections.
@cindex Footnotes, in a minipage
@cindex mpfootnote counter
-In a @code{minipage} environment the @code{\footnote}
-command uses the @code{mpfootnote} counter instead of the
-@code{footnote} counter, so they are numbered independently. They are
-shown at the bottom of the environment, not at the bottom of the page.
-And by default they are shown alphabetically. @xref{minipage}.
+In a @code{minipage} environment the @code{\footnote} command uses the
+@code{mpfootnote} counter instead of the @code{footnote} counter, so
+they are numbered independently. They are shown at the bottom of the
+environment, not at the bottom of the page. And by default they are
+shown alphabetically. @xref{minipage} and @ref{Footnotes in a table}.
@node \footnotemark
@@ -6238,14 +8278,27 @@ Synopsis, one of:
\footnotemark[@var{number}]
@end example
-Put the current footnote number in the
-text. (See@tie{}@ref{\footnotetext} for giving the text of the footnote
-separately.) The version with the optional argument @var{number} uses
-that number to determine the mark printed. This command can be used in
-inner paragraph mode.
+Put the current footnote mark in the text. To specify associated text
+for the footnote see@tie{}@ref{\footnotetext}. The optional argument
+@var{number} causes the command to use that number to determine the
+footnote mark. This command can be used in inner paragraph mode
+(@pxref{Modes}).
-This example gives the same institutional affiliation to both the first
-and third authors (@code{\thanks} is a version of @code{footnote}).
+If you use @code{\footnotemark} without the optional argument then it
+increments the footnote counter but if you use the optional @var{number}
+then it does not. The next example produces several consecutive footnote
+markers referring to the same footnote.
+
+@example
+The first theorem\footnote@{Due to Gauss.@}
+and the second theorem\footnotemark[\value@{footnote@}]
+and the third theorem.\footnotemark[\value@{footnote@}]
+@end example
+
+If there are intervening footnotes then you must remember the value of the
+common mark. This example gives the same institutional affiliation to
+both the first and third authors (@code{\thanks} is a version of
+@code{footnote}), by-hand giving the number of the footnote.
@example
\title@{A Treatise on the Binomial Theorem@}
@@ -6256,17 +8309,36 @@ and third authors (@code{\thanks} is a version of @code{footnote}).
\maketitle
@end example
-If you use @code{\footnotemark} without the optional argument then it
-increments the footnote counter but if you use the optional @var{number}
-then it does not. This produces several consecutive footnote markers
-referring to the same footnote.
+This uses a counter to remember the footnote number. The third sentence
+is followed by the same footnote marker as the first.
@example
-The first theorem\footnote@{Due to Gauss.@}
-and the second theorem\footnotemark[\value@{footnote@}]
-and the third theorem.\footnotemark[\value@{footnote@}]
+\newcounter@{footnoteValueSaver@}
+All babies are illogical.\footnote@{%
+ Lewis Carroll.@}\setcounter@{footnoteValueSaver@}@{\value@{footnote@}@}
+Nobody is despised who can manage a crocodile.\footnote@{%
+ Captain Hook.@}
+Illogical persons are despised.\footnotemark[\value@{footnoteValueSaver@}]
+Therefore, anyone who can manage a crocodile is not a baby.
@end example
+@PkgIndex{cleveref}
+@PkgIndex{hyperref}
+This example accomplishes the same by using the package @file{cleveref}.
+
+@c from SE user Jake http://tex.stackexchange.com/a/10116/339
+@example
+\usepackage@{cleveref@}[2012/02/15] % in preamble
+\crefformat@{footnote@}@{#2\footnotemark[#1]#3@}
+...
+The theorem is from Evers.\footnote@{\label@{fn:TE@}Tinker, Evers, 1994.@}
+The corollary is from Chance.\footnote@{Evers, Chance, 1990.@}
+But the key lemma is from Tinker.\cref@{fn:TE@}
+@end example
+
+@PkgIndex{hyperref}
+It will work with the package @file{hyperref}.
+
@node \footnotetext
@section @code{\footnotetext}
@@ -6280,166 +8352,146 @@ Synopsis, one of:
\footnotetext[@var{number}]@{@var{text}@}
@end example
-Place @var{text} at the bottom of the page as a footnote. This command
-can come anywhere after the @code{\footnotemark} command. The optional
-argument @var{number} changes the displayed footnote number. The
-@code{\footnotetext} command must appear in outer paragraph mode.
+Place @var{text} at the bottom of the page as a footnote. It pairs with
+@code{\footnotemark} (@pxref{\footnotemark}) and can come anywhere after
+that command, but must appear in outer paragraph mode (@pxref{Modes}).
+The optional argument @var{number} changes the number of the footnote
+mark.
+
+@xref{\footnotemark} and@tie{}@ref{Footnotes in a table} for usage
+examples.
+
+
+@node Footnotes in section headings
+@section Footnotes in section headings
+
+@cindex footnote, in section headings
+@cindex table of contents, avoiding footnotes
+
+Putting a footnote in a section heading, as in:
+
+@example
+\section@{Full sets\protect\footnote@{This material due to ...@}@}
+@end example
+
+@noindent
+causes the footnote to appear at the bottom of the page where the
+section starts, as usual, but also at the bottom of the table of
+contents, where it is not likely to be desired. The simplest way
+to have it not appear on the table of contents is to use the optional
+argument to @code{\section}
+
+@example
+\section[Please]@{Please\footnote@{%
+ Don't footnote in chapter and section headers!@}@}
+@end example
+
+@noindent
+No @code{\protect} is needed in front of @code{\footnote} here because
+what gets moved to the table of contents is the optional argument.
@node Footnotes in a table
@section Footnotes in a table
-@cindex Footnotes, in a table
+@cindex footnote, in a table
-Inside a @code{table} environment the @code{\footnote} command does not
-work. For instance, if the code below appears on its own then the
-footnote simply disappears; there is a footnote mark in the table cell
-but nothing is set at the bottom of the page.
+Inside a @code{tabular} or @code{array} environment the @code{\footnote}
+command does not work; there is a footnote mark in the table cell but
+the footnote text does not appear. The solution is to use a
+@code{minipage} environment as here (@pxref{minipage}).
@example
\begin@{center@}
+ \begin@{minipage@}@{\textwidth@} \centering
\begin@{tabular@}@{l|l@}
- \textsc@{Ship@} &\textsc@{Book@} \\ \hline
- \textit@{HMS Sophie@} &Master and Commander \\
- \textit@{HMS Polychrest@} &Post Captain \\
- \textit@{HMS Lively@} &Post Captain \\
- \textit@{HMS Surprise@} &A number of books\footnote@{Starting with
- HMS Surprise.@}
+ \textsc@{Ship@} &\textsc@{Book@} \\ \hline
+ \textit@{HMS Sophie@} &Master and Commander \\
+ \textit@{HMS Polychrest@} &Post Captain \\
+ \textit@{HMS Lively@} &Post Captain \\
+ \textit@{HMS Surprise@} &A number of books\footnote@{%
+ Starting with HMS Surprise.@}
\end@{tabular@}
+ \end@{minipage@}
\end@{center@}
@end example
-The solution is to surround the @code{tabular} environment with a
-@code{minipage} environment, as here (@pxref{minipage}).
+Inside a @code{minipage}, footnote marks are lowercase letters. Change
+that with something like
+@code{\renewcommand@{\thempfootnote@}@{\arabic@{mpfootnote@}@}}
+(@pxref{\alph \Alph \arabic \roman \Roman \fnsymbol}).
+
+The footnotes in the prior example appear at the bottom of the
+@code{minipage}. To have them appear at the bottom of the main page, as
+part of the regular footnote sequence, use the @code{\footnotemark} and
+@code{\footnotetext} pair and make a new counter.
@example
+\newcounter@{mpFootnoteValueSaver@}
\begin@{center@}
- \begin@{minipage@}@{.5\textwidth@}
- ... tabular material ...
- \end@{minipage@}
+ \begin@{minipage@}@{\textwidth@}
+ \setcounter@{mpFootnoteValueSaver@}@{\value@{footnote@}@} \centering
+ \begin@{tabular@}@{l|l@}
+ \textsc@{Woman@} &\textsc@{Relationship@} \\ \hline
+ Mona &Attached\footnotemark \\
+ Diana Villiers &Eventual wife \\
+ Christine Hatherleigh Wood &Fiance\footnotemark
+ \end@{tabular@}
+ \end@{minipage@}% percent sign keeps footnote text close to minipage
+ \stepcounter@{mpFootnoteValueSaver@}%
+ \footnotetext[\value@{mpFootnoteValueSaver@}]@{%
+ Little is known other than her death.@}%
+ \stepcounter@{mpFootnoteValueSaver@}%
+ \footnotetext[\value@{mpFootnoteValueSaver@}]@{%
+ Relationship is unresolved in XXI.@}
\end@{center@}
@end example
-The same technique will work inside a floating @code{table} environment
-(@pxref{table}). To get the footnote at the bottom of the page use the
-@file{tablefootnote} package, as illustrated in this example. If you
-put @code{\usepackage@{tablefootnote@}} in the preamble and use the code
-shown then the footnote appears at the bottom and is numbered in
-sequence with other footnotes.
+For a floating @code{table} environment (@pxref{table}), use the
+@file{tablefootnote} package.
@example
+\usepackage@{tablefootnote@} % in preamble
+ ...
\begin@{table@}
\centering
\begin@{tabular@}@{l|l@}
\textsc@{Date@} &\textsc@{Campaign@} \\ \hline
1862 &Fort Donelson \\
1863 &Vicksburg \\
- 1865 &Army of Northern Virginia\footnote@{Ending the war.@}
+ 1865 &Army of Northern Virginia\tablefootnote@{%
+ Ending the war.@}
\end@{tabular@}
\caption@{Forces captured by US Grant@}
\end@{table@}
@end example
-
-@node Footnotes in section headings
-@section Footnotes in section headings
-
-@cindex footnotes, in section headings
-@cindex table of contents, avoiding footnotes
-Putting a footnote in a section heading, as in:
-
-@example
-\section@{Full sets\protect\footnote@{This material due to ...@}@}
-@end example
-
-@PkgIndex{footmisc}
-@cindex @code{stable} option to @code{footmisc} package
@noindent
-causes the footnote to appear at the bottom of the page where the
-section starts, as usual, but also at the bottom of the table of
-contents, where it is not likely to be desired. To have it not appear
-on the table of contents use the package @file{footmisc} with the
-@code{stable} option.
-
-@example
-\usepackage[stable]@{footmisc@}
-...
-\begin@{document@}
-...
-\section@{Full sets\footnote@{This material due to ...@}@}
-@end example
-
-Note that the @code{\protect} is gone; including it would cause the
-footnote to reappear on the table of contents.
+The footnote appears at the page bottom and is numbered in sequence with
+other footnotes.
@node Footnotes of footnotes
@section Footnotes of footnotes
+@cindex footnote, of a footnote
+
+@PkgIndex{bigfoot}
Particularly in the humanities, authors can have multiple classes of
footnotes, including having footnotes of footnotes. The package
@file{bigfoot} extends @LaTeX{}'s default footnote mechanism in many
ways, including allow these two, as in this example.
@example
-\usepackage@{bigfoot@}
+\usepackage@{bigfoot@} % in preamble
\DeclareNewFootnote@{Default@}
\DeclareNewFootnote@{from@}[alph] % create class \footnotefrom@{@}
...
-\begin@{document@}
-...
The third theorem is a partial converse of the
-second.\footnotefrom@{First noted in Wilson.\footnote@{Second edition only.@}@}
-...
-@end example
-
-
-@node Multiple reference to footnotes
-@section Multiple references to footnotes
-
-You can refer to a single footnote more than once. This example
-uses the package @file{cleverref}.
-
-@c from SE user Jake http://tex.stackexchange.com/a/10116/339
-@example
-\usepackage@{cleveref@}[2012/02/15] % this version of package or later
-\crefformat@{footnote@}@{#2\footnotemark[#1]#3@}
-...
-\begin@{document@}
-...
-The theorem is from Evers.\footnote@{\label@{fn:TE@}Tinker and Evers, 1994.@}
-The corollary is from Chance.\footnote@{Evers and Chance, 1990.@}
-But the key lemma is from Tinker.\cref@{fn:TE@}
-...
+second.\footnotefrom@{%
+ First noted in Wilson.\footnote@{Second edition only.@}@}
@end example
-This solution will work with the package @file{hyperref}.
-See@tie{}@ref{\footnotemark} for a simpler solution in the common case
-of multiple authors with the same affiliation.
-
-
-@node Footnote parameters
-@section Footnote parameters
-
-@cindex footnote parameters
-@cindex parameters, for footnotes
-
-@ftable @code
-@item \footnoterule
-Produces the rule separating the main text on a page from the page's
-footnotes. Default dimensions: @code{0.4pt} thick (or wide), and
-@code{0.4\columnwidth} long in the standard document classes (except
-@code{slides}, where it does not appear).
-
-@item \footnotesep
-The height of the strut placed at the beginning of the footnote. By
-default, this is set to the normal strut for @code{\footnotesize}
-fonts (@pxref{Font sizes}), therefore there is no extra space between
-footnotes. This is @samp{6.65pt} for @samp{10pt}, @samp{7.7pt} for
-@samp{11pt}, and @samp{8.4pt} for @samp{12pt}.
-
-@end ftable
-
@node Definitions
@chapter Definitions
@@ -6448,9 +8500,6 @@ footnotes. This is @samp{6.65pt} for @samp{10pt}, @samp{7.7pt} for
@LaTeX{} has support for making new commands of many different kinds.
-@c xx everything in this chapter needs examples.
-@c xx Add DeclareRobustCommand (see clsguide.pdf)
-
@menu
* \newcommand & \renewcommand:: (Re)define a new command.
* \providecommand:: Define a new command, if name not used.
@@ -6474,111 +8523,155 @@ footnotes. This is @samp{6.65pt} for @samp{10pt}, @samp{7.7pt} for
@cindex defining a new command
@cindex new commands, defining
-@code{\newcommand} and @code{\renewcommand} define and redefine a
-command, respectively. Synopses:
+Synopses, one of:
+
+@example
+\newcommand@{\@var{cmd}@}@{@var{defn}@}
+\newcommand@{\@var{cmd}@}[@var{nargs}]@{@var{defn}@}
+\newcommand@{\@var{cmd}@}[@var{nargs}][@var{optargdefault}]@{@var{defn}@}
+\newcommand*@{\@var{cmd}@}@{@var{defn}@}
+\newcommand*@{\@var{cmd}@}[@var{nargs}]@{@var{defn}@}
+\newcommand*@{\@var{cmd}@}[@var{nargs}][@var{optargdefault}]@{@var{defn}@}
+@end example
+
+@noindent
+or one of these.
@example
- \newcommand@{\@var{cmd}@}[@var{nargs}][@var{optargdefault}]@{@var{defn}@}
- \newcommand*@{\@var{cmd}@}[@var{nargs}][@var{optargdefault}]@{@var{defn}@}
+\renewcommand@{\@var{cmd}@}[@var{nargs}]@{@var{defn}@}
+\renewcommand@{\@var{cmd}@}[@var{nargs}]@{@var{defn}@}
\renewcommand@{\@var{cmd}@}[@var{nargs}][@var{optargdefault}]@{@var{defn}@}
+\renewcommand*@{\@var{cmd}@}@{@var{defn}@}
+\renewcommand*@{\@var{cmd}@}[@var{nargs}]@{@var{defn}@}
\renewcommand*@{\@var{cmd}@}[@var{nargs}][@var{optargdefault}]@{@var{defn}@}
@end example
+Define or redefine a command. See also the discussion of
+@code{\DeclareRobustCommand} in @ref{Class and package commands}.
@cindex starred form, defining new commands
@cindex *-form, defining new commands
-The starred form of these two commands requires that the arguments not
-contain multiple paragraphs of text (not @code{\long}, in plain @TeX{}
-terms).
+The starred form of these two requires that the arguments not contain
+multiple paragraphs of text (in plain @TeX{} terms that it not be
+@code{\long}).
+
+These are the parameters:
@table @var
@item cmd
-Required; @code{\@var{cmd}} is the command name. For @code{\newcommand}, it
-must not be already defined and must not begin with @code{\end}. For
-@code{\renewcommand}, it must already be defined.
+
+Required; the command name. It must begin with a backslash, @code{\},
+and must not begin with the four letter string @code{\end}. For
+@code{\newcommand}, it must not be already defined. For
+@code{\renewcommand}, this name must already be defined.
@item nargs
Optional; an integer from 0 to 9, specifying the number of arguments
-that the command can take, including any optional argument. If this
-argument is not present, the default is for the command to have no
-arguments. When redefining a command, the new version can have a
+that the command takes, including any optional argument. Omitting this
+argument is the same as specifying 0, meaning that the command has no
+arguments. If you redefine a command, the new version can have a
different number of arguments than the old version.
@item optargdefault
-Optional; if this argument is present then the first argument of defined
-command @code{\@var{cmd}} is optional, with default value @var{optargdefault}
+Optional; if this argument is present then the first argument of
+@code{\@var{cmd}} is optional, with default value @var{optargdefault}
(which may be the empty string). If this argument is not present then
@code{\@var{cmd}} does not take an optional argument.
@cindex positional parameter
-That is, if @code{\@var{cmd}} is used with square brackets following,
-as in @code{\@var{cmd}[@var{myval}]}, then within @var{defn} the first
-@dfn{positional parameter} @code{#1} expands @var{myval}. On the
-other hand, if @code{\@var{cmd}} is called without square brackets
-following, then within @var{defn} the positional parameter @code{#1}
-expands to the default @var{optargdefault}. In either case, any
-required arguments will be referred to starting with @code{#2}.
-
-Omitting @code{[@var{myval}]} in a call is different from having the
-square brackets with no contents, as in @code{[]}. The former results
-in @code{#1} expanding to @var{optargdefault}; the latter results in
-@code{#1} expanding to the empty string.
+That is, if @code{\@var{cmd}} is used with square brackets, as in
+@code{\@var{cmd}[@var{optval}]@{...@}...}, then within @var{defn} the
+parameter@tie{}@code{#1} is set to the value of @var{optval}. On the
+other hand, if @code{\@var{cmd}} is called without the square brackets
+then within @var{defn} the parameter @code{#1} is set to the value of
+@var{optargdefault}. In either case, the required arguments start with
+@code{#2}.
+
+Omitting @code{[@var{optargdefault}]} is different from having the
+square brackets with no contents, as in @code{[]}. The former sets
+@code{#1} to the value of @var{optargdefault}; the latter sets @code{#1}
+to the empty string.
@item defn
-The text to be substituted for every occurrence of @code{\@var{cmd}}; the
-positional parameter @code{#@var{n}} in @var{defn} is replaced by
-the text of the @var{n}th argument.
+Required; the text to be substituted for every occurrence of
+@code{\@var{cmd}}. The parameters @code{#1}, @code{#2},
+... @code{#@var{nargs}} are replaced by the values that you supply when
+you call the command (or by the default value if there is an optional
+argument and you don't exercise the option).
@end table
@TeX{} ignores spaces in the source following an alphabetic control
sequence, as in @samp{\cmd }. If you actually want a space there, one
-solution is to type @code{@{@}} after the command (@samp{\cmd@{@} };
+solution is to type @code{@{@}} after the command (@samp{\cmd@{@} }, and
another solution is to use an explicit control space (@samp{\cmd\ }).
A simple example of defining a new command:
-@code{\newcommand@{\RS@}@{Robin Smith@}} results in
-@code{\RS} being replaced by the longer text.
-
-Redefining an existing command is similar:
+@code{\newcommand@{\RS@}@{Robin Smith@}} results in @code{\RS} being
+replaced by the longer text. Redefining an existing command is similar:
@code{\renewcommand@{\qedsymbol@}@{@{\small QED@}@}}.
-Here's a command definition with one required argument:
+If you try to define a command and the name has already been used then
+you get something like @samp{LaTeX Error: Command \fred already
+defined. Or name \end... illegal, see p.192 of the manual}. If you try
+to redefine a command and the name has not yet been used then you get
+something like @samp{LaTeX Error: \hank undefined}.
+
+Here the first command definition has no arguments, and the second has
+one required argument.
@example
+\newcommand@{\student@}@{Ms~O'Leary@}
\newcommand@{\defref@}[1]@{Definition~\ref@{#1@}@}
@end example
-@noindent Then, @code{\defref@{def:basis@}} expands to
-@code{Definition~\ref@{def:basis@}}, which will ultimately expand to
+@noindent
+Use the first as in @code{I highly recommend \student@{@} to you}. The
+second has a variable, so that @code{\defref@{def:basis@}} expands to
+@code{Definition~\ref@{def:basis@}}, which ultimately expands to
something like @samp{Definition~3.14}.
-An example with two required arguments:
+Similarly, but with two required arguments:
@code{\newcommand@{\nbym@}[2]@{$#1 \times #2$@}} is invoked as
@code{\nbym@{2@}@{k@}}.
-An example with an optional argument:
+This example has an optional argument.
@example
\newcommand@{\salutation@}[1][Sir or Madam]@{Dear #1:@}
@end example
-@noindent Then, @code{\salutation} gives @samp{Dear Sir or Madam:} while
+@noindent
+Then @code{\salutation} gives @samp{Dear Sir or Madam:} while
@code{\salutation[John]} gives @samp{Dear John:}. And
@code{\salutation[]} gives @samp{Dear :}.
-The braces around @var{defn} do not define a group, that is, they do
-not delimit the scope of the result of expanding @var{defn}. So
-@code{\newcommand@{\shipname@}[1]@{\it #1@}} is problematic; in this
-sentence,
+This example has an optional argument and two required arguments.
+
+@example
+\newcommand@{\lawyers@}[3][company]@{#2, #3, and~#1@}
+I employ \lawyers[Howe]@{Dewey@}@{Cheatem@}.
+@end example
+
+@noindent
+The output is @samp{I employ Dewey, Cheatem, and Howe}. The optional
+argument, the @code{Howe}, is associated with @code{#1}, while
+@code{Dewey} and @code{Cheatem} are associated with @code{#2}
+and@tie{}@code{#3}. Because of the optional argument,
+@code{\lawyers@{Dewey@}@{Cheatem@}} will give the output @samp{I employ
+Dewey, Cheatem, and company}.
+
+The braces around @var{defn} do not define a group, that is, they do not
+delimit the scope of the result of expanding @var{defn}. For example,
+with @code{\newcommand@{\shipname@}[1]@{\it #1@}}, in this sentence,
@example
The \shipname@{Monitor@} met the \shipname@{Merrimac@}.
@end example
-@noindent the words @samp{met the} would incorrectly be in italics. Another
-pair of braces in the definition is needed, like this:
-@code{\newcommand@{\shipname@}[1]@{@{\it #1@}@}}. Those braces are
-part of the definition and thus do define a group.
+@noindent
+the words @samp{met the} would incorrectly be in italics. The solution
+is to put another pair of braces inside the definition:
+@code{\newcommand@{\shipname@}[1]@{@{\it #1@}@}}.
@node \providecommand
@@ -6589,19 +8682,35 @@ part of the definition and thus do define a group.
@cindex defining a new command
@cindex new commands, defining
-Defines a command, as long as no command of this name already exists.
-Synopses:
+Synopses, one of:
@example
+\providecommand@{@var{cmd}@}@{@var{defn}@}
+\providecommand@{@var{cmd}@}[@var{nargs}]@{@var{defn}@}
\providecommand@{@var{cmd}@}[@var{nargs}][@var{optargdefault}]@{@var{defn}@}
+\providecommand*@{@var{cmd}@}@{@var{defn}@}
+\providecommand*@{@var{cmd}@}[@var{nargs}]@{@var{defn}@}
\providecommand*@{@var{cmd}@}[@var{nargs}][@var{optargdefault}]@{@var{defn}@}
@end example
+Defines a command, as long as no command of this name already exists.
If no command of this name already exists then this has the same effect
-as @code{\newcommand} (@pxref{\newcommand & \renewcommand}). If a
-command of this name already exists then this definition does nothing.
-This is particularly useful in a style file, or other file that may be
-loaded more than once.
+as @code{\newcommand}. If a command of this name already exists then
+this definition does nothing. This is particularly useful in a file
+that may be loaded more than once, such as a style file.
+@xref{\newcommand & \renewcommand} for the description of the arguments.
+
+This example
+
+@example
+\providecommand@{\myaffiliation@}@{Saint Michael's College@}
+\providecommand@{\myaffiliation@}@{Saint Michael's College@}
+From \myaffiliation.
+@end example
+
+@noindent
+outputs @samp{From Saint Michael's College}. Unlike @code{\newcommand},
+the repeated use of @code{\providecommand} does not give an error.
@node \newcounter
@@ -6617,26 +8726,47 @@ Synopsis, one of:
\newcounter@{@var{countername}@}[@var{supercounter}]
@end example
-Globally defines a new counter named @var{countername} and initialize
-the new counter to zero.
+Globally defines a new counter named @var{countername} and initialize it
+to zero (@pxref{Counters}).
-The name @var{countername} must consists of letters only, and does not
+The name @var{countername} must consist of letters only. It does not
begin with a backslash. This name must not already be in use by another
counter.
-When you use the optional argument @code{[@var{supercounter}]} then
-@var{countername} will be numbered within, or subsidiary to, the
-existing counter @var{supercounter}. For example, ordinarily
-@code{subsection} is numbered within @code{section} so that any time
-@var{supercounter} is incremented with @code{\stepcounter}
+When you use the optional argument @code{[@var{supercounter}]} then the
+counter @var{countername} will be reset to zero whenever
+@var{supercounter} is incremented. For example, ordinarily
+@code{subsection} is numbered within @code{section} so that any time you
+increment @var{section}, either with @code{\stepcounter}
(@pxref{\stepcounter}) or @code{\refstepcounter}
-(@pxref{\refstepcounter}) then @var{countername} is reset to zero.
+(@pxref{\refstepcounter}), then @LaTeX{} will reset @var{subsection} to
+zero.
+
+This example
+
+@example
+\newcounter@{asuper@} \setcounter@{asuper@}@{1@}
+\newcounter@{asub@}[asuper] \setcounter@{asub@}@{3@} % Note `asuper'
+The value of asuper is \arabic@{asuper@} and of asub is \arabic@{asub@}.
+\stepcounter@{asuper@}
+Now asuper is \arabic@{asuper@} while asub is \arabic@{asub@}.
+@end example
+
+produces @samp{The value of asuper is 1 and that of asub is 3} and
+@samp{Now asuper is 2 while asub is 0}.
-@xref{Counters}, for more information about counters.
+If the counter already exists, for instance by entering @code{asuper}
+twice, then you get something like @samp{LaTeX Error: Command \c@@asuper
+already defined. Or name \end... illegal, see p.192 of the manual.}.
+
+If you use the optional argument then the super counter must already
+exist. Entering @code{\newcounter@{jh@}[lh]} when @code{lh} is not a
+defined counter will get you @samp{LaTeX Error: No counter 'lh'
+defined.}
@node \newlength
-@section @code{\newlength}: Allocating a length
+@section @code{\newlength}
@findex \newlength
@cindex lengths, allocating new
@@ -6644,42 +8774,65 @@ existing counter @var{supercounter}. For example, ordinarily
@cindex skip register, plain @TeX{}
@cindex glue register, plain @TeX{}
-Allocate a new @dfn{length} register. Synopsis:
+Synopsis:
@example
-\newlength@{\@var{arg}@}
+\newlength@{@var{arg}@}
@end example
-This command takes one required argument, which must begin with a
-backslash (@samp{\}). It creates a new length register named
-@code{\@var{arg}}, which is a place to hold (rubber) lengths such as
-@code{1in plus.2in minus.1in} (what plain @TeX{} calls a @code{skip}
-register). The register gets an initial value of zero. The control
-sequence @code{\@var{arg}} must not already be defined.
+Allocate a new length register (@pxref{Lengths}). The required argument
+@var{arg} must begin with a backslash, @code{\}. The new register holds
+rubber lengths such as @code{72.27pt} or @code{1in plus.2in minus.1in}
+(a @LaTeX{} length register is what plain @TeX{} calls a @code{skip}
+register). The initial value is zero. The control sequence
+@code{\@var{arg}} must not be already defined.
+
+An example:
-@xref{Lengths}, for more about lengths.
+@example
+\newlength@{\graphichgt@}
+@end example
+
+If you forget the backslash then you get @samp{Missing control sequence
+inserted}. If the command sequence already exists then you get
+something like @samp{LaTeX Error: Command \graphichgt already defined.
+Or name \end... illegal, see p.192 of the manual}.
@node \newsavebox
-@section @code{\newsavebox}: Allocating a box
+@section @code{\newsavebox}
@findex \newsavebox
@cindex box, allocating new
-Allocate a ``bin'' for holding a box. Synopsis:
+Synopsis:
@example
-\newsavebox@{\@var{cmd}@}
+\newsavebox@{@var{cmd}@}
@end example
-Defines @code{\@var{cmd}} to refer to a new bin for storing boxes.
-Such a box is for holding typeset material, to use multiple times
-(@pxref{Boxes}) or to measure or manipulate. The name
-@code{\@var{cmd}} must start with a backslash (@samp{\}), and must not
-be already defined.
+Define @code{\@var{cmd}} to refer to a new ``bin'' for storing boxes.
+Such a box is for holding typeset material, to use multiple times or to
+measure or manipulate (@pxref{Boxes}). The required bin name
+@code{@var{cmd}} must start with a backslash, @code{\}, and must not
+already be defined. This command is fragile (@pxref{\protect}).
-The allocation of a box is global. This command is fragile
-(@pxref{\protect}).
+The first line here sets you up to save the material for later use.
+
+@example
+\newsavebox@{\logobox@}
+\savebox@{\logobox@}@{LoGo@}
+Our logo is \usebox@{\logobox@}.
+@end example
+
+@noindent
+The output is @samp{Our logo is LoGo}.
+
+If there is an already defined bin then you get something like
+@samp{LaTeX Error: Command \logobox already defined. Or name
+\end... illegal, see p.192 of the manual}.
+
+The allocation of a box is global.
@node \newenvironment & \renewenvironment
@@ -6691,26 +8844,42 @@ The allocation of a box is global. This command is fragile
@cindex defining new environments
@cindex redefining environments
-These commands define or redefine an environment @var{env}, that is,
-@code{\begin@{@var{env}@} @var{body} \end@{@var{env}@}}. Synopses:
+Synopses, one of:
@example
- \newenvironment@{@var{env}@}[@var{nargs}][@var{optargdefault}]@{@var{begdefn}@}@{@var{enddefn}@}
- \newenvironment*@{@var{env}@}[@var{nargs}][@var{optargdefault}]@{@var{begdefn}@}@{@var{enddefn}@}
- \renewenvironment@{@var{env}@}[@var{nargs}][@var{optargdefault}]@{@var{begdefn}@}@{@var{enddefn}@}
-\renewenvironment*@{@var{env}@}[@var{nargs}][@var{optargdefault}]@{@var{begdefn}@}@{@var{enddefn}@}
+\newenvironment@{@var{env}@}@{@var{begdef}@}@{@var{enddef}@}
+\newenvironment@{@var{env}@}[@var{nargs}]@{@var{begdef}@}@{@var{enddef}@}
+\newenvironment@{@var{env}@}[@var{nargs}][@var{optargdefault}]@{@var{begdef}@}@{@var{enddef}@}
+\newenvironment*@{@var{env}@}@{@var{begdef}@}@{@var{enddef}@}
+\newenvironment*@{@var{env}@}[@var{nargs}]@{@var{begdef}@}@{@var{enddef}@}
+\newenvironment*@{@var{env}@}[@var{nargs}][@var{optargdefault}]@{@var{begdef}@}@{@var{enddef}@}
@end example
+@noindent
+or one of these.
+
+@example
+\renewenvironment@{@var{env}@}@{@var{begdef}@}@{@var{enddef}@}
+\renewenvironment@{@var{env}@}[@var{nargs}]@{@var{begdef}@}@{@var{enddef}@}
+\renewenvironment@{@var{env}@}[@var{nargs}][@var{optargdefault}]@{@var{begdef}@}@{@var{enddef}@}
+\renewenvironment*@{@var{env}@}@{@var{begdef}@}@{@var{enddef}@}
+\renewenvironment*@{@var{env}@}[@var{nargs}]@{@var{begdef}@}@{@var{enddef}@}
+\renewenvironment*@{@var{env}@}[@var{nargs}][@var{optargdefault}]@{@var{begdef}@}@{@var{enddef}@}
+@end example
+
+Define or redefine the environment @var{env}, that is, create the
+construct @code{\begin@{@var{env}@} ... @var{body} ... \end@{@var{env}@}}.
+
@cindex @code{*}-form of environment commands
The starred form of these commands requires that the arguments not
-contain multiple paragraphs of text. The body of these environments can
-still contain multiple paragraphs.
+contain multiple paragraphs of text. However, the body of these
+environments can contain multiple paragraphs.
@table @var
@item env
Required; the environment name. It consists only of letters or the
-@code{*} character, and thus does not begin with backslash
-(@code{\}). It must not begin with the string @code{end}. For
+@code{*} character, and thus does not begin with backslash, @code{\}.
+It must not begin with the string @code{end}. For
@code{\newenvironment}, the name @var{env} must not be the name of an
already existing environment, and also the command @code{\@var{env}}
must be undefined. For @code{\renewenvironment}, @var{env} must be the
@@ -6718,55 +8887,61 @@ name of an existing environment.
@item nargs
Optional; an integer from 0 to 9 denoting the number of arguments of
-that the environment will take. When the environment is used these
+that the environment takes. When you use the environment these
arguments appear after the @code{\begin}, as in
-@code{\begin@{@var{env}@}@{@var{arg1}@}@dots{}@{@var{argn}@}}. If this
-argument is not present then the default is for the environment to have
-no arguments. When redefining an environment, the new version can have
-a different number of arguments than the old version.
+@code{\begin@{@var{env}@}@{@var{arg1}@} ... @{@var{argn}@}}. Omitting
+this is equivalent to setting it to 0; the environment will have no
+arguments. When redefining an environment, the new version can have a
+different number of arguments than the old version.
@item optargdefault
-Optional; if this argument is present then the first argument of the
-defined environment is optional, with default value @var{optargdefault}
-(which may be the empty string). If this argument is not present then
-the environment does not take an optional argument.
-
-That is, when @code{[@var{optargdefault}]} is present in the
-environment definition, if @code{\begin@{@var{env}@}} is used with
-square brackets following, as in
-@code{\begin@{@var{env}@}[@var{myval}]}, then, within @var{begdefn},
-the positional parameter @code{#1} expands to @var{myval}. If
-@code{\begin@{@var{env}@}} is called without square brackets
-following, then, within within @var{begdefn}, the positional parameter
-@code{#1} expands to the default @var{optargdefault}. In either case,
-any required arguments will be referred to starting with @code{#2}.
-
-Omitting @code{[@var{myval}]} in the call is different from having the
+Optional; if this is present then the first argument of the defined
+environment is optional, with default value @var{optargdefault} (which
+may be the empty string). If this is not in the definition then the
+environment does not take an optional argument.
+
+That is, when @var{optargdefault} is present in the definition of the
+environment then you can start the environment with square brackets, as
+in @code{\begin@{@var{env}@}[@var{optval}]@{...@} ... \end@{@var{env}@}}.
+In this case, within @var{begdefn} the parameter @code{#1} is set to the
+value of @var{optval}. If you call @code{\begin@{@var{env}@}} without
+square brackets, then within @var{begdefn} the parameter @code{#1} is
+set to the value of the default @var{optargdefault}. In either case,
+any required arguments start with @code{#2}.
+
+Omitting @code{[@var{myval}]} in the call is different than having the
square brackets with no contents, as in @code{[]}. The former results
in @code{#1} expanding to @var{optargdefault}; the latter results in
@code{#1} expanding to the empty string.
-@item begdefn
+@item begdef
Required; the text expanded at every occurrence of
-@code{\begin@{@var{env}@}}. Within @var{begdef}, the @var{n}th
-positional parameter (i.e., @code{#@var{n}}) is replaced by the text
-of the @var{n}th argument.
+@code{\begin@{@var{env}@}}. Within @var{begdef}, the parameters
+@code{#1}, @code{#2}, ... @code{#@var{nargs}}, are replaced by the
+values that you supply when you call the environment; see the examples
+below.
-@item enddefn
+@item enddef
Required; the text expanded at every occurrence of
-@code{\end@{@var{env}@}}. This may not contain any positional
-parameters, so @code{#@var{n}} cannot be used here (but see the final
+@code{\end@{@var{env}@}}. This may not contain any parameters, that is,
+you cannot use @code{#1}, @code{#2}, etc., here (but see the final
example below).
@end table
-All environments, that is to say the @var{begdefn} code, the environment
-body and the @var{enddefn} code, are processed within a group. Thus, in
+All environments, that is to say the @var{begdef} code, the environment
+body, and the @var{enddef} code, are processed within a group. Thus, in
the first example below, the effect of the @code{\small} is limited to
the quote and does not extend to material following the environment.
+If you try to define an environment and the name has already been used
+then you get something like @samp{LaTeX Error: Command \fred already
+defined. Or name \end... illegal, see p.192 of the manual}. If you try
+to redefine an environment and the name has not yet been used then you
+get something like @samp{LaTeX Error: Environment hank undefined.}.
+
This example gives an environment like @LaTeX{}'s @code{quotation}
-except that it will be set in smaller type:
+except that it will be set in smaller type.
@example
\newenvironment@{smallquote@}@{%
@@ -6776,8 +8951,18 @@ except that it will be set in smaller type:
@}
@end example
-This one shows the use of arguments; it gives a quotation environment
-that cites the author:
+This has an argument, which is set in boldface at the start of a
+paragraph.
+
+@example
+\newenvironment@{point@}[1]@{%
+ \noindent\textbf@{#1@}
+@}@{%
+@}
+@end example
+
+This one shows the use of a optional argument; it gives a quotation
+environment that cites the author.
@example
\newenvironment@{citequote@}[1][Shakespeare]@{%
@@ -6788,8 +8973,9 @@ that cites the author:
@}
@end example
-@noindent The author's name is optional, and defaults to @samp{Shakespeare}.
-In the document, use the environment like this:
+@noindent
+The author's name is optional, and defaults to @samp{Shakespeare}. In
+the document, use the environment like this.
@example
\begin@{citequote@}[Lincoln]
@@ -6798,7 +8984,7 @@ In the document, use the environment like this:
@end example
The final example shows how to save the value of an argument to use in
-@var{enddefn}, in this case in a box (@pxref{\sbox}):
+@var{enddef}, in this case in a box (@pxref{\sbox & \savebox}).
@example
\newsavebox@{\quoteauthor@}
@@ -6821,7 +9007,7 @@ The final example shows how to save the value of an argument to use in
@cindex theorem-like environment
@cindex environment, theorem-like
-Define a new theorem-like environment. Synopses:
+Synopses:
@example
\newtheorem@{@var{name}@}@{@var{title}@}
@@ -6829,25 +9015,24 @@ Define a new theorem-like environment. Synopses:
\newtheorem@{@var{name}@}[@var{numbered_like}]@{@var{title}@}
@end example
-Using the first form, @code{\newtheorem@{@var{name}@}@{@var{title}@}}
-creates an environment that will be labelled with @var{title}. See the
-first example below.
+Define a new theorem-like environment. You can specify one of
+@var{numbered_within} and @var{numbered_like}, or neither, but not both.
-The second form
-@code{\newtheorem@{@var{name}@}@{@var{title}@}[@var{numbered_within}]}
-creates an environment whose counter is subordinate to the existing
-counter @var{numbered_within} (its counter will be reset when
-@var{numbered_within} is reset).
+The first form, @code{\newtheorem@{@var{name}@}@{@var{title}@}}, creates
+an environment that will be labelled with @var{title}; see the first
+example below.
+The second form,
+@code{\newtheorem@{@var{name}@}@{@var{title}@}[@var{numbered_within}]},
+creates an environment whose counter is subordinate to the existing
+counter @var{numbered_within}, so this counter will be reset when
+@var{numbered_within} is reset. See the second example below.
The third form
@code{\newtheorem@{@var{name}@}[@var{numbered_like}]@{@var{title}@}},
-with optional argument between the two required arguments, will create
-an environment whose counter will share the previously defined counter
-@var{numbered_like}.
-
-You can specify one of @var{numbered_within} and @var{numbered_like},
-or neither, but not both.
+with optional argument between the two required arguments, creates an
+environment whose counter will share the previously defined counter
+@var{numbered_like}. See the third example.
This command creates a counter named @var{name}. In addition, unless
the optional argument @var{numbered_like} is used, inside of the
@@ -6860,12 +9045,13 @@ Arguments:
@table @var
@item name
-The name of the environment. It must not begin with a backslash
-(@samp{\}). It must not be the name of an existing environment; indeed,
-the command name @code{\@var{name}} must not already be defined as anything.
+The name of the environment. It is a string of letters. It must not
+begin with a backslash, @code{\}. It must not be the name of an
+existing environment, and the command name @code{\@var{name}} must not
+already be defined.
@item title
-The text printed at the beginning of the environment, before the
+The text to be printed at the beginning of the environment, before the
number. For example, @samp{Theorem}.
@item numbered_within
@@ -6902,10 +9088,10 @@ output.
\end@{defn@}
@end example
-Because the next example specifies the optional argument
-@var{numbered_within} to @code{\newtheorem} as @code{section}, the
-example, with the same document body, gives @samp{Definition@tie{}1.1}
-and @samp{Definition@tie{}2.1}.
+This example has the same document body as the prior one. But here
+@code{\newtheorem}'s optional argument @var{numbered_within} is given as
+@code{section}, so the output is like @samp{Definition@tie{}1.1} and
+@samp{Definition@tie{}2.1}.
@example
\newtheorem@{defn@}@{Definition@}[section]
@@ -6947,45 +9133,43 @@ by @samp{Theorem@tie{}2.1} and @samp{Definition@tie{}2.2}.
@node \newfont
-@section @code{\newfont}: Define a new font (obsolete)
+@section @code{\newfont}
@findex \newfont
@cindex fonts, new commands for
@cindex defining new fonts
-@code{\newfont}, now obsolete, defines a command that will switch fonts.
+@c @findex .fd @r{file}
+This command is obsolete. This description is here only to help with old
+documents. New documents should define fonts in families through the
+New Font Selection Scheme which allows you to, for example, associate a
+boldface with a roman (@pxref{Fonts}).
+@c This is done either by using
+@c @file{.fd} files or through the use of an engine that can access system
+@c fonts such as Xe@LaTeX{} (@pxref{@TeX{} engines}).
+
Synopsis:
@example
\newfont@{\@var{cmd}@}@{@var{font description}@}
@end example
-This defines a control sequence @code{\@var{cmd}} that will change the
-current font. @LaTeX{} will look on your system for a file named
-@file{@var{fontname}.tfm}. The control sequence must must not already
-be defined. It must begin with a backslash (@samp{\}).
-
-@findex .fd @r{file}
-This command is obsolete. It is a low-level command for setting up an
-individual font. Today fonts are almost always defined in families
-(which allows you to, for example, associate a boldface with a roman)
-through the so-called ``New Font Selection Scheme'', either by using
-@file{.fd} files or through the use of an engine that can access
-system fonts such as Xe@LaTeX{} (@pxref{@TeX{} engines}).
-@c xx explain nfss somewhere
+Define a command @code{\@var{cmd}} that will change the current font.
+The control sequence must must not already be defined. It must begin
+with a backslash, @code{\}.
@cindex at clause, in font definitions
@cindex design size, in font definitions
-But since it is part of @LaTeX{}, here is an explanation: the
-@var{font description} consists of a @var{fontname} and an optional
-@dfn{at clause}; this can have the form either @code{at @var{dimen}}
-or @code{scaled @var{factor}}, where a @var{factor} of @samp{1000}
-means no scaling. For @LaTeX{}'s purposes, all this does is scale all
-the character and other font dimensions relative to the font's design
-size, which is a value defined in the @file{.tfm} file.
+The @var{font description} consists of a @var{fontname} and an optional
+@dfn{at clause}. @LaTeX{} will look on your system for a file named
+@file{@var{fontname}.tfm}. The at clause can have the form either
+@code{at @var{dimen}} or @code{scaled @var{factor}}, where a
+@var{factor} of @samp{1000} means no scaling. For @LaTeX{}'s purposes,
+all this does is scale all the character and other font dimensions
+relative to the font's design size, which is a value defined in the
+@file{.tfm} file.
-This example defines two equivalent fonts and typesets a few
-characters in each:
+This defines two equivalent fonts and typesets a few characters in each.
@example
\newfont@{\testfontat@}@{cmb10 at 11pt@}
@@ -7074,6 +9258,7 @@ Synopsis:
\ignorespaces
@end example
+@noindent
or
@example
@@ -7095,12 +9280,17 @@ the command and the question text.
\newcommand@{\points@}[1]@{\makebox[0pt]@{\makebox[10em][l]@{#1~pts@}@}
\begin@{enumerate@}
\item\points@{10@}no extra space output here
- \item\points@{15@} extra space output between the number and the word `extra'
+ \item\points@{15@} extra space between the number and the `extra'
\end@{enumerate@}
@end example
-The solution is to change to
-@code{\newcommand@{\points@}[1]@{\makebox[0pt]@{\makebox[10em][l]@{#1~pts@}@}\ignorespaces@}}.
+@noindent
+The solution is to change to this.
+
+@example
+\newcommand@{\points@}[1]@{%
+ \makebox[0pt]@{\makebox[10em][l]@{#1~pts@}@}\ignorespaces@}
+@end example
A second example shows spaces being removed from the front of text. The
commands below allow a user to uniformly attach a title to names. But,
@@ -7110,7 +9300,7 @@ as given, if a title accidentally starts with a space then
@example
\makeatletter
\newcommand@{\honorific@}[1]@{\def\@@honorific@{#1@}@} % remember title
-\newcommand@{\fullname@}[1]@{\@@honorific~#1@} % recall title; put before name
+\newcommand@{\fullname@}[1]@{\@@honorific~#1@} % put title before name
\makeatother
\begin@{tabular@}@{|l|@}
\honorific@{Mr/Ms@} \fullname@{Jones@} \\ % no extra space here
@@ -7118,6 +9308,7 @@ as given, if a title accidentally starts with a space then
\end@{tabular@}
@end example
+@noindent
To fix this, change to
@code{\newcommand@{\fullname@}[1]@{\ignorespaces\@@honorific~#1@}}.
@@ -7179,18 +9370,20 @@ inside of a minipage (@pxref{minipage}). The counters @code{enumi}
through @code{enumiv} are used in the @code{enumerate} environment, for
up to four levels of nesting (@pxref{enumerate}).
+Counters can have any integer value but they are typically positive.
+
New counters are created with @code{\newcounter}. @xref{\newcounter}.
@menu
* \alph \Alph \arabic \roman \Roman \fnsymbol:: Print value of a counter.
-* \usecounter:: Use a specified counter in a list environment.
-* \value:: Use the value of a counter in an expression.
-* \setcounter:: Set the value of a counter.
-* \addtocounter:: Add a quantity to a counter.
-* \refstepcounter:: Add to a counter.
-* \stepcounter:: Add to a counter, resetting subsidiary counters.
-* \day \month \year:: Numeric date values.
+* \usecounter:: Use a specified counter in a list environment.
+* \value:: Use the value of a counter in an expression.
+* \setcounter:: Set the value of a counter.
+* \addtocounter:: Add a quantity to a counter.
+* \refstepcounter:: Add to a counter.
+* \stepcounter:: Add to a counter, resetting subsidiary counters.
+* \day & \month & \year:: Numeric date values.
@end menu
@@ -7201,7 +9394,7 @@ New counters are created with @code{\newcounter}. @xref{\newcounter}.
Print the value of a counter, in a specified style. For instance, if
the counter @var{counter} has the value 1 then a
-@code{\alph@{@var{counter}@}} in your source will result in a lower case
+@code{\alph@{@var{counter}@}} in your source will result in a lowercase
letter@tie{}a appearing in the output.
All of these commands take a single counter as an argument, for
@@ -7210,54 +9403,67 @@ start with a backslash.
@ftable @code
@item \alph@{@var{counter}@}
-Print the value of @var{counter} in lowercase letters: `a', `b', @enddots{}
+Print the value of @var{counter} in lowercase letters: `a', `b',
+@enddots{} If the counter's value is less than 1 or more than 26 then
+you get @samp{LaTeX Error: Counter too large.}
@item \Alph@{@var{counter}@}
-Print in uppercase letters: `A', `B', @enddots{}
+Print in uppercase letters: `A', `B', @enddots{} If the counter's value
+is less than 1 or more than 26 then you get @samp{LaTeX Error: Counter
+too large.}
@item \arabic@{@var{counter}@}
-Print in Arabic numbers: `1', `2', @enddots{}
+Print in Arabic numbers such as @samp{5} or @samp{-2}.
@item \roman@{@var{counter}@}
-Print in lowercase roman numerals: `i', `ii', @enddots{}
+Print in lowercase roman numerals: `i', `ii', @enddots{} If the
+counter's value is less than 1 then you get no warning or error but
+@LaTeX{} does not print anything in the output.
@item \Roman@{@var{counter}@}
-Print in uppercase roman numerals: `I', `II', @enddots{}
+Print in uppercase roman numerals: `I', `II', @enddots{} If the
+counter's value is less than 1 then you get no warning or error but
+@LaTeX{} does not print anything in the output.
@item \fnsymbol@{@var{counter}@}
-Prints the value of @var{counter} in a specific sequence of nine
-symbols (conventionally used for labeling footnotes). The value of
-@var{counter} must be between@tie{}1 and@tie{}9, inclusive.
+Prints the value of @var{counter} using a sequence of nine symbols that
+are traditionally used for labeling footnotes. The value of
+@var{counter} should be between@tie{}1 and@tie{}9, inclusive. If the
+counter's value is less than 0 or more than 9 then you get @samp{LaTeX
+Error: Counter too large}, while if it is 0 then you get no error or
+warning but @LaTeX{} does not output anything.
Here are the symbols:
-@multitable @columnfractions .33 .33 .33
-@headitem Name@tab Command@tab@iftexthenelse{Symbol,Equivalent Unicode symbol and/or numeric code point}
+@multitable @columnfractions .10 .30 .30 .30
+@headitem Number@tab Name@tab Command@tab Symbol
@item
-asterisk@tab@code{\ast}@tab@iftexthenelse{@math{@ast},*}
+1@tab asterisk@tab@code{\ast}@tab@iftexthenelse{@math{@ast},*}
@item
-dagger@tab@code{\dagger}@tab@BES{2020,\dagger}
+2@tab dagger@tab@code{\dagger}@tab@BES{2020,\dagger}
@item
-ddagger@tab@code{\ddagger}@tab@BES{2021,\ddagger}
+3@tab ddagger@tab@code{\ddagger}@tab@BES{2021,\ddagger}
@item
-section-sign@tab@code{\S}@tab@BES{00A7,\S}
+4@tab section-sign@tab@code{\S}@tab@BES{00A7,\S}
@item
-paragraph-sign@tab@code{\P}@tab@BES{00B6,\P}
+5@tab paragraph-sign@tab@code{\P}@tab@BES{00B6,\P}
@item
-double-vert@tab@code{\parallel}@tab@BES{2016,\parallel}
+6@tab double-vert@tab@code{\parallel}@tab@BES{2016,\parallel}
@item
-double-asterisk@tab@code{\ast\ast}@tab@iftexthenelse{@math{@ast@ast},**}
+7@tab double-asterisk@tab@code{\ast\ast}@tab@iftexthenelse{@math{@ast@ast},**}
@item
-double-dagger@tab@code{\dagger\dagger}@tab@BES{2020,\dagger}@BES{2020,\dagger}
+8@tab
+ double-dagger@tab@code{\dagger\dagger}@tab@BES{2020,\dagger}@BES{2020,\dagger}
@item
-double-ddagger@tab@code{\ddagger\ddagger}@tab@BES{2021,\ddagger}@BES{2021,\ddagger}
+9@tab
+ double-ddagger@tab@code{\ddagger\ddagger}@tab@BES{2021,\ddagger}@BES{2021,\ddagger}
@end multitable
@end ftable
@node \usecounter
-@section @code{\usecounter@{@var{counter}@}}
+@section @code{\usecounter}
@findex \usecounter
@cindex list items, specifying counter
@@ -7269,15 +9475,16 @@ Synopsis:
\usecounter@{@var{counter}@}
@end example
-In the @code{list} environment, when used in the second argument, this
-command sets up @var{counter} to number the list items. It initializes
-@var{counter} to zero, and arranges that when @code{\item} is called
-without its optional argument then @var{counter} is incremented by
-@code{\refstepcounter}, making its value be the current @code{ref}
-value. This command is fragile (@pxref{\protect}).
+Used in the second argument of the @code{list} environment
+(@pxref{list}), this declares that list items will be numbered by
+@var{counter}. It initializes @var{counter} to zero, and arranges that
+when @code{\item} is called without its optional argument then
+@var{counter} is incremented by @code{\refstepcounter}, making its value
+be the current @code{ref} value (@pxref{\ref}). This command is fragile
+(@pxref{\protect}).
-Put in the preamble, this makes a new list environment enumerated with
-@var{testcounter}:
+Put in the document preamble, this example makes a new list environment
+enumerated with @var{testcounter}:
@example
\newcounter@{testcounter@}
@@ -7292,7 +9499,7 @@ Put in the preamble, this makes a new list environment enumerated with
@node \value
-@section @code{\value@{@var{counter}@}}
+@section @code{\value}
@findex \value
@cindex counters, getting value of
@@ -7303,13 +9510,8 @@ Synopsis:
\value@{@var{counter}@}
@end example
-This command expands to the value of @var{counter}. It is often used
-in @code{\setcounter} or @code{\addtocounter}, but @code{\value} can
-be used anywhere that @LaTeX{} expects a number. It must not be
-preceded by @code{\protect} (@pxref{\protect}).
-
-The @code{\value} command is not used for typesetting the value of the
-counter. @xref{\alph \Alph \arabic \roman \Roman \fnsymbol}.
+Expands to the value of the counter @var{counter}. (Note that the name
+of a counter does not begin with a backslash.)
This example outputs @samp{Test counter is@tie{}6. Other counter
is@tie{}5.}.
@@ -7323,6 +9525,14 @@ Test counter is \arabic@{test@}.
Other counter is \arabic@{other@}.
@end example
+The @code{\value} command is not used for typesetting the value of the
+counter. For that, see @ref{\alph \Alph \arabic \roman \Roman \fnsymbol}.
+
+It is often used in @code{\setcounter} or @code{\addtocounter} but
+@code{\value} can be used anywhere that @LaTeX{} expects a number, such
+as in @code{\hspace@{\value@{foo@}\parindent@}}. It must not be
+preceded by @code{\protect} (@pxref{\protect}).
+
This example inserts @code{\hspace@{4\parindent@}}.
@example
@@ -7332,7 +9542,7 @@ This example inserts @code{\hspace@{4\parindent@}}.
@node \setcounter
-@section @code{\setcounter@{@var{counter}@}@{@var{value}@}}
+@section @code{\setcounter}
@findex \setcounter
@cindex counters, setting
@@ -7344,25 +9554,33 @@ Synopsis:
\setcounter@{@var{counter}@}@{@var{value}@}
@end example
-The @code{\setcounter} command globally sets the value of @var{counter}
-to the @var{value} argument. Note that the counter name does not start
-with a backslash.
+Globally set the counter @var{counter} to have the value of the
+@var{value} argument, which must be an integer. Thus, you can set a
+counter's value as @code{\setcounter@{section@}@{5@}}. Note that the
+counter name does not start with a backslash.
-In this example the section value appears as @samp{V}.
+In this example if the counter @code{theorem} has value 12 then the
+second line will print @samp{XII}.
@example
-\setcounter@{section@}@{5@}
-Here it is in Roman: \Roman@{section@}.
+\setcounter@{exercise@}@{\value@{theorem@}@}
+Here it is in Roman: \Roman@{exercise@}.
@end example
@node \addtocounter
-@section @code{\addtocounter@{@var{counter}@}@{@var{value}@}}
+@section @code{\addtocounter}
@findex \addtocounter
-The @code{\addtocounter} command globally increments @var{counter} by
-the amount specified by the @var{value} argument, which may be negative.
+Synopsis:
+
+@example
+\addtocounter@{@var{counter}@}@{@var{value}@
+@end example
+
+Globally increment @var{counter} by the amount specified by the
+@var{value} argument, which may be negative.
In this example the section value appears as @samp{VII}.
@@ -7374,15 +9592,20 @@ Here it is in Roman: \Roman@{section@}.
@node \refstepcounter
-@section @code{\refstepcounter@{@var{counter}@}}
+@section @code{\refstepcounter}
@findex \refstepcounter
-The @code{\refstepcounter} command works in the same way as
-@code{\stepcounter} (@pxref{\stepcounter}): it globally increments the
-value of @var{counter} by one and resets the value of any counter
-numbered within it. (For the definition of ``counters numbered
-within'', @pxref{\newcounter}.)
+Synopsis:
+
+@example
+\refstepcounter@{@var{counter}@}
+@end example
+
+Globally increments the value of @var{counter} by one, as does
+@code{\stepcounter} (@pxref{\stepcounter}). The difference is that this
+command resets the value of any counter numbered within it. (For the
+definition of ``counters numbered within'', @pxref{\newcounter}.)
In addition, this command also defines the current @code{\ref} value
to be the result of @code{\thecounter}.
@@ -7392,30 +9615,51 @@ locally, i.e., inside the current group.
@node \stepcounter
-@section @code{\stepcounter@{@var{counter}@}}
+@section @code{\stepcounter}
@findex \stepcounter
-The @code{\stepcounter} command globally adds one to @var{counter} and
-resets all counters numbered within it. (For the definition of
-``counters numbered within'', @pxref{\newcounter}.)
+Synopsis:
+@example
+\stepcounter@{@var{counter}@}
+@end example
-@node \day \month \year
-@section @code{\day \month \year}: Predefined counters
+Globally adds one to @var{counter} and resets all counters numbered
+within it. (For the definition of ``counters numbered within'',
+@pxref{\newcounter}.)
+
+This command differs from @code{\refstepcounter} in that this one does
+not influence references@tie{}--- it does not define the current
+@code{\ref} value to be the result of @code{\thecounter}
+(@pxref{\refstepcounter}).
+
+
+@node \day & \month & \year
+@section @code{\day} & @code{\month} & @code{\year}
@findex \day
@findex \month
@findex \year
-@LaTeX{} defines counters for the day of the month (@code{\day},
-1--31), month of the year (@code{\month}, 1--12), and year
-(@code{\year}, Common Era). When @TeX{} starts up, they are
-set to the current values on the system where @TeX{} is running. They
-are not updated as the job progresses.
+@LaTeX{} defines the counter @code{\day} for the day of the month
+(nominally with value between 1 and 31), @code{\month} for the month of
+the year (nominally with value between 1 and 12), and year @code{\year}.
+When @TeX{} starts up, they are set from the current values on the
+system. The related command @code{\today} produces a string
+representing the current day (@pxref{\today}).
-The related command @code{\today} produces a string representing the
-current day (@pxref{\today}).
+They counters are not updated as the job progresses so in principle they
+could be incorrect by the end. In addition, @TeX{} does no sanity
+check:
+
+@example
+\day=-2 \month=13 \year=-4 \today
+@end example
+
+@noindent
+gives no error or warning and results in the output @samp{-2, -4} (the
+bogus month value produces no output).
@node Lengths
@@ -7426,29 +9670,110 @@ current day (@pxref{\today}).
A @dfn{length} is a measure of distance. Many @LaTeX{} commands take a
length as an argument.
+This shows a box of the given length.
+
+@example
+\newcommand@{\blackbar@}[1]@{\rule@{#1@}@{10pt@}@} % make a bar
+\newcommand@{\showhbox@}[2]@{\fboxsep=0pt\fbox@{\hbox to #1@{#2@}@}@} % box it
+XXX\showhbox@{100pt@}@{\blackbar@{100pt@}@}YYY
+@end example
+
+@noindent
+It produces a black bar 100@tie{}points long between @samp{XXX} and
+@samp{YYY}.
+
Lengths come in two types. A @dfn{rigid length} (what Plain @TeX{}
-calls a @dfn{dimen}) such as @code{10pt} cannot contain a @code{plus} or
-@code{minus} component. A @dfn{rubber length} (what Plain @TeX{} calls
-a @dfn{skip}) can contain those, as with @code{1cm plus0.05cm
-minus0.01cm}. These give the ability to stretch or shrink; the length
-in the prior sentence could appear in the output as long as 1.05@tie{}cm
-or as short as 0.99@tie{}cm, depending on what @TeX{}'s typesetting
-algorithm finds optimum.
+calls a @dfn{dimen}) such as @code{10pt} does not contain a @code{plus}
+or @code{minus} component. The above example shows a rigid length. A
+@dfn{rubber length} (what Plain @TeX{} calls a @dfn{skip}) can contain
+those components, as with @code{1cm plus0.05cm minus0.01cm}. Here the
+@code{1cm} is the @dfn{natural length} while the other two, the
+@code{plus} and @code{minus} components, allow the length to stretch or
+shrink.
+
+Shrinking is simpler: with @code{1cm minus 0.05cm}, the natural length
+is 1@dmn{cm} but if smaller is needed then @TeX{} can shrink it down as
+far as 0.95@dmn{cm}. Beyond that, @TeX{} refuses to shrink any more.
+Thus, below the first one works fine, producing a space of
+98@tie{}points between the two bars.
+
+@example
+XXX\showhbox@{300pt@}@{%
+ \blackbar@{101pt@}\hspace@{100pt minus 2pt@}\blackbar@{101pt@}@}YYY
+
+XXX\showhbox@{300pt@}@{%
+ \blackbar@{105pt@}\hspace@{100pt minus 1pt@}\blackbar@{105pt@}@}YYY
+@end example
+
+@noindent
+But the second one gets a warning like @samp{Overfull \hbox (1.0pt too
+wide) detected at line 17}. In the output the first @samp{Y} is
+overwritten by the end of the black bar, because the box's material is
+wider than the 300@dmn{pt} allocated, as @TeX{} has refused to shrink
+the total to less than 309@tie{}points.
+
+Stretching is like shrinking except that if @TeX{} is asked to stretch
+beyond the given amount, it won't refuse. Here the first line is fine,
+producing a space of 110@tie{}points between the bars.
+
+@example
+XXX\showhbox@{300pt@}@{%
+ \blackbar@{95pt@}\hspace@{100pt plus 10pt@}\blackbar@{95pt@}@}YYY
+
+XXX\showhbox@{300pt@}@{%
+ \blackbar@{95pt@}\hspace@{100pt plus 1pt@}\blackbar@{95pt@}@}YYY
+@end example
+
+@noindent
+In the second line @TeX{} needs a stretch of 10@tie{}points and only
+1@tie{}point was specified. In this situation, @TeX{} stretches the
+space to the required length, but it complains with a warning like
+@samp{Underfull \hbox (badness 10000) detected at line 22}. (We won't
+discuss badness; the point is that the system was not given as much
+stretch as needed.)
+
+You can put both stretch and shrink in the same length, as in
+@code{1ex plus 0.05ex minus 0.02ex}.
+
+If @TeX{} is setting two or more rubber lengths then it allocates the
+stretch or shrink in proportion.
+
+@example
+XXX\showhbox@{300pt@}@{\blackbar@{100pt@}% left
+ \hspace@{0pt plus 50pt@}\blackbar@{80pt@}\hspace@{0pt plus 10pt@}% middle
+ \blackbar@{100pt@}@}YYY % right
+@end example
+
+@noindent
+The outside bars take up 100@tie{}points, so the middle needs another
+100. In the middle the bar takes up 80@tie{}points, so the two
+@code{\hspace}'s must stretch 20@tie{}points. Because the two say
+@code{plus 50pt} and @code{plus 10pt}, @TeX{} gets 5/6 of the
+stretch from the first space and 1/6 from the second.
The @code{plus} or @code{minus} component of a rubber length can contain
a @dfn{fill} component, as in @code{1in plus2fill}. This gives the
-length infinite stretchability or shrinkability, so that the length in
-the prior sentence can be set by @TeX{} to any distance greater than or
-equal to 1@tie{}inch. @TeX{} actually provides three infinite glue
-components @code{fil}, @code{fill}, and @code{filll}, such that the
-later ones overcome the earlier ones, but only the middle value is
-ordinarily used. @xref{\hfill}, @xref{\vfill}.
-
-Multiplying an entire rubber length by a number turns it into a rigid
-length, so that after @code{\setlength@{\ylength@}@{1in plus 0.2in@}}
-and @code{\setlength@{\zlength@}@{3\ylength@}} then the value of
-@code{\zlength} is @code{3in}.
+length infinite stretchability or shrinkability so that @TeX{} could set
+it to any distance. Here the two figures will be equal-spaced across
+the page.
+
+@example
+\begin@{minipage@}@{\linewidth@}
+ \hspace@{0pt plus 1fill@}\includegraphics@{godel.png@}%
+ \hspace@{0pt plus 1fill@}\includegraphics@{einstein.png@}%
+ \hspace@{0pt plus 1fill@}
+\end@{minipage@}
+@end example
+@TeX{} actually has three infinite glue components @code{fil},
+@code{fill}, and @code{filll}. The later ones are more infinite than
+the earlier ones. Ordinarily document authors only use the middle one
+(@pxref{\hfill} and @pxref{\vfill}).
+
+Multiplying a rubber length by a number turns it into a rigid length, so
+that after @code{\setlength@{\ylength@}@{1in plus 0.2in@}} and
+@code{\setlength@{\zlength@}@{3\ylength@}} then the value of
+@code{\zlength} is @code{3in}.
@menu
* Units of length:: The units that @LaTeX{} knows.
@@ -7457,7 +9782,7 @@ and @code{\setlength@{\zlength@}@{3\ylength@}} then the value of
* \settodepth:: Set a length to the depth of something.
* \settoheight:: Set a length to the height of something.
* \settowidth:: Set a length to the width of something.
-* Predefined lengths:: Lengths that are, like, predefined.
+@c * Predefined lengths:: Lengths that are, like, predefined.
@end menu
@@ -7473,48 +9798,57 @@ math mode.
@item pt
@findex pt
@cindex Point
+@anchor{units of length pt}
Point 1/72.27 inch. The conversion to metric units, to two decimal
places, is 1@dmn{point} = 2.85@dmn{mm} = 28.45@dmn{cm}.
@item pc
@cindex pica
@findex pc
+@anchor{units of length pc}
Pica, 12 pt
@item in
@findex in
@findex inch
+@anchor{units of length in}
Inch, 72.27 pt
@item bp
@findex bp
@cindex Big point
+@anchor{units of length bp}
Big point, 1/72 inch. This length is the definition of a point in
PostScript and many desktop publishing systems.
@item cm
@cindex Centimeter
@findex cm
+@anchor{units of length cm}
Centimeter
@item mm
@cindex Millimeter
@findex mm
+@anchor{units of length mm}
Millimeter
@item dd
@cindex Didot point
@findex dd
+@anchor{units of length dd}
Didot point, 1.07 pt
@item cc
@cindex Cicero
@findex cc
+@anchor{units of length cc}
Cicero, 12 dd
@item sp
@cindex Scaled point
@findex sp
+@anchor{units of length sp}
Scaled point, 1/65536 pt
@end table
@@ -7525,9 +9859,15 @@ Scaled point, 1/65536 pt
@cindex m-width
@cindex em
@findex em
+@anchor{Lengths/em}
+@anchor{Lengths/en}
+@anchor{Lengths/ex}
+@anchor{units of length em}
+@anchor{units of length en}
+@anchor{units of length ex}
Two other lengths that are often used are values set by the designer of
the font. The x-height of the current font @dfn{ex}, traditionally the
-height of the lower case letter x, is often used for vertical
+height of the lowercase letter x, is often used for vertical
lengths. Similarly @dfn{em}, traditionally the width of the capital
letter M, is often used for horizontal lengths (there is also
@code{\enspace}, which is @code{0.5em}). Use of these can help make a
@@ -7553,14 +9893,27 @@ math symbols family. @xref{Spacing in math mode}.
Synopsis:
@example
-\setlength@{@var{\len}@}@{@var{amount}@}
+\setlength@{@var{len}@}@{@var{amount}@}
@end example
-The @code{\setlength} sets the value of @dfn{length command}
-@cindex length command
-@code{\@var{len}} to the @var{value} argument which can be expressed in any
-units that @LaTeX{} understands, i.e., inches (@code{in}), millimeters
-(@code{mm}), points (@code{pt}), big points (@code{bp}), etc.
+Set the length @var{len} to @var{amount}. The length name @var{len}
+must begin with a backslash, @code{\}. The @code{amount} can be a
+rubber length (@pxref{Lengths}). It can be positive, negative or zero,
+and can be in any units that @LaTeX{} understands (@pxref{Units of
+length}).
+
+Below, with @LaTeX{}'s defaults the first paragraph will be indented
+while the second will not.
+
+@example
+I told the doctor I broke my leg in two places.
+
+\setlength@{\parindent@}@{0em@}
+He said stop going to those places.
+@end example
+
+If there is no such length @var{len} then you get something like
+@samp{Undefined control sequence. <argument> \praindent}.
@node \addtolength
@@ -7572,13 +9925,32 @@ units that @LaTeX{} understands, i.e., inches (@code{in}), millimeters
Synopsis:
@example
-\addtolength@{@var{\len}@}@{@var{amount}@}
+\addtolength@{@var{len}@}@{@var{amount}@}
@end example
+Increment the length @var{len} by @var{amount}. The length name
+@var{len} begins with a backslash, @code{\}. The @code{amount} is a
+rubber length (@pxref{Lengths}). It can be positive, negative or zero,
+and can be in any units that @LaTeX{} understands (@pxref{Units of
+length}).
+
+Below, if @code{\parskip} starts with the value @code{0pt plus 1pt}
-The @code{\addtolength} command increments a length command @code{\@var{len}}
-by the amount specified in the @var{amount} argument, which may be
-negative.
+@example
+\addtolength@{\parskip@}@{1pt@}
+Doctor: how is the boy who swallowed the silver dollar?
+
+Nurse: no change.
+@end example
+
+@noindent
+then it has the value @code{1pt plus 1pt} for the second paragraph.
+
+If there is no such length @var{len} then you get something like
+@samp{Undefined control sequence. <argument> \praindent}. If you leave
+off the backslash at the start of @var{len}, as in
+@code{\addtolength@{parindent@}@{1pt@}}, then you get something like
+@samp{You can't use `the letter p' after \advance}.
@node \settodepth
@@ -7589,11 +9961,26 @@ negative.
Synopsis:
@example
-\settodepth@{\@var{len}@}@{@var{text}@}
+\settodepth@{@var{len}@}@{@var{text}@}
+@end example
+
+Set the length @var{len} to the depth of box that @LaTeX{} gets on
+typesetting the @var{text} argument. The length name @var{len} must
+begin with a backslash, @code{\}.
+
+This will show how low the character descenders go.
+
+@example
+\newlength@{\alphabetdepth@}
+\settodepth@{\alphabetdepth@}@{abcdefghijklmnopqrstuvwxyz@}
+\the\alphabetdepth
@end example
-The @code{\settodepth} command sets the value of a length command
-@code{\@var{len}} equal to the depth of the @var{text} argument.
+If there is no such length @var{len} then you get something like
+@samp{Undefined control sequence. <argument> \alphabetdepth}. If you
+leave the backslash out of @var{len}, as in
+@code{\settodepth@{alphabetdepth@}@{...@}} then you get something like
+@samp{Missing number, treated as zero. <to be read again> \setbox}.
@node \settoheight
@@ -7604,56 +9991,85 @@ The @code{\settodepth} command sets the value of a length command
Synopsis:
@example
-\settoheight@{\@var{len}@}@{text@}
+\settoheight@{@var{len}@}@{text@}
@end example
-The @code{\settoheight} command sets the value of a length command @code{\@var{len}}
-equal to the height of the @code{text} argument.
+Sets the length @var{len} to the height of box that @LaTeX{} gets on
+typesetting the @code{text} argument. The length name @var{len} must
+begin with a backslash, @code{\}.
+
+This will show how high the characters go.
+
+@example
+\newlength@{\alphabetheight@}
+\settoheight@{\alphabetheight@}@{abcdefghijklmnopqrstuvwxyz@}
+\the\alphabetheight
+@end example
+If there is no such length @var{len} then you get something like
+@samp{Undefined control sequence. <argument> \alphabetheight}. If you
+leave the backslash out of @var{len}, as in
+@code{\settoheight@{alphabetheight@}@{...@}} then you get something like
+@samp{Missing number, treated as zero. <to be read again> \setbox}.
@node \settowidth
-@section @code{\settowidth@{\@var{len}@}@{@var{text}@}}
+@section @code{\settowidth}
@findex \settowidth
Synopsis:
@example
-\settowidth@{\@var{len}@}@{@var{text}@}
+\settowidth@{@var{len}@}@{@var{text}@}
@end example
-The @code{\settowidth} command sets the value of the command @var{\len}
-to the width of the @var{text} argument.
+Set the length @var{len} to the width of the box that @LaTeX{} gets on
+typesetting the @var{text} argument. The length name @var{len} must
+begin with a backslash, @code{\}.
+This measures the width of the lowercase ASCII alphabet.
-@node Predefined lengths
-@section Predefined lengths
+@example
+\newlength@{\alphabetwidth@}
+\settowidth@{\alphabetwidth@}@{abcdefghijklmnopqrstuvwxyz@}
+\the\alphabetwidth
+@end example
-@cindex lengths, predefined
-@cindex predefined lengths
+If there is no such length @var{len} then you get something like
+@samp{Undefined control sequence. <argument> \alphabetwidth}. If you
+leave the backslash out of @var{len}, as in
+@code{\settoheight@{alphabetwidth@}@{...@}} then you get something like
+@samp{Missing number, treated as zero. <to be read again> \setbox}.
-@code{\width}
-@findex \width
-@code{\height}
-@findex \height
+@c @node Predefined lengths
+@c @section Predefined lengths
-@code{\depth}
-@findex \depth
+@c @cindex lengths, predefined
+@c @cindex predefined lengths
-@code{\totalheight}
-@findex \totalheight
+@c @code{\width}
+@c @findex \width
-These length parameters can be used in the arguments of the box-making
-commands (@pxref{Boxes}). They specify the natural width, etc., of
-the text in the box. @code{\totalheight} equals @math{@code{@backslashchar{}height} +
-@code{@backslashchar{}depth}}. To make a box with the text stretched to double the
-natural size, e.g., say
+@c @code{\height}
+@c @findex \height
-@example
-\makebox[2\width]@{Get a stretcher@}
-@end example
+@c @code{\depth}
+@c @findex \depth
+
+@c @code{\totalheight}
+@c @findex \totalheight
+
+@c These length parameters can be used in the arguments of the box-making
+@c commands (@pxref{Boxes}). They specify the natural width, etc., of the
+@c text in the box. @code{\totalheight} equals
+@c @math{@code{@backslashchar{}height} + @code{@backslashchar{}depth}}. To
+@c make a box with the text stretched to double the natural size, e.g., say
+
+@c @example
+@c \makebox[2\width]@{Get a stretcher@}
+@c @end example
@node Making paragraphs
@@ -7662,43 +10078,155 @@ natural size, e.g., say
@cindex making paragraphs
@cindex paragraphs
-A paragraph is ended by one or more completely blank lines---lines not
-containing even a @code{%}. A blank line should not appear where a new
-paragraph cannot be started, such as in math mode or in the argument of
-a sectioning command.
+Once @LaTeX{} has all of a paragraph's contents it divides it into
+lines, in a way that is optimized over the entire paragraph (@pxref{Line
+breaking}). To end the current paragraph, put an empty line.
+
+@example
+It is a truth universally acknowledged, that a single man in possession
+of a good fortune, must be in want of a wife.
+
+However little known the feelings or views of such a man may be on his
+first entering a neighbourhood, this truth is so well fixed in the minds
+of the surrounding families, that he is considered the rightful property
+of some one or other of their daughters.
+
+``My dear Mr. Bennet,'' said his lady to him one day,
+``have you heard that Netherfield Park is let at last?''
+@end example
+
+The separator lines must be empty, including not containing a comment
+character, @code{%}.
+
+There are places where a new paragraph is not permitted. Don't put a
+blank line in math mode (@pxref{Modes}); here the line before the
+@code{\end@{equation@}}
+
+@example
+\begin@{equation@}
+ 2^@{|S|@} > |S|
+
+\end@{equation@}
+@end example
+
+@noindent
+will get you the error @samp{Missing $ inserted}. Similarly, the blank
+line in this @code{section} argument
+
+@example
+\section@{aaa
+
+bbb@}
+@end example
+
+@noindent
+gets @samp{Runaway argument? @{aaa ! Paragraph ended before \@@sect was
+complete}.
+
@menu
-* \indent:: Indent this paragraph.
-* \noindent:: Do not indent this paragraph.
-* \parskip:: Space added before paragraphs.
-* Marginal notes:: Putting remarks in the margin.
+* \par:: End the current paragraph.
+* \indent & \noindent:: Go into horizontal mode, possibly with an indent.
+* \parindent & \parskip:: Space added before paragraphs.
+* Marginal notes:: Put remarks in the margin.
@end menu
-@node \indent
-@section @code{\indent}
+@node \par
+@section @code{\par}
+
+@findex \par
+@cindex paragraph, ending
+
+Synopsis (note that while reading the input @TeX{}, converts two
+consecutive newlines to a @code{\par}):
+
+@example
+\par
+@end example
+
+End the current paragraph. The usual way to separate paragraphs is with
+a blank line but the @code{\par} command is entirely equivalent. This
+command is robust (@pxref{\protect}).
+
+This example uses @code{\par} rather than a blank line simply for
+readability.
+
+@example
+\newcommand@{\syllabusLegalese@}@{%
+ \whatCheatingIs\par\whatHappensWhenICatchYou@}
+@end example
+
+The @code{\par} command does nothing in LR mode or a vertical mode but
+it terminates paragraph mode, bringing @LaTeX{} to vertical mode
+(@pxref{Modes}).
+
+You cannot use the @code{\par} command in math mode or in the argument
+of many commands, such as the @code{\section} command (@pxref{Making
+paragraphs} and @pxref{\newcommand & \renewcommand}).
+
+The @code{\par} command differs from the @code{\paragraph} command in
+that the latter is, like @code{\section} or @code{\subsection}, a
+sectioning unit used by the standard @LaTeX{} documents.
+
+The @code{\par} command differs from @code{\newline} and the line break
+double backslash, @code{\\}, in that \par ends the paragraph not just
+the line. It also triggers the addition of the between-paragraph
+vertical space @code{\parskip} (@pxref{\parindent & \parskip}).
+
+The output from this example
+
+@example
+xyz
+
+\setlength@{\parindent@}@{3in@}
+\setlength@{\parskip@}@{5in@}
+\noindent test\indent test1\par test2
+@end example
+
+@noindent
+is: after @samp{xyz} there is a vertical skip of 5@tie{}inches and then
+@samp{test} appears, aligned with the left margin. On the same line,
+there is an empty horizontal space of 3@tie{}inches and then
+@samp{test1} appears. Finally. there is a vertical space of
+5@tie{}inches, followed by a fresh paragraph with a paragraph indent of
+3@tie{}inches, and then @LaTeX{} puts the text @samp{test2}.
+
+
+@node \indent & \noindent
+@section @code{\indent} & @code{\noindent}
@findex \indent
+@findex \noindent
@findex \parindent
@cindex indent, forcing
-@code{\indent} produces a horizontal space whose width equals to the
-@code{\parindent} length, the normal paragraph indentation. It is used
-to add paragraph indentation where it would otherwise be suppressed.
+Synopsis:
+
+@example
+\indent
+@end example
+
+@noindent or
-The default value for @code{\parindent} is @code{1em} in two-column
-mode, otherwise @code{15pt} for @code{10pt} documents, @code{17pt} for
-@code{11pt}, and @code{1.5em} for @code{12pt}.
+@example
+\noindent
+@end example
+Go into horizontal mode (@pxref{Modes}). The @code{\indent} command
+first outputs an empty box whose width is @code{\parindent}. These
+commands are robust (@pxref{\protect}).
-@node \noindent
-@section @code{\noindent}
+Ordinarily you create a new paragraph by putting in a blank line.
+@xref{\par} for the difference between this command and @code{\par}. To
+start a paragraph without an indent, or to continue an interrupted
+paragraph, use @code{\noindent}.
-@findex \noindent
-@cindex indent, suppressing
+In the middle of a paragraph the @code{\noindent} command has no effect,
+because @LaTeX{} is already in horizontal mode there. The
+@code{\indent} command's only effect is to output a space.
-When used at the beginning of the paragraph, this command suppresses any
-paragraph indentation, as in this example.
+This example starts a fresh paragraph.
@example
... end of the prior paragraph.
@@ -7706,20 +10234,67 @@ paragraph indentation, as in this example.
\noindent This paragraph is not indented.
@end example
-It has no effect when used in the middle of a paragraph.
+@noindent
+and this continues an interrupted paragraph.
-To eliminate paragraph indentation in an entire document, put
-@code{\setlength@{\parindent@}@{0pt@}} in the preamble.
+@example
+The data
+
+\begin@{center@}
+ \begin@{tabular@}@{rl@} ... \end@{tabular@}
+\end@{center@}
+
+\noindent shows this clearly.
+@end example
+To omit indentation in the entire document put
+@code{\setlength@{\parindent@}@{0pt@}} in the preamble. If you do that,
+you may want to also set the length of spaces between paragraphs,
+@code{\parskip} (@pxref{\parindent & \parskip}).
-@node \parskip
-@section @code{\parskip}
+@PkgIndex{indentfirst}
+Default @LaTeX{} styles have the first paragraph after a section that is
+not indented, as is traditional typesetting in English. To change that,
+look on CTAN for the package @code{indentfirst}.
+
+@node \parindent & \parskip
+@section @code{\parindent} & @code{\parskip}
+
+@findex \parindent
@findex \parskip
+@cindex paragraph indentation
@cindex vertical space before paragraphs
-@code{\parskip} is a rubber length defining extra vertical space added
-before each paragraph. The default is @code{0pt plus1pt}.
+Synopsis:
+
+@example
+\setlength@{\parskip@}@{@var{horizontal len}@}
+\setlength@{\parinden@}@{@var{vertical len}@}
+@end example
+
+Both are a rubber lengths (@pxref{Lengths}). They give the indentation
+of ordinary paragraphs, not paragraphs inside minipages
+(@pxref{minipage}), and the vertical space between paragraphs.
+
+This, put in the preamble,
+
+@example
+\setlength@{\parindent@}@{0em@}
+\setlength@{\parskip@}@{1ex@}
+@end example
+
+@noindent
+arranges that the document will have paragraphs that are not indented,
+but instead are vertically separated by about the height of a lowercase
+@samp{x}.
+
+In standard @LaTeX{} documents, the default value for @code{\parindent}
+in one-column documents is @code{15pt} when the default text size is
+@code{10pt} , @code{17pt} for @code{11pt}, and @code{1.5em} for
+@code{12pt}. In two-column documents it is @code{1em}. The default
+value for @code{\parskip} in @LaTeX{}'s standard document styles is
+@code{0pt plus1pt}.
@node Marginal notes
@@ -7730,52 +10305,55 @@ before each paragraph. The default is @code{0pt plus1pt}.
@cindex remarks in the margin
@findex \marginpar
-Synopsis:
+Synopsis, one of:
@example
+\marginpar@{@var{right}@}
\marginpar[@var{left}]@{@var{right}@}
@end example
-The @code{\marginpar} command creates a note in the margin. The first
-line of the note will have the same baseline as the line in the text
-where the @code{\marginpar} occurs.
+Create a note in the margin. The first line of the note will have the
+same baseline as the line in the text where the @code{\marginpar}
+occurs.
-When you only specify the mandatory argument @var{right}, the text
-will be placed
-
-@itemize @bullet
-@item
-in the right margin for one-sided layout (option @code{oneside}, see @ref{Document class options});
-@item
-in the outside margin for two-sided layout (option @code{twoside}, see @ref{Document class options});
-@item
-in the nearest margin for two-column layout (option @code{twocolumn}, see @ref{Document class options}).
-@end itemize
+The margin that @LaTeX{} uses for the note depends on the current layout
+(@pxref{Document class options}) and also on @code{\reversemarginpar}
+(see below). If you are using one-sided layout (document option
+@code{oneside}) then it goes in the right margin. If you are using
+two-sided layout (document option @code{twoside}) then it goes in the
+outside margin. If you are in two-column layout (document option
+@code{twocolumn}) then it goes in the nearest margin.
@findex \reversemarginpar
@findex \normalmarginpar
-The command @code{\reversemarginpar} places subsequent marginal notes
-in the opposite (inside) margin. @code{\normalmarginpar} places them
-in the default position.
+If you declare @code{\reversemarginpar} then @LaTeX{} will place
+subsequent marginal notes in the opposite margin to that given in the
+prior paragraph. Revert that to the default position with
+@code{\normalmarginpar}.
-When you specify both arguments, @var{left} is used for the left
-margin, and @var{right} is used for the right margin.
+When you specify the optional argument @var{left} then it is used for a
+note in the left margin, while the mandatory argument @var{right} is
+used for a note in the the right margin.
-The first word will normally not be hyphenated; you can enable
-hyphenation there by beginning the node with @code{\hspace@{0pt@}}.
+Normally, a note's first word will not be hyphenated. You can enable
+hyphenation there by beginning @var{left} or @var{right} with
+@code{\hspace@{0pt@}}.
These parameters affect the formatting of the note:
@ftable @code
@item \marginparpush
+@anchor{marginal notes marginparpush}
Minimum vertical space between notes; default @samp{7pt} for
@samp{12pt} documents, @samp{5pt} else.
@item \marginparsep
+@anchor{marginal notes marginparsep}
Horizontal space between the main text and the note; default
@samp{11pt} for @samp{10pt} documents, @samp{10pt} else.
@item \marginparwidth
+@anchor{marginal notes marginparwidth}
Width of the note itself; default for a one-sided @samp{10pt} document
is @samp{90pt}, @samp{83pt} for @samp{11pt}, and @samp{68pt} for
@samp{12pt}; @samp{17pt} more in each case for a two-sided document.
@@ -7800,65 +10378,124 @@ notes from falling off the bottom of the page.
@EnvIndex{displaymath}
@EnvIndex{equation}
-There are three environments that put @LaTeX{} in math mode:
+Produce mathematical text by putting @LaTeX{} into math mode or display
+math mode (@pxref{Modes}). This example shows both.
-@table @code
-@item math
-For formulas that appear right in the text.
-@item displaymath
-For formulas that appear on their own line.
-@item equation
-The same as the displaymath environment except that it adds an equation
-number in the right margin.
-@end table
+@example
+The wave equation for \( u \) is
+\begin@{displaymath@}
+ \frac@{\partial^2u@}@{\partial t^2@} = c^2\nabla^2u
+\end@{displaymath@}
+where \( \nabla^2 \) is the spatial Laplacian and \( c \) is constant.
+@end example
-@findex \(
-@findex \)
-@findex \[
-@findex \]
-The @code{math} environment can be used in both paragraph and LR mode,
-but the @code{displaymath} and @code{equation} environments can be used
-only in paragraph mode. The @code{math} and @code{displaymath}
-environments are used so often that they have the following short forms:
+@noindent
+Math mode is for inline mathematics. In the above example it is invoked
+by the starting @code{\(} and finished by the matching ending @code{\)}.
+Display math mode is for displayed equations and here is invoked by the
+@code{displaymath} environment. Note that any mathematical text
+whatever, including mathematical text consisting of just one character,
+is handled in math mode.
+
+When in math mode or display math mode, @LaTeX{} handles many aspects of
+your input text differently than in other text modes. For example,
@example
-\(...\) @r{instead of} \begin@{math@}...\end@{math@}
-\[...\] @r{instead of} \begin@{displaymath@}...\end@{displaymath@}
+contrast x+y with \( x+y \)
@end example
-@findex $
-In fact, the @code{math} environment is so common that it has an even
-shorter form:
+@noindent
+in math mode the letters are in italics and the spacing around the plus
+sign is different.
+
+There are three ways to make inline formulas, to put @LaTeX{} in math
+mode.
@example
-$ ... $ @r{instead of} \(...\)
+\( @var{mathematical material} \)
+$ @var{mathematical material} $
+\begin@{math@} @var{mathematical material} \end@{math@}
@end example
-@findex \boldmath
-@findex \unboldmath
-The @code{\boldmath} command changes math letters and symbols to be in
-a bold font. It is used @emph{outside} of math mode. Conversely, the
-@code{\unboldmath} command changes math glyphs to be in a normal font;
-it too is used @emph{outside} of math mode.
+@noindent
+The first form is preferred and the second is quite common, but the
+third form is rarely used. You can sometimes use one and sometimes
+another, as in @code{\(x\) and $y$}. You can use these in paragraph
+mode or in LR mode (@pxref{Modes}).
-@c xx own section? Math fonts?
-@findex \displaystyle
-The @code{\displaystyle} declaration forces the size and style of the
-formula to be that of @code{displaymath}, e.g., with limits above and
-below summations. For example:
+To make displayed formulas, put @LaTeX{} into display math mode with
+either:
@example
-$\displaystyle \sum_@{n=0@}^\infty x_n $
+\begin@{displaymath@}
+ @var{mathematical material}
+\end@{displaymath@}
@end example
-@c xx see also \cal, \mathcal
+@noindent
+or
+
+@example
+\begin@{equation@}
+ @var{mathematical material}
+\end@{equation@}
+@end example
+
+@noindent
+(@pxref{displaymath}, @pxref{equation}). The only difference is that
+with the @code{equation} environment, @LaTeX{} puts a formula number
+alongside the formula. The construct @code{\[ @var{math} \]} is
+equivalent to @code{\begin@{displaymath@} @var{math}
+\end@{displaymath@}}. These environments can only be used in paragraph
+mode (@pxref{Modes}).
+
+@findex \displaystyle
+The two mathematics modes are similar, but there are some differences.
+One involves the placement of subscripts and superscripts; in display
+math mode they are further apart and in inline math mode they are closer
+together.
+
+Sometimes you want the display math typographical treatment to happen in
+the inline math mode. For this, the @code{\displaystyle} declaration
+forces the size and style of the formula to be that of
+@code{displaymath}. Thus @code{\(\displaystyle \sum_@{n=0@}^\infty
+x_n\)} will have the limits above and below the summation sign, not next
+to it. Another example is that
+
+@example
+\begin@{tabular@}@{r|cc@}
+ \textsc@{Name@} &\textsc@{Series@} &\textsc@{Sum@} \\ \hline
+ Arithmetic &\( a+(a+b)+(a+2b)+\cdots+(a+(n-1)b) \)
+ &\( na+(n-1)n\cdot\frac@{b@}@{2@}\) \\
+ Geometric &\( a+ab+ab^2+\cdots+ab^@{n-1@} \)
+ &\(\displaystyle a\cdot\frac@{1-b^n@}@{1-b@}\) \\
+\end@{tabular@}
+@end example
+
+@noindent
+because it has no @code{\displaystyle}, the @samp{Arithmetic} line's
+fraction will be scrunched. But, because of its @code{\displaystyle},
+the @samp{Geometric} line's fraction will be easy to read, with
+characters the same size as in the rest of the line.
+
+@PkgIndex{amsmath}
+@PkgIndex{amsfonts}
+@PkgIndex{mathtools}
+The American Mathematical Society has made freely available a set of
+packages that greatly expand your options for writing mathematics,
+@file{amsmath} and @file{amssymb} (also be aware of the @file{mathtools}
+package that is an extension to, and loads, @file{amsmath}). New
+documents that will have mathematical text should use these packages.
+Descriptions of these packages is outside the scope of this document;
+see their documentation on CTAN.
@menu
* Subscripts & superscripts:: Also known as exponent or index.
* Math symbols:: Various mathematical squiggles.
* Math functions:: Math function names like sin and exp.
* Math accents:: Accents in math.
-* Spacing in math mode:: Thick, medium, thin and negative spaces.
+* Over- and Underlining:: Things over or under formulas.
+* Spacing in math mode:: Thick, medium, thin, and negative spaces.
* Math miscellany:: Stuff that doesn't fit anywhere else.
@end menu
@@ -7872,42 +10509,79 @@ $\displaystyle \sum_@{n=0@}^\infty x_n $
@findex _
@findex ^
-In math mode, use the caret character@tie{}@code{^} to make the
-@var{exp} appear as a superscript: @code{^@{@var{exp}@}}.
-Similarly, in math mode, underscore@tie{}@code{_@{@var{exp}@}} makes a
-subscript out of @var{exp}.
+Synopsis (in math mode or display math mode), one of:
-In this example the @code{0} and @code{1} appear as subscripts while the
-@code{2} is a superscript.
+@example
+@var{base}^@var{exp}
+@var{base}^@{@var{exp}@}
+@end example
+
+@noindent
+or, one of:
@example
-\( (x_0+x_1)^2 \)
+@var{base}_@var{exp}
+@var{base}_@{@var{exp}@}
@end example
-To have more than one character in @var{exp} use curly braces as in
-@code{e^@{-2x@}}.
+Make @var{exp} appear as a superscript of @var{base} (with the caret
+character,@tie{}@code{^}) or a subscript (with
+underscore,@tie{}@code{_}).
+
+In this example the @code{0}'s and @code{1}'s are subscripts while the
+@code{2}'s are superscripts.
+
+@example
+\( (x_0+x_1)^2 \leq (x_0)^2+(x_1)^2 \)
+@end example
+
+To have the subscript or superscript contain more than one character,
+surround the expression with curly braces, as in @code{e^@{-2x@}}.
+This example's fourth line shows curly braces used to group an expression
+for the exponent.
+
+@example
+\begin@{displaymath@}
+ (3^3)^3=27^3=19\,683
+ \qquad
+ 3^@{(3^3)@}=3^@{27@}=7\,625\,597\,484\,987
+\end@{displaymath@}
+@end example
+
+@LaTeX{} knows how to handle a superscript on a superscript, or a
+subscript on a subscript, or supers on subs, or subs on supers. So,
+expressions such as @code{e^@{x^2@}} and @code{x_@{i_0@}} give correct
+output. Note the use in those expressions of curly braces to give the
+@var{base} a determined @var{exp}. If you enter @code{\(3^3^3\)} then
+you get @samp{Double superscript}.
+
+@LaTeX{} does the right thing when something has both a subscript and a
+superscript. In this example the integral has both. They come out in
+the correct place without any author intervention.
-@LaTeX{} handles superscripts on superscripts, and all of that stuff, in
-the natural way, so expressions such as @code{e^@{x^2@}} and
-@code{x_@{a_0@}} will look right. It also does the right thing when
-something has both a subscript and a superscript. In this example the
-@code{0} appears at the bottom of the integral sign while the @code{10}
-appears at the top.
-
@example
-\int_0^@{10@} x^2 \,dx
+\begin@{displaymath@}
+ \int_@{x=a@}^b f'(x)\,dx = f(b)-f(a)
+\end@{displaymath@}
@end example
-You can put a superscript or subscript before a symbol with a construct
-such as @code{@{@}_t K^2} in math mode (the initial @code{@{@}} prevents
-the prefixed subscript from being attached to any prior symbols in the
-expression).
+@noindent
+Note the parentheses around @code{x=a} to make the entire expression a
+subscript.
+
+To put a superscript or subscript before a symbol, use a construct like
+@code{@{@}_t K^2}. The empty curly braces @code{@{@}} give the
+subscript something to attach to and keeps it from accidentally
+attaching to a prior symbols.
+
+Using the subscript or superscript command outside of math mode or
+display math mode, as in @code{the expression x^2}, will get you
+the error @samp{Missing $ inserted}.
-Outside of math mode, a construct like @code{A
-test$_\textnormal@{subscript@}$} will produce a subscript typeset in
-text mode, not math mode. Note that there are packages specialized for
-writing Chemical formulas such as @file{mhchem}.
-@c xx display mode
+@PkgIndex{mhchem}
+A common reason to want subscripts outside of a mathematics mode is to
+typeset chemical formulas. There are packages for that such as
+@file{mhchem}; see CTAN.
@node Math symbols
@@ -7917,19 +10591,20 @@ writing Chemical formulas such as @file{mhchem}.
@cindex symbols, math
@cindex greek letters
-@LaTeX{} provides almost any mathematical symbol you're likely to need.
-For example, if you include @code{$\pi$} in your source, you will get
-the pi symbol @BES{03C0,\pi}.
-
-Below is a list of commonly-available symbols. It is by no means an
-exhaustive list. Each symbol here is described with a short phrase, and
-its symbol class (which determines the spacing around it) is given in
-parenthesis. Unless said otherwise, the commands for these symbols can
-be used only in math mode.
+@PkgIndex{symbols}
-To redefine a command so that it can be used whatever the current mode,
-see @ref{\ensuremath}.
+@LaTeX{} provides almost any mathematical or technical symbol that
+anyone uses. For example, if you include @code{$\pi$} in your source,
+you will get the pi symbol @BES{03C0,\pi}. See the @file{Comprehensive
+@LaTeX{} Symbol List} at
+@url{https://ctan.org/tex-archive/info/symbols/comprehensive/}.
+Here is a list of commonly-used symbols. It is by no means exhaustive.
+Each symbol is described with a short phrase, and its symbol class,
+which determines the spacing around it, is given in parenthesis. Unless
+said otherwise, the commands for these symbols can be used only in math
+mode. To redefine a command so that it can be used whatever the current
+mode, see @ref{\ensuremath}.
@c xx Add Negation: @code{} for negations of relevant symbols
@c Useful: http://www.w3.org/TR/WD-math-970515/section6.html
@@ -7942,7 +10617,7 @@ see @ref{\ensuremath}.
@BES{2135,\aleph} Aleph, transfinite cardinal (ordinary).
@item \alpha
-@BES{03B1,\alpha} Lower case Greek letter alpha (ordinary).
+@BES{03B1,\alpha} Lowercase Greek letter alpha (ordinary).
@item \amalg
@BES{2A3F,\amalg} Disjoint union (binary)
@@ -7969,7 +10644,7 @@ sometimes reserved for cross-correlation.
@code{\textbackslash} for backslash outside of math mode.
@item \beta
-@BES{03B2,\beta} Lower case Greek letter beta (ordinary).
+@BES{03B2,\beta} Lowercase Greek letter beta (ordinary).
@item \bigcap
@BES{22C2,\bigcap} Variable-sized, or n-ary, intersection (operator). Similar:
@@ -8014,14 +10689,14 @@ union@tie{}@code{\cup}.
@BES{22C0,\bigwedge} Variable-sized, or n-ary, logical-or (operator).
@item \bot
-@BESU{22A5,bot} Up tack, bottom, least element of a partially ordered
+@BES{22A5,} Up tack, bottom, least element of a partially ordered
set, or a contradiction (ordinary). See also@tie{}@code{\top}.
@item \bowtie
@BES{22C8,\bowtie} Natural join of two relations (relation).
@item \Box
-@BESU{25A1,Box} Modal operator for necessity; square open box
+@BES{25A1,} Modal operator for necessity; square open box
(ordinary). @value{NeedsAMSSymb}
@c bb Best Unicode equivalent?
@@ -8039,7 +10714,7 @@ operator@tie{}@code{\bigcap}.
dot@tie{}@code{\bullet}.
@item \chi
-@BES{03C7,\chi} Lower case Greek chi (ordinary).
+@BES{03C7,\chi} Lowercase Greek chi (ordinary).
@item \circ
@BES{2218,\circ} Function composition, ring operator (binary). Similar:
@@ -8049,9 +10724,9 @@ variable-sized operator@tie{}@code{\bigcirc}.
@BES{2663,\clubsuit} Club card suit (ordinary).
@item \complement
-@BESU{2201,complement} Set complement, used as a superscript as in
-@code{$S^\complement$} (ordinary). @value{NeedsAMSSymb} Also
-used: @code{$S^@{\mathsf@{c@}@}$} or@tie{}@code{$\bar@{S@}$}.
+@BES{2201,} Set complement, used as a superscript as in
+@code{$S^\complement$} (ordinary). @value{NeedsAMSSymb} Also used:
+@code{$S^@{\mathsf@{c@}@}$} or@tie{}@code{$\bar@{S@}$}.
@item \cong
@BES{2245,\cong} Congruent (relation).
@@ -8074,17 +10749,16 @@ turnstile@tie{}@code{\vdash}.
@BES{2021,\ddagger} Double dagger relation (binary).
@item \Delta
-@BES{0394,\Delta} Greek upper case delta, used for increment (ordinary).
+@BES{0394,\Delta} Greek uppercase delta, used for increment (ordinary).
@item \delta
-@BES{03B4,\delta} Greek lower case delta (ordinary).
+@BES{03B4,\delta} Greek lowercase delta (ordinary).
@item \Diamond
-@BESU{25C7,Diamond} Large diamond operator (ordinary). @value{NeedsAMSSymb}
-@c bb Best Unicode equivalent?
+@BES{25C7,} Large diamond operator (ordinary). @value{NeedsAMSSymb}
@item \diamond
-@BES{22C4,\diamond} Diamond operator, or diamond bullet (binary). Similar: large
+@BES{22C4,\diamond} Diamond operator (binary). Similar: large
diamond@tie{}@code{\Diamond}, circle bullet@tie{}@code{\bullet}.
@item \diamondsuit
@@ -8098,12 +10772,12 @@ diamond@tie{}@code{\Diamond}, circle bullet@tie{}@code{\bullet}.
to@tie{}@code{\Doteq}.
@item \downarrow
-@BES{2193,\downarrow} Down arrow, converges (relation). Similar: double line down
-arrow@tie{}@code{\Downarrow}.
+@BES{2193,\downarrow} Down arrow, converges (relation). Similar:
+@code{\Downarrow} double line down arrow.
@item \Downarrow
-@BES{21D3,\Downarrow} Double line down arrow (relation). Similar: single line down
-arrow@tie{}@code{\downarrow}.
+@BES{21D3,\Downarrow} Double line down arrow (relation). Similar:
+@code{\downarrow} single line down arrow.
@item \ell
@BES{2113,\ell} Lowercase cursive letter l (ordinary).
@@ -8114,7 +10788,7 @@ arrow@tie{}@code{\downarrow}.
@c bb Why Unicode has \revemptyset but no \emptyset?
@item \epsilon
-@BES{03F5,\epsilon} Lower case lunate epsilon (ordinary). Similar to
+@BES{03F5,\epsilon} Lowercase lunate epsilon (ordinary). Similar to
Greek text letter. More widely used in mathematics is the script small
letter epsilon @code{\varepsilon}@tie{}@BES{03B5,\varepsilon}. Related:
the set membership relation @code{\in}@tie{}@BES{2208,\in}.
@@ -8125,7 +10799,7 @@ the set membership relation @code{\in}@tie{}@BES{2208,\in}.
@BES{2261,\equiv} Equivalence (relation).
@item \eta
-@BES{03B7,\eta} Lower case Greek letter (ordinary).
+@BES{03B7,\eta} Lowercase Greek letter (ordinary).
@item \exists
@BES{2203,\exists} Existential quantifier (ordinary).
@@ -8140,10 +10814,10 @@ the set membership relation @code{\in}@tie{}@BES{2208,\in}.
@BES{2322,\frown} Downward curving arc (ordinary).
@item \Gamma
-@BES{0393,\Gamma} Upper case Greek letter (ordinary).
+@BES{0393,\Gamma} uppercase Greek letter (ordinary).
@item \gamma
-@BES{03B3,\gamma} Lower case Greek letter (ordinary).
+@BES{03B3,\gamma} Lowercase Greek letter (ordinary).
@item \ge
@BES{2265,\ge} Greater than or equal to (relation). This is a synonym
@@ -8180,8 +10854,13 @@ with a @code{\thickmuskip} on either side.
@item \Im
@BES{2111,\Im} Imaginary part (ordinary). See: real part@tie{}@code{\Re}.
+@item \imath
+@cindex dotless i, math
+Dotless i; used when you are putting an accent on an i (@pxref{Math
+accents}).
+
@item \in
-@BES{2208,\in} Set element (relation). See also: lower case lunate
+@BES{2208,\in} Set element (relation). See also: lowercase lunate
epsilon@tie{}@code{\epsilon}@BES{03F5,\epsilon} and small letter script
epsilon@tie{}@code{\varepsilon}.
@@ -8192,20 +10871,25 @@ epsilon@tie{}@code{\varepsilon}.
@BES{222B,\int} Integral (operator).
@item \iota
-@BES{03B9,\iota} Lower case Greek letter (ordinary).
+@BES{03B9,\iota} Lowercase Greek letter (ordinary).
@item \Join
-@BESU{2A1D,Join} Condensed bowtie symbol (relation). Not available in Plain
+@BES{2A1D,} Condensed bowtie symbol (relation). Not available in Plain
@TeX{}.
+@item \jmath
+@cindex dotless j, math
+Dotless j; used when you are putting an accent on a j (@pxref{Math
+accents}).
+
@item \kappa
-@BES{03BA,\kappa} Lower case Greek letter (ordinary).
+@BES{03BA,\kappa} Lowercase Greek letter (ordinary).
@item \Lambda
-@BES{039B,\Lambda} Upper case Greek letter (ordinary).
+@BES{039B,\Lambda} uppercase Greek letter (ordinary).
@item \lambda
-@BES{03BB,\lambda} Lower case Greek letter (ordinary).
+@BES{03BB,\lambda} Lowercase Greek letter (ordinary).
@item \land
@BES{2227,\land} Logical and (binary). This is a synonym for @code{\wedge}.
@@ -8232,7 +10916,7 @@ shaved off (opening). Matches@tie{}@code{\rceil}.
for@tie{}@code{\leq}.
@item \leadsto
-@BESU{21DD,leadsto} Squiggly right arrow (relation). @value{NeedsAMSSymb}
+@BES{21DD,} Squiggly right arrow (relation). @value{NeedsAMSSymb}
To get this symbol outside of math mode you can put
@code{\newcommand*@{\Leadsto@}@{\ensuremath@{\leadsto@}@}} in the
preamble and then use @code{\Leadsto} instead.
@@ -8269,7 +10953,7 @@ for@tie{}@code{\le}.
@BES{230A,\lfloor} Left floor bracket (opening). Matches:@tie{}@code{\floor}.
@item \lhd
-@BESU{25C1,lhd} Arrowhead, that is, triangle, pointing left (binary).
+@BES{25C1,} Arrowhead, that is, triangle, pointing left (binary).
@value{NeedsAMSSymb} For the normal subgroup symbol you should load
@file{amssymb} and use@tie{}@code{\vartriangleleft} (which is a relation
and so gives better spacing).
@@ -8305,7 +10989,7 @@ double-line right arrow@tie{}@code{\Longrightarrow}.
Similar: longer version@tie{}@code{\longmapsto}.
@item \mho
-@BESU{2127,mho} Conductance, half-circle rotated capital omega (ordinary).
+@BES{2127,} Conductance, half-circle rotated capital omega (ordinary).
@value{NeedsAMSSymb}
@item \mid
@@ -8326,7 +11010,7 @@ for@tie{}@code{\vert} and for norm see the entry for@tie{}@code{\Vert}.
@BES{2213,\mp} Minus or plus (relation).
@item \mu
-@BES{03BC,\mu} Lower case Greek letter (ordinary).
+@BES{03BC,\mu} Lowercase Greek letter (ordinary).
@item \nabla
@BES{2207,\nabla} Hamilton's del, or differential, operator (ordinary).
@@ -8354,20 +11038,20 @@ negation:@tie{}@code{\sim}.
of@tie{}@code{\in}.
@item \not
-@BES{0020,\not}@BES{00A0,}@BES{0338,} Long solidus, or slash, used to overstrike a
+@c the "@ "s put in spaces so the not slash doesn't hit the next char.
+@BES{0020,\not}@ @ @ @ Long solidus, or slash, used to overstrike a
following operator (relation).
-@c Need blank space for it to overstrike
-Many negated operators that don't require @code{\not} are available,
+Many negated operators are available that don't require @code{\not},
particularly with the @file{amssymb} package. For example, @code{\notin}
-is probably typographically preferable to @code{\not\in}.
+is typographically preferable to @code{\not\in}.
@item \notin
@BES{2209,\notin} Not an element of (relation). Similar: not subset
of@tie{}@code{\nsubseteq}.
@item \nu
-@BES{03BD,\nu} Lower case Greek letter (ordinary).
+@BES{03BD,\nu} Lowercase Greek letter (ordinary).
@item \nwarrow
@BES{2196,\nwarrow} North-west arrow (relation).
@@ -8377,13 +11061,14 @@ of@tie{}@code{\nsubseteq}.
operator@tie{}@code{\bigodot}.
@item \oint
-@BES{222E,\oint} Contour integral, integral with circle in the middle (operator).
+@BES{222E,\oint} Contour integral, integral with circle in the middle
+(operator).
@item \Omega
-@BES{03A9,\Omega} Upper case Greek letter (ordinary).
+@BES{03A9,\Omega} uppercase Greek letter (ordinary).
@item \omega
-@BES{03C9,\omega} Lower case Greek letter (ordinary).
+@BES{03C9,\omega} Lowercase Greek letter (ordinary).
@item \ominus
@BES{2296,\ominus} Minus sign, or dash, inside a circle (binary).
@@ -8416,14 +11101,14 @@ same glyph but the spacing is different because it is in the class
ordinary.
@item \phi
-@BES{03D5,\phi} Lower case Greek letter (ordinary). The variant form is
+@BES{03D5,\phi} Lowercase Greek letter (ordinary). The variant form is
@code{\varphi}@tie{}@BES{03C6,\varphi}.
@item \Pi
-@BES{03A0,\Pi} Upper case Greek letter (ordinary).
+@BES{03A0,\Pi} uppercase Greek letter (ordinary).
@item \pi
-@BES{03C0,\pi} Lower case Greek letter (ordinary). The variant form is
+@BES{03C0,\pi} Lowercase Greek letter (ordinary). The variant form is
@code{\varpi}@tie{}@BES{03D6,\varpi}.
@item \pm
@@ -8453,14 +11138,14 @@ single quote@tie{}@code{'} in text mode produces a different character
@BES{221D,\propto} Is proportional to (relation)
@item \Psi
-@BES{03A8,\Psi} Upper case Greek letter (ordinary).
+@BES{03A8,\Psi} uppercase Greek letter (ordinary).
@item \psi
-@BES{03C8,\psi} Lower case Greek letter (ordinary).
+@BES{03C8,\psi} Lowercase Greek letter (ordinary).
@item \rangle
-@BES{27E9,\rangle} Right angle, or sequence, bracket (closing). Similar: greater
-than@tie{}@code{>}. Matches:@code{\langle}.
+@BES{27E9,\rangle} Right angle, or sequence, bracket (closing).
+Similar: greater than@tie{}@code{>}. Matches:@code{\langle}.
@item \rbrace
@BES{007D,\rbrace} Right curly brace
@@ -8479,11 +11164,11 @@ double-line, or blackboard bold, R@tie{}@code{\mathbb@{R@}}; to access
this, load the @file{amsfonts} package.
@item \restriction
-@BESU{21BE,restriction} Restriction of a function
-(relation). Synonym:@tie{}@code{\upharpoonright}. @value{NeedsAMSSymb}
+@BES{21BE,} Restriction of a function (relation). Synonym:
+@code{\upharpoonright}. @value{NeedsAMSSymb}
@item \revemptyset
-@BESU{29B0,revemptyset} Reversed empty set symbol (ordinary). Related:
+@BES{29B0,} Reversed empty set symbol (ordinary). Related:
@code{\varnothing}. @value{NeedsSTIX}
@item \rfloor
@@ -8491,47 +11176,52 @@ this, load the @file{amsfonts} package.
off (closing). Matches@tie{}@code{\lfloor}.
@item \rhd
-@BESU{25C1,rhd} Arrowhead, that is, triangle, pointing right (binary).
+@BES{25C1,} Arrowhead, that is, triangle, pointing right (binary).
@value{NeedsAMSSymb} For the normal subgroup symbol you should instead
-load @file{amssymb} and use@tie{}@code{\vartriangleright} (which
-is a relation and so gives better spacing).
+load @file{amssymb} and use@tie{}@code{\vartriangleright} (which is a
+relation and so gives better spacing).
@item \rho
-@BES{03C1,\rho} Lower case Greek letter (ordinary). The variant form is
+@BES{03C1,\rho} Lowercase Greek letter (ordinary). The variant form is
@code{\varrho}@tie{}@BES{03F1,\varrho}.
@item \Rightarrow
-@BES{21D2,\Rightarrow} Implies, right-pointing double line arrow (relation). Similar:
-right single-line arrow@tie{}@code{\rightarrow}.
+@BES{21D2,\Rightarrow} Implies, right-pointing double line arrow
+(relation). Similar: right single-line arrow@tie{}@code{\rightarrow}.
@item \rightarrow
-@BES{2192,\rightarrow} Right-pointing single line arrow (relation). Synonym:@tie{}@code{\to}. Similar: right double line arrow@tie{}@code{\Rightarrow}.
+@BES{2192,\rightarrow} Right-pointing single line arrow (relation).
+Synonym:@tie{}@code{\to}. Similar: right double line
+arrow@tie{}@code{\Rightarrow}.
@item \rightharpoondown
-@BES{21C1,\rightharpoondown} Right-pointing harpoon with barb below the line (relation).
+@BES{21C1,\rightharpoondown} Right-pointing harpoon with barb below
+the line (relation).
@item \rightharpoonup
-@BES{21C0,\rightharpoonup} Right-pointing harpoon with barb above the line (relation).
+@BES{21C0,\rightharpoonup} Right-pointing harpoon with barb above the
+line (relation).
@item \rightleftharpoons
-@BES{21CC,\rightleftharpoons} Right harpoon up above left harpoon down (relation).
+@BES{21CC,\rightleftharpoons} Right harpoon up above left harpoon down
+(relation).
@item \searrow
@BES{2198,\searrow} Arrow pointing southeast (relation).
@item \setminus
-@BES{29F5,\setminus} Set difference, reverse solidus or slash, like \
-(binary). Similar: backslash@tie{}@code{\backslash} and also
+@BES{29F5,\setminus} Set difference, reverse solidus or reverse slash,
+like \ (binary). Similar: backslash@tie{}@code{\backslash} and also
@code{\textbackslash} outside of math mode.
@item \sharp
@BES{266F,\sharp} Musical sharp (ordinary).
@item \Sigma
-@BES{03A3,\Sigma} Upper case Greek letter (ordinary).
+@BES{03A3,\Sigma} uppercase Greek letter (ordinary).
@item \sigma
-@BES{03C3,\sigma} Lower case Greek letter (ordinary). The variant form is
+@BES{03C3,\sigma} Lowercase Greek letter (ordinary). The variant form is
@code{\varsigma}@tie{}@BES{03C2,\varsigma}.
@item \sim
@@ -8560,7 +11250,7 @@ union@tie{}@code{cup}. Related: variable-sized
operator@tie{}@code{\bigsqcup}.
@item \sqsubset
-@BESU{228F,sqsubset} Square subset symbol (relation). Similar:
+@BES{228F,} Square subset symbol (relation). Similar:
subset@tie{}@code{\subset}. @value{NeedsAMSSymb}
@item \sqsubseteq
@@ -8568,19 +11258,19 @@ subset@tie{}@code{\subset}. @value{NeedsAMSSymb}
equal to@tie{}@code{\subseteq}.
@item \sqsupset
-@BESU{2290,sqsupset} Square superset symbol (relation). Similar:
+@BES{2290,} Square superset symbol (relation). Similar:
superset@tie{}@code{\supset}. @value{NeedsAMSSymb}
@item \sqsupseteq
-@BES{2292,\sqsupseteq} Square superset or equal symbol (binary). Similar: superset or
-equal@tie{}@code{\supseteq}.
+@BES{2292,\sqsupseteq} Square superset or equal symbol (binary).
+Similar: superset or equal@tie{}@code{\supseteq}.
@item \star
-@BES{22C6,\star} Five-pointed star, sometimes used as a general binary operation
-but sometimes reserved for cross-correlation (binary). Similar: the
-synonyms asterisk@tie{}@code{*} and @code{\ast}, which are six-pointed,
-and more often appear as a superscript or subscript, as with the Kleene
-star.
+@BES{22C6,\star} Five-pointed star, sometimes used as a general binary
+operation but sometimes reserved for cross-correlation (binary).
+Similar: the synonyms asterisk@tie{}@code{*} and @code{\ast}, which
+are six-pointed, and more often appear as a superscript or subscript,
+as with the Kleene star.
@item \subset
@BES{2282,\subset} Subset (occasionally, is implied by) (relation).
@@ -8615,10 +11305,10 @@ that extends to cover the argument.
@BES{2199,\swarrow} Southwest-pointing arrow (relation).
@item \tau
-@BES{03C4,\tau} Lower case Greek letter (ordinary).
+@BES{03C4,\tau} Lowercase Greek letter (ordinary).
@item \theta
-@BES{03B8,\theta} Lower case Greek letter (ordinary). The variant form is
+@BES{03B8,\theta} Lowercase Greek letter (ordinary). The variant form is
@code{\vartheta}@tie{}@BES{03D1,\vartheta}.
@item \times
@@ -8630,7 +11320,7 @@ also@tie{}@code{\cdot}.
Synonym:@tie{}@code{\rightarrow}.
@item \top
-@BESU{22A4,top} Top, greatest element of a partially ordered set
+@BES{22A4,} Top, greatest element of a partially ordered set
(ordinary). See also@tie{}@code{\bot}.
@item \triangle
@@ -8649,16 +11339,16 @@ is a relation and so gives better spacing).
relation and so gives better spacing).
@item \unlhd
-@BESU{22B4,unlhd} Left-pointing not-filled underlined arrowhead, that
-is, triangle, with a line under (binary). @value{NeedsAMSSymb} For
-the normal subgroup symbol load @file{amssymb} and
+@BES{22B4,} Left-pointing not-filled underlined arrowhead, that is,
+triangle, with a line under (binary). @value{NeedsAMSSymb} For the
+normal subgroup symbol load @file{amssymb} and
use@tie{}@code{\vartrianglelefteq} (which is a relation and so gives
better spacing).
@item \unrhd
-@BESU{22B5,unrhd} Right-pointing not-filled underlined arrowhead, that
-is, triangle, with a line under (binary). @value{NeedsAMSSymb} For
-the normal subgroup symbol load @file{amssymb} and
+@BES{22B5,} Right-pointing not-filled underlined arrowhead, that is,
+triangle, with a line under (binary). @value{NeedsAMSSymb} For the
+normal subgroup symbol load @file{amssymb} and
use@tie{}@code{\vartrianglerighteq} (which is a relation and so gives
better spacing).
@@ -8678,12 +11368,14 @@ arrow@tie{}@code{\Uparrow}.
arrow@tie{}@code{\updownarrow}.
@item \updownarrow
-@BES{2195,\updownarrow} Single-line upward-and-downward-pointing arrow (relation). Similar:
-double-line upward-and-downward-pointing arrow@tie{}@code{\Updownarrow}.
+@BES{2195,\updownarrow} Single-line upward-and-downward-pointing arrow
+(relation). Similar: double-line upward-and-downward-pointing
+arrow@tie{}@code{\Updownarrow}.
@item \upharpoonright
-@BESU{21BE,upharpoonright} Up harpoon, with barb on right side
-(relation). Synonym:@tie{}@code{@backslashchar{}restriction}. @value{NeedsAMSSymb}
+@BES{21BE,} Up harpoon, with barb on right side
+(relation). Synonym:@tie{}@code{@backslashchar{}restriction}.
+@value{NeedsAMSSymb}
@item \uplus
@BES{228E,\uplus} Multiset union, a union symbol with a plus symbol in
@@ -8691,10 +11383,10 @@ the middle (binary). Similar: union@tie{}@code{\cup}. Related:
variable-sized operator@tie{}@code{\biguplus}.
@item \Upsilon
-@BES{03A5,\Upsilon} Upper case Greek letter (ordinary).
+@BES{03A5,\Upsilon} uppercase Greek letter (ordinary).
@item \upsilon
-@BES{03C5,\upsilon} Lower case Greek letter (ordinary).
+@BES{03C5,\upsilon} Lowercase Greek letter (ordinary).
@item \varepsilon
@BES{03B5,\varepsilon} Small letter script epsilon (ordinary). This is
@@ -8703,28 +11395,28 @@ more widely used in mathematics than the non-variant lunate epsilon form
membership@tie{}@code{\in}.
@item \vanothing
-@BESU{2205,varnothing} Empty set symbol. Similar:
-@code{\emptyset}. Related: @code{\revemptyset}. @value{NeedsAMSSymb}
+@BES{2205,} Empty set symbol. Similar: @code{\emptyset}. Related:
+@code{\revemptyset}. @value{NeedsAMSSymb}
@item \varphi
-@BES{03C6,\varphi} Variant on the lower case Greek letter (ordinary).
+@BES{03C6,\varphi} Variant on the lowercase Greek letter (ordinary).
The non-variant form is @code{\phi}@tie{}@BES{03D5,\phi}.
@item \varpi
-@BES{03D6,\varpi} Variant on the lower case Greek letter (ordinary).
+@BES{03D6,\varpi} Variant on the lowercase Greek letter (ordinary).
The non-variant form is @code{\pi}@tie{}@BES{03C0,\pi}.
@item \varrho
-@BES{03F1,\varrho} Variant on the lower case Greek letter (ordinary).
+@BES{03F1,\varrho} Variant on the lowercase Greek letter (ordinary).
The non-variant form is @code{\rho}@tie{}@BES{03C1,\rho}.
@item \varsigma
-@BES{03C2,\varsigma} Variant on the lower case Greek letter
+@BES{03C2,\varsigma} Variant on the lowercase Greek letter
(ordinary). The non-variant form is
@code{\sigma}@tie{}@BES{03C3,\sigma}.
@item \vartheta
-@BES{03D1,\vartheta} Variant on the lower case Greek letter
+@BES{03D1,\vartheta} Variant on the lowercase Greek letter
(ordinary). The non-variant form is
@code{\theta}@tie{}@BES{03B8,\theta}.
@@ -8742,34 +11434,35 @@ operator@tie{}@code{\bigvee}.
@BES{2016,\Vert} Vertical double bar (ordinary). Similar: vertical single
bar@tie{}@code{\vert}.
-For a norm symbol, you can use the @file{mathtools} package and add
-@code{\DeclarePairedDelimiter\norm@{\lVert@}@{\rVert@}} to your
-preamble. This gives you three command variants for double-line
-vertical bars that are correctly horizontally spaced: if in the
-document body you write the starred version @code{$\norm*@{M^\perp@}$}
-then the height of the vertical bars will match the height of the
-argument, whereas with @code{\norm@{M^\perp@}} the bars do not grow
-with the height of the argument but instead are the default height,
-and @code{\norm[@var{size command}]@{M^\perp@}} also gives bars that
-do not grow but are set to the size given in the @var{size command},
-e.g., @code{\Bigg}.
+For a norm symbol, you can use the @file{mathtools} package and put in
+your preamble
+@code{\DeclarePairedDelimiter\norm@{\lVert@}@{\rVert@}}. This gives you
+three command variants for double-line vertical bars that are correctly
+horizontally spaced: if in the document body you write the starred
+version @code{$\norm*@{M^\perp@}$} then the height of the vertical bars
+will match the height of the argument, whereas with
+@code{\norm@{M^\perp@}} the bars do not grow with the height of the
+argument but instead are the default height, and @code{\norm[@var{size
+command}]@{M^\perp@}} also gives bars that do not grow but are set to
+the size given in the @var{size command}, e.g., @code{\Bigg}.
@item \vert
@BES{007C,\vert} Single line vertical bar (ordinary). Similar: double-line
vertical bar@tie{}@code{\Vert}. For such that, as in the definition of a
set, use@tie{}@code{\mid} because it is a relation.
-For absolute value you can use the @file{mathtools} package and add
-@code{\DeclarePairedDelimiter\abs@{\lvert@}@{\rvert@}} to your
-preamble. This gives you three command variants for single-line vertical
-bars that are correctly horizontally spaced: if in the document body you
-write the starred version @code{$\abs*@{\frac@{22@}@{7@}@}$} then the
-height of the vertical bars will match the height of the argument,
-whereas with @code{\abs@{\frac@{22@}@{7@}@}} the bars do not grow with
-the height of the argument but instead are the default height, and
-@code{\abs[@var{size command}]@{\frac@{22@}@{7@}@}} also gives bars
-that do not grow but are set to the size given in the @var{size
-command}, e.g., @code{\Bigg}.
+For absolute value you can use the @file{mathtools} package and in your
+preamble put
+@code{\DeclarePairedDelimiter\abs@{\lvert@}@{\rvert@}}. This gives you
+three command variants for single-line vertical bars that are correctly
+horizontally spaced: if in the document body you write the starred
+version @code{$\abs*@{\frac@{22@}@{7@}@}$} then the height of the
+vertical bars will match the height of the argument, whereas with
+@code{\abs@{\frac@{22@}@{7@}@}} the bars do not grow with the height of
+the argument but instead are the default height, and
+@code{\abs[@var{size command}]@{\frac@{22@}@{7@}@}} also gives bars that
+do not grow but are set to the size given in the @var{size command},
+e.g., @code{\Bigg}.
@item \wedge
@BES{2227,\wedge} Logical and (binary). Synonym:@tie{}@code{\land}. See also
@@ -8783,16 +11476,245 @@ operator@tie{}@code{\bigwedge}.
@BES{2240,\wr} Wreath product (binary).
@item \Xi
-@BES{039E,\Xi} Upper case Greek letter (ordinary).
+@BES{039E,\Xi} uppercase Greek letter (ordinary).
@item \xi
-@BES{03BE,\xi} Lower case Greek letter (ordinary).
+@BES{03BE,\xi} Lowercase Greek letter (ordinary).
@item \zeta
-@BES{03B6,\zeta} Lower case Greek letter (ordinary).
+@BES{03B6,\zeta} Lowercase Greek letter (ordinary).
+
+@end ftable
+
+The following symbols are most often used in plain text but @LaTeX{}
+provides versions to use in mathematical text.
+
+@ftable @code
+@item \mathdollar
+Dollar sign in math mode: $.
+
+@item \mathparagraph
+Paragraph sign (pilcrow) in math mode, @BES{00B6,\P}.
+
+@item \mathsection
+Section sign in math mode @BES{00A7,\S}.
+
+@item \mathsterling
+Sterling sign in math mode: @pounds{}.
+
+@item \mathunderscore
+Underscore in math mode: _.
@end ftable
+@menu
+* Blackboard bold:: Doublestruck characters.
+* Calligraphic:: Cursive characters.
+* \boldmath & \unboldmath:: Symbols in boldface.
+* Dots:: Ellipses, etc.
+@end menu
+
+
+@node Blackboard bold
+@subsection Blackboard bold
+
+@cindex blackboard bold
+@cindex doublestruck
+
+Synopsis:
+
+@example
+\usepackage@{amssymb@} % in preamble
+ ...
+\mathbb@{@var{uppercase-letter}@}
+@end example
+
+Provide blackboard bold symbols, sometimes also known as doublestruck
+letters, used to denote number sets such as the natural numbers, the
+integers, etc.
+
+Here
+
+@example
+\( \forall n \in \mathbb@{N@}, n^2 \geq 0 \)
+@end example
+
+@noindent
+the @code{\mathbb@{N@}} gives blackboard bold symbol @BES{2115,}
+representing the natural numbers.
+
+If you use other than an uppercase letter then you do not get an error
+but you get strange results, including unexpected characters.
+
+There are packages that give access to symbols other than just the
+capital letters; look on CTAN.
+
+
+@node Calligraphic
+@subsection Calligraphic
+
+@cindex calligraphic fonts
+@cindex script fonts
+@cindex fonts, script
+
+Synopsis:
+
+@example
+\mathcal@{@var{uppercase-letters}@}
+@end example
+
+Use a script-like font.
+
+In this example the graph identifier is output in a cursive font.
+
+@example
+Let the graph be \( \mathcal@{G@} \).
+@end example
+
+If you use something other than an uppercase letter then you do not get
+an error. Instead you get unexpected output. For instance,
+@code{\mathcal@{g@}} outputs a close curly brace symbol, while
+@code{\mathcal@{+@}} outputs a plus sign.
+
+
+@node \boldmath & \unboldmath
+@subsection @code{\boldmath} & @code{\unboldmath}
+
+@cindex boldface mathematics
+@cindex symbols, boldface
+@findex \boldmath
+@findex \unboldmath
+
+Synopsis (used in paragraph mode or LR mode):
+
+@example
+\boldmath \( @var{math} \)
+@end example
+
+@noindent
+or
+
+@example
+\unboldmath \( @var{math} \)
+@end example
+
+@findex \boldmath
+@findex \unboldmath
+Declarations to change the letters and symbols in @var{math} to be in
+a bold font, or to countermand that and bring back the regular
+(non-bold) default. They must be used when not in math mode or display
+math mode (@pxref{Modes}). Both commands are fragile
+(@pxref{\protect}).
+
+In this example each @code{\boldmath} command takes place inside an
+@code{\mbox},
+
+@example
+we have $\mbox@{\boldmath \( v \)@} = 5\cdot\mbox@{\boldmath \( u \)$@}$
+@end example
+
+@noindent
+which means @code{\boldmath} is only called in a text mode, here LR
+mode, and explains why @LaTeX{} must switch to math mode to set @code{v}
+and @code{u}.
+
+If you use either command inside math mode, as with @code{Trouble: \(
+\boldmath x \)}, then you get something like @samp{LaTeX Font Warning:
+Command \boldmath invalid in math mode on input line 11} and @samp{LaTeX
+Font Warning: Command \mathversion invalid in math mode on input line
+11}.
+
+@PkgIndex{bm}
+There are many issues with @code{\boldmath}. New documents should use
+the @file{bm} package provided by the @LaTeX{} Project team. A complete
+description is outside the scope of this document (see the full
+documentation on CTAN) but even this small example
+
+@example
+\usepackage@{bm@} % in preamble
+...
+we have $\bm@{v@} = 5\cdot\bm@{u@}$
+@end example
+
+@noindent
+shows that it is an improvement over @code{\boldmath}.
+
+
+@node Dots
+@subsection Dots, horizontal or vertical
+
+@cindex ellipses
+@cindex dots
+
+Ellipses are the three dots (usually three) indicating that a pattern
+continues.
+
+@example
+\begin@{array@}@{cccc@}
+ a_@{0,0@} &a_@{0,1@} &a_@{0,2@} &\ldots \\
+ a_@{1,0@} &\ddots \\
+ \vdots
+\end@{array@}
+@end example
+
+@LaTeX{} provides these.
+
+@ftable @code
+@anchor{ellipses cdots}
+@item \cdots
+Horizontal ellipsis with the dots raised to the center of the line, as
+in @BES{22EF,\cdots}. Used as: @code{\( a_0\cdot a_1\cdots a_@{n-1@}
+\)}.
+
+@anchor{ellipses ddots}
+@item \ddots
+Diagonal ellipsis, @BES{22F1,\ddots}. See the above array example for a
+usage.
+
+@anchor{ellipses ldots}
+@item \ldots
+Ellipsis on the baseline, @BES{2026,\ldots}. Used as: @code{\(
+x_0,\ldots x_@{n-1@} \)}. Another example is the above array example. A
+synonym is @code{\mathellipsis}. A synonym from the @file{amsmath}
+package is @code{\hdots}.
+
+You can also use this command outside of mathematical text, as in
+@code{The gears, brakes, \ldots@{@} are all broken}. (In a paragraph
+mode or LR mode a synonym for @code{\ldots} is @code{\dots}.)
+
+@anchor{ellipses vdots}
+@item \vdots
+Vertical ellipsis, @BES{22EE,\vdots}. See the above array example for a
+usage.
+
+@end ftable
+
+@PkgIndex{amsmath}
+The @file{amsmath} package has the command @code{\dots} to semantically
+mark up ellipses. This example produces two different-looking outputs
+for the first two uses of the @code{\dots} command.
+
+@example
+\usepackage@{amsmath@} % in preamble
+ ...
+Suppose that \( p_0, p_1, \dots, p_@{n-1@} \) lists all of the primes.
+Observe that \( p_0\cdot p_1 \dots \cdot p_@{n-1@} +1 \) is not a
+ multiple of any \( p_i \).
+Conclusion: there are infinitely many primes \( p_0, p_1, \dotsc \).
+@end example
+
+@noindent
+In the first line @LaTeX{} looks to the comma following @code{\dots} to
+determine that it should output an ellipsis on the baseline. The second
+line has a @code{\cdot} following @code{\dots} so @LaTeX{} outputs an
+ellipsis that is on the math axis, vertically centered. However, the
+third usage has no follow-on character so you have to tell @LaTeX{} what
+to do. You can use one of the commands: @code{\dotsc} if you need the
+ellipsis appropriate for a comma following, @code{\dotsb} if you need
+the ellipses that fits when the dots are followed by a binary operator
+or relation symbol, @code{\dotsi} for dots with integrals, or
+@code{\dotso} for others.
+
@node Math functions
@section Math functions
@@ -8805,117 +11727,227 @@ spacing.
@ftable @code
@item \arccos
+Inverse cosine
+@iftex
@math{\arccos}
+@end iftex
@item \arcsin
+Inverse sine
+@iftex
@math{\arcsin}
+@end iftex
@item \arctan
+Inverse tangent
+@iftex
@math{\arctan}
+@end iftex
@item \arg
+Angle between the real axis and a point in the complex plane
+@iftex
@math{\arg}
+@end iftex
@item \bmod
-Binary modulo operator (@math{x \bmod y})
+Binary modulo operator, used as in @code{\( 5\bmod 3=2 \)}
+@iftex
+@math{5 \bmod 3}
+@end iftex
@item \cos
+Cosine
+@iftex
@math{\cos}
+@end iftex
@item \cosh
+Hyperbolic cosine
+@iftex
@math{\cosh}
+@end iftex
@item \cot
+Cotangent
+@iftex
@math{\cot}
+@end iftex
@item \coth
+Hyperbolic cotangent
+@iftex
@math{\coth}
+@end iftex
@item \csc
+Cosecant
+@iftex
@math{\csc}
+@end iftex
@item \deg
+Degrees
+@iftex
@math{\deg}
+@end iftex
@item \det
+Determinant
+@iftex
@math{\det}
+@end iftex
@item \dim
+Dimension
+@iftex
@math{\dim}
+@end iftex
@item \exp
+Exponential
+@iftex
@math{\exp}
+@end iftex
@item \gcd
+Greatest common divisor
+@iftex
@math{\gcd}
+@end iftex
@item \hom
+Homomorphism
+@iftex
@math{\hom}
+@end iftex
@item \inf
+Infinum
+@iftex
@math{\inf}
+@end iftex
@item \ker
+Kernel
+@iftex
@math{\ker}
+@end iftex
@item \lg
+Base 2 logarithm
+@iftex
@math{\lg}
+@end iftex
@item \lim
+Limit
+@iftex
@math{\lim}
+@end iftex
@item \liminf
+Limit inferior
+@iftex
@math{\liminf}
+@end iftex
@item \limsup
+Limit superior
+@iftex
@math{\limsup}
+@end iftex
@item \ln
+Natural logarithm
+@iftex
@math{\ln}
+@end iftex
@item \log
+Logarithm
+@iftex
@math{\log}
+@end iftex
@item \max
+Maximum
+@iftex
@math{\max}
+@end iftex
@item \min
+Minimum
+@iftex
@math{\min}
+@end iftex
@item \pmod
-parenthesized modulus, as in (@math{\pmod 2^n - 1})
+Parenthesized modulus, as used in @code{\( 5\equiv 2\pmod 3 \)}
+@iftex
+@math{5\equiv 2\pmod 3}
+@end iftex
@item \Pr
+Probability
+@iftex
@math{\Pr}
+@end iftex
@item \sec
+Secant
+@iftex
@math{\sec}
+@end iftex
@item \sin
+Sine
+@iftex
@math{\sin}
+@end iftex
@item \sinh
+Hyperbolic sine
+@iftex
@math{\sinh}
+@end iftex
@item \sup
@iftex
+Supremum
+@iftex
@math{\mathop {\rm sup}}
@end iftex
@ifnottex
-@math{\sup}
+sup
@end ifnottex
@c don't try to use \sup with dvi/pdf output since that turned into a
@c Texinfo command and it's not worth hassling with different versions
@c when it's just three roman letters anyway.
@item \tan
+Tangent
+@iftex
@math{\tan}
+@end iftex
@item \tanh
+Hyperbolic tangent
+@iftex
@math{\tanh}
+@end iftex
@end ftable
+@PkgIndex{amsmath}
+The @file{amsmath} package adds improvements on some of these, and also
+allows you to define your own. The full documentation is on CTAN, but
+briefly, you can define an identity operator with
+@code{\DeclareMathOperator@{\identity@}@{id@}} that is like the ones
+above but prints as @samp{id}. The starred form
+@code{\DeclareMathOperator*@{\op@}@{op@}} sets any limits above and
+below, as is traditional with @code{\lim}, @code{\sup}, or @code{\max}.
+
@node Math accents
@section Math accents
@@ -8930,70 +11962,170 @@ in math. These are different from accents in normal text
@ftable @code
@item \acute
@cindex acute accent, math
-Math acute accent: @math{\acute{x}}.
+Math acute accent
+@iftex
+@math{\acute{x}}.
+@end iftex
@item \bar
@cindex bar-over accent, math
@cindex macron accent, math
-Math bar-over accent: @math{\bar{x}}.
+Math bar-over accent
+@iftex
+@math{\bar{x}}
+@end iftex
@item \breve
@cindex breve accent, math
-Math breve accent: @math{\breve{x}}.
+Math breve accent
+@iftex
+@math{\breve{x}}
+@end iftex
@item \check
@cindex check accent, math
@cindex h@'a@v{c}ek accent, math
-Math h@'a@v{c}ek (check) accent: @math{\check{x}}.
+Math h@'a@v{c}ek (check) accent
+@iftex
+@math{\check{x}}
+@end iftex
@item \ddot
@cindex double dot accent, math
-Math dieresis accent: @math{\ddot{x}}.
+Math dieresis accent
+@iftex
+@math{\ddot{x}}
+@end iftex
@item \dot
@cindex overdot accent, math
@cindex dot over accent, math
-Math dot accent: @math{\dot{x}}.
+Math dot accent
+@iftex
+@math{\dot{x}}
+@end iftex
@item \grave
@cindex grave accent, math
-Math grave accent: @math{\grave{x}}.
+Math grave accent
+@iftex
+@math{\grave{x}}
+@end iftex
@item \hat
@cindex hat accent, math
@cindex circumflex accent, math
-Math hat (circumflex) accent: @math{\hat{x}}.
-
-@item \imath
-@cindex dotless i, math
-Math dotless i.
-
-@item \jmath
-@cindex dotless j, math
-Math dotless j.
+Math hat (circumflex) accent
+@iftex
+@math{\hat{x}}
+@end iftex
@item \mathring
@cindex ring accent, math
-Math ring accent: @ringaccent{x}. @c don't bother implementing in texinfo
+Math ring accent @c don't bother implementing in texinfo
+@iftex
+@ringaccent{x}
+@end iftex
@item \tilde
@cindex tilde accent, math
-Math tilde accent: @math{\tilde{x}}.
+Math tilde accent
+@iftex
+@math{\tilde{x}}
+@end iftex
@item \vec
@cindex vector symbol, math
-Math vector symbol: @math{\vec{x}}.
+Math vector symbol
+@iftex
+@math{\vec{x}}
+@end iftex
@item \widehat
@cindex wide hat accent, math
-Math wide hat accent: @math{\widehat{x+y}}.
+Math wide hat accent
+@iftex
+@math{\widehat{x+y}}
+@end iftex
@item \widetilde
@cindex wide tilde accent, math
-Math wide tilde accent: @math{\widetilde{x+y}}.
+Math wide tilde accent
+@iftex
+@math{\widetilde{x+y}}
+@end iftex
@end ftable
+When you are putting an accent on an i or a j, the tradition is to use
+one without a dot, @code{\imath} or @code{jmath} (@pxref{Math symbols}).
+
+
+@node Over- and Underlining
+@section Over- and Underlining
+
+@cindex overlining
+@cindex underlining
+
+@LaTeX{} provides commands for making overlines or underlines, or
+putting braces over or under some material.
+
+@ftable @code
+
+@item \underline@{@var{text}@}
+Underline @var{text}. Works inside math mode, and outside.
+@ifset HAS-MATH
+The result of @code{\underline@{xyz@}} is @math{\underline{xyz}}.
+@end ifset
+The line is always completely below the text, taking account of
+descenders, so in @code{\(\underline@{y@}\)} the line is lower than in
+@code{\(\underline@{x@}\)}. This command is fragile (@pxref{\protect}).
+
+@PkgIndex{ulem}
+Note that the package @file{ulem} does text mode underlining and allows
+line breaking as well as a number of other features. See the
+documentation on CTAN. See also@tie{}@ref{\hrulefill & \dotfill} for
+producing a line, for such things as a signature.
+
+@item \overline@{@var{text}@}
+Put a horizontal line over @var{text}. Works inside math mode, and
+outside. For example, @code{\overline@{x+y@}}.
+@ifset HAS-MATH
+The result looks like: @math{\overline{x+y}}.
+@end ifset
+Note that this differs from the command @code{\bar} (@pxref{Math
+accents}).
+
+@item \underbrace@{@var{math}@}
+Put a brace under @var{math}. For example, this
+@code{(1-\underbrace@{1/2)+(1/2@}-1/3)} emphasizes the telescoping part.
+@ifset HAS-MATH
+The result looks like this: @math{(1-\underbrace{1/2)+(1/2}-1/3)}.
+@end ifset
+Attach text to the brace by using subscript, @code{_}, or superscript,
+@code{^}, as here.
+
+@example
+\begin@{displaymath@}
+ 1+1/2+\underbrace@{1/3+1/4@}_@{>1/2@}+
+ \underbrace@{1/5+1/6+1/7+1/8@}_@{>1/2@}+\cdots
+\end@{displaymath@}
+@end example
+
+The superscript appears on top of the expression, and so can look
+unconnected to the underbrace.
+
+@item \overbrace@{@var{math}@}
+Put a brace over @var{math}, as with
+@code{\overbrace@{x+x+\cdots+x@}^@{\mbox@{\(k\) times@}@}}. See also
+@code{\underbrace}.
+
+@end ftable
+
+@PkgIndex{mathtools}
+The package @file{mathtools} adds an over- and underbrace, as well as
+some improvements on the braces. See the documentation on CTAN.
+
@node Spacing in math mode
@section Spacing in math mode
@@ -9001,43 +12133,77 @@ Math wide tilde accent: @math{\widetilde{x+y}}.
@cindex spacing within math mode
@cindex math mode, spacing
-In a @code{math} environment, @LaTeX{} ignores the spaces that you use
-in the source, and instead puts in the spacing according to the normal
-rules for mathematics texts.
+When typesetting mathematics, @LaTeX{} puts in spacing according to the
+normal rules for mathematics texts. If you enter @code{y=m x} then
+@LaTeX{} ignores the space and in the output the m is next to the x,
+as @math{y=mx}.
-Many math mode spacing definitions are expressed in terms of the math unit
-@dfn{mu} given by 1 em = 18 mu, where the em is taken from the current
-math symbols family (@pxref{Units of length}).
-@LaTeX{} provides the following commands for use in math mode:
+But @LaTeX{}'s rules sometimes need tweaking. For example, in an
+integral the tradition is to put a small extra space between the
+@code{f(x)} and the @code{dx}, here done with the @code{\,} command.
+
+@example
+\int_0^1 f(x)\,dx
+@end example
+
+@LaTeX{} provides the commands that follow for use in math mode. Many
+of these spacing definitions are expressed in terms of the math unit
+@dfn{mu}. It is defined as 1/18@dmn{em}, where the em is taken from the
+current math symbols family (@pxref{Units of length}). Thus, a
+@code{\thickspace} is something like 5/18 times the width of
+a@tie{}@samp{M}.
@table @code
@item \;
@findex \;
@findex \thickspace
-Normally @code{5.0mu plus 5.0mu}. The longer name is
-@code{\thickspace}. Math mode only.
+@anchor{spacing in math mode thickspace}
+Synonym: @code{\thickspace}. Normally @code{5.0mu plus 5.0mu}. Math
+mode only.
@item \:
@itemx \>
@findex \:
@findex \>
@findex \medspace
-Normally @code{4.0mu plus 2.0mu minus 4.0mu}. The longer name is
-@code{\medspace}. Math mode only.
+@anchor{spacing in math mode medspace}
+Synonym: @code{\medspace}. Normally @code{4.0mu plus 2.0mu minus 4.0mu}.
+Math mode only.
@item \,
@findex \,
@findex \thinspace
-Normally @code{3mu}. The longer name is @code{\thinspace}. This can
-be used in both math mode and text mode. @xref{\thinspace}.
+@cindex thin space
+@anchor{Spacing in math mode/\thinspace}
+@anchor{spacing in math mode thinspace}
+Synonym: @code{\thinspace}. Normally @code{3mu}, which is 1/6@dmn{em}.
+Can be used in both math mode and text mode (@pxref{\thinspace &
+\negthinspace}).
+
+This space is widely used, for instance between the function and the
+infinitesimal in an integral @code{\int f(x)\,dx} and, if an author does
+this, before punctuation in a displayed equation.
+
+@example
+The antiderivative is
+\begin@{equation@}
+ 3x^@{-1/2@}+3^@{1/2@}\,.
+\end@{equation@}
+@end example
@item \!
@findex \!
-A negative thin space. Normally @code{-3mu}. Math mode only.
+@findex \negthinspace
+@cindex thin space, negative
+@anchor{spacing in math mode negthinspace}
+A negative thin space. Normally @code{-3mu}. The @code{\!} command is
+math mode only but the @code{\negthinspace} command is available for
+text mode (@pxref{\thinspace & \negthinspace}).
@item \quad
@cindex quad
@findex \quad
+@anchor{spacing in math mode quad}
This is 18@dmn{mu}, that is, 1@dmn{em}. This is often used for space
surrounding equations or expressions, for instance for the space between
two equations inside a @code{displaymath} environment. It is available
@@ -9045,206 +12211,281 @@ in both text and math mode.
@item \qquad
@findex \qquad
+@anchor{spacing in math mode qquad}
A length of 2 quads, that is, 36@dmn{mu} = 2@dmn{em}. It is available in
both text and math mode.
@end table
-In this example a thinspace separates the function from the
-infinitesimal.
+
+@node Math miscellany
+@section Math miscellany
+
+@cindex math miscellany
+
+@LaTeX{} contains a wide variety of mathematics facilities. Here are
+some that don't fit into other categories.
+
+@menu
+* Colon character & \colon:: Colon.
+* \*:: Discretionary multiplication.
+* \frac:: Fraction.
+* \left & \right:: Paired delimiters.
+* \sqrt:: Radicals.
+* \stackrel:: Text over a relation.
+@end menu
+
+
+@node Colon character & \colon
+@subsection Colon character @code{:} & @code{\colon}
+
+@cindex :
+@cindex colon character
+@findex :
+@findex \colon
+
+Synopsis, one of:
@example
-\int_0^1 f(x)\,dx
+:
+\colon
@end example
+In mathematics, the colon character, @code{:}, is a relation.
-@node Math miscellany
-@section Math miscellany
+@example
+With side ratios \( 3:4 \) and \( 4:5 \), the triangle is right.
+@end example
-@cindex math miscellany
+@PkgIndex{amsmath}
+@noindent
+Ordinary @LaTeX{} defines @code{\colon} to produce the colon character
+with the spacing appropriate for punctuation, as in set-builder notation
+@code{\@{x\colon 0\leq x<1\@}}.
-@ftable @code
-@item \*
-@cindex discretionary multiplication
-@cindex multiplication symbol, discretionary line break
-A @dfn{discretionary} multiplication symbol, at which a line break is
-allowed. Without the break multiplication is implicitly indicated by a
-space, while in the case of a break a @BES{00D7,\times} symbol is
-printed immediately before the break. So
+@PkgIndex{amsmath}
+But the widely-used @file{amsmath} package defines @code{\colon} for use
+in the definition of functions @code{f\colon D\to C}. So if you want
+the colon character as a punctuation then use @code{\mathpunct@{:@}}.
+
+
+@node \*
+@subsection @code{\*}
+
+@cindex multiplication, discretionary
+@cindex breaks, multiplication discretionary
+@cindex line breaks, multiplication discretionary
+@cindex discretionary breaks, multiplication
+@findex \*
+
+Synopsis:
@example
-\documentclass@{article@}
-\begin@{document@}
-Now \(A_3 = 0\), hence the product of all terms \(A_1\)
-through \(A_4\), that is \(A_1\* A_2\* A_3 \* A_4\), is
-equal to zero.
-\end@{document@}
+\*
@end example
-will make that sort of output@c
-@ifnottex
-@w{ }(the ellipsis @samp{[@dots{}]} is here to show the line break at
-the same place as in a @TeX{} output)@c
-@end ifnottex
-:
+A multiplication symbol that allows a line break. If there is a break
+then @LaTeX{} puts a @code{\times} symbol, @BES{00D7,\times}, before
+that break.
-@indentedblock
-Now @math{A_3 = 0},
-@iftex
-hence the product of all terms
-@end iftex
-@ifnottex
-[@dots{}]
-@end ifnottex
-@math{A_1}
-through @math{A_4}, that is @math{A_1 A_2 \times}@*@math{A_3 A_4}, is
-equal to zero.
-@end indentedblock
+In @code{\( A_1\* A_2\* A_3\* A_4 \)}, if there is no line break then
+@LaTeX{} outputs it as though it were @code{\( A_1 A_2 A_3 A_4 \)}. If
+a line break does happen, for example between the two middle ones, then
+@LaTeX{} sets it like @code{\( A_1 A_2 \times \)}, followed by the
+break, followed by @code{\( A_3 A_4 \)}.
-@item \cdots
-A horizontal ellipsis with the dots raised to the center of the line.
-@tex
-As in: `$\cdots$'.
-@end tex
-@item \ddots
-A diagonal ellipsis: @math{\ddots}.
+@node \frac
+@subsection @code{\frac}
-@item \frac@{@var{num}@}@{@var{den}@}
+@cindex fraction
@findex \frac
-Produces the fraction @var{num} divided by @var{den}.
-@ifset HAS-MATH
-eg. @math{{1}\over{4}}
-@end ifset
+Synopsis:
-@item \left @var{delim1} ... \right @var{delim2}
-@findex \right
+@example
+\frac@{@var{numerator}@}@{@var{denominator}@}
+@end example
+
+Produces the fraction. Used as: @code{\begin@{displaymath@}
+\frac@{1@}@{\sqrt@{2\pi\sigma@}@} \end@{displaymath@}}. In inline math
+mode it comes out small; see the discussion of @code{\displaystyle}
+(@pxref{Math formulas}).
+
+
+@node \left & \right
+@subsection @code{\left} & @code{\right}
+
+@cindex delimiters, paired
+@cindex paired delimiters
+@cindex matching parentheses
+@cindex matching brackets
@cindex null delimiter
-The two delimiters need not match; @samp{.} acts as a @dfn{null delimiter},
-producing no output. The delimiters are sized according to the math
-in between. Example: @code{\left( \sum_@{i=1@}^@{10@} a_i \right]}.
+@findex \left
+@findex \right
-@item \mathdollar
-Dollar sign in math mode: $.
+Synopsis:
-@item \mathellipsis
-Ellipsis (spaced for text) in math mode: @dots{}.
+@example
+\left @var{delimiter1} ... \right @var{delimiter2}
+@end example
-@item \mathparagraph
-Paragraph sign (pilcrow) in math mode: @BES{00B6,\P}.
+Make matching parentheses, braces, or other delimiters. The delimiters
+are sized according to the math they enclose. This makes a unit vector
+surrounded by appropriate-height parentheses.
-@item \mathsection
-Section sign in math mode.
+@example
+\begin@{equation@}
+ \left(\begin@{array@}@{c@}
+ 1 \\
+ 0 \\
+ \end@{array@}\right)
+@end example
-@item \mathsterling
-Sterling sign in math mode: @pounds{}.
+Every @code{\left} must have a matching @code{\right}. Leaving out the
+@code{\left(} in the above gets @samp{Extra \right}. Leaving off the
+@code{\right)} gets @samp{You can't use `\eqno' in math mode}.
-@item \mathunderscore
-Underscore in math mode: _.
+However, the two delimiters @var{delimiter1} and @var{delimiter2} need
+not match. A common case is that you want an unmatched brace, as
+below. Use a period, @samp{.}, as a null delimiter.
-@item \overbrace@{@var{math}@}
-Generates a brace over @var{math}.
-For example, @code{\overbrace@{x+\cdots+x@}^@{k \;\textrm@{times@}@}}.
-@ifset HAS-MATH
-The result looks like: @math{\overbrace{x+\cdots+x}^{k \rm\;times}}
-@end ifset
-
-@item \overline@{@var{text}@}
-Generates a horizontal line over @var{tex}.
-For example, @code{\overline@{x+y@}}.
-@ifset HAS-MATH
-The result looks like: @math{\overline{x+y}}.
-@end ifset
+@example
+\begin@{equation@}
+ f(n)=\left\@{\begin@{array@}@{ll@}
+ 1 &\mbox@{--if \(n=0\)@} \\
+ f(n-1)+3n^2 &\mbox@{--else@}
+ \end@{array@}\right.
+\end@{equation@}
+@end example
-@item \sqrt[@var{root}]@{@var{arg}@}
-Produces the representation of the square root of @var{arg}. The
-optional argument @var{root} determines what root to produce. For
-example, the cube root of @code{x+y} would be typed as
-@code{\sqrt[3]@{x+y@}}.
-@ifset HAS-MATH
-The result looks like this: @math{\root 3 \of {x+y}}.
-@end ifset
+@noindent
+Note that to get a curly brace as a delimiter you must prefix it with a
+backslash, @code{\@{}.
-@item \stackrel@{@var{text}@}@{@var{relation}@}
-Puts @var{text} above @var{relation}. For example,
-@code{\stackrel@{f@}@{\longrightarrow@}}.
-@ifset HAS-MATH
- The result looks like this: @math{\buildrel f \over \longrightarrow}.
-@end ifset
-@item \underbrace@{@var{math}@}
-Generates @var{math} with a brace underneath. For example, @code{\underbrace@{x+y+z@}_@{>\,0@}}
-@ifset HAS-MATH
-The result looks like this: @math{\underbrace{x+y+z}_{>\,0}}.
-@end ifset
+@node \sqrt
+@subsection @code{\sqrt}
-@item \underline@{@var{text}@}
-Causes @var{text}, which may be either math mode or not, to be
-underlined. The line is always below the text, taking account of
-descenders.
+@cindex square root
+@cindex roots
+@cindex radical
+@findex \sqrt
+
+Synopsis, one of:
+
+@example
+\sqrt@{@var{arg}@}
+\sqrt[@var{root-number}]@{@var{arg}@}
+@end example
+
+The square root, or optionally other roots, of @var{arg}. The optional
+argument @var{root-number} gives the root, i.e., enter the cube root of
+@code{x+y} as @code{\sqrt[3]@{x+y@}}.
@ifset HAS-MATH
-The result looks like this: @math{\underline{xyz}}
+It comes out like this: @math{\root 3 \of {x+y}}.
@end ifset
+The radical grows with the size of @var{arg} (as the height of the
+radical grows, the angle on the leftmost part gets steeper, until for
+a large enough @code{arg}, it is vertical).
-@item \vdots
-Produces a vertical ellipsis.
+@LaTeX{} has a separate @code{\surd} character (@pxref{Math symbols}).
+
+
+@node \stackrel
+@subsection @code{\stackrel}
+
+@cindex stack math
+@cindex relation, text above
+@findex \stackrel
+
+Synopsis, one of:
+
+@example
+\stackrel@{@var{text}@}@{@var{relation}@}
+@end example
+
+Put @var{text} above @var{relation}. To put a function name above an
+arrow enter @code{\stackrel@{f@}@{\longrightarrow@}}.
@ifset HAS-MATH
-The result looks like this: @math{\vdots}.
+ The result looks like this: @math{\buildrel f \over \longrightarrow}.
@end ifset
-@end ftable
-
@node Modes
@chapter Modes
@cindex modes
+
+As @LaTeX{} processes your document, at any point it is in one of six
+modes. They fall into three categories of two each, the horizontal
+modes, the math modes, and the vertical modes. Some commands only work
+in one mode or another (in particular, many commands only work in one of
+the math modes), and error messages will refer to these.
+
+@itemize
+@item
+@anchor{modes paragraph mode}
@cindex paragraph mode
-@cindex math mode
+@dfn{Paragraph mode} is what @LaTeX{} is in when processing ordinary
+text. It breaks the input text into lines and breaks the lines into
+pages. This is the mode @LaTeX{} is in most of the time.
+
@cindex left-to-right mode
@cindex LR mode
+@anchor{modes lr mode}
+@dfn{LR mode} (for left-to-right mode; in plain @TeX{} this is called
+@dfn{restricted horizontal mode}) is in effect when @LaTeX{} starts
+making a box with an @code{\mbox} command. As in paragraph mode,
+@LaTeX{}'s output is a string of words with spaces between them. Unlike
+in paragraph mode, in LR mode @LaTeX{} never starts a new line, it just
+keeps going from left to right. (Although @LaTeX{} will not complain
+that the LR box is too long, when it is finished and next tries to put
+that box into a line, it could very well complain that the finished LR
+box won't fit there.)
-When @LaTeX{} is processing your input text, it is always in one of three
-modes:
-
-@itemize @bullet
@item
-Paragraph mode
-@item
-Math mode
+@cindex math mode
+@anchor{modes math mode} @dfn{Math mode} is when @LaTeX{} is generating
+an inline mathematical formula.
+
+@cindex display math mode
+@dfn{Display math mode} is when @LaTeX{} is generating a displayed
+mathematical formula. (Displayed formulas differ somewhat from inline
+ones. One example is that the placement of the subscript on @code{\int}
+differs in the two situations.)
+
@item
-Left-to-right mode, called LR mode for short
+@cindex vertical mode
+@anchor{modes vertical mode}
+@dfn{Vertical mode} is when @LaTeX{} is building the list of lines and
+other material making the output page. This is the mode @LaTeX{} is in
+when it starts a document.
+
+@cindex internal vertical mode
+@anchor{modes internal vertical mode}
+@dfn{Internal vertical mode} is in effect when @LaTeX{} starts making a
+@code{\vbox}. This is the vertical analogue of LR mode.
+
@end itemize
-Mode changes occur only when entering or leaving an environment, or when
-@LaTeX{} is processing the argument of certain text-producing commands.
-
-@dfn{Paragraph mode} is the most common; it's the one @LaTeX{} is in
-when processing ordinary text. In this mode, @LaTeX{} breaks the
-input text into lines and breaks the lines into pages.
-
-@LaTeX{} is in @dfn{math mode} when it's generating a mathematical
-formula, either displayed math or within a line.
-
-@findex \mbox@r{, and LR mode}
-In @dfn{LR mode}, as in paragraph mode, @LaTeX{} considers the output
-that it produces to be a string of words with spaces between them.
-However, unlike paragraph mode, @LaTeX{} keeps going from left to
-right; it never starts a new line in LR mode. Even if you put a
-hundred words into an @code{\mbox}, @LaTeX{} would keep typesetting
-them from left to right inside a single box (and then most likely
-complain because the resulting box was too wide to fit on the line).
-@LaTeX{} is in LR mode when it starts making a box with an
-@code{\mbox} command. You can get it to enter a different mode inside
-the box---for example, you can make it enter math mode to put a
-formula in the box.
-
-There are also several text-producing commands and environments for
-making a box that put @LaTeX{} into paragraph mode. The box made by
-one of these commands or environments will be called a @code{parbox}.
-When @LaTeX{} is in paragraph mode while making a box, it is said to
-be in ``inner paragraph mode'' (no page breaks). Its normal paragraph
-mode, which it starts out in, is called ``outer paragraph mode''.
+@noindent
+For instance, if you begin a @LaTeX{} article with @samp{Let \( x \) be
+...} then these are the modes: first @LaTeX{} starts every document in
+vertical mode, then it reads the @samp{L} and switches to paragraph
+mode, then the next switch happens at the @samp{\(} where @LaTeX{}
+changes to math mode, and then when it leaves the formula it pops
+back to paragraph mode.
+
+@cindex inner paragraph mode
+@cindex outer paragraph mode
+@anchor{modes inner paragraph mode}
+@anchor{modes outer paragraph mode}
+Paragraph mode has two subcases. If you use a @code{\parbox} command or
+or a @code{minipage} then @LaTeX{} is put into paragraph mode. But it
+will not put a page break here. Inside one of these boxes, called a
+@dfn{parbox}, @LaTeX{} is in @dfn{inner paragraph mode}. Its more usual
+situation, where it can put page breaks, is @dfn{outer paragraph mode}
+(@pxref{Page breaking}).
@menu
* \ensuremath:: Ensure that math mode is active
@@ -9259,37 +12500,27 @@ Synopsis:
\ensuremath@{@var{formula}@}
@end example
-The @code{\ensuremath} command ensures that @var{formula} is typeset in
-math mode whatever the current mode in which the command is used.
+Ensure that @var{formula} is typeset in math mode.
-For instance:
+For instance, you can redefine commands that ordinarily can be used only
+in math mode, so that they can be used both in math and in plain text.
@example
-\documentclass@{report@}
-\newcommand@{\ab@}@{\ensuremath@{(\delta, \varepsilon)@}@}
-\begin@{document@}
-Now, the \ab\ pair is equal to \(\ab = (\frac@{1@}@{\pi@}, 0)\), ...
-\end@{document@}
+\newcommand@{\dx@}@{\ensuremath@{dx@}@}
+In $\int f(x)\, \dx$, the \dx@{@} is an infinitesimal.
@end example
-One can redefine commands that can be used only in math mode so that
-they ca be used in any mode like in the following example given for
-@code{\leadsto}:
+Caution: the @code{\ensuremath} command is useful but not a panacea.
-@c Vincent 2 Karl : "Tous les chemins mènent à Rome" is a French saying
-@c meaning that there are many different ways to get the same result. I
-@c am not sure whether in English the given example is also funny.
@example
-\documentclass@{report@}
-\usepackage@{amssymb@}
-\newcommand@{\originalMeaningOfLeadsTo@}@{@}
-\let\originalMeaningOfLeadsTo\leadsto
-\renewcommand\leadsto@{\ensuremath@{\originalMeaningOfLeadsTo@}@}
-\begin@{document@}
-All roads \leadsto\ Rome.
-\end@{document@}
+\newcommand@{\alf@}@{\ensuremath@{\alpha@}@}
+You get an alpha in text mode: \alf.
+But compare the correct spacing in $\alf+\alf$ with that in \alf+\alf.
@end example
+@noindent
+Best is to typeset math things in a math mode.
+
@node Page styles
@chapter Page styles
@@ -9297,8 +12528,15 @@ All roads \leadsto\ Rome.
@cindex styles, page
@cindex page styles
-The @code{\documentclass} command determines the size and position of
-the page's head and foot. The page style determines what goes in them.
+The style of a page determines where @LaTeX{} places the components of
+that page, such as headers and footers, and the text body. This
+includes pages in the main part of the document but also includes
+special pages such as the title page of a book, a page from an index, or
+the first page of an article.
+
+@PkgIndex{fancyhdr}
+The package @file{fancyhdr} is very helpful for constructing page
+styles. See its documentation on CTAN.
@menu
* \maketitle:: Generate a title page.
@@ -9314,41 +12552,89 @@ the page's head and foot. The page style determines what goes in them.
@cindex titles, making
@findex \maketitle
-The @code{\maketitle} command generates a title on a separate title
-page---except in the @code{article} class, where the title is placed
-at the top of the first page. Information used to produce the title
-is obtained from the following declarations:
+Synopsis:
+
+@example
+\maketitle
+@end example
+
+Generate a title. In the standard classes the title appears on a
+separate page, except in the @code{article} class where it is at the top
+of the first page. (@xref{Document class options} for information about
+the @code{titlepage} document class option.)
+
+This example shows @code{\maketitle} appearing in its usual place,
+immediately after @code{\begin@{document@}}.
+
+@example
+\documentclass@{article@}
+\title@{Constructing a Nuclear Reactor Using Only Coconuts@}
+\author@{Jonas Grumby\thanks@{%
+ With the support of a Ginger Grant from the Roy Hinkley Society.@} \\
+ Skipper, \textit@{Minnow@}
+ \and
+ Willy Gilligan\thanks@{%
+ Thanks to the Mary Ann Summers foundation
+ and to Thurston and Lovey Howell.@} \\
+ Mate, \textit@{Minnow@}
+ @}
+\date@{1964-Sep-26@}
+\begin@{document@}
+\maketitle
+Just sit right back and you'll hear a tale, a tale of a fateful trip.
+That started from this tropic port, aboard this tiny ship. The mate was
+a mighty sailin' man, the Skipper brave and sure. Five passengers set
+sail that day for a three hour tour. A three hour tour.
+ ...
+@end example
+
+You tell @LaTeX{} the information used to produce the title by making
+the following declarations. These must come before the
+@code{\maketitle}, either in the preamble or in the document body.
@ftable @code
-@item \author@{@var{name} \and @var{name2}@}
+@item \author@{@var{name1} \and @var{name2} \and ...@}
@cindex author, for titlepage
@findex \\ @r{for @code{\author}}
@findex \and @r{for @code{\author}}
-The @code{\author} command declares the document author(s), where the
-argument is a list of authors separated by @code{\and} commands. Use
-@code{\\} to separate lines within a single author's entry---for
-example, to give the author's institution or address.
+Required. Declare the document author or authors. The argument is a
+list of authors separated by @code{\and} commands. To separate lines
+within a single author's entry, for instance to give the author's
+institution or address, use a double backslash, @code{\\}. If you omit
+the @code{\author} declaration then you get @samp{LaTeX Warning: No
+\author given}.
@item \date@{@var{text}@}
@cindex date, for titlepage
-The @code{\date} command declares @var{text} to be the document's
-date. With no @code{\date} command, the current date (@pxref{\today})
-is used.
+Optional. Declare @var{text} to be the document's date. The @var{text}
+doesn't need to be in a date format; it can be any text at all. If you
+omit @code{\date} then @LaTeX{} uses the current date (@pxref{\today}).
+To have no date, instead use @code{\date@{@}}.
@item \thanks@{@var{text}@}
@cindex thanks, for titlepage
@cindex credit footnote
-The @code{\thanks} command produces a @code{\footnote} to the title,
-usually used for credit acknowledgements.
+Optional. Produce a footnote. You can use it in the author information
+for acknowledgements, as illustrated below, but you can also use it in
+the title, or any place a footnote makes sense. It can be any text so
+you can use it to print an email address, or for any purpose.
@item \title@{@var{text}@}
@cindex title, for titlepage
@findex \\ @r{for @code{\title}}
-The @code{\title} command declares @var{text} to be the title of the
-document. Use @code{\\} to force a line break, as usual.
+Required. Declare @var{text} to be the title of the document. Get line
+breaks inside @var{text} with a double backslash, @code{\\}. If you
+omit the @code{\title} declaration then you get @samp{LaTeX Error: No
+\title given}.
@end ftable
+Many publishers will provide a class to use in place of @code{article}
+in that example, that formats the title according to their house
+requirements. To make your own, see@tie{}@ref{titlepage}. You can
+either create this as a one-off or you can include it as part of a
+renewed @code{\maketitle} command.
+
@node \pagenumbering
@section @code{\pagenumbering}
@@ -9359,30 +12645,65 @@ document. Use @code{\\} to force a line break, as usual.
Synopsis:
@example
-\pagenumbering@{@var{style}@}
+\pagenumbering@{@var{number-style}@}
+@end example
+
+Specifies the style of page numbers, and resets the page number. The
+numbering style is reflected on the page, and also in the table of
+contents and other page references. This declaration has global scope
+so its effect is not delimited by braces or environments.
+
+In this example, before the Main section the pages are numbered
+@samp{a}, etc. Starting on the page containing that section, the pages
+are numbered @samp{1}, etc.
+
+@example
+\begin@{document@}\pagenumbering@{alph@}
+ ...
+\section@{Main@}\pagenumbering@{arabic@}
+ ...
@end example
-Specifies the style of page numbers, according to @var{style}; also
-resets the page number to 1. The @var{style} argument is one of
-the following:
+The argument @var{number-style} is one of the following (see
+also@tie{}@ref{\alph \Alph \arabic \roman \Roman \fnsymbol}).
@table @code
@item arabic
-arabic numerals
+arabic numerals: 1, 2, @dots{}
@item roman
-lowercase Roman numerals
+lowercase Roman numerals: i, ii, @dots{}
@item Roman
-uppercase Roman numerals
+uppercase Roman numerals: I, II, @dots{}
@item alph
-lowercase letters
+lowercase letters: a, b, @dots{} If you have more than 26 pages then you
+get @samp{LaTeX Error: Counter too large}.
@item Alph
-uppercase letters
+uppercase letters: A, B, @dots{} If you have more than 26 pages then you
+get @samp{LaTeX Error: Counter too large}.
+
+@item gobble
+@PkgIndex{hyperref} @LaTeX{} does not output a page number, although it
+does get reset. References to that page also are blank. (This does not
+work with the popular package @file{hyperref} so to have the page number
+not appear you may want to instead use @code{\pagestyle@{empty@}} or
+@code{\thispagestyle@{empty@}}.)
+
@end table
+Traditionally, if a document has front matter---preface, table of
+contents, etc.---then it is numbered with lowercase Roman numerals. The
+main matter of a document uses arabic. @xref{\frontmatter & \mainmatter
+& \backmatter}.
+
+If you want to address where the page number appears on the page,
+see@tie{}@ref{\pagestyle}. If you want to change the value of page
+number then you will manipulate the @code{page} counter
+(@pxref{Counters}).
+
@node \pagestyle
@section @code{\pagestyle}
@@ -9398,19 +12719,28 @@ Synopsis:
\pagestyle@{@var{style}@}
@end example
-The @code{\pagestyle} command specifies how the headers and footers
-are typeset from the current page onwards. Values for @var{style}:
+Declaration that specifies how the page headers and footers are typeset,
+from the current page onwards.
+
+@PkgIndex{fancyhdr}
+A discussion with an example is below. Note first that the package
+@file{fancyhdr} is now the standard way to manipulate headers and
+footers. New documents that need to do anything other than one of the
+standard options below should use this package. See its documentation
+on CTAN.
+
+Values for @var{style}:
@table @code
@item plain
-Just a plain page number.
+The header is empty. The footer contains only a page number, centered.
@item empty
-Empty headers and footers, e.g., no page numbers.
+The header and footer is empty.
@item headings
-Put running headers on each page. The document style specifies what
-goes in the headers.
+Put running headers and footers on each page. The document style
+specifies what goes in there; see the discussion below.
@item myheadings
Custom headers, specified via the @code{\markboth} or the
@@ -9418,31 +12748,104 @@ Custom headers, specified via the @code{\markboth} or the
@end table
+Some discussion of the motivation for @LaTeX{}'s mechanism will help you
+work with the options @code{headings} or @code{myheadings}. The
+document source below produces an article, two-sided, with the pagestyle
+@code{headings}. On this document's left hand pages, @LaTeX{} wants (in
+addition to the page number) the title of the current section. On its
+right hand pages @LaTeX{} wants the title of the current subsection.
+When it makes up a page, @LaTeX{} gets this information from the
+commands @code{\leftmark} and @code{\rightmark}. So it is up to
+@code{\section} and @code{\subsection} to store that information there.
+
+@example
+\documentclass[twoside]@{article@}
+\pagestyle@{headings@}
+\begin@{document@}
+ ... \section@{Section 1@} ... \subsection@{Subsection 1.1@} ...
+\section@{Section 2@}
+ ...
+\subsection@{Subsection 2.1@}
+ ...
+\subsection@{Subsection 2.2@}
+ ...
+@end example
+
+@noindent
+Suppose that the second section falls on a left page. Although when the
+page starts it is in the first section, @LaTeX{} will put
+@samp{Section@tie{}2} in the left page header. As to the right header,
+if no subsection starts before the end of the right page then @LaTeX{}
+blanks the right hand header. If a subsection does appear before the
+right page finishes then there are two cases. If at least one
+subsection starts on the right hand page then @LaTeX{} will put in the
+right header the title of the first subsection starting on that right
+page. If at least one of 2.1, 2.2, @dots{}, starts on the left page but
+none starts on the right then @LaTeX{} puts in the right hand header the
+title of the last subsection to start, that is, the one in effect during
+the right hand page.
+
+To accomplish this, in a two-sided article, @LaTeX{} has @code{\section}
+issue a command @code{\markboth}, setting @code{\leftmark}
+to @samp{Section@tie{}2} and setting @code{\rightmark} to blank.
+And, @LaTeX{} has @code{\subsection} issue a command @code{\markright},
+setting @code{\rightmark} to @samp{Subsection@tie{}2.1}, etc.
+
Here are the descriptions of @code{\markboth} and @code{\markright}:
@ftable @code
-@item \markboth@{@var{left}@}@{@var{right}@}
-Sets both the left and the right heading. A ``left-hand heading''
-(@var{left}) is generated by the last @code{\markboth} command before
-the end of the page, while a ``right-hand heading'' (@var{right}) is
-generated by the first @code{\markboth} or @code{\markright} that
-comes on the page if there is one, otherwise by the last one before
-the page.
+@item \markboth@{@var{left-head}@}@{@var{right-head}@}
+Sets both the right hand and left hand heading information for either a
+page style of @code{headings} or @code{myheadings}. A left hand page
+heading @var{left-head} is generated by the last @code{\markboth}
+command before the end of the page. A right hand page heading
+@var{right-head} is generated by the first @code{\markboth} or
+@code{\markright} that comes on the page if there is one, otherwise by
+the last one that came before that page.
@item \markright@{@var{right}@}
-Sets the right heading, leaving the left heading unchanged.
+Sets the right hand page heading, leaving the left unchanged.
@end ftable
@node \thispagestyle
-@section @code{\thispagestyle@{@var{style}@}}
+@section @code{\thispagestyle}
@findex \thispagestyle
+@cindex page style, this page
+
+Synopsis:
+
+@example
+\thispagestyle@{@var{style}@}
+@end example
+
+Works in the same way as the @code{\pagestyle} (@pxref{\pagestyle}),
+except that it changes to @var{style} for the current page only. This
+declaration has global scope, so its effect is not delimited by braces
+or environments.
+
+Often the first page of a chapter or section has a different style. For
+example, this @LaTeX{} book document has the first page of the first
+chapter in in @code{plain} style, as is the default (@pxref{Page
+styles}).
+
+@example
+\documentclass@{book@}
+\pagestyle@{headings@}
+\begin@{document@}
+\chapter@{First chapter@}
+ ...
+\chapter@{Second chapter@}\thispagestyle@{empty@}
+ ...
+@end example
-The @code{\thispagestyle} command works in the same manner as the
-@code{\pagestyle} command (see previous section) except that it
-changes to @var{style} for the current page only.
+@noindent
+The @code{plain} style has a page number on it, centered in the footer.
+To make the page entirely empty, the command
+@code{\thispagestyle@{empty@}} immediately follows the second
+@code{\chapter}.
@node Spaces
@@ -9451,59 +12854,131 @@ changes to @var{style} for the current page only.
@cindex spaces
@cindex white space
-@LaTeX{} has many ways to produce white (or filled) space.
+@LaTeX{} has many ways to produce white (or filled) space. Some of
+these are best suited to mathematical text; see@tie{}@ref{Spacing in
+math mode}. Some spacing commands are suitable for both regular text
+and mathematical text; versions of some of these commands are in this
+chapter.
@menu
Horizontal space
-* \hspace:: Fixed horizontal space.
-* \hfill:: Stretchable horizontal space.
-* \spacefactor:: Stretchability of following space
-* \(SPACE) after control sequence:: Space (gobbling) after a control sequence.
-* \thinspace:: One-sixth of an em.
-* \/:: Insert italic correction.
-* \hrulefill \dotfill:: Stretchable horizontal rule or dots.
+* \enspace & \quad & \qquad:: Traditional horizontal spaces.
+* \hspace:: Any horizontal space.
+* \hfill:: Stretchable horizontal space.
+* \hss:: Infinitely stretchable/shrinkable horizontal space.
+* \spacefactor:: Stretchability of following space
+* \(SPACE):: Backslash-space; and explicit space.
+* ~:: Tie, an unbreakable space.
+* \thinspace & \negthinspace:: One-sixth of an em, and negative one-sixth.
+* \/:: Italic correction.
+* \hrulefill & \dotfill:: Stretchable horizontal rule or dots.
Vertical space
-* \addvspace:: Add arbitrary vertical space if needed.
-* \bigskip \medskip \smallskip:: Fixed vertical spaces.
-* \vfill:: Infinitely stretchable vertical space.
-* \vspace:: Add arbitrary vertical space.
+* \bigskip & \medskip & \smallskip:: Inter-paragraph vertical spaces.
+* \bigbreak & \medbreak & \smallbreak:: Inter-paragraph space and page breaks.
+* \strut:: Ensure height of a line.
+* \vspace:: Vertical space.
+* \vfill:: Stretchable vertical space.
+* \addvspace:: Add arbitrary vertical space if needed.
@end menu
+@node \enspace & \quad & \qquad
+@section @code{\enspace} & @code{\quad} & @code{\qquad}
+
+@findex \enspace
+@findex \quad
+@findex \qquad
+
+Synopsis, one of:
+
+@example
+\enspace
+\quad
+\qquad
+@end example
+
+Insert a horizontal space of 1/2@dmn{em}, 1@dmn{em}, or 2@dmn{em}. The
+em is a length defined by a font designer, often thought of as being the
+width of a capital@tie{}M. One advantage of describing space in ems is
+that it can be more portable across documents than an absolute
+measurement such as points (@pxref{Lengths/em}).
+
+This puts a suitable gap between two graphics.
+
+@example
+\begin@{center@}
+ \includegraphics@{womensmile.png@}%
+ \qquad\includegraphics@{mensmile.png@}
+\end@{center@}
+@end example
+
+@noindent
+@xref{Spacing in math mode} for @code{\quad} and @code{\qquad}. These
+are lengths from centuries of typesetting and so may be a better choice
+in many circumstances than arbitrary lengths, such as you get with
+@code{\hspace}.
+
+
@node \hspace
@section @code{\hspace}
@findex \hspace
-Synopsis:
+Synopsis, one of:
@example
\hspace@{@var{length}@}
\hspace*@{@var{length}@}
@end example
-Add the horizontal space given by @var{length}. The @var{length} is a
-rubber length, that is, it may contain a @code{plus} or @code{minus}
-component, in any unit that @LaTeX{} understands (@pxref{Lengths}).
+Insert the horizontal space @var{length}. The @var{length} can be
+positive, negative, or zero; adding negative space is like backspacing.
+It is a rubber length, that is, it may contain a @code{plus} or
+@code{minus} component, or both (@pxref{Lengths}). Because the space is
+stretchable and shrinkable, it is sometimes called @dfn{glue}.
-This command can add both positive and negative space; adding negative
-space is like backspacing.
+This makes a line with @samp{Name:} an inch from the right margin.
-Normally when @TeX{} breaks a paragraph into lines it discards white
-space (glues and kerns) that would come at the start of a line, so you
-get an inter-word space or a line break between words but not both. This
-command's starred version @code{\hspace*@{...@}} puts a non-discardable
-invisible item in front of the space, so the space appears in the
-output.
+@example
+\noindent\makebox[\linewidth][r]@{Name:\hspace@{1in@}@}
+@end example
-This example make a one-line paragraph that puts @samp{Name:} an inch
-from the right margin.
+The @code{*}-version inserts horizontal space that non-discardable.
+More precisely, when @TeX{} breaks a paragraph into lines any white
+space---glues and kerns---that come at a line break are discarded. The
+@code{*}-version avoids that (technically, it adds a non-discardable
+invisible item in front of the space).
+
+In this example
@example
-\noindent\makebox[\linewidth]@{\hspace@{\fill@}Name:\hspace@{1in@}@}
+\parbox@{0.8\linewidth@}@{%
+ Fill in each blank: Four \hspace*@{1in@} and seven years ago our
+ fathers brought forth on this continent, a new \hspace*@{1in@},
+ conceived in \hspace*@{1in@}, and dedicated to the proposition
+ that all men are created \hspace*@{1in@}.@}
@end example
+@noindent
+the 1@tie{}inch blank following @samp{conceived in} falls at the start
+of a line. If you erase the @code{*} then @LaTeX{} discards the blank.
+
+Here, the @code{\hspace} separates the three graphics.
+
+@example
+\begin@{center@}
+ \includegraphics@{lion.png@}% comment keeps out extra space
+ \hspace@{1cm minus 0.25cm@}\includegraphics@{tiger.png@}%
+ \hspace@{1cm minus 0.25cm@}\includegraphics@{bear.png@}
+\end@{center@}
+@end example
+
+@noindent
+Because the argument to each @code{\hspace} has @code{minus 0.25cm},
+each can shrink a little if the three figures are too wide. But each
+space won't shrink more than 0.25@dmn{cm} (@pxref{Lengths}).
+
@node \hfill
@section @code{\hfill}
@@ -9512,14 +12987,77 @@ from the right margin.
@cindex stretch, infinite horizontal
@cindex infinite horizontal stretch
-Produce a rubber length which has
-no natural space but can stretch horizontally as far as
-needed (@pxref{Lengths}).
+
+Synopsis:
+
+@example
+\hfill
+@end example
+
+Produce a rubber length which has no natural space but that can stretch
+horizontally as far as needed (@pxref{Lengths}).
+
+This creates a one-line paragraph with @samp{Name:} on the left side
+of the page and @samp{Quiz One} on the right.
+
+@example
+\noindent Name:\hfill Quiz One
+@end example
@findex \fill
-The command @code{\hfill} is equivalent to @code{\hspace@{\fill@}}. For
-space that does not disappear at line breaks use
-@code{\hspace*@{\fill@}} instead (@pxref{\hspace}).
+The @code{\hfill} command is equivalent to @code{\hspace@{\fill@}} and
+so the space can be discarded at line breaks. To avoid that instead use
+@code{\hspace*@{\fill@}} (@pxref{\hspace}).
+
+Here the graphs are evenly spaced in the middle of the figure.
+
+@example
+\newcommand*@{\vcenteredhbox@}[1]@{\begin@{tabular@}@{@@@{@}c@@@{@}@}#1\end@{tabular@}@}
+ ...
+\begin@{figure@}
+ \hspace*@{\fill@}%
+ \vcenteredhbox@{\includegraphics@{graph0.png@}@}%
+ \hfill\vcenteredhbox@{\includegraphics@{graph1.png@}@}%
+ \hspace*@{\fill@}%
+ \caption@{Comparison of two graphs@} \label@{fig:twographs@}
+\end@{figure@}
+@end example
+
+@noindent
+Note the @code{\hspace*}'s where the space could otherwise be dropped.
+
+
+@node \hss
+@section @code{\hss}
+
+@findex \hss
+@cindex horizontal space
+@cindex horizontal space, stretchable
+@cindex space, inserting horizontal
+
+Synopsis:
+
+@example
+\hss
+@end example
+
+Produce a horizontal space that is infinitely shrinkable as well as
+infinitely stretchable (this command is a @TeX{} primitive). @LaTeX{}
+authors should reach first for the @code{\makebox} command to get the
+effects of @code{\hss} (@pxref{\mbox & \makebox}).
+
+Here, the first line's @code{\hss} makes the Z stick out to the right,
+overwriting the Y. In the second line the Z sticks out to the left,
+overwriting the X.
+
+@example
+X\hbox to 0pt@{Z\hss@}Y
+X\hbox to 0pt@{\hss Z@}Y
+@end example
+
+@noindent
+Without the @code{\hss} you get something like @samp{Overfull \hbox
+(6.11111pt too wide) detected at line 20}.
@node \spacefactor
@@ -9532,24 +13070,26 @@ Synopsis:
@end example
@findex \spacefactor
-While @LaTeX{} is making the page, to give the lines the best appearance
-it may stretch or shrink the gaps between words. The
-@code{\spacefactor} command (from Plain@tie{}@TeX{}) allows you to
-change the @LaTeX{}'s default behavior.
+Influence @LaTeX{}'s glue stretch and shrink behavior. Most user-level
+documents do not use this command.
+
+While @LaTeX{} is laying out the material, it may stretch or shrink the
+gaps between words. (This space is not a character; it is called the
+@dfn{interword glue}; @pxref{\hspace}). The @code{\spacefactor} command
+(from Plain@tie{}@TeX{}) allows you to, for instance, have the space
+after a period stretch more than the space after a word-ending letter.
After @LaTeX{} places each character, or rule or other box, it sets a
parameter called the @dfn{space factor}. If the next thing in the input
-is a space then this parameter affects how much of a horizontal gap
-@LaTeX{} will have it span. (This gap is not a character; it is called
-@dfn{interword glue}.) A larger space factor means that the glue gap
-can stretch more and shrink less.
-
-Normally, the space factor is 1000; this value is in effect following
-most characters, and any non-character box or math formula. But it is
-3000 after a period, exclamation mark, or question mark, it is 2000
-after a colon, 1500 after a semicolon, 1250 after a comma, and 0 after a
-right parenthesis or bracket, or closing double quote or single quote.
-Finally, it is 999 after a capital letter.
+is a space then this parameter affects how much stretching or shrinking
+can happen. A space factor that is larger than the normal value means
+that the glue can stretch more and shrink less. Normally, the space
+factor is 1000. This value is in effect following most characters, and
+any non-character box or math formula. But it is 3000 after a period,
+exclamation mark, or question mark, it is 2000 after a colon, 1500 after
+a semicolon, 1250 after a comma, and 0 after a right parenthesis or
+bracket, or closing double quote or single quote. Finally, it is 999
+after a capital letter.
If the space factor@tie{}@var{f} is 1000 then the glue gap will be the
font's normal space value (for Computer Modern Roman 10 point this is
@@ -9558,65 +13098,103 @@ than 2000 then @TeX{} adds the font's extra space value (for Computer
Modern Roman 10 point this is 1.11111@tie{}points), and then the font's
normal stretch value is multiplied by @math{f /1000} and the normal
shrink value is multiplied by @math{1000/f} (for Computer Modern Roman
-10 point these are 1.66666 and 1.11111@tie{}points). In short, compared
-to a normal space, such as the space following a word ending in a
-lowercase letter, inter-sentence spacing has a fixed extra space added
-and then the space can stretch 3 times as much and shrink 1/3 as much.
-
-The rules for how @TeX{} uses space factors are even more complex
-because they play two more roles. In practice, there are two
-consequences. First, if a period or other punctuation is followed by a
-close parenthesis or close double quote then its effect is still in
-place, that is, the following glue will have increased stretch and
-shrink. Second, conversely, if punctuation comes after a capital letter
-then its effect is not in place so you get an ordinary space. For how
-to adjust to this second case, for instance if an abbreviation does not
-end in a capital letter, @pxref{\(SPACE) and \@@}.
+10 point these are 1.66666 and 1.11111@tie{}points).
+
+For example, consider the period ending @code{A man's best friend is his
+dog.} After it, @TeX{} puts in a fixed extra space, and also allows the
+glue to stretch 3 times as much and shrink 1/3 as much, as the glue
+after @code{friend}, which does not end in a period.
+
+The rules for space factors are even more complex because they play
+additional roles. In practice, there are two consequences. First, if a
+period or other punctuation is followed by a right parenthesis or
+bracket, or right single or double quote then the spacing effect of that
+period carries through those characters (that is, the following glue
+will have increased stretch and shrink). Second, if
+punctuation comes after a capital letter then its effect is not in place
+so you get an ordinary space. This second case also affects abbreviations
+that do not end in a capital letter (@pxref{\@@}).
+
+You can only use @code{\spacefactor} in paragraph mode or LR mode
+(@pxref{Modes}). You can see the current value with
+@code{\the\spacefactor} or @code{\showthe\spacefactor}.
+
+(Comment, not really related to @code{\spacefactor}: if you get errors
+like @samp{You can't use `\spacefactor' in vertical mode}, or @samp{You
+can't use `\spacefactor' in math mode.}, or @samp{Improper \spacefactor}
+then you have probably tried to redefine an internal command.
+@xref{\makeatletter & \makeatother}.)
@menu
-* \(SPACE) and \@@:: Space after a period.
-* \frenchspacing:: Equal interword and inter-sentence space.
-* \normalsfcodes:: Restore space factor settings to the default.
+* \@@:: Distinguish sentence-ending periods from abbreviations.
+* \frenchspacing:: Equal interword and inter-sentence space.
+* \normalsfcodes:: Restore space factor settings to the default.
@end menu
-@node \(SPACE) and \@@
-@subsection @code{\(SPACE)} and @code{\@@}
+@node \@@
+@subsection @code{\@@}
-@findex \(SPACE)
-@findex \TAB
-@findex \NEWLINE
@findex \@@
+@findex at-sign
+@cindex period, sentence-ending
+@cindex period, abbreviation-ending
+@cindex period, spacing after
@anchor{\AT}@c old name
-Here, @code{\(SPACE)} means a backslash followed by a space. These
-commands mark a punctuation character, typically a period, as either
-ending a sentence or as ending an abbreviation.
+Synopsis:
+
+@example
+@var{capital-letter}\@@.
+@end example
-By default, in justifying a line @LaTeX{} adjusts the space after a
-sentence-ending period (or a question mark, exclamation point, comma, or
-colon) more than the space between words. @xref{\spacefactor}. As
-described there, @LaTeX{} assumes that the period ends a sentence unless
-it is preceded by a capital letter, in which case it takes that period
-for part of an abbreviation. Note that if a sentence-ending period is
-immediately followed by a right parenthesis or bracket, or right single
-or double quote, then the space effect of that period follows through
-that parenthesis or quote.
+Treat a period as sentence-ending, where @LaTeX{} would otherwise think
+it is part of an abbreviation. @LaTeX{} thinks that a period ends an
+abbreviation if the period comes after a capital letter, and otherwise
+thinks the period ends the sentence. By default, in justifying a line
+@LaTeX{} adjusts the space after a sentence-ending period (or a question
+mark, exclamation point, comma, or colon) more than it adjusts the space
+between words (@pxref{\spacefactor}).
-So: if you have a period ending an abbreviation whose last letter is not
-a capital letter, and that abbreviation is not the last word in the
-sentence, then follow that period with a backslash-space (@code{\ }) or
-a tie (@code{~}) or a @code{\@@}. Examples are @code{Nat.\ Acad.\
-Science}, and @code{Mr.~Bean}, and @code{(manure, etc.\@@) for sale}
-(note that in the last the @code{\@@} comes before the closing parenthesis).
+This example shows the two cases to remember.
-In the opposite situation, if you have a capital letter followed by a
-period that does end the sentence, then put @code{\@@} before the
-period. For example, @code{book by the MAA\@@.} will have correct
-inter-sentence spacing after the period.
+@example
+The songs \textit@{Red Guitar@}, etc.\ are by Loudon Wainwright~III\@@.
+@end example
-For another use of @code{\(SPACE)}, @pxref{\(SPACE) after control sequence}.
+@noindent
+The second period ends the sentence, despite that it is preceded by a
+capital. We tell @LaTeX{} that it ends the sentence by putting
+@code{\@@} before it. The first period ends the abbreviation
+@samp{etc.} but not the sentence. The backslash-space, @code{\ },
+produces a mid-sentence space.
+
+So: if you have a capital letter followed by a period that ends the
+sentence, then put @code{\@@} before the period. This holds even if
+there is an intervening right parenthesis or bracket, or right single or
+double quote, because the spacing effect of that period carries through
+those characters. For example, this
+
+@example
+Use the \textit@{Instructional Practices Guide@},
+(a book by the MAA)\@@.
+@end example
+
+@noindent
+will have correct inter-sentence spacing after the period.
+
+The @code{\@@} command is only for a text mode. If you use it outside of
+a text mode then you get @samp{You can't use `\spacefactor' in vertical
+mode} (@pxref{Modes}).
+
+Comment: the converse case is a period ending an abbreviation whose last
+letter is not a capital letter, and that abbreviation is not the last
+word in the sentence. For that case follow the period with a
+backslash-space, (@code{\ }), or a tie, (@code{~}), or @code{\@@}.
+Examples are @code{Nat.\ Acad.\ Science}, and @code{Mr.~Bean}, and
+@code{(manure, etc.\@@) for sale} (note in the last one that the
+@code{\@@} comes before the closing parenthesis).
@node \frenchspacing
@@ -9626,15 +13204,24 @@ For another use of @code{\(SPACE)}, @pxref{\(SPACE) after control sequence}.
@findex \nonfrenchspacing
@cindex spacing, inter-sentence
-This declaration (from Plain @TeX{}) causes @LaTeX{} to treat
-inter-sentence spacing in the same way as interword spacing.
+Synopsis, one of:
+
+@example
+\frenchspacing
+\nonfrenchspacing
+@end example
-In justifying the text in a line, some typographic traditions, including
-English, prefer to adjust the space between sentences (or after other
-punctuation marks) more than the space between words. Following this
-declaration, all spaces are instead treated equally.
+The first declaration causes @LaTeX{} to treat spacing between sentences
+in the same way as spacing between words in the middle of a sentence.
+The second causes spacing between sentences to stretch or shrink more
+(@pxref{\spacefactor}); this is the default.
-Revert to the default behavior by declaring @code{\nonfrenchspacing}.
+Some typographic traditions, including English, prefer to adjust the
+space between sentences (or spaces following a question mark,
+exclamation point, comma, or colon) more than the space between words
+that are in the middle of a sentence. Declaring @code{\frenchspacing}
+(the command is from Plain @TeX{}) switches to the tradition that all
+spaces are treated equally.
@node \normalsfcodes
@@ -9643,171 +13230,562 @@ Revert to the default behavior by declaring @code{\nonfrenchspacing}.
@findex \normalsfcodes
@cindex spacing, inter-sentence
-Reset the @LaTeX{} space factor values to the default.
+Synopsis:
+
+@example
+\normalsfcodes
+@end example
+
+Reset the @LaTeX{} space factor values to the default
+(@pxref{\spacefactor}).
-@node \(SPACE) after control sequence
-@section @code{\ } after control sequence
+@node \(SPACE)
+@section Backslash-space, @code{\ }
-The @code{\ } command is often used after control sequences to keep
-them from gobbling the space that follows, as in @samp{\TeX\ is nice}.
-And, under normal circumstances, @code{\}@key{tab} and
-@code{\}@key{newline} are equivalent to @code{\ }. For another use of
-@code{\ }, see also @ref{\(SPACE) and \@@}.
+@cindex \NEWLINE
+@cindex \SPACE
+@cindex \TAB
-Some people prefer to use @code{@{@}} for the same purpose, as in
-@code{\TeX@{@} is nice}. This has the advantage that you can always
-write it the same way, namely @code{\TeX@{@}}, whether it is followed
-by a space or by a punctuation mark. Compare:
+This section refers to the command consisting of two characters, a
+backslash followed by a space. Synopsis:
@example
-\TeX\ is a nice system. \TeX, a nice system.@*
-\TeX@{@} is a nice system. \TeX@{@}, a nice system.
+\
+@end example
+
+Produce a space. By default it produces white space of length
+3.33333@dmn{pt} plus 1.66666@dmn{pt} minus 1.11111@dmn{pt}.
+
+A blank is not a space. When you type a blank between words, @LaTeX{}
+produces white space. That's different from an explicit space. This
+illustrates.
+
+@example
+\begin@{tabular@}@{l@}
+Three blanks: in a row \\
+Three spaces:\ \ \ in a row \\
+\end@{tabular@}
@end example
-@PkgIndex{xspace}
-Some individual commands, notably those defined with the @code{xspace},
-package do not follow the standard behavior.
+@noindent
+On the first line @LaTeX{} collapses the three blanks to output one
+whitespace (it would be the same with a single blank or, for instance,
+with a blank and an tab and a blank, or a blank and a newline and a
+blank). But the second line asks for three spaces so the white area is
+wider. Thus, the backslash-space command will create some horizontal
+space. (But the best way to create horizontal space is with
+@code{\hspace}; @xref{\hspace}.)
+
+The backslash-space command has two main uses. First, it is often used
+after control sequences to keep them from gobbling the space that
+follows, as in @code{\TeX\ is nice}. (But the approach of using curly
+parentheses, as in @code{\TeX@{@} is nice}, has the advantage of still
+working if the next character is a period.)
+
+The second common use is that
+it mark a period as ending an abbreviation instead of ending
+a sentence, as in @code{So says Prof.\ Smith} (@pxref{\@@}).
+
+Under normal circumstances, @code{\}@key{tab} and @code{\}@key{newline}
+are equivalent to backslash-space, @code{\ }.
+
+@c @PkgIndex{xspace}
+@c Some individual commands, notably those defined with the @code{xspace},
+@c package do not follow the standard behavior.
+
+
+@node ~
+@section @code{~}
+
+@findex ~
+@cindex tie
+@cindex space, hard
+@cindex space, unbreakable
+@cindex NBSP
+
+Synopsis:
+
+@example
+@var{before}~@var{after}
+@end example
+
+The tie character, @code{~}, produces a space between @var{before} and
+@var{after} at which the line will not be broken. By default the white
+space has length 3.33333@dmn{pt} plus 1.66666@dmn{pt} minus
+1.11111@dmn{pt} (@pxref{Lengths}).
+
+Here @LaTeX{} will not break the line between the final two words.
+
+@example
+Thanks to Prof.~Lerman.
+@end example
+
+@noindent
+In addition, despite the period, @LaTeX{} does not use the
+end-of-sentence spacing (@pxref{\@@}).
+
+Ties prevent the end of line separation of things where that could cause
+confusion. But they also reduce @LaTeX{}'s options when it breaks lines
+into paragraphs, so you can use too many. They are also matters of
+taste, sometimes alarmingly dogmatic taste, among readers. Nevertheless,
+here are some usage models, many of them from the @TeX{}book.
+
+@itemize @bullet
+@item
+Between an enumerator and its item, such as in references:
+@code{Chapter~12}, or @code{Theorem~\ref@{th:Wilsons@}}, or
+@code{Figure~\ref@{fig:KGraph@}}. When cases are enumerated inline:
+@code{(b)~Show that $f(x)$ is (1)~continuous, and (2)~bounded}.
+
+@PkgIndex{siunitx}
+@item
+Between a number and its unit: @code{$745.7.8$~watts} (the
+@file{siunitx} package has a special facility for this) or
+@code{144~eggs}. This includes between a month and a date:
+@code{October~12} or @code{12~Oct}. In general, in any expressions where
+numbers and abbreviations or symbols are separated by a space:
+@code{AD~565}, or @code{2:50~pm}, or @code{Boeing~747}, or
+@code{268~Plains Road}, or @code{\$$1.4$~billion}.
+
+@item
+When mathematical phrases are rendered in words: @code{equals~$n$}, or
+@code{less than~$\epsilon$}, or @code{given~$X$}, or @code{modulo~$p^e$
+for all large~$n$} (but compare @code{is~$15$} with @code{is $15$~times
+the height}). Between mathematical symbols in apposition with nouns:
+@code{dimension~$d$} or @code{function~$f(x)$} (but compare @code{with
+length $l$~or more}). When a symbol is a tightly bound object of a
+preposition: @code{of~$x$}, or @code{from $0$ to~$1$}, or @code{in
+common with~$m$}.
+
+@item
+Between symbols in series: @code{$1$,~$2$, or~$3$} or @code{$1$,~$2$,
+\ldots,~$n$}.
+
+@item
+Between a person's forenames and between multiple surnames:
+@code{Donald~E. Knuth}, or @code{Luis~I. Trabb~Pardo}, or
+@code{Charles~XII} (but you must give TeX places to break the line so
+you may do @code{Charles Louis Xavier~Joseph de~la Vall\'ee~Poussin}).
+
+@item
+Before a dash: @code{pages 12~--14} or @code{it is~--- it must be
+said~--- plausible}.
+
+@end itemize
-@node \thinspace
-@section @code{\thinspace}: Insert 1/6@dmn{em}
+@node \thinspace & \negthinspace
+@section @code{\thinspace} & @code{\negthinspace}
@findex \thinspace
+@findex \negthinspace
+@cindex thin space
+@cindex space, thin
+@cindex thin space, negative
+@cindex space, negative thin
+
+Synopsis, one of:
+
+@example
+\thinspace
+\negthinspace
+@end example
-@code{\thinspace} produces an unbreakable and unstretchable space that
-is 1/6 of an em. This is the proper space to use between nested
-quotes, as in '@dmn{}''.@c Abuse @dmn, which is a thin space in Texinfo.
+Produce an unbreakable and unstretchable space of 1/6@dmn{em} and
+-1/6@dmn{em}. These are the text mode equivalents of @code{\,} and
+@code{\!} (@pxref{Spacing in math mode/\thinspace}). You can use
+@code{\,} as a synonym for @code{\thinspace} in text mode.
+
+The @code{\negthinspace} command is used in text mode mostly for
+fiddling with spaces. One common use of @code{\thinspace} is as the
+space between nested quotes.
+
+@example
+Killick replied, ``I heard the Captain say, `Ahoy there.'\thinspace''
+@end example
+
+@noindent
+Another use is that some style guides call for a @code{\thinspace}
+between an ellipsis and a sentence ending period (other style guides,
+though, think the three dots are quite enough already). Still another
+use is between initials, as in @code{D.\thinspace E.\ Knuth}.
@node \/
-@section @code{\/}: Insert italic correction
+@section @code{\/}
@findex \/
@cindex italic correction
-The @code{\/} command produces an @dfn{italic correction}. This is a
-small space defined by the font designer for a given character,
-to avoid the character colliding with whatever follows. The italic
-@i{f} character typically has a large italic correction value.
+Synopsis:
-If the following character is a period or comma, it's not necessary to
-insert an italic correction, since those punctuation symbols have a
-very small height. However, with semicolons or colons, as well as
-normal letters, it can help. Compare
-@tex
-{\it f\/: f\/;}
-@end tex
-@ifnottex
-@i{f: f;} (in the @TeX{} output, the `f's are nicely separated)
-@end ifnottex
-with @i{f: f;}.
+@example
+@var{before-character}\/@var{after-character}
+@end example
-When changing fonts with commands such as @code{\textit@{italic
-text@}} or @code{@{\itshape italic text@}}, @LaTeX{} will
-automatically insert an italic correction if appropriate (@pxref{Font
-styles}).
+Insert an @dfn{italic correction}, a small space defined by the font
+designer for each character, to avoid the character colliding with
+whatever follows. When you use @code{\/}, @LaTeX{} takes the correction
+from the font metric file, scales it by any scaling that has been
+applied to the font, and then inserts that much horizontal space.
-Despite the name, roman characters can also have an italic
-correction. Compare
-@tex
-pdf\/\TeX{}
-@end tex
-@ifnottex
-pdf@TeX{} (in the @TeX{} output, there is a small space after the `f')
-@end ifnottex
-with pdf@TeX{}.
+Here, were it not for the @code{\/}, the @var{before-character}
+italic@tie{}f would hit the @var{after-character} roman@tie{}H
+
+@example
+\newcommand@{\companylogo@}@{@{\it f@}\/H@}
+@end example
+
+@noindent
+because the italic letter leans far to the right.
+
+If @var{after-character} is a period or comma then don't insert an
+italic correction since those punctuation symbols have a very small
+height. However, with semicolons or colons as well as with normal
+letters, the italic correction can help.
+
+When you use commands such as @code{\textit} or @code{\itshape} to
+change fonts, @LaTeX{} will automatically insert any needed italic
+correction (@pxref{Font styles}).
+
+Roman characters can also have an italic correction. An example is in
+the name @code{pdf\/\TeX}.
There is no concept of italic correction in math mode; spacing is done
in a different way.
-@node \hrulefill \dotfill
-@section @code{\hrulefill \dotfill}
+@node \hrulefill & \dotfill
+@section @code{\hrulefill} & @code{\dotfill}
@findex \hrulefill
@findex \dotfill
-Produce an infinite rubber length (@pxref{Lengths}) filled with a
-horizontal rule (that is, a line) or with dots, instead of just white
-space.
+Synopsis, one of:
+
+@example
+\hrulefill
+\dotfill
+@end example
+
+Produce an infinite horizontal rubber length (@pxref{Lengths}) that
+@LaTeX{} fills with a rule (that is, a line) or with dots, instead of
+white space.
-When placed between blank lines this example creates a paragraph that is
-left and right justified, where the space in the middle is filled with
-evenly spaced dots.
+This outputs a line 2 inches long.
@example
-\noindent Jack Aubrey\dotfill Melbury Lodge
+Name:~\makebox[2in]@{\hrulefill@}
+@end example
+
+@noindent
+This example, when placed between blank lines, creates a paragraph that
+is left and right justified and where the middle is filled with evenly
+spaced dots.
+
+@example
+\noindent John Aubrey, RN \dotfill@{@} Melbury Lodge
@end example
To make the rule or dots go to the line's end use @code{\null} at the
start or end.
To change the rule's thickness, copy the definition and adjust it, as
-with @code{\renewcommand@{\hrulefill@}@{\leavevmode\leaders\hrule height
-1pt\hfill\kern\z@@@}}, which changes the default thickness of
-0.4@dmn{pt} to 1@dmn{pt}. Similarly, adjust the dot spacing as with
-@code{\renewcommand@{\dotfill@}@{\leavevmode\cleaders\hb@@xt@@
-1.00em@{\hss .\hss @}\hfill\kern\z@@@}}, which changes the default
-length of 0.33@dmn{em} to 1.00@dmn{em}.
+here
+@example
+\renewcommand@{\hrulefill@}@{%
+ \leavevmode\leaders\hrule height 1pt\hfill\kern\z@@@}
+@end example
-@node \addvspace
-@section @code{\addvspace}
+@noindent
+which changes the default thickness of 0.4@dmn{pt} to 1@dmn{pt}.
+Similarly, adjust the dot spacing as with
-@findex \addvspace
-@cindex vertical space
-@cindex space, inserting vertical
+@example
+\renewcommand@{\dotfill@}@{%
+ \leavevmode\cleaders\hb@@xt@@1.00em@{\hss .\hss @}\hfill\kern\z@@@}
+@end example
+
+@noindent
+which changes the default length of 0.33@dmn{em} to 1.00@dmn{em}.
+
+This example produces a line for a signature.
+
+@example
+\begin@{minipage@}@{4cm@}
+ \centering
+ \hrulefill\\
+ Signed
+\end@{minipage@}
+@end example
-@code{\addvspace@{@var{length}@}}
+@noindent
+The line is 4@dmn{cm} long.
+
+
+@node \bigskip & \medskip & \smallskip
+@section @code{\bigskip} & @code{\medskip} & @code{\smallskip}
-Add a vertical space of height @var{length}, which is a rubber length
-(@pxref{Lengths}). However, if vertical space has already been added to
-the same point in the output by a previous @code{\addvspace} command
-then this command will not add more space than what is needed to make
-the natural length of the total vertical space equal to @var{length}.
+Synopsis, one of:
-Use this command to adjust the vertical space above or below an
-environment that starts a new paragraph. For instance, a Theorem
-environment is defined to begin and end with @code{\addvspace@{...@}}
-so that two consecutive Theorem's are separated by one vertical space,
-not two.
+@example
+\bigskip
+\medskip
+\smallskip
+@end example
-This command is fragile (@pxref{\protect}).
+Produce an amount of vertical space, large or medium-sized or
+small. These commands are fragile (@pxref{\protect}).
-The error @samp{Something's wrong--perhaps a missing \item} means that
-you were not in vertical mode when you invoked this command; one way to
-change that is to precede this command with a @code{\par} command.
+Here the skip suggests the passage of time (from @i{The Golden Ocean} by
+O'Brian).
+@example
+Mr Saumarez would have something rude to say to him, no doubt: he
+was at home again, and it was delightful.
-@node \bigskip \medskip \smallskip
-@section @code{\bigskip \medskip \smallskip}
+\bigskip
+``A hundred and fifty-seven miles and one third, in twenty-four hours,''
+said Peter.
+@end example
-These commands produce a given amount of space, specified by the
-document class.
+Each command is associated with a length defined in the document class
+file.
@ftable @code
+@anchor{bigskip}
@item \bigskip
@findex \bigskipamount
The same as @code{\vspace@{\bigskipamount@}}, ordinarily about one line
-space, with stretch and shrink (the default for the @code{book} and
-@code{article} classes is @code{12pt plus 4pt minus 4pt}).
+space, with stretch and shrink. The default for the @code{book} and
+@code{article} classes is @code{12pt plus 4pt minus 4pt}.
+@anchor{medskip}
@item \medskip
@findex \medskipamount
-The same as @code{\vspace@{\medskipamount@}}, ordinarily about half of
-a line space, with stretch and shrink (the default for the @code{book}
-and @code{article} classes is @code{6pt plus 2pt minus 2pt}).
+The same as @code{\vspace@{\medskipamount@}}, ordinarily about half of a
+line space, with stretch and shrink. The default for the @code{book}
+and @code{article} classes is @code{6pt plus 2pt minus 2pt}.
+@anchor{smallskip}
@item \smallskip
@findex \smallskipamount
The same as @code{\vspace@{\smallskipamount@}}, ordinarily about a
-quarter of a line space, with stretch and shrink (the default for the
-@code{book} and @code{article} classes is @code{3pt plus 1pt minus
-1pt}).
+quarter of a line space, with stretch and shrink. The default for the
+@code{book} and @code{article} classes is @code{3pt plus 1pt minus 1pt}.
@end ftable
+Because each command is a @code{\vspace}, if you use on in mid-paragraph
+then it will insert its vertical space between the line in which you use
+it and the next line, not necessarily at the place that you use it. So
+these are best between paragraphs.
+
+The commands @code{\bigbreak}, @code{\medbreak}, and @code{\smallbreak}
+are similar but also suggest to @LaTeX{} that this is a good place to
+put a page break (@pxref{\bigbreak & \medbreak & \smallbreak}.
+
+
+@node \bigbreak & \medbreak & \smallbreak
+@section @code{\bigbreak} & @code{\medbreak} & @code{\smallbreak}
+
+Synopsis, one of:
+
+@example
+\bigbreak
+\medbreak
+\smallbreak
+@end example
+
+Produce a vertical space that is big or medium-sized or small, and
+suggest to @LaTeX{} that this is a good place to break the page. (The
+associated penalties are -200, -100, and -50.)
+
+@xref{\bigskip & \medskip & \smallskip}, for more. These commands
+produce the same vertical space but differ in that they also remove a
+preceding vertical space if it is less than what they would insert (as
+with @code{\addvspace}). In addition, they terminate a paragraph where
+they are used: this example
+
+@example
+abc\bigbreak def ghi
+
+jkl mno pqr
+@end example
+
+@noindent
+will output three paragraphs, the first ending in @samp{abc} and the
+second starting, after an extra vertical space and a paragraph indent,
+with @samp{def}.
+
+
+@node \strut
+@section @code{\strut}
+
+@findex \strut
+@cindex strut
+
+Synopsis:
+
+@example
+\strut
+@end example
+
+Ensure that the current line has height at least @code{0.7\baselineskip}
+and depth at least @code{0.3\baselineskip}. Essentially, @LaTeX{}
+inserts into the line a rectangle having zero width,
+@code{\rule[-0.3\baselineskip]@{0pt@}@{\baselineskip@}} (@pxref{\rule}).
+The @code{\baselineskip} changes with the current font and fontsize.
+
+In this example the @code{\strut} keeps the box inside the frame from
+having zero height.
+
+@example
+\setlength@{\fboxsep@}@{0pt@}\framebox[2in]@{\strut@}
+@end example
+
+This example has four lists. In the first there is a much bigger gap
+between items 2 and@tie{}3 than there is between items 1 and@tie{}2.
+The second list fixes that with a @code{\strut} at the end of its first
+item's second line.
+
+@example
+\setlength@{\fboxsep@}@{0pt@}
+\noindent\begin@{minipage@}[t]@{0.2\linewidth@}
+\begin@{enumerate@}
+ \item \parbox[t]@{15pt@}@{test \\ test@}
+ \item test
+ \item test
+\end@{enumerate@}
+\end@{minipage@}%
+\begin@{minipage@}[t]@{0.2\linewidth@}
+\begin@{enumerate@}
+ \item \parbox[t]@{15pt@}@{test \\ test\strut@}
+ \item test
+ \item test
+\end@{enumerate@}
+\end@{minipage@}%
+\begin@{minipage@}[t]@{0.2\linewidth@}
+\begin@{enumerate@}
+ \item \fbox@{\parbox[t]@{15pt@}@{test \\ test@}@}
+ \item \fbox@{test@}
+ \item \fbox@{test@}
+\end@{enumerate@}
+\end@{minipage@}%
+\begin@{minipage@}[t]@{0.2\linewidth@}
+\begin@{enumerate@}
+ \item \fbox@{\parbox[t]@{15pt@}@{test \\ test\strut@}@}
+ \item \fbox@{test@}
+ \item \fbox@{test@}
+\end@{enumerate@}
+\end@{minipage@}%
+@end example
+
+@noindent
+The final two lists use @code{fbox} to show what's happening. The third
+list's @code{\parbox} goes only to the bottom of its second @samp{test},
+which happens not have any characters that descend below the baseline.
+The fourth list adds the strut that gives the needed extra
+below-baseline space.
+
+@PkgIndex{TikZ} @PkgIndex{Asymptote}
+The @code{\strut} command is often useful in graphics, such as in
+@file{TikZ} or @file{Asymptote}. For instance, you may have a command
+such as @code{\graphnode@{@var{node-name}@}} that fits a circle around
+@var{node-name}. However, unless you are careful the @var{node-name}'s
+@samp{x} and @samp{y} will produce different-diameter circles because
+the characters are different sizes. A careful @code{\graphnode} might
+insert a @code{\strut}, then @var{node-name}, and then draw the circle.
+
+The general approach of using a zero width @code{\rule} is useful in
+many circumstances. In this table, the zero-width rule keeps the top of
+the first integral from hitting the @code{\hline}. Similarly, the
+second rule keeps the second integral from hitting the first.
+
+@example
+\begin@{tabular@}@{rl@}
+ \textsc@{Integral@} &\textsc@{Value@} \\
+ \hline
+ $\int_0^x t\, dt$ &$x^2/2$ \rule@{0em@}@{2.5ex@} \\
+ $\int_0^x t^2\, dt$ &$x^3/3$ \rule@{0em@}@{2.5ex@}
+\end@{tabular@}
+@end example
+
+@noindent
+(Although the line-ending double backslash command has an available
+optional argument to put in more vertical room, that won't work here.
+Changing the first double backslash to something like @code{\\[2.5ex]}
+will put the room between the header line and the @code{\hline}, and the
+integral would still hit the line.)
+
+
+@node \vspace
+@section @code{\vspace}
+
+@findex \vspace
+@cindex vertical space
+@cindex space, vertical
+
+Synopsis, one of:
+
+@example
+\vspace@{@var{length}@}
+\vspace*@{@var{length}@}
+@end example
+
+Add the vertical space @var{length}. The @var{length} can be positive,
+negative, or zero. It is a rubber length---it may contain a @code{plus}
+or @code{minus} component (@pxref{Lengths}).
+
+This puts space between the two paragraphs.
+
+@example
+And I slept.
+
+\vspace@{1ex plus 0.5ex@}
+The new day dawned cold.
+@end example
+
+@noindent
+(@xref{\bigskip & \medskip & \smallskip} for common inter-paragraph
+spaces.)
+
+The @code{*}-version inserts vertical space that non-discardable. More
+precisely, @LaTeX{} discards vertical space at a page break and the
+@code{*}-version causes the space to stay. This example leaves space
+between the two questions.
+
+@example
+Question: Find the integral of \( 5x^4+5 \).
+
+\vspace*@{2cm plus 0.5cm@}
+Question: Find the derivative of \( x^5+5x+9 \).
+@end example
+
+@noindent
+That space will be present even if the page break happens to fall
+between the questions.
+
+If you use @code{\vspace} in the middle of a paragraph (i.e., in
+horizontal mode) then the space is inserted after the line containing
+the @code{\vspace} command; it does not start a new paragraph at the
+@code{\vspace} command.
+
+In this example the two questions will be evenly spaced vertically on
+the page, with at least one inch of space below each.
+
+@example
+\begin@{document@}
+1) Who put the bomp in the bomp bah bomp bah bomp?
+\vspace@{1in plus 1fill@}
+
+2) Who put the ram in the rama lama ding dong?
+\vspace@{1in plus 1fill@}
+\end@{document@}
+@end example
+
@node \vfill
@section @code{\vfill}
@@ -9817,310 +13795,611 @@ quarter of a line space, with stretch and shrink (the default for the
@cindex stretch, infinite vertical
@cindex infinite vertical stretch
-End the current paragraph and insert a vertical rubber length
-(@pxref{Lengths}) that is infinite, so it can stretch or shrink as far
-as needed.
+Synopsis:
+
+@example
+\vfill
+@end example
+
+End the current paragraph and insert a vertical rubber length that is
+infinite, so it can stretch or shrink as far as needed
+(@pxref{Lengths}).
It is often used in the same way as @code{\vspace@{\fill@}}, except that
-@code{\vfill} ends the current paragraph, whereas
-@code{\vspace@{\fill@}} adds the infinite vertical space below its line
-irrespective of the paragraph structure. In both cases that space will
-disappear at a page boundary; to circumvent this see@tie{}@ref{\vspace}.
+@code{\vfill} ends the current paragraph whereas @code{\vspace@{\fill@}}
+adds the infinite vertical space below its line, irrespective of the
+paragraph structure. In both cases that space will disappear at a page
+boundary; to circumvent this see the starred option
+in@tie{}@ref{\vspace}.
In this example the page is filled, so the top and bottom lines contain
-the text @samp{Lost Dog!} and the third @samp{Lost Dog!} is exactly
+the text @samp{Lost Dog!} and the second @samp{Lost Dog!} is exactly
halfway between them.
@example
\begin@{document@}
Lost Dog!
\vfill
-Lost Dog!
+Lost Dog! % perfectly in the middle
\vfill
Lost Dog!
\end@{document@}
@end example
-@node \vspace
-@section @code{\vspace@{@var{length}@}}
+@node \addvspace
+@section @code{\addvspace}
-@findex \vspace
+@findex \addvspace
@cindex vertical space
-@cindex space, vertical
+@cindex space, inserting vertical
-Synopsis, one of these two:
+Synopsis:
@example
-\vspace@{@var{length}@}
-\vspace*@{@var{length}@}
+\addvspace@{@var{vert-length}@}
@end example
-Add the vertical space @var{length}. This can be negative or positive,
-and is a rubber length (@pxref{Lengths}).
+Add a vertical space of @var{vert-length}. However, if there are two or
+more @code{\addvspace}'s in a sequence then together they only add the
+space needed to make the natural length equal to the maximum of the
+@var{vert-length}'s in that sequence. This command is fragile
+(@pxref{\protect}). The @var{vert-length} is a rubber length
+(@pxref{Lengths}).
-@LaTeX{} removes the vertical space from @code{\vspace} at a page
-break, that is, at the top or bottom of a page. The starred version
-@code{\vspace*@{...@}} causes the space to stay.
-
-If @code{\vspace} is used in the middle of a paragraph (i.e., in
-horizontal mode), the space is inserted @emph{after} the line with
-the @code{\vspace} command. A new paragraph is not started.
-
-In this example the two questions will be evenly spaced vertically on
-the page, with at least one inch of space below each.
+This example illustrates. The @code{picture} draws a scale. In a
+standard @LaTeX{} article the length @code{\baselineskip} is 12@dmn{pt}.
+The two rules here are 22@dmn{pt} apart: the sum of the
+@code{\baselineskip} and the 10@dmn{pt} from the first @code{addvspace}.
@example
+\documentclass@{article@}
+\usepackage@{color@}
\begin@{document@}
-1) Who put the bomp in the bomp bah bomp bah bomp?
-\vspace@{1in plus 1fill@}
-
-2) Who put the ram in the rama lama ding dong?
-\vspace@{1in plus 1fill@}
+\setlength@{\unitlength@}@{2pt@}%
+\noindent\begin@{picture@}(0,0)%
+ \multiput(0,0)(0,-1)@{25@}@{@{\color@{blue@}\line(1,0)@{1@}@}@}
+ \multiput(0,0)(0,-5)@{6@}@{@{\color@{red@}\line(1,0)@{2@}@}@}
+\end@{picture@}%
+\rule@{0.25\linewidth@}@{0.1pt@}%
+\par\addvspace@{10pt@}% \addvspace@{20pt@}%
+\par\noindent\rule@{0.25\linewidth@}@{0.1pt@}%
\end@{document@}
@end example
+@noindent
+Now uncomment the second @code{\addvspace}. It does not make the gap
+20@dmn{pt} longer; instead the gap is the sum of @code{\baselineskip}
+and 20@dmn{pt}. So @code{\addvspace} in a sense does the opposite of
+its name --- it makes sure that multiple vertical spaces do not
+accumulate, but instead that only the largest one is used.
+
+@LaTeX{} uses this command to adjust the vertical space above or below
+an environment that starts a new paragraph. For instance, a
+@code{theorem} environment begins and ends with @code{\addvspace} so
+that two consecutive @code{theorem}'s are separated by one vertical
+space, not two.
+
+A error @samp{Something's wrong--perhaps a missing \item} pointing to an
+@code{\addvspace} means that you were not in vertical mode when you hit
+this command. One way to change that is to precede @code{\addvspace}
+with a @code{\par} command (@pxref{\par}), as in the above example.
+
@node Boxes
@chapter Boxes
@cindex boxes
-All the predefined length parameters (@pxref{Predefined lengths}) can be
-used in the arguments of the box-making commands.
+At its core, @LaTeX{} puts things in boxes and then puts the boxes on a
+page. So these commands are central.
+
+There are many packages on CTAN that are useful for manipulating boxes.
+One useful adjunct to the commands here is @file{adjustbox}.
@menu
-* \mbox:: Horizontal boxes.
-* \fbox and \framebox:: Put a frame around a box.
-* lrbox:: An environment like @code{\sbox}.
-* \makebox:: Box, adjustable position.
+* \mbox & \makebox:: Horizontal boxes.
+* \fbox & \framebox:: Put a frame around a box.
* \parbox:: Box with text in paragraph mode.
* \raisebox:: Raise or lower text.
-* \savebox:: Like @code{\makebox}, but save the text for later use.
-* \sbox:: Like @code{\mbox}, but save the text for later use.
+* \sbox & \savebox:: Like @code{\makebox} but save the text for later.
+* lrbox:: Environment version of @code{\sbox}.
* \usebox:: Print saved text.
@end menu
-@node \mbox
-@section @code{\mbox@{@var{text@}}}
+@node \mbox & \makebox
+@section @code{\mbox} & @code{\makebox}
@findex \mbox
-
+@findex \makebox
+@cindex box
+@cindex make a box
@cindex hyphenation, preventing
-The @code{\mbox} command creates a box just wide enough to hold the
-text created by its argument. The @var{text} is not broken into
-lines, so it can be used to prevent hyphenation.
+Synopsis, one of:
-@node \fbox and \framebox
-@section @code{\fbox} and @code{\framebox}
+@example
+\mbox@{@var{text}@}
+\makebox@{@var{text}@}
+\makebox[@var{width}]@{@var{text}@}
+\makebox[@var{width}][@var{position}]@{@var{text}@}
+@end example
-@findex \fbox
-@findex \framebox
+Create a box, a container for material. The @var{text} is is typeset in
+LR mode (@pxref{Modes}) so it is not broken into lines. The
+@code{\mbox} command is robust, while @code{\makebox} is fragile
+(@pxref{\protect}).
-Synopses:
+Because @code{text} is not broken into lines, you can use @code{\mbox}
+to prevent hyphenation. In this example, @LaTeX{} will not hyphenate
+the table name, @samp{T-4}.
@example
-\fbox@{@var{text}@}
-\framebox[@var{width}][@var{position}]@{@var{text}@}
+See Table~\mbox@{T-4@}
@end example
-The @code{\fbox} and @code{\framebox} commands are like @code{\mbox},
-except that they put a frame around the outside of the box being created.
+The first two command versions, @code{\mbox} and @code{\makebox}, are
+roughly equivalent. They create a box just wide enough to contain the
+@var{text}. (They are like plain @TeX{}'s @code{\hbox}.)
-In addition, the @code{\framebox} command allows for explicit
-specification of the box width with the optional @var{width} argument
-(a dimension), and positioning with the optional @var{position}
-argument. @c xxref
+In the third version the optional argument @var{width} specifies the
+width of the box. Note that the space occupied by the text need not
+equal the width of the box. For one thing, @var{text} can be too small;
+this creates a full-line box
-@findex \fboxrule
-@findex \fboxsep
-Both commands produce a rule of thickness @code{\fboxrule} (default
-@code{0.4pt}), and leave a space of @code{\fboxsep} (default @code{3pt})
-between the rule and the contents of the box.
+@example
+\makebox[\linewidth]@{Chapter Exam@}
+@end example
-@xref{\framebox (picture)}, for the @code{\framebox} command in the
-@code{picture} environment.
+@noindent
+with @samp{Chapter Exam} centered. But @var{text} can also be too wide
+for @var{width}. See the example below of zero-width boxes.
+@anchor{mbox makebox depth}
+@anchor{mbox makebox height}
+@anchor{mbox makebox width}
+@anchor{mbox makebox totalheight}
+In the @var{width} argument you can use the following lengths that refer
+to the dimension of the box that @LaTeX{} gets on typesetting
+@var{text}: @code{\depth}, @code{\height}, @code{\width},
+@code{\totalheight} (this is the box's height plus its depth). For
+example, to make a box with the text stretched to double the natural
+size you can say this.
-@node lrbox
-@section @code{lrbox}
+@example
+\makebox[2\width]@{Get a stretcher@}
+@end example
-@findex lrbox
+For the fourth command version the optional argument @var{position}
+gives position of the text within the box. It may take the following
+values:
-Synopsis:
+@table @code
+@item c
+The @var{text} is centered (default).
+
+@item l
+The @var{text} is flush left.
+
+@item r
+Flush right.
+
+@item s
+Stretch the interword space in @var{text} across the entire @var{width}.
+The @var{text} must contain stretchable space for this to work. For
+instance, this could head a press release:
+@code{\noindent\makebox[\textwidth][s]@{\large\hfil IMMEDIATE\hfil
+RELEASE\hfil@}}
+@end table
+
+A common use of @code{\makebox} is to make zero-width text boxes. This
+puts the value of the quiz questions to the left of those questions.
@example
-\begin@{lrbox@}@{\@var{cmd}@}
- @var{text }
-\end@{lrbox@}
+\newcommand@{\pts@}[1]@{\makebox[0em][r]@{#1 points\hspace*@{1em@}@}@}
+\pts@{10@}What is the air-speed velocity of an unladen swallow?
+
+\pts@{90@}An African or European swallow?
@end example
-This is the environment form of @ref{\sbox,@code{\sbox}}.
+@noindent
+@PkgIndex{TikZ}
+@PkgIndex{Asymptote}
+The right edge of the output @samp{10 points } (note the ending space)
+will be just before the @samp{What} (note the space after
+@samp{points}). You can use @code{\makebox} similarly when making
+graphics, such as in @file{TikZ} or @file{Asymptote}, where you put the
+edge of the text at a known location, regardless of the length of that
+text.
-The @var{text} inside the environment is saved in the box @code{\@var{cmd}},
-which must have been declared with @code{\newsavebox}.
+For boxes with frames see@tie{}@ref{\fbox & \framebox}. For colors
+see@tie{}@ref{Colored boxes}.
+There is a related version of @code{\makebox} that is used within the
+@code{picture} environment, where the length is given in terms of
+@code{\unitlength} (@pxref{\makebox (picture)}).
-@node \makebox
-@section @code{\makebox}
+If you put a double-backslash into @var{text} then @LaTeX{} will not
+give you a new line; for instance @code{\makebox@{abc def \\ ghi@}}
+outputs @samp{abc defghi} while @code{\makebox@{abc def \par ghi@}}
+outputs @samp{abc def ghi}, but neither go to a second line. To get
+multiple lines see@tie{}@ref{\parbox} and@tie{}@ref{minipage}.
-@findex \makebox
-Synopsis:
+@node \fbox & \framebox
+@section @code{\fbox} & @code{\framebox}
+
+@findex \fbox
+@findex \framebox
+
+Synopses, one of:
@example
-\makebox[@var{width}][@var{position}]@{@var{text}@}
+\fbox@{@var{text}@}
+\framebox@{@var{text}@}
+\framebox[@var{width}]@{@var{text}@}
+\framebox[@var{width}][@var{position}]@{@var{text}@}
@end example
-The @code{\makebox} command creates a box just wide enough to contain
-the @var{text} specified. The width of the box can be overridden by the
-optional @var{width} argument. The position of the text within the box
-is determined by the optional @var{position} argument, which may take
-the following values:
+Create a box with an enclosing frame, four lines surrounding the space.
+These commands are the same as @code{\mbox} and @code{\makebox} except
+for the frame (@pxref{\mbox & \makebox}). The @code{\fbox} command is
+robust, the @code{\framebox} command is fragile (@pxref{\protect}).
-@table @code
-@item c
-Centered (default).
-@item l
-Flush left.
-@item r
-Flush right.
-@item s
-Stretch (justify) across entire @var{width}; @var{text} must contain
-stretchable space for this to work.
-@end table
+@example
+\fbox@{Warning! No work shown, no credit given.@}
+@end example
-@code{\makebox} is also used within the @code{picture} environment
-@pxref{\makebox (picture)}.
+@noindent
+@LaTeX{} puts the text into a box that cannot be split or hyphenated.
+Around that box, separated from it by a small gap, are four lines making
+a frame.
+The first two command invocations, @code{\fbox@{...@}} and
+@code{\framebox@{...@}}, are roughly the same. As to the third and
+fourth invocations, the optional arguments allow you to specify the box
+width as @var{width} and the position of the text inside that box as
+@var{position}. @xref{\mbox & \makebox} for the full description but
+here is an example creating an empty box that is 1/4@dmn{in} wide.
-@node \parbox
-@section @code{\parbox}
+@example
+\setlength@{\fboxsep@}@{0pt@}\framebox[0.25in]@{\strut@}@}
+@end example
-@findex \parbox
+@noindent
+The @code{\strut} inserts a vertical height of @code{\baselineskip}
+(@pxref{\strut}).
-Synopsis:
+These parameters determine the frame layout.
+
+@ftable @code
+@anchor{fbox framebox fboxrule}
+@item \fboxrule
+@findex frame, line width
+@findex frame rule width
+@cindex \fboxrule
+The thickness of the lines around the enclosed box. The default is
+0.2@dmn{pt}. Change it with a command such as
+@code{\setlength@{\fboxrule@}@{0.8pt@}} (@pxref{\setlength}).
+
+@anchor{fbox framebox fboxsep}
+@item \fboxsep
+@findex frame, separation from contents
+@cindex \fboxsep
+The distance from the frame to the enclosed box. The default is 3@dmn{pt}.
+Change it with a command such as @code{\setlength@{\fboxsep@}@{0pt@}}
+(@pxref{\setlength}). Setting it to 0@dmn{pt} is useful sometimes:
+this will put a frame around the picture with no white border.
+
+@example
+@{\setlength@{\fboxsep@}@{0pt@}
+ \framebox@{%
+ \includegraphics[width=0.5\textwidth]@{prudence.jpg@}@}@}
+@end example
+
+@noindent
+The extra curly braces keep the effect of the @code{\setlength} local.
+
+@end ftable
+
+As with @code{\mbox} and @code{\makebox}, @LaTeX{} will not break lines
+in @var{text}. But this example has @LaTeX{} break lines to make a
+paragraph, and then frame the result.
@example
-\parbox[@var{position}][@var{height}][@var{inner-pos}]@{@var{width}@}@{@var{text}@}
+\framebox@{%
+ \begin@{minipage@}@{0.6\linewidth@}
+ My dear, here we must run as fast as we can, just to stay in place.
+ And if you wish to go anywhere you must run twice as fast as that.
+ \end@{minipage@}@}
@end example
-@cindex paragraph mode
-The @code{\parbox} command produces a box whose contents are created
-in @dfn{paragraph mode}. It should be used to make a box small
-pieces of text, with nothing fancy inside. In particular, you
-shouldn't use any paragraph-making environments inside a
-@code{\parbox} argument. For larger pieces of text, including ones
-containing a paragraph-making environment, you should use a
-@code{minipage} environment (@pxref{minipage}).
+@xref{Colored boxes} for colors other than black and white.
-@code{\parbox} has two mandatory arguments:
+The @code{picture} environment has a version of this command where the
+units depend on @code{picture}'s @code{\unitlength} (@pxref{\framebox
+(picture)}).
-@table @var
-@item width
-the width of the parbox;
-@item text
-the text that goes inside the parbox.
-@end table
-By default @LaTeX{} will position vertically a parbox so its center
-lines up with the center of the surrounding text line. When the
-optional @var{position} argument is present and equal either to @samp{t}
-or @samp{b}, this allows you respectively to align either the top or
-bottom line in the parbox with the baseline of the surrounding text. You
-may also specify @samp{m} for @var{position} to get the default
-behaviour.
+@node \parbox
+@section @code{\parbox}
-The optional @var{height} argument overrides the natural height of the box.
+@findex \parbox
+@cindex paragraph mode
+@cindex paragraph, in a box
-The @var{inner-pos} argument controls the placement of the text inside
-the box, as follows; if it is not specified, @var{position} is used.
+Synopses, one of:
-@table @code
-@item t
-text is placed at the top of the box.
-@item c
-text is centered in the box.
-@item b
-text is placed at the bottom of the box.
-@item s
-stretch vertically; the text must contain vertically stretchable space
-for this to work.
-@end table
+@example
+\parbox@{@var{width}@}@{@var{contents}@}
+\parbox[@var{position}]@{@var{width}@}@{@var{contents}@}
+\parbox[@var{position}][@var{height}]@{@var{width}@}@{@var{contents}@}
+\parbox[@var{position}][@var{height}][@var{inner-pos}]@{@var{width}@}@{@var{contents}@}
+@end example
+
+Produce a box of text that is @var{width} wide. Use this command to make
+a box of small pieces of text, of a single paragraph. This command is
+fragile (@pxref{\protect}).
+
+@example
+\begin@{picture@}(0,0)
+ ...
+ \put(1,2)@{\parbox@{1.75in@}@{\raggedright Because the graph is a line on
+ this semilog paper, the relationship is
+ exponential.@}@}
+\end@{picture@}
+@end example
+The @var{contents} are processed in a text mode (@pxref{Modes}) so
+@LaTeX{} will break lines to make a paragraph. But it won't make
+multiple paragraphs; for that, use a @code{minipage} environment
+(@pxref{minipage}).
+
+The options for @code{\parbox} (except for @var{contents}) are the same
+as those for @code{minipage}. For convenience a summary of the options
+is here but see@tie{}@ref{minipage} for a complete description.
+
+There are two required arguments. The @var{width} is a rigid length
+(@pxref{Lengths}). It sets the width of the box into which @LaTeX{}
+typesets @var{contents}. The @var{contents} is the text that is placed
+in that box. It should not have any paragraph-making components.
+
+There are three optional arguments, @var{position}, @var{height}, and
+@var{inner-pos}. The @var{position} gives the vertical alignment of the
+@code{parbox} with respect to the surrounding material. The possible
+values are @code{c} or @code{m} to make the vertical center of the
+@code{parbox} lines up with the center of the adjacent line (this is the
+default), or @code{t} to match the top line of the @code{parbox} with
+the baseline of the surrounding material, or @code{b} to match the
+bottom line.
+
+The optional argument @var{height} overrides the natural height of the
+box.
+
+The optional argument @var{inner-pos} controls the placement of
+@var{content} inside the @code{parbox}. Its default is the value of
+@var{position}. Its possible values are: @code{t} to put the
+@var{content} at the top of the box, @code{c} to put it in the vertical
+center, @code{b} to put it at the bottom of the box, and @code{s} to
+stretch it out vertically (for this, the text must contain vertically
+stretchable space).
@node \raisebox
@section @code{\raisebox}
@findex \raisebox
-Synopsis:
+Synopsis, one of:
@example
+\raisebox@{@var{distance}@}@{@var{text}@}
+\raisebox@{@var{distance}@}[@var{height}]@{@var{text}@}
\raisebox@{@var{distance}@}[@var{height}][@var{depth}]@{@var{text}@}
@end example
-The @code{\raisebox} command raises or lowers @var{text}. The first
-mandatory argument specifies how high @var{text} is to be raised (or
-lowered if it is a negative amount). @var{text} itself is processed
-in LR mode.
+Raise or lower @var{text}. This command is fragile (@pxref{\protect}).
+
+This example makes a command for the restriction of a function by
+lowering the vertical bar symbol.
+
+@c credit: egreg https://tex.stackexchange.com/a/278631/121234
+@example
+\newcommand\restricted[1]@{\raisebox@{-.5ex@}@{$|$@}_@{#1@}@}
+$f\restricted@{A@}$
+@end example
+
+The first mandatory argument @var{distance} specifies how far to raise
+the second mandatory argument @var{text}. This is a rigid length
+(@pxref{Lengths}). If it is negative then it lowers @var{text}. The
+@var{text} is processed in LR mode so it cannot contain line breaks
+(@pxref{Modes}).
The optional arguments @var{height} and @var{depth} are dimensions. If
-they are specified, @LaTeX{} treats @var{text} as extending a certain
-distance above the baseline (@var{height}) or below (@var{depth}),
-ignoring its natural height and depth.
+they are specified, they override the natural height and depth of the
+box @LaTeX{} gets by typesetting @var{text}.
+
+@anchor{raisebox depth}
+@anchor{raisebox height}
+@anchor{raisebox width}
+@anchor{raisebox totalheight}
+In the arguments @var{distance}, @var{height}, and @var{depth} you can
+use the following lengths that refer to the dimension of the box that
+@LaTeX{} gets on typesetting @var{text}: @code{\depth}, @code{\height},
+@code{\width}, @code{\totalheight} (this is the box's height plus its
+depth).
+
+This will align two graphics on their top (@pxref{Graphics}).
+
+@c credit: FAQ https://texfaq.org/FAQ-topgraph
+@example
+\usepackage@{graphicx@} \usepackage@{calc@} % in preamble
+ ...
+\begin@{center@}
+ \raisebox@{1ex-\height@}@{%
+ \includegraphics[width=0.4\linewidth]@{lion.png@}@}
+ \qquad
+ \raisebox@{1ex-\height@}@{%
+ \includegraphics[width=0.4\linewidth]@{meta.png@}@}
+\end@{center@}
+@end example
+@noindent
+The first @code{\height} is the height of @file{lion.png} while the
+second is the height of @file{meta.png}.
-@node \savebox
-@section @code{\savebox}
+@node \sbox & \savebox
+@section @code{\sbox} & @code{\savebox}
+
+@findex \sbox
@findex \savebox
+@cindex box, save
-Synopsis:
+Synopsis, one of:
@example
-\savebox@{@var{\boxcmd}@}[@var{width}][@var{pos}]@{@var{text}@}
+\sbox@{@var{box-cmd}@}@{@var{text}@}
+\savebox@{@var{box-cmd}@}@{@var{text}@}
+\savebox@{@var{box-cmd}@}[@var{width}]@{@var{text}@}
+\savebox@{@var{box-cmd}@}[@var{width}][@var{pos}]@{@var{text}@}
@end example
-This command typeset @var{text} in a box just as with @code{\makebox}
-(@pxref{\makebox}), except that instead of printing the resulting box,
-it saves it in the box labeled @var{\boxcmd}, which must have been
-declared with @code{\newsavebox} (@pxref{\newsavebox}).
+Typeset @var{text} just as with @code{\makebox} (@pxref{\mbox &
+\makebox}) except that @LaTeX{} does not output it but instead saves it
+in a storage bin named @var{box-cmd}. The bin name @var{box-cmd} begins
+with a backslash, @code{\}. You must have previously allocated the bin
+@var{box-cmd} with @code{\newsavebox} (@pxref{\newsavebox}).The
+@code{\sbox} command is robust while @code{\savebox} is fragile
+(@pxref{\protect}).
+This creates and uses a bin.
-@node \sbox
-@section @code{\sbox@{@var{\boxcmd}@}@{@var{text}@}}
+@example
+\newsavebox@{\fullname@}
+\sbox@{\fullname@}@{John Jacob Jingleheimer Schmidt@}
+ ...
+\usebox@{\fullname@}! His name is my name, too!
+Whenever we go out, the people always shout!
+There goes \\usebox@{\fullname@}! Ya da da da da da da.
+@end example
-@findex \sbox
+@noindent
+One advantage of using and reusing a bin over a @code{\newcommand} is
+efficiency, that @LaTeX{} need not repeatedly retypeset the contents.
+See the example below.
+
+The first two command invocations,
+@code{\sbox@{@var{box-cmd}@}@{@var{text}@}} and
+@code{\savebox@{@var{box-cmd}@}@{@var{text}@}}, are roughly equivalent.
+As to the third and fourth, the optional arguments allow you to specify
+the box width as @var{width}, and the position of the text inside that
+box as @var{position}. @xref{\mbox & \makebox} for the full
+description.
+
+In the @code{\sbox} and @code{\savebox} commands the @var{text} is
+typeset in LR mode so it does not have line breaks (@pxref{Modes}). If
+you use these then @LaTeX{} doesn't give you an error but it ignores
+what you want: if you enter @code{\sbox@{\newbin@}@{test \\ test@}} and
+@code{\usebox@{\newbin@}} then you get @samp{testtest}, while if you
+enter @code{\sbox@{\newbin@}@{test \par test@}} and
+@code{\usebox@{\newbin@}} then you get @samp{test test}, but no error or
+warning. To fix this use a @code{\parbox} or @code{minipage} as here.
+
+@c credit: egreg https://tex.stackexchange.com/a/41668/121234
+@example
+\savebox@{\abin@}@{%
+ \begin@{minipage@}@{\linewidth@}
+ \begin@{enumerate@}
+ \item First item
+ \item Second item
+ \end@{enumerate@}
+ \end@{minipage@}@}
+ ...
+\usebox@{\abin@}
+@end example
+
+As an example of the efficiency of reusing a bin's contents, this puts
+the same picture on each page of the document by putting it in the
+header. @LaTeX{} only typesets it once.
+
+@example
+\usepackage@{graphicx@} % all this in the preamble
+\newsavebox@{\sealbin@}
+\savebox@{\sealbin@}@{%
+ \setlength@{\unitlength@}@{1in@}%
+ \begin@{picture@}(0,0)%
+ \put(1.5,-2.5)@{%
+ \begin@{tabular@}@{c@}
+ \includegraphics[height=2in]@{companylogo.png@} \\
+ Office of the President
+ \end@{tabular@}@}
+ \end@{picture@}%
+@}
+\markright@{\usebox@{\sealbin@}@}
+\pagestyle@{headings@}
+@end example
+
+@noindent
+The @code{picture} environment is good for fine-tuning the placement.
+
+If the bin has not already been defined then you get something like
+@samp{Undefined control sequence. <argument> \nobin}.
+
+
+@node lrbox
+@section @code{lrbox}
+
+@findex lrbox
Synopsis:
@example
-\sbox@{@var{\boxcmd}@}@{@var{text}@}
+\begin@{lrbox@}@{@var{box-cmd}@}
+ @var{text}
+\end@{lrbox@}
@end example
-@code{\sbox} types @var{text} in a box just as with @code{\mbox}
-(@pxref{\mbox}) except that instead of the resulting box being
-included in the normal output, it is saved in the box labeled
-@var{\boxcmd}. @var{\boxcmd} must have been previously declared with
-@code{\newsavebox} (@pxref{\newsavebox}).
+The @var{text} inside the environment is saved in the bin
+@code{@var{box-cmd}}. The @var{box-cmd} must begin with a
+backslash. You must create this bin in advance with @code{\newsavebox}
+(@pxref{\newsavebox}). This is the environment form of the @code{\sbox}
+and @code{\savebox} commands, and is equivalent to them. @xref{\sbox &
+\savebox} for the full information.
+
+In this example the environment is convenient for entering the
+@code{tabular}.
+
+@example
+\newsavebox@{\jhbin@}
+\begin@{lrbox@}@{\jhbin@}
+ \begin@{tabular@}@{c@}
+ \includegraphics[height=1in]@{jh.png@} \\
+ Jim Hef@{@}feron
+ \end@{tabular@}
+\end@{lrbox@}
+ ...
+\usebox@{\jhbin@}
+@end example
@node \usebox
-@section @code{\usebox@{@var{\boxcmd}@}}
+@section @code{\usebox}
@findex \usebox
+@cindex box, use saved box
Synopsis:
@example
-\usebox@{@var{\boxcmd}@}
+\usebox@{@var{box-cmd}@}
@end example
-@code{\usebox} produces the box most recently saved in the bin
-@var{\boxcmd} by a @code{\savebox} command (@pxref{\savebox}).
+Produce the box most recently saved in the bin @var{box-cmd} by the
+commands @code{\sbox} or @code{\savebox}, or the @code{lrbox}
+environment. @xref{\sbox & \savebox} for more information and examples.
+(Note that @var{box-cmd} starts with a backslash.) This command is
+robust (@pxref{\protect}).
@node Color
@@ -10148,7 +14427,7 @@ significantly extends the capabilities described here, including adding
@node Color package options
-@section Color package options
+@section @code{color} package options
@cindex color package options
@cindex options, color package
@@ -10216,6 +14495,7 @@ such as with inks, so that combining full intensity of cyan, magenta,
and yellow makes black.
@table @code
+@anchor{color models cmyk}
@item cmyk
A comma-separated list with four real numbers between 0 and 1,
inclusive. The first number is the intensity of cyan, the second is
@@ -10223,10 +14503,12 @@ magenta, and the others are yellow and black. A number value of 0 means
minimal intensity, while a 1 is for full intensity. This model is often
used in color printing. It is a subtractive model.
+@anchor{color models gray}
@item gray
A single real number between 0 and 1, inclusive. The colors are shades
of grey. The number 0 produces black while 1 gives white.
+@anchor{color models rgb}
@item rgb
A comma-separated list with three real numbers between 0 and 1,
inclusive. The first number is the intensity of the red component, the
@@ -10234,6 +14516,7 @@ second is green, and the third the blue. A number value of 0 means that
none of that component is added in, while a 1 means full intensity.
This is an additive model.
+@anchor{color models RGB}
@item RGB
(@file{pdftex}, @file{xetex}, @file{luatex} drivers) A comma-separated
list with three integers between 0 and 255, inclusive. This model is a
@@ -10242,6 +14525,7 @@ often described in a red-green-blue model using numbers in this range.
The values entered here are converted to the @code{rgb} model by
dividing by 255.
+@anchor{color models named}
@item named
Colors are accessed by name, such as @samp{PrussianBlue}. The list of
names depends on the driver, but all support the names @samp{black},
@@ -10280,9 +14564,15 @@ Synopsis:
\definecolor@{@var{name}@}@{@var{model}@}@{@var{specification}@}
@end example
-Give the name @var{name} to the color. For example, after
-@code{\definecolor@{silver@}@{rgb@}@{0.75,0.75,0.74@}} you can use that
-color name with @code{Hi ho, \textcolor@{silver@}@{Silver@}!}.
+Give the name @var{name} to the color. For example, after this
+
+@example
+\definecolor@{silver@}@{rgb@}@{0.75,0.75,0.74@}
+@end example
+
+@noindent
+you can use that color name with @code{Hi ho,
+\textcolor@{silver@}@{Silver@}!}.
This example gives the color a more abstract name, so it could change and
not be misleading.
@@ -10309,6 +14599,7 @@ Synopses:
\textcolor[@var{color model}]@{@var{color specification}@}@{...@}
@end example
+@noindent
or
@example
@@ -10319,9 +14610,11 @@ or
The affected text gets the color. This line
@example
-\textcolor@{magenta@}@{My name is Ozymandias, king of kings:@} Look on my works, ye Mighty, and despair!
+\textcolor@{magenta@}@{My name is Ozymandias, king of kings:@}
+Look on my works, ye Mighty, and despair!
@end example
+@noindent
causes the first half to be in magenta while the rest is in black. You
can use a color declared with @code{\definecolor} in exactly the same
way that we just used the builtin color @samp{magenta}.
@@ -10349,9 +14642,15 @@ including the vertical and horizontal lines.
\end@{center@}
@end example
-You can use color in equations. A document might have
-@code{\definecolor@{highlightcolor@}@{RGB@}@{225,15,0@}} in the
-preamble, and then contain this equation.
+You can use color in equations. A document might have this definition
+in the preamble
+
+@example
+\definecolor@{highlightcolor@}@{RGB@}@{225,15,0@}
+@end example
+
+@noindent
+and then contain this equation.
@example
\begin@{equation@}
@@ -10364,7 +14663,8 @@ but sometimes you want a one-off. Those are the second forms in the
synopses.
@example
-Colors of \textcolor[rgb]@{0.33,0.14,0.47@}@{Purple@} and @{\color[rgb]@{0.72,0.60,0.37@} Gold@} for the team
+Colors of \textcolor[rgb]@{0.33,0.14,0.47@}@{Purple@} and
+@{\color[rgb]@{0.72,0.60,0.37@} Gold@} for the team.
@end example
The format of @var{color specification } depends on the color model
@@ -10381,6 +14681,7 @@ Colors inside colors do not combine. Thus
\textcolor@{green@}@{kind of \textcolor@{blue@}@{blue@}@}
@end example
+@noindent
has a final word that is blue, not a combination of blue and green.
@c xx address coloring a line of a table?
@@ -10397,14 +14698,15 @@ Synopses:
@example
\colorbox@{@var{name}@}@{...@}
-\colorbox[@var{model name}]@{@var{box background color specification}@}@{...@}
+\colorbox[@var{model name}]@{@var{box background color}@}@{...@}
@end example
+@noindent
or
@example
\fcolorbox@{@var{frame color}@}@{@var{box background color}@}@{...@}
-\fcolorbox[@var{model name}]@{@var{frame color specification}@}@{@var{box background color specification}@}@{...@}
+\fcolorbox[@var{model name}]@{@var{frame color}@}@{@var{box background color}@}@{...@}
@end example
Make a box with the stated background color. The @code{\fcolorbox}
@@ -10414,6 +14716,7 @@ command puts a frame around the box. For instance this
Name:~\colorbox@{cyan@}@{\makebox[5cm][l]@{\strut@}@}
@end example
+@noindent
makes a cyan-colored box that is five centimeters long and gets its
depth and height from the @code{\strut} (so the depth is
@code{-.3\baselineskip} and the height is @code{\baselineskip}). This
@@ -10424,7 +14727,7 @@ puts white text on a blue background.
@end example
The @code{\fcolorbox} commands use the same parameters as @code{\fbox}
-(@pxref{\fbox and \framebox}), @code{\fboxrule} and @code{\fboxsep}, to
+(@pxref{\fbox & \framebox}), @code{\fboxrule} and @code{\fboxsep}, to
set the thickness of the rule and the boundary between the box interior
and the surrounding rule. @LaTeX{}'s defaults are @code{0.4pt} and
@code{3pt}, respectively.
@@ -10511,7 +14814,7 @@ external to @LaTeX{}, that generate a graphic that you include using the
commands of this chapter. Two that use a programming language are
Asymptote and MetaPost. One that uses a graphical interface is Xfig.
Full description of these systems is outside the scope of this document;
-see their documentation.
+see their documentation on CTAN.
@menu
* Graphics package options:: Options when you load the package.
@@ -10521,7 +14824,7 @@ see their documentation.
@node Graphics package options
-@section Graphics package options
+@section @code{graphics} package options
@cindex graphics package options
@cindex options, graphics package
@@ -10532,6 +14835,7 @@ Synopsis (must be in the document preamble):
\usepackage[@var{comma-separated option list}]@{graphics@}
@end example
+@noindent
or
@example
@@ -10600,7 +14904,7 @@ option has @LaTeX{} to read the size from the latter.
@node Graphics package configuration
-@section Graphics package configuration
+@section @code{graphics} package configuration
@cindex graphics
@cindex graphics package
@@ -10615,13 +14919,13 @@ These commands configure the way @LaTeX{} searches the file system for
the graphic.
The behavior of file system search code is necessarily platform
-dependent. In this document we cover Linux, Macintosh, and Windows, as
+dependent. In this document we cover GNU/Linux, Macintosh, and Windows, as
those systems are typically configured. For other situations consult
the documentation in @file{grfguide.pdf}, or the @LaTeX{} source, or your
@TeX{} distribution's documentation.
@menu
-* \graphicspath:: Directories to search.
+* \graphicspath:: Directories to search.
* \DeclareGraphicsExtensions:: File types, such as JPG or EPS.
* \DeclareGraphicsRule:: How to handle file types.
@end menu
@@ -10677,6 +14981,7 @@ current directory,
\usepackage@{lion.png@}
@end example
+@noindent
for each of the listed directories, @LaTeX{} concatenates it with the
file name and searches for the result, checking for @file{pix/lion.png}
and then @file{../pix/lion.png}. This algorithm means that the
@@ -10690,9 +14995,9 @@ these means that the document is not portable. (You could preserve
portability by adjusting your @TeX{} system settings configuration file
parameter @code{TEXINPUTS}; see the documentation of your system.)
-You can use @code{\graphicspath} in the preamble or in the document
-body. You can use it more than once. For debugging, show its value
-with @code{\makeatletter\typeout@{\Ginput@@path@}\makeatother}.
+You can use @code{\graphicspath} anywhere in the document. You can use
+it more than once. Show its value with
+@code{\makeatletter\typeout@{\Ginput@@path@}\makeatother}.
The directories are taken with respect to the base file. That is,
suppose that you are working on a document based on @file{book/book.tex}
@@ -10727,6 +15032,7 @@ files.
\includegraphics@{lion@} % will find @file{lion.png} before @file{lion.pdf}
@end example
+@noindent
Because the file name @file{lion} does not have a period, @LaTeX{} uses
the extension list. For each directory in the graphics path
(@pxref{\graphicspath}), @LaTeX{} will try the extensions in the order
@@ -10735,17 +15041,20 @@ and extensions then it reports @samp{! LaTeX Error: File `@file{lion}'
not found}. Note that you must include the periods at the start of the
extensions.
-Because Linux and Macintosh filenames are case sensitive, the list of
+Because GNU/Linux and Macintosh filenames are case sensitive, the list of
file extensions is case sensitive on those platforms. The Windows
platform is not case sensitive.
You are not required to include @code{\DeclareGraphicsExtensions} in
your document; the printer driver has a sensible default. For example,
-the most recent @file{pdftex.def} has the extension list
-@samp{@code{.png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPEG,.JBIG2,.JB2}}.
+the most recent @file{pdftex.def} has this extension list.
+
+@example
+.png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPEG,.JBIG2,.JB2
+@end example
-You can use this command in the preamble or in the document body. You
-can use it more than once. For debugging, show its value with
+You can use this command anywhere in the document. You can use it more
+than once. Show its value with
@code{\makeatletter\typeout@{\Gin@@extensions@}\makeatother}.
@@ -10777,6 +15086,7 @@ This
\DeclareGraphicsRule@{*@}@{mps@}@{*@}@{@}
@end example
+@noindent
tells @LaTeX{} that it should handle as MetaPost output any file with an
extension not covered by another rule, so it covers @file{filename.1},
@file{filename.2}, etc.
@@ -10898,13 +15208,14 @@ This
\end@{center@}
@end example
+@noindent
will incorporate into the document the graphic in @file{plot.pdf},
centered and at its nominal size. You can also give a path to the file,
as with @code{\includegraphics@{graphics/plot.pdf@}}. To specify a list
of locations to search for the file, @pxref{\graphicspath}.
-If your filename includes spaces then put it in double quotes, as with
-@code{\includegraphics@{"sister picture.jpg"@}}.
+If your filename includes spaces then put it in double quotes. An example
+is @code{\includegraphics@{"sister picture.jpg"@}}.
The @code{\includegraphics@{@var{filename}@}} command decides on the
type of graphic by splitting @var{filename} on the first dot. You can
@@ -10942,7 +15253,7 @@ caption.
...
\begin@{center@}
\includegraphics@{pix/nix.png@}
- \captionof@{figure@}@{The spirit of the night@} \label@{pix:nix@} % if you want a caption
+ \captionof@{figure@}@{The spirit of the night@} \label@{pix:nix@} % optional
\end@{center@}
@end example
@@ -10950,8 +15261,7 @@ This example puts a box with a graphic side by side with one having
text, with the two vertically centered.
@example
-\newcommand*@{\vcenteredhbox@}[1]@{\begingroup
- \setbox0=\hbox@{#1@}\parbox@{\wd0@}@{\box0@}\endgroup@}
+\newcommand*@{\vcenteredhbox@}[1]@{\begin@{tabular@}@{@@@{@}c@@@{@}@}#1\end@{tabular@}@}
...
\begin@{center@}
\vcenteredhbox@{\includegraphics[width=0.4\textwidth]@{plot@}@}
@@ -10988,6 +15298,7 @@ in a key-value form, as here.
\end@{center@}
@end example
+@noindent
The options are read left-to-right. So the first graphic above is made
one inch wide and then rotated, while the second is rotated and then
made one inch wide. Thus, unless the graphic is perfectly square, the
@@ -11003,6 +15314,7 @@ page it puts together boxes and this is the box allocated for the
graphic.
@table @code
+@anchor{includegraphics width}
@item width
The graphic will be shown so its bounding box is this width. An example
is @code{\includegraphics[width=1in]@{plot@}}. You can use the standard
@@ -11014,37 +15326,44 @@ the width of the text with
@code{\includegraphics[width=\linewidth-1.0cm]@{hefferon.jpg@}}.
@item height
+@anchor{includegraphics height}
The graphic will be shown so its bounding box is this height. You can
use the standard @TeX{} dimensions (@pxref{Units of length}), and also
convenient are @code{\pageheight} and @code{\textheight} (@pxref{Page
-layout parameters}). For instance,
+layout parameters}). For instance, the command
@code{\includegraphics[height=0.25\textheight]@{godel@}} will make the
-graphic be a quarter of the height of the text area.
+graphic a quarter of the height of the text area.
@item totalheight
+@anchor{includegraphics totalheght}
The graphic will be shown so its bounding box has this height plus
depth. This differs from the height if the graphic was rotated. For
instance, if it has been rotated by -90 then it will have zero height
but a large depth.
@item keepaspectratio
-If set to @code{true}, or just specified as with
-@code{\includegraphics[...,keepaspectratio,...]@{...@}} and you give as
-options both @code{width} and @code{height} (or @code{totalheight}),
-then @LaTeX{} will make the graphic is as large as possible without
-distortion. That is, @LaTeX{} will ensure that neither is the graphic
-wider than @code{width} nor taller than @code{height} (or
+@anchor{includegraphics keepaspectratio}
+If set to @code{true}, or just specified as here
+
+@example
+@code{\includegraphics[...,keepaspectratio,...]@{...@}}
+@end example
+
+@noindent
+and you give as options both @code{width} and @code{height} (or
+@code{totalheight}), then @LaTeX{} will make the graphic is as large as
+possible without distortion. That is, @LaTeX{} will ensure that neither
+is the graphic wider than @code{width} nor taller than @code{height} (or
@code{totalheight}).
@item scale
-Factor by which to scale the graphic. Specifying
-@code{\includegraphics[scale=2.0]@{...@}} makes the graphic twice its
-nominal size. This number may be any value; a number between 1
-and@tie{}0 will shrink the graphic and a negative number will reflect
-it.
+Factor by which to scale the graphic. To make a graphic twice its
+nominal size, enter @code{\includegraphics[scale=2.0]@{...@}}. This
+number may be any value; a number between 1 and@tie{}0 will shrink the
+graphic and a negative number will reflect it.
@item angle
-Rotate the picture. The angle is taken in degrees and counterclockwise.
+Rotate the graphic. The angle is taken in degrees and counterclockwise.
The graphic is rotated about its @code{origin}; see that option. For a
complete description of how rotated material is typeset,
@pxref{\rotatebox}.
@@ -11053,9 +15372,9 @@ complete description of how rotated material is typeset,
The point of the graphic about which the rotation happens. Possible
values are any string containing one or two of: @code{l} for left,
@code{r} for right, @code{b} for bottom, @code{c} for center, @code{t}
-for top, and @code{B} for baseline. Thus,
+for top, and @code{B} for baseline. Thus, entering the command
@code{\includegraphics[angle=180,origin=c]@{moon@}} will turn the
-picture upside down from the center, while
+picture upside down about that picture's center, while the command
@code{\includegraphics[angle=180,origin=lB]@{LeBateau@}} will turn its
picture upside down about its left baseline. (The character @code{c}
gives the horizontal center in @code{bc} or @code{tc}, but gives the
@@ -11068,6 +15387,7 @@ To rotate about an arbitrary point, @pxref{\rotatebox}.
These are lesser-used options.
@table @code
+@anchor{includegraphics viewport}
@item viewport
Pick out a subregion of the graphic to show. Takes four arguments,
separated by spaces and given in @TeX{} dimensions, as with
@@ -11076,6 +15396,7 @@ dimensions default to big points,@tie{}@code{bp}. They are taken
relative to the origin specified by the bounding box. See also the
@code{trim} option.
+@anchor{includegraphics trim}
@item trim
Gives parts of the graphic to not show. Takes four arguments, separated
by spaces, that are given in @TeX{} dimensions, as with
@@ -11085,17 +15406,25 @@ will crop the picture by 0@tie{}inches on the left, 0.1@tie{}inches on
the bottom, 0.2@tie{}inches on the right, and 0.3@tie{}inches on the
top. See also the @code{viewport} option.
+@anchor{includegraphics clip}
@item clip
-If set to @code{true}, or just specified as with
-@code{\includegraphics[...,clip,...]@{...@}}, then the graphic is
-cropped to the bounding box. You can get this effect by instead using
-the starred form of the command, as
+If set to @code{true}, or just specified as here
+
+@example
+\includegraphics[...,clip,...]@{...@}
+@end example
+
+@noindent
+then the graphic is cropped to the bounding box. This is the same as
+using the starred form of the command,
@code{\includegraphics*[...]@{...@}}.
+@anchor{includegraphics page}
@item page
Give the page number of a multi-page PDF file. The default is
@code{page=1}.
+@anchor{includegraphics pagebox}
@item pagebox
Specifies which bounding box to use for PDF files from among
@code{mediabox}, @code{cropbox}, @code{bleedbox}, @code{trimbox}, or
@@ -11110,22 +15439,33 @@ content. The driver will set the image size based on CropBox if
present, otherwise it will not use one of the others, with a
driver-defined order of preference. MediaBox is always present.
+@anchor{includegraphics interpolate}
@item interpolate
Enable or disable interpolation of raster images by the viewer. Can be
-set with @code{interpolate=true} or just specified as with
-@code{\includegraphics[...,interpolate,...]@{...@}}.
+set with @code{interpolate=true} or just specified as here.
+@example
+\includegraphics[...,interpolate,...]@{...@}
+@end example
+
+@anchor{includegraphics quiet}
@item quiet
Do not write information to the log. You can set it with
@code{quiet=true} or just specified it with
@code{\includegraphics[...,quite,...]@{...@}},
+@anchor{includegraphics draft}
@item draft
-If you set it with @code{draft=true} or just specified it with
-@code{\includegraphics[...,draft,...]@{...@}}, then the graphic will not
-appear in the document, possibly saving color printer ink. Instead,
-@LaTeX{} will put an empty box of the correct size with the filename
-printed in it.
+If you set it with @code{draft=true} or just specify it with
+
+@example
+\includegraphics[...,draft,...]@{...@}
+@end example
+
+@noindent
+then the graphic will not appear in the document, possibly saving color
+printer ink. Instead, @LaTeX{} will put an empty box of the correct
+size with the filename printed in it.
@end table
@@ -11140,6 +15480,7 @@ For example, if an @file{.eps} file has the line @code{%%BoundingBox 10
60/72@tie{}inch tall.
@table @code
+@anchor{includegraphics bb}
@item bb
Specify the bounding box of the displayed region. The argument is four
dimensions separated by spaces, as with @code{\includegraphics[.., bb=
@@ -11148,23 +15489,40 @@ BoundingBox numbers from the EPS file automatically, so this option is
only useful if the bounding box is missing from that file or if you want
to change it.
+@anchor{includegraphics bbllx}
+@anchor{includegraphics bblly}
+@anchor{includegraphics bburx}
+@anchor{includegraphics bbury}
@item bbllx, bblly, bburx, bbury
Set the bounding box. These four are obsolete, but are retained for
compatibility with old packages.
+@anchor{includegraphics natwidth}
+@anchor{includegraphics natheight}
@item natwidth, natheight
An alternative for @code{bb}. Setting
-@code{\includegraphics[...,natwidth=1in,natheight=0.618in,...]@{...@}}
+
+@example
+\includegraphics[...,natwidth=1in,natheight=0.618in,...]@{...@}
+@end example
+
+@noindent
is the same as setting @code{bb=0 0 1in 0.618in}.
+@anchor{includegraphics hiresbb}
@item hiresbb
If set to @code{true}, or just specified as with
-@code{\includegraphics[...,hiresbb,...]@{...@}}, then @LaTeX{} will look
-for @code{%%HiResBoundingBox} lines instead of @code{%%BoundingBox}
-lines. (The @code{BoundingBox} lines use only natural numbers while the
-@code{HiResBoundingBox} lines use decimals; both use units equivalent to
-@TeX{}'s big points, 1/72@tie{}inch.) To override a prior setting of
-@code{true}, you can set it to @code{false}.
+
+@example
+\includegraphics[...,hiresbb,...]@{...@}
+@end example
+
+@noindent
+then @LaTeX{} will look for @code{%%HiResBoundingBox} lines instead of
+@code{%%BoundingBox} lines. (The @code{BoundingBox} lines use only
+natural numbers while the @code{HiResBoundingBox} lines use decimals;
+both use units equivalent to @TeX{}'s big points, 1/72@tie{}inch.) To
+override a prior setting of @code{true}, you can set it to @code{false}.
@end table
@@ -11175,21 +15533,26 @@ will read the file @file{lion.xxx} as though it were
@file{lion.png}. For more on these, @pxref{\DeclareGraphicsRule}.
@table @code
+@anchor{includegraphics type}
@item type
Specify the graphics type.
+@anchor{includegraphics ext}
@item ext
Specify the graphics extension.
Only use this in conjunction with the option @code{type}.
+@anchor{includegraphics read}
@item read
Specify the file extension of the read file.
Only use this in conjunction with the option @code{type}.
+@anchor{includegraphics command}
@item command
-Specify a command to be applied to this file.
-Only use this in conjunction with the option @code{type}.
-@c write18 and restricted execution.
+Specify a command to be applied to this file. Only use this in
+conjunction with the option @code{type}. @xref{Command line options}
+for a discussion of enabling the @code{\write18} functionality to run
+external commands.
@end table
@@ -11215,7 +15578,8 @@ Synopses for @file{graphicx} package:
\rotatebox[@var{key-value list}]@{@var{angle}@}@{@var{material}@}
@end example
-Put @var{material} in a box and rotate it @var{angle} degrees counterclockwise.
+Put @var{material} in a box and rotate it @var{angle} degrees
+counterclockwise.
This example rotates the table column heads forty five degrees.
@@ -11252,15 +15616,21 @@ except for the @code{x} and @code{y} options (@pxref{\includegraphics}).
@table @code
@item origin
The point of the @var{material}'s box about which the rotation happens.
-Possible values are any string containing one or two of: @code{l} for
+Possible value is any string containing one or two of: @code{l} for
left, @code{r} for right, @code{b} for bottom, @code{c} for center,
-@code{t} for top, and @code{B} for baseline. Thus,
-@code{\includegraphics[angle=180,origin=c]@{moon@}} will turn the
-picture upside down from the center, while
-@code{\includegraphics[angle=180,origin=lB]@{LeBateau@}} will turn its
-picture upside down about its left baseline. (The character @code{c}
-gives the horizontal center in @code{bc} or @code{tc} but gives the
-vertical center in @code{lc} or @code{rc}.) The default is @code{lB}.
+@code{t} for top, and @code{B} for baseline. Thus, the first line here
+
+@example
+\includegraphics[angle=180,origin=c]@{moon@}
+\includegraphics[angle=180,origin=lB]@{LeBateau@}
+@end example
+
+@noindent
+will turn the picture upside down from the center while the second will
+turn its picture upside down about its left baseline. (The character
+@code{c} gives the horizontal center in @code{bc} or @code{tc} but gives
+the vertical center in @code{lc} or @code{rc}.) The default is
+@code{lB}.
@item x, y
Specify an arbitrary point of rotation with
@@ -11308,10 +15678,15 @@ first text and doubles the size of the second.
If you do not specify the optional @var{vertical factor} then it
defaults to the same value as the @var{horizontal factor}.
-You can use this command to resize a graphic, as with
-@code{\scalebox@{0.5@}@{\includegraphics@{lion@}@}}. If you use the
-@file{graphicx} package then you can accomplish the same thing with
-optional arguments to @code{\includegraphics}
+You can use this command to resize a graphic, as here.
+
+@example
+\scalebox@{0.5@}@{\includegraphics@{lion@}@}
+@end example
+
+@noindent
+If you use the @file{graphicx} package then you can accomplish the same
+thing with optional arguments to @code{\includegraphics}
(@pxref{\includegraphics}).
The @code{\reflectbox} command abbreviates
@@ -11377,7 +15752,7 @@ special meaning do not correspond to simple characters you can type.
* Symbols by font position:: Inserting font symbols by number.
* Text symbols:: Inserting other non-letter symbols in text.
* Accents:: Inserting accents.
-* Additional Latin letters:: Inserting other non-English characters.
+* Additional Latin letters:: Inserting other non-English characters.
* \rule:: Inserting lines and rectangles.
* \today:: Inserting today's date.
@end menu
@@ -11390,8 +15765,8 @@ special meaning do not correspond to simple characters you can type.
@cindex characters, reserved
@cindex special characters
@cindex characters, special
-@LaTeX{} sets aside the following characters for special purposes (for
-example, the percent sign@tie{}@code{%} is for comments) so they are
+@LaTeX{} sets aside the following characters for special purposes. For
+example, the percent sign@tie{}@code{%} is for comments. They are
called @dfn{reserved characters} or @dfn{special characters}.
@example
@@ -11408,7 +15783,7 @@ called @dfn{reserved characters} or @dfn{special characters}.
If you want a reserved character to be printed as itself, in the text
body font, for all but the final three characters in that list simply
put a backslash@tie{}@code{\} in front of the character. Thus,
-@code{\$1.23} will produce@tie{}@code{$1.23} in your output.
+typing @code{\$1.23} will produce@tie{}@code{$1.23} in your output.
@findex \~
@findex \^
@@ -11416,11 +15791,12 @@ put a backslash@tie{}@code{\} in front of the character. Thus,
As to the last three characters, to get a tilde in the text body font
use @code{\~@{@}} (omitting the curly braces would result in the next
character receiving a tilde accent). Similarly, to get a get a text
-body font circumflex use @code{\^@{@}}. A text body font backslash
-results from @code{\textbackslash@{@}}.
+body font circumflex use @code{\^@{@}}. To get a backslash in the font
+of the text body, enter @code{\textbackslash@{@}}.
To produce the reserved characters in a typewriter font use
-@code{\verb!!}, as below.
+@code{\verb!!} as below (the double backslash@tie{}@code{\\} is only
+there to split the lines).
@example
\begin@{center@}
@@ -11429,16 +15805,13 @@ To produce the reserved characters in a typewriter font use
\end@{center@}
@end example
-In that example the double backslash@tie{}@code{\\} is only there to
-split the lines.
-
@node Upper and lower case
@section Upper and lower case
-@cindex Upper case
-@cindex Lower case
-@cindex characters, case
+@cindex uppercase
+@cindex lowercase
+@cindex characters, case of
Synopsis:
@@ -11516,23 +15889,24 @@ example could also be written as @code{\symbol@{'40@}} or
@cindex symbols, text
@findex textcomp @r{package}
-@LaTeX{} provides commands to generate a number of non-letter symbols
-in running text. Some of these, especially the more obscure ones, are
-not available in OT1; you may need to load the @code{textcomp} package.
+@LaTeX{} provides commands to generate a number of non-letter symbols in
+running text. Some of these, especially the more obscure ones, are not
+available in OT1. Unless you are using Xe@LaTeX{} or Lua@LaTeX{} then
+you may need to load the @code{textcomp} package.
@ftable @code
@item \copyright
@itemx \textcopyright
@cindex copyright symbol
-The copyright symbol, @copyright{}.
+@copyright{} The copyright symbol.
@item \dag
@cindex dagger, in text
-The dagger symbol (in text).
+@BES{2020,@math{\dag}} The dagger symbol (in text).
@item \ddag
@cindex double dagger, in text
-The double dagger symbol (in text).
+@BES{2021,@math{\ddag}} The double dagger symbol (in text).
@item \LaTeX
@cindex @LaTeX{} logo
@@ -11556,50 +15930,50 @@ The @LaTeX{}2e logo.
@cindex single angle quotation marks
@cindex French quotation marks
@cindex quotation marks, French
-Double and single angle quotation marks, commonly used in French:
-@guillemotleft{}, @guillemotright{}, @guilsinglleft{}, @guilsinglright{}.
+@guillemotleft{}, @guillemotright{}, @guilsinglleft{}, @guilsinglright{}
+Double and single angle quotation marks, commonly used in French.
@item \ldots
@itemx \dots
@itemx \textellipsis
@cindex ellipsis
-An ellipsis (three dots at the baseline): `@dots{}'. @code{\ldots}
+@dots{} An ellipsis (three dots at the baseline): @code{\ldots}
and @code{\dots} also work in math mode.
@item \lq
@cindex left quote
@cindex opening quote
-Left (opening) quote: `.
+` Left (opening) quote.
@item \P
@itemx \textparagraph
@cindex paragraph symbol
@cindex pilcrow
-Paragraph sign (pilcrow): @BES{00B6,\P}.
+@BES{00B6,\P} Paragraph sign (pilcrow).
@item \pounds
@itemx \textsterling
@cindex pounds symbol
@cindex sterling symbol
-English pounds sterling: @pounds{}.
+@pounds{} English pounds sterling.
@item \quotedblbase @r{(@quotedblbase{})}
@itemx \quotesinglbase @r{(@quotesinglbase{})}
@cindex double low-9 quotation mark
@cindex single low-9 quotation mark
@cindex low-9 quotation marks, single and double
-Double and single quotation marks on the baseline:
-@quotedblbase{} and @quotesinglbase{}.
+@quotedblbase{} and @quotesinglbase{}
+Double and single quotation marks on the baseline.
@item \rq
@cindex right quote
@cindex closing quote
-Right (closing) quote: '.
+' Right (closing) quote.
@item \S
-\itemx \textsection
+@itemx \textsection
@cindex section symbol
-Section sign: @BES{00A7,\S}.
+@BES{00A7,\S} Section sign.
@item \TeX
@cindex @TeX{} logo
@@ -11609,55 +15983,55 @@ The @TeX{} logo.
@item \textasciicircum
@cindex circumflex, ASCII, in text
@cindex ASCII circumflex, in text
-ASCII circumflex: ^.
+^ ASCII circumflex.
@item \textasciitilde
@cindex tilde, ASCII, in text
@cindex ASCII tilde, in text
-ASCII tilde: ~.
+~ ASCII tilde.
@item \textasteriskcentered
@cindex asterisk, centered, in text
@cindex centered asterisk, in text
-Centered asterisk: *.
+* Centered asterisk.
@item \textbackslash
@cindex backslash, in text
-Backslash: \.
+\ Backslash.
@item \textbar
@cindex vertical bar, in text
@cindex bar, vertical, in text
-Vertical bar: |.
+| Vertical bar.
@item \textbardbl
@cindex vertical bar, double, in text
@cindex bar, double vertical, in text
@cindex double vertical bar, in text
-Double vertical bar.
+@BES{23F8,||} Double vertical bar.
@item \textbigcircle
@cindex big circle symbols, in text
@cindex circle symbol, big, in text
-Big circle symbol.
+@BES{25EF,} Big circle symbol.
@item \textbraceleft
@cindex left brace, in text
@cindex brace, left, in text
-Left brace: @{.
+@{ Left brace.
@item \textbraceright
@cindex right brace, in text
@cindex brace, right, in text
-Right brace: @}.
+@} Right brace.
@item \textbullet
@cindex bullet, in text
-Bullet: @bullet{}.
+@bullet{} Bullet.
@item \textcircled@{@var{letter}@}
@cindex circled letter, in text
-@var{letter} in a circle, as in @registeredsymbol{}.
+@BES{24B6,} Circle around @var{letter}.
@item \textcompwordmark
@itemx \textcapitalcompwordmark
@@ -11665,53 +16039,60 @@ Bullet: @bullet{}.
@cindex composite word mark, in text
@cindex cap height
@cindex ascender height
-Composite word mark (invisible). The @code{\textcapital...} form
-has the cap height of the font, while the @code{\textascender...} form
-has the ascender height.
+Used to separate letters that would normally ligature. For example,
+@code{f\textcompwordmark i} produces @samp{fi} without a ligature. This
+is most useful in non-English languages. The
+@code{\textcapitalcompwordmark} form has the cap height of the font
+while the @code{\textascendercompwordmark} form has the ascender height.
@item \textdagger
@cindex dagger, in text
-Dagger: @math{\dag}.
+@BES{2020,@math{\dag}} Dagger.
@item \textdaggerdbl
@cindex dagger, double, in text
@cindex double dagger, in text
-Double dagger: @math{\ddag}.
+@BES{2021,@math{\ddag}} Double dagger.
@item \textdollar @r{(or @code{\$})}
@cindex dollar sign
@cindex currency, dollar
-Dollar sign: $.
+$ Dollar sign.
@item \textemdash @r{(or @code{---})}
@cindex em-dash
-Em-dash: --- (for punctuation).
+--- Em-dash (used for punctuation, as in
+@code{The playoffs --- if you are fortunate enough to make the playoffs ---
+is more like a sprint.}).
@item \textendash @r{(or @code{--})}
@cindex e-dash
-En-dash: -- (for ranges).
+-- En-dash (used for ranges, as in @code{See pages 12--14}).
@item \texteuro
@cindex euro symbol
@cindex currency, euro
-The Euro symbol: @euro{}.
+@PkgIndex{eurosym}
+The Euro symbol: @euro{}. For an alternative glyph design, try the
+@file{eurosym} package; also, most fonts nowadays come with their own
+Euro symbol (Unicode U+20AC).
@item \textexclamdown @r{(or @code{!`})}
@cindex exclamation point, upside-down
-Upside down exclamation point: @exclamdown{}.
+@exclamdown{} Upside down exclamation point.
@item \textgreater
@cindex greater than symbol, in text
-Greater than: >.
+> Greater than symbol.
@item \textless
@cindex less than symbol, in text
-Less than: <.
+< Less than symbol.
@item \textleftarrow
@cindex arrow, left, in text
@cindex left arrow, in text
-Left arrow.
+@BES{2190,} Left arrow.
@item \textordfeminine
@itemx \textordmasculine
@@ -11719,42 +16100,42 @@ Left arrow.
@cindex masculine ordinal symbol
@cindex ordinals, feminine and masculine
@cindex Spanish ordinals, feminine and masculine
-Feminine and masculine ordinal symbols: @ordf{}, @ordm{}.
+@ordf{}, @ordm{} Feminine and masculine ordinal symbols.
@item \textperiodcentered
@cindex period, centered, in text
@cindex centered period, in text
-Centered period: @BES{00B7,\cdot}.
+@BES{00B7,\cdot} Centered period.
@item \textquestiondown @r{(or @code{?`})}
@cindex question mark, upside-down
-Upside down question mark: @questiondown{}.
+@questiondown{} Upside down question mark.
@item \textquotedblleft @r{(or @code{``})}
@cindex left quote, double
@cindex double left quote
-Double left quote: ``.
+`` Double left quote.
@item \textquotedblright @r{(or @code{''})}
@cindex right quote, double
@cindex double right quote
-Double right quote: ''.
+'' Double right quote.
@item \textquoteleft @r{(or @code{`})}
@cindex left quote, single
@cindex single left quote
-Single left quote: `.
+` Single left quote.
@item \textquoteright @r{(or @code{'})}
@cindex right quote, single
@cindex single right quote
-Single right quote: '.
+' Single right quote.
@item \textquotesingle
@cindex quote, single straight
@cindex straight single quote
@cindex single quote, straight
-Straight single quote. (From TS1 encoding.)
+@BES{0027,} Straight single quote. (From TS1 encoding.)
@item \textquotestraightbase
@itemx \textquotestraightdblbase
@@ -11762,38 +16143,40 @@ Straight single quote. (From TS1 encoding.)
@cindex straight quote, base
@cindex double quote, straight base
@cindex straight double quote, base
+@c Unicode doesn't have these https://en.wikipedia.org/wiki/Quotation_mark
Single and double straight quotes on the baseline.
@item \textregistered
@cindex registered symbol
-Registered symbol: @registeredsymbol{}.
+@registeredsymbol{} Registered symbol.
@item \textrightarrow
@cindex arrow, right, in text
@cindex right arrow, in text
-Right arrow.
+@BES{2192,} Right arrow.
@item \textthreequartersemdash
@cindex three-quarters em-dash
@cindex em-dash, three-quarters
-``Three-quarters'' em-dash, between en-dash and em-dash.
+@BES{FE58,} ``Three-quarters'' em-dash, between en-dash and em-dash.
@item \texttrademark
@cindex trademark symbol
-Trademark symbol: @BES{2122,^{\hbox{TM}}}.
+@BES{2122,^{\hbox{TM}}} Trademark symbol.
+@c ?? Diff from \textthreequartersemdash? In Unicode?
@item \texttwelveudash
@cindex two-thirds em-dash
@cindex em-dash, two-thirds
-``Two-thirds'' em-dash, between en-dash and em-dash.
+@BES{FE58,} ``Two-thirds'' em-dash, between en-dash and em-dash.
@item \textunderscore
@cindex underscore, in text
-Underscore: _.
+_ Underscore.
@item \textvisiblespace
@cindex visible space symbol, in text
-Visible space symbol.
+@BES{2423,} Visible space symbol.
@end ftable
@@ -11806,14 +16189,29 @@ Visible space symbol.
@cindex letters, accented
@PkgIndex{babel}
+@PkgIndex{polyglossia}
@cindex multilingual support
-@LaTeX{} has wide support for many of the world's scripts and
-languages, through the @code{babel} package and related support. This
-section does not attempt to cover all that support. It merely lists
-the core @LaTeX{} commands for creating accented characters.
+@LaTeX{} has wide support for many of the world's scripts and languages,
+through the @code{babel} package and related support if you are using
+pdf@LaTeX{}, or @file{polyglossia} if you are using Xe@LaTeX{} or
+Lua@LaTeX{}. This section does not cover that support. It only lists
+the core @LaTeX{} commands for creating accented characters. The
+@code{\capital...} commands shown here produce alternative forms for use
+with capital letters. These are not available with OT1.
-The @code{\capital...} commands produce alternative forms for use with
-capital letters. These are not available with OT1.
+Below, to make them easier to find, the accents are all illustrated with
+lowercase @samp{o}.
+
+@findex \i @r{(dotless i)}
+@cindex dotless i
+Note that @code{\i} produces a dotless i,
+@c @dotless{i},
+@findex \j @r{(dotless j)}
+@cindex dotless j
+and @code{\j} produces a dotless j.
+@c @dotless{j}.
+These are often used in place of their dotted counterparts when they are
+accented.
@table @code
@item \"
@@ -11822,22 +16220,20 @@ capital letters. These are not available with OT1.
@findex \capitaldieresis
@cindex umlaut accent
@cindex dieresis accent
-Produces an umlaut (dieresis), as in @"{o}.
+@"{o} Umlaut (dieresis).
@item \'
@itemx \capitalacute
@findex \' @r{(acute accent)}
@findex \capitalacute
@cindex acute accent
-Produces an acute accent, as in @'{o}. In the @code{tabbing}
-environment, pushes current column to the right of the previous column
-(@pxref{tabbing}).
+@'{o} Acute accent.
@item \.
@findex \. @r{(dot-over accent)}
@cindex dot accent
@cindex dot-over accent
-Produces a dot accent over the following, as in @dotaccent{o}.
+@dotaccent{o} Dot accent.
@item \=
@itemx \capitalmacron
@@ -11846,7 +16242,7 @@ Produces a dot accent over the following, as in @dotaccent{o}.
@cindex macron accent
@cindex overbar accent
@cindex bar-over accent
-Produces a macron (overbar) accent over the following, as in @={o}.
+@={o} Macron (overbar) accent.
@item \^
@itemx \capitalcircumflex
@@ -11854,75 +16250,69 @@ Produces a macron (overbar) accent over the following, as in @={o}.
@findex \capitalcircumflex
@cindex circumflex accent
@cindex hat accent
-Produces a circumflex (hat) accent over the following, as in @^{o}.
+@^{o} Circumflex (hat) accent.
@item \`
@itemx \capitalgrave
@findex \` @r{(grave accent)}
@findex \capitalgrave
@cindex grave accent
-Produces a grave accent over the following, as in @`{o}. In the
-@code{tabbing} environment, move following text to the right margin
-(@pxref{tabbing}).
+@`{o} Grave accent.
@item \~
@itemx \capitaltilde
@findex \~ @r{(tilde accent)}
@findex \capitaltilde
@cindex tilde accent
-Produces a tilde accent over the following, as in @~{n}.
+@~{n} Tilde accent.
@item \b
@findex \b @r{(bar-under accent)}
@cindex bar-under accent
-Produces a bar accent under the following, as in @ubaraccent{o}. See
-also @code{\underbar} hereinafter.
+@ubaraccent{o} Bar accent underneath.
+
+@findex \underbar
+@cindex underbar
+Related to this, @code{\underbar@{@var{text}@}} produces a bar under
+@var{text}. The argument is always processed in LR mode
+(@pxref{Modes}). The bar is always a fixed position under the baseline,
+thus crossing through descenders. See also @code{\underline} in
+@ref{Math miscellany}.
@item \c
@itemx \capitalcedilla
@findex \c @r{(cedilla accent)}
@findex \capitalcedilla
@cindex cedilla accent
-Produces a cedilla accent under the following, as in @,{c}.
+@,{c} Cedilla accent underneath.
@item \d
@itemx \capitaldotaccent
@findex \d @r{(dot-under accent)}
@findex \capitaldotaccent
@cindex dot-under accent
-Produces a dot accent under the following, as in @udotaccent{o}.
+@udotaccent{o} Dot accent underneath.
@item \H
@itemx \capitalhungarumlaut
@findex \H @r{(Hungarian umlaut accent)}
@findex \capitalhungarumlaut
@cindex hungarian umlaut accent
-Produces a long Hungarian umlaut accent over the following, as in @H{o}.
-
-@item \i
-@findex \i @r{(dotless i)}
-@cindex dotless i
-Produces a dotless i, as in `@dotless{i}'.
-
-@item \j
-@findex \j @r{(dotless j)}
-@cindex dotless j
-Produces a dotless j, as in `@dotless{j}'.
+@H{o} Long Hungarian umlaut accent.
@item \k
@itemx \capitalogonek
@findex \k @r{(ogonek)}
@findex \capitalogonek
@cindex ogonek
-Produces a letter with ogonek, as in `@ogonek{o}'. Not available in
-the OT1 encoding.
+@ogonek{o} Ogonek. Not available in the OT1 encoding.
@item \r
@itemx \capitalring
@findex \r @r{(ring accent)}
@findex \capitalring
@cindex ring accent
-Produces a ring accent, as in `@ringaccent{o}'.
+@ringaccent{o} Ring accent.
@item \t
@itemx \capitaltie
@@ -11933,24 +16323,15 @@ Produces a ring accent, as in `@ringaccent{o}'.
@findex \newtie
@findex \capitalnewtie
@cindex tie-after accent
-Produces a tie-after accent, as in `@tieaccent{oo}'. The
-@code{\newtie} form is centered in its box.
+@tieaccent{oo} Tie-after accent. The @code{\newtie} form is centered in
+its box.
@item \u
@itemx \capitalbreve
@findex \u @r{(breve accent)}
@findex \capitalbreve
@cindex breve accent
-Produces a breve accent, as in `@u{o}'.
-
-@item \underbar
-@findex \underbar
-@cindex underbar
-Not exactly an accent, this produces a bar under the argument text.
-The argument is always processed in horizontal mode. The bar is
-always a fixed position under the baseline, thus crossing through
-descenders. See also @code{\underline} in @ref{Math miscellany}.
-See also @code{\b} above.
+@u{o} Breve accent.
@item \v
@itemx \capitalcaron
@@ -11959,7 +16340,7 @@ See also @code{\b} above.
@cindex hacek accent
@cindex check accent
@cindex caron accent
-Produces a h@'a@v{c}ek (check, caron) accent, as in `@v{o}'.
+@v{o} H@'a@v{c}ek (check, caron) accent.
@end table
@@ -11975,8 +16356,8 @@ Produces a h@'a@v{c}ek (check, caron) accent, as in `@v{o}'.
@cindex non-English characters
@cindex characters, non-English
-Here are the basic @LaTeX{} commands for inserting letters (beyond
-A--Z) extending the Latin alphabet, used primarily in languages other
+Here are the basic @LaTeX{} commands for inserting letters beyond
+A--Z that extend the Latin alphabet, used primarily in languages other
than English.
@table @code
@@ -12072,25 +16453,48 @@ font encoding, such as @sc{T1}.
@findex \rule
-Synopsis:
+Synopsis, one of:
@example
+\rule@{@var{width}@}@{@var{thickness}@}
\rule[@var{raise}]@{@var{width}@}@{@var{thickness}@}
@end example
-The @code{\rule} command produces @dfn{rules}, that is, lines or
-rectangles. The arguments are:
+Produce a @dfn{rule}, a filled-in rectangle.
-@table @var
-@item raise
-How high to raise the rule (optional).
+@cindex Halmos symbol
+@cindex tombstone
+This produces a rectangular blob, sometimes called a Halmos symbol,
+often used to mark the end of a proof.
-@item width
-The length of the rule (mandatory).
+@example
+\newcommand@{\qedsymbol@}@{\rule@{0.4em@}@{2ex@}@}
+@end example
-@item thickness
-The thickness of the rule (mandatory).
-@end table
+@PkgIndex{amsthm}
+@noindent
+The @file{amsthm} package includes this command, with a somewhat
+different-looking symbol.
+
+The mandatory arguments give the horizontal @var{width} and vertical
+@var{thickness} of the rectangle. They are rigid lengths
+(@pxref{Lengths}). The optional argument @var{raise} is also a rigid
+length, and tells @LaTeX{} how much to raise the rule above the
+baseline, or lower it if the length is negative.
+
+This produces a line, a rectangle that is wide but not tall.
+
+@example
+\noindent\rule@{\textwidth@}@{0.4pt@}
+@end example
+
+@noindent
+The line is the width of the page and 0.4@tie{}points tall. This line
+thickness is common in @LaTeX{}.
+
+A rule that has zero width, or zero thickness, will not show up in the
+output, but can cause @LaTeX{} to change the output around it.
+@xref{\strut} for examples.
@node \today
@@ -12098,16 +16502,23 @@ The thickness of the rule (mandatory).
@findex \today
@cindex date, today's
+@cindex today's date
-The @code{\today} command produces today's date, in the format
-@samp{@var{month} @var{dd}, @var{yyyy}}; for example, @samp{July 4, 1976}.
-It uses the predefined counters @code{\day}, @code{\month}, and
-@code{\year} (@pxref{\day \month \year}) to do this. It is not
-updated as the program runs.
+Synopsis:
-Multilingual packages like @file{babel} or classes like @file{lettre},
-among others, will localize @code{\today}. For example, the following
-will output @samp{4 juillet 1976}:
+@example
+\today
+@end example
+
+Produce today's date in the format @samp{@var{month} @var{dd},
+@var{yyyy}}. An example of a date in that format is @samp{July 4,
+1976}.
+
+@PkgIndex{babel}
+@PkgIndex{polyglossia}
+Multilingual packages such as @file{babel} or @file{polyglossia}, or
+classes such as @file{lettre}, will localize @code{\today}. For example,
+the following will output @samp{4 juillet 1976}:
@example
\year=1976 \month=7 \day=4
@@ -12118,9 +16529,16 @@ will output @samp{4 juillet 1976}:
\end@{document@}
@end example
+@noindent
+@code{\today} uses the counters @code{\day}, @code{\month}, and
+@code{\year} (@pxref{\day & \month & \year}).
+
@PkgIndex{datetime}
-The @code{datetime} package, among others, can produce a wide variety
-of other date formats.
+A number of package on CTAN work with dates. One is @file{datetime} package
+which can produce a wide variety of date formats, including ISO standards.
+
+The date is not updated as the @LaTeX{} process runs, so in principle the
+date could be incorrect by the time the program finishes.
@node Splitting the input
@@ -12129,68 +16547,239 @@ of other date formats.
@cindex splitting the input file
@cindex input file
-A large document requires a lot of input. Rather than putting the whole
-input in a single large file, it's more efficient to split it into
-several smaller ones. Regardless of how many separate files you use,
-there is one that is the
+@LaTeX{} lets you split a large document into several smaller ones.
+This can simplify editing or allow multiple authors to work on the
+document. It can also speed processing.
+
+Regardless of how many separate files you use, there is always one
@cindex root file
@cindex file, root
-@dfn{root file}; it is the one whose name you type
-when you run @LaTeX{}.
+@dfn{root file}, on which @LaTeX{} compilation starts. This shows such
+a file with five included files.
-@xref{filecontents}, for an environment that allows bundling an
-external file to be created with the main document.
+@example
+\documentclass@{book@}
+\includeonly@{ % comment out lines below to omit compiling
+ pref,
+ chap1,
+ chap2,
+ append,
+ bib
+ @}
+\begin@{document@}
+\frontmatter
+\include@{pref@}
+\mainmatter
+\include@{chap1@}
+\include@{chap2@}
+\appendix
+\include@{append@}
+\backmatter
+\include@{bib@}
+\end@{document@}
+@end example
+
+@noindent
+This will bring in material from @file{pref.tex}, @file{chap1.tex},
+@file{chap2.tex}, @file{append.tex}, and @file{bib.tex}. If you compile
+this file, and then comment out all of the lines inside
+@code{\includeonly@{...@}} except for @code{chap1,} and compile again,
+then @LaTeX{} will only process the material in the first chapter.
+Thus, your output will appear more quickly and be shorter to print.
+However, the advantage of the @code{\includeonly} command is that
+@LaTeX{} will retain the page numbers and all of the cross reference
+information from the other parts of the document so these will appear in
+your output correctly.
+
+@xref{Larger book template} for another example of @code{\includeonly}.
@menu
-* \include:: Conditionally include a file.
-* \includeonly:: Determine which files are included.
-* \input:: Unconditionally include a file.
+* \endinput:: Stop including material from a file.
+* \include & \includeonly:: Conditionally include files.
+* \input:: Unconditionally include a file.
@end menu
-@node \include
-@section @code{\include}
-@findex \include
+@node \endinput
+@section @code{\endinput}
+
+@findex \endinput
Synopsis:
@example
-\include@{@var{file}@}
+\endinput
@end example
-If no @code{\includeonly} command is present, the @code{\include}
-command executes @code{\clearpage} to start a new page
-(@pxref{\clearpage}), then reads @var{file}, then does another
-@code{\clearpage}.
+When you @code{\include@{filename@}}, inside @file{filename.tex} the
+material after @code{\endinput} will not be included. This command is
+optional; if @file{filename.tex} has no @code{\endinput} then @LaTeX{}
+will read all of the file.
-Given an @code{\includeonly} command, the @code{\include} actions are
-only run if @var{file} is listed as an argument to
-@code{\includeonly}. See @ref{\includeonly}.
+For example, suppose that a document's root file has
+@code{\input@{chap1@}} and this is @file{chap1.tex}.
-@cindex nested @code{\include}, not allowed
-The @code{\include} command may not appear in the preamble or in a file
-read by another @code{\include} command.
+@example
+\chapter@{One@}
+This material will appear in the document.
+\endinput
+This will not appear.
+@end example
+
+This can be useful for putting documentation or comments at the end of a
+file, or for avoiding junk characters that can be added during mailing.
+It is also useful for debugging: one strategy to localize errors is to
+put @code{\endinput} halfway through the included file and see if the
+error disappears. Now, knowing which half contains the error, moving
+@code{\endinput} to halfway through that area further narrows down the
+location. This process rapidly finds the offending line.
+After reading @code{\endinput}, @LaTeX{} continues to read to the end of
+the line, so something can follow this command and be read nonetheless.
+This allows you, for instance, to close an @code{\if...} with a
+@code{\fi}.
-@node \includeonly
-@section @code{\includeonly}
+@node \include & \includeonly
+@section @code{\include} & @code{\includeonly}
+
+@findex \include
@findex \includeonly
Synopsis:
@example
-\includeonly@{@var{file1},@var{file2},...@}
+\includeonly@{ % in document preamble
+ ...
+ @var{filename},
+ ...
+ @}
+ ...
+\include@{@var{filename}@} % in document body
+@end example
+
+Bring material from the external file @file{@var{filename}.tex} into a
+@LaTeX{} document.
+
+The @code{\include} command does three things: it executes
+@code{\clearpage} (@pxref{\clearpage & \cleardoublepage}), then it
+inputs the material from @file{@var{filename}.tex} into the document,
+and then it does another @code{\clearpage}. This command can only
+appear in the document body. The @code{\includeonly} command controls
+which files will be read by @LaTeX{} under subsequent @code{\include}
+commands. Its list of filenames is comma-separated, and it can only
+appear in the preamble.
+
+This example root document, @file{constitution.tex}, brings in
+three files, @file{preamble.tex}, @file{articles.tex}, and
+@file{amendments.tex}.
+
+@example
+\documentclass@{book@}
+\includeonly@{
+ preamble,
+ articles,
+ amendments
+ @}
+\begin@{document@}
+\include@{preamble@}
+\include@{articles@}
+\include@{amendments@}
+\end@{document@}
@end example
-The @code{\includeonly} command controls which files will be read by
-subsequent @code{\include} commands. The list of filenames is
-comma-separated. Each element @var{file1}, @var{file2}, @dots{} must
-exactly match a filename specified in a @code{\include} command for the
-selection to be effective.
+@noindent
+The file @file{preamble.tex} contains no special code; you have just
+excerpted the chapter from @file{consitution.tex} and put it in a
+separate file just for editing convenience.
+
+@example
+\chapter@{Preamble@}
+We the People of the United States,
+in Order to form a more perfect Union, ...
+@end example
-This command can only appear in the preamble.
+@noindent
+Running @LaTeX{} on @file{constitution.tex} makes the material from the
+three files appear in the document but also generates the auxiliary
+files @file{preamble.aux}, @file{articles.aux}, and
+@file{amendments.tex}. These contain information such as page numbers
+and cross-references (@pxref{Cross references}). If you now comment out
+@code{\includeonly}'s lines with @code{preamble} and @code{amendments}
+and run @LaTeX{} again then the resulting document shows only the
+material from @file{articles.tex}, not the material from
+@file{preamble.tex} or @file{amendments.tex}. Nonetheless, all of the
+auxiliary information from the omitted files is still there, including
+the starting page number of the chapter.
+
+If the document preamble does not have @code{\includeonly} then
+@LaTeX{} will include all the files you call for with @code{\include}
+commands.
+
+The @code{\include} command makes a new page. To avoid that, see
+@ref{\input} (which, however, does not retain the auxiliary
+information).
+
+@xref{Larger book template} for another example using @code{\include}
+and @code{\includeonly}. That example also uses @code{\input} for some
+material that will not necessarily start on a new page.
+
+File names can involve paths.
+
+@example
+\documentclass@{book@}
+\includeonly@{
+ chapters/chap1,
+ @}
+\begin@{document@}
+\include@{chapters/chap1@}
+\end@{document@}
+@end example
+
+To make your document portable across distributions and platforms you
+should avoid spaces in the file names. The tradition is to instead use
+dashes or underscores. Nevertheless, for the name @samp{amo amas amat},
+this works under @TeX{} Live on GNU/Linux:
+
+@example
+\documentclass@{book@}
+\includeonly@{
+ "amo\space amas\space amat"
+ @}
+\begin@{document@}
+\include@{"amo\space amas\space amat"@}
+\end@{document@}
+@end example
+
+and this works under MiK@TeX{} on Windows:
+
+@example
+\documentclass@{book@}
+\includeonly@{
+ @{"amo amas amat"@}
+ @}
+\begin@{document@}
+\include@{@{"amo amas amat"@}@}
+\end@{document@}
+@end example
+
+@cindex nested @code{\include}, not allowed
+You cannot use @code{\include} inside a file that is being included or
+you get @samp{LaTeX Error: \include cannot be nested.} The
+@code{\include} command cannot appear in the document preamble; you will
+get @samp{LaTeX Error: Missing \begin@{document@}}.
+
+If a file that you @code{\include} does not exist, for instance if you
+@code{\include@{athiesm@}} but you meant @code{\include@{atheism@}},
+then @LaTeX{} does not give you an error but will warn you @samp{No file
+athiesm.tex.} (It will also create @file{athiesm.aux}.)
+
+If you @code{\include} the root file in itself then you first get
+@samp{LaTeX Error: Can be used only in preamble.} Later runs get
+@samp{TeX capacity exceeded, sorry [text input levels=15]}. To fix
+this, you must remove the inclusion @code{\include@{root@}} but also
+delete the file @file{@var{root}.aux} and rerun @LaTeX{}.
@node \input
@@ -12201,62 +16790,183 @@ This command can only appear in the preamble.
Synopsis:
@example
-\input@{@var{file}@}
+\input@{@var{filename}@}
+@end example
+
+@LaTeX{} processes the file as if its contents were inserted in the
+current file. For a more sophisticated inclusion mechanism see
+@ref{\include & \includeonly}.
+
+If @var{filename} does not end in @samp{.tex} then @LaTeX{} first tries
+the filename with that extension; this is the usual case. If
+@var{filename} ends with @samp{.tex} then @LaTeX{} looks for the
+filename as it is.
+
+For example, this
+
+@example
+\input@{macros@}
+@end example
+
+@noindent
+will cause @LaTeX{} to first look for @file{macros.tex}. If it finds
+that file then it processes its contents as thought they had been
+copy-pasted in. If there is no file of the name @file{macros.tex} then
+@LaTeX{} tries the name @file{macros}, without an extension. (This may
+vary by distribution.)
+
+To make your document portable across distributions and platforms you
+should avoid spaces in the file names. The tradition is to instead use
+dashes or underscores. Nevertheless, for the name @samp{amo amas amat},
+this works under @TeX{} Live on GNU/Linux:
+
+@example
+\input@{"amo\space amas\space amat"@}
@end example
-The @code{\input} command causes the specified @var{file} to be read
-and processed, as if its contents had been inserted in the current
-file at that point.
+and this works under MiK@TeX{} on Windows:
-If @var{file} does not end in @samp{.tex} (e.g., @samp{foo} or
-@samp{foo.bar}), it is first tried with that extension (@samp{foo.tex}
-or @samp{foo.bar.tex}). If that is not found, the original @var{file}
-is tried (@samp{foo} or @samp{foo.bar}).
+@example
+\input@{@{"amo amas amat"@}@}
+@end example
@node Front/back matter
@chapter Front/back matter
@menu
-* Tables of contents::
-* Glossaries::
-* Indexes::
+* Table of contents etc.:: Table of contents, list of figures, list of tables.
+* Indexes:: Generate an index.
+* Glossaries:: Generate a glossary.
@end menu
-@node Tables of contents
-@section Tables of contents
+@node Table of contents etc.
+@section Table of contents etc.
@cindex table of contents, creating
@findex \tableofcontents
@findex .toc @r{file}
-A table of contents is produced with the @code{\tableofcontents}
-command. You put the command right where you want the table of
-contents to go; @LaTeX{} does the rest for you. A previous run must
-have generated a @file{.toc} file.
-
-The @code{\tableofcontents} command produces a heading, but it does
-not automatically start a new page. If you want a new page after the
-table of contents, write a @code{\newpage} command after the
-@code{\tableofcontents} command.
-
@findex \listoffigures
@findex \listoftables
@findex .lof @r{file}
@findex .lot @r{file}
-The analogous commands @code{\listoffigures} and @code{\listoftables}
-produce a list of figures and a list of tables (from @file{.lof} and
-@file{.lot} files), respectively. Everything works exactly the same
-as for the table of contents.
-@findex \nofiles
-The command @code{\nofiles} overrides these commands, and
-@emph{prevents} any of these lists from being generated.
+Synopsis, one of:
+
+@example
+\tableofcontents
+\listoffigures
+\listoftables
+@end example
+
+Produce a table of contents, or list of figures, or list of tables. Put
+the command in the input file where you want the table or list to
+go. You do not type the entries; for example, typically the table of
+contents entries are automatically generated from the sectioning
+commands @code{\chapter}, etc.
+
+This example illustrates the first command, @code{\tableofcontents}.
+@LaTeX{} will produce a table of contents on the book's first page.
+
+@example
+\documentclass@{book@}
+% \setcounter@{tocdepth@}@{1@}
+\begin@{document@}
+\tableofcontents\newpage
+ ...
+\chapter@{...@}
+ ...
+\section@{...@}
+ ...
+\subsection@{...@}
+ ...
+\end@{document@}
+@end example
+
+@noindent
+Uncommenting the second line would cause that table to contain chapter
+and section listings but not subsection listings, because the
+@code{\section} command has level@tie{}1. @xref{Sectioning} for level
+numbers of the sectioning units. For more on the @code{tocdepth}
+@pxref{Sectioning/tocdepth}.
+
+Another example of the use of @code{\tableofcontents} is in @ref{Larger
+book template}.
+
+If you want a page break after the table of contents, write a
+@code{\newpage} command after the @code{\tableofcontents} command, as
+above.
+
+To make the table of contents @LaTeX{} stores the information in an
+auxiliary file named @file{@var{root-file}.toc} (@pxref{Splitting the
+input}). For example, this @LaTeX{} file @file{test.tex}
+
+@example
+\documentclass@{article@}
+\begin@{document@}
+\tableofcontents\newpage
+\section@{First section@}
+\subsection@{First subsection@}
+ ...
+@end example
+
+@noindent
+writes the following line to @file{test.toc}.
+
+@example
+\contentsline @{section@}@{\numberline @{1@}First section@}@{2@}
+\contentsline @{subsection@}@{\numberline @{1.1@}First subsection@}@{2@}
+@end example
+
+@noindent
+The @code{section} or @code{subsection} is the sectioning unit. The
+hook @code{\numberline} lets you to change how the information appears
+in the table of contents. Of its two arguments, @code{1} or @code{1.1}
+is the sectioning unit number and @code{First section} or @code{First
+subsection} is the title. Finally, @code{2} is the page number on which
+the sectioning units start.
+
+One consequence of this auxiliary file storage strategy is that to get the
+contents page correct you must run @LaTeX{} twice, once to store the
+information and once to get it. In particular, the first time that you
+run @LaTeX{} on a new document, the table of contents page will be empty
+except for its @samp{Contents} header. Just run it again.
+
+The commands @code{\listoffigures} and @code{\listoftables} produce a
+list of figures and a list of tables. They work the same way as the
+contents commands; for instance, these work with information stored in
+@file{.lof} and @file{.lot} files.
+
+@PkgIndex{babel}
+@PkgIndex{polyglossia}
+To change the header for the table of contents page do something like
+the first line here.
+
+@example
+\renewcommand@{\contentsname@}@{Table of contents@}
+\renewcommand@{\listfigurename@}@{Plots@}
+\renewcommand@{\listtablename@}@{Tables@}
+@end example
+
+@noindent
+Similarly, the other two lines will do the other two.
+Internationalization packages such as @file{babel} or @file{polyglossia}
+will change the headers depending on the chosen base language.
+
+@PkgIndex{tocloft}
+@PkgIndex{tocbibbind}
+CTAN has many packages for the table of contents and lists of figures
+and tables. One convenient one for adjusting some aspects of the
+default, such as spacing, is @file{tocloft}. And, @file{tocbibbind}
+will automatically add the bibliography, index, etc. to the table of
+contents.
@menu
* \addcontentsline:: Add an entry to table of contents, etc.
* \addtocontents:: Add text directly to table of contents file, etc.
+* \nofiles:: Prevent writing to auxiliary files.
@end menu
@@ -12272,39 +16982,94 @@ Synopsis:
\addcontentsline@{@var{ext}@}@{@var{unit}@}@{@var{text}@}
@end example
-The @code{\addcontentsline} command adds an entry to the specified list
-or table where:
+@findex \contentsline
+Add an entry to the file specified by @var{ext}. Usually @var{ext} is
+one of @code{toc} for the table of contents, @code{lof} for the list of
+figures, or @code{lot} for the list of tables.
+
+The following will result in an @samp{Appendices} line in the table of
+contents.
+
+@example
+\addcontentsline@{toc@}@{section@}@{\protect\textbf@{Appendices@}@}
+@end example
+
+@noindent
+It will appear at the same indentation level as the sections, will be in
+boldface, and will be assigned the page number associated with the point
+where it appears in the input file.
+
+The @code{\addcontentsline} command writes information to the file
+@file{@var{root-name}.@var{ext}}. It writes that information as the
+text of the command
+@code{\contentsline@{@var{unit}@}@{@var{text}@}@{@var{num}@}}, where
+@code{@var{num}} is the current value of counter @code{@var{unit}}. The
+most common case is the table of contents and there @var{num} is the
+page number of the first page of @var{unit}.
+
+This command is invoked by the sectioning commands @code{\chapter},
+etc., and also by @code{\caption} inside a float environment. But it is
+also used by authors. For example, in a book to have the preface
+unnumbered, you may use the starred @code{\chapter*}. But that does not
+put in table of contents information, so you can enter it manually, as
+here.
+
+@example
+\chapter*@{Preface@}
+\addcontentsline@{toc@}@{chapter@}@{\protect\numberline@{@}Preface@}
+@end example
+
+@noindent
+In the @file{.toc} file @LaTeX{} will put the line @code{\contentsline
+@{chapter@}@{\numberline @{@}Preface@}@{3@}}; note the page number
+@samp{3}.
+
+@c xx how hardwired are these values? other unit names?
+
+All of the arguments for @code{\addcontentsline} are required.
@table @var
@item ext
-The filename extension of the file on which information is to be written,
-typically one of: @code{toc} (table of contents), @code{lof} (list of
-figures), or @code{lot} (list of tables).
+Typically one of the strings @code{toc} for the table of contents,
+@code{lof} for the list of figures, or @code{lot} for the list of
+tables. The filename extension of the information file.
@item unit
-The name of the sectional unit being added, typically one of the
-following, matching the value of the @var{ext} argument:
+A string that depends on the value of the @var{ext} argument:
@table @code
@item toc
-The name of the sectional unit: @code{part}, @code{chapter},
-@code{section}, @code{subsection}, @code{subsubsection}.
+For the table of contents, this is the name of a sectional unit:
+@code{part}, @code{chapter}, @code{section}, @code{subsection}, etc.
+
@item lof
For the list of figures: @code{figure}.
+
@item lot
For the list of tables: @code{table}.
@end table
@item text
-The text of the entry.
+The text of the entry. You must @code{\protect} any commands that are
+fragile (@pxref{\protect}).
@end table
-@findex \contentsline
-What is written to the @file{.@var{ext}} file is the command
-@code{\contentsline@{@var{unit}@}@{@var{text}@}@{@var{num}@}}, where
-@code{@var{num}} is the current value of counter @code{@var{unit}}.
+The @code{\addcontentsline} command has an interaction with
+@code{\include} (@pxref{\include & \includeonly}). If you use them at
+the same level, as with
+@code{\addcontentsline@{...@}@{...@}@{...@}\include@{...@}} then lines
+in the table of contents can come out in the wrong order. The solution
+is to move @code{\addcontentsline} into the file being included.
-@c xx how hardwired are these values? other unit names?
+If you use a @var{unit} that @LaTeX{} does not recognize, as here
+
+@example
+\addcontentsline@{toc@}@{setcion@}@{\protect\textbf@{Appendices@}@}
+@end example
+
+@noindent
+then you don't get an error but the formatting in the table of contents
+will not make sense.
@node \addtocontents
@@ -12312,42 +17077,84 @@ What is written to the @file{.@var{ext}} file is the command
@findex \addtocontents@{@var{ext}@}@{@var{text}@}
-The @code{\addtocontents}@{@var{ext}@}@{@var{text}@} command adds text
-(or formatting commands) directly to the @file{.@var{ext}} file that
-generates the table of contents or lists of figures or tables.
+Synopsis:
+
+@example
+\addtocontents@{@var{ext}@}@{@var{text}@}
+@end example
+
+Add @var{text}, which may be text or formatting commands, directly to
+the auxiliary file with extension @var{ext}. This is most commonly used
+for the table of contents so that is the discussion here, but this also
+applies to the list of figures and list of tables.
+
+This will put some vertical space in the table of contents after the
+@samp{Contents} header.
+
+@example
+\tableofcontents\newpage
+\addtocontents@{toc@}@{\protect\vspace*@{3ex@}@}
+@end example
+
+The @code{\addtocontents} command has two arguments. Both are
+required.
@table @var
@item ext
-The extension of the file on which information is to be written,
-typically one of: @file{toc} (table of contents), @file{lof} (list of
-figures), or @file{lot} (list of tables).
+Typically one of: @file{toc} for the table of contents, @file{lof} for
+the list of figures, or @file{lot} for the list of tables. The
+extension of the file holding the information.
@item text
-The text to be written.
+The text, and possibly commands, to be written.
@end table
+The sectioning commands such as @code{\chapter} use the
+@code{\addcontentsline} command to store information. This command
+creates lines in the @file{.toc} auxiliary file containing the
+@code{\contentsline} command (@pxref{\addcontentsline}). In contrast,
+the command @code{\addtocontents} puts material directly in that file.
-@node Glossaries
-@section Glossaries
+The @code{\addtocontents} command has an interaction with
+@code{\include} (@pxref{\include & \includeonly}). If you use them at
+the same level, as with
+@code{\addtocontents@{...@}@{...@}\include@{...@}} then lines in the
+table of contents can come out in the wrong order. The solution is to
+move @code{\addtocontents} into the file being included.
-@cindex glossaries
-@findex \makeglossary
-The command @code{\makeglossary} enables creating glossaries.
+@node \nofiles
+@subsection @code{\nofiles}
-@findex \glossary
-@cindex @file{.glo} file
-The command @code{\glossary@{@var{text}@}} writes a glossary entry for
-@var{text} to an auxiliary file with the @file{.glo} extension.
+@findex \nofiles
+
+Synopsis:
-@findex \glossaryentry
-Specifically, what gets written is the command
-@code{\glossaryentry@{@var{text}@}@{@var{pageno}@}}, where
-@var{pageno} is the current @code{\thepage} value.
+@example
+\nofiles
+@end example
+
+Prevent @LaTeX{} from writing any auxiliary files. The only output will
+be the @file{.log} and @file{.pdf} (or @file{.dvi}) files. This command
+must go in the preamble.
+
+Because of the @code{\nofiles} command this example will not produce a
+@file{.toc} file.
+
+@example
+\documentclass@{book@}
+\nofiles
+\begin@{document@}
+\tableofcontents\newpage
+\chapter@{...@}
+ ...
+@end example
-@cindex glossary @r{package}
-The @code{glossary} package on CTAN provides support for fancier
-glossaries.
+@noindent
+@LaTeX{} will not erase any existing auxiliary files, so if you insert
+the @code{\nofiles} command after you have run the file and gotten
+a @file{.toc} then the table of contents page will continue to show
+the old information.
@node Indexes
@@ -12356,61 +17163,608 @@ glossaries.
@cindex indexes
@findex \makeindex
-The command @code{\makeindex} enables creating indexes. Put this in
-the preamble.
-
@findex \index
@cindex @file{.idx} file
-The command @code{\index@{@var{text}@}} writes an index entry for
-@var{text} to an auxiliary file named with the @file{.idx} extension.
-@findex \indexentry
-Specifically, what gets written is the command
-@code{\indexentry@{@var{text}@}@{@var{pageno}@}}, where @var{pageno}
-is the current @code{\thepage} value.
+This document has an index.
+
+@example
+\documentclass@{article@}
+\usepackage@{makeidx@} \makeindex
+ ...
+\begin@{document@}
+ ...
+Recall Wilson's Theorem: \index@{Wilson's Theorem@}
+a number \( n>1 \) is prime if and only if the factorial of \( n-1 \)
+is congruent to \( -1 \) modulo~\( n \).
+ ...
+\printindex
+ ...
+@end example
+
+@noindent
+The @code{\usepackage@{makeidx@}} and @code{\makeindex} in the preamble
+bring in the relevant commands.
+
+Producing an index is a three stage process. First, in the document
+body you declare index entries with the @code{\index} command
+(@pxref{\index}). When you run @LaTeX{}, the @code{\index} writes its
+information to an auxiliary file @file{@var{root-name}.idx}. Next, to
+alphabetize and to do other manipulations you run an external command,
+typically @command{makeindex} or @command{xindy} (@pxref{makeindex}).
+These output a file @file{@var{root-name}.ind}. Finally, you bring the
+information back into your document and typeset it with the
+@code{\printindex} command (@pxref{\printindex}).
+
+@PkgIndex{showidx}
+@PkgIndex{multind}
+There are many packages that apply to indexing commands. The
+@code{showidx} package causes each index entries to be shown in the
+margin on the page where the entry appears. This can help in preparing
+the index. The @code{multind} package supports multiple indexes. See
+also the @TeX{} FAQ entry on this topic,
+@url{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=multind}.
+
+@menu
+* \index:: Declare an index entry.
+* makeindex:: Alphabetize index entries.
+* \printindex:: Put the index here.
+@end menu
+
+
+@node \index
+@subsection @code{\index}
+
+@cindex index entry
+@findex \index
+
+Synopsis:
+
+@example
+\index@{@var{index-entry-string}@}
+@end example
+
+Declare an entry in the index. This command is fragile
+(@pxref{\protect}).
+
+For example, as described in @ref{Indexes}, one way to get an index from
+what's below is to compile the document with @code{pdflatex test}, then
+process the index entries with @code{makeindex test}, and then compile
+again with @code{pdflatex test}.
+
+@example
+W~Ackermann (1896--1962).\index@{Ackermann@}
+ ...
+Ackermann function\index@{Ackermann!function@}
+ ...
+rate of growth\index@{Ackermann!function!growth rate@}
+@end example
+
+@noindent
+All three index entries will get a page number, such as @samp{Ackermann,
+22}. @LaTeX{} will format the second as a subitem of the first, on the
+line below it and indented, and the third as a subitem of the second.
+Three levels deep is as far as you can nest subentries. (If you add
+@code{\index@{Ackermann!function!growth rate!comparison@}} then
+@command{makeindex} says @samp{Scanning input file test.idx....done (4
+entries accepted, 1 rejected)} and nothing appears in the index).
+
+If you enter a second @code{\index} with the same
+@var{index-entry-string} then you will get a single index entry with two
+page numbers (unless they happen to fall on the same page). Thus,
+adding @code{as for Ackermann.\index@{Ackermann@}} later in the same
+document as above will give an index entry like @samp{Ackermann, 22,
+151}. Also, you can enter the index entries in any order, so for
+instance @code{\index@{Ackermann!function@}} could come before
+@code{\index@{Ackermann@}}.
+
+@cindex index, page range
+Get a page range in the output, like @samp{Hilbert, 23--27}, as here.
+
+@example
+W~Ackermann (1896--1962).\index@{Ackermann@}
+ ...
+D~Hilbert (1862--1943)\index@{Ackermann!Hilbert\(@}
+ ...
+disapproved of his marriage.\index@{Ackermann!Hilbert\)@}
+@end example
+
+@noindent
+If the beginning and ending of the page range are equal then the system
+just gives a single page entry, not a range.
+
+If you index subentries but not a main entry, as with
+@code{\index@{Jones!program@}} and @code{\index@{Jones!results@}}, then
+the output is the item @samp{Jones} with no comma or page number,
+followed by two subitems, like @samp{program, 50} and @samp{results,
+51}.
@cindex `see' and `see also' index entries
@cindex index entries, `see' and `see also'
-To generate a index entry for `bar' that says `See foo', use a
-vertical bar: @code{\index@{bar|see@{foo@}@}}. Use @code{seealso}
-instead of @code{see} to make a `See also' entry.
-
@findex \seename
@findex \alsoname
-The text `See' is defined by the macro @code{\seename}, and `See also'
-by the macro @code{\alsoname}. These can be redefined for other
-languages.
+@PkgIndex{babel} @PkgIndex{polyglossia}
+
+Generate a index entry that says @samp{See} by using a vertical bar
+character: @code{\index@{Ackermann!function|see@{P\'eter's
+function@}@}}. You can instead get @samp{See also} with @code{seealso}.
+(The text @samp{See} is defined by @code{\seename}, and @samp{See also}
+by @code{\alsoname}. You can redefine these either by using an
+internationalization package such as @file{babel} or @file{polyglossia},
+or directly as with @code{\renewcommand@{\alsoname@}[1]@{Also see
+#1@}}.)
+
+The @samp{See} feature is part of a more general functionality. After
+the vertical bar you can put the name of a one-input command, as in
+@code{\index@{group|textit@}} (note the missing backslash on the
+@code{\textit} command) and the system will apply that command to the
+page number, here giving something like @code{\textit@{7@}}. You can
+define your own one-input commands, such as
+@code{\newcommand@{\definedpage@}[1]@{@{\color@{blue@}#1@}@}} and then
+@code{\index@{Ackermann!function|definedpage@}} will give a blue page
+number (@pxref{Color}). Another, less practical, example is this,
+
+@c credit Ian Thompson https://tex.stackexchange.com/a/272572/121234
+@example
+\newcommand\indexownpage[1]@{#1, \thepage@}
+ ... Epimenides.\index@{self-reference|indexownpage@}
+@end example
+
+@noindent
+which creates an entry citing the page number of its own index listing.
+
+The two functions just described combine, as here
+@example
+\index@{Ackermann!function|(definedpage@}
+ ...
+\index@{Ackermann!function|)@}
+@end example
+
+@noindent
+which outputs an index entry like @samp{function, 23--27} where the page
+number range is in blue.
+
+Consider an index entry such as @samp{@BES{03B1,\alpha}-ring}. Entering
+it as @code{$\alpha$-ring} will cause it to be alphabetized according to
+the dollar sign. You can instead enter it using an at-sign, as
+@code{\index@{alpha-ring@@$\alpha$-ring@}}. If you specify an entry
+with an at-sign separating two strings, @code{@var{pos}@@@var{text}},
+then @var{pos} gives the alphabetical position of the entry while
+@var{text} produces the text of the entry. Another example is that
+@code{\index@{Saint Michael's College@@SMC@}} produces an index entry
+@samp{SMC} alphabetized into a different location than its spelling
+would naturally give it.
+
+To put a @code{!}, or @code{@@}, or @code{|} character in an index
+entry, preceding it with a double quote, @code{"}. (The double quote
+gets deleted before alphabetization.)
+
+@PkgIndex{index}
+A number of packages on CTAN have additional functionality beyond that
+provided by @file{makeidx}. One is @file{index}, which allows for
+multiple indices and contains a command
+@code{\index*@{@var{index-entry-string}@}} that prints the
+@var{index-entry-string} as well as indexing it.
+
+@findex \indexentry
+@cindex idx file
+The @code{\index} command writes the indexing information to the file
+@file{@var{root-name}.idx} file. Specifically, it writes text of the
+command
+@code{\indexentry@{@var{index-entry-string}@}@{@var{page-num}@}}, where
+where @var{page-num} is the value of the @code{\thepage} counter. On
+occasion, when the @code{\printindex} command is confused, you have to
+delete this file to start with a fresh slate.
+
+If you omit the closing brace of an @code{\index} command then you get a
+message like this.
+
+@example
+Runaway argument? @{Ackermann!function
+! Paragraph ended before \@@wrindex was complete.
+@end example
+
+
+@node makeindex
+@subsection @command{makeindex}
+
+@cindex index, processing
+@findex makeindex
@cindex @command{makeindex} program
-@cindex @command{xindy} program
@cindex @file{.ind} file
-The generated @file{.idx} file is then sorted with an external
-command, usually either @command{makeindex}
-(@url{http://mirror.ctan.org/indexing/makeindex}) or (the
-multi-lingual) @command{xindy} (@url{http://xindy.sourceforge.net}).
-This results in a @file{.ind} file, which can then be read to typeset
-the index.
+@cindex @file{.idx} file
-@findex \printindex
-@PkgIndex{makeidx}
-The index is usually generated with the @code{\printindex} command.
-This is defined in the @code{makeidx} package, so
-@code{\usepackage@{makeidx@}} needs to be in the preamble.
+Synopsis, one of:
+
+@example
+makeindex @var{filename}
+makeindex -s @var{style-file} @var{filename}
+makeindex @var{options} @var{filename0} ...
+@end example
+
+Sort, and otherwise process, the index information in the auxiliary file
+@var{filename}. This is a command line program. It takes one or more
+raw index files, @file{@var{filename}.idx} files, and produces the
+actual index file, the @file{@var{filename}.ind} file that is input by
+@code{\printindex} (@pxref{\printindex}).
+
+@cindex @file{.isty} file
+@findex index, style file
+@findex makeindex, style file
+The first form of the command suffices for many uses. The second allows
+you to format the index by using an @dfn{index style file}, a
+@file{.isty} file. The third form is the most general; see the full
+documentation on CTAN.
+This is a simple @file{.isty} file.
+
+@example
+% book.isty
+% $ makeindex -s book.isty -p odd book.idx
+% creates the index as book.ind, starting on an odd page.
+preamble
+"\\pagestyle@{empty@}
+\\small
+\\begin@{theindex@}
+\\thispagestyle@{empty@}"
+
+postamble
+"\n
+\\end@{theindex@}"
+@end example
+
+The description here covers only some of the index formatting
+possibilities in @var{style-file}. For a full list see the documentation
+on CTAN.
+
+A style file consists of a list of pairs: @var{specifier} and
+@var{attribute}. These can appear in the file in any order. All of the
+@var{attributes} are strings, except where noted. Strings are
+surrounded with double quotes, @code{"}, and the maximum length of a
+string is 144 characters. The @code{\n} is for a newline and @code{\t}
+is for a tab. Backslashes are escaped with another backslash,
+@code{\\}. If a line begins with a percent sign, @code{%}, then it is a
+comment.
+
+@ftable @code
+@anchor{makeindex preamble}
+@item preamble
+Preamble of the output file. Defines the context in which the index is
+formatted. Default: @code{"\\begin@{theindex@}\n"}.
+
+@anchor{makeindex postamble}
+@item postamble
+Postamble of the output file. Default: @code{"\n\n\\end@{theindex@}\n"}.
+
+@anchor{makeindex group skip}
+@item group_skip
@findex \indexspace
-The rubber length @code{\indexspace} is inserted before each new
-letter in the printed index; its default value is @samp{10pt plus5pt
-minus3pt}.
+Traditionally index items are broken into groups, typically a group for
+entries starting with @samp{a}, etc. This specifier gives what is
+inserted when a new group begins. Default: @code{"\n\n \\indexspace\n"}
+(@code{\indexspace} is a rubber length with default value @code{10pt
+plus5pt minus3pt}).
+
+@anchor{makeindex letheadflag}
+@item lethead_flag
+An integer. It governs what is inserted for a new group or letter. If
+it is 0 (which is the default) then other than @code{group_skip} nothing
+will be inserted before the group. If it is is positive then at a new
+letter the @code{lethead_prefix} and @code{lethead_suffix} will be
+inserted, with that letter in uppercase between them. If it is negative
+then what will be inserted is the letter in lowercase. The default
+is@tie{}0.
+
+@anchor{makeindex lethead prefix}
+@item lethead_prefix
+If a new group begins with a different letter then this is the prefix
+inserted before the new letter header. Default: @code{""}
+
+@anchor{makeindex lethead suffix}
+@item lethead_suffix
+If a group begins with a different letter then this is the suffix
+inserted after the new letter header. Default: @code{""}.
+
+@anchor{makeindex item 0}
+@item item_0
+What is put between two level@tie{}0 items. Default: @code{"\n \\item
+"}.
+
+@anchor{makeindex item 1}
+@item item_1
+Put between two level@tie{}1 items. Default: @code{"\n \\subitem "}.
+
+@anchor{makeindex item 2}
+@item item_2
+put between two level@tie{}2 items. Default: @code{"\n \\subsubitem "}.
+
+@anchor{makeindex item 01}
+@item item_01
+What is put between a level@tie{}0 item and a level@tie{}1 item.
+Default: @code{"\n \\subitem "}.
+
+@anchor{makeindex item x1}
+@item item_x1
+What is put between a level@tie{}0 item and a level@tie{}1 item in the
+case that the level@tie{}0 item doesn't have any page numbers (as in
+@code{\index@{aaa|see@{bbb@}@}}). Default: @code{"\n \\subitem "}.
+
+@anchor{makeindex item 12}
+@item item_12
+What is put between a level@tie{}1 item and a level@tie{}2 item.
+Default: @code{"\n \\subsubitem "}.
+
+@anchor{makeindex item x2}
+@item item_x2
+What is put between a level@tie{}1 item and a level@tie{}2 item, if the
+level@tie{}1 item doesn't have page numbers. Default: @code{"\n
+\\subsubitem "}.
+
+@anchor{makeindex delim 0}
+@item delim_0
+Delimiter put between a level@tie{}0 key and its first page
+number. Default: a comma followed by a blank, @code{", "}.
+
+@anchor{makeindex delim 1}
+@item delim_1
+Delimiter put between a level@tie{}1 key and its first page
+number. Default: a comma followed by a blank, @code{", "}.
+
+@anchor{makeindex delim 2}
+@item delim_2
+Delimiter between a level@tie{}2 key and its first page number. Default:
+a comma followed by a blank, @code{", "}.
+
+@anchor{makeindex delim n}
+@item delim_n
+Delimiter between two page numbers for the same key (at any
+level). Default: a comma followed by a blank, @code{", "}.
+
+@anchor{makeindex delim r}
+@item delim_r
+What is put between the starting and ending page numbers of a range.
+Default: @code{"--"}.
+
+@anchor{makeindex line max}
+@item line_max
+An integer. Maximum length of an index entry's line in the output,
+beyond which the line wraps. Default: @code{72}.
+
+@anchor{makeindex indent space}
+@item indent_space
+What is inserted at the start of a wrapped line. Default:
+@code{"\t\t"}.
+
+@anchor{makeindex indent length}
+@item indent_length
+A number. The length of the wrapped line indentation. The default
+@code{indent_space} is two tabs and each tab is eight spaces so the
+default here is @code{16}.
+
+@anchor{makeindex page precedence}
+@item page_precedence
+A document may have pages numbered in different ways. For example, a
+book may have front matter pages numbered in lowercase roman while main
+matter pages are in arabic. This string specifies the order in which
+they will appear in the index. The @command{makeindex} command supports
+five different types of numerals: lowercase roman @code{r}, and numeric
+or arabic @code{n}, and lowercase alphabetic @code{a}, and uppercase
+roman @code{R}, and uppercase alphabetic @code{A}. Default:
+@code{"rnaRA"}.
-@PkgIndex{showidx}
-The @code{showidx} package causes each index entries to be shown in
-the margin on the page where the entry appears. This can help in
-preparing the index.
+@end ftable
-@PkgIndex{multind}
-The @code{multind} package supports multiple indexes. See also the
-@TeX{} FAQ entry on this topic,
-@url{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=multind}.
+@findex xindy
+@cindex @command{xindy} program
+There are a number of other programs that do the job @command{makeindex}
+does. One is @command{xindy}, which does internationalization and can
+process indexes for documents marked up using @LaTeX{} and a number of
+other languages. It is is highly configurable, both in markup terms and
+in terms of the collating order of the text. See the documentation on
+CTAN.
+
+
+@node \printindex
+@subsection @command{\printindex}
+
+@cindex index, printing
+@findex \printindex
+
+Synopsis:
+
+@example
+\printindex
+@end example
+
+@findex \printindex
+Place the index into the output.
+
+To get an index you must first include
+@code{\usepackage@{makeidx@}\makeindex} in the document preamble and
+compile the document, then run the system command @command{makeindex},
+and then compile the document again. @xref{Indexes} for further
+discussion and an example of the use of @code{\printindex}.
+
+
+@node Glossaries
+@section Glossaries
+
+@cindex glossary
+@cindex glossaries
+@cindex acronyms, list of
+@findex \makeglossary
+@findex \printglossaries
+
+Synopsis:
+
+@example
+\usepackage@{glossaries@} \makeglossaries
+ ...
+\newglossaryentry@{@var{label}@}@{@var{settings}@}
+ ...
+\gls@{@var{label}@}.
+ ...
+\printglossaries
+@end example
+
+The @file{glossaries} package allows you to make glossaries, including
+multiple glossaries, as well as lists of acronyms.
+
+To get the output from this example, compile the document (for instance
+with @code{pdflatex filename}), then run the command line command
+@code{makeglossaries filename}, and then compile the document again.
+
+@example
+\documentclass@{...@}
+\usepackage@{glossaries@} \makeglossaries
+\newglossaryentry@{tm@}@{%
+ name=@{Turing machine@},
+ description=@{A model of a machine that computes. The model is simple
+ but can compute anything any existing device can compute.
+ It is the standard model used in Computer Science.@},
+ @}
+\begin@{document@}
+Everything begins with the definition of a \gls@{tm@}.
+ ...
+\printglossaries
+\end@{document@}
+@end example
+
+@noindent
+That gives two things. In the main text it outputs @samp{... definition
+of a Turing machine}. In addition, in a separate sectional unit headed
+@samp{Glossary} there appears a description list. In boldface it says
+@samp{Turing machine} and the rest of the item says in normal type
+@samp{A model of a machine @dots{} Computer Science}.
+
+@findex \makeglossary
+@findex \printglossaries
+@cindex @file{.glo} file
+The command @code{\makeglossary} opens the file that will contain the
+entry information, @file{@var{root-file}.glo}. Put the
+@code{\printglossaries} command where you want the glossaries to appear
+in your document.
+
+The @file{glossaries} package is very powerful. For instance, besides
+the commands @code{\newglossaryentry} and @code{\gls}, there are similar
+commands for a list of acronyms. See the package documentations on
+CTAN.
+
+@menu
+* \newglossaryentry:: Declare the content of a glossary entry.
+* \gls:: Give a page reference for a glossary entry.
+@end menu
+
+
+@node \newglossaryentry
+@subsection @code{\newglossaryentry}
+
+@cindex glossary, entries
+@findex \newglossaryentry
+
+Synopsis, one of:
+
+@example
+\newglossaryentry@{@var{label}@}
+@{
+ name=@{@var{name}@},
+ description=@{@var{description}@},
+ @var{other options}, ...
+@}
+@end example
+
+or
+
+@example
+\longnewglossaryentry@{@var{label}@}
+@{
+ name=@{@var{name}@},
+ @var{other options} ...,
+@}
+@{@var{description}@}
+@end example
+
+Declare a new entry for a glossary. The @var{label} must be unique for
+the document. The settings associated with the label are pairs:
+@code{@var{key}=@var{value}}.
+
+This puts the blackboard bold symbol for the real numbers @BES{211D,} in the
+glossary.
+
+@example
+\newglossaryentry@{R@}
+@{
+ name=@{\ensuremath@{\mathbb@{R@}@}@},
+ description=@{the real numbers@},
+@}
+@end example
+
+Use the second command form if the @var{description} spans more than one
+paragraph.
+
+For a full list of @var{key}s see the package documentation on CTAN but
+here are a few.
+
+@ftable @code
+@item name
+(Required.) The word, phrase, or symbol that you are defining.
+
+@item description
+(Required.) The description that will appear in the glossary.
+If this has more than one paragraph then you must use the second command
+form given in the synopsis.
+
+@item plural
+The plural form of @var{name}. Refer to the plural form using
+@code{\glspl} or @code{\Glspl} (@pxref{\gls}).
+
+@item sort
+How to place this entry in the list of entries that the glossary holds.
+
+@item symbol
+A symbol, such as a mathematical symbol, besides the name.
+
+@end ftable
+
+
+@node \gls
+@subsection @code{\gls}
+
+@cindex glossary, entry reference
+@findex \gls
+
+Synopsis, one of:
+
+@example
+\gls@{@var{label}@}
+\glspl@{@var{label}@}
+\Gls@{@var{label}@}
+\Glspl@{@var{label}@}
+@end example
+
+Refer to a glossary entry. The entries are declared with
+@code{\newglossaryentry} (@pxref{\newglossaryentry}).
+
+This
+
+@example
+\newglossaryentry@{N@}@{%
+ name=@{the natural numbers@},
+ description=@{The numbers $0$, $1$, $2$, $\ldots$\@@@},
+ symbol=@{\ensuremath@{\mathbb@{N@}@}@},
+ @}
+ ...
+Consider \gls@{N@}.
+@end example
+
+@noindent
+gives the output @samp{Consider the natural numbers}.
+
+The second command form @code{\glspl@{@var{label}@}} produces the plural
+of @var{name} (by default it tries adding an @samp{s}). The third form
+capitalizes the first letter of @var{name}, as does the fourth form,
+which also takes the plural.
@node Letters
@@ -12423,7 +17777,7 @@ Synopsis:
@example
\documentclass@{letter@}
-\address@{@var{sender address}@}
+\address@{@var{senders address}@} % return address
\signature@{@var{sender name}@}
\begin@{document@}
\begin@{letter@}@{@var{recipient address}@}
@@ -12431,7 +17785,7 @@ Synopsis:
@var{letter body}
\closing@{@var{closing text}@}
\end@{letter@}
-... more letters ...
+ ...
\end@{document@}
@end example
@@ -12439,12 +17793,11 @@ Produce one or more letters.
Each letter is in a separate @code{letter} environment, whose argument
@var{recipient address} often contains multiple lines separated with a
-double backslash@tie{}(@code{\\}). For example, you might have:
+double backslash,@tie{}(@code{\\}). For example, you might have:
@example
- \begin@{letter@}@{Mr. Joe Smith \\
- 2345 Princess St. \\
- Edinburgh, EH1 1AA@}
+ \begin@{letter@}@{Ninon de l'Enclos \\
+ l'h\^otel Sagonne@}
...
\end@{letter@}
@end example
@@ -12458,15 +17811,15 @@ preamble. As with the recipient address, often @var{sender address}
contains multiple lines separated by a double
backslash@tie{}(@code{\\}). @LaTeX{} will put the @var{sender name}
under the closing, after a vertical space for the traditional
-hand-written signature; it also can contain multiple lines.
+hand-written signature.
-Each @code{letter} environment body begins with a required @code{\opening} command
-such as @code{\opening@{Dear Madam or Sir:@}}. The @var{letter body}
-text is ordinary @LaTeX{} so it can contain everything from
-enumerated lists to displayed math, except that commands such as
-@code{\chapter} that make no sense in a letter are turned off. Each
-@code{letter} environment body typically ends with a @code{\closing}
-command such as @code{\closing@{Yours,@}}.
+Each @code{letter} environment body begins with a required
+@code{\opening} command such as @code{\opening@{Dear Madam or Sir:@}}.
+The @var{letter body} text is ordinary @LaTeX{} so it can contain
+everything from enumerated lists to displayed math, except that commands
+such as @code{\chapter} that make no sense in a letter are turned off.
+Each @code{letter} environment body typically ends with a
+@code{\closing} command such as @code{\closing@{Yours,@}}.
@findex \\ @r{for letters}
Additional material may come after the @code{\closing}. You can say who
@@ -12474,13 +17827,13 @@ is receiving a copy of the letter with a command like @code{\cc@{the
Boss \\ the Boss's Boss@}}. There's a similar @code{\encl} command for
a list of enclosures. And, you can add a postscript with @code{\ps}.
-@LaTeX{}'s default is to indent the signature and the @code{\closing}
-above it by a length of @code{\longindentation}. By default this is
+@LaTeX{}'s default is to indent the sender name and the closing above it
+by a length of @code{\longindentation}. By default this is
@code{0.5\textwidth}. To make them flush left, put
@code{\setlength@{\longindentation@}@{0em@}} in your preamble.
To set a fixed date use something like
-@code{\renewcommand@{\today@}@{2015-Oct-12@}}. If put in your preamble
+@code{\renewcommand@{\today@}@{1958-Oct-12@}}. If put in your preamble
then it will apply to all the letters.
This example shows only one @code{letter} environment. The three lines
@@ -12515,7 +17868,6 @@ These commands are used with the @code{letter} class.
* \opening:: Saying hello.
* \ps:: Adding a postscript.
* \signature:: Sender's signature.
-@c ?Not user-level? * \stopbreaks and \startbreaks:: Disallow and allow page breaks.
* \telephone:: Sender's phone number.
@end menu
@@ -12531,19 +17883,18 @@ Synopsis:
\address@{@var{senders address}@}
@end example
-Specifies the return address as it appears on the letter and on the
+Specify the return address, as it appears on the letter and on the
envelope. Separate multiple lines in @var{senders address} with a
-double backslash@tie{}@code{\\}.
+double backslash,@tie{}@code{\\}.
Because it can apply to multiple letters this declaration is often put
in the preamble. However, it can go anywhere, including inside an
individual @code{letter} environment.
-This command is optional: without the @code{\address} declaration the
-letter is formatted with some blank space on top, for copying onto
-pre-printed letterhead paper. (@xref{Overview}, for details on your
-local implementation.) With the @code{\address} declaration, it is
-formatted as a personal letter.
+This command is optional: if you do not use it then the letter is
+formatted with some blank space on top, for copying onto pre-printed
+letterhead paper. If you do use the @code{\address} declaration then it
+is formatted as a personal letter.
Here is an example.
@@ -12562,14 +17913,14 @@ Here is an example.
Synopsis:
@example
-\cc@{@var{first name} \\
+\cc@{@var{name0} \\
... @}
@end example
Produce a list of names to which copies of the letter were sent. This
command is optional. If it appears then typically it comes after
-@code{\closing}. Separate multiple lines with a double
-backslash@tie{}@code{\\}, as in:
+@code{\closing}. Put the names on different lines by separating them
+with a double backslash, @code{\\}, as in:
@example
\cc@{President \\
@@ -12590,8 +17941,8 @@ Synopsis:
\closing@{@var{text}@}
@end example
-Usually at the end of a letter, above the handwritten signature, there
-is a @code{\closing} (although this command is optional). For example,
+Produce the letter's closing. This is optional, but usual. It appears
+at the end of a letter, above a handwritten signature. For example:
@example
\closing@{Regards,@}
@@ -12613,11 +17964,11 @@ Synopsis:
Produce a list of things included with the letter. This command is
optional; when it is used, it typically is put after @code{\closing}.
-Separate multiple lines with a double backslash@tie{}@code{\\}.
+Separate multiple lines with a double backslash, @code{\\}.
@example
\encl@{License \\
- Passport @}
+ Passport@}
@end example
@@ -12632,7 +17983,7 @@ Synopsis:
\location@{@var{text}@}
@end example
-The @var{text} appears centered at the bottom of the each page. It only
+The @var{text} appears centered at the bottom of the page. It only
appears if the page style is @code{firstpage}.
@@ -12644,26 +17995,64 @@ appears if the page style is @code{firstpage}.
Synopsis:
@example
-\makelabels
+\makelabels % in preamble
@end example
-Create a sheet of address labels from the recipient addresses, one for
-each letter. This sheet will be output before the letters, with the idea
-that you can copy it to a sheet of peel-off labels. This command goes
-in the preamble.
+Optional, for a document that contains @code{letter} environments. If
+you just put @code{\makelabels} in the preamble then at the end of the
+document you will get a sheet with labels for all the recipients, one
+for each letter environment, that you can copy to a sheet of peel-off
+address labels.
Customize the labels by redefining the commands @code{\startlabels},
-@code{\mlabel}, and @code{\returnaddress} in the preamble. The command
-@code{\startlabels} sets the width, height, number of columns, etc., of
-the page onto which the labels are printed. The command
-@code{\mlabel@{@var{sender address}@}@{@var{recipient address}@}}
-produces the two labels (or one, if you choose to ignore the @var{sender
-address}). The @var{sender address} is the value returned by the macro
-@code{\returnaddress} while @var{recipient address} is the value passed
-in the argument to the @code{letter} environment. By default
-@code{\mlabel} ignores the first argument, the @var{sender address}.
-
-@c xxx TODO, align on latex2e-fr.texi, see https://mail.gna.org/public/latexrefman-discuss/2015-10/msg00000.html
+@code{\mlabel}, and @code{\returnaddress} (and perhaps @code{\name}) in
+the preamble. The command @code{\startlabels} sets the width, height,
+number of columns, etc., of the page onto which the labels are printed.
+The command @code{\mlabel@{@var{return address}@}@{@var{recipient
+address}@}} produces the two labels (or one, if you choose to ignore the
+@var{return address}) for each letter environment. The first argument,
+@var{return address}, is the value returned by the macro
+@code{\returnaddress}. The second argument, @var{recipient address}, is
+the value passed in the argument to the @code{letter} environment. By
+default @code{\mlabel} ignores the first argument, the @var{return
+address}, causing the default behavior described in the prior paragraph.
+
+This illustrates customization. Its output includes a page with two
+columns having two labels each.
+
+@example
+\documentclass@{letter@}
+\renewcommand*@{\returnaddress@}@{Fred McGuilicuddy \\
+ Oshkosh, Mineola 12305@}
+\newcommand*\originalMlabel@{@}
+\let\originalMlabel\mlabel
+\def\mlabel#1#2@{\originalMlabel@{@}@{#1@}\originalMlabel@{@}@{#2@}@}
+\makelabels
+ ...
+\begin@{document@}
+\begin@{letter@}@{A Einstein \\
+ 112 Mercer Street \\
+ Princeton, New Jersey, USA 08540@}
+ ...
+\end@{letter@}
+\begin@{letter@}@{K G\"odel \\
+ 145 Linden Lane \\
+ Princeton, New Jersey, USA 08540@}
+ ...
+\end@{letter@}
+\end@{document@}
+@end example
+
+@noindent
+The first column contains the return address twice. The second column
+contains the address for each recipient.
+
+@PkgIndex{envlab}
+The package @code{envlab} makes formatting the labels easier, with
+standard sizes already provided. The preamble lines
+@code{\usepackage[personalenvelope]@{envlab@}} and @code{\makelabels}
+are all that you need to print envelopes.
+
@node \name
@section @code{\name}
@@ -12676,8 +18065,8 @@ Synopsis:
\name@{@var{name}@}
@end example
-Sender's name, used for printing on the envelope together with the
-return address.
+Optional. Sender's name, used for printing on the envelope together
+with the return address.
@node \opening
@@ -12689,12 +18078,11 @@ return address.
Synopsis:
@example
-\opening@{@var{text}@}
+\opening@{@var{salutation}@}
@end example
-This command is required. It starts a letter, following the
-@code{\begin@{letter@}@{...@}}. The mandatory argument @var{text} is the
-text that starts your letter. For instance:
+Required. Follows the @code{\begin@{letter@}@{...@}}. The argument
+@var{salutation} is mandatory. For instance:
@example
\opening@{Dear John:@}
@@ -12735,10 +18123,10 @@ Synopsis:
The sender's name. This command is optional, although its inclusion is
usual.
-The argument text appears at the end of the letter, after the closing
-and after a vertical space for the traditional hand-written
+The argument text appears at the end of the letter, after the closing.
+@LaTeX{} leaves some vertical space for a handwritten
signature. Separate multiple lines with a double
-backslash@tie{}@code{\\}. For example:
+backslash,@tie{}@code{\\}. For example:
@example
\signature@{J Fred Muggs \\
@@ -12747,16 +18135,24 @@ backslash@tie{}@code{\\}. For example:
@LaTeX{}'s default for the vertical space from the @code{\closing} text
down to the @code{\signature} text is @code{6\medskipamount}, which is
-six times 0.7@dmn{em}.
+six times @code{\medskipamount} (where @code{\medskipamount} is equal to
+a @code{\parskip}, which in turn is defined by default here to
+0.7@dmn{em}).
This command is usually in the preamble, to apply to all the letters in
the document. To have it apply to one letter only, put it inside a
@code{letter} environment and before the @code{\closing}.
-You can include a graphic in the signature, for instance with
-@code{\signature@{\vspace@{-6\medskipamount@}\includegraphics@{sig.png@}\\
-My name@}} (this requires writing @code{\usepackage@{graphicx@}} in the
-preamble).
+You can include a graphic in the signature as here.
+
+@example
+\signature@{\vspace@{-6\medskipamount@}\includegraphics@{sig.png@}\\
+ My name@}
+@end example
+
+@noindent
+For this you must put @code{\usepackage@{graphicx@}} in the preamble
+(@pxref{Graphics}).
@c I think this is not a user-level command; it is used to keep from breaking
@@ -12807,27 +18203,69 @@ page.
@node \typein
-@section @code{\typein[@var{cmd}]@{@var{msg}@}}
+@section @code{\typein}
@findex \typein
-Synopsis:
+Synopsis, one of:
+
+@example
+\typein@{@var{prompt-msg}@}
+\typein[@var{cmd}]@{@var{prompt-msg}@}
+@end example
+
+Print @var{prompt-msg} on the terminal and cause @LaTeX{} to stop and
+wait for you to type a line of input. This line of input ends when you
+hit the return key.
+
+For example, this
+
+@example
+As long as I live I shall never forget \typein@{Enter student name:@}
+@end example
+
+@noindent
+coupled with this command line interaction
@example
-\typein[\@var{cmd}]@{@var{msg}@}
+Enter student name:
+
+\@@typein=Aphra Behn
+@end example
+
+@noindent
+gives the output @samp{... never forget Aphra Behn}.
+
+The first command version, @code{\typein@{@var{prompt-msg}@}}, causes
+the input you typed to be processed as if it had been included in the
+input file in place of the @code{\typein} command.
+
+In the second command version the optional argument @code{@var{cmd}}
+argument must be a command name --- it must begin with a backslash, \.
+This command name is then defined or redefined to be the input that you
+typed. For example, this
+
+@example
+\typein[\student]@{Enter student name:@}
+\typeout@{Recommendation for \student .@}
+@end example
+
+@noindent
+gives this output on the command line,
+
+@example
+Enter student name:
+
+\student=John Dee
+Recommendation for John Dee.
@end example
-@code{\typein} prints @var{msg} on the terminal and causes @LaTeX{} to
-stop and wait for you to type a line of input, ending with return. If
-the optional @code{\@var{cmd}} argument is omitted, the typed input is
-processed as if it had been included in the input file in place of the
-@code{\typein} command. If the @code{\@var{cmd}} argument is present, it
-must be a command name. This command name is then defined or
-redefined to be the typed input.
+@noindent
+where the user has entered @samp{John Dee.}
@node \typeout
-@section @code{\typeout@{@var{msg}@}}
+@section @code{\typeout}
@findex \typeout
@@ -12837,16 +18275,37 @@ Synopsis:
\typeout@{@var{msg}@}
@end example
-Prints @code{msg} on the terminal and in the @code{log} file.
-Commands in @code{msg} that are defined with @code{\newcommand} or
+Print @code{msg} on the terminal and in the @code{log} file.
+
+This
+
+@example
+\newcommand@{\student@}@{John Dee@}
+\typeout@{Recommendation for \student .@}
+@end example
+
+@noindent
+outputs @samp{Recommendation for John Dee}. Like what happens here with
+@code{\student}, commands that are defined with @code{\newcommand} or
@code{\renewcommand} (among others) are replaced by their definitions
before being printed.
@LaTeX{}'s usual rules for treating multiple spaces as a single space
-and ignoring spaces after a command name apply to @code{msg}. A
-@code{\space} command in @code{msg} causes a single space to be
-printed, independent of surrounding spaces. A @code{^^J} in
-@code{msg} prints a newline.
+and ignoring spaces after a command name apply to @code{msg}. As above,
+use the command @code{\space} to get a single space, independent of
+surrounding spaces. Use @code{^^J} to get a newline. Get a percent
+character with @code{\csname @@percentchar\endcsname}.
+
+This command can be useful for simple debugging, as here:
+
+@example
+\newlength@{\jhlength@}
+\setlength@{\jhlength@}@{5pt@}
+\typeout@{The length is \the\jhlength.@}
+@end example
+
+@noindent
+produces on the command line @samp{The length is 5.0pt}.
@node Command line
@@ -12854,31 +18313,281 @@ printed, independent of surrounding spaces. A @code{^^J} in
@cindex command line
-@findex .tex, @r{default extension}
-The input file specification indicates the file to be formatted;
-@TeX{} uses @file{.tex} as a default file extension. If you omit the
-input file entirely, @TeX{} accepts input from the terminal. You can
-also specify arbitrary @LaTeX{} input by starting with a backslash.
-For example, this processes @file{foo.tex} without pausing after every
-error:
+Synopsis (from a terminal command line):
+
+@example
+pdflatex @var{options} @var{argument}
+@end example
+
+Run @LaTeX{} on @var{argument}. In place of @command{pdflatex} you can
+also use @command{xelatex}, or @code{lualatex}, or @code{dviluatex}, or
+@code{latex}.
+
+For example, this will run @LaTeX{} on the file @file{thesis.tex},
+creating the output @file{thesis.pdf}.
@example
-latex '\nonstopmode\input foo.tex'
+pdflatex thesis
@end example
+@noindent
+@findex .tex, @r{default extension}
+Note that @file{.tex} is the default file extension.
+
+pdf@TeX{} is a development of the original @TeX{} program, as are
+Xe@TeX{} and Lua@TeX{} (@pxref{@TeX{} engines}). They are completely
+backward compatible. But the original program had a custom output
+format, DVI, while the newer ones can output directly to PDF. This
+allows them to take advantage of the extra features in PDF such as
+hyperlinks, support for modern image formats such as JPG and PNG, and
+ubiquitous viewing programs. In short, if you run @command{pdflatex} or
+@command{xelatex} or @command{lualatex} then you will by default get PDF
+and have access to all its modern features. If you run @command{latex},
+or @code{dvilualatex}, then you will get DVI. The description here
+assumes pdf@LaTeX{}.
+
+@xref{Command line options}, for a selection of the most useful
+command line options. As to @var{argument}, the usual case is that it
+does not begin with a backslash, so the system takes it to be the name
+of a file and it compiles that file. If @var{argument} begins with a
+backslash then the system will interpret it as a line of @LaTeX{}
+input, which can be used for special effects (@pxref{Command line
+input}).
+
+If you gave no arguments or options then @command{pdflatex} prompts for
+input from the terminal. You can escape from this by entering
+@code{<control>-D}.
+
+If @LaTeX{} finds an error in your document then by default it stops and
+asks you about it. @xref{Recovering from errors} for an outline of what
+to do.
+
+@menu
+* Command line options:: Read text from the terminal.
+* Command line input:: Write text to the terminal.
+* Recovering from errors:: When something goes wrong.
+@end menu
+
+
+@node Command line options
+@section Command line options
+
+@cindex options, command line
+
+These are the command-line options relevant to ordinary document
+authoring. For a full list, try running @samp{latex --help} from the
+command line.
+
+With many implementations you can specify command line options by
+prefixing them with @samp{-} or @samp{--}. This is the case for
+both @TeX{} Live (and Mac@TeX{}) and MiK@TeX{}. We will use both
+conventions interchangeably.
+
+@table @code
+@findex --version @r{command-line option}
+@item -version
+Show the current version, like @samp{pdfTeX 3.14159265-2.6-1.40.16 (TeX
+Live 2015/Debian)} along with a small amount of additional information,
+and exit.
+
@findex --help @r{command-line option}
-With many, but not all, implementations, command-line options can also
-be specified in the usual Unix way, starting with @samp{-} or
-@samp{--}. For a list of those options, try @samp{latex --help}.
+@item -help
+Give a brief usage message that is useful as a prompt and exit.
+
+@findex --interaction @r{command-line option}
+@item -interaction=@var{mode}
+@TeX{} compiles a document in one of four interaction modes:
+@code{batchmode}, @code{nonstopmode}, @code{scrollmode},
+@code{errorstopmode}. In @dfn{errorstop mode} (the default), @TeX{}
+stops at each error and asks for user intervention. In @dfn{batch
+mode} it prints nothing on the terminal, errors are scrolled as if the
+user hit @code{<return>} at every error, and missing files cause the
+job to abort. In @dfn{nonstop mode}, diagnostic message appear on the
+terminal but as in batch mode there is no user interaction. In
+@dfn{scroll mode}, @TeX{} only stops for missing files or keyboard
+input.
+
+For instance, starting @LaTeX{} with this command line
+
+@example
+pdflatex -interaction=batchmode @var{filename}
+@end example
+
+@noindent
+eliminates most terminal output.
+
+@findex --jobname @r{command-line option}
+@item -jobname=@var{string}
+Set the value of @TeX{}'s @code{jobname} to the string. The log file
+and output file will then be named @file{@var{string}.log} and
+@file{@var{string}.pdf}.
+
+When you run @code{@command{pdflatex} @var{options} @var{argument}}, if
+@var{argument} does not start with a backslash then @TeX{} considers it
+the name of a file to input. Otherwise it waits for the first
+@code{\input} instruction and the name of the input file will be the job
+name. This is used to name the log file the output file. This option
+overrides that process and directly specifies the name. @xref{Command
+line input} for an example of its use.
+
+@findex --output-directory @r{command-line option}
+@item -output-directory=@var{directory}
+Write files in the directory @var{directory}. It must already exist.
+
+@findex --shell-escape @r{command-line option}
+@findex --no-shell-escape @r{command-line option}
+@findex --enable-write18 @r{command-line option}
+@findex --disable-write18 @r{command-line option}
+@item shell-escape
+@itemx no-shell-escape
+@itemx enable-write18
+@itemx disable-write18
+Enable or disable @code{\write18@{@var{shell command}@}}. The first two
+options are for with @TeX{} Live or Mac@TeX{} while the second two are
+for MiK@TeX{}.
+
+@PkgIndex{sagetex}
+Sometimes you want to run external system commands from inside a
+@LaTeX{} file. For instance the package @file{sagetex} allows you to
+have the mathematics software system @i{Sage} do calculations or draw
+graphs and then incorporate that output in your document. For this
+@TeX{} provides the @code{\write18} command.
+
+But with this functionality enabled, security issues could happen if you
+compiled a @LaTeX{} file from the Internet. By default @code{\write18}
+is disabled. (More precisely, by default @TeX{} Live, Mac@TeX{}, and
+MiK@TeX{} only allow the execution of a limited number of @TeX{}-related
+programs, which they distribute.)
+
+If you invoke @LaTeX{} with the option @code{no-shell-escape}, and in
+your document you call @code{\write18@{ls -l@}}, then you do not get an
+error but the log file says @samp{runsystem(ls -l)...disabled}.
+
+@findex --halt-on-error @r{command-line option}
+@item -halt-on-error
+Stop processing at the first error.
+
+@findex --file-line-error @r{command-line option}
+@findex --no-file-line-error @r{command-line option}
+@item -file-line-error
+@item -no-file-line-error
+Enable or disable @code{@var{filename}:@var{lineno}:@var{error}}-style
+error messages. These are only available with @TeX{} Live or Mac@TeX{}.
+@end table
+
+
+@node Command line input
+@section Command line input
+
+@cindex input, on command line
+
+As part of the command line invocation @code{pdflatex @var{options}
+@var{argument}} you can specify arbitrary @LaTeX{} input by starting
+@var{argument} with a backslash. This allows you to do some special
+effects.
+
+@PkgIndex{hyperref}
+For example, this file (which uses the @file{hyperref} package for
+hyperlinks) can produce two kinds of output, one for paper and one for a
+PDF.
+
+@example
+\ifdefined\paperversion % in preamble
+\newcommand@{\urlcolor@}@{black@}
+\else
+\newcommand@{\urlcolor@}@{blue@}
+\fi
+\usepackage[colorlinks=true,urlcolor=\urlcolor]@{hyperref@}
+ ...
+\href@{https://www.ctan.org@}@{CTAN@} % in body
+ ...
+@end example
+
+@noindent
+Compiling this document @file{book.tex} with the command line
+@code{pdflatex test} will give the @samp{CTAN} link in blue. But
+compiling it with @code{pdflatex "\def\paperversion@{@}\input test.tex"}
+has the link in black. (Note the use of double quotes to prevent
+interpretation of the symbols by the command line shell; your system may
+do this differently.)
+
+In a similar way, from the single file @file{main.tex} you can compile
+two different versions.
+
+@c credit Paul Gaborit: https://tex.stackexchange.com/a/220101/121234
+@example
+pdflatex -jobname=students "\def\student@{@}\input@{main@}"
+pdflatex -jobname=teachers "\def\teachers@{@}\input@{main@}"
+@end example
+
+@noindent
+The @code{jobname} option is there because otherwise both files would be
+called @file{main.pdf} and the second would overwrite the first.
+
+A final example. This loads the package @file{graphicx} with the option
+@code{draft}
+
+@c credit Herbert Voss: https://tex.stackexchange.com/a/17236/121234
+@example
+pdflatex -jobname=aa "\RequirePackage[draft]@{graphicx@}\input@{aa.tex@}"
+@end example
+
+@noindent
+so the graphic files are read for their size information but not
+incorporated into the PDF. (The @code{jobname} option is needed because
+otherwise the output file would be @file{graphicx.pdf}, as
+@code{\RequirePackage} does an @code{\input} of its own.)
+
+
+@node Recovering from errors
+@section Recovering from errors
+
+If @LaTeX{} finds an error in your document then it gives you an error
+message and prompts you with a question mark, @code{?}. For instance,
+running @LaTeX{} on this file
+
+@example
+\newcommand@{\NP@}@{\ensuremath@{\textbf@{NP@}@}@}
+The \PN@{@} problem is a million dollar one.
+@end example
+
+@noindent
+causes it show this, and wait for input.
+
+@example
+! Undefined control sequence.
+l.5 The \PN
+ @{@} problem is a million dollar one.
+?
+@end example
+
+@noindent
+The simplest thing is to enter @samp{x} and @code{<return>} and fix the
+typo. You could instead enter @samp{?} and @code{<return>} to see other
+options.
@cindex @samp{*} prompt
@cindex prompt, @samp{*}
@findex \stop
-If @LaTeX{} stops in the middle of the document and gives you a
-@samp{*} prompt, it is waiting for input. You can type @code{\stop}
-(and return) and it will prematurely end the document.
+There are two other error scenarios. The first is that you forgot to
+include the @code{\end@{document@}} or misspelled it. In this case
+@LaTeX{} gives you a @samp{*} prompt. You can get back to the command
+line by typing @code{\stop} and @code{<return>}.
+
+The last scenario is that you mistyped the file name. For instance,
+instead of @code{pdflatex test} you might type @code{pdflatex tste}.
+
+@example
+! I can't find file `tste'.
+<*> tste
+
+(Press Enter to retry, or Control-D to exit)
+Please type another input file name:
+@end example
-@xref{@TeX{} engines}, for other system commands invoking @LaTeX{}.
+@noindent
+The simplest thing is to enter @code{<Contol>} and @samp{d} (holding
+them down at the same time), and just fix the command line.
@node Document templates
@@ -12893,7 +18602,9 @@ be useful. Additional template resources are listed at
@menu
* beamer template::
+* article template::
* book template::
+* Larger book template::
* tugboat template::
@end menu
@@ -12935,11 +18646,39 @@ One web resource for this:
@url{http://robjhyndman.com/hyndsight/beamer/}.
+@node article template
+@section @code{article} template
+
+@cindex template, @code{article}
+
+@verbatim
+\documentclass{article}
+\title{Article Class Template}
+\author{Alex Author}
+
+\begin{document}
+\maketitle
+
+\section{First section}
+Some text.
+
+\subsection{First section, first subsection}
+Additional text.
+
+\section{Second section}
+Some more text.
+\end{document}
+@end verbatim
+
+
@node book template
@section @code{book} template
@cindex template, @code{book}
+This is a straightforward template for a book. See @xref{Larger book
+template} for a more elaborate one.
+
@verbatim
\documentclass{book}
\title{Book Class Template}
@@ -12960,6 +18699,62 @@ The end.
@end verbatim
+@node Larger book template
+@section Larger @code{book} template
+
+@cindex template, @code{book}
+
+This is a more elaborate template for a book. It has
+@code{\frontmatter}, @code{\mainmatter}, and @code{\backmatter} to
+control the typography of the three main areas of a book
+(@pxref{\frontmatter & \mainmatter & \backmatter}). The book has a
+bibliography and an index.
+
+Notable is that it uses @code{\include} and @code{\includeonly}
+(@pxref{Splitting the input}). While you are working on a chapter you
+can comment out all the other chapter entries from the argument to
+@code{\includeonly}. That will speed up compilation without losing any
+information such as cross-references. (Material that does not need to
+come on a new page is brought in with @code{\input} instead of
+@code{\include}. You don't get the cross-reference benefit this way.)
+
+@verbatim
+\documentclass[titlepage]{book}
+\usepackage{makeidx}\makeindex
+
+\title{Book Class Template}
+\author{Alex Author}
+
+\includeonly{%
+ frontcover,
+ preface,
+ chap1,
+ ...
+ }
+\begin{document}
+\frontmatter
+\include{frontcover}
+ % maybe comment out while drafting:
+\maketitle \input{dedication} \input{copyright}
+\tableofcontents
+\include{preface}
+\mainmatter
+\include{chap1}
+...
+\appendix
+\include{appena}
+...
+\backmatter
+\bibliographystyle{apalike}
+\addcontentsline{toc}{chapter}{Bibliography}
+\bibliography
+\addcontentsline{toc}{chapter}{Index}
+\printindex
+\include{backcover}
+\end{document}
+@end verbatim
+
+
@node tugboat template
@section @code{tugboat} template
@@ -13053,16 +18848,13 @@ Email \verb|tugboat@tug.org| if problems or questions.
@end verbatim
-@node Concept Index
-@unnumbered Concept Index
+@node Index
+@unnumbered Index
-@printindex cp
+@c Keep `Command Index' working for ltx-help.el.
+@anchor{Command Index}
-@c The name of the `Command Index' node must NOT be altered for ltx-help.el.
-@node Command Index
-@unnumbered Command Index
-
-@printindex fn
+@printindex cp
@bye